BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ProjectDocument Class Reference

Description

Project document class handles all data related to the opened project (sample, job, project specific settings).

It also provides signaling regarding changes in the current document data.

e.g. if project file is /home/users/development/Untitled/Untitled.pro projectName() - 'Untitled' projectDir() - '/home/users/development/Untitled projectFileName() - '/home/users/development/Untitled/Untitled.pro'

Definition at line 43 of file ProjectDocument.h.

Inheritance diagram for ProjectDocument:
[legend]
Collaboration diagram for ProjectDocument:
[legend]

Public Types

enum  Functionality {
  None = 0x0 , Gisas = 0x1 , Offspec = 0x2 , Specular = 0x4 ,
  DepthProbe = 0x8 , All = Gisas | Offspec | Specular | DepthProbe
}
 
enum class  ReadResult { ok , warning , error }
 

Signals

void functionalitiesChanged ()
 Emitted when functionality has changed. More...
 
void modified ()
 Emitted for any modifications in the document. More...
 
void singleInstrumentModeChanged ()
 Emitted when single instrument mode has changed. More...
 
void singleSampleModeChanged ()
 Emitted when single sample mode has changed. More...
 

Public Member Functions

 ProjectDocument ()
 
void clearModified ()
 
InstrumentCollectioncollectedItems () const
 
QString documentVersion () const
 
Functionalities functionalities () const
 
bool hasData () const
 
bool hasValidNameAndPath ()
 
InstrumentsEditControllerinstrumentsEditController ()
 The edit controller for the instruments in this project document. More...
 
bool isModified () const
 
JobModeljobModel () const
 
LinkInstrumentManagerlinkInstrumentManager ()
 
ReadResult loadProjectFile (const QString &project_file_name, MessageService &messageService)
 
QString projectDir () const
 
QString projectFileName () const
 
QString projectName () const
 
RealDataModelrealDataModel () const
 
MultiLayerItemssampleItems ()
 
void save (const QString &project_file_name, bool autoSave=false)
 
void saveProjectData (const QString &project_file_name)
 
void saveProjectFile (const QString &project_file_name, bool autoSave=false)
 
void setFunctionalities (const Functionalities &f)
 
void setModified ()
 
void setProjectDir (const QString &text)
 
void setProjectFileName (const QString &projectFileName)
 
void setProjectName (const QString &text)
 
void setSingleInstrumentMode (bool b)
 
void setSingleSampleMode (bool b)
 
SimulationOptionsItemsimulationOptionsItem ()
 
bool singleInstrumentMode () const
 
bool singleSampleMode () const
 
QString userExportDir () const
 Returns directory name suitable for saving plots. More...
 
QString validProjectDir () const
 

Private Member Functions

void connectModels ()
 
void disconnectModels ()
 
void onModelChanged ()
 
ReadResult readProject (QIODevice *device, MessageService &messageService)
 
void writeTo (QIODevice *device)
 

Private Attributes

ApplicationModels m_applicationModels
 
QString m_currentVersion
 
DatafieldIOServicem_dataService
 
Functionalities m_functionalities
 
InstrumentsEditController m_instrumentEditController
 
InstrumentCollection m_instruments
 
std::unique_ptr< LinkInstrumentManagerm_linkManager
 
bool m_modified
 
QString m_project_dir
 
QString m_project_name
 
MultiLayerItems m_sampleItems
 
SimulationOptionsItem m_simulationOptionsItem
 
bool m_singleInstrumentMode
 
bool m_singleSampleMode
 

Member Enumeration Documentation

◆ Functionality

Enumerator
None 
Gisas 
Offspec 
Specular 
DepthProbe 
All 

Definition at line 49 of file ProjectDocument.h.

49  {
50  None = 0x0,
51  Gisas = 0x1,
52  Offspec = 0x2,
53  Specular = 0x4,
54  DepthProbe = 0x8,
56  };

◆ ReadResult

Enumerator
ok 
warning 
error 

Definition at line 47 of file ProjectDocument.h.

47 { ok, warning, error };
void warning(QWidget *parent, const QString &title, const QString &text, const QString &detailedText)
Definition: MessageBox.cpp:37

