casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
PlotMSToolsTab.qo.h
Go to the documentation of this file.
00001 //# PlotMSToolsTab.qo.h: Subclass of PlotMSTab for tools management.
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 #ifndef PLOTMSTOOLSTAB_QO_H_
00028 #define PLOTMSTOOLSTAB_QO_H_
00029 
00030 #include <plotms/GuiTabs/PlotMSToolsTab.ui.h>
00031 
00032 #include <graphics/GenericPlotter/PlotTool.h>
00033 #include <plotms/GuiTabs/PlotMSTab.qo.h>
00034 
00035 #include <casa/namespace.h>
00036 
00037 namespace casa {
00038 
00039 
00040 class PlotMSToolsTab;  /* fwd */
00041 
00042 // Registered with all Canvases so Tracker can act upon key presses
00043 class TrackerKeyHandler : public PlotKeyEventHandler  {
00044         
00045         public:
00046                 TrackerKeyHandler(PlotMSToolsTab *);
00047                                 
00048                 virtual void handleKey(const PlotKeyEvent& event);
00049         
00050         private: 
00051                 PlotMSToolsTab *tools_tab;
00052 };
00053 
00054 
00055 
00056 
00057 // Subclass of PlotMSTab that handles the tools for the current plot.  Watches
00058 // no parameters.
00059 class PlotMSToolsTab : public PlotMSTab, Ui::ToolsTab,
00060                        public PlotTrackerToolNotifier {
00061     Q_OBJECT
00062     
00063 public:
00064     // Constructor which takes the parent plotter, and the QtActionGroup to
00065     // use to synchronize tool actions with the radio buttons on the tab.
00066     PlotMSToolsTab(PlotMSPlotter* parent);
00067     
00068     // Destructor.
00069     ~PlotMSToolsTab();
00070     
00071     
00072     // Implements PlotMSTab::tabName().
00073     QString tabName() const { return "Tools"; }
00074     
00075     // Overrides PlotMSTab::toolButtons().
00076     QList<QToolButton*> toolButtons() const;
00077     
00078     // Implements PlotMSParametersWatcher::parametersHaveChanged.  Currently
00079     // does nothing.
00080     void parametersHaveChanged(const PlotMSWatchedParameters& params,
00081             int updateFlag) { (void)params,(void)updateFlag; }
00082     
00083     
00084     // Show/hide the iteration buttons on this tab.
00085     void showIterationButtons(bool show);
00086     
00087     
00088 
00089     
00090 public slots:
00091     // Slot for when all tools are turned off, and the "None" radio button
00092     // should be checked.
00093     void toolsUnchecked();
00094 
00095     // Tracker "snapshot" feature. Copies value in live display
00096     // into multi-line text box for user to copy/paste.
00097     // Made a slot in case it's useful to connect to a signal, but
00098     // for the initial version, this is not done.
00099     void takeSnapshotOfTrackerValue();
00100     
00101     // Erase contents of the text box holding recorded tracker values
00102     void clearRecordedValues();
00103     
00104 protected:
00105     // Implements PlotTrackerToolNotifier::notifyTrackerChanged().  Updates the
00106     // tracker information in the line edit, if the proper checkbox is toggled.
00107     void notifyTrackerChanged(PlotTrackerTool& tool);
00108 
00109 public:
00110     TrackerKeyHandler *tracker_key_handler;
00111     
00112 };
00113 
00114 }
00115 
00116 #endif /* PLOTMSTOOLSTAB_QO_H_ */