| BornAgain
    1.19.79
    Simulate and fit neutron and x-ray scattering at grazing incidence | 
Provide read/write of heavy data files in a separate thread.
Listens all models and keep tracks of changes in items. Provides logic to not to re-save already saved data.
Definition at line 30 of file IOService.h.
| Public Member Functions | |
| DatafieldIOService (ApplicationModels *models, QObject *parent=nullptr) | |
| DatafieldIOService (QObject *parent=nullptr) | |
| QVector< SaveLoadInterface * > | dataInterfaces () const | 
| Returns all non-XML items available for save/load.  More... | |
| void | loadDataFiles (const QString &projectDir, MessageService *messageService=nullptr) | 
| void | save (const QString &projectDir) | 
| void | setApplicationModels (ApplicationModels *models) | 
| Private Member Functions | |
| void | cleanOldFiles (const QString &projectDir, const QStringList &oldSaves, const QStringList &newSaves) | 
| Clean old saved files. All files in oldSaves list, which are not in newSaves list, will be removed.  More... | |
| Private Attributes | |
| ApplicationModels * | m_applicationModels | 
| DatafieldIOHistory | m_history | 
| 
 | explicit | 
Definition at line 35 of file IOService.cpp.
| 
 | explicit | 
Definition at line 42 of file IOService.cpp.
References setApplicationModels().
| 
 | private | 
Clean old saved files. All files in oldSaves list, which are not in newSaves list, will be removed.
Definition at line 126 of file IOService.cpp.
References GUI::RealSpace::Particles::name(), and GUI::Project::Utils::projectDir().
Referenced by save().
| QVector< SaveLoadInterface * > DatafieldIOService::dataInterfaces | ( | ) | const | 
Returns all non-XML items available for save/load.
Definition at line 109 of file IOService.cpp.
References m_applicationModels, and ApplicationModels::nonXMLItems().
Referenced by ProjectDocument::hasData(), loadDataFiles(), and save().
| void DatafieldIOService::loadDataFiles | ( | const QString & | projectDir, | 
| MessageService * | messageService = nullptr | ||
| ) | 
Definition at line 77 of file IOService.cpp.
References MessageService::addWarning(), dataInterfaces(), Failed, m_history, DatafieldDirHistory::markAsSaved(), GUI::Project::Utils::projectDir(), and DatafieldIOHistory::setHistory().
Referenced by ProjectDocument::loadProjectFile().
| void DatafieldIOService::save | ( | const QString & | projectDir | ) | 
Definition at line 55 of file IOService.cpp.
References cleanOldFiles(), dataInterfaces(), DatafieldIOHistory::hasHistory(), m_history, DatafieldDirHistory::markAsSaved(), GUI::Project::Utils::projectDir(), DatafieldDirHistory::savedFileNames(), DatafieldIOHistory::savedFileNames(), DatafieldIOHistory::setHistory(), and DatafieldIOHistory::wasModifiedSinceLastSave().
Referenced by ProjectDocument::saveProjectData().
| void DatafieldIOService::setApplicationModels | ( | ApplicationModels * | models | ) | 
Definition at line 50 of file IOService.cpp.
References m_applicationModels.
Referenced by DatafieldIOService(), and ProjectDocument::ProjectDocument().
| 
 | private | 
Definition at line 49 of file IOService.h.
Referenced by dataInterfaces(), and setApplicationModels().
| 
 | private | 
Definition at line 48 of file IOService.h.
Referenced by loadDataFiles(), and save().