Constructor & Destructor Documentation

◆ ProjectDocument()

ProjectDocument::ProjectDocument ( )

Definition at line 53 of file ProjectDocument.cpp.

54  : m_modified(false)
56  , m_singleInstrumentMode(false)
57  , m_singleSampleMode(false)
60 {
62  &ProjectDocument::onModelChanged, Qt::UniqueConnection);
64  &ProjectDocument::onModelChanged, Qt::UniqueConnection);
65 
66 
67  m_linkManager = std::make_unique<LinkInstrumentManager>(this);
68  setObjectName("ProjectDocument");
69 
71  connectModels();
72 }
Provide read/write of heavy data files in a separate thread.
Definition: IOService.h:30
void setApplicationModels(ApplicationModels *models)
Definition: IOService.cpp:50
void instrumentAddedOrRemoved()
Signals a change in the list of instruments.
void instrumentChanged(const InstrumentItem *instrument)
Signals any change in the settings of the given instrument.
ApplicationModels m_applicationModels
InstrumentCollection m_instruments
InstrumentsEditController m_instrumentEditController
std::unique_ptr< LinkInstrumentManager > m_linkManager
DatafieldIOService * m_dataService
Functionalities m_functionalities

References connectModels(), InstrumentsEditController::instrumentAddedOrRemoved(), InstrumentsEditController::instrumentChanged(), m_applicationModels, m_dataService, m_instrumentEditController, m_linkManager, onModelChanged(), and DatafieldIOService::setApplicationModels().

Here is the call graph for this function:

Member Function Documentation

◆ clearModified()

void ProjectDocument::clearModified ( )

Definition at line 247 of file ProjectDocument.cpp.

248 {
249  m_modified = false;
250 }

References m_modified.

◆ collectedItems()

◆ connectModels()

void ProjectDocument::connectModels ( )
private

Definition at line 435 of file ProjectDocument.cpp.

436 {
438  &ProjectDocument::onModelChanged, Qt::UniqueConnection);
439 }

References m_applicationModels, ApplicationModels::modelChanged(), and onModelChanged().

Referenced by ProjectDocument(), and loadProjectFile().

Here is the call graph for this function:

◆ disconnectModels()

void ProjectDocument::disconnectModels ( )
private

Definition at line 429 of file ProjectDocument.cpp.

430 {
433 }

References m_applicationModels, ApplicationModels::modelChanged(), and onModelChanged().

Referenced by loadProjectFile().

Here is the call graph for this function:

◆ documentVersion()

QString ProjectDocument::documentVersion ( ) const

Definition at line 257 of file ProjectDocument.cpp.

258 {
259  QString result(m_currentVersion);
260  if (result.isEmpty())
262  return result;
263 }
QString m_currentVersion
QString getBornAgainVersionString()
Definition: Path.cpp:60

References GUI::Util::Path::getBornAgainVersionString(), and m_currentVersion.

Here is the call graph for this function:

◆ functionalities()

◆ functionalitiesChanged

void ProjectDocument::functionalitiesChanged ( )
signal

Emitted when functionality has changed.

Referenced by setFunctionalities().

◆ hasData()

bool ProjectDocument::hasData ( ) const

Definition at line 252 of file ProjectDocument.cpp.

253 {
254  return !m_dataService->dataInterfaces().isEmpty();
255 }
QVector< SaveLoadInterface * > dataInterfaces() const
Returns all non-XML items available for save/load.
Definition: IOService.cpp:109

References DatafieldIOService::dataInterfaces(), and m_dataService.

Referenced by SaveService::process_queue().

Here is the call graph for this function:

◆ hasValidNameAndPath()

bool ProjectDocument::hasValidNameAndPath ( )

◆ instrumentsEditController()

InstrumentsEditController * ProjectDocument::instrumentsEditController ( )

The edit controller for the instruments in this project document.

Use this to modify instrument list or instrument data. Listen to its signals to get notification about any changes.

See also
InstrumentsEditController for more information

Definition at line 156 of file ProjectDocument.cpp.

157 {
159 }

References m_instrumentEditController.

