CAVAPA-GUI  30.5.2014
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Signals | Public Member Functions | Protected Member Functions | List of all members
cavapa_gui::MainWindow Class Reference

The main window for the CAVAPA-GUI application. More...

#include <mainwindow.h>

Inheritance diagram for cavapa_gui::MainWindow:
cavapa_gui::UserInterface

Signals

void calculationCancelRequested ()
 Emitted when the user requests to cancel the calculation. More...
 
void calculationContinueRequested ()
 Emitted when the user requests to continue the calculation. More...
 
void calculationPauseRequested ()
 Emitted when the user requests to pause the calculation. More...
 
void calculationStartRequested ()
 Emitted when the user requests to start the calculation. More...
 
void calculationStopRequested ()
 Emitted when the user requests to stop the calculation. More...
 
void calibrationPointsReady (const std::vector< cavapa::CalibrationPoint > &points)
 Emitted when the user has set all the calibration points. More...
 
void generalSettingsChanged (const GeneralSettings &settings)
 Emitted when the user changes a general setting. More...
 
void graphPositionSelected (FrameTime time)
 Emitted when the user selects a position in the activity graph. More...
 
void locationChanged (int x, int y)
 Emitted when the interface is moved. More...
 
void markersReady (const std::vector< GraphMarker > &markers)
 Emitted when the user has placed all the markers. More...
 
void metadataOpened (const std::string &path)
 Emitted when the user requests to open a metadata file. More...
 
void metadataReady (const Metadata &metadata)
 Emitted when the user has input all the metadata. More...
 
void newMeasurementRequested ()
 Emitted when the user wants to start a new measurement. More...
 
void openMeasurementRequested (const std::string &path)
 Emitted when the user wants to open an existing measurement. More...
 
void redoMeasurementRequested ()
 Emitted when the user wants to redo the measurement. More...
 
void refreshRequested ()
 Emitted when the user requests to refresh cameras. More...
 
void sizeChanged (int width, int height, bool fullscreen)
 Emitted when the size of the interface changes. More...
 
void sourceAddRequested (const std::string &path)
 Emitted when the user adds a new video source. More...
 
void sourcePauseRequested (SourceID source)
 Emitted when the user requests to pause a source. More...
 
void sourcePlayRequested (SourceID source)
 Emitted when the user requests to play a source. More...
 
void sourceRemoveRequested (SourceID source)
 Emitted when the user removes a source. More...
 
void sourceSeekRequested (SourceID source, FrameTime position)
 Emitted when the user requests to seek a source to a certain position. More...
 
void sourceSettingsChanged (SourceID source, const SourceSettings &settings)
 Emitted when the user changes a setting for a source. More...
 
void sourceStepBackward (SourceID source)
 Emitted when the user steps a video one frame back. More...
 
void sourceStepForward (SourceID source)
 Emitted when the user steps a video one frame forward. More...
 
void statisticsRequested (FrameTime start, FrameTime stop, int points)
 Emitted when the user wants the frame statistics to be retrieved. More...
 
void interfaceClosed ()
 Emitted when the user closes the interface. More...
 
void exportRequested (const ExportOptions &options)
 Emitted when the user requests to export data from the graph. More...
 

Public Member Functions

 MainWindow (QMainWindow *parent=0)
 Constructs a new MainWindow having the specified parent. More...
 
void addSource (SourceID source, SourceType type, FrameTime length, const std::string &description) override
 Adds a new source to the interface. More...
 
void calculationCanceled () override
 Informs the interface that the calculation was cancelled.
 
void calculationCompleted () override
 Informs the interface that the calculation has completed.
 
void calculationContinued () override
 Informs the interface that the calculation was continued.
 
void calculationPaused () override
 Informs the interface that the calculation was paused.
 
void calculationStarted () override
 Informs the interface that the calculation has started.
 
void calculationStopped () override
 Informs the interface that the calculation has stopped.
 
std::vector< std::string > getMarkerHistory () override
 Returns the history of the recently used markers. More...
 
void newMeasurement () override
 Informs the interface that the user wants to start a new measurement.
 
void openMeasurement () override
 Informs the interface that a measurement has been opened.
 
void removeSource (SourceID source) override
 Removes the specified source from the interface. More...
 
void setCalibrationPoints (SourceID source, const std::vector< CalibrationPoint > &points) override
 Sets the calibration points for the specified source. More...
 
void setCanPause (bool flag) override
 Informs the interface whether the calculation can be paused. More...
 
void setCanSaveVideos (bool flag) override
 Sets whether videos can be saved. More...
 
void setLocation (int x, int y) override
 Sets the location of the interface. More...
 
void setMarkerHistory (const std::vector< std::string > &history) override
 Sets the history of previously input markers. More...
 
void setSize (int width, int height, bool fullscreen) override
 Sets the size of the interface. More...
 
