VariableController.h
61 lines
| 1.7 KiB
| text/x-c
|
CLexer
Alexandre Leroux
|
r111 | #ifndef SCIQLOP_VARIABLECONTROLLER_H | ||
#define SCIQLOP_VARIABLECONTROLLER_H | ||||
r235 | #include <Data/SqpDateTime.h> | |||
Alexandre Leroux
|
r111 | #include <QLoggingCategory> | ||
#include <QObject> | ||||
#include <Common/spimpl.h> | ||||
Alexandre Leroux
|
r166 | class IDataProvider; | ||
r304 | class QItemSelectionModel; | |||
r193 | class TimeController; | |||
Alexandre Leroux
|
r113 | class Variable; | ||
Alexandre Leroux
|
r152 | class VariableModel; | ||
Alexandre Leroux
|
r111 | Q_DECLARE_LOGGING_CATEGORY(LOG_VariableController) | ||
/** | ||||
* @brief The VariableController class aims to handle the variables in SciQlop. | ||||
*/ | ||||
class VariableController : public QObject { | ||||
Q_OBJECT | ||||
public: | ||||
explicit VariableController(QObject *parent = 0); | ||||
virtual ~VariableController(); | ||||
Alexandre Leroux
|
r166 | VariableModel *variableModel() noexcept; | ||
r304 | QItemSelectionModel *variableSelectionModel() noexcept; | |||
Alexandre Leroux
|
r166 | |||
r193 | void setTimeController(TimeController *timeController) noexcept; | |||
r235 | ||||
Alexandre Leroux
|
r166 | signals: | ||
/// Signal emitted when a variable has been created | ||||
void variableCreated(std::shared_ptr<Variable> variable); | ||||
public slots: | ||||
r298 | /// Request the data loading of the variable whithin dateTime | |||
void onRequestDataLoading(std::shared_ptr<Variable> variable, const SqpDateTime &dateTime); | ||||
Alexandre Leroux
|
r113 | /** | ||
Alexandre Leroux
|
r166 | * Creates a new variable and adds it to the model | ||
Alexandre Leroux
|
r113 | * @param name the name of the new variable | ||
Alexandre Leroux
|
r166 | * @param provider the data provider for the new variable | ||
Alexandre Leroux
|
r113 | */ | ||
Alexandre Leroux
|
r166 | void createVariable(const QString &name, std::shared_ptr<IDataProvider> provider) noexcept; | ||
Alexandre Leroux
|
r113 | |||
r304 | /// Update the temporal parameters of every selected variable to dateTime | |||
void onDateTimeOnSelection(const SqpDateTime &dateTime); | ||||
Alexandre Leroux
|
r111 | void initialize(); | ||
void finalize(); | ||||
private: | ||||
void waitForFinish(); | ||||
class VariableControllerPrivate; | ||||
spimpl::unique_impl_ptr<VariableControllerPrivate> impl; | ||||
}; | ||||
#endif // SCIQLOP_VARIABLECONTROLLER_H | ||||