Referenced by InstrumentListView::InstrumentListView(), LinkInstrumentManager::LinkInstrumentManager(), RealDataPropertiesWidget::RealDataPropertiesWidget(), LinkInstrumentManager::canLinkDataToInstrument(), InstrumentView::createWidgetsForCurrentInstrument(), InstrumentView::hideEvent(), InstrumentView::onInstrumentChangedByEditor(), InstrumentView::onInstrumentNameEdited(), and InstrumentView::showEvent().

◆ isModified()

bool ProjectDocument::isModified ( ) const

Definition at line 236 of file ProjectDocument.cpp.

237 {
238  return m_modified;
239 }

References m_modified.

Referenced by AutosaveController::onDocumentModified(), and AutosaveController::onTimerTimeout().

◆ jobModel()

JobModel * ProjectDocument::jobModel ( ) const

Definition at line 141 of file ProjectDocument.cpp.

142 {
143  return m_applicationModels.jobModel();
144 }
JobModel * jobModel() const

References ApplicationModels::jobModel(), and m_applicationModels.

Referenced by SessionModelView::SessionModelView(), JobView::connectJobRelated(), JobView::createSubWindows(), and SimulationView::simulate().

Here is the call graph for this function:

◆ linkInstrumentManager()

LinkInstrumentManager * ProjectDocument::linkInstrumentManager ( )

◆ loadProjectFile()

ProjectDocument::ReadResult ProjectDocument::loadProjectFile ( const QString &  project_file_name,
MessageService messageService 
)

Definition at line 199 of file ProjectDocument.cpp.

201 {
202  setProjectFileName(project_file_name);
203 
204  QFile file(projectFileName());
205  if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
206  QString message = QString("Open file error '%1'").arg(file.errorString());
207  messageService.addError(this, message);
208  return ReadResult::error;
209  }
210 
211  try {
213  auto result = readProject(&file, messageService);
214  file.close();
215  if (result == ReadResult::error)
216  return result;
217 
218  m_dataService->loadDataFiles(projectDir(), &messageService);
219  connectModels();
220 
221  if (!messageService.warnings().empty())
222  result = ReadResult::warning;
223  return result;
224  } catch (const std::exception& ex) {
225  QString message = QString("Exception thrown '%1'").arg(QString(ex.what()));
226  messageService.addError(this, message);
227  return ReadResult::error;
228  }
229 }
void loadDataFiles(const QString &projectDir, MessageService *messageService=nullptr)
Definition: IOService.cpp:77
QStringList warnings(bool includeSenders=false) const
void addError(QObject *sender, const QString &description)
QString projectFileName() const
void setProjectFileName(const QString &projectFileName)
ReadResult readProject(QIODevice *device, MessageService &messageService)
QString projectDir() const

References MessageService::addError(), connectModels(), disconnectModels(), error, DatafieldIOService::loadDataFiles(), m_dataService, projectDir(), projectFileName(), readProject(), setProjectFileName(), warning, and MessageService::warnings().

Here is the call graph for this function:

◆ modified

◆ onModelChanged()

void ProjectDocument::onModelChanged ( )
private

Definition at line 310 of file ProjectDocument.cpp.

311 {
312  m_modified = true;
313  emit modified();
314 }
void modified()
Emitted for any modifications in the document.

References m_modified, and modified().

Referenced by ProjectDocument(), connectModels(), and disconnectModels().

◆ projectDir()

QString ProjectDocument::projectDir ( ) const

Definition at line 87 of file ProjectDocument.cpp.

88 {
89  return m_project_dir;
90 }

References m_project_dir.

Referenced by AutosaveController::assureAutoSaveDirExists(), loadProjectFile(), and projectFileName().

◆ projectFileName()

QString ProjectDocument::projectFileName ( ) const

Definition at line 113 of file ProjectDocument.cpp.

114 {
115  if (!projectName().isEmpty())
117  return "";
118 }
QString projectName() const
constexpr const char * projectFileExtension
Definition: ProjectUtils.h:24

References projectDir(), GUI::Project::Utils::projectFileExtension, and projectName().

Referenced by AutosaveController::autosaveDir(), AutosaveController::autosaveName(), loadProjectFile(), setProjectFileName(), and ProjectSettingsView::updateInformation().

Here is the call graph for this function:

◆ projectName()

QString ProjectDocument::projectName ( ) const

Definition at line 74 of file ProjectDocument.cpp.

75 {
76  return m_project_name;
77 }

References m_project_name.

Referenced by projectFileName(), ProjectSettingsView::updateInformation(), and writeTo().

◆ readProject()

ProjectDocument::ReadResult ProjectDocument::readProject ( QIODevice *  device,
MessageService messageService 
)
private

Definition at line 316 of file ProjectDocument.cpp.

318 {
319  const int warningsBefore = messageService.warnings().size();
320 
321  QXmlStreamReader reader(device);
322  try {
323  while (!reader.atEnd()) {
324  reader.readNext();
325  if (reader.isStartElement()) {
326  if (reader.name() == BornAgainTag) {
327  Streamer(&reader).assertVersion(2);
329  reader.attributes().value(BornAgainVersionAttribute).toString();
330 
332  minimal_supported_version)) {
333  QString message = QString("Can't open document version '%1', "
334  "minimal supported version '%2'")
335  .arg(m_currentVersion)
336  .arg(minimal_supported_version);
337  messageService.addError(this, message);
338  return ReadResult::error;
339  }
340 
341  while (reader.readNextStartElement())
342  if (reader.name() == InfoTag)
343  reader.skipCurrentElement();
344  else if (reader.name() == SimulationOptionsTag) {
346  reader.skipCurrentElement();
347  GUI::Session::XML::assertExpectedTag(&reader, SimulationOptionsTag);
348  } else if (reader.name() == SamplesTag) {
349  Streamer s(&reader);
351  // cleanup
352  if (reader.name() != SamplesTag) {
353  if (!reader.isEndElement())
354  reader.skipCurrentElement();
355  reader.skipCurrentElement();
356  }
357  GUI::Session::XML::assertExpectedTag(&reader, SamplesTag);
358  ASSERT(reader.isEndElement());
359 
360  GUI::Session::XML::assertExpectedTag(&reader, SamplesTag);
361  } else if (reader.name() == InstrumentsTag) {
362  Streamer s(&reader);
364  // cleanup
365  if (reader.name() != InstrumentsTag) {
366  if (!reader.isEndElement())
367  reader.skipCurrentElement();
368  reader.skipCurrentElement();
369  }
370  GUI::Session::XML::assertExpectedTag(&reader, InstrumentsTag);
371  ASSERT(reader.isEndElement());
372 
373  GUI::Session::XML::assertExpectedTag(&reader, InstrumentsTag);
374  } else
375  m_applicationModels.readFrom(&reader, &messageService);
376  }
377  }
378  }
379 
380  } catch (DeserializationException& ex) {
381  reader.raiseError(ex.text());
382  }
383 
384  if (reader.hasError()) {
385  QString message = QString("Format error '%1'").arg(reader.errorString());
386  messageService.addError(this, message);
387  return ReadResult::error;
388  }
389 
390  // return "ReadResult::warning" only if warnings have been issued _in here_
391  return warningsBefore != messageService.warnings().size() ? ReadResult::warning
392  : ReadResult::ok;
393 }
void readFrom(class QXmlStreamReader *reader, MessageService *messageService)
void serialize(Streamer &s)
void serialize(Streamer &s)
SimulationOptionsItem m_simulationOptionsItem
MultiLayerItems m_sampleItems
void readContentFrom(QXmlStreamReader *reader)
Supports serialization to or deserialization from QXmlStream.
Definition: Streamer.h:36
void assertVersion(unsigned expectedVersion) const
As reader, throws DeserializationException unless the expected version is read. As writer,...
Definition: Streamer.cpp:26
void assertExpectedTag(QXmlStreamReader *reader, const QString &tag)
Definition: UtilXML.cpp:199
bool isVersionMatchMinimal(const QString &version, const QString &minimal_version)
Returns true if current BornAgain version match minimal required version.
Definition: Path.cpp:117

