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