casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlotServerProxy.h
Go to the documentation of this file.
1 //# PlotServerProxy.h: allows control of the viewer from C++ via DBus
2 //# Copyright (C) 2009
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef DBUS_PLOTSERVERPROXY_H_
29 #define DBUS_PLOTSERVERPROXY_H_
30 
31 #include <vector>
32 #include <string>
33 #include <casadbus/plotserver/PlotServerProxy.proxy.h>
35 #include <casa/Containers/Record.h>
36 #include <stdcasa/variant.h>
37 
38 namespace casa {
40  private edu::nrao::casa::plotserver_proxy,
41  public DBus::IntrospectableProxy,
42  public DBus::ObjectProxy {
43 
44  public:
45 
46  static std::list<std::string> execArgs( const std::list<std::string> &args );
47  static std::string dbusName( ) { return "plot_server"; }
48 
49  PlotServerProxy( const std::string &name=dbusName( ) );
50 
51  dbus::variant panel( const std::string& title, const std::string &xlabel="", const std::string &ylabel="",
52  const std::string &window_title="", const std::vector<int> &size=std::vector<int>( ),
53  const std::string& legend="bottom", const std::string &zoom="bottom",
54  const int32_t& with_panel=0, const bool& new_row=false, const bool& hidden=false )
55  { return dbus::toVariant( edu::nrao::casa::plotserver_proxy::panel(title,xlabel,ylabel,window_title,size,
56  legend,zoom,with_panel,new_row,hidden) ); }
57  std::vector< std::string > colors( )
58  { return edu::nrao::casa::plotserver_proxy::colors( ); }
59  std::vector< std::string > colormaps( )
60  { return edu::nrao::casa::plotserver_proxy::colormaps( ); }
61  std::vector< std::string > symbols( )
62  { return edu::nrao::casa::plotserver_proxy::symbols( ); }
63  dbus::variant line( const std::vector< double >& x, const std::vector< double >& y, const std::string& color="black",
64  const std::string& label="", const int32_t& panel=0 )
65  { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::line( x, y, color, label, panel)); }
66  dbus::variant scatter( const std::vector< double >& x, const std::vector< double >& y, const std::string& color="black",
67  const std::string& label="", const std::string& symbol="", const int32_t& symbol_size=-1,
68  const int32_t& dot_size=-1, const int32_t& panel=0)
69  { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::scatter( x, y, color, label, symbol,
70  symbol_size, dot_size, panel)); }
71  dbus::variant histogram( const std::vector< double >& values, int bins=0, const std::string& color="blue",
72  const std::string& label="", const int panel=0 )
73  { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::histogram( values, bins, color, label, panel)); }
74  dbus::variant raster( const std::vector<double> &matrix, int sizex, int sizey, const std::string &colormap="Rainbow 2", int panel=0 )
75  { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::raster( matrix, sizex, sizey, colormap, panel )); }
76 
77  dbus::variant erase(const int32_t& data_or_panel=0)
78  { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::erase(data_or_panel)); }
79 
80  dbus::variant setlabel(const std::string& xlabel="", const std::string& ylabel="", const std::string& title="", int panel=0)
81  { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::setlabel(xlabel,ylabel,title,panel)); }
82 
83  dbus::variant close(const int32_t& panel=0)
84  { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::close(panel)); }
85  dbus::variant release(const int32_t& panel=0)
86  { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::release(panel)); }
87 
88  dbus::variant show(const int32_t& panel=0)
90  dbus::variant hide(const int32_t& panel=0)
91  { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::hide(panel)); }
92 
93  void done() { edu::nrao::casa::plotserver_proxy::done( ); }
94 
95  dbus::variant loaddock( const std::string &file_or_xml, const std::string &loc="top", const std::vector<std::string> &dockable=std::vector<std::string>( ), const int32_t& panel=0 )
96  { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::loaddock(file_or_xml, loc, dockable, panel)); }
97 
98 
99  //
100  // signals...
101  //
102  void button(const int32_t& /*panel*/, const std::string& /*name*/) { }
103  void check(const int32_t& /*panel*/, const std::string& /*name*/, const int32_t& /*state*/) { }
104  void radio(const int32_t& /*panel*/, const std::string& /*name*/, const bool& /*state*/) { }
105  void linetext(const int32_t& /*panel*/, const std::string& /*name*/, const std::string& /*text*/) { }
106  void slidevalue(const int32_t& /*panel*/, const std::string& /*name*/, const int32_t& /*value*/) { }
107  void exiting( ) { }
108  void closing(const int32_t& /*panel*/, const bool& /*gone*/) { }
109 
110 
111  };
112 }
113 #endif
dbus::variant erase(const int32_t &data_or_panel=0)
void slidevalue(const int32_t &, const std::string &, const int32_t &)
dbus::variant show(const int32_t &panel=0)
dbus::variant panel(const std::string &title, const std::string &xlabel="", const std::string &ylabel="", const std::string &window_title="", const std::vector< int > &size=std::vector< int >(), const std::string &legend="bottom", const std::string &zoom="bottom", const int32_t &with_panel=0, const bool &new_row=false, const bool &hidden=false)
std::vector< std::string > colors()
dbus::variant line(const std::vector< double > &x, const std::vector< double > &y, const std::string &color="black", const std::string &label="", const int32_t &panel=0)
void linetext(const int32_t &, const std::string &, const std::string &)
dbus::variant release(const int32_t &panel=0)
void check(const int32_t &, const std::string &, const int32_t &)
static std::list< std::string > execArgs(const std::list< std::string > &args)
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
size_t size() const
void show(const variant &v)
dbus::variant hide(const int32_t &panel=0)
void closing(const int32_t &, const bool &)
variant toVariant(const DBus::Variant &src)
dbus::variant histogram(const std::vector< double > &values, int bins=0, const std::string &color="blue", const std::string &label="", const int panel=0)
dbus::variant loaddock(const std::string &file_or_xml, const std::string &loc="top", const std::vector< std::string > &dockable=std::vector< std::string >(), const int32_t &panel=0)
static std::string dbusName()
std::vector< std::string > colormaps()
std::vector< std::string > symbols()
dbus::variant close(const int32_t &panel=0)
PlotServerProxy(const std::string &name=dbusName())
dbus::variant raster(const std::vector< double > &matrix, int sizex, int sizey, const std::string &colormap="Rainbow 2", int panel=0)
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the color(i.e.,"000000"for black) and
void button(const int32_t &, const std::string &)
signals...
void radio(const int32_t &, const std::string &, const bool &)
dbus::variant scatter(const std::vector< double > &x, const std::vector< double > &y, const std::string &color="black", const std::string &label="", const std::string &symbol="", const int32_t &symbol_size=-1, const int32_t &dot_size=-1, const int32_t &panel=0)
dbus::variant setlabel(const std::string &xlabel="", const std::string &ylabel="", const std::string &title="", int panel=0)