Changeset 5066 in ntrip


Ignore:
Timestamp:
Mar 30, 2013, 11:31:00 AM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/GPSS/gpssDecoder.cpp

    r2711 r5066  
    5151gpssDecoder::gpssDecoder() : GPSDecoder() {
    5252  connect(this, SIGNAL(newGPSEph(gpsephemeris*)),
    53           (bncApp*) qApp, SLOT(slotNewGPSEph(gpsephemeris*)));
     53          PGM_CORE, SLOT(slotNewGPSEph(gpsephemeris*)));
    5454}
    5555
  • trunk/BNC/src/GPSS/hassDecoder.cpp

    r3580 r5066  
    4747
    4848  connect(this, SIGNAL(newCorrLine(QString, QString, long)),
    49           (bncApp*) qApp, SLOT(slotNewCorrLine(QString, QString, long)));
     49          PGM_CORE, SLOT(slotNewCorrLine(QString, QString, long)));
    5050}
    5151
  • trunk/BNC/src/RTCM3/RTCM3Decoder.cpp

    r4389 r5066  
    7575
    7676  connect(this, SIGNAL(newGPSEph(gpsephemeris*)),
    77           (bncApp*) qApp, SLOT(slotNewGPSEph(gpsephemeris*)));
     77          PGM_CORE, SLOT(slotNewGPSEph(gpsephemeris*)));
    7878  connect(this, SIGNAL(newGlonassEph(glonassephemeris*)),
    79           (bncApp*) qApp, SLOT(slotNewGlonassEph(glonassephemeris*)));
     79          PGM_CORE, SLOT(slotNewGlonassEph(glonassephemeris*)));
    8080  connect(this, SIGNAL(newGalileoEph(galileoephemeris*)),
    81           (bncApp*) qApp, SLOT(slotNewGalileoEph(galileoephemeris*)));
     81          PGM_CORE, SLOT(slotNewGalileoEph(galileoephemeris*)));
    8282
    8383  // Mode can be either observations or corrections
     
    149149  // Get Glonass Slot Numbers from Global Array
    150150  // ------------------------------------------
    151   bncApp* app = (bncApp*) qApp;
    152   app->getGlonassSlotNums(parser.GLOFreq);
     151  PGM_CORE->getGlonassSlotNums(parser.GLOFreq);
    153152
    154153  // Remaining part decodes the Observations
     
    378377
    379378  if (decoded) {
    380     app->storeGlonassSlotNums(parser.GLOFreq);
     379    PGM_CORE->storeGlonassSlotNums(parser.GLOFreq);
    381380    return success;
    382381  }
  • trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp

    r4900 r5066  
    7373
    7474  connect(this, SIGNAL(newCorrLine(QString, QString, long)),
    75           (bncApp*) qApp, SLOT(slotNewCorrLine(QString, QString, long)));
     75          PGM_CORE, SLOT(slotNewCorrLine(QString, QString, long)));
    7676
    7777  connect(this, SIGNAL(newMessage(QByteArray,bool)),
    78           (bncApp*) qApp, SLOT(slotMessage(const QByteArray,bool)));
     78          PGM_CORE, SLOT(slotMessage(const QByteArray,bool)));
    7979
    8080  memset(&_co, 0, sizeof(_co));
  • trunk/BNC/src/RTCM3/ephemeris.cpp

    r4904 r5066  
    416416    }
    417417
    418     if (timeChanged && ((bncApp*) qApp)->mode() == bncApp::batchPostProcessing) {
     418    if (timeChanged && PGM_CORE->mode() == t_pgmCore::batchPostProcessing) {
    419419      bncTime newHTime(ww, (double) tow);
    420420      cout << "GLONASS " << ee->almanac_number <<  " Time Changed at "
  • trunk/BNC/src/RTRover/bncrtrover.cpp

    r4800 r5066  
    9393  // Connect to BNC Signals
    9494  // ----------------------
    95   connect(((bncApp*)qApp), SIGNAL(newCorrections(QList<QString>)),
     95  connect(PGM_CORE, SIGNAL(newCorrections(QList<QString>)),
    9696          this, SLOT(slotNewCorrections(QList<QString>)));
    9797
    98   connect(((bncApp*)qApp), SIGNAL(newEphGPS(gpsephemeris)),
     98  connect(PGM_CORE, SIGNAL(newEphGPS(gpsephemeris)),
    9999          this, SLOT(slotNewEphGPS(gpsephemeris)));
    100100
    101   connect(((bncApp*)qApp), SIGNAL(newEphGlonass(glonassephemeris)),
     101  connect(PGM_CORE, SIGNAL(newEphGlonass(glonassephemeris)),
    102102          this, SLOT(slotNewEphGlonass(glonassephemeris)));
    103103
    104   connect(((bncApp*)qApp), SIGNAL(newEphGalileo(galileoephemeris)),
     104  connect(PGM_CORE, SIGNAL(newEphGalileo(galileoephemeris)),
    105105          this, SLOT(slotNewEphGalileo(galileoephemeris)));
    106106 
  • trunk/BNC/src/bncapp.cpp

    r4904 r5066  
    2727 * -------------------------------------------------------------------------
    2828 *
    29  * Class:      bncApp
     29 * Class:      t_pgmCore
    3030 *
    3131 * Purpose:    This class implements the main application
     
    5858// Constructor
    5959////////////////////////////////////////////////////////////////////////////
    60 bncApp::bncApp(int& argc, char* argv[], bool GUIenabled) :
    61   QApplication(argc, argv, GUIenabled) {
    62 
     60t_pgmCore::t_pgmCore(int& argc, char* argv[], bool GUIenabled) {
    6361  _GUIenabled  = GUIenabled;
    6462  _logFileFlag = 0;
     
    127125// Destructor
    128126////////////////////////////////////////////////////////////////////////////
    129 bncApp::~bncApp() {
     127t_pgmCore::~t_pgmCore() {
    130128  delete _logStream;
    131129  delete _logFile;
     
    163161// Write a Program Message
    164162////////////////////////////////////////////////////////////////////////////
    165 void bncApp::slotMessage(QByteArray msg, bool showOnScreen) {
     163void t_pgmCore::slotMessage(QByteArray msg, bool showOnScreen) {
    166164
    167165  QMutexLocker locker(&_mutexMessage);
     
    173171// Write a Program Message (private, no lock)
    174172////////////////////////////////////////////////////////////////////////////
    175 void bncApp::messagePrivate(const QByteArray& msg) {
     173void t_pgmCore::messagePrivate(const QByteArray& msg) {
    176174
    177175  // First time resolve the log file name
     
    215213// New GPS Ephemeris
    216214////////////////////////////////////////////////////////////////////////////
    217 void bncApp::slotNewGPSEph(gpsephemeris* gpseph) {
     215void t_pgmCore::slotNewGPSEph(gpsephemeris* gpseph) {
    218216
    219217  QMutexLocker locker(&_mutex);
     
    246244// New Glonass Ephemeris
    247245////////////////////////////////////////////////////////////////////////////
    248 void bncApp::slotNewGlonassEph(glonassephemeris* glonasseph) {
     246void t_pgmCore::slotNewGlonassEph(glonassephemeris* glonasseph) {
    249247
    250248  QMutexLocker locker(&_mutex);
     
    292290// New Galileo Ephemeris
    293291////////////////////////////////////////////////////////////////////////////
    294 void bncApp::slotNewGalileoEph(galileoephemeris* galileoeph) {
     292void t_pgmCore::slotNewGalileoEph(galileoephemeris* galileoeph) {
    295293
    296294  QMutexLocker locker(&_mutex);
     
    327325// Print Header of the output File(s)
    328326////////////////////////////////////////////////////////////////////////////
    329 void bncApp::printEphHeader() {
     327void t_pgmCore::printEphHeader() {
    330328
    331329  bncSettings settings;
     
    499497// Print One GPS Ephemeris
    500498////////////////////////////////////////////////////////////////////////////
    501 void bncApp::printGPSEph(gpsephemeris* ep, bool printFile) {
     499void t_pgmCore::printGPSEph(gpsephemeris* ep, bool printFile) {
    502500
    503501  t_ephGPS eph;
     
    512510// Print One Glonass Ephemeris
    513511////////////////////////////////////////////////////////////////////////////
    514 void bncApp::printGlonassEph(glonassephemeris* ep, bool printFile) {
     512void t_pgmCore::printGlonassEph(glonassephemeris* ep, bool printFile) {
    515513
    516514  t_ephGlo eph;
     
    526524// Print One Galileo Ephemeris
    527525////////////////////////////////////////////////////////////////////////////
    528 void bncApp::printGalileoEph(galileoephemeris* ep, bool printFile) {
     526void t_pgmCore::printGalileoEph(galileoephemeris* ep, bool printFile) {
    529527
    530528  t_ephGal eph;
     
    539537// Output
    540538////////////////////////////////////////////////////////////////////////////
    541 void bncApp::printOutput(bool printFile, QTextStream* stream,
     539void t_pgmCore::printOutput(bool printFile, QTextStream* stream,
    542540                         const QString& strV2, const QString& strV3) {
    543541
     
    576574// Set Port Number
    577575////////////////////////////////////////////////////////////////////////////
    578 void bncApp::setPort(int port) {
     576void t_pgmCore::setPort(int port) {
    579577  _port = port;
    580578  if (_port != 0) {
     
    582580    _server = new QTcpServer;
    583581    if ( !_server->listen(QHostAddress::Any, _port) ) {
    584       slotMessage("bncApp: Cannot listen on ephemeris port", true);
     582      slotMessage("t_pgmCore: Cannot listen on ephemeris port", true);
    585583    }
    586584    connect(_server, SIGNAL(newConnection()), this, SLOT(slotNewConnection()));
     
    592590// Set Port Number
    593591////////////////////////////////////////////////////////////////////////////
    594 void bncApp::setPortCorr(int port) {
     592void t_pgmCore::setPortCorr(int port) {
    595593  _portCorr = port;
    596594  if (_portCorr != 0) {
     
    598596    _serverCorr = new QTcpServer;
    599597    if ( !_serverCorr->listen(QHostAddress::Any, _portCorr) ) {
    600       slotMessage("bncApp: Cannot listen on correction port", true);
     598      slotMessage("t_pgmCore: Cannot listen on correction port", true);
    601599    }
    602600    connect(_serverCorr, SIGNAL(newConnection()), this, SLOT(slotNewConnectionCorr()));
     
    608606// New Connection
    609607////////////////////////////////////////////////////////////////////////////
    610 void bncApp::slotNewConnection() {
     608void t_pgmCore::slotNewConnection() {
    611609  _sockets->push_back( _server->nextPendingConnection() );
    612610}
     
    614612// New Connection
    615613////////////////////////////////////////////////////////////////////////////
    616 void bncApp::slotNewConnectionCorr() {
     614void t_pgmCore::slotNewConnectionCorr() {
    617615  _socketsCorr->push_back( _serverCorr->nextPendingConnection() );
    618616}
     
    620618//
    621619////////////////////////////////////////////////////////////////////////////
    622 void bncApp::slotQuit() {
    623   cout << "bncApp::slotQuit" << endl;
     620void t_pgmCore::slotQuit() {
     621  cout << "t_pgmCore::slotQuit" << endl;
    624622  delete _caster;
    625   quit();
     623  qApp->quit();
    626624}
    627625
    628626//
    629627////////////////////////////////////////////////////////////////////////////
    630 void bncApp::slotNewCorrLine(QString line, QString staID, long coTime) {
     628void t_pgmCore::slotNewCorrLine(QString line, QString staID, long coTime) {
    631629
    632630  QMutexLocker locker(&_mutex);
     
    680678// Dump Complete Correction Epochs
    681679////////////////////////////////////////////////////////////////////////////
    682 void bncApp::dumpCorrs(long minTime, long maxTime) {
     680void t_pgmCore::dumpCorrs(long minTime, long maxTime) {
    683681  for (long sec = minTime; sec <= maxTime; sec++) {
    684682    QList<QString> allCorrs = _corrs->values(sec);
     
    690688// Dump all corrections
    691689////////////////////////////////////////////////////////////////////////////
    692 void bncApp::dumpCorrs() {
     690void t_pgmCore::dumpCorrs() {
    693691  QList<QString> allCorrs;
    694692  QMutableMapIterator<long, QString> it(*_corrs);
     
    702700// Dump List of Corrections
    703701////////////////////////////////////////////////////////////////////////////
    704 void bncApp::dumpCorrs(const QList<QString>& allCorrs) {
     702void t_pgmCore::dumpCorrs(const QList<QString>& allCorrs) {
    705703  emit newCorrections(allCorrs);
    706704  if (_socketsCorr) {
     
    729727//
    730728////////////////////////////////////////////////////////////////////////////
    731 void bncApp::setConfFileName(const QString& confFileName) {
     729void t_pgmCore::setConfFileName(const QString& confFileName) {
    732730  if (confFileName.isEmpty()) {
    733731    _confFileName = QDir::homePath() + QDir::separator()
    734732                  + ".config" + QDir::separator()
    735                   + organizationName() + QDir::separator()
    736                   + applicationName() + ".bnc";
     733                  + qApp->organizationName() + QDir::separator()
     734                  + qApp->applicationName() + ".bnc";
    737735  }
    738736  else {
     
    743741// Raw Output
    744742////////////////////////////////////////////////////////////////////////////
    745 void bncApp::writeRawData(const QByteArray& data, const QByteArray& staID,
     743void t_pgmCore::writeRawData(const QByteArray& data, const QByteArray& staID,
    746744                          const QByteArray& format) {
    747745
     
    763761// Get Glonass Slot Numbers from Global Array
    764762////////////////////////////////////////////////////////////////////////////
    765 void bncApp::getGlonassSlotNums(int GLOFreq[]) {
     763void t_pgmCore::getGlonassSlotNums(int GLOFreq[]) {
    766764
    767765  QMutexLocker locker(&_mutex);
     
    776774// Store Glonass Slot Numbers to Global Array
    777775////////////////////////////////////////////////////////////////////////////
    778 void bncApp::storeGlonassSlotNums(const int GLOFreq[]) {
     776void t_pgmCore::storeGlonassSlotNums(const int GLOFreq[]) {
    779777
    780778  QMutexLocker locker(&_mutex);
     
    789787//
    790788////////////////////////////////////////////////////////////////////////////
    791 void bncApp::initCombination() {
     789void t_pgmCore::initCombination() {
    792790#ifdef USE_COMBINATION
    793791  _bncComb = new bncComb();
     
    801799//
    802800////////////////////////////////////////////////////////////////////////////
    803 void bncApp::stopCombination() {
     801void t_pgmCore::stopCombination() {
    804802#ifdef USE_COMBINATION
    805803  delete _bncComb;
     
    808806}
    809807
    810 // Handling Events (virtual)
    811 ////////////////////////////////////////////////////////////////////////////
    812 bool bncApp::event(QEvent* ev) {
    813 
    814   if (ev->type() == QEvent::FileOpen) {  // currently happens on Mac only
    815     QString fileName = static_cast<QFileOpenEvent*>(ev)->file();
    816     setConfFileName(fileName);
    817     return true;
    818   }
    819    
    820   return QApplication::event(ev);
    821 }
    822 
    823808// Check Ephemeris Consistency
    824809////////////////////////////////////////////////////////////////////////////
    825 void bncApp::checkEphemeris(gpsephemeris* oldEph, gpsephemeris* newEph) {
     810void t_pgmCore::checkEphemeris(gpsephemeris* oldEph, gpsephemeris* newEph) {
    826811  if (oldEph->clock_bias      != newEph->clock_bias      ||
    827812      oldEph->clock_drift     != newEph->clock_drift     ||
  • trunk/BNC/src/bncapp.h

    r4447 r5066  
    3636class bncTableItem;
    3737
    38 class bncApp : public QApplication {
     38class t_pgmCore : public QObject {
    3939  Q_OBJECT
    4040
     
    4444  public:
    4545    enum e_mode {interactive, nonInteractive, batchPostProcessing};
    46     bncApp(int& argc, char* argv[], bool GUIenabled);
    47     virtual ~bncApp(); 
     46    t_pgmCore(int& argc, char* argv[], bool GUIenabled);
     47    virtual ~t_pgmCore(); 
    4848    e_mode mode() const {return _mode;}
    4949    void   setMode(e_mode mode) {_mode = mode;}
     
    6565    void setMainWindow(QWidget* mainWindow){_mainWindow = mainWindow;}
    6666    bool GUIenabled() const {return _GUIenabled;}
    67   protected:
    68     virtual bool event(QEvent* ev);
    6967
    7068  public slots:
     
    143141    QMap<int, bncTableItem*> _uploadTableItems;
    144142};
     143
     144extern t_pgmCore* PGM_CORE;
     145
    145146#endif
  • trunk/BNC/src/bnccaster.cpp

    r4990 r5066  
    6565
    6666  connect(this, SIGNAL(newMessage(QByteArray,bool)),
    67           (bncApp*) qApp, SLOT(slotMessage(const QByteArray,bool)));
     67          PGM_CORE, SLOT(slotMessage(const QByteArray,bool)));
    6868
    6969  if ( !outFileName.isEmpty() ) {
     
    483483  emit mountPointsRead(_threads);
    484484  emit( newMessage(QString("Configuration read: "
    485                            + ((bncApp*) qApp)->confFileName()
     485                           + PGM_CORE->confFileName()
    486486                           + ", %1 stream(s)")
    487487                            .arg(_threads.count()).toAscii(), true) );
  • trunk/BNC/src/bncephuser.cpp

    r4904 r5066  
    5151
    5252  if (connectSlots) {
    53     connect(((bncApp*)qApp), SIGNAL(newEphGPS(gpsephemeris)),
     53    connect(PGM_CORE, SIGNAL(newEphGPS(gpsephemeris)),
    5454            this, SLOT(slotNewEphGPS(gpsephemeris)), Qt::DirectConnection);
    5555   
    56     connect(((bncApp*)qApp), SIGNAL(newEphGlonass(glonassephemeris)),
     56    connect(PGM_CORE, SIGNAL(newEphGlonass(glonassephemeris)),
    5757            this, SLOT(slotNewEphGlonass(glonassephemeris)), Qt::DirectConnection);
    5858   
    59     connect(((bncApp*)qApp), SIGNAL(newEphGalileo(galileoephemeris)),
     59    connect(PGM_CORE, SIGNAL(newEphGalileo(galileoephemeris)),
    6060            this, SLOT(slotNewEphGalileo(galileoephemeris)), Qt::DirectConnection);
    6161  }
  • trunk/BNC/src/bncgetthread.cpp

    r4792 r5066  
    121121  setTerminationEnabled(true);
    122122
    123   bncApp* app = (bncApp*) qApp;
    124 
    125123  connect(this, SIGNAL(newMessage(QByteArray,bool)),
    126           app, SLOT(slotMessage(const QByteArray,bool)));
     124          PGM_CORE, SLOT(slotMessage(const QByteArray,bool)));
    127125
    128126  _isToBeDeleted = false;
     
    333331      settings.value("pppMount").toString() == _staID) {
    334332    _PPPclient = new bncPPPclient(_staID);
    335     bncApp* app = (bncApp*) qApp;
    336     app->_bncPPPclient = _PPPclient;
     333    PGM_CORE->_bncPPPclient = _PPPclient;
    337334    qRegisterMetaType<bncTime>("bncTime");
    338335    connect(_PPPclient, SIGNAL(newPosition(bncTime, double, double, double)),
     
    443440        if (data.isEmpty()) {
    444441          cout << "no more data" << endl;
    445           ((bncApp*) qApp)->stopCombination();
     442          PGM_CORE->stopCombination();
    446443          QThread::exit(0);
    447444          delete this;
     
    468465      // -----------
    469466      if (_rawOutput) {
    470         bncApp* app = (bncApp*) qApp;
    471         app->writeRawData(data, _staID, _format);
     467        PGM_CORE->writeRawData(data, _staID, _format);
    472468      }
    473469
  • trunk/BNC/src/bncmain.cpp

    r4716 r5066  
    4545#include <iostream>
    4646
     47#include "app.h"
    4748#include "bncapp.h"
    4849#include "bncwindow.h"
     
    116117
    117118  bool GUIenabled = interactive || displaySet;
    118   bncApp app(argc, argv, GUIenabled);
     119  t_app app(argc, argv, GUIenabled);
    119120
    120121  app.setApplicationName("BNC");
    121122  app.setOrganizationName("BKG");
    122123  app.setOrganizationDomain("www.bkg.bund.de");
    123   app.setConfFileName( confFileName );
     124  PGM_CORE->setConfFileName( confFileName );
    124125
    125126  bncSettings settings;
     
    137138  if (interactive) {
    138139
    139     app.setMode(bncApp::interactive);
     140    PGM_CORE->setMode(t_pgmCore::interactive);
    140141
    141142    QString fontString = settings.value("font").toString();
     
    150151
    151152    bncWindow* bncWin = new bncWindow();
    152     app.setMainWindow(bncWin);
     153    PGM_CORE->setMainWindow(bncWin);
    153154    bncWin->show();
    154155  }
     
    159160  // -------------------
    160161  else if (settings.value("pppSPP").toString() == "Post-Processing") {
    161     app.setMode(bncApp::batchPostProcessing);
     162    PGM_CORE->setMode(t_pgmCore::batchPostProcessing);
    162163    t_postProcessing* postProcessing = new t_postProcessing(0);
    163164    postProcessing->start();
     
    167168  // -------------------------
    168169  else if (settings.value("reqcAction").toString() == "Edit/Concatenate") {
    169     app.setMode(bncApp::batchPostProcessing);
     170    PGM_CORE->setMode(t_pgmCore::batchPostProcessing);
    170171    t_reqcEdit* reqcEdit = new t_reqcEdit(0);
    171172    reqcEdit->start();
     
    175176  // ----------------------------
    176177  else if (settings.value("reqcAction").toString() == "Analyze") {
    177     app.setMode(bncApp::batchPostProcessing);
     178    PGM_CORE->setMode(t_pgmCore::batchPostProcessing);
    178179    t_reqcAnalyze* reqcAnalyze = new t_reqcAnalyze(0);
    179180    reqcAnalyze->start();
     
    193194                                      settings.value("outPort").toInt());
    194195   
    195     app.setCaster(caster);
    196     app.setPort(settings.value("outEphPort").toInt());
    197     app.setPortCorr(settings.value("corrPort").toInt());
    198     app.initCombination();
    199    
    200     app.connect(caster, SIGNAL(getThreadsFinished()), &app, SLOT(quit()));
    201    
    202     ((bncApp*)qApp)->slotMessage("========== Start BNC v" BNCVERSION " =========", true);
     196    PGM_CORE->setCaster(caster);
     197    PGM_CORE->setPort(settings.value("outEphPort").toInt());
     198    PGM_CORE->setPortCorr(settings.value("corrPort").toInt());
     199    PGM_CORE->initCombination();
     200   
     201    PGM_CORE->connect(caster, SIGNAL(getThreadsFinished()), &app, SLOT(quit()));
     202   
     203    PGM_CORE->slotMessage("========== Start BNC v" BNCVERSION " =========", true);
    203204   
    204205    // Normal case - data from Internet
    205206    // --------------------------------
    206207    if ( rawFileName.isEmpty() ) {
    207       app.setMode(bncApp::nonInteractive);
     208      PGM_CORE->setMode(t_pgmCore::nonInteractive);
    208209      caster->readMountPoints();
    209210      if (caster->numStations() == 0) {
     
    215216    // -----------------------------
    216217    else {
    217       app.setMode(bncApp::batchPostProcessing);
     218      PGM_CORE->setMode(t_pgmCore::batchPostProcessing);
    218219      bncRawFile*   rawFile   = new bncRawFile(rawFileName, "",
    219220                                               bncRawFile::input);
  • trunk/BNC/src/bncnetquery.h

    r4278 r5066  
    1313
    1414  bncNetQuery() {
    15     connect(this,           SIGNAL(newMessage(QByteArray,bool)),
    16             (bncApp*) qApp, SLOT(slotMessage(const QByteArray,bool)));
     15    connect(this,     SIGNAL(newMessage(QByteArray,bool)),
     16            PGM_CORE, SLOT(slotMessage(const QByteArray,bool)));
    1717  }
    1818  virtual ~bncNetQuery() {}
  • trunk/BNC/src/bncnetqueryv2.cpp

    r4278 r5066  
    4242
    4343  if (_secure && !QSslSocket::supportsSsl()) {
    44     ((bncApp*)qApp)->slotMessage("No SSL support, install OpenSSL run-time libraries", true);
     44    PGM_CORE->slotMessage("No SSL support, install OpenSSL run-time libraries", true);
    4545    stop();
    4646  }
     
    219219  }
    220220
    221   ((bncApp*)qApp)->slotMessage(msg.toAscii(), true);
     221  PGM_CORE->slotMessage(msg.toAscii(), true);
    222222
    223223  if (_ignoreSslErrors) {
  • trunk/BNC/src/bncpppclient.cpp

    r4979 r5066  
    7272  if (connectSlots) {
    7373    connect(this, SIGNAL(newMessage(QByteArray,bool)),
    74             ((bncApp*)qApp), SLOT(slotMessage(const QByteArray,bool)));
    75 
    76     connect(((bncApp*)qApp), SIGNAL(newCorrections(QList<QString>)),
     74            PGM_CORE, SLOT(slotMessage(const QByteArray,bool)));
     75
     76    connect(PGM_CORE, SIGNAL(newCorrections(QList<QString>)),
    7777            this, SLOT(slotNewCorrections(QList<QString>)));
    7878  }
  • trunk/BNC/src/bncrawfile.cpp

    r4278 r5066  
    136136      QStringList lst  = line.split(' ');
    137137     
    138       bncApp* app = (bncApp*) qApp;
    139       delete app->_currentDateAndTimeGPS;
    140       app->_currentDateAndTimeGPS =
     138      delete PGM_CORE->_currentDateAndTimeGPS;
     139      PGM_CORE->_currentDateAndTimeGPS =
    141140        new QDateTime(QDateTime::fromString(lst.value(0), Qt::ISODate));
    142141     
  • trunk/BNC/src/bncsettings.cpp

    r5064 r5066  
    2727  QMutexLocker locker(&_mutex);
    2828
    29 #ifdef GNSSCENTER_PLUGIN
    30   _bncApp = 0;
    31   return;
    32 #else
    33   _bncApp = static_cast<bncApp*>(qApp);
    34 #endif
    35 
    3629  // First fill the options
    3730  // ----------------------
    38   if (_bncApp->_settings.size() == 0) {
     31  if (PGM_CORE->_settings.size() == 0) {
    3932    reRead();
    4033  }
     
    5043void bncSettings::reRead() {
    5144
    52   _bncApp->_settings.clear();
    53 
    54   QSettings settings(_bncApp->confFileName(), QSettings::IniFormat);
     45  PGM_CORE->_settings.clear();
     46
     47  QSettings settings(PGM_CORE->confFileName(), QSettings::IniFormat);
    5548
    5649  // Read from File
     
    6053    while (it.hasNext()) {
    6154      QString key = it.next();
    62       _bncApp->_settings[key] = settings.value(key);
     55      PGM_CORE->_settings[key] = settings.value(key);
    6356    }
    6457  }
     
    225218  QMutexLocker locker(&_mutex);
    226219
    227   if (_bncApp && _bncApp->_settings.contains(key)) {
    228     return _bncApp->_settings[key];
     220  if (PGM_CORE->_settings.contains(key)) {
     221    return PGM_CORE->_settings[key];
    229222  }
    230223  else {
     
    243236////////////////////////////////////////////////////////////////////////////
    244237void bncSettings::setValue_p(const QString &key, const QVariant& value) {
    245   _bncApp->_settings[key] = value;
     238  PGM_CORE->_settings[key] = value;
    246239}
    247240
     
    250243void bncSettings::remove(const QString& key ) {
    251244  QMutexLocker locker(&_mutex);
    252   _bncApp->_settings.remove(key);
     245  PGM_CORE->_settings.remove(key);
    253246}
    254247
     
    257250void bncSettings::sync() {
    258251  QMutexLocker locker(&_mutex);
    259   QSettings settings(_bncApp->confFileName(), QSettings::IniFormat);
     252  QSettings settings(PGM_CORE->confFileName(), QSettings::IniFormat);
    260253  settings.clear();
    261   QMapIterator<QString, QVariant> it(_bncApp->_settings);
     254  QMapIterator<QString, QVariant> it(PGM_CORE->_settings);
    262255  while (it.hasNext()) {
    263256    it.next();
  • trunk/BNC/src/bncsettings.h

    r4278 r5066  
    33
    44#include <QMutex>
    5 
    6 class bncApp;
    75
    86class bncSettings {
     
    1816 private:
    1917  void setValue_p(const QString &key, const QVariant& value);
    20   bncApp*       _bncApp;
    2118  static QMutex _mutex;
    2219};
  • trunk/BNC/src/bncutils.cpp

    r4338 r5066  
    9191  QDateTime currDateTimeGPS;
    9292
    93   if ( ((bncApp*) qApp)->_currentDateAndTimeGPS ) {
    94     currDateTimeGPS = *(((bncApp*) qApp)->_currentDateAndTimeGPS);
     93  if ( PGM_CORE->_currentDateAndTimeGPS ) {
     94    currDateTimeGPS = *(PGM_CORE->_currentDateAndTimeGPS);
    9595  }
    9696  else {
     
    116116////////////////////////////////////////////////////////////////////////////
    117117QDateTime currentDateAndTimeGPS() {
    118   if ( ((bncApp*) qApp)->_currentDateAndTimeGPS ) {
    119     return *(((bncApp*) qApp)->_currentDateAndTimeGPS);
     118  if ( PGM_CORE->_currentDateAndTimeGPS ) {
     119    return *(PGM_CORE->_currentDateAndTimeGPS);
    120120  }
    121121  else {
  • trunk/BNC/src/bncwindow.cpp

    r5063 r5066  
    101101  setWindowTitle(tr("BKG Ntrip Client (BNC) Version " BNCVERSION));
    102102
    103   connect((bncApp*)qApp, SIGNAL(newMessage(QByteArray,bool)),
    104            this, SLOT(slotWindowMessage(QByteArray,bool)));
     103  connect(PGM_CORE, SIGNAL(newMessage(QByteArray,bool)),
     104          this, SLOT(slotWindowMessage(QByteArray,bool)));
    105105
    106106  // Create Actions
     
    19211921////////////////////////////////////////////////////////////////////////////
    19221922void bncWindow::slotGetThreadsFinished() {
    1923   ((bncApp*)qApp)->slotMessage("All Get Threads Terminated", true);
     1923  PGM_CORE->slotMessage("All Get Threads Terminated", true);
    19241924  delete _caster;    _caster    = 0;
    19251925  delete _casterEph; _casterEph = 0;
     
    19571957                          _outPortLineEdit->text().toInt());
    19581958
    1959   ((bncApp*)qApp)->setPort(_outEphPortLineEdit->text().toInt());
    1960   ((bncApp*)qApp)->setPortCorr(_corrPortLineEdit->text().toInt());
    1961   ((bncApp*)qApp)->initCombination();
     1959  PGM_CORE->setPort(_outEphPortLineEdit->text().toInt());
     1960  PGM_CORE->setPortCorr(_corrPortLineEdit->text().toInt());
     1961  PGM_CORE->initCombination();
    19621962
    19631963  connect(_caster, SIGNAL(getThreadsFinished()),
     
    19671967           this, SLOT(slotMountPointsRead(QList<bncGetThread*>)));
    19681968
    1969   ((bncApp*)qApp)->slotMessage("========== Start BNC v" BNCVERSION " =========", true);
     1969  PGM_CORE->slotMessage("========== Start BNC v" BNCVERSION " =========", true);
    19701970
    19711971  bncSettings settings;
    19721972
    19731973  QDir rnxdir(settings.value("rnxPath").toString());
    1974   if (!rnxdir.exists()) ((bncApp*)qApp)->slotMessage("Cannot find RINEX Observations directory", true);
     1974  if (!rnxdir.exists()) PGM_CORE->slotMessage("Cannot find RINEX Observations directory", true);
    19751975
    19761976  QString rnx_file = settings.value("rnxScript").toString();
    19771977  if ( !rnx_file.isEmpty() ) {
    19781978    QFile rnxfile(settings.value("rnxScript").toString());
    1979     if (!rnxfile.exists()) ((bncApp*)qApp)->slotMessage("Cannot find RINEX Observations script", true);
     1979    if (!rnxfile.exists()) PGM_CORE->slotMessage("Cannot find RINEX Observations script", true);
    19801980  }
    19811981
    19821982  QDir ephdir(settings.value("ephPath").toString());
    1983   if (!ephdir.exists()) ((bncApp*)qApp)->slotMessage("Cannot find RINEX Ephemeris directory", true);
     1983  if (!ephdir.exists()) PGM_CORE->slotMessage("Cannot find RINEX Ephemeris directory", true);
    19841984
    19851985  QDir corrdir(settings.value("corrPath").toString());
    1986   if (!corrdir.exists()) ((bncApp*)qApp)->slotMessage("Cannot find Broadcast Corrections directory", true);
     1986  if (!corrdir.exists()) PGM_CORE->slotMessage("Cannot find Broadcast Corrections directory", true);
    19871987
    19881988  QString advise_file = settings.value("adviseScript").toString();
    19891989  if ( !advise_file.isEmpty() ) {
    19901990    QFile advisefile(settings.value("adviseScript").toString());
    1991     if (!advisefile.exists()) ((bncApp*)qApp)->slotMessage("Cannot find Outages script", true);
     1991    if (!advisefile.exists()) PGM_CORE->slotMessage("Cannot find Outages script", true);
    19921992  }
    19931993
     
    19951995  if ( !ant_file.isEmpty() ) {
    19961996    QFile anxfile(settings.value("pppAntex").toString());
    1997     if (!anxfile.exists()) ((bncApp*)qApp)->slotMessage("Cannot find IGS ANTEX file", true);
     1997    if (!anxfile.exists()) PGM_CORE->slotMessage("Cannot find IGS ANTEX file", true);
    19981998  }
    19991999
     
    20122012                                   QMessageBox::NoButton);
    20132013  if (iRet == QMessageBox::Yes) {
    2014     ((bncApp*)qApp)->stopCombination();
     2014    PGM_CORE->stopCombination();
    20152015    delete _caster;    _caster    = 0;
    20162016    delete _casterEph; _casterEph = 0;
     
    25842584      bncIt->setFlags(bncIt->flags() & ~Qt::ItemIsEditable);
    25852585      _uploadTable->setItem(iRow, iCol, bncIt);
    2586       ((bncApp*)qApp)->_uploadTableItems[iRow] = bncIt;
     2586      PGM_CORE->_uploadTableItems[iRow] = bncIt;
    25872587    }
    25882588    else {
     
    25952595////////////////////////////////////////////////////////////////////////////
    25962596void bncWindow::slotDelUploadRow() {
    2597   ((bncApp*)qApp)->_uploadTableItems.clear();
     2597  PGM_CORE->_uploadTableItems.clear();
    25982598  int nRows = _uploadTable->rowCount();
    25992599  bool flg[nRows];
     
    26122612  }
    26132613  for (int iRow = 0; iRow < _uploadTable->rowCount(); iRow++) {
    2614     ((bncApp*)qApp)->_uploadTableItems[iRow] =
     2614    PGM_CORE->_uploadTableItems[iRow] =
    26152615                                (bncTableItem*) _uploadTable->item(iRow, 11);
    26162616  }
     
    26682668        bncIt->setFlags(bncIt->flags() & ~Qt::ItemIsEditable);
    26692669        _uploadTable->setItem(iRow, iCol, bncIt);
    2670         ((bncApp*)qApp)->_uploadTableItems[iRow] = bncIt;
     2670        PGM_CORE->_uploadTableItems[iRow] = bncIt;
    26712671      }
    26722672      else {
  • trunk/BNC/src/combination/bnccomb.cpp

    r4992 r5066  
    163163
    164164  connect(this, SIGNAL(newMessage(QByteArray,bool)),
    165           ((bncApp*)qApp), SLOT(slotMessage(const QByteArray,bool)));
     165          PGM_CORE, SLOT(slotMessage(const QByteArray,bool)));
    166166
    167167  // Combination Method
     
    750750  // Optionally send new Corrections to PPP
    751751  // --------------------------------------
    752   bncApp* app = (bncApp*) qApp;
    753   if (app->_bncPPPclient) {
    754     app->_bncPPPclient->slotNewCorrections(corrLines);
     752  if (PGM_CORE->_bncPPPclient) {
     753    PGM_CORE->_bncPPPclient->slotNewCorrections(corrLines);
    755754  }
    756755}
  • trunk/BNC/src/latencychecker.cpp

    r4278 r5066  
    6060  _staID = staID;
    6161
    62   bncApp* app = (bncApp*) qApp;
    6362  connect(this, SIGNAL(newMessage(QByteArray,bool)),
    64           app, SLOT(slotMessage(const QByteArray,bool)));
     63          PGM_CORE, SLOT(slotMessage(const QByteArray,bool)));
    6564
    6665  bncSettings settings;
  • trunk/BNC/src/rinex/bncpostprocess.cpp

    r4619 r5066  
    9898  }
    9999  else {
    100     ((bncApp*) qApp)->slotMessage(msg, false);
     100    PGM_CORE->slotMessage(msg, false);
    101101  }
    102102}
     
    222222  }
    223223
    224   bncApp* app = (bncApp*) qApp;
    225   if ( app->mode() != bncApp::interactive) {
    226     app->exit(0);
     224  if (PGM_CORE->mode() != t_pgmCore::interactive) {
     225    qApp->exit(0);
    227226  }
    228227  else {
  • trunk/BNC/src/rinex/reqcanalyze.cpp

    r4718 r5066  
    101101  delete _log;     _log     = 0;
    102102  delete _logFile; _logFile = 0;
    103   bncApp* app = (bncApp*) qApp;
    104   if ( app->mode() != bncApp::interactive) {
    105     app->exit(0);
     103  if (PGM_CORE->mode() != t_pgmCore::interactive) {
     104    qApp->exit(0);
    106105  }
    107106}
     
    117116                                   double maxValue) {
    118117
    119   bncApp* app = dynamic_cast<bncApp*>(qApp);
    120   if (app->GUIenabled()) {
     118  if (PGM_CORE->GUIenabled()) {
    121119
    122120    if (maxValue == 0.0) {
     
    144142    if (data1) {
    145143      t_polarPlot* plot1 = new t_polarPlot(QwtText(title1), scaleInterval,
    146                                           app->mainWindow());
     144                                          PGM_CORE->mainWindow());
    147145      plot1->addCurve(data1);
    148146      plots << plot1;
     
    150148    if (data2) {
    151149      t_polarPlot* plot2 = new t_polarPlot(QwtText(title2), scaleInterval,
    152                                            app->mainWindow());
     150                                           PGM_CORE->mainWindow());
    153151      plot2->addCurve(data2);
    154152      plots << plot2;
     
    298296  // Show the plots
    299297  // --------------
    300   if (dynamic_cast<bncApp*>(qApp)->GUIenabled()) {
     298  if (PGM_CORE->GUIenabled()) {
    301299    QFileInfo  fileInfo(obsFile->fileName());
    302300    QByteArray title = fileInfo.fileName().toAscii();
     
    653651                                     const QByteArray& title) {
    654652
    655   if (dynamic_cast<bncApp*>(qApp)->GUIenabled()) {
     653  if (PGM_CORE->GUIenabled()) {
    656654    t_availPlot* plotA = new t_availPlot(0, &_availDataMap);
    657655    plotA->setTitle(title);
  • trunk/BNC/src/rinex/reqcedit.cpp

    r4541 r5066  
    103103  // ---------------
    104104  if (_log) {
    105     bncApp* app = (bncApp*) qApp;
    106 
    107105    *_log << QByteArray(78, '-') << endl;
    108106    *_log << "Concatenation of RINEX Observation and/or Navigation Files\n";
     
    110108
    111109    *_log << QByteArray("Program").leftJustified(15) << ": "
    112           << app->pgmName() << endl;
     110          << PGM_CORE->pgmName() << endl;
    113111    *_log << QByteArray("Run by").leftJustified(15) << ": "
    114           << app->userName() << endl;
     112          << PGM_CORE->userName() << endl;
    115113    *_log << QByteArray("Date").leftJustified(15) << ": "
    116114          << QDateTime::currentDateTime().toUTC().toString("yyyy-MM-dd hh:mm:ss") << endl;
     
    148146  // Exit (thread)
    149147  // -------------
    150   bncApp* app = (bncApp*) qApp;
    151   if ( app->mode() != bncApp::interactive) {
    152     app->exit(0);
     148  if (PGM_CORE->mode() != t_pgmCore::interactive) {
     149    qApp->exit(0);
    153150  }
    154151  else {
  • trunk/BNC/src/rinex/rnxnavfile.cpp

    r4232 r5066  
    241241void t_rnxNavFile::writeHeader(const QMap<QString, QString>* txtMap) {
    242242
    243   bncApp* app = (bncApp*) qApp;
    244 
    245   QString     runBy = app->userName();
     243  QString     runBy = PGM_CORE->userName();
    246244  QStringList comments;
    247245
     
    277275                                            : "yyyyMMdd hhmmss UTC";
    278276  *_stream << QString("%1%2%3")
    279     .arg(app->pgmName(), -20)
     277    .arg(PGM_CORE->pgmName(), -20)
    280278    .arg(runBy.trimmed().left(20), -20)
    281279    .arg(QDateTime::currentDateTime().toUTC().toString(fmtDate), -20)
  • trunk/BNC/src/rinex/rnxobsfile.cpp

    r4748 r5066  
    212212                           const QMap<QString, QString>* txtMap) const {
    213213
    214   bncApp* app = (bncApp*) qApp;
    215 
    216214  QStringList newComments;
    217   QString     runBy = app->userName();
     215  QString     runBy = PGM_CORE->userName();
    218216
    219217  if (txtMap) {
     
    238236                                                  : "yyyyMMdd hhmmss UTC";
    239237  *stream << QString("%1%2%3")
    240     .arg(app->pgmName(), -20)
     238    .arg(PGM_CORE->pgmName(), -20)
    241239    .arg(runBy.trimmed().left(20), -20)
    242240    .arg(QDateTime::currentDateTime().toUTC().toString(fmtDate), -20)
  • trunk/BNC/src/src.pro

    r4807 r5066  
    5757          bncephuser.h bncoutf.h bncclockrinex.h bncsp3.h             \
    5858          bncbytescounter.h bncsslconfig.h reqcdlg.h                  \
     59          app.h                                                       \
    5960          upload/bncrtnetdecoder.h upload/bncuploadcaster.h           \
    6061          upload/bncrtnetuploadcaster.h upload/bnccustomtrafo.h       \
     
    8687          bncephuser.cpp bncoutf.cpp bncclockrinex.cpp bncsp3.cpp     \
    8788          bncbytescounter.cpp bncsslconfig.cpp reqcdlg.cpp            \
     89          app.cpp                                                     \
    8890          upload/bncrtnetdecoder.cpp upload/bncuploadcaster.cpp       \
    8991          upload/bncrtnetuploadcaster.cpp upload/bnccustomtrafo.cpp   \
  • trunk/BNC/src/upload/bncuploadcaster.cpp

    r4985 r5066  
    4545  _isToBeDeleted = false;
    4646
    47   bncApp* app = (bncApp*) qApp;
    4847  connect(this, SIGNAL(newMessage(QByteArray,bool)),
    49           app, SLOT(slotMessage(const QByteArray,bool)));
     48          PGM_CORE, SLOT(slotMessage(const QByteArray,bool)));
    5049
    51   if (app->_uploadTableItems.find(_iRow) != app->_uploadTableItems.end()){
     50  if (PGM_CORE->_uploadTableItems.find(_iRow) != PGM_CORE->_uploadTableItems.end()){
    5251    connect(this, SIGNAL(newBytes(QByteArray,double)),
    53             app->_uploadTableItems.value(iRow),
     52            PGM_CORE->_uploadTableItems.value(iRow),
    5453            SLOT(slotNewBytes(const QByteArray,double)));
    5554  }
Note: See TracChangeset for help on using the changeset viewer.