16 #include "Device/IO/IOFactory.h"
31 if (
m_data->size() != data.size())
32 throw Error(
"DataItem::setVector() -> Error. "
33 "Different data size.");
61 return static_cast<bool>(
m_data);
67 auto* data = IOFactory::readDatafield(filename.toStdString());
80 std::unique_ptr<Datafield> clone(
getDatafield()->clone());
Defines class ComboProperty.
Custom property to define list of string values with multiple selections. Intended for QVariant.
static ComboProperty fromList(const QStringList &values, const QString ¤t_value="")
QVariant variant() const
Constructs variant enclosing given ComboProperty.
Abstract base class for IntensityDataItem and SpecularDataItem. Owns one simulated data set of type D...
QDateTime lastModified() const override
Indicates last modification timepoint.
static bool isAxesUnitsPropertyName(const QString &name)
static constexpr auto P_AXES_UNITS
virtual void setDatafield(Datafield *data)=0
The given pointer becomes owned by this class!!
QDateTime m_last_modified
static void updateAxesUnits(SessionItem *item, const QString &name, InstrumentItem *instrumentItem)
void setLastModified(const QDateTime &dtime)
DataItem(const QString &modelType)
void datafieldChanged(Datafield *data)
Datafield * getDatafield()
QString selectedCoords() const
bool containsNonXMLData() const override
Checks if object owns non-XML data.
bool saveData(const QString &projectDir) override
Saves non-XML data in projectDir and returns success flag.
void setAxesUnits(const ComboProperty &units)
virtual void updateCoords(const InstrumentItem *instrument)=0
std::mutex m_update_data_mutex
SessionItem * getAxesUnitsItem() const
void rawDataVectorChanged(const std::vector< double > &data)
void fileNameChanged(const QString &filename)
QString fileName() const override
Reports file name to save/load non-XML data.
void setRawDataVector(const std::vector< double > &data)
Sets the raw data vector from external source. Checks only the equality of data size; no dimension ch...
void axesUnitsChanged(const ComboProperty &units)
bool loadData(const QString &projectDir) override
Loads non-XML data from projectDir and returns success flag.
std::unique_ptr< Datafield > m_data
simulation results
void setFileName(const QString &filename)
static constexpr auto P_FILE_NAME
SelectionDescriptor< QString > axesUnits() const
Abstract base class for instrument-specific item classes.
Describes a selection (various possibilities and the current one).
Base class for a GUI data item.
SessionItem * addProperty(const QString &name, const QVariant &variant)
Add new property item and register new tag. name is the tag name and the display name....
QVariant getItemValue(const QString &tag) const
Directly access value of item under given tag.
void setItemValue(const QString &tag, const QVariant &variant) const
Directly set value of item under given tag.
T * item(const QString &tag) const
SessionItem * getItem(const QString &tag="", int row=0) const
Returns item in given row of given tag.
QString projectDir(const QString &projectFileName)
Returns project directory deduced from project file name.
QString const & name(EShape k)