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

Last change on this file since 9954 was 9954, checked in by stuerze, 15 months ago
File size: 28.3 KB
RevLine 
[280]1// Part of BNC, a utility for retrieving decoding and
[464]2// converting GNSS data streams from NTRIP broadcasters.
[280]3//
[464]4// Copyright (C) 2007
[280]5// German Federal Agency for Cartography and Geodesy (BKG)
6// http://www.bkg.bund.de
[464]7// Czech Technical University Prague, Department of Geodesy
[280]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.
[35]24
25/* -------------------------------------------------------------------------
[93]26 * BKG NTRIP Client
[35]27 * -------------------------------------------------------------------------
28 *
29 * Class: main
30 *
31 * Purpose: Application starts here
32 *
33 * Author: L. Mervart
34 *
35 * Created: 24-Dec-2005
36 *
[7268]37 * Changes:
[35]38 *
39 * -----------------------------------------------------------------------*/
40
[9952]41#ifndef WIN32
[274]42#include <unistd.h>
[9954]43#else
[9952]44#include <qt_windows.h>
45#endif
[603]46#include <signal.h>
[35]47#include <QApplication>
48#include <QFile>
[8354]49#include <iostream>
[9151]50#include <QNetworkProxyFactory>
[35]51
[5066]52#include "app.h"
[5070]53#include "bnccore.h"
[35]54#include "bncwindow.h"
[1535]55#include "bncsettings.h"
[2012]56#include "bncversion.h"
[3251]57#include "upload/bncephuploadcaster.h"
[5887]58#include "rinex/reqcedit.h"
59#include "rinex/reqcanalyze.h"
[6343]60#include "orbComp/sp3Comp.h"
[35]61
62using namespace std;
63
[9822]64
[9154]65void catch_SIGINT(int) {
[603]66 cout << "Program Interrupted by Ctrl-C" << endl;
[7976]67 BNC_CORE->sigintReceived = 1;
[9822]68 BNC_CORE->stopPPP();
[8772]69 BNC_CORE->stopCombination();
[9191]70 sleep(2);
[9854]71 ::exit(99);
[603]72}
73
[9154]74void catch_SIGPIPE(int signum) {
75 cout << "Caught signal SIGPIPE " << signum << endl;
76}
77
[82]78// Main Program
79/////////////////////////////////////////////////////////////////////////////
[4490]80int main(int argc, char* argv[]) {
[35]81
[4446]82 bool interactive = true;
[4716]83#ifdef WIN32
84 bool displaySet = true;
85#else
[4490]86 bool displaySet = false;
[4716]87#endif
[9822]88 QByteArray rawFileName;
89 QString confFileName;
[1146]90
[9822]91 bncWindow* bncWin = 0;
92 t_reqcEdit* reqcEdit = 0;
93 t_reqcAnalyze* reqcAnalyze = 0;
94 t_sp3Comp* sp3Comp = 0;
95 bncEphUploadCaster* casterEph = 0;
96 bncCaster* caster = 0;
97 bncRawFile* rawFile = 0;
98 bncGetThread* getThread = 0;
99
[7293]100 QByteArray printHelp =
[7510]101 "Usage:\n"
[7826]102 " bnc --help (MS Windows: bnc.exe --help | more)\n"
[7510]103 " --nw\n"
[7827]104 " --version (MS Windows: bnc.exe --version | more)\n"
[7510]105 " --display {name}\n"
106 " --conf {confFileName}\n"
107 " --file {rawFileName}\n"
108 " --key {keyName} {keyValue}\n"
[7273]109 "\n"
110 "Network Panel keys:\n"
[9795]111 " proxyHost {Proxy host, name or IP address [character string]}\n"
112 " proxyPort {Proxy port [integer number]}\n"
113 " sslCaCertPath {Full path to SSL certificates [character string]}\n"
[9940]114 " sslClientCertPath {Full path to client SSL certificates [character string]}\n"
[9795]115 " sslIgnoreErrors {Ignore SSL authorization errors [integer number: 0=no,2=yes]}\n"
[7273]116 "\n"
117 "General Panel keys:\n"
[7512]118 " logFile {Logfile, full path [character string]}\n"
119 " rnxAppend {Append files [integer number: 0=no,2=yes]}\n"
[8119]120 " onTheFlyInterval {Configuration reload interval [character string: no|1 day|1 hour|5 min|1 min]}\n"
[7512]121 " autoStart {Auto start [integer number: 0=no,2=yes]}\n"
122 " rawOutFile {Raw output file, full path [character string]}\n"
[7273]123 "\n"
124 "RINEX Observations Panel keys:\n"
[9184]125 " rnxPath {Directory for RINEX files [character string]}\n"
[7510]126 " rnxIntr {File interval [character string: 1 min|2 min|5 min|10 min|15 min|30 min|1 hour|1 day]}\n"
[8397]127 " rnxSampl {File sampling rate [character string: 0.1 sec|1 sec|5 sec|10 sec|15 sec|30 sec|60 sec]}\n"
[9940]128 " rnxSkel {RINEX skeleton file extension [character string: skl|SKL]}\n"
[9184]129 " rnxSkelPath {Directory for local skeleton files [character string]}\n"
[7510]130 " rnxOnlyWithSKL {Using RINEX skeleton file is mandatory [integer number: 0=no,2=yes]}\n"
131 " rnxScript {File upload script, full path [character string]}\n"
[9940]132 " rnxVersion {Specifies the RINEX version of the file contents [integer number: 2|3|4]}\n"
133 " rnxV2Priority {Priority of signal attributes for RINEX version 2 [character string, list separated by blank character,\n"
134 " 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"
[7273]135 "\n"
136 "RINEX Ephemeris Panel keys:\n"
[7510]137 " ephPath {Directory [character string]}\n"
138 " ephIntr {File interval [character string: 1 min|2 min|5 min|10 min|15 min|30 min|1 hour|1 day]}\n"
139 " ephOutPort {Output port [integer number]}\n"
[9760]140 " ephVersion {Specifies the RINEX version of the file contents [integer number: 2|3|4]}\n"
[7273]141 "\n"
142 "RINEX Editing and QC Panel keys:\n"
[7510]143 " reqcAction {Action specification [character string: Blank|Edit/Concatenate|Analyze]}\n"
144 " reqcObsFile {Input observations file(s), full path [character string, comma separated list in quotation marks]}\n"
145 " reqcNavFile {Input navigation file(s), full path [character string, comma separated list in quotation marks]}\n"
146 " reqcOutObsFile {Output observations file, full path [character string]}\n"
147 " reqcOutNavFile {Output navigation file, full path [character string]}\n"
148 " reqcOutLogFile {Output logfile, full path [character string]}\n"
149 " reqcLogSummaryOnly {Output only summary of logfile [integer number: 0=no,2=yes]}\n"
[9940]150 " reqcSkyPlotSignals {Observation signals [character string, list separated by blank character,\n"
151 " 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"
[7510]152 " reqcPlotDir {QC plots directory [character string]}\n"
[9940]153 " reqcRnxVersion {RINEX version [integer number: 2|3|4]}\n"
[8397]154 " reqcSampling {RINEX output file sampling rate [character string: 0.1 sec|1 sec|5 sec|10 sec|15 sec|30 sec|60 sec]}\n"
[9940]155 " reqcV2Priority {Version 2 priority of signal attributes [character string, list separated by blank character,\n"
156 " 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"
[7510]157 " reqcStartDateTime {Start time [character string, example: 1967-11-02T00:00:00]}\n"
[9942]158 " reqcEndDateTime {Stop time [character string, example: 2099-01-01T00:00:00]}\n"
[7510]159 " reqcRunBy {Operators name [character string]}\n"
160 " reqcUseObsTypes {Use observation types [character string, list separated by blank character, example: G:C1C G:L1C R:C1C RC1P]}\n"
161 " reqcComment {Additional comments [character string]}\n"
162 " reqcOldMarkerName {Old marker name [character string]}\n"
163 " reqcNewMarkerName {New marker name [character string]}\n"
164 " reqcOldAntennaName {Old antenna name [character string]}\n"
165 " reqcNewAntennaName {New antenna name [character string]}\n"
166 " reqcOldAntennaNumber {Old antenna number [character string]}\n"
167 " reqcNewAntennaNumber {New antenna number [character string]}\n"
[9783]168 " reqcOldAntennadN {Old north eccentricity [character string]}\n"
[7510]169 " reqcNewAntennadN {New north eccentricity [character string]}\n"
170 " reqcOldAntennadE {Old east eccentricity [character string]}\n"
171 " reqcNewAntennadE {New east eccentricity [character string]}\n"
172 " reqcOldAntennadU {Old up eccentricity [character string]}\n"
173 " reqcNewAntennadU {New up eccentricity [character string]}\n"
174 " reqcOldReceiverName {Old receiver name [character string]}\n"
175 " reqcNewReceiverName {New receiver name [character string]}\n"
176 " reqcOldReceiverNumber {Old receiver number [character string]}\n"
177 " reqcNewReceiverNumber {New receiver number [character string]}\n"
[7273]178 "\n"
179 "SP3 Comparison Panel keys:\n"
[7510]180 " sp3CompFile {SP3 input files, full path [character string, comma separated list in quotation marks]}\n"
[7840]181 " sp3CompExclude {Satellite exclusion list [character string, comma separated list in quotation marks, example: G04,G31,R]}\n"
[7510]182 " sp3CompOutLogFile {Output logfile, full path [character string]}\n"
[7273]183 "\n"
184 "Broadcast Corrections Panel keys:\n"
[7510]185 " corrPath {Directory for saving files in ASCII format [character string]}\n"
186 " corrIntr {File interval [character string: 1 min|2 min|5 min|10 min|15 min|30 min|1 hour|1 day]}\n"
187 " corrPort {Output port [integer number]}\n"
[7273]188 "\n"
189 "Feed Engine Panel keys:\n"
[7510]190 " outPort {Output port, synchronized [integer number]}\n"
191 " outWait {Wait for full observation epoch [integer number of seconds: 1-30]}\n"
[8397]192 " outSampl {Sampling rate [character string: 0.1 sec|1 sec|5 sec|10 sec|15 sec|30 sec|60 sec]}\n"
[7510]193 " outFile {Output file, full path [character string]}\n"
194 " outUPort {Output port, unsynchronized [integer number]}\n"
[7273]195 "\n"
196 "Serial Output Panel:\n"
[7510]197 " serialMountPoint {Mountpoint [character string]}\n"
198 " serialPortName {Port name [character string]}\n"
199 " serialBaudRate {Baud rate [integer number: 110|300|600|1200|2400|4800|9600|19200|38400|57600|115200]}\n"
200 " serialFlowControl {Flow control [character string: OFF|XONXOFF|HARDWARE}\n"
201 " serialDataBits {Data bits [integer number: 5|6|7|8]}\n"
202 " serialParity {Parity [character string: NONE|ODD|EVEN|SPACE]}\n"
203 " serialStopBits {Stop bits [integer number: 1|2]}\n"
204 " serialAutoNMEA {NMEA specification [character string: no|Auto|Manual GPGGA|Manual GNGGA]}\n"
205 " serialFileNMEA {NMEA filename, full path [character string]}\n"
206 " serialHeightNMEA {Height [floating-point number]}\n"
207 " serialHeightNMEASampling {Sampling rate [integer number of seconds: 0|10|20|30|...|280|290|300]}\n"
[7273]208 "\n"
209 "Outages Panel keys:\n"
[7510]210 " adviseObsRate {Stream observation rate [character string: 0.1 Hz|0.2 Hz|0.5 Hz|1 Hz|5 Hz]} \n"
211 " adviseFail {Failure threshold [integer number of minutes: 0-60]}\n"
212 " adviseReco {Recovery threshold [integer number of minutes: 0-60]}\n"
213 " adviseScript {Advisory script, full path [character string]}\n"
[7273]214 "\n"
215 "Miscellaneous Panel keys:\n"
[7510]216 " miscMount {Mountpoint [character string]}\n"
217 " 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"
218 " miscScanRTCM {Scan for RTCM message numbers [integer number: 0=no,2=yes]}\n"
219 " miscPort {Output port [integer number]}\n"
[7273]220 "\n"
221 "PPP Client Panel 1 keys:\n"
[7510]222 " PPP/dataSource {Data source [character string: Blank|Real-Time Streams|RINEX Files]}\n"
223 " PPP/rinexObs {RINEX observation file, full path [character string]}\n"
224 " PPP/rinexNav {RINEX navigation file, full path [character string]}\n"
225 " PPP/corrMount {Corrections mountpoint [character string]}\n"
226 " PPP/corrFile {Corrections file, full path [character string]}\n"
227 " PPP/crdFile {Coordinates file, full path [character string]}\n"
228 " PPP/logPath {Directory for PPP log files [character string]}\n"
229 " PPP/antexFile {ANTEX file, full path [character string]}\n"
[7961]230#ifdef USE_PPP
[9783]231 " PPP/blqFile {BLQ file, full path [character string]}\n"
232 " PPP/ionoMount {VTEC mountpoint, [char string]}\n"
233 " PPP/ionoFile {VTEC file, full path [char string]}\n"
[7961]234#endif
[7510]235 " PPP/nmeaPath {Directory for NMEA output files [character string]}\n"
236 " PPP/snxtroPath {Directory for SINEX troposphere output files [character string]}\n"
237 " 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"
[8403]238 " PPP/snxtroSampl {SINEX troposphere file sampling rate [character string: 1 sec|5 sec|10 sec|30 sec|60 sec|300 sec]}\n"
[9889]239 " PPP/snxtroAc {SINEX troposphere Analysis Center [3-char string]}\n"
240 " PPP/snxtroSol {SINEX troposphere solution ID [1-char]}\n"
[7273]241 "\n"
242 "PPP Client Panel 2 keys:\n"
[9866]243 " PPP/lcGPS {Select observations from GPS code and/or phase data [character string; Pi&Li|Pi|Li|no]}\n"
244 " PPP/lcGLONASS {Select observations from GLONASS code and/or phase data [character string: Pi&Li|Pi|Li|no]}\n"
245 " PPP/lcGalileo {Select observations from Galileo code and/or phase data [character string: Pi&Li|Pi|Li|no]}\n"
246 " PPP/lcBDS {Select observations from BDS code and/or phase data [character string: Pi&Li|Pi|Li|no]}\n"
247 " PPP/modelObs {select observation model [character string: Uncombined PPP|Ionosphere-free PPP|DCM with Code Biases|DCM with Phase Biases]}\n"
[7510]248 " PPP/sigmaC1 {Sigma for code observations in meters [floating-point number]}\n"
249 " PPP/sigmaL1 {Sigma for phase observations in meters [floating-point number]}\n"
250 " PPP/maxResC1 {Maximal residuum for code observations in meters [floating-point number]}\n"
251 " PPP/maxResL1 {Maximal residuum for phase observations in meters [floating-point number]}\n"
252 " PPP/eleWgtCode {Elevation dependent waiting of code observations [integer number: 0=no,2=yes]}\n"
253 " PPP/eleWgtPhase {Elevation dependent waiting of phase observations [integer number: 0=no,2=yes]}\n"
254 " PPP/minObs {Minimum number of observations [integer number: 4|5|6]}\n"
255 " PPP/minEle {Minimum satellite elevation in degrees [integer number: 0-20]}\n"
[7944]256 " PPP/corrWaitTime {Wait for clock corrections [integer number of seconds: 0-20]}\n"
[7510]257 " PPP/seedingTime {Seeding time span for Quick Start [integer number of seconds]}\n"
[9940]258#ifdef USE_PPP
259 " PPP/pseudoOb {Select pseudo observations [character string: no|Ionosphere]}\n"
260 " PPP/sigmaGIM {Sigma for GIM pseudo observations in meters [floating-point number]}\n"
261 " PPP/maxResGIM {Maximal residuum for GIM pseudo observations in meters [floating-point number]}\n"
262#endif
[7273]263 "\n"
[9938]264 "PPP Client Panel 3 keys:\n"
265 " PPP/staTable {Station specifications table [character string, semicolon separated list, each element in quotaion marks, example:\n"
[9940]266 " \"WTZR00DEU0,100.0,100.0,100.0,100.0,100.0,100.0,0.1,3e-6,0,G:12&CWPSLX R:12&CP E:1&CBX E:5&QIX C:26&IQX;\n"
267 " FFMJ00DEU0,100.0,100.0,100.0,100.0,100.0,100.0,0.1,3e-6,0,G:12&CWPSLX R:12&CP E:1&CBX E:5&QIX C:26&IQX\"]}\n"
[9938]268 "\n"
[7273]269 "PPP Client Panel 4 keys:\n"
[7510]270 " PPP/plotCoordinates {Mountpoint for time series plot [character string]}\n"
271 " PPP/audioResponse {Audio response threshold in meters [floating-point number]}\n"
272 " PPP/mapWinDotSize {Size of dots on map [integer number: 0-10]}\n"
273 " PPP/mapWinDotColor {Color of dots and cross hair on map [character string: red|yellow]}\n"
[8869]274 " PPP/mapSpeedSlider {Off-line processing speed for mapping [integer number: 1-100]}\n"
[7273]275 "\n"
276 "Combine Corrections Panel keys:\n"
[7510]277 " cmbStreams {Correction streams table [character string, semicolon separated list, each element in quotation marks, example:\n"
[9292]278 " \"SSRA00ESA0 ESA 1.0;SSRA00BKG BKG 1.0\"]}\n"
[9940]279 " cmbMethodFilter {Combination approach [character string: Single-Epoch|Filter]}\n"
280 " cmbBsxFile {SINEX Bias file, full path [char string]}\n"
[7510]281 " cmbMaxres {Clock outlier residuum threshold in meters [floating-point number]\n"
[9676]282 " cmbSampl {Clock sampling rate [integer number of seconds: 0|10|20|30|40|50|60]}\n"
[9292]283 " cmbGps {GPS correction usage [integer number: 0=no,2=yes]}\n"
284 " cmbGlo {GLONASS correction usage [integer number: 0=no,2=yes]}\n"
285 " cmbGal {Galileo correction usage [integer number: 0=no,2=yes]}\n"
[9940]286 " cmbBds {Beidou correction usage [integer number: 0=no,2=yes]}\n"
[9292]287 " cmbQzss {QZSS correction usage [integer number: 0=no,2=yes]}\n"
288 " cmbSbas {SBAS correction usage [integer number: 0=no,2=yes]}\n"
289 " cmbIrnss {IRNSS correction usage [integer number: 0=no,2=yes]}\n"
[7273]290 "\n"
291 "Upload Corrections Panel keys:\n"
[7510]292 " uploadMountpointsOut {Upload corrections table [character string, semicolon separated list, each element in quotation marks, example:\n"
[9942]293 " \"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"
[9940]294 " euref-ip.net,2101,SSRA02IGS1_EUREF,2,usr,pass,ETRF2000,RTCM-SSR,0,,,,258,2,0\"]}\n"
[9652]295 " 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"
[7510]296 " uploadSamplRtcmEphCorr {Orbit corrections stream sampling rate [integer number of seconds: 0|5|10|15|20|25|30|35|40|45|50|55|60]}\n"
297 " uploadSamplSp3 {SP3 file sampling rate [integer number of minutes: 0-15]}\n"
298 " uploadSamplClkRnx {Clock RINEX file sampling rate [integer number of seconds: 0|5|10|15|20|25|30|35|40|45|50|55|60]}\n"
[9940]299 " uploadSamplBiaSnx {SINEX Bias file sampling rate [integer number of seconds: 0|5|10|15|20|25|30|35|40|45|50|55|60]}\n"
[7273]300 "\n"
301 "Custom Trafo keys:\n"
[7510]302 " trafo_dx {Translation X in meters [floating-point number]\n"
303 " trafo_dy {Translation Y in meters [floating-point number]\n"
304 " trafo_dz {Translation Z in meters [floating-point number]\n"
305 " trafo_dxr {Translation change X in meters per year [floating-point number]\n"
306 " trafo_dyr {Translation change Y in meters per year [floating-point number]\n"
307 " trafo_dzr {Translation change Z in meters per year [floating-point number]\n"
308 " trafo_ox {Rotation X in arcsec [floating-point number]}\n"
309 " trafo_oy {Rotation Y in arcsec [floating-point number]}\n"
310 " trafo_oz {Rotation Z in arcsec [floating-point number]}\n"
311 " trafo_oxr {Rotation change X in arcsec per year [floating-point number]}\n"
312 " trafo_oyr {Rotation change Y in arcsec per year [floating-point number]}\n"
313 " trafo_ozr {Rotation change Z in arcsec per year [floating-point number]}\n"
314 " trafo_sc {Scale [10^-9, floating-point number]}\n"
315 " trafo_scr {Scale change [10^-9 per year, floating-point number]}\n"
316 " trafo_t0 {Reference year [integer number]}\n"
[7273]317 "\n"
318 "Upload Ephemeris Panel keys:\n"
[7889]319 " uploadEphMountpointsOut {Upload corrections table [character string, semicolon separated list, each element in quotation marks, example:\n"
[9940]320 " \"products.igs-ip.net,443,BCEP00BKG0,2s,usr,pass,ALL;products.igs-ip.net,443,BCEP01BKG0,2s,usr,pass,G\"]}\n"
[7889]321 " uploadSamplRtcmEph {Stream upload sampling rate [integer number of seconds: 0|5|10|15|20|25|30|35|40|45|50|55|60]}\n"
[7273]322 "\n"
323 "Add Stream keys:\n"
[7510]324 " mountPoints {Mountpoints [character string, semicolon separated list, example:\n"
[9940]325 " \"//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"
[7510]326 " ntripVersion {Ntrip Version [character string: 1|2|2s|R|U]}\n"
327 " casterUrlList {Visited Broadcasters [character string, comma separated list]}\n"
[7283]328 "\n"
[7541]329 "Appearance keys:\n"
330 " startTab {Index of top panel to be presented at start time [integer number: 0-17]}\n"
331 " statusTab {Index of bottom panel to be presented at start time [integer number: 0-3]}\n"
332 " font {Font specification [character string in quotation marks, example: \"Helvetica,14,-1,5,50,0,0,0,0,0\"]}\n"
333 "\n"
[7477]334 "Note:\n"
[7841]335 "The syntax of some command line configuration options slightly differs from that\n"
336 "used in configuration files: Configuration file options which contain one or more blank\n"
337 "characters or contain a semicolon separated parameter list must be enclosed by quotation\n"
338 "marks when specified on command line.\n"
[7477]339 "\n"
340 "Examples command lines:\n"
[7284]341 "(1) /home/weber/bin/bnc\n"
342 "(2) /Applications/bnc.app/Contents/MacOS/bnc\n"
[9940]343 "(3) /home/userName/bin/bnc --conf /home/userName/MyConfigFile.bnc\n"
344 "(4) bnc --conf /Users/userName/.config/BKG/BNC.bnc -nw\n"
[7284]345 "(5) bnc --conf /dev/null --key startTab 4 --key reqcAction Edit/Concatenate"
[9940]346 " --key reqcObsFile BRUX00BEL_S_20211251100_15M_01S_MO.rnx --key reqcOutObsFile BRUX00BEL_S_20211251100_15M_01S_MO_OUT.rnx"
347 " --key reqcRnxVersion 2 --key reqcSampling \"30 sec\" --key reqcV2Priority \"G:12&PWCSLX G:5&IQX\"\n"
348 "(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;"
[9404]349 "//user:pass@igs-ip.net:2101/FFMJ00DEU1 RTCM_3.1 DEU 50.09 8.66 no 2\"\n"
[9940]350 "(7) bnc --conf /dev/null --key startTab 15 --key cmbStreams \"SSRA00BKG1 BKG 1.0;SSRA00CNE1 CNES 1.0\"\n"
[9942]351 "(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;"
[9940]352 "euref-ip.net,443,SSRA00BKG1_EUREF,2s,usr,pass,ETRF2000,IGS-SSR,0,,,,33,5,5\"\n"
353 "(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&CWPSLX R:12&CP E:1&CBX E:5&QIX C:26&IQX;"
354 "CUT000AUS0,100.0,100.0,100.0,100.0,100.0,100.0,0.1,3e-6,7778,G:12&CWPSLX R:12&CP E:1&CBX E:5&QIX C:26&IQX\"\n";
[3977]355
[8869]356
[100]357 for (int ii = 1; ii < argc; ii++) {
[3977]358 if (QRegExp("--?help").exactMatch(argv[ii])) {
359 cout << printHelp.data();
[9854]360 exit(1);
[3977]361 }
362 if (QRegExp("--?nw").exactMatch(argv[ii])) {
[4446]363 interactive = false;
[100]364 }
[7268]365 if (QRegExp("--?version").exactMatch(argv[ii])) {
366 cout << BNCPGMNAME << endl;
[9854]367 exit(2);
[7268]368 }
[4490]369 if (QRegExp("--?display").exactMatch(argv[ii])) {
370 displaySet = true;
[4492]371 strcpy(argv[ii], "-display"); // make it "-display" not "--display"
[4490]372 }
[1552]373 if (ii + 1 < argc) {
[3977]374 if (QRegExp("--?conf").exactMatch(argv[ii])) {
[1552]375 confFileName = QString(argv[ii+1]);
[1146]376 }
[3977]377 if (QRegExp("--?file").exactMatch(argv[ii])) {
[4446]378 interactive = false;
[1553]379 rawFileName = QByteArray(argv[ii+1]);
[1552]380 }
[1156]381 }
[1146]382 }
383
[4162]384#ifdef Q_OS_MAC
[4446]385 if (argc== 3 && interactive) {
[4162]386 confFileName = QString(argv[2]);
387 }
388#else
[4446]389 if (argc == 2 && interactive) {
[1585]390 confFileName = QString(argv[1]);
391 }
[4162]392#endif
[1585]393
[6548]394#ifdef Q_OS_MACX
395 if ( QSysInfo::MacintoshVersion > QSysInfo::MV_10_8 )
396 {
397 // fix Mac OS X 10.9 (mavericks) font issue
398 // https://bugreports.qt-project.org/browse/QTBUG-32789
399 QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande");
400 }
401#endif
402
[4491]403 bool GUIenabled = interactive || displaySet;
[8897]404 QScopedPointer<QCoreApplication> app(createApplication(argc, argv, GUIenabled));
[1516]405
[8897]406 if (qobject_cast<QApplication *>(app.data())) { // start GUI version
407 app->setApplicationName("BNC");
408 app->setOrganizationName("BKG");
409 app->setOrganizationDomain("www.bkg.bund.de");
[9780]410 //app->setWindowIcon(QPixmap(":ntrip-logo.png"));
[8897]411 BNC_CORE->setGUIenabled(GUIenabled);
412 }
413
[5068]414 BNC_CORE->setConfFileName( confFileName );
[1538]415
[1535]416 bncSettings settings;
[1503]417
[8909]418 // Proxy Settings
419 // --------------
420 QString proxyHost = settings.value("proxyHost").toString();
421 int proxyPort = settings.value("proxyPort").toInt();
422 if (!proxyHost.isEmpty()) {
423 QNetworkProxy proxy;
424 proxy.setType(QNetworkProxy::HttpProxy);
425 proxy.setHostName(proxyHost);
426 proxy.setPort(proxyPort);
427 QNetworkProxy::setApplicationProxy(proxy);
428 }
[9151]429 else {
430 QNetworkProxyFactory::setUseSystemConfiguration(true);
431 }
[8909]432
[3976]433 for (int ii = 1; ii < argc - 2; ii++) {
[3978]434 if (QRegExp("--?key").exactMatch(argv[ii])) {
[3976]435 QString key(argv[ii+1]);
436 QString val(argv[ii+2]);
[7476]437 if (val.indexOf(";") != -1) {
[7293]438 settings.setValue(key, val.split(";", QString::SkipEmptyParts));
439 }
440 else {
441 settings.setValue(key, val);
442 }
[3976]443 }
444 }
445
[7640]446
[9822]447
[9159]448#ifndef WIN32
[9154]449 signal(SIGPIPE, catch_SIGPIPE);
[9159]450#endif
[9142]451
[8684]452 // Interactive Mode - open the main window
[8909]453 // -----------------------------------------
[4446]454 if (interactive) {
[113]455
[5072]456 BNC_CORE->setMode(t_bncCore::interactive);
[3280]457
[113]458 QString fontString = settings.value("font").toString();
459 if ( !fontString.isEmpty() ) {
460 QFont newFont;
461 if (newFont.fromString(fontString)) {
462 QApplication::setFont(newFont);
463 }
464 }
[7268]465
[7640]466 bncWin = new bncWindow();
[5068]467 BNC_CORE->setMainWindow(bncWin);
[35]468 bncWin->show();
469 }
[180]470
[7268]471 // Post-Processing PPP
[6343]472 // -------------------
473 else if (settings.value("PPP/dataSource").toString() == "RINEX Files") {
[7640]474 caster = new bncCaster();
[6343]475 BNC_CORE->setCaster(caster);
476 BNC_CORE->setMode(t_bncCore::batchPostProcessing);
477 BNC_CORE->startPPP();
478 }
479
[3974]480 // Post-Processing reqc edit
481 // -------------------------
[5864]482 else if (settings.value("reqcAction").toString() == "Edit/Concatenate") {
[5072]483 BNC_CORE->setMode(t_bncCore::batchPostProcessing);
[7640]484 reqcEdit = new t_reqcEdit(0);
[3974]485 reqcEdit->start();
486 }
487
[3975]488 // Post-Processing reqc analyze
489 // ----------------------------
490 else if (settings.value("reqcAction").toString() == "Analyze") {
[5072]491 BNC_CORE->setMode(t_bncCore::batchPostProcessing);
[7640]492 reqcAnalyze = new t_reqcAnalyze(0);
[3975]493 reqcAnalyze->start();
494 }
495
[6343]496 // SP3 Files Comparison
497 // --------------------
498 else if (!settings.value("sp3CompFile").toString().isEmpty()) {
[5926]499 BNC_CORE->setMode(t_bncCore::batchPostProcessing);
[7640]500 sp3Comp = new t_sp3Comp(0);
[6343]501 sp3Comp->start();
[5926]502 }
503
[3974]504 // Non-Interactive (data gathering)
505 // --------------------------------
[35]506 else {
[621]507
[9154]508 signal(SIGINT, catch_SIGINT);
[1138]509
[8870]510 BNC_CORE->sigintReceived = 0;
511
[7640]512 casterEph = new bncEphUploadCaster(); (void) casterEph;
[7268]513
[7640]514 caster = new bncCaster();
[7268]515
[5068]516 BNC_CORE->setCaster(caster);
[7327]517 BNC_CORE->setPortEph(settings.value("ephOutPort").toInt());
[5068]518 BNC_CORE->setPortCorr(settings.value("corrPort").toInt());
519 BNC_CORE->initCombination();
[7268]520
[8897]521 BNC_CORE->connect(caster, SIGNAL(getThreadsFinished()), app->instance(), SLOT(quit()));
[9822]522
[9854]523// BNC_CORE->connect (caster, SIGNAL(mountPointsRead(QList<bncGetThread*>)), app->instance(), SLOT(slotMountPointsRead(QList<bncGetThread*>)));
[9822]524
[9854]525
[8231]526 BNC_CORE->slotMessage("========== Start BNC v" BNCVERSION " (" BNC_OS ") ==========", true);
[5845]527
[8870]528
[1170]529 // Normal case - data from Internet
530 // --------------------------------
[3974]531 if ( rawFileName.isEmpty() ) {
[5072]532 BNC_CORE->setMode(t_bncCore::nonInteractive);
[5946]533 BNC_CORE->startPPP();
[5905]534
[4250]535 caster->readMountPoints();
[1170]536 if (caster->numStations() == 0) {
[9852]537 BNC_CORE->slotMessage("bncMain: number of caster stations: 0 => exit" , true);
[9854]538 exit(3);
[1170]539 }
540 }
[7268]541
[1170]542 // Special case - data from file
543 // -----------------------------
544 else {
[5072]545 BNC_CORE->setMode(t_bncCore::batchPostProcessing);
[5946]546 BNC_CORE->startPPP();
[5905]547
[7640]548 rawFile = new bncRawFile(rawFileName, "", bncRawFile::input);
549 getThread = new bncGetThread(rawFile);
[2528]550 caster->addGetThread(getThread, true);
[35]551 }
552 }
[180]553
554 // Start the application
555 // ---------------------
[8897]556 app->exec();
[9822]557
558 // End of application
559 // ------------------
[7640]560 if (interactive) {
561 delete bncWin;
562 }
[7854]563 else {
564 BNC_CORE->stopPPP();
565 BNC_CORE->stopCombination();
566 }
[7640]567 if (caster) {
[7854]568 delete caster; caster = 0; BNC_CORE->setCaster(0);
[7640]569 }
570 if (casterEph) {
[7854]571 delete casterEph; casterEph = 0;
[7640]572 }
573 if (rawFile) {
574 delete rawFile;
575 }
[8897]576
[7640]577 return 0;
[35]578}
Note: See TracBrowser for help on using the repository browser.