File: uPlotManager.cc

package info (click to toggle)
metview 5.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 44,932 kB
  • sloc: cpp: 211,811; ansic: 33,467; xml: 3,942; sh: 2,942; yacc: 1,183; fortran: 762; lex: 761; perl: 700; python: 340; f90: 236; makefile: 92
file content (131 lines) | stat: -rw-r--r-- 4,195 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/***************************** LICENSE START ***********************************

 Copyright 2012 ECMWF and INPE. This software is distributed under the terms
 of the Apache License version 2.0. In applying this license, ECMWF does not
 waive the privileges and immunities granted to it by virtue of its status as
 an Intergovernmental Organization or submit itself to any jurisdiction.

 ***************************** LICENSE END *************************************/

#include "uPlotManager.hpp"
#include "uPlotService.hpp"
#include <stdlib.h>
#include <stdio.h>

#include "MvScanFileType.h"
#ifdef METVIEW_ODB_NEW
#include "MvOdb.h"
#endif

uPlotManager::uPlotManager(const char* kw): MvService(kw)
{
   saveToPool(false);
}

void uPlotManager::serve(MvRequest& in,MvRequest& out)
{
cout << "uPlotManager::serve --> in" << endl;
in.print();

   uPlotService::Instance().CalluPlot ( in,out );

   // Send error message signal to the caller (i.e. Desktop)
   // The request out is not enough to tell Desktop that an error
   // ocurred. Function MvProtocol::setError needs to be called too.
   if ( strcmp(out.getVerb(),"ERROR") == 0 )
   {
      if ( (const char*)out("MESSAGE") )
         setError(1,"%s",(const char*)out("MESSAGE"));
      else
         setError(1);
   }

cout << "uPlotManager::serve --> out" << endl;
out.print();

   return;
}

//--------------------------------------------------------

int main(int argc,char **argv)
{
   // Set option -debug to true
   // This is needed in order to force the Save Request command
   // to save the hidden parameters too (underscore parameters)
   option opts[] = {"debug","MARS_DEBUG","-debug","1",t_boolean, sizeof(boolean),OFFSET(globals,debug)};

   MvApplication theApp(argc,argv,NULL,&mars,1,opts);

   uPlotManager vis0("UPLOT_MANAGER");
   uPlotManager vis1("GRIB");
   uPlotManager vis2("GEOPOINTS");
   uPlotManager vis3("MAPVIEW");
   uPlotManager vis4("CARTESIANVIEW");
   uPlotManager vis6("PLOT_SUPERPAGE");
   uPlotManager vis7("PRASTERLOOP");
   uPlotManager vis8("BUFR");
   uPlotManager vis9("PRINTER_MANAGER");
   uPlotManager vis10("GEOVIEW");
   uPlotManager vis11("MXSECTIONVIEW");
   uPlotManager vis12("MVPROFILEVIEW");
   uPlotManager vis13("MXAVERAGEVIEW");
   uPlotManager vis14("ANNOTATIONVIEW");
   uPlotManager vis15("HOVMOELLERVIEW");
   uPlotManager vis16("MHOVMOELLERVIEW");
   uPlotManager vis17("THERMOVIEW");

   uPlotManager nc0("NETCDF_GEO_POINTS");
   uPlotManager nc1("NETCDF_GEO_VECTORS");
   uPlotManager nc2("NETCDF_GEO_MATRIX");
   uPlotManager nc3("NETCDF_XY_MATRIX");
   uPlotManager nc4("NETCDF_XY_POINTS");
   uPlotManager nc5("NETCDF");

   uPlotManager i1 ("INPUT_HISTOGRAM");
   uPlotManager i2 ("INPUT_XY_POINTS");
   uPlotManager i3 ("INPUT_GEO_POINTS");
   uPlotManager i4 ("INPUT_XY_VECTORS");
   uPlotManager i5 ("INPUT_GEO_VECTORS");
   uPlotManager i6 ("INPUT_XY_BINNING");
   uPlotManager i7 ("INPUT_GEO_BINNING");
   uPlotManager i8 ("INPUT_XY_BOXES");
   uPlotManager i9 ("INPUT_GEO_BOXES");
   uPlotManager i10("INPUT_HOR_BAR");
   uPlotManager i11("INPUT_VER_BAR");

   uPlotManager t1 ("TABLE_HISTOGRAM");
   uPlotManager t2 ("TABLE_XY_POINTS");
   uPlotManager t3 ("TABLE_GEO_POINTS");
   uPlotManager t4 ("TABLE_XY_VECTORS");
   uPlotManager t5 ("TABLE_GEO_VECTORS");
   uPlotManager t6 ("TABLE_XY_BINNING");
   uPlotManager t7 ("TABLE_GEO_BINNING");
   uPlotManager t8 ("TABLE_XY_BOXES");
   uPlotManager t9 ("TABLE_GEO_BOXES");
   uPlotManager t10("TABLE_HOR_BAR");
   uPlotManager t11("TABLE_VER_BAR");

   uPlotManager odb1("ODB_GEO_POINTS");
   uPlotManager odb2("ODB_GEO_VECTORS");
   uPlotManager odb3("ODB_XY_POINTS");
   uPlotManager odb4("ODB_XY_VECTORS");
   uPlotManager odb5("ODB_XY_BINNING");

   uPlotManager gv1("GRIB_VECTORS");

   uPlotManager vd1("MCONT");
   uPlotManager vd2("MCOAST");
   uPlotManager vd3("MTEXT");
   uPlotManager vd4("MLEGEND");
   uPlotManager vd5("MGRAPH");
   uPlotManager vd6("MSYMB");

   // 'METVIEW 3' applications. Instantiated here due to
   // backwards compatibility. Delete them later.
   uPlotManager mv31("XSECTVIEW");
   uPlotManager mv32("AVERAGEVIEW");
   uPlotManager mv33("VERTPROFVIEW");

   theApp.run();
}