Changeset 4251 in ntrip for trunk/BNC/bncsettings.cpp


Ignore:
Timestamp:
Jun 20, 2012, 5:41:29 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncsettings.cpp

    r4209 r4251  
    3232  // ----------------------
    3333  if (_bncApp->_settings.size() == 0) {
    34     QSettings settings(_bncApp->confFileName(), QSettings::IniFormat);
    35 
    36     // Read from File
    37     // --------------
    38     if (settings.allKeys().size() > 0) {
    39       QStringListIterator it(settings.allKeys());
    40       while (it.hasNext()) {
    41         QString key = it.next();
    42         _bncApp->_settings[key] = settings.value(key);
    43       }
     34    reRead();
     35  }
     36}
     37
     38// Destructor
     39////////////////////////////////////////////////////////////////////////////
     40bncSettings::~bncSettings() {
     41}
     42
     43// (Re-)read the Options from File or Set the Defaults
     44////////////////////////////////////////////////////////////////////////////
     45void bncSettings::reRead() {
     46
     47  _bncApp->_settings.clear();
     48
     49  QSettings settings(_bncApp->confFileName(), QSettings::IniFormat);
     50
     51  // Read from File
     52  // --------------
     53  if (settings.allKeys().size() > 0) {
     54    QStringListIterator it(settings.allKeys());
     55    while (it.hasNext()) {
     56      QString key = it.next();
     57      _bncApp->_settings[key] = settings.value(key);
    4458    }
    45 
    46     // Set Defaults
    47     // ------------
    48     else {
    49       setValue_p("startTab",            "0");
    50       setValue_p("statusTab",           "0");
    51       setValue_p("casterUrlList", (QStringList()
    52                                  << "http://user:pass@www.euref-ip.net:2101"
    53                                  << "http://user:pass@www.igs-ip.net:2101"
    54                                  << "http://user:pass@products.igs-ip.net:2101"
    55                                  << "http://user:pass@mgex.igs-ip.net:2101"));
    56       setValue_p("mountPoints",         "");
    57       setValue_p("ntripVersion",        "1");
    58       // Network
    59       setValue_p("proxyHost",           "");
    60       setValue_p("proxyPort",           "");
    61       setValue_p("sslCaCertPath",       "");
    62       setValue_p("ignoreSslErrors",     "0");
    63       // General
    64       setValue_p("logFile",             "");
    65       setValue_p("rnxAppend",           "0");
    66       setValue_p("onTheFlyInterval",    "1 day");
    67       setValue_p("autoStart",           "0");
    68       setValue_p("rawOutFile",          "");
    69       // RINEX Observations
    70       setValue_p("rnxPath",             "");
    71       setValue_p("rnxIntr",             "1 day");
    72       setValue_p("rnxSampl",            "0");
    73       setValue_p("rnxSkel",             "SKL");
    74       setValue_p("rnxScript",           "");
    75       setValue_p("rnxV3",               "0");
    76       // RINEX Ephemeris
    77       setValue_p("ephPath",             "");
    78       setValue_p("ephIntr",             "1 day");
    79       setValue_p("outEphPort",          "");
    80       setValue_p("ephV3",               "0");
    81       // Braodcast Corrections
    82       setValue_p("corrPath",            "");
    83       setValue_p("corrIntr",            "1 day");
    84       setValue_p("corrPort",            "");
    85       setValue_p("corrTime",            "5");
    86       // Feed Engine
    87       setValue_p("outPort",             "");
    88       setValue_p("waitTime",            "5");
    89       setValue_p("binSampl",            "0");
    90       setValue_p("outFile",             "");
    91       setValue_p("outUPort",            "");
    92       // Serial Output
    93       setValue_p("serialMountPoint",    "");
    94       setValue_p("serialPortName",      "");
    95       setValue_p("serialBaudRate",      "9600");
    96       setValue_p("serialFlowControl",   "OFF");
    97       setValue_p("serialDataBits",      "8");
    98       setValue_p("serialParity",        "NONE");
    99       setValue_p("serialStopBits",      "1");
    100       setValue_p("serialAutoNMEA",      "Auto");
    101       setValue_p("serialFileNMEA",      "");
    102       setValue_p("serialHeightNMEA",    "");
    103       // Outages
    104       setValue_p("obsRate",             "");
    105       setValue_p("adviseFail",          "15");
    106       setValue_p("adviseReco",          "5");
    107       setValue_p("adviseScript",        "");
    108       // Miscellaneous
    109       setValue_p("miscMount",           ""); 
    110       setValue_p("perfIntr",            "");
    111       setValue_p("scanRTCM",            "0");
    112       // PPP
    113       setValue_p("pppSPP",              "");
    114       setValue_p("pppMount",            "");
    115       setValue_p("pppCorrMount",        "");
    116       setValue_p("pppRefCrdX",          "");
    117       setValue_p("pppRefCrdY",          "");
    118       setValue_p("pppRefCrdZ",          "");
    119       setValue_p("pppRefdN",            "");
    120       setValue_p("pppRefdE",            "");
    121       setValue_p("pppRefdU",            "");
    122       setValue_p("nmeaFile",            "");
    123       setValue_p("nmeaPort",            "");
    124       setValue_p("pppPlotCoordinates",  "");
    125       setValue_p("postObsFile",         "");
    126       setValue_p("postNavFile",         "");
    127       setValue_p("postCorrFile",        "");
    128       setValue_p("postOutFile",         "");
    129       setValue_p("pppAntenna",          "");
    130       setValue_p("pppAntex",            "");
    131       setValue_p("pppUsePhase",         "");
    132       setValue_p("pppEstTropo",         "");
    133       setValue_p("pppGLONASS",          "");
    134       setValue_p("pppGalileo",          "");
    135       setValue_p("pppSync",             "");
    136       setValue_p("pppAverage",          "");
    137       setValue_p("pppQuickStart",       "");
    138       setValue_p("pppMaxSolGap",        "");
    139       setValue_p("pppSigmaCode",        "10.0");
    140       setValue_p("pppSigmaPhase",       "0.02");
    141       setValue_p("pppSigCrd0",          "100.0");
    142       setValue_p("pppSigCrdP",          "100.0");
    143       setValue_p("pppSigTrp0",          "0.1");
    144       setValue_p("pppSigTrpP",          "3e-6");
    145       // Reqc
    146       setValue_p("reqcAction",          "");
    147       setValue_p("reqcObsFile",         "");
    148       setValue_p("reqcNavFile",         "");
    149       setValue_p("reqcOutObsFile",      "");
    150       setValue_p("reqcOutNavFile",      "");
    151       setValue_p("reqcOutLogFile",      "");
    152       setValue_p("reqcRnxVersion",      "");
    153       setValue_p("reqcSampling",        "");
    154       setValue_p("reqcStartDateTime",   "");
    155       setValue_p("reqcEndDateTime",     "");
    156       setValue_p("reqcRunBy",           "");
    157       setValue_p("reqcComment",         "");
    158       setValue_p("reqcOldMarkerName",   "");
    159       setValue_p("reqcNewMarkerName",   "");
    160       setValue_p("reqcOldAntennaName",  "");
    161       setValue_p("reqcNewAntennaName",  "");
    162       setValue_p("reqcOldReceiverName", "");
    163       setValue_p("reqcNewReceiverName", "");
    164       // Combination
    165       setValue_p("combineStreams",      "");
    166       setValue_p("cmbMethod",           "");
    167       setValue_p("cmbMaxres",           "");
    168       setValue_p("cmbSampl",          "10");
    169       // Upload (clk)
    170       setValue_p("uploadMountpointsOut","");
    171       setValue_p("uploadIntr",          "1 day");
    172       setValue_p("uploadSamplRtcmEphCorr", "0");
    173       setValue_p("uploadSamplSp3",         "1");
    174       setValue_p("uploadSamplClkRnx",     "10");
    175       setValue_p("trafo_dx",            "");
    176       setValue_p("trafo_dy",            "");
    177       setValue_p("trafo_dz",            "");
    178       setValue_p("trafo_dxr",           "");
    179       setValue_p("trafo_dyr",           "");
    180       setValue_p("trafo_dzr",           "");
    181       setValue_p("trafo_ox",            "");
    182       setValue_p("trafo_oy",            "");
    183       setValue_p("trafo_oz",            "");
    184       setValue_p("trafo_oxr",           "");
    185       setValue_p("trafo_oyr",           "");
    186       setValue_p("trafo_ozr",           "");
    187       setValue_p("trafo_sc",            "");
    188       setValue_p("trafo_scr",           "");
    189       setValue_p("trafo_t0",            "");
    190       // Upload (eph)
    191       setValue_p("uploadEphHost",       "");
    192       setValue_p("uploadEphPort",       "");
    193       setValue_p("uploadEphMountpoint", "");
    194       setValue_p("uploadEphPassword",   "");
    195       setValue_p("uploadEphSample",     "5");
    196     }
    197   }
    198 }
    199 
    200 // Destructor
    201 ////////////////////////////////////////////////////////////////////////////
    202 bncSettings::~bncSettings() {
     59  }
     60
     61  // Set Defaults
     62  // ------------
     63  else {
     64    setValue_p("startTab",            "0");
     65    setValue_p("statusTab",           "0");
     66    setValue_p("casterUrlList", (QStringList()
     67                               << "http://user:pass@www.euref-ip.net:2101"
     68                               << "http://user:pass@www.igs-ip.net:2101"
     69                               << "http://user:pass@products.igs-ip.net:2101"
     70                               << "http://user:pass@mgex.igs-ip.net:2101"));
     71    setValue_p("mountPoints",         "");
     72    setValue_p("ntripVersion",        "1");
     73    // Network
     74    setValue_p("proxyHost",           "");
     75    setValue_p("proxyPort",           "");
     76    setValue_p("sslCaCertPath",       "");
     77    setValue_p("ignoreSslErrors",     "0");
     78    // General
     79    setValue_p("logFile",             "");
     80    setValue_p("rnxAppend",           "0");
     81    setValue_p("onTheFlyInterval",    "1 day");
     82    setValue_p("autoStart",           "0");
     83    setValue_p("rawOutFile",          "");
     84    // RINEX Observations
     85    setValue_p("rnxPath",             "");
     86    setValue_p("rnxIntr",             "1 day");
     87    setValue_p("rnxSampl",            "0");
     88    setValue_p("rnxSkel",             "SKL");
     89    setValue_p("rnxScript",           "");
     90    setValue_p("rnxV3",               "0");
     91    // RINEX Ephemeris
     92    setValue_p("ephPath",             "");
     93    setValue_p("ephIntr",             "1 day");
     94    setValue_p("outEphPort",          "");
     95    setValue_p("ephV3",               "0");
     96    // Braodcast Corrections
     97    setValue_p("corrPath",            "");
     98    setValue_p("corrIntr",            "1 day");
     99    setValue_p("corrPort",            "");
     100    setValue_p("corrTime",            "5");
     101    // Feed Engine
     102    setValue_p("outPort",             "");
     103    setValue_p("waitTime",            "5");
     104    setValue_p("binSampl",            "0");
     105    setValue_p("outFile",             "");
     106    setValue_p("outUPort",            "");
     107    // Serial Output
     108    setValue_p("serialMountPoint",    "");
     109    setValue_p("serialPortName",      "");
     110    setValue_p("serialBaudRate",      "9600");
     111    setValue_p("serialFlowControl",   "OFF");
     112    setValue_p("serialDataBits",      "8");
     113    setValue_p("serialParity",        "NONE");
     114    setValue_p("serialStopBits",      "1");
     115    setValue_p("serialAutoNMEA",      "Auto");
     116    setValue_p("serialFileNMEA",      "");
     117    setValue_p("serialHeightNMEA",    "");
     118    // Outages
     119    setValue_p("obsRate",             "");
     120    setValue_p("adviseFail",          "15");
     121    setValue_p("adviseReco",          "5");
     122    setValue_p("adviseScript",        "");
     123    // Miscellaneous
     124    setValue_p("miscMount",           ""); 
     125    setValue_p("perfIntr",            "");
     126    setValue_p("scanRTCM",            "0");
     127    // PPP
     128    setValue_p("pppSPP",              "");
     129    setValue_p("pppMount",            "");
     130    setValue_p("pppCorrMount",        "");
     131    setValue_p("pppRefCrdX",          "");
     132    setValue_p("pppRefCrdY",          "");
     133    setValue_p("pppRefCrdZ",          "");
     134    setValue_p("pppRefdN",            "");
     135    setValue_p("pppRefdE",            "");
     136    setValue_p("pppRefdU",            "");
     137    setValue_p("nmeaFile",            "");
     138    setValue_p("nmeaPort",            "");
     139    setValue_p("pppPlotCoordinates",  "");
     140    setValue_p("postObsFile",         "");
     141    setValue_p("postNavFile",         "");
     142    setValue_p("postCorrFile",        "");
     143    setValue_p("postOutFile",         "");
     144    setValue_p("pppAntenna",          "");
     145    setValue_p("pppAntex",            "");
     146    setValue_p("pppUsePhase",         "");
     147    setValue_p("pppEstTropo",         "");
     148    setValue_p("pppGLONASS",          "");
     149    setValue_p("pppGalileo",          "");
     150    setValue_p("pppSync",             "");
     151    setValue_p("pppAverage",          "");
     152    setValue_p("pppQuickStart",       "");
     153    setValue_p("pppMaxSolGap",        "");
     154    setValue_p("pppSigmaCode",        "10.0");
     155    setValue_p("pppSigmaPhase",       "0.02");
     156    setValue_p("pppSigCrd0",          "100.0");
     157    setValue_p("pppSigCrdP",          "100.0");
     158    setValue_p("pppSigTrp0",          "0.1");
     159    setValue_p("pppSigTrpP",          "3e-6");
     160    // Reqc
     161    setValue_p("reqcAction",          "");
     162    setValue_p("reqcObsFile",         "");
     163    setValue_p("reqcNavFile",         "");
     164    setValue_p("reqcOutObsFile",      "");
     165    setValue_p("reqcOutNavFile",      "");
     166    setValue_p("reqcOutLogFile",      "");
     167    setValue_p("reqcRnxVersion",      "");
     168    setValue_p("reqcSampling",        "");
     169    setValue_p("reqcStartDateTime",   "");
     170    setValue_p("reqcEndDateTime",     "");
     171    setValue_p("reqcRunBy",           "");
     172    setValue_p("reqcComment",         "");
     173    setValue_p("reqcOldMarkerName",   "");
     174    setValue_p("reqcNewMarkerName",   "");
     175    setValue_p("reqcOldAntennaName",  "");
     176    setValue_p("reqcNewAntennaName",  "");
     177    setValue_p("reqcOldReceiverName", "");
     178    setValue_p("reqcNewReceiverName", "");
     179    // Combination
     180    setValue_p("combineStreams",      "");
     181    setValue_p("cmbMethod",           "");
     182    setValue_p("cmbMaxres",           "");
     183    setValue_p("cmbSampl",          "10");
     184    // Upload (clk)
     185    setValue_p("uploadMountpointsOut","");
     186    setValue_p("uploadIntr",          "1 day");
     187    setValue_p("uploadSamplRtcmEphCorr", "0");
     188    setValue_p("uploadSamplSp3",         "1");
     189    setValue_p("uploadSamplClkRnx",     "10");
     190    setValue_p("trafo_dx",            "");
     191    setValue_p("trafo_dy",            "");
     192    setValue_p("trafo_dz",            "");
     193    setValue_p("trafo_dxr",           "");
     194    setValue_p("trafo_dyr",           "");
     195    setValue_p("trafo_dzr",           "");
     196    setValue_p("trafo_ox",            "");
     197    setValue_p("trafo_oy",            "");
     198    setValue_p("trafo_oz",            "");
     199    setValue_p("trafo_oxr",           "");
     200    setValue_p("trafo_oyr",           "");
     201    setValue_p("trafo_ozr",           "");
     202    setValue_p("trafo_sc",            "");
     203    setValue_p("trafo_scr",           "");
     204    setValue_p("trafo_t0",            "");
     205    // Upload (eph)
     206    setValue_p("uploadEphHost",       "");
     207    setValue_p("uploadEphPort",       "");
     208    setValue_p("uploadEphMountpoint", "");
     209    setValue_p("uploadEphPassword",   "");
     210    setValue_p("uploadEphSample",     "5");
     211  }
    203212}
    204213
Note: See TracChangeset for help on using the changeset viewer.