casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Slots | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
casa::PlotMSPlotter Class Reference

High(ish)-level plotter class that manages the GUI (semi-) transparently to the rest of PlotMS. More...

#include <PlotMSPlotter.qo.h>

Inheritance diagram for casa::PlotMSPlotter:
casa::PlotDrawWatcher casa::Client

Public Slots

virtual void showError (const casacore::String &message, const casacore::String &title, bool isWarning)
 Shows the given error/warning message in a GUI window. More...
 
virtual void showMessage (const casacore::String &message, const casacore::String &title, bool warning=false)
 Shows the given informational message in a GUI window. More...
 
virtual void clearMessage ()
 Clears the message in a GUI window. More...
 
void showAbout ()
 Slot for showing an "about" dialog. More...
 
void prepareForPlotting ()
 Take any clean-up actions before a Plot is made 1) unclick any zoom, pan, etc buttons to avoid bug in zoom stack 2)... More...
 
virtual bool close ()
 

Public Member Functions

virtual bool isActionEnabled (PlotMSAction::Type type) const
 Methods from the client interface. More...
 
virtual std::vector< PlotMSPlot * > getCurrentPlots () const
 Return the current client plot. More...
 
virtual bool plot ()
 
virtual std::vector
< std::vector< PMS::Axis > > 
getSelectedLoadAxes () const
 Retrieve the plot load axes the user has specified. More...
 
virtual std::vector
< std::vector< PMS::Axis > > 
getSelectedReleaseAxes () const
 Retrieve the release axes the user has specified. More...
 
virtual PlotMSFlagging getFlagging () const
 Retrieve flagging information specified by the client. More...
 
virtual bool isInteractive () const
 Return whether the client is interactive (a GUI) or noninteractive (a script) More...
 
virtual void canvasAdded (PlotCanvasPtr &canvas)
 Add a plot to those displayed. More...
 
virtual void setAnnotationModeActive (PlotMSAction::Type type, bool active)
 Use to enable annotations in the GUI client. More...
 
virtual std::vector
< casacore::String
getFiles () const
 Return a list of files loaded in the client. More...
 
 PlotMSPlotter (PlotMSApp *parent, Plotter::Implementation impl=Plotter::DEFAULT)
 Non-Static //. More...
 
 ~PlotMSPlotter ()
 Destructor. More...
 
PlotMSAppgetParent ()
 Accessor methods. More...
 
QtProgressWidgetgetProgressWidget ()
 
PlotMSAnnotatorgetAnnotator ()
 
virtual bool isDrawing () const
 
virtual bool isClosed () const
 
void setShowProgress (bool showProgressDialog)
 Execution Methods //. More...
 
virtual void showGUI (bool show=true)
 Shows/hides the GUI. More...
 
virtual bool guiShown () const
 Returns true if the GUI is currently visible, false otherwise. More...
 
virtual int execLoop ()
 Enters the plotter's execution loop, and returns its return value. More...
 
virtual void doThreadedOperation (ThreadController *thread)
 Runs the given operation thread, keeping GUI and progress information synchronized as necessary. More...
 
bool canvasDrawBeginning (PlotOperationPtr drawOperation, bool drawingIsThreaded, int drawnLayersFlag)
 Implements PlotDrawWatcher::canvasDrawBeginning(). More...
 
virtual ThreadControllergetThreadController (PlotMSAction::Type type, PMSPTMethod postThreadMethod=NULL, PlotMSPlot *plot=NULL, int index=-1)
 FactoryMethod for producing a thread controller to manage a specific type of threaded operation. More...
 
void showIterationButtons (bool show)
 GUI Methods //. More...
 
bool showQuestion (const casacore::String &message, const casacore::String &title)
 Pops up a dialog to ask the user the given question with the given window title. More...
 
void setWindowTitle (const casacore::String &windowTitle)
 Plotter Customization Methods //. More...
 
void setStatusText (const casacore::String &statusText)
 Sets the status bar text to the given. More...
 
