VariableController.h
75 lines
| 2.2 KiB
| text/x-c
|
CLexer
|
r111 | #ifndef SCIQLOP_VARIABLECONTROLLER_H | ||
#define SCIQLOP_VARIABLECONTROLLER_H | ||||
r235 | #include <Data/SqpDateTime.h> | |||
|
r111 | #include <QLoggingCategory> | ||
#include <QObject> | ||||
#include <Common/spimpl.h> | ||||
|
r166 | class IDataProvider; | ||
r304 | class QItemSelectionModel; | |||
r193 | class TimeController; | |||
|
r113 | class Variable; | ||
|
r152 | class VariableModel; | ||
|
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(); | ||||
|
r166 | VariableModel *variableModel() noexcept; | ||
r304 | QItemSelectionModel *variableSelectionModel() noexcept; | |||
|
r166 | |||
r193 | void setTimeController(TimeController *timeController) noexcept; | |||
|
r329 | /** | ||
* Deletes from the controller the variable passed in parameter. | ||||
* | ||||
* | ||||
* @param variable the variable to delete from the controller. | ||||
*/ | ||||
void deleteVariable(std::shared_ptr<Variable> variable) noexcept; | ||||
/** | ||||
* Deletes from the controller the variables passed in parameter. | ||||
* @param variables the variables to delete from the controller. | ||||
* @sa deleteVariable() | ||||
*/ | ||||
void deleteVariables(const QVector<std::shared_ptr<Variable> > &variables) noexcept; | ||||
r235 | ||||
|
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); | ||||
|
r113 | /** | ||
|
r166 | * Creates a new variable and adds it to the model | ||
|
r113 | * @param name the name of the new variable | ||
|
r166 | * @param provider the data provider for the new variable | ||
|
r113 | */ | ||
|
r166 | void createVariable(const QString &name, std::shared_ptr<IDataProvider> provider) noexcept; | ||
|
r113 | |||
r304 | /// Update the temporal parameters of every selected variable to dateTime | |||
void onDateTimeOnSelection(const SqpDateTime &dateTime); | ||||
|
r111 | void initialize(); | ||
void finalize(); | ||||
private: | ||||
void waitForFinish(); | ||||
class VariableControllerPrivate; | ||||
spimpl::unique_impl_ptr<VariableControllerPrivate> impl; | ||||
}; | ||||
#endif // SCIQLOP_VARIABLECONTROLLER_H | ||||