##// END OF EJS Templates
Reads variable's metadata to retrieve the type of data series (scalar, vector, spectrogram)
Reads variable's metadata to retrieve the type of data series (scalar, vector, spectrogram)

File last commit:

r933:ba45dcc66c3a
r1279:88939ef97b8f
Show More
VariableModel.h
111 lines | 3.9 KiB | text/x-c | CLexer
Alexandre Leroux
Creates the variable model...
r112 #ifndef SCIQLOP_VARIABLEMODEL_H
#define SCIQLOP_VARIABLEMODEL_H
Alexandre Leroux
Exports core module as a shared library...
r461 #include "CoreGlobal.h"
A variable is now created with its dateTime too....
r228
Change SqpRange for SqpDateTime
r512 #include <Data/SqpRange.h>
Alexandre Leroux
Creates the variable model...
r112
Alexandre Leroux
Adapts VariableModel to be a QabstractTableModel...
r149 #include <QAbstractTableModel>
Alexandre Leroux
Creates the variable model...
r112 #include <QLoggingCategory>
Alexandre Leroux
Fixes refresh problem in Variable widget
r368 #include <Common/MetaTypes.h>
A variable is now created with its dateTime too....
r228 #include <Common/spimpl.h>
Alexandre Leroux
Creates the variable model...
r112 Q_DECLARE_LOGGING_CATEGORY(LOG_VariableModel)
Correction MR
r402 enum VariableRoles { ProgressRole = Qt::UserRole };
Add implementation of progress bar on variable inspector connected to...
r401
Alexandre Leroux
Updates VariableModel::createVariable() method...
r165 class IDataSeries;
Alexandre Leroux
Creates the variable model...
r112 class Variable;
Drag of variables
r849 class VariableController;
Alexandre Leroux
Creates the variable model...
r112
/**
* @brief The VariableModel class aims to hold the variables that have been created in SciQlop
*/
Alexandre Leroux
Exports core module as a shared library...
r461 class SCIQLOP_CORE_EXPORT VariableModel : public QAbstractTableModel {
Implement of the abort download process
r422 Q_OBJECT
Alexandre Leroux
Creates the variable model...
r112 public:
Drag of variables
r849 explicit VariableModel(VariableController *parent = nullptr);
Alexandre Leroux
Creates the variable model...
r112
Alexandre Leroux
Adds variable to model
r708 /**
* Adds an existing variable in the model.
* @param variable the variable to add.
* @remarks the variable's name is modified to avoid name duplicates
* @remarks this method does nothing if the variable already exists in the model
*/
void addVariable(std::shared_ptr<Variable> variable) noexcept;
Alexandre Leroux
Creates duplicate only if the variable is in the model
r710 /**
* Checks that a variable is contained in the model
* @param variable the variable to check
* @return true if the variable is in the model, false otherwise
*/
bool containsVariable(std::shared_ptr<Variable> variable) const noexcept;
Alexandre Leroux
Creates the variable model...
r112 /**
* Creates a new variable in the model
* @param name the name of the new variable
Alexandre Leroux
Updates variable creation to pass metadata...
r410 * @param metadata the metadata associated to the new variable
Alexandre Leroux
Updates VariableModel::createVariable() method...
r165 * @return the pointer to the new variable
Alexandre Leroux
Creates the variable model...
r112 */
Fix bug when creating two variables crash the app. ...
r756 std::shared_ptr<Variable> createVariable(const QString &name,
Alexandre Leroux
Updates variable creation to pass metadata...
r410 const QVariantHash &metadata) noexcept;
Alexandre Leroux
Creates the variable model...
r112
Alexandre Leroux
Variable deletion (3)...
r332 /**
* Deletes a variable from the model, if it exists
* @param variable the variable to delete
*/
void deleteVariable(std::shared_ptr<Variable> variable) noexcept;
Add implementation of progress bar on variable inspector connected to...
r401
Alexandre Leroux
Retrieves the current selected variable when clicking on the variable widget
r246 std::shared_ptr<Variable> variable(int index) const;
Alexandre Leroux
Adds method to get all variables from model...
r684 std::vector<std::shared_ptr<Variable> > variables() const;
Alexandre Leroux
Retrieves the current selected variable when clicking on the variable widget
r246
Add implementation of progress bar on variable inspector connected to...
r401 void setDataProgress(std::shared_ptr<Variable> variable, double progress);
Implement of the abort download process
r422
Alexandre Leroux
Adapts VariableModel to be a QabstractTableModel...
r149 // /////////////////////////// //
// QAbstractTableModel methods //
// /////////////////////////// //
Add implementation of progress bar on variable inspector connected to...
r401
Alexandre Leroux
Adapts VariableModel to be a QabstractTableModel...
r149 virtual int columnCount(const QModelIndex &parent = QModelIndex{}) const override;
virtual int rowCount(const QModelIndex &parent = QModelIndex{}) const override;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
Drag of variables
r849 virtual Qt::ItemFlags flags(const QModelIndex &index) const override;
// ///////////////// //
// Drag&Drop methods //
// ///////////////// //
virtual Qt::DropActions supportedDropActions() const override;
virtual Qt::DropActions supportedDragActions() const override;
virtual QStringList mimeTypes() const override;
virtual QMimeData *mimeData(const QModelIndexList &indexes) const override;
virtual bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column,
const QModelIndex &parent) const override;
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column,
const QModelIndex &parent) override;
Implement of the abort download process
r422
void abortProgress(const QModelIndex &index);
signals:
void abortProgessRequested(std::shared_ptr<Variable> variable);
Drop of product in variables
r870 void requestVariable(const QVariantHash &productData);
Drop TIME mime data on a variable
r933 void requestVariableRangeUpdate(std::shared_ptr<Variable> variable, const SqpRange &range);
Implement of the abort download process
r422
Alexandre Leroux
Creates the variable model...
r112 private:
class VariableModelPrivate;
spimpl::unique_impl_ptr<VariableModelPrivate> impl;
Alexandre Leroux
Fixes refresh problem in Variable widget
r368
private slots:
/// Slot called when data of a variable has been updated
void onVariableUpdated() noexcept;
Alexandre Leroux
Creates the variable model...
r112 };
Alexandre Leroux
Fixes refresh problem in Variable widget
r368 // Registers QVector<int> metatype so it can be used in VariableModel::dataChanged() signal
SCIQLOP_REGISTER_META_TYPE(QVECTOR_INT_REGISTRY, QVector<int>)
Alexandre Leroux
Creates the variable model...
r112 #endif // SCIQLOP_VARIABLEMODEL_H