References MessageService::addError(), GUI::Session::XML::assertExpectedTag(), Streamer::assertVersion(), error, GUI::Util::Path::isVersionMatchMinimal(), m_applicationModels, m_currentVersion, m_instruments, m_sampleItems, m_simulationOptionsItem, ok, SimulationOptionsItem::readContentFrom(), ApplicationModels::readFrom(), InstrumentCollection::serialize(), MultiLayerItems::serialize(), DeserializationException::text(), warning, and MessageService::warnings().

Referenced by loadProjectFile().

Here is the call graph for this function:

◆ realDataModel()

RealDataModel * ProjectDocument::realDataModel ( ) const

Definition at line 136 of file ProjectDocument.cpp.

137 {
139 }
RealDataModel * realDataModel() const

References m_applicationModels, and ApplicationModels::realDataModel().

Referenced by ImportDataView::ImportDataView(), SessionModelView::SessionModelView(), LinkInstrumentManager::onInstrumentAddedOrRemoved(), LinkInstrumentManager::onInstrumentChanged(), SimulationView::realDataItems(), saveProjectData(), and SimulationView::writeOptionsToUI().

Here is the call graph for this function:

◆ sampleItems()

◆ save()

void ProjectDocument::save ( const QString &  project_file_name,
bool  autoSave = false 
)

Definition at line 161 of file ProjectDocument.cpp.

162 {
163  saveProjectData(project_file_name);
164  saveProjectFile(project_file_name, autoSave);
165 }
void saveProjectData(const QString &project_file_name)
void saveProjectFile(const QString &project_file_name, bool autoSave=false)

References saveProjectData(), and saveProjectFile().

Here is the call graph for this function:

◆ saveProjectData()

void ProjectDocument::saveProjectData ( const QString &  project_file_name)

Definition at line 188 of file ProjectDocument.cpp.

189 {
190  for (auto* d : realDataModel()->realDataItems())
191  d->updateNonXMLDataFileNames();
192 
193  QElapsedTimer timer;
194  timer.start();
195 
197 }
void save(const QString &projectDir)
Definition: IOService.cpp:55
RealDataModel * realDataModel() const
QString projectDir(const QString &projectFileName)
Returns project directory deduced from project file name.

References m_dataService, GUI::Project::Utils::projectDir(), realDataModel(), and DatafieldIOService::save().

Referenced by SaveThread::run(), and save().

Here is the call graph for this function:

◆ saveProjectFile()

void ProjectDocument::saveProjectFile ( const QString &  project_file_name,
bool  autoSave = false 
)

Definition at line 167 of file ProjectDocument.cpp.

168 {
169  QElapsedTimer timer;
170  timer.start();
171 
172  QFile file(project_file_name);
173  if (!file.open(QFile::ReadWrite | QIODevice::Truncate | QFile::Text))
174  throw Error("ProjectDocument::save_project_file() -> Error. Can't open "
175  "file '"
176  + project_file_name + "' for writing.");
177 
178  writeTo(&file);
179  file.close();
180 
181  if (!autoSave) {
182  setProjectFileName(project_file_name);
183  m_modified = false;
184  emit modified();
185  }
186 }
void writeTo(QIODevice *device)

References Error, m_modified, modified(), setProjectFileName(), and writeTo().

Referenced by SaveService::process_queue(), and save().

Here is the call graph for this function:

◆ setFunctionalities()

void ProjectDocument::setFunctionalities ( const Functionalities &  f)

Definition at line 300 of file ProjectDocument.cpp.

301 {
302  if (m_functionalities != f) {
303  m_functionalities = f;
304  emit modified();
305  emit functionalitiesChanged();
306  setModified();
307  }
308 }
void functionalitiesChanged()
Emitted when functionality has changed.

References functionalitiesChanged(), m_functionalities, modified(), and setModified().

Referenced by ProjectSettingsView::onFunctionalityToggled().

Here is the call graph for this function:

◆ setModified()

◆ setProjectDir()

void ProjectDocument::setProjectDir ( const QString &  text)

Definition at line 99 of file ProjectDocument.cpp.

100 {
101  m_project_dir = text;
102 }

References m_project_dir.

Referenced by setProjectFileName().

◆ setProjectFileName()

void ProjectDocument::setProjectFileName ( const QString &  projectFileName)

Definition at line 120 of file ProjectDocument.cpp.

121 {
124 }
void setProjectDir(const QString &text)
void setProjectName(const QString &text)
QString projectName(const QString &projectFileName)
Returns project name deduced from project file name.

References GUI::Project::Utils::projectDir(), projectFileName(), GUI::Project::Utils::projectName(), setProjectDir(), and setProjectName().

Referenced by loadProjectFile(), and saveProjectFile().

Here is the call graph for this function:

◆ setProjectName()

void ProjectDocument::setProjectName ( const QString &  text)

Definition at line 79 of file ProjectDocument.cpp.

80 {
81  if (m_project_name != text) {
82  m_project_name = text;
83  emit modified();
84  }
85 }

References m_project_name, and modified().

Referenced by setProjectFileName().

◆ setSingleInstrumentMode()

void ProjectDocument::setSingleInstrumentMode ( bool  b)

Definition at line 270 of file ProjectDocument.cpp.

271 {
272  if (b != m_singleInstrumentMode) {
274  emit modified();
276  setModified();
277  }
278 }
void singleInstrumentModeChanged()
Emitted when single instrument mode has changed.

References m_singleInstrumentMode, modified(), setModified(), and singleInstrumentModeChanged().

Referenced by ProjectSettingsView::onSingleInstrumentRadioToggled().

Here is the call graph for this function:

◆ setSingleSampleMode()

void ProjectDocument::setSingleSampleMode ( bool  b)

Definition at line 285 of file ProjectDocument.cpp.

286 {
287  if (b != m_singleSampleMode) {
288  m_singleSampleMode = b;
289  emit modified();
291  setModified();
292  }
293 }
void singleSampleModeChanged()
Emitted when single sample mode has changed.

References m_singleSampleMode, modified(), setModified(), and singleSampleModeChanged().

Referenced by ProjectSettingsView::onSingleSampleRadioToggled().

Here is the call graph for this function:

◆ simulationOptionsItem()

SimulationOptionsItem * ProjectDocument::simulationOptionsItem ( )

Definition at line 146 of file ProjectDocument.cpp.

147 {
148  return &m_simulationOptionsItem;
149 }

References m_simulationOptionsItem.

Referenced by SimulationView::optionsItem().

◆ singleInstrumentMode()

◆ singleInstrumentModeChanged

void ProjectDocument::singleInstrumentModeChanged ( )
signal

Emitted when single instrument mode has changed.

Referenced by InstrumentView::InstrumentView(), and setSingleInstrumentMode().

◆ singleSampleMode()

bool ProjectDocument::singleSampleMode ( ) const

◆ singleSampleModeChanged

void ProjectDocument::singleSampleModeChanged ( )
signal

Emitted when single sample mode has changed.

Referenced by SampleView::SampleView(), and setSingleSampleMode().

◆ userExportDir()

QString ProjectDocument::userExportDir ( ) const

Returns directory name suitable for saving plots.

Definition at line 106 of file ProjectDocument.cpp.

107 {
108  if (QString dir = validProjectDir(); !dir.isEmpty())
109  return dir;
110  return QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
111 }
QString validProjectDir() const

References validProjectDir().

Here is the call graph for this function:

◆ validProjectDir()

QString ProjectDocument::validProjectDir ( ) const

Definition at line 92 of file ProjectDocument.cpp.

93 {
94  if (m_project_name.isEmpty())
95  return "";
96  return m_project_dir;
97 }

References m_project_dir, and m_project_name.

Referenced by userExportDir().

◆ writeTo()

void ProjectDocument::writeTo ( QIODevice *  device)
private

Definition at line 395 of file ProjectDocument.cpp.

