Changeset 4070 in ntrip


Ignore:
Timestamp:
Apr 28, 2012, 1:13:13 PM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncapp.h

    r4020 r4070  
    2626#define BNCAPP_H
    2727
    28 #include <QApplication>
    29 #include <QFile>
    30 #include <QTextStream>
     28#include <QtGui>
    3129
    3230#include "bnccaster.h"
     
    4038class bncApp : public QApplication {
    4139  Q_OBJECT
     40
     41    friend class bncSettings;
     42    QSettings::SettingsMap   _settings;
     43
    4244  public:
    4345    enum e_mode {interactive, nonInteractive, batchPostProcessing};
  • trunk/BNC/bncsettings.cpp

    r3896 r4070  
    1515 * -----------------------------------------------------------------------*/
    1616
    17 #include <QCoreApplication>
    18 #include <QStringList>
    19 
    2017#include "bncsettings.h"
    2118#include "bncapp.h"
     
    2320// Constructor
    2421////////////////////////////////////////////////////////////////////////////
    25 bncSettings::bncSettings(bool noInit) :
    26   QSettings(((bncApp*) qApp)->confFileName(), QSettings::IniFormat) {
    27 
    28   if (! noInit && allKeys().size() == 0) {
    29 //
    30     setValue("startTab",            "0");
    31     setValue("statusTab",           "0");
    32     setValue("casterUrlList", (QStringList()
    33                                << "http://user:pass@www.euref-ip.net:2101"
    34                                << "http://user:pass@www.igs-ip.net:2101"
    35                                << "http://user:pass@products.igs-ip.net:2101"
    36                                << "http://user:pass@mgex.igs-ip.net:2101"));
    37     setValue("mountPoints",         "");
    38     setValue("ntripVersion",        "1");
    39 // Network
    40     setValue("proxyHost",           "");
    41     setValue("proxyPort",           "");
    42     setValue("sslCaCertPath",       "");
    43     setValue("ignoreSslErrors",     "0");
    44 // General
    45     setValue("logFile",             "");
    46     setValue("rnxAppend",           "0");
    47     setValue("onTheFlyInterval",    "1 day");
    48     setValue("autoStart",           "0");
    49     setValue("rawOutFile",          "");
    50 // RINEX Observations
    51     setValue("rnxPath",             "");
    52     setValue("rnxIntr",             "1 day");
    53     setValue("rnxSampl",            "0");
    54     setValue("rnxSkel",             "SKL");
    55     setValue("rnxScript",           "");
    56     setValue("rnxV3",               "0");
    57 // RINEX Ephemeris
    58     setValue("ephPath",             "");
    59     setValue("ephIntr",             "1 day");
    60     setValue("outEphPort",          "");
    61     setValue("ephV3",               "0");
    62 // Braodcast Corrections
    63     setValue("corrPath",            "");
    64     setValue("corrIntr",            "1 day");
    65     setValue("corrPort",            "");
    66     setValue("corrTime",            "5");
    67 // Feed Engine
    68     setValue("outPort",             "");
    69     setValue("waitTime",            "5");
    70     setValue("binSampl",            "0");
    71     setValue("outFile",             "");
    72     setValue("outUPort",            "");
    73 // Serial Output
    74     setValue("serialMountPoint",    "");
    75     setValue("serialPortName",      "");
    76     setValue("serialBaudRate",      "9600");
    77     setValue("serialFlowControl",   "OFF");
    78     setValue("serialDataBits",      "8");
    79     setValue("serialParity",        "NONE");
    80     setValue("serialStopBits",      "1");
    81     setValue("serialAutoNMEA",      "Auto");
    82     setValue("serialFileNMEA",      "");
    83     setValue("serialHeightNMEA",    "");
    84 // Outages
    85     setValue("obsRate",             "");
    86     setValue("adviseFail",          "15");
    87     setValue("adviseReco",          "5");
    88     setValue("adviseScript",        "");
    89 // Miscellaneous
    90     setValue("miscMount",           ""); 
    91     setValue("perfIntr",            "");
    92     setValue("scanRTCM",            "0");
    93 // PPP
    94     setValue("pppSPP",              "");
    95     setValue("pppMount",            "");
    96     setValue("pppCorrMount",        "");
    97     setValue("pppRefCrdX",          "");
    98     setValue("pppRefCrdY",          "");
    99     setValue("pppRefCrdZ",          "");
    100     setValue("pppRefdN",            "");
    101     setValue("pppRefdE",            "");
    102     setValue("pppRefdU",            "");
    103     setValue("nmeaFile",            "");
    104     setValue("nmeaPort",            "");
    105     setValue("pppPlotCoordinates",  "");
    106     setValue("postObsFile",         "");
    107     setValue("postNavFile",         "");
    108     setValue("postCorrFile",        "");
    109     setValue("postOutFile",         "");
    110     setValue("pppAntenna",          "");
    111     setValue("pppAntex",            "");
    112     setValue("pppApplySatAnt",      "0");
    113     setValue("pppUsePhase",         "");
    114     setValue("pppEstTropo",         "");
    115     setValue("pppGLONASS",          "");
    116     setValue("pppGalileo",          "");
    117     setValue("pppSync",             "");
    118     setValue("pppAverage",          "");
    119     setValue("pppQuickStart",       "");
    120     setValue("pppMaxSolGap",        "");
    121     setValue("pppSigmaCode",        "10.0");
    122     setValue("pppSigmaPhase",       "0.02");
    123     setValue("pppSigCrd0",          "100.0");
    124     setValue("pppSigCrdP",          "100.0");
    125     setValue("pppSigTrp0",          "0.1");
    126     setValue("pppSigTrpP",          "3e-6");
    127 // Reqc
    128     setValue("reqcAction",          "");
    129     setValue("reqcObsFile",         "");
    130     setValue("reqcNavFile",         "");
    131     setValue("reqcOutObsFile",      "");
    132     setValue("reqcOutNavFile",      "");
    133     setValue("reqcOutLogFile",      "");
    134     setValue("reqcRnxVersion",      "");
    135     setValue("reqcSampling",        "");
    136     setValue("reqcStartDateTime",   "");
    137     setValue("reqcEndDateTime",     "");
    138     setValue("reqcOldMarkerName",   "");
    139     setValue("reqcNewMarkerName",   "");
    140     setValue("reqcOldAntennaName",  "");
    141     setValue("reqcNewAntennaName",  "");
    142     setValue("reqcOldReceiverName", "");
    143     setValue("reqcNewReceiverName", "");
    144 // Combination
    145     setValue("combineStreams",      "");
    146     setValue("cmbMethod",           "");
    147     setValue("cmbMaxres",           "");
    148 // Upload (clk)
    149     setValue("uploadMountpointsOut","");
    150     setValue("uploadIntr",          "1 day");
    151     setValue("uploadSampl",         "5");
    152     setValue("uploadSamplOrb",      "0");
    153     setValue("trafo_dx",            "");
    154     setValue("trafo_dy",            "");
    155     setValue("trafo_dz",            "");
    156     setValue("trafo_dxr",           "");
    157     setValue("trafo_dyr",           "");
    158     setValue("trafo_dzr",           "");
    159     setValue("trafo_ox",            "");
    160     setValue("trafo_oy",            "");
    161     setValue("trafo_oz",            "");
    162     setValue("trafo_oxr",           "");
    163     setValue("trafo_oyr",           "");
    164     setValue("trafo_ozr",           "");
    165     setValue("trafo_sc",            "");
    166     setValue("trafo_scr",           "");
    167     setValue("trafo_t0",            "");
    168 // Upload (eph)
    169     setValue("uploadEphHost",       "");
    170     setValue("uploadEphPort",       "");
    171     setValue("uploadEphMountpoint", "");
    172     setValue("uploadEphPassword",   "");
    173     setValue("uploadEphSample",     "5");
    174     sync();
     22bncSettings::bncSettings(bool noInit) {
     23
     24  _bncApp = static_cast<bncApp*>(qApp);
     25
     26  // First fill the options
     27  // ----------------------
     28  if (_bncApp->_settings.size() == 0) {
     29    QSettings settings(_bncApp->confFileName(), QSettings::IniFormat);
     30
     31    // Read from File
     32    // --------------
     33    if (settings.allKeys().size() > 0) {
     34      QStringListIterator it(settings.allKeys());
     35      while (it.hasNext()) {
     36        QString key = it.next();
     37        _bncApp->_settings[key] = settings.value(key);
     38      }
     39    }
     40
     41    // Set Defaults
     42    // ------------
     43    else if (!noInit) {
     44
     45    }
    17546  }
    17647}
    17748
    178 
     49// Destructor
     50////////////////////////////////////////////////////////////////////////////
     51bncSettings::~bncSettings() {
     52
     53}
     54
     55//
     56////////////////////////////////////////////////////////////////////////////
     57QVariant bncSettings::value(const QString& key,
     58                            const QVariant& defaultValue) const {
     59 
     60  if (_bncApp->_settings.contains(key)) {
     61    return _bncApp->_settings[key];
     62  }
     63  else {
     64    return defaultValue;
     65  }
     66}
     67
     68//
     69////////////////////////////////////////////////////////////////////////////
     70void bncSettings::setValue(const QString &key, const QVariant& value) {
     71  _bncApp->_settings[key] = value;
     72}
     73
     74//
     75////////////////////////////////////////////////////////////////////////////
     76void bncSettings::remove(const QString& key ) {
     77
     78}
     79
     80//
     81////////////////////////////////////////////////////////////////////////////
     82void bncSettings::sync() {
     83
     84}
     85
     86//   QSettings(((bncApp*) qApp)->confFileName(), QSettings::IniFormat) {
     87//
     88//   if (! noInit && allKeys().size() == 0) {
     89// //
     90//     setValue("startTab",            "0");
     91//     setValue("statusTab",           "0");
     92//     setValue("casterUrlList", (QStringList()
     93//                                << "http://user:pass@www.euref-ip.net:2101"
     94//                                << "http://user:pass@www.igs-ip.net:2101"
     95//                                << "http://user:pass@products.igs-ip.net:2101"
     96//                                << "http://user:pass@mgex.igs-ip.net:2101"));
     97//     setValue("mountPoints",         "");
     98//     setValue("ntripVersion",        "1");
     99// // Network
     100//     setValue("proxyHost",           "");
     101//     setValue("proxyPort",           "");
     102//     setValue("sslCaCertPath",       "");
     103//     setValue("ignoreSslErrors",     "0");
     104// // General
     105//     setValue("logFile",             "");
     106//     setValue("rnxAppend",           "0");
     107//     setValue("onTheFlyInterval",    "1 day");
     108//     setValue("autoStart",           "0");
     109//     setValue("rawOutFile",          "");
     110// // RINEX Observations
     111//     setValue("rnxPath",             "");
     112//     setValue("rnxIntr",             "1 day");
     113//     setValue("rnxSampl",            "0");
     114//     setValue("rnxSkel",             "SKL");
     115//     setValue("rnxScript",           "");
     116//     setValue("rnxV3",               "0");
     117// // RINEX Ephemeris
     118//     setValue("ephPath",             "");
     119//     setValue("ephIntr",             "1 day");
     120//     setValue("outEphPort",          "");
     121//     setValue("ephV3",               "0");
     122// // Braodcast Corrections
     123//     setValue("corrPath",            "");
     124//     setValue("corrIntr",            "1 day");
     125//     setValue("corrPort",            "");
     126//     setValue("corrTime",            "5");
     127// // Feed Engine
     128//     setValue("outPort",             "");
     129//     setValue("waitTime",            "5");
     130//     setValue("binSampl",            "0");
     131//     setValue("outFile",             "");
     132//     setValue("outUPort",            "");
     133// // Serial Output
     134//     setValue("serialMountPoint",    "");
     135//     setValue("serialPortName",      "");
     136//     setValue("serialBaudRate",      "9600");
     137//     setValue("serialFlowControl",   "OFF");
     138//     setValue("serialDataBits",      "8");
     139//     setValue("serialParity",        "NONE");
     140//     setValue("serialStopBits",      "1");
     141//     setValue("serialAutoNMEA",      "Auto");
     142//     setValue("serialFileNMEA",      "");
     143//     setValue("serialHeightNMEA",    "");
     144// // Outages
     145//     setValue("obsRate",             "");
     146//     setValue("adviseFail",          "15");
     147//     setValue("adviseReco",          "5");
     148//     setValue("adviseScript",        "");
     149// // Miscellaneous
     150//     setValue("miscMount",           ""); 
     151//     setValue("perfIntr",            "");
     152//     setValue("scanRTCM",            "0");
     153// // PPP
     154//     setValue("pppSPP",              "");
     155//     setValue("pppMount",            "");
     156//     setValue("pppCorrMount",        "");
     157//     setValue("pppRefCrdX",          "");
     158//     setValue("pppRefCrdY",          "");
     159//     setValue("pppRefCrdZ",          "");
     160//     setValue("pppRefdN",            "");
     161//     setValue("pppRefdE",            "");
     162//     setValue("pppRefdU",            "");
     163//     setValue("nmeaFile",            "");
     164//     setValue("nmeaPort",            "");
     165//     setValue("pppPlotCoordinates",  "");
     166//     setValue("postObsFile",         "");
     167//     setValue("postNavFile",         "");
     168//     setValue("postCorrFile",        "");
     169//     setValue("postOutFile",         "");
     170//     setValue("pppAntenna",          "");
     171//     setValue("pppAntex",            "");
     172//     setValue("pppApplySatAnt",      "0");
     173//     setValue("pppUsePhase",         "");
     174//     setValue("pppEstTropo",         "");
     175//     setValue("pppGLONASS",          "");
     176//     setValue("pppGalileo",          "");
     177//     setValue("pppSync",             "");
     178//     setValue("pppAverage",          "");
     179//     setValue("pppQuickStart",       "");
     180//     setValue("pppMaxSolGap",        "");
     181//     setValue("pppSigmaCode",        "10.0");
     182//     setValue("pppSigmaPhase",       "0.02");
     183//     setValue("pppSigCrd0",          "100.0");
     184//     setValue("pppSigCrdP",          "100.0");
     185//     setValue("pppSigTrp0",          "0.1");
     186//     setValue("pppSigTrpP",          "3e-6");
     187// // Reqc
     188//     setValue("reqcAction",          "");
     189//     setValue("reqcObsFile",         "");
     190//     setValue("reqcNavFile",         "");
     191//     setValue("reqcOutObsFile",      "");
     192//     setValue("reqcOutNavFile",      "");
     193//     setValue("reqcOutLogFile",      "");
     194//     setValue("reqcRnxVersion",      "");
     195//     setValue("reqcSampling",        "");
     196//     setValue("reqcStartDateTime",   "");
     197//     setValue("reqcEndDateTime",     "");
     198//     setValue("reqcOldMarkerName",   "");
     199//     setValue("reqcNewMarkerName",   "");
     200//     setValue("reqcOldAntennaName",  "");
     201//     setValue("reqcNewAntennaName",  "");
     202//     setValue("reqcOldReceiverName", "");
     203//     setValue("reqcNewReceiverName", "");
     204// // Combination
     205//     setValue("combineStreams",      "");
     206//     setValue("cmbMethod",           "");
     207//     setValue("cmbMaxres",           "");
     208// // Upload (clk)
     209//     setValue("uploadMountpointsOut","");
     210//     setValue("uploadIntr",          "1 day");
     211//     setValue("uploadSampl",         "5");
     212//     setValue("uploadSamplOrb",      "0");
     213//     setValue("trafo_dx",            "");
     214//     setValue("trafo_dy",            "");
     215//     setValue("trafo_dz",            "");
     216//     setValue("trafo_dxr",           "");
     217//     setValue("trafo_dyr",           "");
     218//     setValue("trafo_dzr",           "");
     219//     setValue("trafo_ox",            "");
     220//     setValue("trafo_oy",            "");
     221//     setValue("trafo_oz",            "");
     222//     setValue("trafo_oxr",           "");
     223//     setValue("trafo_oyr",           "");
     224//     setValue("trafo_ozr",           "");
     225//     setValue("trafo_sc",            "");
     226//     setValue("trafo_scr",           "");
     227//     setValue("trafo_t0",            "");
     228// // Upload (eph)
     229//     setValue("uploadEphHost",       "");
     230//     setValue("uploadEphPort",       "");
     231//     setValue("uploadEphMountpoint", "");
     232//     setValue("uploadEphPassword",   "");
     233//     setValue("uploadEphSample",     "5");
     234//     sync();
     235//   }
     236
     237
  • trunk/BNC/bncsettings.h

    r1769 r4070  
    44#include <QSettings>
    55
    6 class bncSettings : public QSettings {
     6class bncApp;
     7
     8class bncSettings {
    79 public:
    810  bncSettings(bool noInit = false);
    9   virtual ~bncSettings() {};
     11  ~bncSettings();
     12  QVariant value(const QString& key,
     13                 const QVariant& defaultValue = QVariant()) const;
     14  void setValue(const QString &key, const QVariant& value);
     15  void remove(const QString& key );
     16  void sync();
    1017 private:
     18  bncApp* _bncApp;
    1119};
    1220
  • trunk/BNC/bnctabledlg.cpp

    r3780 r4070  
    172172  bncSettings settings;
    173173  settings.setValue("ntripVersion", _ntripVersionComboBox->currentText());
    174   settings.sync();
    175174  delete _ntripVersionComboBox;
    176175  delete _buttonGet;
     
    512511  }
    513512  settings.setValue("casterUrlList", newUrlList);
    514   settings.sync();
    515513}
    516514
  • trunk/BNC/bncwindow.cpp

    r4066 r4070  
    13831383      settings.setValue("proxyHost",   _proxyHostLineEdit->text());
    13841384      settings.setValue("proxyPort",   _proxyPortLineEdit->text());
    1385       settings.sync();
    13861385    }
    13871386  }
     
    13891388  settings.setValue("sslCaCertPath",   _sslCaCertPathLineEdit->text());
    13901389  settings.setValue("ignoreSslErrors", _ignoreSslErrorsCheckBox->checkState());
    1391   settings.sync();
    13921390
    13931391  QMessageBox msgBox;
     
    17251723    _caster->slotReadMountPoints();
    17261724  }
    1727   settings.sync();
    17281725}
    17291726
     
    18441841  else if (iRet == QMessageBox::Yes) {
    18451842    slotSaveOptions();
     1843    bncSettings settings;
     1844    settings.sync();
    18461845  }
    18471846
  • trunk/BNC/reqcdlg.cpp

    r4061 r4070  
    226226  settings.setValue("reqcOldReceiverName", _reqcOldReceiverName->text());
    227227  settings.setValue("reqcNewReceiverName", _reqcNewReceiverName->text());
    228    
    229   settings.sync();
    230 }
     228}
Note: See TracChangeset for help on using the changeset viewer.