casa  $Rev:20696$
plotms_private.h
Go to the documentation of this file.
00001 // The Private declarations of the PlotMS component.
00002 
00003 // Static //
00004 
00005 // Constants for how long to wait for the casapy application to launch, in
00006 // microseconds.
00007 // <group>
00008 static const unsigned int LAUNCH_WAIT_INTERVAL_US;
00009 static const unsigned int LAUNCH_TOTAL_WAIT_US;
00010 // </group>
00011 
00012 // Implementation of casapy_watcher for use with plotms component.
00013 class plotms_watcher : public CasapyWatcher {
00014 public:
00015     // Constructor which takes parent.
00016     plotms_watcher(plotms *pl) : p(pl) { CasapyWatcher::registerWatcher(this); }
00017     
00018     // Destructor.
00019     ~plotms_watcher() { }
00020     
00021     // Overrides casapy_watcher::logChanged().
00022     // <group>
00023     void logChanged(const String& sinkLocation) {
00024         p->setLogFilename(sinkLocation); }
00025     void logChanged(LogMessage::Priority filterPriority) {
00026         p->setLogFilter(LogMessage::toString(filterPriority).c_str()); }
00027     // </group>
00028     
00029     // Overrides casapy_watcher::casapyClosing().
00030     void casapyClosing() { p->closeApp(); }
00031     
00032 private:
00033     // Plotms parent.
00034     plotms *p;
00035 };
00036 
00037 class plotms_app  {
00038 public:
00039   plotms_app( ) { }
00040   const String &dbusName( ) const { return itsDBusName_; }
00041   String &dbusName( ) { return itsDBusName_; }
00042   // DBus name of the plotms application we're communicating with.
00043   const QString &getName( ) const { return PlotMSDBusApp::name( ); }
00044  private:
00045   String itsDBusName_;
00046 };
00047 
00048 // Non-Static //
00049 
00050 // must forward declare & use a pointer because build system
00051 // does not allow extra include in plotms_cmpt.h...
00052 plotms_app app;
00053 
00054 // Casapy watcher.
00055 plotms_watcher itsWatcher_;
00056 
00057 // Log parameters that are set before the application is launched.
00058 // <group>
00059 String itsLogFilename_, itsLogFilter_;
00060 // </group>
00061 
00062 
00063 // Returns true if the DISPLAY environment variable is set, false otherwise.
00064 // If not set, an error message is printed.
00065 bool displaySet();
00066 
00067 // Launches the dbus plotms application IF it is not already launched.
00068 void launchApp();
00069 
00070 // Closes the launched dbus plotms application if needed.
00071 void closeApp();
00072 
00073 // Helper method for calling an async method.
00074 void callAsync(const String& methodName);
00075 
00076 // Helper method for realizing synchronous behavior
00077 void waitUntilIdle();
00078 
00079 // Helper method for setting the MS selection.
00080 void setPlotMSSelection_(const PlotMSSelection& selection,
00081         const bool updateImmediately, const int plotIndex);
00082 
00083 // Helper method for setting the MS averaging.
00084 void setPlotMSAveraging_(const PlotMSAveraging& averaging,
00085         const bool updateImmediately, const int plotIndex);
00086 
00087 // Helper method for setting the MS transformations.
00088 void setPlotMSTransformations_(const PlotMSTransformations& trans,
00089         const bool updateImmediately, const int plotIndex);
00090 
00091 // Helper method for setting the iteration parameters
00092 void setPlotMSIterate_(const PlotMSIterParam& iter,
00093         const bool updateImmediately, const int plotIndex);
00094 
00095 // Helper method for setting the flag extension.
00096 void setFlagging_(const PlotMSFlagging& flagging);
00097 
00098 // Bool that turns on iteration
00099 bool doIter_;
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines