casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
PlotServerProxy.h
Go to the documentation of this file.
00001 //# PlotServerProxy.h: allows control of the viewer from C++ via DBus
00002 //# Copyright (C) 2009
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id$
00027 
00028 #ifndef DBUS_PLOTSERVERPROXY_H_
00029 #define DBUS_PLOTSERVERPROXY_H_
00030 
00031 #include <vector>
00032 #include <string>
00033 #include <casadbus/plotserver/PlotServerProxy.proxy.h>
00034 #include <casadbus/utilities/Conversion.h>
00035 #include <casa/Containers/Record.h>
00036 #include <stdcasa/variant.h>
00037 
00038 namespace casa {
00039     class PlotServerProxy :
00040         private edu::nrao::casa::plotserver_proxy,
00041         public DBus::IntrospectableProxy,
00042         public DBus::ObjectProxy {
00043 
00044     public:
00045 
00046         static std::list<std::string> execArgs( const std::list<std::string> &args );
00047         static std::string dbusName( ) { return "plot_server"; }
00048 
00049         PlotServerProxy( const std::string &name=dbusName( ) );
00050 
00051         dbus::variant panel( const std::string& title, const std::string &xlabel="", const std::string &ylabel="",
00052                              const std::string &window_title="", const std::vector<int> &size=std::vector<int>( ),
00053                              const std::string& legend="bottom", const std::string &zoom="bottom",
00054                              const int32_t& with_panel=0, const bool& new_row=false, const bool& hidden=false )
00055           { return dbus::toVariant( edu::nrao::casa::plotserver_proxy::panel(title,xlabel,ylabel,window_title,size,
00056                                                                              legend,zoom,with_panel,new_row,hidden) ); }
00057         std::vector< std::string > colors( )
00058                         { return edu::nrao::casa::plotserver_proxy::colors( ); }
00059         std::vector< std::string > colormaps( )
00060                         { return edu::nrao::casa::plotserver_proxy::colormaps( ); }
00061         std::vector< std::string > symbols( )
00062                         { return edu::nrao::casa::plotserver_proxy::symbols( ); }
00063         dbus::variant line( const std::vector< double >& x, const std::vector< double >& y, const std::string& color="black",
00064                             const std::string& label="", const int32_t& panel=0 )
00065                         { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::line( x, y, color, label, panel)); }
00066         dbus::variant scatter( const std::vector< double >& x, const std::vector< double >& y, const std::string& color="black",
00067                                const std::string& label="", const std::string& symbol="", const int32_t& symbol_size=-1,
00068                                const int32_t& dot_size=-1, const int32_t& panel=0)
00069                         { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::scatter( x, y, color, label, symbol,
00070                                                                                              symbol_size, dot_size, panel)); }
00071         dbus::variant histogram( const std::vector< double >& values, int bins=0, const std::string& color="blue",
00072                                  const std::string& label="", const int panel=0 )
00073                         { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::histogram( values, bins, color, label, panel)); }
00074         dbus::variant raster( const std::vector<double> &matrix, int sizex, int sizey, const std::string &colormap="Rainbow 2", int panel=0 )
00075                         { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::raster( matrix, sizex, sizey, colormap, panel )); }
00076 
00077         dbus::variant erase(const int32_t& data_or_panel=0)
00078                         { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::erase(data_or_panel)); }
00079 
00080         dbus::variant setlabel(const std::string& xlabel="", const std::string& ylabel="", const std::string& title="", int panel=0)
00081                         { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::setlabel(xlabel,ylabel,title,panel)); }
00082 
00083         dbus::variant close(const int32_t& panel=0)
00084                         { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::close(panel)); }
00085         dbus::variant release(const int32_t& panel=0)
00086                         { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::release(panel)); }
00087 
00088         dbus::variant show(const int32_t& panel=0)
00089                         { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::show(panel)); }
00090         dbus::variant hide(const int32_t& panel=0)
00091                         { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::hide(panel)); }
00092 
00093         void done() { edu::nrao::casa::plotserver_proxy::done( ); }
00094 
00095         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 )
00096                         { return dbus::toVariant(edu::nrao::casa::plotserver_proxy::loaddock(file_or_xml, loc, dockable, panel)); }
00097 
00098 
00099         //
00100         // signals...
00101         //
00102         void button(const int32_t& panel, const std::string& name) { }
00103         void check(const int32_t& panel, const std::string& name, const int32_t& state) { }
00104         void radio(const int32_t& panel, const std::string& name, const bool& state) { }
00105         void linetext(const int32_t& panel, const std::string& name, const std::string& text) { }
00106         void slidevalue(const int32_t& panel, const std::string& name, const int32_t& value) { }
00107         void exiting( ) { }
00108         void closing(const int32_t& panel, const bool &gone) { }
00109 
00110 
00111     };
00112 }
00113 #endif