##// END OF EJS Templates
Added Y log tag for Spectrograms...
Added Y log tag for Spectrograms Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r76:9a080a34054c
r87:c6cf2dba079d
Show More
Variable2.h
98 lines | 2.6 KiB | text/x-c | CLexer
New TimeSeries integration WIP...
r62 #ifndef SCIQLOP_VARIABLE2_H
#define SCIQLOP_VARIABLE2_H
#include "CoreGlobal.h"
#include <Common/MetaTypes.h>
#include <Common/deprecate.h>
#include <Common/spimpl.h>
#include <Data/DataSeriesType.h>
#include <Data/DateTimeRange.h>
MultiComponent TS almost done, still blows up when built from python with empty data...
r76 #include <Data/MultiComponentTimeSerie.h>
New TimeSeries integration WIP...
r62 #include <Data/ScalarTimeSerie.h>
More work on new Variable python bindings...
r63 #include <Data/SpectrogramTimeSerie.h>
New TimeSeries integration WIP...
r62 #include <Data/VectorTimeSerie.h>
#include <QDataStream>
#include <QObject>
#include <QReadWriteLock>
#include <QUuid>
#include <TimeSeries.h>
#include <optional>
class SCIQLOP_CORE_EXPORT Variable2 : public QObject
{
Q_OBJECT
public:
explicit Variable2(const QString& name, const QVariantHash& metadata = {});
/// Copy ctor
explicit Variable2(const Variable2& other);
std::shared_ptr<Variable2> clone() const;
Switched to new TS impl, but quite broken!...
r67 QString name();
void setName(const QString& name);
DateTimeRange range();
void setRange(const DateTimeRange& range);
std::optional<DateTimeRange> realRange();
New TimeSeries integration WIP...
r62
Switched to new TS impl, but quite broken!...
r67 std::size_t nbPoints();
New TimeSeries integration WIP...
r62
/// @return the data of the variable, nullptr if there is no data
Fixed all tests \o/ with new TS impl...
r68 std::shared_ptr<TimeSeries::ITimeSerie> data();
New TimeSeries integration WIP...
r62
/// @return the type of data that the variable holds
Switched to new TS impl, but quite broken!...
r67 DataSeriesType type();
New TimeSeries integration WIP...
r62
QVariantHash metadata() const noexcept;
Switched to new TS impl, but quite broken!...
r67 // void setData(const std::vector<AnyTimeSerie*>& dataSeries,
// const DateTimeRange& range, bool notify = true);
New TimeSeries integration WIP...
r62
More work on new Variable python bindings...
r63 void setData(const std::vector<TimeSeries::ITimeSerie*>& dataSeries,
const DateTimeRange& range, bool notify = true);
New TimeSeries integration WIP...
r62 static QByteArray
mimeData(const std::vector<std::shared_ptr<Variable2>>& variables)
{
auto encodedData = QByteArray{};
QDataStream stream{&encodedData, QIODevice::WriteOnly};
for(auto& var : variables)
{
stream << var->ID().toByteArray();
}
return encodedData;
}
static std::vector<QUuid> IDs(QByteArray mimeData)
{
std::vector<QUuid> variables;
QDataStream stream{mimeData};
QVariantList ids;
stream >> ids;
std::transform(std::cbegin(ids), std::cend(ids),
std::back_inserter(variables),
[](const auto& id) { return id.toByteArray(); });
return variables;
}
operator QUuid() { return _uuid; }
QUuid ID() { return _uuid; }
signals:
void updated(QUuid ID);
private:
struct VariablePrivate;
spimpl::unique_impl_ptr<VariablePrivate> impl;
QUuid _uuid;
QReadWriteLock m_lock;
};
// Required for using shared_ptr in signals/slots
Removed few remaining fw decl to Variable impl and adde missing Variable2 meta data getter...
r70 SCIQLOP_REGISTER_META_TYPE(VARIABLE_PTR_REGISTRY, std::shared_ptr<Variable2>)
SCIQLOP_REGISTER_META_TYPE(VARIABLE_PTR_VECTOR_REGISTRY,
QVector<std::shared_ptr<Variable2>>)
New TimeSeries integration WIP...
r62
#endif // SCIQLOP_VARIABLE2_H