Skip to content
Snippets Groups Projects
Commit 0329bab8 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

Datafield: fix constructors

parent 6811553f
No related branches found
No related tags found
1 merge request!1001GUI: show error bars for loaded reflectivity data
......@@ -40,16 +40,21 @@ Datafield::Datafield(Frame* frame, const std::vector<double>& values, const std:
, m_errSigmas(errSigmas)
{
ASSERT(m_values.size() == m_frame->size());
ASSERT(m_values.size() == m_errSigmas.size());
ASSERT(m_errSigmas.size()==0 || m_errSigmas.size() == m_values.size());
}
Datafield::Datafield(const std::vector<IAxis*>& axes, const std::vector<double>& vector)
: Datafield(new Frame(axes), vector)
Datafield::Datafield(const std::vector<IAxis*>& axes)
: Datafield(new Frame(axes))
{
}
Datafield::Datafield(const std::vector<IAxis*>& axes)
: Datafield(new Frame(axes))
Datafield::Datafield(const std::vector<IAxis*>& axes, const std::vector<double>& values)
: Datafield(new Frame(axes), values)
{
}
Datafield::Datafield(const std::vector<IAxis*>& axes, const std::vector<double>& values, const std::vector<double> &errSigmas)
: Datafield(new Frame(axes), values, errSigmas)
{
}
......
......@@ -38,8 +38,10 @@ public:
//! Constructor that takes ownership of supplied axes.
Datafield(const std::vector<IAxis*>& axes);
//! Constructor that takes ownership of supplied axes.
Datafield(const std::vector<IAxis*>& axes, const std::vector<double>& vector);
//! Constructor that takes ownership of supplied axes and initializes values.
Datafield(const std::vector<IAxis*>& axes, const std::vector<double>& values);
//! Constructor that takes ownership of supplied axes and initializes values and errorbars
Datafield(const std::vector<IAxis*>& axes, const std::vector<double>& values, const std::vector<double>& errSigmas);
Datafield(const Datafield&) = delete;
Datafield(Datafield&&) = default;
......
......@@ -551,7 +551,7 @@ void QREDataLoader::datafieldFromParsingResult(RealItem* item) const
for (auto lineNr : lineNumbers)
eVec.push_back(m_importResult.eValues[lineNr]);
auto* oData = new Datafield({new PointwiseAxis("qVector", qVec)}, rVec);
auto* oData = new Datafield({new PointwiseAxis("qVector", qVec)}, rVec, eVec); // eVec can be empty
// -- Replacement of item->setImportData(std::move(data));
item->initNativeData();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment