28 #ifndef GRPCVIEWERADAPTOR_H_
29 #define GRPCVIEWERADAPTOR_H_
36 #include <casagrpc/protos/img.grpc.pb.h>
37 #include <casagrpc/protos/shutdown.grpc.pb.h>
38 #include <grpc++/grpc++.h>
42 class grpcShutdown :
public QObject,
public ::casatools::rpc::Shutdown::Service {
48 ::grpc::Status
now(::grpc::ServerContext*, const ::google::protobuf::Empty*, ::google::protobuf::Empty*);
63 void qtGO( std::function<
void()> );
69 data_desc(
int idx,
const std::string &pathx,
const std::string &typex,
85 const std::string &
path( )
const {
91 const std::string &
type( )
const {
131 const std::list<int> &
data( )
const {
151 ::grpc::Status
panel( ::grpc::ServerContext *context,
152 const ::rpc::img::NewPanel *req,
153 ::rpc::img::Id *reply );
154 ::grpc::Status
hide( ::grpc::ServerContext *context,
155 const ::rpc::img::Id *req,
156 ::google::protobuf::Empty* );
157 ::grpc::Status
show( ::grpc::ServerContext *context,
158 const ::rpc::img::Id *req,
159 ::google::protobuf::Empty* );
160 ::grpc::Status
freeze( ::grpc::ServerContext *context,
161 const ::rpc::img::Id *req,
162 ::google::protobuf::Empty* );
163 ::grpc::Status
unfreeze( ::grpc::ServerContext *context,
164 const ::rpc::img::Id *req,
165 ::google::protobuf::Empty* );
166 ::grpc::Status
close( ::grpc::ServerContext *context,
167 const ::rpc::img::Id *req,
168 ::google::protobuf::Empty* );
169 ::grpc::Status
release( ::grpc::ServerContext *context,
170 const ::rpc::img::Id *req,
171 ::google::protobuf::Empty* );
173 ::grpc::Status
axes( ::grpc::ServerContext *context,
174 const ::rpc::img::Axes *req,
175 ::google::protobuf::Empty* );
177 ::grpc::Status
popup( ::grpc::ServerContext *context,
178 const ::rpc::img::PopUp *req,
179 ::google::protobuf::Empty* );
181 ::grpc::Status
load( ::grpc::ServerContext *context,
182 const ::rpc::img::NewData *req,
183 ::rpc::img::Id *reply );
184 ::grpc::Status
reload( ::grpc::ServerContext *context,
185 const ::rpc::img::Id *req,
186 ::google::protobuf::Empty* );
187 ::grpc::Status
unload( ::grpc::ServerContext *context,
188 const ::rpc::img::Id *req,
189 ::google::protobuf::Empty* );
191 ::grpc::Status
restore( ::grpc::ServerContext *context,
192 const ::rpc::img::Restore *req,
193 ::rpc::img::Id *reply );
195 ::grpc::Status
colormap( ::grpc::ServerContext *context,
196 const ::rpc::img::ColorMap *req,
197 ::google::protobuf::Empty* );
199 ::grpc::Status
colorwedge( ::grpc::ServerContext *context,
200 const ::rpc::img::Toggle *req,
201 ::google::protobuf::Empty* );
203 ::grpc::Status
datarange( ::grpc::ServerContext *context,
204 const ::rpc::img::DataRange *req,
205 ::google::protobuf::Empty* );
207 ::grpc::Status
contourlevels( ::grpc::ServerContext *context,
208 const ::rpc::img::ContourLevels *req,
209 ::google::protobuf::Empty* );
211 const ::rpc::img::ContourThickness *req,
212 ::google::protobuf::Empty* );
213 ::grpc::Status
contourcolor( ::grpc::ServerContext *context,
214 const ::rpc::img::ContourColor *req,
215 ::google::protobuf::Empty* );
217 ::grpc::Status
channel( ::grpc::ServerContext *context,
218 const ::rpc::img::SetChannel *req,
219 ::google::protobuf::Empty* );
220 ::grpc::Status
zoomlevel( ::grpc::ServerContext *context,
221 const ::rpc::img::SetZoomLevel *req,
222 ::google::protobuf::Empty* );
223 ::grpc::Status
zoombox( ::grpc::ServerContext *context,
224 const ::rpc::img::SetZoomBox *req,
225 ::google::protobuf::Empty* );
227 ::grpc::Status
output( ::grpc::ServerContext *context,
228 const ::rpc::img::Output *req,
229 ::google::protobuf::Empty* );
232 ::grpc::Status
fileinfo( ::grpc::ServerContext *context,
233 const ::rpc::img::Path *req,
234 ::rpc::img::FileInfo *reply );
235 ::grpc::Status
keyinfo( ::grpc::ServerContext *context,
236 const ::rpc::img::Id *req,
237 ::rpc::img::KeyInfo *reply );
241 ::grpc::Status
cwd( ::grpc::ServerContext *context,
242 const ::rpc::img::Path *req,
243 ::rpc::img::Path *reply );
246 ::grpc::Status
done( ::grpc::ServerContext*,
247 const ::google::protobuf::Empty*,
248 ::google::protobuf::Empty* );
262 const QString &
file,
double scale );
264 int dpi,
const QString &orientation,
const QString &media );
265 void adjusteps(
const char *from,
const char *to,
266 const QSize &wcmax,
const QRect &viewport );
304 if (
getenv(
"GRPC_DEBUG")) {
305 fprintf(stdout,
"stopping grpc server...\n");
bool printps(QtDisplayPanel *panel, const QString &type, const QString &file, int dpi, const QString &orientation, const QString &media)
QtDisplayPanelGui * findpanel(int key)
const std::list< int > & data() const
void handle_destroyed_panel(QObject *)
::grpc::Status load(::grpc::ServerContext *context, const ::rpc::img::NewData *req,::rpc::img::Id *reply)
const std::string & type() const
grpcShutdown(QtViewer *qtv)
::grpc::Status now(::grpc::ServerContext *, const ::google::protobuf::Empty *,::google::protobuf::Empty *)
Qt implementation of main viewer supervisory object – Gui level.
::grpc::Status keyinfo(::grpc::ServerContext *context, const ::rpc::img::Id *req,::rpc::img::KeyInfo *reply)
void adjusteps(const char *from, const char *to, const QSize &wcmax, const QRect &viewport)
QtDisplayPanelGui *& panel()
::grpc::Status panel(::grpc::ServerContext *context, const ::rpc::img::NewPanel *req,::rpc::img::Id *reply)
::grpc::Status unfreeze(::grpc::ServerContext *context, const ::rpc::img::Id *req,::google::protobuf::Empty *)
data_desc & operator=(const data_desc &)
virtual Type type()
Return the type enum.
::grpc::Status fileinfo(::grpc::ServerContext *context, const ::rpc::img::Path *req,::rpc::img::FileInfo *reply)
::grpc::Status contourlevels(::grpc::ServerContext *context, const ::rpc::img::ContourLevels *req,::google::protobuf::Empty *)
std::unique_ptr< grpcImageViewer > viewer_service
const QtDisplayPanelGui * panel() const
bool load_data(QtDisplayPanelGui *, int)
::grpc::Status restore(::grpc::ServerContext *context, const ::rpc::img::Restore *req,::rpc::img::Id *reply)
std::recursive_mutex managed_panels_mutex
grpcImageViewer(QtViewer *)
Constructor which takes the application.
panel_desc(QtDisplayPanelGui *p)
::grpc::Status zoomlevel(::grpc::ServerContext *context, const ::rpc::img::SetZoomLevel *req,::google::protobuf::Empty *)
int get_id(QtDisplayPanelGui *)
::grpc::Status datarange(::grpc::ServerContext *context, const ::rpc::img::DataRange *req,::google::protobuf::Empty *)
const std::string & path() const
const QtDisplayPanelGui * panel() const
void erase_panel(int panel)
std::string path(const std::string &name)
::grpc::Status reload(::grpc::ServerContext *context, const ::rpc::img::Id *req,::google::protobuf::Empty *)
::grpc::Status show(::grpc::ServerContext *context, const ::rpc::img::Id *req,::google::protobuf::Empty *)
bool printraster(QtDisplayPanel *panel, const QString &type, const QString &file, double scale)
::grpc::Status freeze(::grpc::ServerContext *context, const ::rpc::img::Id *req,::google::protobuf::Empty *)
The main display window for the Qt version of the viewer.
::grpc::Status colormap(::grpc::ServerContext *context, const ::rpc::img::ColorMap *req,::google::protobuf::Empty *)
::grpc::Status popup(::grpc::ServerContext *context, const ::rpc::img::PopUp *req,::google::protobuf::Empty *)
const QtDisplayData * data() const
QtDisplayPanelGui *& panel()
::grpc::Status channel(::grpc::ServerContext *context, const ::rpc::img::SetChannel *req,::google::protobuf::Empty *)
::grpc::Status cwd(::grpc::ServerContext *context, const ::rpc::img::Path *req,::rpc::img::Path *reply)
if path is null string, return current path if path is not null (and represents a valid dir)...
std::map< int, data_desc * > datamap
::grpc::Status release(::grpc::ServerContext *context, const ::rpc::img::Id *req,::google::protobuf::Empty *)
::grpc::Status axes(::grpc::ServerContext *context, const ::rpc::img::Axes *req,::google::protobuf::Empty *)
std::map< int, panel_desc * > panelmap
grpcViewerState(QtViewer *v)
::grpc::Status contourthickness(::grpc::ServerContext *context, const ::rpc::img::ContourThickness *req,::google::protobuf::Empty *)
::grpc::Status contourcolor(::grpc::ServerContext *context, const ::rpc::img::ContourColor *req,::google::protobuf::Empty *)
::grpc::Status done(::grpc::ServerContext *, const ::google::protobuf::Empty *,::google::protobuf::Empty *)
duplicates the shutdown::now rpc call...
QtDisplayData * finddata(int key)
bool unload_data(QtDisplayPanelGui *, int, bool=true)
::grpc::Status zoombox(::grpc::ServerContext *context, const ::rpc::img::SetZoomBox *req,::google::protobuf::Empty *)
QtDisplayPanelGui * panel_
::grpc::Status output(::grpc::ServerContext *context, const ::rpc::img::Output *req,::google::protobuf::Empty *)
data_desc(int idx, const std::string &pathx, const std::string &typex, QtDisplayData *ddx, QtDisplayPanelGui *dpx)
::grpc::Status unload(::grpc::ServerContext *context, const ::rpc::img::Id *req,::google::protobuf::Empty *)
void qtGO(std::function< void()>)
::grpc::Status hide(::grpc::ServerContext *context, const ::rpc::img::Id *req,::google::protobuf::Empty *)
std::recursive_mutex managed_datas_mutex
std::unique_ptr< grpcShutdown > shutdown_service
::grpc::Status colorwedge(::grpc::ServerContext *context, const ::rpc::img::Toggle *req,::google::protobuf::Empty *)
std::list< int > & data()
std::unique_ptr< grpc::Server > server
::grpc::Status close(::grpc::ServerContext *context, const ::rpc::img::Id *req,::google::protobuf::Empty *)
T getenv(const char *name, const T defaultVal)
Defines nreal time structures used by the VLA table filler.