void clearStatusText ()
 Clears the status bar text. More...
 
void setToolButtonStyle (Qt::ToolButtonStyle style)
 Overrides QMainWindow::setToolButtonStyle(). More...
 
const QMap< PlotMSAction::Type,
QAction * > & 
plotActionMap () const
 Action Methods //. More...
 
void synchronizeAction (PlotMSAction::Type action, QAbstractButton *button)
 Synchronizes the given button with the given action type. More...
 
casacore::String actionText (PlotMSAction::Type type)
 Gets/Sets the text for the QAction associated with the given PlotMSApp action. More...
 
void setActionText (PlotMSAction::Type type, const casacore::String &text)
 
bool actionIsChecked (PlotMSAction::Type type) const
 Gets/Sets whether the QAction associated with the given PlotMSApp action is checked. More...
 
void setActionIsChecked (PlotMSAction::Type type, bool checked, bool alsoTriggerAction=false)
 
virtual bool exportPlot (const PlotExportFormat &format, const bool async)
 export a plot to a file More...
 
virtual void setFlagging (PlotMSFlagging flag)
 Flagging. More...
 
virtual void gridSizeChanged (int rowCount, int colCount)
 
- Public Member Functions inherited from casa::PlotDrawWatcher
 PlotDrawWatcher ()
 Constructor. More...
 
virtual ~PlotDrawWatcher ()
 Destructor. More...
 
- Public Member Functions inherited from casa::Client
virtual void setCommonAxes (bool commonX, bool commonY)
 In the case of a grid of plots whether to use common x- or y- axes. More...
 
virtual bool isCommonAxisX () const
 
virtual bool isCommonAxisY () const
 
virtual void setAxisLocation (PlotAxis locationX, PlotAxis locationY)
 
virtual PlotAxis getAxisLocationX () const
 
virtual PlotAxis getAxisLocationY () const
 
virtual bool exportToFormat (const PlotExportFormat &format)
 
virtual void showError (const casacore::String &message, const casacore::String &title, bool isWarning)=0
 Display an error in a client dependent way. More...
 
virtual void showMessage (const casacore::String &message, const casacore::String &title, bool warning=false)=0
 Display a message. More...
 
virtual void clearMessage ()=0
 
virtual void setCanvasCachedAxesStackImageSize (int width, int height)
 
virtual PlotterPtr getPlotter ()
 Get the abstraction that holds the plots. More...
 
virtual PlotSymbolPtr createSymbol (const PlotSymbolPtr &copy)
 Ask the client to make a deep copy of the given plot symbol. More...
 
virtual PlotSymbolPtr createSymbol (const casacore::String &descriptor, casacore::Int size, const casacore::String &color, const casacore::String &fillPattern, bool outline)
 Ask the client to make a symbol with the given specifications for insertion into the plot. More...
 
virtual PlotLoggerPtr getLogger ()
 Logging is client (implementation) specific so that client needs to be asked for the logger. More...
 
virtual bool isVisible (PlotCanvasPtr &canvas)
 Is the plot visible? More...
 
virtual std::vector
< PlotCanvasPtr
currentCanvases ()
 
virtual void holdDrawing ()
 Keeps resizes from flooding event loop (dragging). More...
 
virtual void releaseDrawing ()
 
virtual bool allDrawingHeld () const
 
virtual void setOperationCompleted (bool completed)
 
virtual int showAndExec (bool show=true)
 
virtual bool close ()=0
 
virtual PlotFactoryPtr getPlotFactory ()
 

Static Public Member Functions

static casacore::String aboutText (Plotter::Implementation implementation, bool useHTML=true)
 Static //. More...
 

Protected Member Functions

void closeEvent (QCloseEvent *event)
 Overrides QWidget::closeEvent(), in case we're dealing with a plotter that isn't Qt and thus is in its own window (and possibly its own execution loop). More...
 
- Protected Member Functions inherited from casa::Client
 Client ()
 