396 {
397  QXmlStreamWriter writer(device);
398  writer.setAutoFormatting(true);
399  writer.writeStartDocument();
400  writer.writeStartElement(BornAgainTag);
401  QString version_string = GUI::Util::Path::getBornAgainVersionString();
402  writer.writeAttribute(BornAgainVersionAttribute, version_string);
403  Streamer(&writer).writeVersion(2);
404 
405  writer.writeStartElement(InfoTag);
406  writer.writeAttribute(InfoNameAttribute, projectName());
407  writer.writeEndElement(); // InfoTag
408 
409  writer.writeStartElement(SimulationOptionsTag);
411  writer.writeEndElement();
412 
413  writer.writeStartElement(SamplesTag);
414  Streamer s(&writer);
416  writer.writeEndElement();
417 
418  writer.writeStartElement(InstrumentsTag);
419  Streamer sInstruments(&writer);
420  m_instruments.serialize(sInstruments);
421  writer.writeEndElement();
422 
423  m_applicationModels.writeTo(&writer);
424 
425  writer.writeEndElement(); // BornAgain tag
426  writer.writeEndDocument();
427 }
void writeTo(class QXmlStreamWriter *writer)
Writes all model in file one by one.
void writeContentTo(QXmlStreamWriter *writer) const
void writeVersion(unsigned version) const
As writer, serializes the given version number. As reader, does nothing.
Definition: Streamer.cpp:19

References GUI::Util::Path::getBornAgainVersionString(), m_applicationModels, m_instruments, m_sampleItems, m_simulationOptionsItem, projectName(), InstrumentCollection::serialize(), MultiLayerItems::serialize(), SimulationOptionsItem::writeContentTo(), ApplicationModels::writeTo(), and Streamer::writeVersion().

Referenced by saveProjectFile().

Here is the call graph for this function:

Member Data Documentation

◆ m_applicationModels

ApplicationModels ProjectDocument::m_applicationModels
private

◆ m_currentVersion

QString ProjectDocument::m_currentVersion
private

Definition at line 139 of file ProjectDocument.h.

Referenced by documentVersion(), and readProject().

◆ m_dataService

DatafieldIOService* ProjectDocument::m_dataService
private

Definition at line 140 of file ProjectDocument.h.

Referenced by ProjectDocument(), hasData(), loadProjectFile(), and saveProjectData().

◆ m_functionalities

Functionalities ProjectDocument::m_functionalities
private

Definition at line 144 of file ProjectDocument.h.

Referenced by functionalities(), and setFunctionalities().

◆ m_instrumentEditController

InstrumentsEditController ProjectDocument::m_instrumentEditController
private

Definition at line 147 of file ProjectDocument.h.

Referenced by ProjectDocument(), and instrumentsEditController().

◆ m_instruments

InstrumentCollection ProjectDocument::m_instruments
private

Definition at line 148 of file ProjectDocument.h.

Referenced by collectedItems(), readProject(), and writeTo().

◆ m_linkManager

std::unique_ptr<LinkInstrumentManager> ProjectDocument::m_linkManager
private

Definition at line 141 of file ProjectDocument.h.

Referenced by ProjectDocument(), and linkInstrumentManager().

◆ m_modified

bool ProjectDocument::m_modified
private

◆ m_project_dir

QString ProjectDocument::m_project_dir
private

Definition at line 135 of file ProjectDocument.h.

Referenced by hasValidNameAndPath(), projectDir(), setProjectDir(), and validProjectDir().

◆ m_project_name

QString ProjectDocument::m_project_name
private

◆ m_sampleItems

MultiLayerItems ProjectDocument::m_sampleItems
private

Definition at line 146 of file ProjectDocument.h.

Referenced by readProject(), sampleItems(), and writeTo().

◆ m_simulationOptionsItem

SimulationOptionsItem ProjectDocument::m_simulationOptionsItem
private

Definition at line 145 of file ProjectDocument.h.

Referenced by readProject(), simulationOptionsItem(), and writeTo().

◆ m_singleInstrumentMode

bool ProjectDocument::m_singleInstrumentMode
private

Definition at line 142 of file ProjectDocument.h.

Referenced by setSingleInstrumentMode(), and singleInstrumentMode().

◆ m_singleSampleMode

bool ProjectDocument::m_singleSampleMode
private

Definition at line 143 of file ProjectDocument.h.

Referenced by setSingleSampleMode(), and singleSampleMode().


The documentation for this class was generated from the following files: