⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 commandinput.cpp

📁 linux的gps应用
💻 CPP
📖 第 1 页 / 共 4 页
字号:
      cout << "Found the debug switch" << endl;   }   else if(string(arg)==string("-v") || string(arg)==string("--verbose")) {      Verbose = true;      if(Debug) cout << "Found the verbose switch" << endl;   }   // undocumented shortcut   else if(string(arg).substr(0,7)==string("-AllOut")) {      string stem=string(arg).substr(7);      Args.push_back("--RAWFileOut"); Args.push_back("RAW" + stem);      Args.push_back("--PRSFileOut"); Args.push_back("PRS" + stem);      Args.push_back("--CLKFileOut"); Args.push_back("CLK" + stem);      Args.push_back("--RDDFileOut"); Args.push_back("RDD" + stem);      Args.push_back("--DDDFileOut"); Args.push_back("DDD" + stem);      Args.push_back("--TDDFileOut"); Args.push_back("TDD" + stem);      Args.push_back("--DDRFileOut"); Args.push_back("DDR" + stem);   }   else Args.push_back(arg);}catch(Exception& e) { GPSTK_RETHROW(e); }catch(exception& e) { Exception E("std except: "+string(e.what())); GPSTK_THROW(E); }catch(...) { Exception e("Unknown exception"); GPSTK_THROW(e); }}//------------------------------------------------------------------------------------int CommandInput::ValidateCmdInput(void){try {   bool ok=true,flag;   int i,n;   string site1,site2,msg;   vector<string> fixed,notfixed;   map<string,Station>::iterator it;      // data interval must be given   if(DataInterval == -1.0) {      cerr << "Input ERROR: data interval must be specified: --DT <t>. Abort.\n";      oflog << "Input ERROR: data interval must be specified: --DT <t>. Abort.\n";      ok = false;   }   if(BegTime > DayTime::BEGINNING_OF_TIME &&      EndTime < DayTime::END_OF_TIME &&      BegTime >= EndTime)   {      cerr << "Input ERROR: end time is at or before begin time. Abort.\n";      oflog << "Input ERROR: end time is at or before begin time. Abort.\n";      ok = false;   }   if(Frequency == 3 && FixBiases) {      msg = string("Input ERROR: Frequency L3 (--Freq L3) and bias fixing "         "(--FixBias) are inconsistent. Abort.\n");      cerr << msg;      oflog << msg;      ok = false;   }   if(MinElevation < 0.0 || MinElevation > 90.0) {      msg = "Input ERROR: Elevation limit (--MinElevation) is out of bounds: "         + StringUtils::asString(MinElevation,2) + " Abort.\n";      cerr << msg;      oflog << msg;      ok = false;   }   if(PRSMinElevation < 0.0 || PRSMinElevation > 90.0) {      msg = "Input ERROR: Elevation limit (--PRSMinElevation) is out of bounds: "         + StringUtils::asString(PRSMinElevation,2) + " Abort.\n";      cerr << msg;      oflog << msg;      ok = false;   }      // loop over stations      // make sure there is at least one fixed station, and one non-fixed.      // check weather, create trop model, etc   for(it=Stations.begin(); it != Stations.end(); it++) {      if(it->second.fixed) {         fixed.push_back(it->first);      }      else {         notfixed.push_back(it->first);      }         // check that ids do not contain '-' or '_'      if(it->first.find_first_of(string("-_")) != string::npos) {         cerr << "Input ERROR: station label " << it->first            << " invalid (must not contain '-' or '_'). Abort.\n";         oflog << "Input ERROR: station label " << it->first            << " invalid (must not contain '-' or '_'). Abort.\n";         ok = false;      }         // check that there is 1+ data files      for(n=0,i=0; i<ObsFileList.size(); i++)         if(ObsFileList[i].label == it->first) n++;      if(n==0) {         cerr << "Input ERROR: station " << it->first            << " has no observation data files. Abort.\n";         oflog << "Input ERROR: station " << it->first            << " has no observation data files. Abort.\n";         ok = false;      }         // check weather      if(it->second.temp == 0.0) it->second.temp = CI.DefaultTemp;      if(it->second.press == 0.0) it->second.press = CI.DefaultPress;      if(it->second.rhumid == 0.0) it->second.rhumid = CI.DefaultRHumid;      if(it->second.temp <= 0 || it->second.temp > 40 ||         it->second.press < 900. || it->second.press > 1050. ||         it->second.rhumid < 0 || it->second.rhumid > 100) {         cerr << "Input ERROR: station " << it->first            << " has invalid weather parameters. Abort.\n";         oflog << "Input ERROR: station " << it->first            << " has invalid weather parameters. Abort.\n";         ok = false;      }         // define the trop model for the estimation         // see dashtrop above "choices are 'Black','NewB','ModHop','ModHopH','Saas'"         // configure in Configure(2)      flag = true;      if(it->second.TropType == string("Saas")) {         it->second.pTropModel = new SaasTropModel;      }      else if(it->second.TropType == string("ModHop")) {         it->second.pTropModel = new GGTropModel;      }      else if(it->second.TropType == string("ModHopH")) {         it->second.pTropModel = new GGHeightTropModel;      }      else if(it->second.TropType == string("NewB")) {         it->second.pTropModel = new NBTropModel;      }      else if(it->second.TropType == string("Black")) {         it->second.pTropModel = new SimpleTropModel;      }      else if(it->second.TropType == string("Zero")) {         it->second.pTropModel = new ZeroTropModel;      }      else {         cerr << "Input ERROR: unknown trop model for station " << it->first            << " : " << it->second.TropType            << "\n   (choices are 'Black','NewB','ModHop','ModHopH','Saas')"            << ". Abort.\n";         oflog << "Input ERROR: unknown trop model for station " << it->first            << " : " << it->second.TropType            << "\n   (choices are 'Black','NewB','ModHop','ModHopH','Saas')"            << ". Abort.\n";         ok = flag = false;      }      if(flag && ! it->second.pTropModel) {         cerr << "Input ERROR: failed to allocate Trop model. Abort.\n";         oflog << "Input ERROR: failed to allocate Trop model. Abort.\n";         ok = false;      }      // test validity of stations -- is everything there?      // is position valid? TD check geodetic height - warn if not small      if(!it->second.usePRS && it->second.pos.getRadius() < 1.) {         oflog << "Input ERROR: station " << it->first            << " has undefined position. Abort.\n";         cerr << "Input ERROR: station " << it->first            << " has undefined position. Abort.\n";         ok = false;      }   }  // end loop over stations   if(fixed.size() == 0) {      cerr << "Input ERROR: at least one station must be fixed. Abort.\n";      oflog << "Input ERROR: at least one station must be fixed. Abort.\n";      ok = false;   }   // not true   //if(notfixed.size() == 0) {   //   cerr << "Input ERROR: at least one station must be not fixed. Abort.\n";   //   oflog << "Input ERROR: at least one station must be not fixed. Abort.\n";   //   ok = false;   //}      // make up the list of baselines for computation      // use first fixed site - all others ... can this matter?   for(i=1; i<fixed.size(); i++) {      Baselines.push_back(fixed[0] + string("-") + fixed[i]);      if(CI.Verbose)         oflog << " Compute baseline : " << Baselines[i] << endl;      if(CI.Screen)         cout << " Compute baseline : " << Baselines[i] << endl;   }   for(i=0; i<notfixed.size(); i++) {      Baselines.push_back(fixed[0] + string("-") + notfixed[i]);      if(CI.Verbose)          oflog << " Compute baseline : " << Baselines[i] << endl;      if(CI.Screen)         cout << " Compute baseline : " << Baselines[i] << endl;   }      // check that baselines for output are all valid   for(i=0; i<CI.OutputBaselines.size(); i++) {      site1 = StringUtils::word(CI.OutputBaselines[i],0,'-');      site2 = StringUtils::word(CI.OutputBaselines[i],1,'-');      if(  Stations.find(site1) == Stations.end()        || Stations.find(site2) == Stations.end()) {                  cerr << "Input ERROR: Invalid output baseline : '" << CI.OutputBaselines[i]               << "', station not found. Abort.\n";         oflog << "Input ERROR: Invalid output baseline : '" << CI.OutputBaselines[i]               << "', station not found. Abort.\n";         ok = false;      }   }   oflog << " ---- Input is " << (ok ? "" : "NOT ") << "valid ----\n";   if(CI.Screen) cout << " ---- Input is " << (ok ? "" : "NOT ") << "valid ----\n";   return (ok ? 0 : 1);}catch(Exception& e) { GPSTK_RETHROW(e); }catch(exception& e) { Exception E("std except: "+string(e.what())); GPSTK_THROW(E); }catch(...) { Exception e("Unknown exception"); GPSTK_THROW(e); }}//------------------------------------------------------------------------------------void CommandInput::Dump(std::ostream& ofs) const{try {   int i;   ofs << "Summary of command line input:" << endl;   if(Validate) ofs << " ------------ validate: this run will quit after "      << "validating the input ---------" << endl;   ofs << " Debug is " << (Debug ? "on":"off") << endl;   ofs << " Verbose is " << (Verbose ? "on":"off") << endl;   ofs << " Log file name is " << LogFile << endl;   if(!InputPath.empty()) ofs << " Path for input obs files is "      << InputPath << endl;   ofs << " Input Observation files are:\n";   for(i=0; i<ObsFileList.size(); i++)      ofs << "  " << ObsFileList[i].name         << " (station " << ObsFileList[i].label << ")" << endl;   if(!NavPath.empty()) ofs << " Path for input nav files is "      << NavPath << endl;   ofs << " Input Navigation files are:\n";   for(i=0; i<NavFileNames.size(); i++) ofs << "  " << NavFileNames[i]; ofs << endl;   if(!EOPPath.empty()) ofs << " Path for input earth orientation files is "      << EOPPath << endl;   if(EOPFileNames.size() > 0) {      ofs << " Input Earth orientation parameter files are:\n";      for(i=0; i<EOPFileNames.size(); i++)         ofs << "  " << EOPFileNames[i]; ofs << endl;   }   else      ofs << " No EOP files - DDBase will search for 'finals.daily'" << endl;   ofs << " Station list is:\n";   map<string,Station>::const_iterator it;   for(it=Stations.begin(); it != Stations.end(); it++) {      ofs << "  Station " << it->first         << " (" << (it->second.fixed ? "":"not ") << "fixed)" << endl;      ofs << "   Position:   " << it->second.pos.printf("%.4x %.4y %.4z m\n");      ofs << "   Position:   " << it->second.pos.printf("%A deg N %L deg E %h m\n");      if(it->second.usePRS)         ofs << "      (NB: use average PR solution to define this position.)\n";      ofs << "   Trop model: " << it->second.TropType << endl;      ofs << "   Weather:    " << fixed         << setprecision(1) << it->second.temp << " degC, "         << setprecision(2) << it->second.press << " mbar, "         << setprecision(1) << it->second.rhumid << " %" << endl;      //if(it->second.ant_azimuth != 0) ofs << "   Antenna orientation: "      //   << setprecision(2) << it->second.ant_azimuth << " deg" << endl;      ofs << "   Obs files: " << endl;      for(i=0; i<ObsFileList.size(); i++)         if(it->first == ObsFileList[i].label)            ofs << "      " << ObsFileList[i].name << endl;   }   ofs << " End of Station list.\n";   if(TimeTableFile.size() > 0)      ofs << " Input time table file name " << TimeTableFile << endl;   ofs << " Process L" << Frequency << " data." << endl;   if(BegTime > DayTime::BEGINNING_OF_TIME) ofs << " Begin time is "      << BegTime.printf("%Y/%m/%d %H:%02M:%6.3f = %F/%10.3g") << endl;   if(EndTime < DayTime::END_OF_TIME) ofs << " End   time is "      << EndTime.printf("%Y/%m/%d %H:%02M:%6.3f = %F/%10.3g") << endl;   ofs << " Set satellite " << RefSat << " as the reference in DDs" << endl;   if(noEstimate) ofs << " ** Estimation is turned OFF **" << endl;   if(noRAIM) ofs << " ** Pseudorange solution is turned OFF **" << endl;   ofs << " Set the number of iterations to " << nIter << endl;   ofs << " Set the convergence limit to "      << scientific << setprecision(3) << convergence << endl;   ofs << " On last iteration," << (FixBiases ? "" : " do not")      << " fix biases" << endl;   if(NRZDintervals > 0) {      ofs << " Estimate " << NRZDintervals         << " residual zenith delay intervals" << endl;      ofs << " RZD time constant is " << RZDtimeconst << " hours" << endl;      ofs << " RZD sigma is " << RZDsigma << " meters" << endl;   }   else ofs << " Do not estimate any residual zenith delay" << endl;   ofs << " A priori constraints, in ppm of the baseline:" << endl;   ofs << "  Loose : " << scientific << setprecision(2) << LooseConstraint << endl;   ofs << "  Tight : " << scientific << setprecision(2) << TightConstraint << endl;   ofs << " Pseudorange solution: iterations " << PRSnIter      << ", convergence " << scientific << setprecision(2) << PRSconverge      << ", " << (PRSalgebra ? "" : "do not ") << "use algebra," << endl      << "  RMS residual limit " << fixed << PRSrmsLimit      << ", elevation mask " << fixed << PRSMinElevation      << endl;   if(DataInterval != -1)      ofs << " Data interval is DT = "      << fixed << setprecision(2) << DataInterval << " seconds." << endl;   else      ofs << " ERROR -- data interval must be specified: --DT <t>" << endl;   ofs << " Maximum gap in data = " << MaxGap << " * DT" << endl;   ofs << " Minimum DD dataset length = " << MinDDSeg << endl;   ofs << " Phase bias reset limit is " << PhaseBiasReset << " cycles" << endl;   ofs << " Minimum elevation for DD data is "      << fixed << setw(6) << setprecision(2) << MinElevation << " degrees." << endl;   if(RotatedAntennaElevation > 0 || RotatedAntennaAzimuth > 0)      ofs << " Minimum elevation cutoff for antenna rotated through (el,az) = ("         << fixed << setprecision(2) << RotatedAntennaElevation         << "," << RotatedAntennaAzimuth << ") degrees." << endl;   if(ExSV.size()) {      ofs << " Exclude satellites :";      for(i=0; i<ExSV.size(); i++) ofs << " " << ExSV[i];      ofs << endl;   }   ofs << " Computed baselines :" << endl;   for(i=0; i<Baselines.size(); i++) ofs << "  " << Baselines[i] << endl;   if(CI.OutputBaselines.size()) {      ofs << " Output baselines :" << endl;      for(i=0; i<CI.OutputBaselines.size(); i++) {         ofs << "  " << CI.OutputBaselines[i] << setprecision(5);         Triple trip = CI.OutputBaselineOffsets[i];         if(trip.mag() < 0.01) ofs << " ...without offset";         else ofs << " with offset " << trip[0] << "," << trip[1] << "," << trip[2];         ofs << endl;      }   }   if(!OutputRawFile.empty())      ofs << " Output file name: " << OutputRawFile << " for raw data." << endl;   if(!OutputPRSFile.empty())      ofs << " Output file name: " << OutputPRSFile << " for PRS." << endl;   if(!OutputClkFile.empty())      ofs << " Output file name: " << OutputClkFile << " for clock bias." << endl;   if(!OutputRawDDFile.empty())      ofs << " Output file name: " << OutputRawDDFile << " for raw DD data." << endl;   if(!OutputDDDFile.empty())      ofs << " Output file name: " << OutputDDDFile << " for edited DD data." << endl;   if(!OutputDDRFile.empty())      ofs << " Output file name: " << OutputDDRFile<< " for DD post-fit residuals."          << endl;   if(!OutputTDDFile.empty())      ofs << " Output file name: " << OutputTDDFile << " for triple diff data."         << endl;   ofs << "End of command line input summary." << endl;}catch(Exception& e) { GPSTK_RETHROW(e); }catch(exception& e) { Exception E("std except: "+string(e.what())); GPSTK_THROW(E); }catch(...) { Exception e("Unknown exception"); GPSTK_THROW(e); }}//------------------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -