BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Definition at line 27 of file JobModel.h.
Signals | |
void | focusRequest (JobItem *item) |
void | globalProgress (int) |
Public Member Functions | |
JobModel (QObject *parent=nullptr) | |
~JobModel () override | |
QVector< QString > | acceptableDefaultItemTypes (const QModelIndex &parent) const |
JobItem * | addJob (const MultiLayerItem *sampleItem, const InstrumentItem *instrumentItem, const RealDataItem *realDataItem, const SimulationOptionsItem &optionItem) |
Main method to add a job. More... | |
void | cancelJob (JobItem *jobItem) |
bool | canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override |
void | clear () override |
int | columnCount (const QModelIndex &parent) const override |
SessionItem * | copy (const SessionItem *item_to_copy, SessionItem *new_parent=nullptr, const QString &tag="") |
Copy given item to the new_parent at given row. Item intended for copying can belong to another model and it will remain intact. Returns pointer to the new child. More... | |
template<typename T > | |
T * | copyItem (const T *item_to_copy, SessionItem *new_parent=nullptr, const QString &tag="") |
void | createRootItem () |
QVariant | data (const QModelIndex &index, int role) const override |
bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
JobItem * | getJobItemForIdentifier (const QString &identifier) |
QString | getModelTag () const |
bool | hasUnfinishedJobs () |
QVariant | headerData (int section, Qt::Orientation orientation, int role) const override |
QModelIndex | index (int row, int column, const QModelIndex &parent) const override |
QModelIndex | indexOfItem (SessionItem *item) const |
virtual void | initFrom (SessionModel *model, SessionItem *parent) |
template<typename T > | |
T * | insertItem (const QModelIndex &parent, int row=-1, QString tag="") |
template<typename T > | |
T * | insertItem (SessionItem *parent=nullptr, int row=-1, QString tag="") |
SessionItem * | insertNewItem (QString model_type, const QModelIndex &parent_item, int row=-1, QString tag="") |
SessionItem * | insertNewItem (QString model_type, SessionItem *parent_item=nullptr, int row=-1, QString tag="") |
SessionItem * | itemForIndex (const QModelIndex &index) const |
QVector< JobItem * > | jobItems () const |
QMimeData * | mimeData (const QModelIndexList &indices) const override |
QStringList | mimeTypes () const override |
SessionItem * | moveItem (SessionItem *item, SessionItem *new_parent=nullptr, int row=-1, const QString &tag="") |
Move given parameterized item to the new_parent at given row. If new_parent is not defined, use root_item as a new parent. More... | |
QVector< SessionItem * > | nonXMLItems () const override |
QModelIndex | parent (const QModelIndex &child) const override |
void | readFrom (QXmlStreamReader *reader, MessageService *messageService=nullptr) override |
void | removeItem (SessionItem *item) |
void | removeJob (JobItem *jobItem) |
bool | removeRows (int row, int count, const QModelIndex &parent) override |
void | restore (JobItem *jobItem) |
restore instrument and sample model from backup for given JobItem More... | |
SessionItem * | rootItem () const |
int | rowCount (const QModelIndex &parent) const override |
void | runJob (JobItem *jobItem) |
bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
void | setDraggedItemType (const QString &type) |
Qt::DropActions | supportedDragActions () const override |
Qt::DropActions | supportedDropActions () const override |
template<typename T = SessionItem> | |
T * | topItem () const |
Returns first item in list of topItems. More... | |
template<typename T = SessionItem> | |
QVector< T * > | topItems () const |
template<typename T = SessionItem> | |
QVector< T * > | topItems (std::function< bool(const T &)> accept) const |
virtual void | writeTo (QXmlStreamWriter *writer) |
Protected Member Functions | |
void | setRootItem (SessionItem *root) |
Private Member Functions | |
QString | generateJobName () |
generates numbered job name with new/unused number More... | |
Private Attributes | |
QString | m_dragged_item_type |
QString | m_model_tag |
JobQueueData * | m_queue_data |
SessionItem * | m_root_item |
|
explicit |
Definition at line 28 of file JobModel.cpp.
References focusRequest(), JobQueueData::focusRequest(), globalProgress(), JobQueueData::globalProgress(), GUI::Session::XML::JobModelTag(), and m_queue_data.
|
override |
Definition at line 37 of file JobModel.cpp.
References m_queue_data.
|
inherited |
Definition at line 310 of file SessionModel.cpp.
References SessionModel::itemForIndex(), and SessionModel::parent().
Referenced by SessionModel::canDropMimeData(), and SessionModel::flags().
JobItem * JobModel::addJob | ( | const MultiLayerItem * | sampleItem, |
const InstrumentItem * | instrumentItem, | ||
const RealDataItem * | realDataItem, | ||
const SimulationOptionsItem & | optionItem | ||
) |
Main method to add a job.
Definition at line 52 of file JobModel.cpp.
References ParameterTreeBuilder::build(), generateJobName(), GUI::Model::JobFunctions::setupJobItemForFit(), GUI::Model::JobFunctions::setupJobItemInstrument(), GUI::Model::JobFunctions::setupJobItemOutput(), and GUI::View::PropertyEditorFactory::toString().
Referenced by SimulationView::simulate().
void JobModel::cancelJob | ( | JobItem * | jobItem | ) |
Definition at line 147 of file JobModel.cpp.
References JobQueueData::cancelJob(), JobItem::getIdentifier(), and m_queue_data.
Referenced by JobListModel::cancelJob().
|
overrideinherited |
Definition at line 213 of file SessionModel.cpp.
References SessionModel::acceptableDefaultItemTypes(), SessionModel::data(), GUI::Session::XML::ItemMimeType, GUI::Session::XML::ItemTag(), GUI::Session::XML::ModelTypeAttribute(), and SessionModel::parent().
Referenced by SessionModel::dropMimeData().
|
overridevirtual |
Reimplemented from SessionModel.
Definition at line 100 of file JobModel.cpp.
References SessionModel::clear(), jobItems(), and removeJob().
Referenced by ApplicationModels::readFrom().
|
overrideinherited |
Definition at line 134 of file SessionModel.cpp.
References SessionFlags::MAX_COLUMNS, and SessionModel::parent().
Referenced by SessionModel::data(), and SessionModel::index().
|
inherited |
Copy given item to the new_parent at given row. Item intended for copying can belong to another model and it will remain intact. Returns pointer to the new child.
Definition at line 395 of file SessionModel.cpp.
References SessionItem::defaultTag(), SessionItem::getItems(), SessionModel::m_root_item, GUI::Session::XML::readItems(), and GUI::Session::XML::writeItemAndChildItems().
Referenced by SessionModel::copyItem().
|
inherited |
Definition at line 149 of file SessionModel.h.
References SessionModel::copy().
Referenced by MaskItems::copy(), and JobItem::copyRealDataIntoJob().
|
inherited |
Definition at line 56 of file SessionModel.cpp.
References SessionModel::m_root_item, SessionItem::registerTag(), SessionModel::SessionItem, and SessionItem::setModel().
Referenced by SessionModel::SessionModel(), and SessionModel::clear().
|
overrideinherited |
Definition at line 88 of file SessionModel.cpp.
References SessionModel::columnCount(), SessionModel::index(), SessionFlags::ITEM_NAME, SessionFlags::ITEM_VALUE, SessionModel::itemForIndex(), SessionItem::itemName(), SessionModel::m_root_item, and SessionItem::value().
Referenced by SessionModel::canDropMimeData(), and SessionModel::dropMimeData().
|
overrideinherited |
Definition at line 241 of file SessionModel.cpp.
References SessionModel::canDropMimeData(), SessionModel::data(), SessionModel::itemForIndex(), GUI::Session::XML::ItemMimeType, SessionItem::numberOfChildren(), and SessionModel::parent().
|
overrideinherited |
Definition at line 71 of file SessionModel.cpp.
References SessionModel::acceptableDefaultItemTypes(), SessionModel::index(), SessionItem::isEditable(), SessionItem::isEnabled(), SessionFlags::ITEM_VALUE, SessionModel::itemForIndex(), SessionModel::m_dragged_item_type, and SessionItem::value().
|
signal |
Referenced by JobModel(), and JobView::connectJobRelated().
|
private |
generates numbered job name with new/unused number
Definition at line 160 of file JobModel.cpp.
References jobItems().
Referenced by addJob().
JobItem * JobModel::getJobItemForIdentifier | ( | const QString & | identifier | ) |
Definition at line 42 of file JobModel.cpp.
References jobItems().
Referenced by JobQueueData::onFinishedJob(), JobQueueData::onProgressUpdate(), and JobQueueData::onStartedJob().
|
inlineinherited |
Definition at line 202 of file SessionModel.h.
References SessionModel::m_model_tag.
Referenced by ApplicationModels::readFrom(), GUI::Session::XML::readItems(), and GUI::Session::XML::writeModel().
|
signal |
Referenced by JobModel(), and JobProgressAssistant::JobProgressAssistant().
bool JobModel::hasUnfinishedJobs | ( | ) |
Definition at line 88 of file JobModel.cpp.
References Fitting, JobQueueData::hasUnfinishedJobs(), jobItems(), and m_queue_data.
|
overrideinherited |
Definition at line 112 of file SessionModel.cpp.
References SessionFlags::ITEM_NAME, and SessionFlags::ITEM_VALUE.
|
overrideinherited |
Definition at line 141 of file SessionModel.cpp.
References SessionItem::childAt(), SessionModel::columnCount(), SessionModel::itemForIndex(), SessionModel::m_root_item, and SessionModel::parent().
Referenced by MaskResultsPresenter::createMaskPresentation(), SessionModel::data(), MaskGraphicsScene::deleteViews(), SessionModel::flags(), MaskItems::insertMask(), GUI::Model::Path::isValidItem(), SessionModel::itemForIndex(), ModelMapper::onBeginRemoveRows(), ModelMapper::onRowRemoved(), MaskGraphicsScene::onRowsAboutToBeRemoved(), ItemStackWidget::onRowsAboutToBeRemoved(), ModelMapper::onRowsInserted(), SessionModel::removeItem(), SessionModel::setData(), MaskGraphicsScene::setItemName(), MaskGraphicsScene::setZValues(), SessionModel::topItems(), and MaskGraphicsScene::updateViews().
|
inherited |
Definition at line 265 of file SessionModel.cpp.
References SessionModel::m_root_item, SessionItem::parentItem(), and SessionItem::rowOfChild().
Referenced by MaskGraphicsScene::cancelCurrentDrawing(), MaskEditorActions::changeMaskStackingOrder(), SessionItem::emitDataChanged(), SessionItem::index(), MaskGraphicsScene::onSceneSelectionChanged(), MaskGraphicsScene::onSessionSelectionChanged(), MaskGraphicsScene::processLineItem(), MaskGraphicsScene::processPolygonItem(), and SessionModel::removeItem().
|
virtualinherited |
Definition at line 413 of file SessionModel.cpp.
References SessionModel::readFrom(), and SessionModel::writeTo().
|
inherited |
Definition at line 143 of file SessionModel.h.
References SessionModel::itemForIndex(), and SessionModel::parent().
|
inherited |
Definition at line 137 of file SessionModel.h.
References SessionModel::insertNewItem(), SessionItem::modelType(), and SessionModel::parent().
Referenced by IntensityDataFFTPresenter::IntensityDataFFTPresenter(), FitParameterItem::addLink(), JobItem::createDataViewItem(), FitComparison1DViewController::createDiffViewItem(), FitParameterContainerItem::createFitParameter(), FitSuiteItem::createFitParametersContainer(), JobItem::createFitSuiteItem(), FitSuiteItem::createMinimizerContainer(), Data1DViewItem::createPropertyContainerItem(), JobItem::createRealDataItem(), IntensityDataItem::getOrCreateMaskContainerItem(), IntensityDataItem::getOrCreateProjectionContainerItem(), RealDataItem::initDataItem(), ProjectionsEditorCanvas::onEnteringColorMap(), MaskGraphicsScene::processHorizontalLineItem(), MaskGraphicsScene::processMaskAllItem(), MaskGraphicsScene::processPolygonItem(), MaskGraphicsScene::processVerticalLineItem(), and JobItem::setDataType().
|
inherited |
Definition at line 297 of file SessionModel.cpp.
References SessionModel::insertNewItem(), and SessionModel::itemForIndex().
|
inherited |
Definition at line 274 of file SessionModel.cpp.
References GUI::Model::ItemFactory::CreateItem(), SessionItem::defaultTag(), SessionItem::insertChild(), SessionItemTags::isValid(), SessionModel::m_root_item, SessionItem::numberOfChildren(), and SessionItem::sessionItemTags().
Referenced by SessionModel::insertItem(), SessionModel::insertNewItem(), and MaskGraphicsScene::processRectangleShapeItem().
|
inherited |
Definition at line 327 of file SessionModel.cpp.
References SessionModel::index(), and SessionModel::m_root_item.
Referenced by SessionModel::acceptableDefaultItemTypes(), MaskEditorActions::changeMaskStackingOrder(), MaskResultsPresenter::createMaskPresentation(), SessionModel::data(), DataProperties::dataItem(), MaskGraphicsScene::deleteViews(), SessionModel::dropMimeData(), SessionModel::flags(), SessionModel::index(), SessionModel::insertItem(), SessionModel::insertNewItem(), MaskEditorActions::isSendToBackPossible(), GUI::Model::Path::isValidItem(), MaskEditorPropertyPanel::maskItemForIndex(), SessionModel::mimeData(), ModelMapper::onBeginRemoveRows(), ModelMapper::onDataChanged(), ModelMapper::onRowRemoved(), ItemStackWidget::onRowsAboutToBeRemoved(), ModelMapper::onRowsInserted(), FitParameterModel::onSourceDataChanged(), MaskEditorActions::onToggleMaskValueAction(), SessionModel::parent(), SessionModel::removeRows(), SessionModel::rowCount(), SessionModel::setData(), MaskGraphicsScene::setItemName(), MaskEditor::setMaskContext(), MaskGraphicsScene::setMaskContext(), MaskGraphicsScene::setZValues(), SessionDecorationModel::textColor(), SessionModel::topItems(), MaskGraphicsScene::updateScene(), and MaskGraphicsScene::updateViews().
QVector< JobItem * > JobModel::jobItems | ( | ) | const |
Definition at line 77 of file JobModel.cpp.
Referenced by JobListModel::JobListModel(), JobListModel::~JobListModel(), clear(), JobListModel::data(), JobListModel::emitJobListModelChanged(), generateJobName(), getJobItemForIdentifier(), hasUnfinishedJobs(), JobListModel::indexForJob(), JobListModel::jobForIndex(), JobListModel::onRowsInserted(), readFrom(), JobListModel::rowCount(), and JobQueueData::updateGlobalProgress().
|
overrideinherited |
Definition at line 197 of file SessionModel.cpp.
References SessionModel::itemForIndex(), GUI::Session::XML::ItemMimeType, and GUI::Session::XML::writeItemAndChildItems().
|
overrideinherited |
Definition at line 192 of file SessionModel.cpp.
References GUI::Session::XML::ItemMimeType.
|
inherited |
Move given parameterized item to the new_parent at given row. If new_parent is not defined, use root_item as a new parent.
Definition at line 360 of file SessionModel.cpp.
References SessionItem::defaultTag(), SessionItem::getItems(), SessionItem::insertChild(), SessionItemTags::isValid(), SessionModel::m_root_item, SessionItemTags::maximumReached(), SessionItem::modelType(), SessionItem::parentItem(), SessionItem::rowOfChild(), SessionItem::sessionItemTags(), SessionItem::takeItem(), and SessionItem::takeRow().
Referenced by MaskEditorActions::changeMaskStackingOrder().
|
overridevirtual |
Reimplemented from SessionModel.
Definition at line 108 of file JobModel.cpp.
Referenced by ApplicationModels::nonXMLItems().
|
overrideinherited |
Definition at line 155 of file SessionModel.cpp.
References SessionModel::itemForIndex(), SessionModel::m_root_item, and SessionItem::parentItem().
Referenced by SessionModel::acceptableDefaultItemTypes(), SessionModel::canDropMimeData(), SessionModel::columnCount(), SessionModel::dropMimeData(), SessionModel::index(), SessionModel::insertItem(), RealDataModel::onRowsChange(), SessionModel::removeRows(), and SessionModel::rowCount().
|
overridevirtual |
Reimplemented from SessionModel.
Definition at line 127 of file JobModel.cpp.
References ParameterTreeBuilder::build(), jobItems(), and SessionModel::readFrom().
Referenced by ApplicationModels::readFrom().
|
inherited |
Definition at line 303 of file SessionModel.cpp.
References SessionModel::index(), SessionModel::indexOfItem(), and SessionModel::removeRows().
void JobModel::removeJob | ( | JobItem * | jobItem | ) |
Definition at line 152 of file JobModel.cpp.
References JobItem::getIdentifier(), SessionItem::index(), m_queue_data, JobQueueData::removeJob(), and SessionModel::removeRows().
Referenced by clear(), and JobListModel::removeJob().
|
overrideinherited |
Definition at line 183 of file SessionModel.cpp.
References SessionModel::itemForIndex(), SessionModel::m_root_item, SessionModel::parent(), and SessionItem::takeRow().
Referenced by MaskGraphicsScene::cancelCurrentDrawing(), MaskContainerItem::clear(), ProjectionsEditorActions::onDeleteAction(), MaskEditorActions::onDeleteMaskAction(), SessionModel::removeItem(), and removeJob().
void JobModel::restore | ( | JobItem * | jobItem | ) |
restore instrument and sample model from backup for given JobItem
Definition at line 83 of file JobModel.cpp.
References JobItem::parameterContainerItem(), and ParameterContainerItem::restoreBackupValues().
Referenced by ParameterTuningWidget::restoreModelsOfCurrentJobItem().
|
inherited |
Definition at line 430 of file SessionModel.cpp.
References SessionModel::m_root_item.
Referenced by ModelMapper::nestlingDepth().
|
overrideinherited |
Definition at line 126 of file SessionModel.cpp.
References SessionModel::itemForIndex(), SessionItem::numberOfChildren(), and SessionModel::parent().
Referenced by MaskResultsPresenter::createMaskPresentation(), MaskGraphicsScene::deleteViews(), GUI::Model::Path::isValidItem(), MaskGraphicsScene::setItemName(), MaskGraphicsScene::setZValues(), SessionModel::topItems(), and MaskGraphicsScene::updateViews().
void JobModel::runJob | ( | JobItem * | jobItem | ) |
Definition at line 142 of file JobModel.cpp.
References m_queue_data, and JobQueueData::runJob().
Referenced by ParameterTuningWidget::onCurrentLinkChanged(), ParameterTuningWidget::restoreModelsOfCurrentJobItem(), JobListModel::runJob(), and SimulationView::simulate().
|
overrideinherited |
Definition at line 170 of file SessionModel.cpp.
References SessionModel::index(), SessionModel::itemForIndex(), and SessionItem::setRoleProperty().
|
inlineinherited |
Definition at line 207 of file SessionModel.h.
References SessionModel::m_dragged_item_type.
|
inlineprotectedinherited |
|
inlineoverrideinherited |
Definition at line 192 of file SessionModel.h.
|
inlineoverrideinherited |
Definition at line 197 of file SessionModel.h.
|
inherited |
Returns first item in list of topItems.
Definition at line 155 of file SessionModel.h.
References SessionItem::items().
|
inherited |
Definition at line 162 of file SessionModel.h.
References SessionModel::index(), SessionItem::item(), SessionModel::itemForIndex(), and SessionModel::rowCount().
|
inherited |
Definition at line 177 of file SessionModel.h.
References SessionModel::index(), SessionItem::item(), SessionModel::itemForIndex(), and SessionModel::rowCount().
|
virtualinherited |
Definition at line 352 of file SessionModel.cpp.
References SessionModel::m_root_item, and GUI::Session::XML::writeModel().
Referenced by SessionModel::initFrom(), and ApplicationModels::writeTo().
|
privateinherited |
Definition at line 132 of file SessionModel.h.
Referenced by SessionModel::flags(), and SessionModel::setDraggedItemType().
|
privateinherited |
Definition at line 133 of file SessionModel.h.
Referenced by SessionModel::getModelTag(), and SessionModel::readFrom().
|
private |
Definition at line 60 of file JobModel.h.
Referenced by JobModel(), ~JobModel(), cancelJob(), hasUnfinishedJobs(), removeJob(), and runJob().
|
privateinherited |
Definition at line 131 of file SessionModel.h.
Referenced by SessionModel::~SessionModel(), SessionModel::clear(), SessionModel::copy(), SessionModel::createRootItem(), SessionModel::data(), SessionModel::index(), SessionModel::indexOfItem(), SessionModel::insertNewItem(), SessionModel::itemForIndex(), SessionModel::moveItem(), SessionModel::parent(), SessionModel::readFrom(), SessionModel::removeRows(), SessionModel::rootItem(), SessionModel::setRootItem(), and SessionModel::writeTo().