Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxSessionStorageServiceImpl.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXSESSIONSTORAGESERVICEIMPL_H
13 #define CXSESSIONSTORAGESERVICEIMPL_H
14 
15 #include "org_custusx_core_patientmodel_Export.h"
16 
18 class QDomDocument;
19 class ctkPluginContext;
20 
21 namespace cx
22 {
23 
24 
31 class org_custusx_core_patientmodel_EXPORT SessionStorageServiceImpl : public SessionStorageService
32 {
33  Q_OBJECT
34 public:
35  SessionStorageServiceImpl(ctkPluginContext* context);
36  virtual ~SessionStorageServiceImpl();
37  virtual void load(QString dir);
38  virtual void save();
39  virtual void clear();
40  virtual bool isValid() const;
41  virtual QString getRootFolder() const;
42  virtual bool isNull() const;
43 
44 private slots:
45  void onSessionChanged();
46  void startupLoadPatient();
47 private:
48  void reportActivePatient();
49  void setActivePatient(const QString& activePatientFolder);
50  QString getXmlFileName() const;
51 
52  bool isValidSessionFolder(QString dir) const;
53  bool folderExists(QString dir) const;
54  void loadSession(QString dir);
55  void initializeNewSession(QString dir);
56  bool isActivePatient(QString patient) const;
57  void loadPatientSilent(QString choosenDir);
58  void writeRecentPatientData();
59  void generateSaveDoc(QDomDocument& doc);
60  void clearPatientSilent();
61  QString getNoPatientFolder() const;
62  void createPatientFolders(QString dir);
63  static QString getVersionName();
64  QString convertToValidFolderName(QString dir) const;
65  void clearCache();
66  QString getCommandLineStartupPatient();
67 
68  QString mActivePatientFolder;
69 };
70 
71 } // namespace cx
72 
73 #endif // CXSESSIONSTORAGESERVICEIMPL_H
Namespace for all CustusX production code.