source: ntrip/trunk/BNC/bncsettings.cpp@ 4072

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