##// END OF EJS Templates
Variable slot is called when x range of its graph changed
Variable slot is called when x range of its graph changed

File last commit:

r210:f1820cb4eabb
r210:f1820cb4eabb
Show More
Variable.cpp
58 lines | 1.4 KiB | text/x-c | CppLexer
Alexandre Leroux
Changes Variable from struct to class
r151 #include "Variable/Variable.h"
Alexandre Leroux
Adds data series to a variable
r152 #include <Data/IDataSeries.h>
Variable slot is called when x range of its graph changed
r210 #include <Data/SqpDateTime.h>
Q_LOGGING_CATEGORY(LOG_Variable, "Variable")
Alexandre Leroux
Adds data series to a variable
r152
Alexandre Leroux
Changes Variable from struct to class
r151 struct Variable::VariablePrivate {
explicit VariablePrivate(const QString &name, const QString &unit, const QString &mission)
Alexandre Leroux
Adds data series to a variable
r152 : m_Name{name}, m_Unit{unit}, m_Mission{mission}, m_DataSeries{nullptr}
Alexandre Leroux
Changes Variable from struct to class
r151 {
}
QString m_Name;
QString m_Unit;
QString m_Mission;
Variable slot is called when x range of its graph changed
r210
SqpDateTime m_DateTime; // The dateTime available in the view and loaded. not the cache.
Alexandre Leroux
Adds data series to a variable
r152 std::unique_ptr<IDataSeries> m_DataSeries;
Alexandre Leroux
Changes Variable from struct to class
r151 };
Variable::Variable(const QString &name, const QString &unit, const QString &mission)
: impl{spimpl::make_unique_impl<VariablePrivate>(name, unit, mission)}
{
}
QString Variable::name() const noexcept
{
return impl->m_Name;
}
QString Variable::mission() const noexcept
{
return impl->m_Mission;
}
QString Variable::unit() const noexcept
{
return impl->m_Unit;
}
Alexandre Leroux
Adds data series to a variable
r152
void Variable::addDataSeries(std::unique_ptr<IDataSeries> dataSeries) noexcept
{
if (!impl->m_DataSeries) {
impl->m_DataSeries = std::move(dataSeries);
}
/// @todo : else, merge the two data series (if possible)
}
Alexandre Leroux
Handles creations for scalar series
r169
IDataSeries *Variable::dataSeries() const noexcept
{
return impl->m_DataSeries.get();
}
Variable slot is called when x range of its graph changed
r210
void Variable::onXRangeChanged(SqpDateTime dateTime)
{
qCInfo(LOG_Variable()) << "onXRangeChanged detected";
}