VisualizationController.cpp
54 lines
| 1.6 KiB
| text/x-c
|
CppLexer
r53 | #include <Visualization/VisualizationController.h> | |||
|
r170 | #include <Variable/Variable.h> | ||
r53 | #include <QMutex> | |||
#include <QThread> | ||||
#include <QDir> | ||||
#include <QStandardPaths> | ||||
Q_LOGGING_CATEGORY(LOG_VisualizationController, "VisualizationController") | ||||
class VisualizationController::VisualizationControllerPrivate { | ||||
public: | ||||
QMutex m_WorkingMutex; | ||||
}; | ||||
VisualizationController::VisualizationController(QObject *parent) | ||||
: impl{spimpl::make_unique_impl<VisualizationControllerPrivate>()} | ||||
{ | ||||
r76 | qCDebug(LOG_VisualizationController()) << tr("VisualizationController construction") | |||
<< QThread::currentThread(); | ||||
r53 | } | |||
VisualizationController::~VisualizationController() | ||||
{ | ||||
r76 | qCDebug(LOG_VisualizationController()) << tr("VisualizationController destruction") | |||
<< QThread::currentThread(); | ||||
r53 | this->waitForFinish(); | |||
} | ||||
|
r170 | void VisualizationController::onVariableCreated(std::shared_ptr<Variable> variable) noexcept | ||
{ | ||||
/// @todo ALX : make new graph for the variable | ||||
qCDebug(LOG_VisualizationController()) << "new variable to display"; | ||||
} | ||||
r53 | void VisualizationController::initialize() | |||
{ | ||||
r76 | qCDebug(LOG_VisualizationController()) << tr("VisualizationController init") | |||
<< QThread::currentThread(); | ||||
r53 | impl->m_WorkingMutex.lock(); | |||
qCDebug(LOG_VisualizationController()) << tr("VisualizationController init END"); | ||||
} | ||||
void VisualizationController::finalize() | ||||
{ | ||||
impl->m_WorkingMutex.unlock(); | ||||
} | ||||
void VisualizationController::waitForFinish() | ||||
{ | ||||
QMutexLocker locker{&impl->m_WorkingMutex}; | ||||
} | ||||