1 | /* -------------------------------------------------------------------------
|
---|
2 | * BKG NTRIP Client
|
---|
3 | * -------------------------------------------------------------------------
|
---|
4 | *
|
---|
5 | * Class: bncSettings
|
---|
6 | *
|
---|
7 | * Purpose: Subclasses the QSettings
|
---|
8 | *
|
---|
9 | * Author: L. Mervart
|
---|
10 | *
|
---|
11 | * Created: 25-Jan-2009
|
---|
12 | *
|
---|
13 | * Changes:
|
---|
14 | *
|
---|
15 | * -----------------------------------------------------------------------*/
|
---|
16 |
|
---|
17 | #include "bncsettings.h"
|
---|
18 | #include "bncapp.h"
|
---|
19 |
|
---|
20 | // Constructor
|
---|
21 | ////////////////////////////////////////////////////////////////////////////
|
---|
22 | bncSettings::bncSettings(bool noInit) {
|
---|
23 |
|
---|
24 | _bncApp = static_cast<bncApp*>(qApp);
|
---|
25 |
|
---|
26 | // First fill the options
|
---|
27 | // ----------------------
|
---|
28 | if (_bncApp->_settings.size() == 0) {
|
---|
29 | QSettings settings(_bncApp->confFileName(), QSettings::IniFormat);
|
---|
30 |
|
---|
31 | // Read from File
|
---|
32 | // --------------
|
---|
33 | if (settings.allKeys().size() > 0) {
|
---|
34 | QStringListIterator it(settings.allKeys());
|
---|
35 | while (it.hasNext()) {
|
---|
36 | QString key = it.next();
|
---|
37 | _bncApp->_settings[key] = settings.value(key);
|
---|
38 | }
|
---|
39 | }
|
---|
40 |
|
---|
41 | // Set Defaults
|
---|
42 | // ------------
|
---|
43 | else if (!noInit) {
|
---|
44 |
|
---|
45 | }
|
---|
46 | }
|
---|
47 | }
|
---|
48 |
|
---|
49 | // Destructor
|
---|
50 | ////////////////////////////////////////////////////////////////////////////
|
---|
51 | bncSettings::~bncSettings() {
|
---|
52 |
|
---|
53 | }
|
---|
54 |
|
---|
55 | //
|
---|
56 | ////////////////////////////////////////////////////////////////////////////
|
---|
57 | QVariant bncSettings::value(const QString& key,
|
---|
58 | const QVariant& defaultValue) const {
|
---|
59 |
|
---|
60 | if (_bncApp->_settings.contains(key)) {
|
---|
61 | return _bncApp->_settings[key];
|
---|
62 | }
|
---|
63 | else {
|
---|
64 | return defaultValue;
|
---|
65 | }
|
---|
66 | }
|
---|
67 |
|
---|
68 | //
|
---|
69 | ////////////////////////////////////////////////////////////////////////////
|
---|
70 | void bncSettings::setValue(const QString &key, const QVariant& value) {
|
---|
71 | _bncApp->_settings[key] = value;
|
---|
72 | }
|
---|
73 |
|
---|
74 | //
|
---|
75 | ////////////////////////////////////////////////////////////////////////////
|
---|
76 | void bncSettings::remove(const QString& key ) {
|
---|
77 |
|
---|
78 | }
|
---|
79 |
|
---|
80 | //
|
---|
81 | ////////////////////////////////////////////////////////////////////////////
|
---|
82 | void bncSettings::sync() {
|
---|
83 |
|
---|
84 | }
|
---|
85 |
|
---|
86 | // QSettings(((bncApp*) qApp)->confFileName(), QSettings::IniFormat) {
|
---|
87 | //
|
---|
88 | // if (! noInit && allKeys().size() == 0) {
|
---|
89 | // //
|
---|
90 | // setValue("startTab", "0");
|
---|
91 | // setValue("statusTab", "0");
|
---|
92 | // setValue("casterUrlList", (QStringList()
|
---|
93 | // << "http://user:pass@www.euref-ip.net:2101"
|
---|
94 | // << "http://user:pass@www.igs-ip.net:2101"
|
---|
95 | // << "http://user:pass@products.igs-ip.net:2101"
|
---|
96 | // << "http://user:pass@mgex.igs-ip.net:2101"));
|
---|
97 | // setValue("mountPoints", "");
|
---|
98 | // setValue("ntripVersion", "1");
|
---|
99 | // // Network
|
---|
100 | // setValue("proxyHost", "");
|
---|
101 | // setValue("proxyPort", "");
|
---|
102 | // setValue("sslCaCertPath", "");
|
---|
103 | // setValue("ignoreSslErrors", "0");
|
---|
104 | // // General
|
---|
105 | // setValue("logFile", "");
|
---|
106 | // setValue("rnxAppend", "0");
|
---|
107 | // setValue("onTheFlyInterval", "1 day");
|
---|
108 | // setValue("autoStart", "0");
|
---|
109 | // setValue("rawOutFile", "");
|
---|
110 | // // RINEX Observations
|
---|
111 | // setValue("rnxPath", "");
|
---|
112 | // setValue("rnxIntr", "1 day");
|
---|
113 | // setValue("rnxSampl", "0");
|
---|
114 | // setValue("rnxSkel", "SKL");
|
---|
115 | // setValue("rnxScript", "");
|
---|
116 | // setValue("rnxV3", "0");
|
---|
117 | // // RINEX Ephemeris
|
---|
118 | // setValue("ephPath", "");
|
---|
119 | // setValue("ephIntr", "1 day");
|
---|
120 | // setValue("outEphPort", "");
|
---|
121 | // setValue("ephV3", "0");
|
---|
122 | // // Braodcast Corrections
|
---|
123 | // setValue("corrPath", "");
|
---|
124 | // setValue("corrIntr", "1 day");
|
---|
125 | // setValue("corrPort", "");
|
---|
126 | // setValue("corrTime", "5");
|
---|
127 | // // Feed Engine
|
---|
128 | // setValue("outPort", "");
|
---|
129 | // setValue("waitTime", "5");
|
---|
130 | // setValue("binSampl", "0");
|
---|
131 | // setValue("outFile", "");
|
---|
132 | // setValue("outUPort", "");
|
---|
133 | // // Serial Output
|
---|
134 | // setValue("serialMountPoint", "");
|
---|
135 | // setValue("serialPortName", "");
|
---|
136 | // setValue("serialBaudRate", "9600");
|
---|
137 | // setValue("serialFlowControl", "OFF");
|
---|
138 | // setValue("serialDataBits", "8");
|
---|
139 | // setValue("serialParity", "NONE");
|
---|
140 | // setValue("serialStopBits", "1");
|
---|
141 | // setValue("serialAutoNMEA", "Auto");
|
---|
142 | // setValue("serialFileNMEA", "");
|
---|
143 | // setValue("serialHeightNMEA", "");
|
---|
144 | // // Outages
|
---|
145 | // setValue("obsRate", "");
|
---|
146 | // setValue("adviseFail", "15");
|
---|
147 | // setValue("adviseReco", "5");
|
---|
148 | // setValue("adviseScript", "");
|
---|
149 | // // Miscellaneous
|
---|
150 | // setValue("miscMount", "");
|
---|
151 | // setValue("perfIntr", "");
|
---|
152 | // setValue("scanRTCM", "0");
|
---|
153 | // // PPP
|
---|
154 | // setValue("pppSPP", "");
|
---|
155 | // setValue("pppMount", "");
|
---|
156 | // setValue("pppCorrMount", "");
|
---|
157 | // setValue("pppRefCrdX", "");
|
---|
158 | // setValue("pppRefCrdY", "");
|
---|
159 | // setValue("pppRefCrdZ", "");
|
---|
160 | // setValue("pppRefdN", "");
|
---|
161 | // setValue("pppRefdE", "");
|
---|
162 | // setValue("pppRefdU", "");
|
---|
163 | // setValue("nmeaFile", "");
|
---|
164 | // setValue("nmeaPort", "");
|
---|
165 | // setValue("pppPlotCoordinates", "");
|
---|
166 | // setValue("postObsFile", "");
|
---|
167 | // setValue("postNavFile", "");
|
---|
168 | // setValue("postCorrFile", "");
|
---|
169 | // setValue("postOutFile", "");
|
---|
170 | // setValue("pppAntenna", "");
|
---|
171 | // setValue("pppAntex", "");
|
---|
172 | // setValue("pppApplySatAnt", "0");
|
---|
173 | // setValue("pppUsePhase", "");
|
---|
174 | // setValue("pppEstTropo", "");
|
---|
175 | // setValue("pppGLONASS", "");
|
---|
176 | // setValue("pppGalileo", "");
|
---|
177 | // setValue("pppSync", "");
|
---|
178 | // setValue("pppAverage", "");
|
---|
179 | // setValue("pppQuickStart", "");
|
---|
180 | // setValue("pppMaxSolGap", "");
|
---|
181 | // setValue("pppSigmaCode", "10.0");
|
---|
182 | // setValue("pppSigmaPhase", "0.02");
|
---|
183 | // setValue("pppSigCrd0", "100.0");
|
---|
184 | // setValue("pppSigCrdP", "100.0");
|
---|
185 | // setValue("pppSigTrp0", "0.1");
|
---|
186 | // setValue("pppSigTrpP", "3e-6");
|
---|
187 | // // Reqc
|
---|
188 | // setValue("reqcAction", "");
|
---|
189 | // setValue("reqcObsFile", "");
|
---|
190 | // setValue("reqcNavFile", "");
|
---|
191 | // setValue("reqcOutObsFile", "");
|
---|
192 | // setValue("reqcOutNavFile", "");
|
---|
193 | // setValue("reqcOutLogFile", "");
|
---|
194 | // setValue("reqcRnxVersion", "");
|
---|
195 | // setValue("reqcSampling", "");
|
---|
196 | // setValue("reqcStartDateTime", "");
|
---|
197 | // setValue("reqcEndDateTime", "");
|
---|
198 | // setValue("reqcOldMarkerName", "");
|
---|
199 | // setValue("reqcNewMarkerName", "");
|
---|
200 | // setValue("reqcOldAntennaName", "");
|
---|
201 | // setValue("reqcNewAntennaName", "");
|
---|
202 | // setValue("reqcOldReceiverName", "");
|
---|
203 | // setValue("reqcNewReceiverName", "");
|
---|
204 | // // Combination
|
---|
205 | // setValue("combineStreams", "");
|
---|
206 | // setValue("cmbMethod", "");
|
---|
207 | // setValue("cmbMaxres", "");
|
---|
208 | // // Upload (clk)
|
---|
209 | // setValue("uploadMountpointsOut","");
|
---|
210 | // setValue("uploadIntr", "1 day");
|
---|
211 | // setValue("uploadSampl", "5");
|
---|
212 | // setValue("uploadSamplOrb", "0");
|
---|
213 | // setValue("trafo_dx", "");
|
---|
214 | // setValue("trafo_dy", "");
|
---|
215 | // setValue("trafo_dz", "");
|
---|
216 | // setValue("trafo_dxr", "");
|
---|
217 | // setValue("trafo_dyr", "");
|
---|
218 | // setValue("trafo_dzr", "");
|
---|
219 | // setValue("trafo_ox", "");
|
---|
220 | // setValue("trafo_oy", "");
|
---|
221 | // setValue("trafo_oz", "");
|
---|
222 | // setValue("trafo_oxr", "");
|
---|
223 | // setValue("trafo_oyr", "");
|
---|
224 | // setValue("trafo_ozr", "");
|
---|
225 | // setValue("trafo_sc", "");
|
---|
226 | // setValue("trafo_scr", "");
|
---|
227 | // setValue("trafo_t0", "");
|
---|
228 | // // Upload (eph)
|
---|
229 | // setValue("uploadEphHost", "");
|
---|
230 | // setValue("uploadEphPort", "");
|
---|
231 | // setValue("uploadEphMountpoint", "");
|
---|
232 | // setValue("uploadEphPassword", "");
|
---|
233 | // setValue("uploadEphSample", "5");
|
---|
234 | // sync();
|
---|
235 | // }
|
---|
236 |
|
---|
237 |
|
---|