virtual ~Client ()
 

Private Slots

void action_ ()
 Method for when an action has been triggered. More...
 
void action (QAction *which)
 Method for when the given action has been triggered. More...
 
void currentThreadFinished ()
 Slot for when the currently running thread is finished. More...
 
void summarize ()
 Summarize an MS. More...
 
void exportPlots ()
 Export the current plots. More...
 
void tabChanged ()
 

Private Member Functions

bool _triggerAction (PlotMSAction::Type type)
 
void initialize (Plotter::Implementation impl)
 Initializes the plotter with the given implementation. More...
 

Private Attributes

PlotMSAppitsParent_
 PlotMSApp parent. More...
 
bool isQt_
 Flag for whether the underlying Plotter is Qt-based or not. More...
 
bool isClosed_
 Flag for whether the widget is open or not. More...
 
QList< QWidget * > itsEnableWidgets_
 Widgets to be enabled/disabled during threading. More...
 
PlotMSDataSummaryTabitsPlotTab_
 Plot tab. More...
 
PlotMSFlaggingTabitsFlaggingTab_
 Flagging tab (on the plot tab). More...
 
PlotMSToolsTabitsToolsTab_
 Tools tab. More...
 
PlotMSAnnotatorTabitsAnnotatorTab_
 Annotator tab. More...
 
PlotMSOptionsTabitsOptionsTab_
 Options tab. More...
 
QList< QToolButton * > itsToolButtons_
 Tool buttons on the tabs. More...
 
QtProgressWidgetitsThreadProgress_
 Widget for displaying thread progress. More...
 
PlotMSThreaditsCurrentThread_
 Current thread (or NULL for none). More...
 
std::vector< PlotMSThread * > itsWaitingThreads_
 Waiting threads. More...
 
QMap< PlotMSAction::Type,
QAction * > 
itsActionMap_
 casacore::Map between PlotMSApp actions and QActions. More...
 
QtActionSynchronizer itsActionSynchronizer_
 Action synchronizer. More...
 
PlotMSAnnotator itsAnnotator_
 Annotator tool. More...
 
QString itsAboutString_
 "About" string. More...
 
bool showProgressWidget
 
QTabWidget * tabWidget
 

Additional Inherited Members

- Protected Attributes inherited from casa::Client
PlotterPtr itsPlotter_
 Plotter. More...
 
PlotFactoryPtr itsFactory_
 Plot factory. More...
 

Detailed Description

High(ish)-level plotter class that manages the GUI (semi-) transparently to the rest of PlotMS.

Definition at line 64 of file PlotMSPlotter.qo.h.

Constructor & Destructor Documentation

casa::PlotMSPlotter::PlotMSPlotter ( PlotMSApp parent,
Plotter::Implementation  impl = Plotter::DEFAULT 
)

Non-Static //.

Constructor that creates a plotter with the given parent using the given implementation.

casa::PlotMSPlotter::~PlotMSPlotter ( )

Destructor.

Member Function Documentation

bool casa::PlotMSPlotter::_triggerAction ( PlotMSAction::Type  type)
private
static casacore::String casa::PlotMSPlotter::aboutText ( Plotter::Implementation  implementation,
bool  useHTML = true 
)
static

Static //.

Returns "about" text for the given implementation, using HTML or not.

void casa::PlotMSPlotter::action ( QAction *  which)
privateslot

Method for when the given action has been triggered.

Referenced by action_().

void casa::PlotMSPlotter::action_ ( )
inlineprivateslot

Method for when an action has been triggered.

Definition at line 308 of file PlotMSPlotter.qo.h.

References action().

bool casa::PlotMSPlotter::actionIsChecked ( PlotMSAction::Type  type) const

Gets/Sets whether the QAction associated with the given PlotMSApp action is checked.

Has no effect on actions that are not checkable.

casacore::String casa::PlotMSPlotter::actionText ( PlotMSAction::Type  type)