void showMessage (const std::string &message, ErrorLevel errorLevel) override
 Displays a message in the interface. More...
 
void sourcePaused (SourceID source) override
 Informs the interface that a source was paused. More...
 
void sourcePlayStarted (SourceID source) override
 Informs the interface that playing was started for a source. More...
 
void startInterface () override
 Starts the interface.
 
void updateFrame (const FrameCapture &frame) override
 Updates the frame for a source. More...
 
void updateCalculation (const FrameStats &statistics) override
 Updates the calculation data. More...
 
void updateGeneralSettings (const GeneralSettings &settings) override
 Updates the general settings for the interface. More...
 
void updateMarkers (const std::vector< GraphMarker > &markers) override
 Updates the graph markers. More...
 
void updateMetadata (const Metadata &metadata) override
 Updates the metadata to the interface. More...
 
void updateSourceSettings (SourceID source, const SourceSettings &settings) override
 Updates the settings of the speficied source. More...
 
void updateStatistics (const std::vector< FrameStats > &stats) override
 Updates the interface with the frame statistics from a certain period. More...
 

Protected Member Functions

virtual void changeEvent (QEvent *event)
 Reimplemented for handling a state change event. More...
 
virtual void closeEvent (QCloseEvent *event)
 Reimplemented for handling a window close event. More...
 
virtual void moveEvent (QMoveEvent *event)
 Reimplemented for handling a window move event. More...
 
virtual void resizeEvent (QResizeEvent *event)
 Reimplemented for handling a window resize event. More...
 
- Protected Member Functions inherited from cavapa_gui::UserInterface
virtual void calculationCancelRequested ()=0
 Emitted when the user requests to cancel the calculation.
 
virtual void calculationContinueRequested ()=0
 Emitted when the user requests to continue the calculation.
 
virtual void calculationPauseRequested ()=0
 Emitted when the user requests to pause the calculation.
 
virtual void calculationStartRequested ()=0
 Emitted when the user requests to start the calculation.
 
virtual void calculationStopRequested ()=0
 Emitted when the user requests to stop the calculation.
 
virtual void calibrationPointsReady (const std::vector< CalibrationPoint > &points)=0
 Emitted when the user has set all the calibration points. More...
 
virtual void exportRequested (const ExportOptions &options)=0
 Emitted when the user requests to export data from the graph. More...
 
virtual void generalSettingsChanged (const GeneralSettings &settings)=0
 Emitted when the user changes a general setting. More...
 
virtual void graphPositionSelected (FrameTime time)=0
 Emitted when the user selects a position in the activity graph. More...
 
virtual void locationChanged (int x, int y)=0
 Emitted when the interface is moved. More...
 
virtual void markersReady (const std::vector< GraphMarker > &markers)=0
 Emitted when the user has placed all the markers. More...
 
virtual void metadataOpened (const std::string &path)=0
 Emitted when the user requests to open a metadata file. More...
 
virtual void metadataReady (const Metadata &metadata)=0
 Emitted when the user has input all the metadata. More...
 
virtual void newMeasurementRequested ()=0
 Emitted when the user wants to start a new measurement.
 
virtual void openMeasurementRequested (const std::string &path)=0
 Emitted when the user wants to open an existing measurement. More...
 
virtual void redoMeasurementRequested ()=0
 Emitted when the user wants to redo the measurement.
 
virtual void refreshRequested ()=0
 Emitted when the user requests to refresh cameras.
 
virtual void sizeChanged (int width, int height, bool fullscreen)=0
 Emitted when the size of the interface changes. More...
 
virtual void sourceAddRequested (const std::string &path)=0
 Emitted when the user adds a new video source. More...
 
virtual void sourcePauseRequested (SourceID source)=0
 Emitted when the user requests to pause a source. More...
 
virtual void sourcePlayRequested (SourceID source)=0
 Emitted when the user requests to play a source. More...
 
virtual void sourceSeekRequested (SourceID source, FrameTime position)=0
 Emitted when the user requests to seek a source to a certain position. More...
 
virtual void sourceRemoveRequested (SourceID source)=0
 Emitted when the user removes a source. More...
 
virtual void sourceSettingsChanged (SourceID source, const SourceSettings &settings)=0
 Emitted when the user changes a setting for a source. More...
 
virtual void sourceStepBackward (SourceID source)=0
 Emitted when the user steps a video one frame back. More...
 
virtual void sourceStepForward (SourceID source)=0
 Emitted when the user steps a video one frame forward. More...
 
virtual void statisticsRequested (FrameTime start, FrameTime stop, int points)=0
 Emitted when the user wants the frame statistics to be retrieved. More...
 
virtual void interfaceClosed ()=0
 Emitted when the user closes the interface.
 

Detailed Description

The main window for the CAVAPA-GUI application.

Author
Mika Lehtinen, Oskari Leppäaho

Constructor & Destructor Documentation

cavapa_gui::MainWindow::MainWindow ( QMainWindow *  parent = 0)
explicit

Constructs a new MainWindow having the specified parent.

Parameters
parentThe parent window.

Member Function Documentation

void cavapa_gui::MainWindow::addSource ( SourceID  source,
SourceType  type,
FrameTime  length,
const std::string &  path 
)
overridevirtual

Adds a new source to the interface.

Parameters
sourceThe ID of the source.
typeThe type of the source.
lengthThe length of the source.
pathThe path of the source.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::calculationCancelRequested ( )
signal

Emitted when the user requests to cancel the calculation.

void cavapa_gui::MainWindow::calculationContinueRequested ( )
signal

Emitted when the user requests to continue the calculation.

void cavapa_gui::MainWindow::calculationPauseRequested ( )
signal

Emitted when the user requests to pause the calculation.

void cavapa_gui::MainWindow::calculationStartRequested ( )
signal

Emitted when the user requests to start the calculation.

void cavapa_gui::MainWindow::calculationStopRequested ( )
signal

Emitted when the user requests to stop the calculation.

void cavapa_gui::MainWindow::calibrationPointsReady ( const std::vector< cavapa::CalibrationPoint > &  points)
signal

Emitted when the user has set all the calibration points.

Parameters
pointsThe set of calibration points.
void cavapa_gui::MainWindow::changeEvent ( QEvent *  event)
protectedvirtual

Reimplemented for handling a state change event.

Parameters
eventThe event object.
void cavapa_gui::MainWindow::closeEvent ( QCloseEvent *  event)
protectedvirtual

Reimplemented for handling a window close event.

Parameters
eventThe close event object.
void cavapa_gui::MainWindow::exportRequested ( const ExportOptions options)
signal

Emitted when the user requests to export data from the graph.

Parameters
optionsThe parameters for the export.
void cavapa_gui::MainWindow::generalSettingsChanged ( const GeneralSettings settings)
signal

Emitted when the user changes a general setting.

Parameters
settingsThe new GeneralSettings object.
std::vector< string > cavapa_gui::MainWindow::getMarkerHistory ( )
overridevirtual

Returns the history of the recently used markers.

Returns
The history of the recently used markers as a vector of strings.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::graphPositionSelected ( FrameTime  time)
signal

Emitted when the user selects a position in the activity graph.

Parameters
timeThe time of the position.
void cavapa_gui::MainWindow::interfaceClosed ( )
signal

Emitted when the user closes the interface.

void cavapa_gui::MainWindow::locationChanged ( int  x,
int  y 
)
signal

Emitted when the interface is moved.

Parameters
xThe x-coordinate of the interface.
yThe y-coordinate of the interface.
void cavapa_gui::MainWindow::markersReady ( const std::vector< GraphMarker > &  markers)
signal

Emitted when the user has placed all the markers.

Parameters
markersThe vector containing the markers.
Remarks
At the moment, this signal is emitted when the calculation completes.
void cavapa_gui::MainWindow::metadataOpened ( const std::string &  path)
signal

Emitted when the user requests to open a metadata file.

Parameters
pathThe path of the file that was selected.
void cavapa_gui::MainWindow::metadataReady ( const Metadata metadata)
signal

Emitted when the user has input all the metadata.

Parameters
metadataThe Metadata object representing the user input.
void cavapa_gui::MainWindow::moveEvent ( QMoveEvent *  event)
protectedvirtual

Reimplemented for handling a window move event.

Parameters
eventThe move event object.
void cavapa_gui::MainWindow::newMeasurementRequested ( )
signal

Emitted when the user wants to start a new measurement.

void cavapa_gui::MainWindow::openMeasurementRequested ( const std::string &  path)
signal

Emitted when the user wants to open an existing measurement.

Parameters
pathThe path to the measurement's XML file.
void cavapa_gui::MainWindow::redoMeasurementRequested ( )
signal

Emitted when the user wants to redo the measurement.

void cavapa_gui::MainWindow::refreshRequested ( )
signal

Emitted when the user requests to refresh cameras.

void cavapa_gui::MainWindow::removeSource ( SourceID  source)
overridevirtual

Removes the specified source from the interface.

Parameters
sourceThe id of the source to be removed.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::resizeEvent ( QResizeEvent *  event)
protectedvirtual

Reimplemented for handling a window resize event.

Parameters
eventThe resize event object.
void cavapa_gui::MainWindow::setCalibrationPoints ( SourceID  source,
const std::vector< CalibrationPoint > &  points 
)
overridevirtual

Sets the calibration points for the specified source.

Parameters
sourceThe id of the source whose calibration points will be set.
pointsThe collection of calibration points.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::setCanPause ( bool  flag)
overridevirtual

