source: ntrip/trunk/BNC/src/bncmain.cpp@ 11158

Last change on this file since 11158 was 11158, checked in by stuerze, 3 weeks ago

deprecated functions exchanged libs updated

File size: 33.9 KB
Line 
1// Part of BNC, a utility for retrieving decoding and
2// converting GNSS data streams from NTRIP broadcasters.
3//
4// Copyright (C) 2007
5// German Federal Agency for Cartography and Geodesy (BKG)
6// http://bkg.bund.de
7// Czech Technical University Prague, Department of Geodesy
8// http://www.fsv.cvut.cz
9//
10// Email: euref-ip@bkg.bund.de
11//
12// This program is free software; you can redistribute it and/or
13// modify it under the terms of the GNU General Public License
14// as published by the Free Software Foundation, version 2.
15//
16// This program is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this program; if not, write to the Free Software
23// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
25/* -------------------------------------------------------------------------
26 * BKG NTRIP Client
27 * -------------------------------------------------------------------------
28 *
29 * Class: main
30 *
31 * Purpose: Application starts here
32 *
33 * Author: L. Mervart
34 *
35 * Created: 24-Dec-2005
36 *
37 * Changes:
38 *
39 * -----------------------------------------------------------------------*/
40
41#ifndef WIN32
42#include <unistd.h>
43#else
44#include <windows.h>
45#endif
46#include <signal.h>
47#include <QApplication>
48#include <QFile>
49#include <QRegularExpression>
50#include <iostream>
51#include <QNetworkProxyFactory>
52
53#include "app.h"
54#include "bnccore.h"
55#include "bncwindow.h"
56#include "bncsettings.h"
57#include "bncversion.h"
58#include "upload/bncephuploadcaster.h"
59#include "rinex/reqcedit.h"
60#include "rinex/reqcanalyze.h"
61#include "orbComp/sp3Comp.h"
62
63using namespace std;
64
65
66void catch_SIGINT(int) {
67 cout << "BNC Interrupted by Ctrl-C" << endl;
68 BNC_CORE->sigintReceived = 1;
69 BNC_CORE->stopPPP();
70 BNC_CORE->stopCombination();
71 BNC_CORE->stopSsrQc();
72#ifndef WIN32
73 sleep(2);
74#else
75 Sleep(2000);
76#endif
77 ::exit(0);
78}
79
80void catch_SIGTERM(int) {
81 cout << "BNC Terminated" << endl;
82 BNC_CORE->sigintReceived = 1;
83 BNC_CORE->stopPPP();
84 BNC_CORE->stopCombination();
85 BNC_CORE->stopSsrQc();
86#ifndef WIN32
87 sleep(2);
88#else
89 Sleep(2000);
90#endif
91 ::exit(0);
92}
93
94void catch_SIGHUP(int) {
95 cout << "BNC received SIGHUP signal: reload configuration" << endl;
96 bncSettings settings;
97 settings.reRead();
98 BNC_CORE->caster()->readMountPoints();
99}
100
101// Main Program
102/////////////////////////////////////////////////////////////////////////////
103// Command line argument matches the option pattern, e.g. "--?conf"
104////////////////////////////////////////////////////////////////////////////
105static bool isOption(const char* arg, const char* pattern) {
106 return QRegularExpression(QRegularExpression::anchoredPattern(pattern)).match(arg).hasMatch();
107}
108
109int main(int argc, char* argv[]) {
110
111 bool interactive = true;
112#ifdef WIN32
113 bool displaySet = true;
114#else
115 bool displaySet = false;
116#endif
117 QByteArray rawFileName;
118 QString confFileName;
119
120 bncWindow* bncWin = 0;
121 t_reqcEdit* reqcEdit = 0;
122 t_reqcAnalyze* reqcAnalyze = 0;
123 t_sp3Comp* sp3Comp = 0;
124 bncEphUploadCaster* casterEph = 0;
125 bncCaster* caster = 0;
126 bncRawFile* rawFile = 0;
127 bncGetThread* getThread = 0;
128
129 QByteArray printHelp =
130 "Usage:\n"
131 " bnc --help (MS Windows: bnc.exe --help | more)\n"
132 " --nw\n"
133 " --version (MS Windows: bnc.exe --version | more)\n"
134 " --display {name}\n"
135 " --conf {confFileName}\n"
136 " --file {rawFileName}\n"
137 " --key {keyName} {keyValue}\n"
138 "\n"
139 "Network Panel keys:\n"
140 " proxyHost {Proxy host, name or IP address [character string]}\n"
141 " proxyPort {Proxy port [integer number]}\n"
142 " sslCaCertPath {Full path to SSL certificates [character string]}\n"
143 " sslClientCertPath {Full path to client SSL certificates [character string]}\n"
144 " sslIgnoreErrors {Ignore SSL authorization errors [integer number: 0=no,2=yes]}\n"
145 " credentialsFile {Credentials files, netrc or BNC format, default $NETRC or ~/.netrc [character string, comma separated list]}\n"
146 "\n"
147 "General Panel keys:\n"
148 " logFile {Logfile, full path [character string]}\n"
149 " rnxAppend {Append files [integer number: 0=no,2=yes]}\n"
150 " onTheFlyInterval {Configuration reload interval [character string: no|1 day|1 hour|5 min|1 min]}\n"
151 " autoStart {Auto start [integer number: 0=no,2=yes]}\n"
152 " rawOutFile {Raw output file, full path [character string]}\n"
153 " ephMount {Broadcast Ephemeris mountpoint(s) for combination, upload of corrections and SSR QC, comma separated [character string]}\n"
154 "\n"
155 "RINEX Observations Panel keys:\n"
156 " rnxPath {Directory for RINEX files [character string]}\n"
157 " rnxIntr {File interval [character string: 1 min|2 min|5 min|10 min|15 min|30 min|1 hour|1 day]}\n"
158 " rnxSampl {File sampling rate [character string: 0.1 sec|1 sec|5 sec|10 sec|15 sec|30 sec|60 sec]}\n"
159 " rnxSkel {RINEX skeleton file extension [character string: skl|SKL]}\n"
160 " rnxSkelPath {Directory for local skeleton files [character string]}\n"
161 " rnxOnlyWithSKL {Using RINEX skeleton file is mandatory [integer number: 0=no,2=yes]}\n"
162 " rnxScript {File upload script, full path [character string]}\n"
163 " rnxVersion {Specifies the RINEX version of the file contents [integer number: 2|3|4]}\n"
164 " rnxV2Priority {Priority of signal attributes for RINEX version 2 [character string, list separated by blank character,\n"
165 " example: G:12&PWCSLX G:5&IQX R:12&PC R:3&IQX R:46&ABX E:16&BCXZ E:578&IQX J:1&SLXCZ J:26&SLX J:5&IQX C:267&IQX C:18&DPX I:ABCX S:1&C S:5&IQX]}\n"
166 "\n"
167 "RINEX Ephemeris Panel keys:\n"
168 " ephPath {Directory [character string]}\n"
169 " ephIntr {File interval [character string: 1 min|2 min|5 min|10 min|15 min|30 min|1 hour|1 day]}\n"
170 " ephOutPort {Output port [integer number]}\n"
171 " ephVersion {Specifies the RINEX version of the file contents [integer number: 2|3|4]}\n"
172 " ephFilePerStation {One RINEX navigation file per stream [integer number: 0=no,2=yes]}\n"
173 "\n"
174 "RINEX Editing and QC Panel keys:\n"
175 " reqcAction {Action specification [character string: Blank|Edit/Concatenate|Analyze]}\n"
176 " reqcObsFile {Input observations file(s), full path [character string, comma separated list in quotation marks]}\n"
177 " reqcNavFile {Input navigation file(s), full path [character string, comma separated list in quotation marks]}\n"
178 " reqcOutObsFile {Output observations file, full path [character string]}\n"
179 " reqcOutNavFile {Output navigation file, full path [character string]}\n"
180 " reqcMinEle {Minimum satellite elevation in degrees [integer number: 0-90]}\n"
181 " reqcOutLogFile {Output logfile, full path [character string]}\n"
182 " reqcLogSummaryOnly {Output only summary of logfile [integer number: 0=no,2=yes]}\n"
183 " reqcSkyPlotSignals {Observation signals [character string, list separated by blank character,\n"
184 " example: G:1&2&5 R:1&2&3 E:1&7 C:2&6 J:1&2 I:5&9 S:1&5]}\n"
185 " reqcPlotDir {QC plots directory [character string]}\n"
186 " reqcRnxVersion {RINEX version [integer number: 2|3|4]}\n"
187 " reqcSampling {RINEX output file sampling rate [character string: 0.1 sec|1 sec|5 sec|10 sec|15 sec|30 sec|60 sec]}\n"
188 " reqcV2Priority {Version 2 priority of signal attributes [character string, list separated by blank character,\n"
189 " example: G:12&PWCSLX G:5&IQX R:12&PC R:3&IQX R:46&ABX E:16&BCXZ E:578&IQX J:1&SLXCZ J:26&SLX J:5&IQX C:267&IQX C:18&DPX I:ABCX S:1&C S:5&IQX]}\n"
190 " reqcStartDateTime {Start time [character string, example: 1967-11-02T00:00:00]}\n"
191 " reqcEndDateTime {Stop time [character string, example: 2099-01-01T00:00:00]}\n"
192 " reqcRunBy {Operators name [character string]}\n"
193 " reqcUseObsTypes {Use observation types [character string, list separated by blank character, example: G:C1C G:L1C R:C1C RC1P]}\n"
194 " reqcComment {Additional comments [character string]}\n"
195 " reqcOldMarkerName {Old marker name [character string]}\n"
196 " reqcNewMarkerName {New marker name [character string]}\n"
197 " reqcOldAntennaName {Old antenna name [character string]}\n"
198 " reqcNewAntennaName {New antenna name [character string]}\n"
199 " reqcOldAntennaNumber {Old antenna number [character string]}\n"
200 " reqcNewAntennaNumber {New antenna number [character string]}\n"
201 " reqcOldAntennadN {Old north eccentricity [character string]}\n"
202 " reqcNewAntennadN {New north eccentricity [character string]}\n"
203 " reqcOldAntennadE {Old east eccentricity [character string]}\n"
204 " reqcNewAntennadE {New east eccentricity [character string]}\n"
205 " reqcOldAntennadU {Old up eccentricity [character string]}\n"
206 " reqcNewAntennadU {New up eccentricity [character string]}\n"
207 " reqcOldReceiverName {Old receiver name [character string]}\n"
208 " reqcNewReceiverName {New receiver name [character string]}\n"
209 " reqcOldReceiverNumber {Old receiver number [character string]}\n"
210 " reqcNewReceiverNumber {New receiver number [character string]}\n"
211 "\n"
212 "SP3 Comparison Panel keys:\n"
213 " sp3CompFile {SP3 input files, full path [character string, comma separated list in quotation marks]}\n"
214 " sp3CompExclude {Satellite exclusion list [character string, comma separated list in quotation marks, example: G04,G31,R]}\n"
215 " sp3CompOutLogFile {Output logfile, full path [character string]}\n"
216 " sp3CompSummaryOnly {Output only summary of logfile [integer number: 0=no,2=yes]}\n"
217 "\n"
218 "Broadcast Corrections Panel keys:\n"
219 " corrPath {Directory for saving files in ASCII format [character string]}\n"
220 " corrIntr {File interval [character string: 1 min|2 min|5 min|10 min|15 min|30 min|1 hour|1 day]}\n"
221 " corrPort {Output port [integer number]}\n"
222 " ssrQcPath {Directory for SSR QC files, one per stream [character string]}\n"
223 " ssrQcStreams {Streams to check [character string: ALL or comma separated list of stream names; '!' excludes a stream, e.g. ALL,!SIRGAS200001]}\n"
224 " ssrQcRef {Reference of the stream comparison [character string: CONSENSUS or a stream name, e.g. INTERNAL]}\n"
225 " ssrQcIntr {SSR QC report interval [character string: 5 min|15 min|30 min|1 hour|1 day]}\n"
226 " ssrQcBiasFile {Bias SINEX file (OSB or DSB) as reference for the SSR QC code bias check, full path [character string]}\n"
227 " ssrQcAntexFile {ANTEX file for the SSR QC attitude check (SSR yaw vs. clocks during turns), full path [character string]}\n"
228 "\n"
229 "Feed Engine Panel keys:\n"
230 " outPort {Output port, synchronized [integer number]}\n"
231 " outWait {Wait for full observation epoch [integer number of seconds: 1-30]}\n"
232 " outSampl {Sampling rate [character string: 0.1 sec|1 sec|5 sec|10 sec|15 sec|30 sec|60 sec]}\n"
233 " outFile {Output file, full path [character string]}\n"
234 " outUPort {Output port, unsynchronized [integer number]}\n"
235 "\n"
236 "Serial Output Panel:\n"
237 " serialMountPoint {Mountpoint [character string]}\n"
238 " serialPortName {Port name [character string]}\n"
239 " serialBaudRate {Baud rate [integer number: 110|300|600|1200|2400|4800|9600|19200|38400|57600|115200]}\n"
240 " serialFlowControl {Flow control [character string: OFF|XONXOFF|HARDWARE}\n"
241 " serialDataBits {Data bits [integer number: 5|6|7|8]}\n"
242 " serialParity {Parity [character string: NONE|ODD|EVEN|SPACE]}\n"
243 " serialStopBits {Stop bits [integer number: 1|2]}\n"
244 " serialAutoNMEA {NMEA specification [character string: no|Auto|Manual GPGGA|Manual GNGGA]}\n"
245 " serialFileNMEA {NMEA filename, full path [character string]}\n"
246 " serialHeightNMEA {Height [floating-point number]}\n"
247 " serialHeightNMEASampling {Sampling rate [integer number of seconds: 0|10|20|30|...|280|290|300]}\n"
248 "\n"
249 "Outages Panel keys:\n"
250 " adviseObsRate {Stream observation rate [character string: 0.1 Hz|0.2 Hz|0.5 Hz|1 Hz|5 Hz]} \n"
251 " adviseFail {Failure threshold [integer number of minutes: 0-60]}\n"
252 " adviseReco {Recovery threshold [integer number of minutes: 0-60]}\n"
253 " adviseScript {Advisory script, full path [character string]}\n"
254 "\n"
255 "Miscellaneous Panel keys:\n"
256 " miscMount {Mountpoint [character string]}\n"
257 " miscIntr {Interval for logging latency [character string: Blank|2 sec|10 sec|1 min|5 min|15 min|1 hour|6 hours|1 day]}\n"
258 " miscScanRTCM {Scan for RTCM message numbers [integer number: 0=no,2=yes]}\n"
259 " miscPort {Output port [integer number]}\n"
260 "\n"
261 "PPP Client Panel 1 keys:\n"
262 " PPP/dataSource {Data source [character string: Blank|Real-Time Streams|RINEX Files]}\n"
263 " PPP/rinexObs {RINEX observation file, full path [character string]}\n"
264 " PPP/rinexNav {RINEX navigation file, full path [character string]}\n"
265 " PPP/corrMount {Corrections mountpoint [character string]}\n"
266 " PPP/corrFile {Corrections file, full path [character string]}\n"
267 " PPP/crdFile {Coordinates file, full path [character string]}\n"
268 " PPP/logPath {Directory for PPP log files [character string]}\n"
269 " PPP/antexFile {ANTEX file, full path [character string]}\n"
270 " PPP/blqFile {BLQ file, full path [character string]}\n"
271 " PPP/biasMount {Satellite Biases mountpoint, [char string]}\n"
272 " PPP/biasFile {Satellite Biases file, full path [char string]}\n"
273 " PPP/ionoMount {VTEC mountpoint, [char string]}\n"
274 " PPP/ionoFile {VTEC file, full path [char string]}\n"
275 " PPP/ephMount {Broadcast Ephemeris mountpoint(s), comma separated [char string]}\n"
276 " PPP/nmeaPath {Directory for NMEA output files [character string]}\n"
277 " PPP/snxtroPath {Directory for SINEX troposphere output files [character string]}\n"
278 " PPP/snxtroIntr {SINEX troposphere file interval [character string: 1 min|2 min|5 min|10 min|15 min|30 min|1 hour|1 day]}\n"
279 " PPP/snxtroSampl {SINEX troposphere file sampling rate [character string: 1 sec|5 sec|10 sec|30 sec|60 sec|300 sec]}\n"
280 " PPP/snxtroAc {SINEX troposphere Analysis Center [3-char string]}\n"
281 " PPP/snxtroSolId {SINEX troposphere solution ID [1-char]}\n"
282 " PPP/snxtroSolType {SINEX troposphere solution type, e.g. RTS, UNK, .. [3-char]}\n"
283 " PPP/snxtroCampId {SINEX troposphere campaign ID, e.g. DEM, TST, OPS, .. [3-char]}\n"
284 "\n"
285 "PPP Client Panel 2 keys:\n"
286 " PPP/lcGPS {Select the kind of linear combination from GPS code and/or phase data [character string: Pi&Li|Pi|P1&L1|P1|P3&L3|P3|L3|no]}\n"
287 " PPP/lcGLONASS {Select the kind of linear combination from GLONASS code and/or phase data [character string: Pi&Li|Pi|P1&L1|P1|P3&L3|P3|L3|no]}\n"
288 " PPP/lcGalileo {Select the kind of linear combination from Galileo code and/or phase data [character string: Pi&Li|Pi|P1&L1|P1|P3&L3|P3|L3|no]}\n"
289 " PPP/lcBDS {Select the kind of linear combination from BDS code and/or phase data [character string: Pi&Li|Pi|P1&L1|P1|P3&L3|P3|L3|no]}\n"
290 " PPP/sigmaC1 {Sigma for code observations in meters [floating-point number]}\n"
291 " PPP/sigmaL1 {Sigma for phase observations in meters [floating-point number]}\n"
292 " PPP/maxResC1 {Maximal residuum for code observations in meters [floating-point number]}\n"
293 " PPP/maxResL1 {Maximal residuum for phase observations in meters [floating-point number]}\n"
294 " PPP/eleWgtCode {Elevation dependent weighting of code observations [integer number: 0=no,2=yes]}\n"
295 " PPP/eleWgtPhase {Elevation dependent weighting of phase observations [integer number: 0=no,2=yes]}\n"
296 " PPP/minObs {Minimum number of observations [integer number: 4|5|6]}\n"
297 " PPP/minEle {Minimum satellite elevation in degrees [integer number: 0-20]}\n"
298 " PPP/corrWaitTime {Wait for clock corrections [integer number of seconds: 0-20]}\n"
299 " PPP/seedingTime {Seeding time span for Quick Start [integer number of seconds]}\n"
300 " PPP/constraints {Specify, whether ionospheric constraints in form of pseudo-observations shall be added [character string: no|Ionosphere: pseudo-obs]}\n"
301 " PPP/sigmaGIM {Sigma for GIM pseudo observations in meters [floating-point number]}\n"
302 " PPP/arGPS {Ambiguities for GPS should be resolved: [integer number: 0=no,2=yes]}\n"
303 " PPP/arGalileo {Ambiguities for Galileo should be resolved: [integer number: 0=no,2=yes]}\n"
304 " PPP/arBDS {Ambiguities for BDS should be resolved: [integer number: 0=no,2=yes]}\n"
305 " PPP/arMinNumEpo {Number of epochs for which the unknown ambiguity parameter has to be at least observed: [integer number: 5|10|15|20|25|30|35|40|45|50|55|60]}\n"
306 " PPP/arMinNumSat {The ambiguity search is performed if at least the specified number of satellites per constellation is being tracked: [integer number: 4|5|6|7|8]}\n"
307 " PPP/arUseYaw {If set, the information about the satellite attitude is taken from the SSR stream. Otherwise a standard satellite attitude model is used: [integer number: 0=no,2=yes]}\n"
308 " PPP/arMaxFrac {If greater than zero, the ambiguity is constrained only if the absolute value of the fractional part of its BIE value is lower or equal than the specified value: [floating-point number]}\n"
309 " PPP/arMaxSig {If greater than zero, the ambiguity is constrained only if the BIE sigma (uncertainty of the BIE result) is lower or equal than the specified value: [floating-point number]}\n"
310
311 "\n"
312 "PPP Client Panel 3 keys:\n"
313 " PPP/staTable {Station specifications table [character string, semicolon separated list, each element in quotaion marks, example:\n"
314 " \"WTZR00DEU0,100.0,100.0,100.0,100.0,100.0,100.0,0.1,3e-6,0,G:1&C G:2&W R:1&C R:2&P E:1&C E:5&Q C:26&I;\n"
315 " FFMJ00DEU0,100.0,100.0,100.0,100.0,100.0,100.0,0.1,3e-6,0,G:12&W R:12&P E:15&X C:26&I\"]}\n"
316 "\n"
317 "PPP Client Panel 4 keys:\n"
318 " PPP/plotCoordinates {Mountpoint for time series plot [character string]}\n"
319 " PPP/audioResponse {Audio response threshold in meters [floating-point number]}\n"
320 " PPP/mapWinDotSize {Size of dots on map [integer number: 0-10]}\n"
321 " PPP/mapWinDotColor {Color of dots and cross hair on map [character string: red|yellow]}\n"
322 " PPP/mapSpeedSlider {Off-line processing speed for mapping [integer number: 1-100]}\n"
323 "\n"
324 "Combine Corrections Panel keys:\n"
325 " cmbStreams {Correction streams table [character string, semicolon separated list, each element in quotation marks, example:\n"
326 " \"SSRA00ESA0 ESA 1.0;SSRA00BKG BKG 1.0\"]}\n"
327 " cmbMethodFilter {Combination approach [character string: Single-Epoch|Filter]}\n"
328 " cmbBsxFile {SINEX Bias file, full path [char string]}\n"
329 " ssrRefSignals {Reference signals of the clocks per GNSS, also used by the SSR QC [character string,\n"
330 " example: C:1P&5P J:1C&5Q; empty: G:1W&2W R:1P&2P E:1C&5Q C:2I&6I J:1C&2L S:1C&5Q]}\n"
331 " cmbMaxres {Clock outlier residuum threshold in meters [floating-point number]}\n"
332 " cmbMaxdisplacement {Maximal orbit displacement from the mean of corrections for a satellite [floating-point number]}\n"
333 " cmbSampl {Clock sampling rate [integer number of seconds: 1 sec|2 sec|5 sec|10 sec|15 sec|30 sec|60 sec]}\n"
334 " cmbLogpath {Directory for Combination log files [character string]}\n"
335 " cmbGps {GPS correction usage [integer number: 0=no,2=yes]}\n"
336 " cmbGlo {GLONASS correction usage [integer number: 0=no,2=yes]}\n"
337 " cmbGal {Galileo correction usage [integer number: 0=no,2=yes]}\n"
338 " cmbBds {Beidou correction usage [integer number: 0=no,2=yes]}\n"
339 " cmbQzss {QZSS correction usage [integer number: 0=no,2=yes]}\n"
340 " cmbSbas {SBAS correction usage [integer number: 0=no,2=yes]}\n"
341 " cmbNavic {NavIC correction usage [integer number: 0=no,2=yes]}\n"
342 "\n"
343 "Upload Corrections Panel keys:\n"
344 " uploadMountpointsOut {Upload corrections table [character string, semicolon separated list, each element in quotation marks, example:\n"
345 " \"products.igs-ip.net,2101,SSRA02IGS1,2,usr,pass,IGS20,IGS-SSR,0,/home/user/BKG0MGXRTS${V3PROD}.SP3,/home/user/BKG0MGXRTS${V3PROD}.CLK,/home/user/BKG0MGXRTS${V3PROD}.BIA,258,1,0;\n"
346 " euref-ip.net,2101,SSRA02IGS1_EUREF,2,usr,pass,ETRF2000,RTCM-SSR,0,,,,258,2,0\"]}\n"
347 " uploadIntr {Length of SP3, Clock RINEX and Bias SINEX file interval [character string: 1 min|2 min|5 min|10 min|15 min|30 min|1 hour|1 day]}\n"
348 " uploadSamplRtcmEphCorr {Orbit corrections stream sampling rate [integer number of seconds: 0 sec|1 sec|2 sec|5 sec|10 sec|15 sec|30 sec|60 sec]}\n"
349 " uploadSamplSp3 {SP3 file sampling rate [integer number of seconds: 0 sec|30 sec|60 sec|300 sec|900 sec]}\n"
350 " uploadSamplClkRnx {Clock RINEX file sampling rate [integer number of seconds: 0|5|10|15|20|25|30|35|40|45|50|55|60]}\n"
351 " uploadSamplBiaSnx {SINEX Bias file sampling rate [integer number of seconds: 0|5|10|15|20|25|30|35|40|45|50|55|60]}\n"
352 "\n"
353 "Custom Trafo keys:\n"
354 " trafo_dx {Translation X in meters [floating-point number]\n"
355 " trafo_dy {Translation Y in meters [floating-point number]\n"
356 " trafo_dz {Translation Z in meters [floating-point number]\n"
357 " trafo_dxr {Translation change X in meters per year [floating-point number]\n"
358 " trafo_dyr {Translation change Y in meters per year [floating-point number]\n"
359 " trafo_dzr {Translation change Z in meters per year [floating-point number]\n"
360 " trafo_ox {Rotation X in arcsec [floating-point number]}\n"
361 " trafo_oy {Rotation Y in arcsec [floating-point number]}\n"
362 " trafo_oz {Rotation Z in arcsec [floating-point number]}\n"
363 " trafo_oxr {Rotation change X in arcsec per year [floating-point number]}\n"
364 " trafo_oyr {Rotation change Y in arcsec per year [floating-point number]}\n"
365 " trafo_ozr {Rotation change Z in arcsec per year [floating-point number]}\n"
366 " trafo_sc {Scale [10^-9, floating-point number]}\n"
367 " trafo_scr {Scale change [10^-9 per year, floating-point number]}\n"
368 " trafo_t0 {Reference year [integer number]}\n"
369 "\n"
370 "Upload Ephemeris Panel keys:\n"
371 " uploadEphMountpointsOut {Upload ephemeris table [character string, semicolon separated list, each element in quotation marks, example:\n"
372 " \"products.igs-ip.net,443,BCEP00BKG0,2s,usr,pass,ALL;products.igs-ip.net,443,BCEP01BKG0,2s,usr,pass,G\"]}\n"
373 " uploadSamplRtcmEph {Stream upload sampling rate [integer number of seconds: 0|5|10|15|20|25|30|35|40|45|50|55|60]}\n"
374 "\n"
375 "Upload Raw Data Panel keys:\n"
376 " uploadRawMountpointsOut {Upload raw data table [character string, semicolon separated list, each element in quotation marks, example:\n"
377 " \"TCP00DEU0,products.igs-ip.net,443,SSRA00BKG0,2s,usr,pass;TCP01DEU0,products.igs-ip.net,443,SSRA01BKG0,2s,usr,pass\"]}\n"
378 "\n"
379 "Add Stream keys:\n"
380 " mountPoints {Mountpoints [character string, semicolon separated list, example:\n"
381 " \"//user:pass@igs-ip.net:2101/FFMJ00DEU0 RTCM_3.3 DEU 50.09 8.66 no 2;//user:pass@mgex.igs-ip.net:2101/CUT000AUS0 RTCM_3.0 ETH 9.03 38.74 no 2\"}\n"
382 " ntripVersion {Ntrip Version [character string: 1|2|2s|R|U]}\n"
383 " casterUrlList {Visited Broadcasters [character string, comma separated list]}\n"
384 "\n"
385 "Appearance keys:\n"
386 " startTab {Index of top panel to be presented at start time [integer number: 0-17]}\n"
387 " statusTab {Index of bottom panel to be presented at start time [integer number: 0-3]}\n"
388 " font {Font specification [character string in quotation marks, example: \"Helvetica,14,-1,5,50,0,0,0,0,0\"]}\n"
389 "\n"
390 "Note:\n"
391 "The syntax of some command line configuration options slightly differs from that\n"
392 "used in configuration files: Configuration file options which contain one or more blank\n"
393 "characters or contain a semicolon separated parameter list must be enclosed by quotation\n"
394 "marks when specified on command line.\n"
395 "\n"
396 "Examples command lines:\n"
397 "(1) /home/weber/bin/bnc\n"
398 "(2) /Applications/bnc.app/Contents/MacOS/bnc\n"
399 "(3) /home/userName/bin/bnc --conf /home/userName/MyConfigFile.bnc\n"
400 "(4) bnc --conf /Users/userName/.config/BKG/BNC.bnc -nw\n"
401 "(5) bnc --conf /dev/null --key startTab 4 --key reqcAction Edit/Concatenate"
402 " --key reqcObsFile BRUX00BEL_S_20211251100_15M_01S_MO.rnx --key reqcOutObsFile BRUX00BEL_S_20211251100_15M_01S_MO_OUT.rnx"
403 " --key reqcRnxVersion 2 --key reqcSampling \"30 sec\" --key reqcV2Priority \"G:12&PWCSLX G:5&IQX\"\n"
404 "(6) bnc --conf /dev/null --key mountPoints \"//user:pass@mgex.igs-ip.net:2101/CUT000AUS0 RTCM_3.0 ETH 9.03 38.74 no 2;"
405 "//user:pass@igs-ip.net:2101/FFMJ00DEU1 RTCM_3.1 DEU 50.09 8.66 no 2\"\n"
406 "(7) bnc --conf /dev/null --key startTab 15 --key cmbStreams \"SSRA00BKG1 BKG 1.0;SSRA00CNE1 CNES 1.0\"\n"
407 "(8) bnc --conf /dev/null --key startTab 16 --key uploadMountpointsOut \"products.igs-ip.net,2101,SSRC00BKG1,2,usr,pass,IGS20,RTCM-SSR,2,/Users/userName/BKG0MGXRTS${V3PROD}.SP3,,,33,3,2;"
408 "euref-ip.net,443,SSRA00BKG1_EUREF,2s,usr,pass,ETRF2000,IGS-SSR,0,,,,33,5,5\"\n"
409 "(9) bnc --conf /dev/null --key startTab 13 --key PPP/dataSource \"Real-Time Streams\" --key PPP/staTable \"FFMJ00DEU1,100.0,100.0,100.0,100.0,100.0,100.0,0.1,3e-6,7777,G:12&W R:12&P E:1&C E:5&Q C:26&I;"
410 "CUT000AUS0,100.0,100.0,100.0,100.0,100.0,100.0,0.1,3e-6,7778,G:1&C G:2&W R:12&P E:15&X C:26&I\"\n";
411
412
413 for (int ii = 1; ii < argc; ii++) {
414 if (isOption(argv[ii], "--?help")) {
415 cout << printHelp.data();
416 exit(0);
417 }
418 if (isOption(argv[ii], "--?nw")) {
419 interactive = false;
420 }
421 if (isOption(argv[ii], "--?version")) {
422 cout << BNCPGMNAME << endl;
423 exit(0);
424 }
425 if (isOption(argv[ii], "--?display")) {
426 displaySet = true;
427 strcpy(argv[ii], "-display"); // make it "-display" not "--display"
428 }
429 if (ii + 1 < argc) {
430 if (isOption(argv[ii], "--?conf")) {
431 confFileName = QString(argv[ii + 1]);
432 }
433 if (isOption(argv[ii], "--?file")) {
434 interactive = false;
435 rawFileName = QByteArray(argv[ii + 1]);
436 }
437 }
438 }
439
440#ifdef Q_OS_MAC
441 if (argc == 3 && interactive) {
442 confFileName = QString(argv[2]);
443 }
444#else
445 if (argc == 2 && interactive) {
446 confFileName = QString(argv[1]);
447 }
448#endif
449
450#ifdef Q_OS_MACX
451 if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_8)
452 {
453 // fix Mac OS X 10.9 (mavericks) font issue
454 // https://bugreports.qt-project.org/browse/QTBUG-32789
455 QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande");
456 }
457#endif
458
459 bool GUIenabled = interactive || displaySet;
460 QScopedPointer<QCoreApplication> app(createApplication(argc, argv, GUIenabled));
461
462 if (qobject_cast<QApplication*>(app.data())) { // start GUI version
463 app->setApplicationName("BNC");
464 app->setOrganizationName("BKG");
465 app->setOrganizationDomain("bkg.bund.de"); //app->setWindowIcon(QPixmap(":ntrip-logo.png"));
466 BNC_CORE->setGUIenabled(GUIenabled);
467 }
468 BNC_CORE->setConfFileName(confFileName);
469
470 bncSettings settings;
471
472 // Proxy Settings
473 // --------------
474 QString proxyHost = settings.value("proxyHost").toString();
475 int proxyPort = settings.value("proxyPort").toInt();
476 if (!proxyHost.isEmpty()) {
477 QNetworkProxy proxy;
478 proxy.setType(QNetworkProxy::HttpProxy);
479 proxy.setHostName(proxyHost);
480 proxy.setPort(proxyPort);
481 QNetworkProxy::setApplicationProxy(proxy);
482 }
483 else {
484 QNetworkProxyFactory::setUseSystemConfiguration(true);
485 }
486
487 for (int ii = 1; ii < argc - 2; ii++) {
488 if (isOption(argv[ii], "--?key")) {
489 QString key(argv[ii + 1]);
490 QString val(argv[ii + 2]);
491 if (val.indexOf(";") != -1) {
492 settings.setValue(key, val.split(";", Qt::SkipEmptyParts));
493 }
494 else {
495 settings.setValue(key, val);
496 }
497 }
498 }
499
500 // Interactive Mode - open the main window
501 // -----------------------------------------
502 if (interactive) {
503
504 BNC_CORE->setMode(t_bncCore::interactive);
505
506 QString fontString = settings.value("font").toString();
507 if (!fontString.isEmpty()) {
508 QFont newFont;
509 if (newFont.fromString(fontString)) {
510 QApplication::setFont(newFont);
511 }
512 }
513
514 bncWin = new bncWindow();
515 BNC_CORE->setMainWindow(bncWin);
516 bncWin->show();
517 }
518
519 // Post-Processing PPP
520 // -------------------
521 else if (settings.value("PPP/dataSource").toString() == "RINEX Files") {
522 caster = new bncCaster();
523 BNC_CORE->setCaster(caster);
524 BNC_CORE->setMode(t_bncCore::batchPostProcessing);
525 BNC_CORE->startPPP();
526 }
527
528 // Post-Processing reqc edit
529 // -------------------------
530 else if (settings.value("reqcAction").toString() == "Edit/Concatenate") {
531 BNC_CORE->setMode(t_bncCore::batchPostProcessing);
532 reqcEdit = new t_reqcEdit(0);
533 reqcEdit->start();
534 }
535
536 // Post-Processing reqc analyze
537 // ----------------------------
538 else if (settings.value("reqcAction").toString() == "Analyze") {
539 BNC_CORE->setMode(t_bncCore::batchPostProcessing);
540 reqcAnalyze = new t_reqcAnalyze(0);
541 reqcAnalyze->start();
542 }
543
544 // SP3 Files Comparison
545 // --------------------
546 else if (!settings.value("sp3CompFile").toString().isEmpty()) {
547 BNC_CORE->setMode(t_bncCore::batchPostProcessing);
548 sp3Comp = new t_sp3Comp(0);
549 sp3Comp->start();
550 }
551
552 // Non-Interactive (data gathering)
553 // --------------------------------
554 else {
555
556 signal(SIGINT, catch_SIGINT);
557 signal(SIGTERM, catch_SIGTERM);
558 BNC_CORE->sigintReceived = 0;
559#ifndef WIN32
560 signal(SIGHUP, catch_SIGHUP);
561#endif
562
563 casterEph = new bncEphUploadCaster(); (void)casterEph;
564
565 caster = new bncCaster();
566
567 BNC_CORE->setCaster(caster);
568 BNC_CORE->setPortEph(settings.value("ephOutPort").toInt());
569 BNC_CORE->setPortCorr(settings.value("corrPort").toInt());
570 BNC_CORE->initCombination();
571 BNC_CORE->initSsrQc();
572
573 BNC_CORE->connect(caster, SIGNAL(getThreadsFinished()), app->instance(), SLOT(quit()));
574
575 BNC_CORE->slotMessage("========== Start BNC v" BNCVERSION " (" BNC_OS ") ==========", true);
576
577
578 // Normal case - data from Internet
579 // --------------------------------
580 if (rawFileName.isEmpty()) {
581 BNC_CORE->setMode(t_bncCore::nonInteractive);
582 BNC_CORE->startPPP();
583
584 caster->readMountPoints();
585 if (caster->numStations() == 0) {
586 BNC_CORE->slotMessage("bncMain: number of caster stations: 0 => exit", true);
587 exit(3);
588 }
589 }
590
591 // Special case - data from file
592 // -----------------------------
593 else {
594 BNC_CORE->setMode(t_bncCore::batchPostProcessing);
595 BNC_CORE->startPPP();
596
597 rawFile = new bncRawFile(rawFileName, "", bncRawFile::input);
598 getThread = new bncGetThread(rawFile);
599 caster->addGetThread(getThread, true);
600 }
601
602 }
603
604 // Start the application
605 // ---------------------
606 app->exec();
607
608 // End of application
609 // ------------------
610 if (interactive) {
611 delete bncWin;
612 }
613 else {
614 BNC_CORE->stopPPP();
615 BNC_CORE->stopCombination();
616 BNC_CORE->stopSsrQc();
617#ifndef WIN32
618 sleep(2);
619#else
620 Sleep(2000);
621#endif
622 }
623 if (caster) {
624 delete caster; caster = 0; BNC_CORE->setCaster(0);
625 }
626 if (casterEph) {
627 delete casterEph; casterEph = 0;
628 }
629 if (rawFile) {
630 delete rawFile;
631 }
632
633 return 0;
634}
Note: See TracBrowser for help on using the repository browser.