-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdrs4programsettingsmanager.h
167 lines (136 loc) · 5.75 KB
/
drs4programsettingsmanager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/****************************************************************************
**
** DDRS4PALS, a software for the acquisition of lifetime spectra using the
** DRS4 evaluation board of PSI: https://www.psi.ch/drs/evaluation-board
**
** Copyright (C) 2016-2022 Dr. Danny Petschke
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see http://www.gnu.org/licenses/.
**
*****************************************************************************
**
** @author: Dr. Danny Petschke
** @contact: [email protected]
**
*****************************************************************************
**
** related publications:
**
** when using DDRS4PALS for your research purposes please cite:
**
** DDRS4PALS: A software for the acquisition and simulation of lifetime spectra using the DRS4 evaluation board:
** https://www.sciencedirect.com/science/article/pii/S2352711019300676
**
** and
**
** Data on pure tin by Positron Annihilation Lifetime Spectroscopy (PALS) acquired with a semi-analog/digital setup using DDRS4PALS
** https://www.sciencedirect.com/science/article/pii/S2352340918315142?via%3Dihub
**
** when using the integrated simulation tool /DLTPulseGenerator/ of DDRS4PALS for your research purposes please cite:
**
** DLTPulseGenerator: A library for the simulation of lifetime spectra based on detector-output pulses
** https://www.sciencedirect.com/science/article/pii/S2352711018300530
**
** Update (v1.1) to DLTPulseGenerator: A library for the simulation of lifetime spectra based on detector-output pulses
** https://www.sciencedirect.com/science/article/pii/S2352711018300694
**
** Update (v1.2) to DLTPulseGenerator: A library for the simulation of lifetime spectra based on detector-output pulses
** https://www.sciencedirect.com/science/article/pii/S2352711018301092
**
** Update (v1.3) to DLTPulseGenerator: A library for the simulation of lifetime spectra based on detector-output pulses
** https://www.sciencedirect.com/science/article/pii/S235271101930038X
**/
#ifndef DRS4PROGRAMSETTINGSMANAGER_H
#define DRS4PROGRAMSETTINGSMANAGER_H
#include <QCoreApplication>
#include <QMutex>
#include <QMutexLocker>
#include <QDateTime>
#include "dversion.h"
#include "DLib.h"
class DRS4ProgramSettingsManager
{
DSimpleXMLNode *m_parentNode;
DSimpleXMLNode *m_lastSaveDateNode;
DSimpleXMLNode *m_renderPointsNode;
DSimpleXMLNode *m_lastSimulationInputFilePathNode;
DSimpleXMLNode *m_lastStreamInputFilePathNode;
DSimpleXMLNode *m_lastStreamTextFileInputFilePathNode;
DSimpleXMLNode *m_lastSettingsFilePathNode;
DSimpleXMLNode *m_lastSaveDataFilePathNode;
DSimpleXMLNode *m_lastSaveScriptFilePathNode;
DSimpleXMLNode *m_lastSaveLogFilePathNode;
DSimpleXMLNode *m_lastPHSSaveFilePathNode;
DSimpleXMLNode *m_lastRiseTimeDistrPathNode;
DSimpleXMLNode *m_lastAreaDistrPathNode;
DSimpleXMLNode *m_httpServerPort;
DSimpleXMLNode *m_httpServerAutoStart;
DSimpleXMLNode *m_httpServerUrlUpdateRate;
DSimpleXMLNode *m_rcServerPort;
DSimpleXMLNode *m_rcServerIP;
DSimpleXMLNode *m_rcServerAutoStart;
DSimpleXMLNode *m_multicoreThreadingParentNode;
DSimpleXMLNode *m_enableMulticoreThreadingNode;
DSimpleXMLNode *m_pulsePairChunkSizeNode;
mutable QMutex m_mutex;
DRS4ProgramSettingsManager();
virtual ~DRS4ProgramSettingsManager();
bool save();
bool load();
public:
static DRS4ProgramSettingsManager *sharedInstance();
void setSplineIntraPoints(int points);
void setSimulationInputFilePath(const QString& path);
void setStreamInputFilePath(const QString& path);
void setStreamTextFileInputFilePath(const QString& path);
void setSettingsFilePath(const QString& path);
void setSaveDataFilePath(const QString& path);
void setSaveScriptFilePath(const QString& path);
void setSaveLogFilePath(const QString& path);
void setSavePHSDataFilePath(const QString& path);
void setSaveRiseTimeDistributionDataFilePath(const QString& path);
void setSaveAreaDistributionDataFilePath(const QString& path);
void setHttpServerAutostart(bool on);
void setHttpServerPort(int port);
void setHttpServerUrlUpdateRate(int rate);
void setRemoteControlServerAutostart(bool on);
void setRemoteControlServerPort(int port);
void setRemoteControlServerIP(const QString& ip);
void setEnableMulticoreThreading(bool on);
void setPulsePairChunkSize(int size);
int splineIntraPoints();
QString simulationInputFilePath();
QString streamInputFilePath();
QString streamTextFileInputFilePath();
QString settingsFilePath();
QString saveDataFilePath();
QString saveScriptFilePath();
QString saveLogFilePath();
QString savePHSDataFilePath();
QString saveRiseTimeDistributionDataFilePath();
QString saveAreaDistributionDataFilePath();
bool httpServerAutostart();
int httpServerPort();
int httpServerUrlUpdateRate();
bool remoteControlServerAutostart();
int remoteControlServerPort();
QString remoteControlServerIP();
bool isMulticoreThreadingEnabled();
int pulsePairChunkSize();
void showXMLContent();
private:
void setLastSaveDate(const QDateTime& dateTime);
QString lastSaveDate();
};
#endif // DRS4PROGRAMSETTINGSMANAGER_H