28 #ifndef GRPCPLOTMSADAPTOR_H_
29 #define GRPCPLOTMSADAPTOR_H_
30 #include <grpc++/grpc++.h>
32 #include <casagrpc/protos/plotms.grpc.pb.h>
33 #include <casagrpc/protos/shutdown.grpc.pb.h>
41 class grpcPMSShutdown :
public QObject,
public ::casatools::rpc::Shutdown::Service {
47 ::grpc::Status
now(::grpc::ServerContext*, const ::google::protobuf::Empty*, ::google::protobuf::Empty*);
56 class grpcPlotMS :
public QObject,
public ::rpc::plotms::app::Service {
65 ::grpc::Status
getPlotMSPid( ::grpc::ServerContext *context,
66 const ::google::protobuf::Empty*,
67 ::rpc::plotms::Pid *reply );
68 ::grpc::Status
setShowGui( ::grpc::ServerContext *context,
69 const ::rpc::plotms::Toggle *req,
70 ::google::protobuf::Empty* );
71 ::grpc::Status
setGridSize( ::grpc::ServerContext *context,
72 const ::rpc::plotms::GridSize *req,
73 ::google::protobuf::Empty* );
74 ::grpc::Status
isDrawing( ::grpc::ServerContext *context,
75 const ::google::protobuf::Empty*,
76 ::rpc::plotms::Toggle *reply );
77 ::grpc::Status
clearPlots( ::grpc::ServerContext *context,
78 const ::google::protobuf::Empty*,
79 ::google::protobuf::Empty* );
81 const ::rpc::plotms::SetVis *req,
82 ::google::protobuf::Empty* );
83 ::grpc::Status
setPlotAxes( ::grpc::ServerContext *context,
84 const ::rpc::plotms::SetAxes *req,
85 ::google::protobuf::Empty* );
86 ::grpc::Status
setShowAtm( ::grpc::ServerContext *context,
87 const ::rpc::plotms::SetToggle *req,
88 ::google::protobuf::Empty* );
89 ::grpc::Status
setShowTsky( ::grpc::ServerContext *context,
90 const ::rpc::plotms::SetToggle *req,
91 ::google::protobuf::Empty* );
93 const ::rpc::plotms::SetSelection *req,
94 ::google::protobuf::Empty* );
96 const ::rpc::plotms::SetAveraging *req,
97 ::google::protobuf::Empty* );
99 const ::rpc::plotms::SetTransform *req,
100 ::google::protobuf::Empty* );
102 const ::rpc::plotms::SetCalibration *req,
103 ::google::protobuf::Empty* );
105 const ::rpc::plotms::SetFlagExtension *req,
106 ::google::protobuf::Empty* );
108 const ::rpc::plotms::ExportRange *req,
109 ::google::protobuf::Empty* );
111 const ::rpc::plotms::SetIterate *req,
112 ::google::protobuf::Empty* );
113 ::grpc::Status
setColorAxis( ::grpc::ServerContext *context,
114 const ::rpc::plotms::SetString *req,
115 ::google::protobuf::Empty* );
116 ::grpc::Status
setSymbol( ::grpc::ServerContext *context,
117 const ::rpc::plotms::SetSymbol *req,
118 ::google::protobuf::Empty* );
120 const ::rpc::plotms::SetSymbol *req,
121 ::google::protobuf::Empty* );
122 ::grpc::Status
setConnect( ::grpc::ServerContext *context,
123 const ::rpc::plotms::SetConnect *req,
124 ::google::protobuf::Empty* );
125 ::grpc::Status
setLegend( ::grpc::ServerContext *context,
126 const ::rpc::plotms::SetLegend *req,
127 ::google::protobuf::Empty* );
128 ::grpc::Status
setTitle( ::grpc::ServerContext *context,
129 const ::rpc::plotms::SetString *req,
130 ::google::protobuf::Empty* );
131 ::grpc::Status
setTitleFont( ::grpc::ServerContext *context,
132 const ::rpc::plotms::SetInt *req,
133 ::google::protobuf::Empty* );
134 ::grpc::Status
setXAxisFont( ::grpc::ServerContext *context,
135 const ::rpc::plotms::SetInt *req,
136 ::google::protobuf::Empty* );
137 ::grpc::Status
setYAxisFont( ::grpc::ServerContext *context,
138 const ::rpc::plotms::SetInt *req,
139 ::google::protobuf::Empty* );
140 ::grpc::Status
setXAxisLabel( ::grpc::ServerContext *context,
141 const ::rpc::plotms::SetString *req,
142 ::google::protobuf::Empty* );
143 ::grpc::Status
setYAxisLabel( ::grpc::ServerContext *context,
144 const ::rpc::plotms::SetString *req,
145 ::google::protobuf::Empty* );
146 ::grpc::Status
setGridParams( ::grpc::ServerContext *context,
147 const ::rpc::plotms::SetGrid *req,
148 ::google::protobuf::Empty* );
149 ::grpc::Status
setXRange( ::grpc::ServerContext *context,
150 const ::rpc::plotms::SetRange *req,
151 ::google::protobuf::Empty* );
152 ::grpc::Status
setYRange( ::grpc::ServerContext *context,
153 const ::rpc::plotms::SetRange *req,
154 ::google::protobuf::Empty* );
156 const ::rpc::plotms::SetString *req,
157 ::google::protobuf::Empty* );
158 ::grpc::Status
save( ::grpc::ServerContext *context,
159 const ::rpc::plotms::Save *req,
160 ::google::protobuf::Empty* );
161 ::grpc::Status
update( ::grpc::ServerContext *context,
162 const ::google::protobuf::Empty *req,
163 ::google::protobuf::Empty* );
187 void qtGO( std::function<
void()> );
215 if (
getenv(
"GRPC_DEBUG")) {
216 fprintf(stdout,
"stopping grpc server...\n");
::grpc::Status setFlaggedSymbol(::grpc::ServerContext *context, const ::rpc::plotms::SetSymbol *req,::google::protobuf::Empty *)
std::unique_ptr< grpc::Server > server
PMS_PP_Canvas * sys_ppcan(PlotMSPlotParameters *sp)
::grpc::Status setFlagExtension(::grpc::ServerContext *context, const ::rpc::plotms::SetFlagExtension *req,::google::protobuf::Empty *)
::grpc::Status setPlotAxes(::grpc::ServerContext *context, const ::rpc::plotms::SetAxes *req,::google::protobuf::Empty *)
PMS_PP_PageHeader * sys_pphead(PlotMSPlotParameters *sp)
::grpc::Status setColorAxis(::grpc::ServerContext *context, const ::rpc::plotms::SetString *req,::google::protobuf::Empty *)
::grpc::Status setTitle(::grpc::ServerContext *context, const ::rpc::plotms::SetString *req,::google::protobuf::Empty *)
::grpc::Status setGridParams(::grpc::ServerContext *context, const ::rpc::plotms::SetGrid *req,::google::protobuf::Empty *)
::grpc::Status clearPlots(::grpc::ServerContext *context, const ::google::protobuf::Empty *,::google::protobuf::Empty *)
grpcPMSShutdown(PlotEngine *qtv)
::grpc::Status setSymbol(::grpc::ServerContext *context, const ::rpc::plotms::SetSymbol *req,::google::protobuf::Empty *)
PMS_PP_Display * ppdisp(int index)
::grpc::Status setLegend(::grpc::ServerContext *context, const ::rpc::plotms::SetLegend *req,::google::protobuf::Empty *)
::grpc::Status setPlotMSIterate(::grpc::ServerContext *context, const ::rpc::plotms::SetIterate *req,::google::protobuf::Empty *)
Subclass of PlotMSPlotParameters::Group to handle display parameters.
::grpc::Status setPlotMSSelection(::grpc::ServerContext *context, const ::rpc::plotms::SetSelection *req,::google::protobuf::Empty *)
PMS_PP_PageHeader * pphead(int index)
::grpc::Status isDrawing(::grpc::ServerContext *context, const ::google::protobuf::Empty *,::rpc::plotms::Toggle *reply)
Specifies an casacore::MS selection.
::grpc::Status getPlotMSPid(::grpc::ServerContext *context, const ::google::protobuf::Empty *,::rpc::plotms::Pid *reply)
void release_notification(PlotMSPlotParameters *sp)
Parameters for a PlotMSPlot.
::grpc::Status update(::grpc::ServerContext *context, const ::google::protobuf::Empty *req,::google::protobuf::Empty *)
::grpc::Status setPlotMSPageHeaderItems(::grpc::ServerContext *context, const ::rpc::plotms::SetString *req,::google::protobuf::Empty *)
Subclass of PlotMSPlotParameters::Group to handle canvas parameters.
void hold_notification(PlotMSPlotParameters *sp)
::grpc::Status now(::grpc::ServerContext *, const ::google::protobuf::Empty *,::google::protobuf::Empty *)
::grpc::Status setGridSize(::grpc::ServerContext *context, const ::rpc::plotms::GridSize *req,::google::protobuf::Empty *)
::grpc::Status setShowAtm(::grpc::ServerContext *context, const ::rpc::plotms::SetToggle *req,::google::protobuf::Empty *)
::grpc::Status setXAxisFont(::grpc::ServerContext *context, const ::rpc::plotms::SetInt *req,::google::protobuf::Empty *)
PMS_PP_Axes * sys_ppaxes(PlotMSPlotParameters *sp)
PMS_PP_MSData * sys_ppdata(PlotMSPlotParameters *sp)
PMS_PP_Iteration * sys_ppiter(PlotMSPlotParameters *sp)
::grpc::Status setXAxisLabel(::grpc::ServerContext *context, const ::rpc::plotms::SetString *req,::google::protobuf::Empty *)
void set_plotter(PlotMSPlotter *plt)
PMS_PP_Cache * ppcache(int index)
::grpc::Status setConnect(::grpc::ServerContext *context, const ::rpc::plotms::SetConnect *req,::google::protobuf::Empty *)
Subclass of PlotMSPlotParameters::Group to handle subparameters for casacore::MS data.
::grpc::Status setPlotMSTransformations(::grpc::ServerContext *context, const ::rpc::plotms::SetTransform *req,::google::protobuf::Empty *)
::grpc::Status setShowGui(::grpc::ServerContext *context, const ::rpc::plotms::Toggle *req,::google::protobuf::Empty *)
::grpc::Status setYRange(::grpc::ServerContext *context, const ::rpc::plotms::SetRange *req,::google::protobuf::Empty *)
Subclass of PlotMSPlotParameters::Group to handle axes parameters.
::grpc::Status setExportRange(::grpc::ServerContext *context, const ::rpc::plotms::ExportRange *req,::google::protobuf::Empty *)
void qtGO(std::function< void()>)
::grpc::Status setTitleFont(::grpc::ServerContext *context, const ::rpc::plotms::SetInt *req,::google::protobuf::Empty *)
std::unique_ptr< grpcPlotMS > plotms_service
::grpc::Status setShowTsky(::grpc::ServerContext *context, const ::rpc::plotms::SetToggle *req,::google::protobuf::Empty *)
static constexpr char APP_SERVER_SWITCH[]
void clear_parameters()
update parameters
grpcPlotMS(PlotEngine *pe)
PMS_PP_Iteration * ppiter(int index)
grpcPlotMSState(PlotEngine *v)
::grpc::Status setPlotMSAveraging(::grpc::ServerContext *context, const ::rpc::plotms::SetAveraging *req,::google::protobuf::Empty *)
std::unique_ptr< grpcPMSShutdown > shutdown_service
::grpc::Status setYAxisLabel(::grpc::ServerContext *context, const ::rpc::plotms::SetString *req,::google::protobuf::Empty *)
Subclass of PlotMSPlotParameters::Group to handle cache parameters.
::grpc::Status setPlotMSFilename(::grpc::ServerContext *context, const ::rpc::plotms::SetVis *req,::google::protobuf::Empty *)
Subclass of PlotMSPlotParameters::Group to handle iteration parameters.
PlotMSPlotParameters * get_sysparams(int index)
std::map< std::pair< int, int >, PlotMSPlotParameters::Group * > param_groups
PMS_PP_Display * sys_ppdisp(PlotMSPlotParameters *sp)
High(ish)-level plotter class that manages the GUI (semi-) transparently to the rest of PlotMS...
PMS_PP_MSData * ppdata(int index)
::grpc::Status save(::grpc::ServerContext *context, const ::rpc::plotms::Save *req,::google::protobuf::Empty *)
Abstracts the interface DBUS uses to talk to the main PlotMS application.
PMS_PP_Cache * sys_ppcache(PlotMSPlotParameters *sp)
void populate_selection(const ::rpc::plotms::SetSelection &req, PlotMSSelection &sel)
PMS_PP_Canvas * ppcan(int index)
::grpc::Status setYAxisFont(::grpc::ServerContext *context, const ::rpc::plotms::SetInt *req,::google::protobuf::Empty *)
::grpc::Status setXRange(::grpc::ServerContext *context, const ::rpc::plotms::SetRange *req,::google::protobuf::Empty *)
PMS_PP_Axes * ppaxes(int index)
::grpc::Status setPlotMSCalibration(::grpc::ServerContext *context, const ::rpc::plotms::SetCalibration *req,::google::protobuf::Empty *)
T getenv(const char *name, const T defaultVal)