BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Provide read/write of heavy data files in a separate thread. More...
Public Member Functions | |
OutputDataIOService (ApplicationModels *models, QObject *parent=nullptr) | |
OutputDataIOService (QObject *parent=nullptr) | |
void | load (const QString &projectDir, MessageService *messageService=nullptr) |
QVector< SaveLoadInterface * > | nonXMLItems () const |
Returns all non-XML items available for save/load. More... | |
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. More... | |
Private Attributes | |
ApplicationModels * | m_applicationModels |
OutputDataIOHistory | m_history |
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 OutputDataIOService.h.
|
explicit |
Definition at line 28 of file OutputDataIOService.cpp.
|
explicit |
Definition at line 34 of file OutputDataIOService.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 119 of file OutputDataIOService.cpp.
References ProjectUtils::projectDir(), ProjectUtils::removeFiles(), and ProjectUtils::substract().
Referenced by save().
void OutputDataIOService::load | ( | const QString & | projectDir, |
MessageService * | messageService = nullptr |
||
) |
Definition at line 68 of file OutputDataIOService.cpp.
References m_history, OutputDataDirHistory::markAsSaved(), nonXMLItems(), ProjectUtils::projectDir(), MessageService::send_warning(), and OutputDataIOHistory::setHistory().
Referenced by ProjectDocument::load().
QVector< SaveLoadInterface * > OutputDataIOService::nonXMLItems | ( | ) | const |
Returns all non-XML items available for save/load.
Definition at line 102 of file OutputDataIOService.cpp.
References m_applicationModels, and ApplicationModels::nonXMLItems().
Referenced by ProjectDocument::hasData(), load(), and save().
void OutputDataIOService::save | ( | const QString & | projectDir | ) |
Definition at line 46 of file OutputDataIOService.cpp.
References cleanOldFiles(), OutputDataIOHistory::hasHistory(), m_history, OutputDataDirHistory::markAsSaved(), nonXMLItems(), ProjectUtils::projectDir(), OutputDataDirHistory::savedFileNames(), OutputDataIOHistory::savedFileNames(), OutputDataIOHistory::setHistory(), and OutputDataIOHistory::wasModifiedSinceLastSave().
Referenced by ProjectDocument::save_project_data().
void OutputDataIOService::setApplicationModels | ( | ApplicationModels * | models | ) |
Definition at line 41 of file OutputDataIOService.cpp.
References m_applicationModels.
Referenced by OutputDataIOService(), and ProjectDocument::setApplicationModels().
|
private |
Definition at line 49 of file OutputDataIOService.h.
Referenced by nonXMLItems(), and setApplicationModels().
|
private |
Definition at line 48 of file OutputDataIOService.h.