15 #ifndef BORNAGAIN_GUI_MODEL_JOB_JOBITEM_H
16 #define BORNAGAIN_GUI_MODEL_JOB_JOBITEM_H
37 class MaterialItemContainer;
41 class SimulationResult;
46 static constexpr
auto P_IDENTIFIER{
"Identifier"};
47 static constexpr
auto P_INSTRUMENT_NAME{
"Instrument"};
48 static constexpr
auto P_WITH_FITTING{
"With fitting"};
49 static constexpr
auto P_STATUS{
"Status"};
50 static constexpr
auto P_BEGIN_TIME{
"Begin time"};
51 static constexpr
auto P_END_TIME{
"End time"};
52 static constexpr
auto P_COMMENTS{
"Comments"};
53 static constexpr
auto P_PROGRESS{
"Progress"};
54 static constexpr
auto P_PRESENTATION_TYPE{
"Presentation type"};
55 static constexpr
auto T_MATERIAL_CONTAINER{
"Material container tag"};
56 static constexpr
auto T_OUTPUT{
"Output tag"};
57 static constexpr
auto T_REALDATA{
"Real Data tag"};
58 static constexpr
auto T_DATAVIEW{
"Data View tag"};
59 static constexpr
auto T_FIT_SUITE{
"Fit suite tag"};
62 static constexpr
auto M_TYPE{
"JobItem"};
67 QString getIdentifier()
const;
68 void setIdentifier(
const QString& identifier);
70 QString jobName()
const;
71 void setJobName(
const QString&
name);
82 bool isRunning()
const;
83 bool isCompleted()
const;
84 bool isCanceled()
const;
85 bool isFailed()
const;
86 bool isFitting()
const;
87 bool isValidForFitting();
89 QDateTime beginTime()
const;
90 void setBeginTime(
const QDateTime& begin_time);
92 QDateTime endTime()
const;
93 void setEndTime(
const QDateTime& end_time);
96 std::optional<size_t> duration()
const;
98 QString getComments()
const;
99 void setComments(
const QString& comments);
101 int getProgress()
const;
102 void setProgress(
int progress);
104 bool runImmediately()
const;
105 bool runInBackground()
const;
117 void setResults(
const SimulationResult& result);
134 QString sampleName()
const;
136 QString instrumentName()
const;
137 void setInstrumentName(
const QString&
name);
139 QString presentationType()
const;
140 void setPresentationType(
const QString& type);
145 bool isSpecularJob()
const;
162 void updateIntensityDataFileName();
170 template <
typename T>
173 static_assert(std::is_base_of<DataItem, T>::value,
"Class must be derived from DataItem");
Defines class InstrumentItem and all its children.
JobStatus
The JobStatus enum lists the possible states of a job.
Defines class MaterialItems.
Defines class MultiLayerItem.
Defines classes for ParameterTreeItems.
Defines class SessionItem.
Defines class SessionModel.
Defines class SimulationOptionsItem.
View model for 1D DataItem. Can represent several items at once. In current implementation the first ...
Abstract base class for IntensityDataItem and SpecularDataItem. Owns one simulated data set of type D...
The FitParameterContainerItem class is a collection of all defined fit parameters in JobItem.
Abstract base class for instrument-specific item classes.
void jobStatusChanged(const JobStatus status)
void jobCommentsChanged(const QString &comments)
void jobEndTimeChanged(const QDateTime &end_time)
ParameterContainerItem m_parameterContainer
void jobBeginTimeChanged(const QDateTime &begin_time)
void jobProgressChanged(int progress)
SimulationOptionsItem m_simulationOptionsItem
void jobNameChanged(const QString &name)
void jobPresentationTypeChanged(const QString &type)
void jobIdentifierChanged(const QString &identifier)
static constexpr auto T_OUTPUT
void jobInstrumentNameChanged(const QString &name)
MultiLayerItem m_sampleItem
std::unique_ptr< InstrumentItem > m_instrument
The ParameterContainerItem is a top item to hold all ParameterItem, represents an entry point to para...
Provides access to experimental data, for display and fitting. Owns an AbstractDataLoader.
Base class for a GUI data item.
SessionModel * model() const
Returns model of this item.
virtual void writeNonSessionItems(QXmlStreamWriter *writer) const
virtual void readNonSessionItems(QXmlStreamReader *reader)
T * insertItem(SessionItem *parent=nullptr, int row=-1, QString tag="")
The SimulationOptionsItem class holds simulation status (run policy, number of threads,...
IntensityDataItem * intensityDataItem(SessionItem *parent)
Returns IntensityDataItem contained as a child in givent parent.
void setResults(DataItem *intensityItem, const SimulationResult &result)
Sets simulation results into the DataItem.
QString const & name(EShape k)