35 #include <QMainWindow>
36 #include <QPushButton>
39 #include "userinterface.h"
41 #include "controller.h"
42 #include "scenewidget.h"
44 using cavapa::CalibrationPoint;
70 const std::string& description)
override;
94 const std::vector<CalibrationPoint>& points)
override;
104 void setSize(
int width,
int height,
bool fullscreen)
override;
121 void updateMarkers(
const std::vector<GraphMarker>& markers)
override;
136 bool askConfirmation(
const std::string& question)
override;
143 std::shared_ptr<SceneWidget> getScene(
SourceID id)
const;
150 void setAddCalibrationPointsEnabled(
bool enable);
157 void setGraphVisible(
bool visible);
166 void setSliderValueFromLineEdit(QObject* lineEdit,
float scale,
173 void updateSlidersFromScene();
175 std::vector<std::shared_ptr<SceneWidget>> scenes;
177 bool calculationInProgress =
false;
178 bool canPause =
false;
179 bool canAddCalibrationPoints =
false;
188 void emitMarkersReady();
193 void graphSettingsChanged();
218 void changeActiveScene(
SceneWidget* newActiveScene);
220 void on_buttonStart_clicked();
222 void on_actionOpen_video_triggered();
224 void on_actionRefresh_cameras_triggered();
226 void on_cancelButton_clicked();
228 void on_actionSettings_triggered();
230 void on_actionOpen_link_triggered();
232 void on_actionAbout_triggered();
234 void on_addStreamButton_clicked();
236 void on_addVideoFileButton_clicked();
238 void on_stopButton_clicked();
240 void on_horizontalSliderHeight_sliderMoved(
int position);
242 void on_lineEditHeight_returnPressed();
244 void on_horizontalSliderXRot_sliderMoved(
int position);
246 void on_lineEditXRot_returnPressed();
248 void on_horizontalSliderYRot_sliderMoved(
int position);
250 void on_lineEditYRot_returnPressed();
252 void on_horizontalSliderZRot_sliderMoved(
int position);
254 void on_lineEditZRot_returnPressed();
256 void on_horizontalSliderFov_sliderMoved(
int position);
258 void on_lineEditFov_returnPressed();
260 void on_actionOpen_existing_measurement_triggered();
262 void on_actionNew_measurement_triggered();
264 void on_sourceList_itemSelectionChanged();
266 void on_actionRedo_current_measurement_triggered();
268 void on_pauseButton_clicked();
270 void on_continueButton_clicked();
272 void on_pushButtonDefaultConfig_clicked();
291 virtual void moveEvent(QMoveEvent* event);
329 const std::vector<cavapa::CalibrationPoint>& points);
349 void markersReady(
const std::vector<GraphMarker>& markers);
384 void sizeChanged(
int width,
int height,
bool fullscreen);
443 #endif // MAINWINDOW_H
void sourceSettingsChanged(SourceID source, const SourceSettings &settings)
Emitted when the user changes a setting for a source.
void sourceAddRequested(const std::string &path)
Emitted when the user adds a new video source.
void setMarkerHistory(const std::vector< std::string > &history) override
Sets the history of previously input markers.
Definition: mainwindow.cpp:311
void interfaceClosed()
Emitted when the user closes the interface.
void calculationCanceled() override
Informs the interface that the calculation was cancelled.
Definition: mainwindow.cpp:166
void setSize(int width, int height, bool fullscreen) override
Sets the size of the interface.
Definition: mainwindow.cpp:316
void sourcePauseRequested(SourceID source)
Emitted when the user requests to pause a source.
void sourceRemoveRequested(SourceID source)
Emitted when the user removes a source.
void calculationContinued() override
Informs the interface that the calculation was continued.
Definition: mainwindow.cpp:184
void updateMetadata(const Metadata &metadata) override
Updates the metadata to the interface.
Definition: mainwindow.cpp:585
void sizeChanged(int width, int height, bool fullscreen)
Emitted when the size of the interface changes.
void sourceStepBackward(SourceID source)
Emitted when the user steps a video one frame back.
void calculationStartRequested()
Emitted when the user requests to start the calculation.
virtual void resizeEvent(QResizeEvent *event)
Reimplemented for handling a window resize event.
Definition: mainwindow.cpp:355
Structure for holding frame statistics on activity.
Definition: common.h:285
void setLocation(int x, int y) override
Sets the location of the interface.
Definition: mainwindow.cpp:303
unsigned int SourceID
Used to indicate unique source ID-numbers.
Definition: common.h:229
void calculationContinueRequested()
Emitted when the user requests to continue the calculation.
void openMeasurement() override
Informs the interface that a measurement has been opened.
Definition: mainwindow.cpp:249
void calibrationPointsReady(const std::vector< cavapa::CalibrationPoint > &points)
Emitted when the user has set all the calibration points.
void calculationStopRequested()
Emitted when the user requests to stop the calculation.
void sourcePlayStarted(SourceID source) override
Informs the interface that playing was started for a source.
Definition: mainwindow.cpp:512
void setCalibrationPoints(SourceID source, const std::vector< CalibrationPoint > &points) override
Sets the calibration points for the specified source.
Definition: mainwindow.cpp:286
void updateGeneralSettings(const GeneralSettings &settings) override
Updates the general settings for the interface.
Definition: mainwindow.cpp:574
virtual void changeEvent(QEvent *event)
Reimplemented for handling a state change event.
Definition: mainwindow.cpp:361
void statisticsRequested(FrameTime start, FrameTime stop, int points)
Emitted when the user wants the frame statistics to be retrieved.
void generalSettingsChanged(const GeneralSettings &settings)
Emitted when the user changes a general setting.
void metadataOpened(const std::string &path)
Emitted when the user requests to open a metadata file.
void calculationCompleted() override
Informs the interface that the calculation has completed.
Definition: mainwindow.cpp:177
void markersReady(const std::vector< GraphMarker > &markers)
Emitted when the user has placed all the markers.
void setCanPause(bool flag) override
Informs the interface whether the calculation can be paused.
Definition: mainwindow.cpp:293
void calculationCancelRequested()
Emitted when the user requests to cancel the calculation.
void updateFrame(const FrameCapture &frame) override
Updates the frame for a source.
Definition: mainwindow.cpp:559
Represents the settings for a video source.
Definition: sourcesettings.h:46
virtual void closeEvent(QCloseEvent *event)
Reimplemented for handling a window close event.
Definition: mainwindow.cpp:325
SourceType
Available source types are the following ones: CAMERA = hardware or network camera, NOTHING = not a working source, STREAM = network stream, VIDEO = video file and VIDEOSET = set of multiple files.
Definition: common.h:68
void startInterface() override
Starts the interface.
Definition: mainwindow.cpp:554
Represents the general settings of the application.
Definition: generalsettings.h:43
void sourceSeekRequested(SourceID source, FrameTime position)
Emitted when the user requests to seek a source to a certain position.
virtual void moveEvent(QMoveEvent *event)
Reimplemented for handling a window move event.
Definition: mainwindow.cpp:349
void exportRequested(const ExportOptions &options)
Emitted when the user requests to export data from the graph.
std::uint64_t FrameTime
Used to store milliseconds interval in frame times.
Definition: common.h:138
void locationChanged(int x, int y)
Emitted when the interface is moved.
void newMeasurementRequested()
Emitted when the user wants to start a new measurement.
void calculationPaused() override
Informs the interface that the calculation was paused.
Definition: mainwindow.cpp:192
void sourcePaused(SourceID source) override
Informs the interface that a source was paused.
Definition: mainwindow.cpp:506
The structure is used for storing a single source frame.
Definition: common.h:241
void addSource(SourceID source, SourceType type, FrameTime length, const std::string &description) override
Adds a new source to the interface.
Definition: mainwindow.cpp:109
void showMessage(const std::string &message, ErrorLevel errorLevel) override
Displays a message in the interface.
Definition: mainwindow.cpp:466
void graphPositionSelected(FrameTime time)
Emitted when the user selects a position in the activity graph.
void updateSourceSettings(SourceID source, const SourceSettings &settings) override
Updates the settings of the speficied source.
Definition: mainwindow.cpp:590
The main window for the CAVAPA-GUI application.
Definition: mainwindow.h:58
std::vector< std::string > getMarkerHistory() override
Returns the history of the recently used markers.
Definition: mainwindow.cpp:229
The structure holds CSV export options.
Definition: common.h:183
void setCanSaveVideos(bool flag) override
Sets whether videos can be saved.
Definition: mainwindow.cpp:298
void updateStatistics(const std::vector< FrameStats > &stats) override
Updates the interface with the frame statistics from a certain period.
Definition: mainwindow.cpp:603
void calculationStarted() override
Informs the interface that the calculation has started.
Definition: mainwindow.cpp:200
void openMeasurementRequested(const std::string &path)
Emitted when the user wants to open an existing measurement.
void refreshRequested()
Emitted when the user requests to refresh cameras.
void updateCalculation(const FrameStats &statistics) override
Updates the calculation data.
Definition: mainwindow.cpp:568
void newMeasurement() override
Informs the interface that the user wants to start a new measurement.
Definition: mainwindow.cpp:234
MainWindow(QMainWindow *parent=0)
Constructs a new MainWindow having the specified parent.
Definition: mainwindow.cpp:43
void redoMeasurementRequested()
Emitted when the user wants to redo the measurement.
void calculationStopped() override
Informs the interface that the calculation has stopped.
Definition: mainwindow.cpp:215
void updateMarkers(const std::vector< GraphMarker > &markers) override
Updates the graph markers.
Definition: mainwindow.cpp:580
ErrorLevel
Error level indicator.
Definition: common.h:77
void calculationPauseRequested()
Emitted when the user requests to pause the calculation.
void sourceStepForward(SourceID source)
Emitted when the user steps a video one frame forward.
void metadataReady(const Metadata &metadata)
Emitted when the user has input all the metadata.
The UserInterface class defines the methods and signals that a user interface needs to have...
Definition: userinterface.h:52
void removeSource(SourceID source) override
Removes the specified source from the interface.
Definition: mainwindow.cpp:264
void sourcePlayRequested(SourceID source)
Emitted when the user requests to play a source.