Informs the interface whether the calculation can be paused.

Parameters
flagTrue if the calculation can be paused, false otherwise.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::setCanSaveVideos ( bool  flag)
overridevirtual

Sets whether videos can be saved.

Parameters
flagTrue if videos can be saved, false otherwise.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::setLocation ( int  x,
int  y 
)
overridevirtual

Sets the location of the interface.

Parameters
xThe x-coordinate of the interface.
yThe y-coordinate of the interface.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::setMarkerHistory ( const std::vector< std::string > &  history)
overridevirtual

Sets the history of previously input markers.

Parameters
historyThe collection of strings representing the history.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::setSize ( int  width,
int  height,
bool  fullscreen 
)
overridevirtual

Sets the size of the interface.

Parameters
widthThe desired width of the interface.
heightThe desired height of the interface.
fullscreenWhether the interface is in fullscreen mode or not.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::showMessage ( const std::string &  message,
ErrorLevel  level 
)
overridevirtual

Displays a message in the interface.

Parameters
messageThe message to be displayed.
levelThe severity level of the message.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::sizeChanged ( int  width,
int  height,
bool  fullscreen 
)
signal

Emitted when the size of the interface changes.

Parameters
widthThe new width of the interface.
heightThe new height of the interface.
fullscreenWhether the interface is in fullscreen mode or not.
void cavapa_gui::MainWindow::sourceAddRequested ( const std::string &  path)
signal

Emitted when the user adds a new video source.

Parameters
pathThe path of the source.
void cavapa_gui::MainWindow::sourcePaused ( SourceID  source)
overridevirtual

Informs the interface that a source was paused.

Parameters
sourceThe id of the source that was paused.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::sourcePauseRequested ( SourceID  source)
signal

Emitted when the user requests to pause a source.

Parameters
sourceThe id of the source to be paused.
void cavapa_gui::MainWindow::sourcePlayRequested ( SourceID  source)
signal

Emitted when the user requests to play a source.

Parameters
sourceThe id of the source to play.
void cavapa_gui::MainWindow::sourcePlayStarted ( SourceID  source)
overridevirtual

Informs the interface that playing was started for a source.

Parameters
sourceThe source that is being played.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::sourceRemoveRequested ( SourceID  source)
signal

Emitted when the user removes a source.

Parameters
sourceThe source ID to be removed.
void cavapa_gui::MainWindow::sourceSeekRequested ( SourceID  source,
FrameTime  position 
)
signal

Emitted when the user requests to seek a source to a certain position.

Parameters
sourceThe id of the source to be sought.
positionThe requested position.
void cavapa_gui::MainWindow::sourceSettingsChanged ( SourceID  source,
const SourceSettings settings 
)
signal

Emitted when the user changes a setting for a source.

Parameters
sourceThe source ID for which a setting was changed.
settingsThe new settings for the source.
void cavapa_gui::MainWindow::sourceStepBackward ( SourceID  source)
signal

Emitted when the user steps a video one frame back.

Parameters
sourceThe source that was stepped.
void cavapa_gui::MainWindow::sourceStepForward ( SourceID  source)
signal

Emitted when the user steps a video one frame forward.

Parameters
sourceThe source that was stepped.
void cavapa_gui::MainWindow::statisticsRequested ( FrameTime  start,
FrameTime  stop,
int  points 
)
signal

Emitted when the user wants the frame statistics to be retrieved.

Parameters
startThe starting point of the period.
stopThe end point of the period.
pointsThe number of points desired to be returned.
void cavapa_gui::MainWindow::updateCalculation ( const FrameStats statistics)
overridevirtual

Updates the calculation data.

Parameters
statisticsThe frame calculation statistics.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::updateFrame ( const FrameCapture frame)
overridevirtual

Updates the frame for a source.

Parameters
frameThe FrameCapture structure containing the new frame and the source ID.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::updateGeneralSettings ( const GeneralSettings settings)
overridevirtual

Updates the general settings for the interface.

Parameters
settingsThe object describing the new settings.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::updateMarkers ( const std::vector< GraphMarker > &  markers)
overridevirtual

Updates the graph markers.

Parameters
markersA vector containing the markers.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::updateMetadata ( const Metadata metadata)
overridevirtual

Updates the metadata to the interface.

Parameters
metadataThe Metadata object.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::updateSourceSettings ( SourceID  source,
const SourceSettings settings 
)
overridevirtual

Updates the settings of the speficied source.

Parameters
sourceThe ID of the source whose settings should be updated.
settingsThe new settings for the source.

Implements cavapa_gui::UserInterface.

void cavapa_gui::MainWindow::updateStatistics ( const std::vector< FrameStats > &  stats)
overridevirtual

Updates the interface with the frame statistics from a certain period.

Parameters
statsStatistical information.

Implements cavapa_gui::UserInterface.


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