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

Last change on this file since 9852 was 9852, checked in by stuerze, 18 months ago

minor changes

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