OGS
|
A dialog that allows for setting preferences for a requested diagram.
A dialog that allows for setting preferences for a requested diagram. Note: In the current version this dialog only works when requesting data from a database. Visualisation of data from an ASCII-file is still possible using the "Load File"-button but setting the preferences will not work (i.e. it is only possible to visualise all the data in the file with default preferences.
Definition at line 38 of file DiagramPrefsDialog.h.
#include <DiagramPrefsDialog.h>
Public Member Functions | |
DiagramPrefsDialog (const GeoLib::Station *stn, const QString &listName, QDialog *parent=nullptr) | |
DiagramPrefsDialog (GeoLib::Station *stn, QDialog *parent=nullptr) | |
DiagramPrefsDialog (const QString &filename, DetailWindow *window=nullptr, QDialog *parent=nullptr) | |
~DiagramPrefsDialog () override | |
Private Slots | |
void | accept () override |
void | reject () override |
Instructions if the Cancel-Button has been pressed. | |
void | on_loadFileButton_clicked () |
Instructions if the "Load File"-Button has been pressed. | |
Private Member Functions | |
void | createVisibilityCheckboxes () |
int | loadFile (const QString &filename) |
int | loadList (const std::vector< std::pair< QDateTime, float > > &coords) |
Private Attributes | |
std::vector< DiagramList * > | _list |
std::vector< QCheckBox * > | _visability |
DetailWindow * | _window |
DiagramPrefsDialog::DiagramPrefsDialog | ( | const GeoLib::Station * | stn, |
const QString & | listName, | ||
QDialog * | parent = nullptr ) |
Opens a new dialog based on station and the list this station belongs to. If a database connection is available, the program will try to find data associated with the station, otherwise data can be loaded from a file.
stn | The station object associated the diagram. |
listName | The station list the station belongs to. |
parent | The parent QDialog. |
Definition at line 27 of file DiagramPrefsDialog.cpp.
References GeoLib::Station::getName().
|
explicit |
Opens a new dialog and automatically reads data from the associated station object.
stn | The station object associated the diagram. |
parent | The parent QDialog. |
Definition at line 40 of file DiagramPrefsDialog.cpp.
References _list, createVisibilityCheckboxes(), SensorData::getEndTime(), GeoLib::Station::getName(), GeoLib::Station::getSensorData(), SensorData::getStartTime(), and DiagramList::readList().
|
explicit |
Opens a new dialog and automatically reads data from the specified file. The diagram is not associated with any geometric object.
filename | File containing data for the diagram(s) to be visualised. | |
[out] | window | Returns the created DetailWindow. |
parent | The parent QDialog. |
Definition at line 54 of file DiagramPrefsDialog.cpp.
References loadFile().
|
override |
Definition at line 66 of file DiagramPrefsDialog.cpp.
|
overrideprivateslot |
Instructions if the OK-Button has been pressed. Note: Clicking the "Load from file"-button overrides the database input!
Definition at line 71 of file DiagramPrefsDialog.cpp.
References _list, _visability, _window, DetailWindow::addList(), OGSError::box(), and getDateTime().
|
private |
Creates checkboxes for every list of data values found. Per default all of these are checked, i.e. all diagrams will be visualised. Any checkbox the user unchecks will result in the associated data not being visualised.
Definition at line 186 of file DiagramPrefsDialog.cpp.
References _list, and _visability.
Referenced by DiagramPrefsDialog(), and loadFile().
|
private |
Loading data from a file
filename | Name of the file containing the data |
Definition at line 141 of file DiagramPrefsDialog.cpp.
References _list, OGSError::box(), createVisibilityCheckboxes(), and DiagramList::readList().
Referenced by DiagramPrefsDialog(), and on_loadFileButton_clicked().
|
private |
Setting up the QDiagramList object were the time series data will be stored
coords | List of coordinates. |
Definition at line 167 of file DiagramPrefsDialog.cpp.
References _list, and DiagramList::setName().
|
privateslot |
Instructions if the "Load File"-Button has been pressed.
Definition at line 128 of file DiagramPrefsDialog.cpp.
References loadFile().
|
overrideprivateslot |
Instructions if the Cancel-Button has been pressed.
Definition at line 123 of file DiagramPrefsDialog.cpp.
|
private |
Definition at line 99 of file DiagramPrefsDialog.h.
Referenced by DiagramPrefsDialog(), accept(), createVisibilityCheckboxes(), loadFile(), and loadList().
|
private |
Definition at line 100 of file DiagramPrefsDialog.h.
Referenced by accept(), and createVisibilityCheckboxes().
|
private |
Definition at line 101 of file DiagramPrefsDialog.h.
Referenced by accept().