Changeset 1146 in ntrip for trunk/BNC/bncmain.cpp


Ignore:
Timestamp:
Oct 2, 2008, 4:38:03 PM (16 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncmain.cpp

    r1140 r1146  
    5959int main(int argc, char *argv[]) {
    6060
    61   bool GUIenabled = true;
     61  bool       GUIenabled  = true;
     62  bool       fileInput   = false;
     63  QByteArray fileName;
     64  QByteArray format;
     65
    6266  for (int ii = 1; ii < argc; ii++) {
    63     if (QString(argv[ii]) == "-nw") {
     67    if (QByteArray(argv[ii]) == "-nw") {
    6468      GUIenabled = false;
    6569      break;
     70    }
     71  }
     72
     73  for (int ii = 1; ii < argc; ii++) {
     74    if (QByteArray(argv[ii]) == "-file" || QByteArray(argv[ii]) == "--file") {
     75      GUIenabled = false;
     76      fileInput  = true;
     77      if (ii+1 < argc) {
     78        fileName = QByteArray(argv[ii+1]);
     79      }
     80    }
     81    if (QByteArray(argv[ii]) == "-format" || QByteArray(argv[ii]) == "--format") {
     82      GUIenabled = false;
     83      fileInput  = true;
     84      if (ii+1 < argc) {
     85        format = QByteArray(argv[ii+1]);
     86      }
    6687    }
    6788  }
     
    130151    ((bncApp*)qApp)->slotMessage("============ Start BNC ============");
    131152
    132     if (false) {
    133       bncGetThread* getThread = new bncGetThread("SASS0.raw","RTCM_3");
     153    if (fileInput) {
     154      if (fileName.isEmpty() || format.isEmpty()) {
     155        cout << "Usage: bnc --file <fileName> --format <RTIGS | RTCM_2 | RTCM_3>" << endl;
     156        exit(0);
     157      }
     158
     159      bncGetThread* getThread = new bncGetThread(fileName, format);
    134160      app.connect(getThread, SIGNAL(newMessage(QByteArray)),
    135161                  &app, SLOT(slotMessage(const QByteArray)));
Note: See TracChangeset for help on using the changeset viewer.