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

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