Changeset 1552 in ntrip
- Timestamp:
- Jan 31, 2009, 5:21:28 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncmain.cpp
r1548 r1552 61 61 62 62 bool GUIenabled = true; 63 bool fileInput = false; 64 bool confFile = false; 65 bool dragAndDrop = true; 66 QByteArray fileName; 63 QByteArray rawFileName; 67 64 QByteArray format; 68 65 QString dateString; … … 73 70 if (QByteArray(argv[ii]) == "-nw") { 74 71 GUIenabled = false; 75 dragAndDrop = false;76 break;77 72 } 78 } 79 80 for (int ii = 1; ii < argc; ii++) { 81 if (QByteArray(argv[ii]) == "-file" || QByteArray(argv[ii]) == "--file") { 82 GUIenabled = false; 83 fileInput = true; 84 dragAndDrop = false; 85 if (ii+1 < argc) { 86 fileName = QByteArray(argv[ii+1]); 73 if (ii + 1 < argc) { 74 if (QByteArray(argv[ii]).indexOf("-conf") != -1) { 75 confFileName = QString(argv[ii+1]); 87 76 } 88 } 89 if (QByteArray(argv[ii]) == "-format" || QByteArray(argv[ii]) == "--format") { 90 GUIenabled = false; 91 fileInput = true; 92 dragAndDrop = false; 93 if (ii+1 < argc) { 77 if (QByteArray(argv[ii]).indexOf("-file") != -1) { 78 GUIenabled = false; 79 rawFileName = QByteArray(argv[ii+1]); 80 } 81 if (QByteArray(argv[ii]).indexOf("-format") != -1) { 94 82 format = QByteArray(argv[ii+1]); 95 83 } 96 } 97 if (QByteArray(argv[ii]) == "-date" || QByteArray(argv[ii]) == "--date") { 98 dragAndDrop = false; 99 if (ii+1 < argc) { 84 if (QByteArray(argv[ii]).indexOf("-date") != -1) { 100 85 dateString = QString(argv[ii+1]); 101 86 } 102 } 103 if (QByteArray(argv[ii]) == "-time" || QByteArray(argv[ii]) == "--time") { 104 dragAndDrop = false; 105 if (ii+1 < argc) { 87 if (QByteArray(argv[ii]).indexOf("-time") != -1) { 106 88 timeString = QString(argv[ii+1]); 107 }108 }109 if (QByteArray(argv[ii]) == "-conf" || QByteArray(argv[ii]) == "--conf") {110 confFile = true;111 dragAndDrop = false;112 if (ii+1 < argc) {113 confFileName = QString(argv[ii+1]);114 }115 }116 if (dragAndDrop && ii == 1) {117 confFile = true;118 if (ii < argc) {119 confFileName = QString(argv[ii]);120 89 } 121 90 } 122 91 } 123 92 124 QString printHelp; 125 printHelp = "Usage: bnc -nw\n" 126 " --conf <confFileName>\n" 127 " --file <inputFileName>\n" 128 " --format <RTIGS | RTCM_2 | RTCM_3>\n" 129 " --date YYYY-MM-DD --time HH:MM:SS"; 130 131 if (confFile && confFileName.isEmpty() ) { 132 cout << printHelp.toAscii().data() << endl; 133 exit(0); 134 } 93 QString printHelp = "Usage: bnc -nw\n" 94 " --conf <confFileName>\n" 95 " --file <rawFileName>\n" 96 " --format <RTIGS | RTCM_2 | RTCM_3>\n" 97 " --date YYYY-MM-DD --time HH:MM:SS"; 135 98 136 99 bncApp app(argc, argv, GUIenabled); … … 180 143 // Normal case - data from Internet 181 144 // -------------------------------- 182 if ( !fileInput) {145 if ( rawFileName.isEmpty() ) { 183 146 caster->slotReadMountPoints(); 184 147 if (caster->numStations() == 0) { 185 return 0;148 exit(0); 186 149 } 187 150 } … … 190 153 // ----------------------------- 191 154 else { 192 if ( fileName.isEmpty() || format.isEmpty() || 193 dateString.isEmpty() || timeString.isEmpty() ) { 194 cout << printHelp.toAscii().data() << endl; 155 if ( format.isEmpty() || dateString.isEmpty() || timeString.isEmpty() ) { 156 cout << printHelp.toAscii().data() << endl; 195 157 exit(0); 196 158 } … … 200 162 QTime::fromString(timeString, Qt::ISODate), Qt::UTC); 201 163 202 bncGetThread* getThread = new bncGetThread( fileName, format);164 bncGetThread* getThread = new bncGetThread(rawFileName, format); 203 165 caster->addGetThread(getThread); 204 166 }
Note:
See TracChangeset
for help on using the changeset viewer.