##// END OF EJS Templates
Revert "Remove worse commit"...
Revert "Remove worse commit" This reverts commit a6522680236132283b040266dfb186fb73be0d8f.

File last commit:

r237:120010a3d4ff
r237:120010a3d4ff
Show More
Variable.cpp
89 lines | 2.2 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 {
A variable is now created with its dateTime too....
r212 explicit VariablePrivate(const QString &name, const QString &unit, const QString &mission,
const SqpDateTime &dateTime)
: m_Name{name},
m_Unit{unit},
m_Mission{mission},
m_DateTime{dateTime},
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 };
A variable is now created with its dateTime too....
r212 Variable::Variable(const QString &name, const QString &unit, const QString &mission,
const SqpDateTime &dateTime)
: impl{spimpl::make_unique_impl<VariablePrivate>(name, unit, mission, dateTime)}
Alexandre Leroux
Changes Variable from struct to class
r151 {
}
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
The mock plugin can now create data with view operation
r219 SqpDateTime Variable::dateTime() const noexcept
{
return impl->m_DateTime;
}
void Variable::setDataSeries(std::unique_ptr<IDataSeries> dataSeries) noexcept
Alexandre Leroux
Adds data series to a variable
r152 {
if (!impl->m_DataSeries) {
impl->m_DataSeries = std::move(dataSeries);
}
The mock plugin can now create data with view operation
r219 }
void Variable::onAddDataSeries(std::shared_ptr<IDataSeries> dataSeries) noexcept
{
if (impl->m_DataSeries) {
impl->m_DataSeries->merge(dataSeries.get());
emit dataCacheUpdated();
}
Alexandre Leroux
Adds data series to a variable
r152 }
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
Correction for pull request
r227 bool Variable::contains(const SqpDateTime &dateTime)
Variable slot is called when x range of its graph changed
r210 {
A variable is now created with its dateTime too....
r212 if (!impl->m_DateTime.contains(dateTime)) {
// The current variable dateTime isn't enough to display the dateTime requested.
// We have to update it to the new dateTime requested.
// the correspondant new data to display will be given by the cache if possible and the
// provider if necessary.
qCInfo(LOG_Variable()) << "NEW DATE NEEDED";
Revert "Remove worse commit"...
r237 impl->m_DateTime = dateTime;
The mock plugin can now create data with view operation
r219
return false;
A variable is now created with its dateTime too....
r212 }
The mock plugin can now create data with view operation
r219
return true;
Variable slot is called when x range of its graph changed
r210 }