Gets/Sets the text for the QAction associated with the given PlotMSApp action.

virtual void casa::PlotMSPlotter::canvasAdded ( PlotCanvasPtr canvas)
virtual

Add a plot to those displayed.

Implements casa::Client.

bool casa::PlotMSPlotter::canvasDrawBeginning ( PlotOperationPtr  drawOperation,
bool  drawingIsThreaded,
int  drawnLayersFlag 
)
virtual
virtual void casa::PlotMSPlotter::clearMessage ( )
inlinevirtualslot

Clears the message in a GUI window.

Definition at line 211 of file PlotMSPlotter.qo.h.

References clearStatusText().

void casa::PlotMSPlotter::clearStatusText ( )
inline

Clears the status bar text.

Definition at line 166 of file PlotMSPlotter.qo.h.

References setStatusText().

Referenced by clearMessage().

virtual bool casa::PlotMSPlotter::close ( )
virtualslot
void casa::PlotMSPlotter::closeEvent ( QCloseEvent *  event)
protected

Overrides QWidget::closeEvent(), in case we're dealing with a plotter that isn't Qt and thus is in its own window (and possibly its own execution loop).

void casa::PlotMSPlotter::currentThreadFinished ( )
privateslot

Slot for when the currently running thread is finished.

Performs cleanup and starts next waiting thread if applicable.

virtual void casa::PlotMSPlotter::doThreadedOperation ( ThreadController thread)
virtual

Runs the given operation thread, keeping GUI and progress information synchronized as necessary.

The given thread will be deleted upon completion.

Implements casa::Client.

virtual int casa::PlotMSPlotter::execLoop ( )
virtual

Enters the plotter's execution loop, and returns its return value.

Only during this execution loops will GUI windows be shown and GUI events be handled. The execution loop ends when the user clicks the "close" or "quit" buttons. This method can be called multiple times.

Implements casa::Client.

virtual bool casa::PlotMSPlotter::exportPlot ( const PlotExportFormat format,
const bool  async 
)
virtual

export a plot to a file

Implements casa::Client.

void casa::PlotMSPlotter::exportPlots ( )
privateslot

Export the current plots.

PlotMSAnnotator& casa::PlotMSPlotter::getAnnotator ( )
inline

Definition at line 108 of file PlotMSPlotter.qo.h.

References itsAnnotator_.

virtual std::vector<PlotMSPlot*> casa::PlotMSPlotter::getCurrentPlots ( ) const
virtual

Return the current client plot.

Implements casa::Client.

virtual std::vector<casacore::String> casa::PlotMSPlotter::getFiles ( ) const
virtual

Return a list of files loaded in the client.

Implements casa::Client.

virtual PlotMSFlagging casa::PlotMSPlotter::getFlagging ( ) const
virtual

Retrieve flagging information specified by the client.

Implements casa::Client.

PlotMSApp* casa::PlotMSPlotter::getParent ( )
inline

Accessor methods.

Definition at line 104 of file PlotMSPlotter.qo.h.

References itsParent_.

QtProgressWidget* casa::PlotMSPlotter::getProgressWidget ( )
inline

Definition at line 106 of file PlotMSPlotter.qo.h.

References itsThreadProgress_.

virtual std::vector<std::vector<PMS::Axis> > casa::PlotMSPlotter::getSelectedLoadAxes ( ) const
virtual

Retrieve the plot load axes the user has specified.

Implements casa::Client.

virtual std::vector<std::vector<PMS::Axis> > casa::PlotMSPlotter::getSelectedReleaseAxes ( ) const
virtual

Retrieve the release axes the user has specified.

Implements casa::Client.

virtual ThreadController* casa::PlotMSPlotter::getThreadController ( PlotMSAction::Type  type,
PMSPTMethod  postThreadMethod = NULL,
PlotMSPlot postThreadObject = NULL,
int  index = -1 
)
virtual

FactoryMethod for producing a thread controller to manage a specific type of threaded operation.

