16 #include "Base/Util/Assert.h"
17 #include "Device/Detector/IDetector.h"
43 void processInstrumentLink(
JobItem* jobItem)
47 throw Error(
"GUI::Model::JobFunctions::processInstrumentLink() -> Error. No data.");
53 void copyMasksToInstrument(
JobItem* jobItem)
60 void cropRealData(
JobItem* jobItem)
69 std::unique_ptr<Datafield> origData(intensityItem->
getDatafield()->clone());
74 instrument_item->createInstrument()->detector().iterateOverNonMaskedPoints(
75 [&](IDetector::const_iterator it) {
77 (*cropped_data)[it.roiIndex()] = (*origData)[it.detectorIndex()];
84 void createFitContainers(
JobItem* jobItem)
109 property_container->addItem(job_item->
dataItem());
120 copiedInstrument->
setInstrumentName(copiedInstrument->instrumentType() +
" instrument");
121 copiedInstrument->setId(QUuid::createUuid().
toString());
134 ASSERT(isSpecularInstrument || isIntensityInstrument);
136 if (isSpecularInstrument)
138 else if (isIntensityInstrument)
152 processInstrumentLink(jobItem);
153 copyMasksToInstrument(jobItem);
156 cropRealData(jobItem);
160 createFitContainers(jobItem);
169 ASSERT(realDataItemCopy);
Defines class Data1DViewItem.
Defines class DataPropertyContainer.
Defines class FitSuiteItem.
Defines class InstrumentItem and all its children.
Defines class Instrument.
Defines class IntensityDataItem.
Defines namespace GUI::Model::FilenameUtils.
Defines abstract item with a material property.
Defines auxiliary functions in namespace GUI::Model::JobModelFunctions.
Defines namespace GUI::Model::JobItemUtils.
Defines class MaterialItem.
Defines MinimizerItem class.
Defines class Helpers functions.
Defines pointwise axis item.
Defines class RealDataItem.
Defines class SpecularDataItem.
DataPropertyContainer * createPropertyContainerItem()
virtual void setDatafield(Datafield *data)=0
The given pointer becomes owned by this class!!
Datafield * getDatafield()
void setFileName(const QString &filename)
void addItem(DataItem *data_item)
FitParameterContainerItem * createFitParametersContainer()
MinimizerContainerItem * createMinimizerContainer()
Abstract base class for instrument-specific item classes.
QString instrumentName() const
virtual ICoordSystem * createCoordSystem() const =0
void setInstrumentName(const QString &instrumentName)
virtual void importMasks(const MaskContainerItem *)
void updateDataRange()
Sets min,max values for z-axis, if axes is not locked, and ranges are not yet set.
Instrument2DItem * instrument2DItem()
Data1DViewItem * dataItemView()
void setInstrumentName(const QString &name)
InstrumentItem * instrumentItem() const
RealDataItem * realDataItem()
RealDataItem * copyRealDataIntoJob(const RealDataItem *real_data)
QString getIdentifier() const
FitSuiteItem * createFitSuiteItem()
InstrumentItem * copyInstrumentIntoJob(const InstrumentItem *instrument)
Data1DViewItem * createDataViewItem()
Provides access to experimental data, for display and fitting. Owns an AbstractDataLoader.
MaskContainerItem * maskContainerItem()
Returns mask container item.
void linkToInstrument(const InstrumentItem *instrument)
void setNativeDatafield(Datafield *data)
takes ownership of data
bool hasNativeData() const
IntensityDataItem * intensityDataItem()
const Datafield * nativeDatafield() const
QString jobReferenceFileName(const QString &itemName)
Constructs the name of the file with reference data.
QString jobNativeDataFileName(const QString &id)
void setupJobItemOutput(JobItem *jobItem)
Setup items intended for storing results of the job.
void copyRealDataItem(JobItem *jobItem, const RealDataItem *realDataItem)
Copy RealDataItem to jobItem intended for fitting.
void setupJobItemForFit(JobItem *jobItem, const RealDataItem *realDataItem)
Setups JobItem for fit.
void setupJobItemInstrument(JobItem *jobItem, const InstrumentItem *from)
Properly copies instrument into job item.
void initDataView(JobItem *job_item)
Initializes Data1DViewItem and assigns it to the passed JobItem.
void createDefaultDetectorMap(DataItem *intensityItem, const Instrument2DItem *instrumentItem)
ComboProperty availableUnits(const ICoordSystem &converter)
QString toString(const QModelIndex &index)
Provides string representation of index data.