Examples include caching, exporting a plot, and drawing.

Implements casa::Client.

virtual void casa::PlotMSPlotter::gridSizeChanged ( int  rowCount,
int  colCount 
)
virtual

Implements casa::Client.

virtual bool casa::PlotMSPlotter::guiShown ( ) const
virtual

Returns true if the GUI is currently visible, false otherwise.

Implements casa::Client.

void casa::PlotMSPlotter::initialize ( Plotter::Implementation  impl)
private

Initializes the plotter with the given implementation.

MUST be called from constructors.

virtual bool casa::PlotMSPlotter::isActionEnabled ( PlotMSAction::Type  type) const
virtual

Methods from the client interface.

Implements casa::Client.

virtual bool casa::PlotMSPlotter::isClosed ( ) const
virtual

Implements casa::Client.

virtual bool casa::PlotMSPlotter::isDrawing ( ) const
virtual

Implements casa::Client.

virtual bool casa::PlotMSPlotter::isInteractive ( ) const
virtual

Return whether the client is interactive (a GUI) or noninteractive (a script)

Implements casa::Client.

virtual bool casa::PlotMSPlotter::plot ( )
virtual

Implements casa::Client.

const QMap<PlotMSAction::Type, QAction*>& casa::PlotMSPlotter::plotActionMap ( ) const

Action Methods //.

Returns a map between PlotMSApp actions and the QActions associated with them in the GUI. Triggering the QActions will trigger the proper PlotMSApp action, and the QAction will be kept properly checked as needed.

void casa::PlotMSPlotter::prepareForPlotting ( )
slot

Take any clean-up actions before a Plot is made 1) unclick any zoom, pan, etc buttons to avoid bug in zoom stack 2)...

anything else needed in the future...

void casa::PlotMSPlotter::setActionIsChecked ( PlotMSAction::Type  type,
bool  checked,
bool  alsoTriggerAction = false 
)
void casa::PlotMSPlotter::setActionText ( PlotMSAction::Type  type,
const casacore::String text 
)
virtual void casa::PlotMSPlotter::setAnnotationModeActive ( PlotMSAction::Type  ,
bool   
)
virtual

Use to enable annotations in the GUI client.

Reimplemented from casa::Client.

virtual void casa::PlotMSPlotter::setFlagging ( PlotMSFlagging  flag)
virtual

Flagging.

Implements casa::Client.

void casa::PlotMSPlotter::setShowProgress ( bool  showProgressDialog)

Execution Methods //.

void casa::PlotMSPlotter::setStatusText ( const casacore::String statusText)

Sets the status bar text to the given.

Referenced by clearStatusText().

void casa::PlotMSPlotter::setToolButtonStyle ( Qt::ToolButtonStyle  style)

Overrides QMainWindow::setToolButtonStyle().

void casa::PlotMSPlotter::setWindowTitle ( const casacore::String windowTitle)

Plotter Customization Methods //.

Sets the window title to the given.

void casa::PlotMSPlotter::showAbout ( )
slot

Slot for showing an "about" dialog.

virtual void casa::PlotMSPlotter::showError ( const casacore::String message,
const casacore::String title,
bool  isWarning 
)
virtualslot

Shows the given error/warning message in a GUI window.

virtual void casa::PlotMSPlotter::showGUI ( bool  show = true)
virtual

Shows/hides the GUI.

Implements casa::Client.

void casa::PlotMSPlotter::showIterationButtons ( bool  show)

GUI Methods //.

Shows/Hides the "iteration" widgets and actions on the GUI.

virtual void casa::PlotMSPlotter::showMessage ( const casacore::String message,
const casacore::String title,
bool  warning = false 
)
virtualslot

Shows the given informational message in a GUI window.

bool casa::PlotMSPlotter::showQuestion ( const casacore::String message,
const casacore::String title 
)

Pops up a dialog to ask the user the given question with the given window title.

Returns true if the user says "Yes"; false for "No" or otherwise rejecting the dialog.

void casa::PlotMSPlotter::summarize ( )
privateslot

Summarize an MS.

void casa::PlotMSPlotter::synchronizeAction ( PlotMSAction::Type  action,
QAbstractButton *  button 
)

Synchronizes the given button with the given action type.

(See QtActionSynchronizer class.)

void casa::PlotMSPlotter::tabChanged ( )
privateslot

Member Data Documentation

bool casa::PlotMSPlotter::isClosed_
private

Flag for whether the widget is open or not.

Definition at line 248 of file PlotMSPlotter.qo.h.

bool casa::PlotMSPlotter::isQt_
private

Flag for whether the underlying Plotter is Qt-based or not.

Definition at line 245 of file PlotMSPlotter.qo.h.

QString casa::PlotMSPlotter::itsAboutString_
private

"About" string.

Definition at line 293 of file PlotMSPlotter.qo.h.

QMap<PlotMSAction::Type, QAction*> casa::PlotMSPlotter::itsActionMap_
private

casacore::Map between PlotMSApp actions and QActions.

Definition at line 284 of file PlotMSPlotter.qo.h.

QtActionSynchronizer casa::PlotMSPlotter::itsActionSynchronizer_
private

Action synchronizer.

Definition at line 287 of file PlotMSPlotter.qo.h.

PlotMSAnnotator casa::PlotMSPlotter::itsAnnotator_
private

Annotator tool.

Definition at line 290 of file PlotMSPlotter.qo.h.

Referenced by getAnnotator().

PlotMSAnnotatorTab* casa::PlotMSPlotter::itsAnnotatorTab_
private

Annotator tab.

Definition at line 266 of file PlotMSPlotter.qo.h.

PlotMSThread* casa::PlotMSPlotter::itsCurrentThread_
private

Current thread (or NULL for none).

Definition at line 278 of file PlotMSPlotter.qo.h.

QList<QWidget*> casa::PlotMSPlotter::itsEnableWidgets_
private

Widgets to be enabled/disabled during threading.

Definition at line 254 of file PlotMSPlotter.qo.h.

PlotMSFlaggingTab* casa::PlotMSPlotter::itsFlaggingTab_
private

Flagging tab (on the plot tab).

Definition at line 260 of file PlotMSPlotter.qo.h.

PlotMSOptionsTab* casa::PlotMSPlotter::itsOptionsTab_
private

Options tab.

Definition at line 269 of file PlotMSPlotter.qo.h.

PlotMSApp* casa::PlotMSPlotter::itsParent_
private

PlotMSApp parent.

Definition at line 242 of file PlotMSPlotter.qo.h.

Referenced by getParent().

PlotMSDataSummaryTab* casa::PlotMSPlotter::itsPlotTab_
private

Plot tab.

Definition at line 257 of file PlotMSPlotter.qo.h.

QtProgressWidget* casa::PlotMSPlotter::itsThreadProgress_
private

Widget for displaying thread progress.

Definition at line 275 of file PlotMSPlotter.qo.h.

Referenced by getProgressWidget().

QList<QToolButton*> casa::PlotMSPlotter::itsToolButtons_
private

Tool buttons on the tabs.

Definition at line 272 of file PlotMSPlotter.qo.h.

PlotMSToolsTab* casa::PlotMSPlotter::itsToolsTab_
private

Tools tab.

Definition at line 263 of file PlotMSPlotter.qo.h.

std::vector<PlotMSThread*> casa::PlotMSPlotter::itsWaitingThreads_
private

Waiting threads.

Definition at line 281 of file PlotMSPlotter.qo.h.

bool casa::PlotMSPlotter::showProgressWidget
private

Definition at line 295 of file PlotMSPlotter.qo.h.

QTabWidget* casa::PlotMSPlotter::tabWidget
private

Definition at line 297 of file PlotMSPlotter.qo.h.


The documentation for this class was generated from the following file: