Changeset 5838 in ntrip for trunk/BNC/src/t_prn.cpp


Ignore:
Timestamp:
Aug 6, 2014, 3:42:49 PM (10 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/t_prn.cpp

    r5745 r5838  
    2929// Set from string
    3030////////////////////////////////////////////////////////////////////////////
    31 void t_prn::setValue(const std::string& str) {
     31void t_prn::set(const std::string& str) {
    3232  unsigned    prn    = 0;
    3333  char        system = '\x0';
     
    4242  }
    4343  else {
    44     throw "t_prn::setValue: wrong satellite ID: " + str;
     44    throw "t_prn::set: wrong satellite ID: " + str;
    4545  }
    4646
     
    4848  prn = strtol(number, &tmpc, 10);
    4949  if ( tmpc == number || *tmpc != '\x0' ) {
    50     throw "t_prn::setValue: wrong satellite ID: " + str;
     50    throw "t_prn::set: wrong satellite ID: " + str;
    5151  }
    5252
    5353  try {
    54     this->setValue(system, prn);
     54    this->set(system, prn);
    5555  }
    5656  catch (string exc) {
    57     throw "t_prn::setValue: wrong satellite ID: " + str;
    58   }
    59 }
    60 
    61 void t_prn::setValue(char system, unsigned prn) {
    62   _system = system;
    63   _number = prn;
    64   int maxprn = 0;
    65   switch (system) {
    66   case 'G':
    67     maxprn = MAXPRN_GPS;     
    68     break;
    69   case 'R':
    70     maxprn = MAXPRN_GLONASS;   
    71     break;
    72   default:
    73     throw "t_prn::setValue: wrong satellite system identifier";
    74     break;
    75   }
    76   if (_number > maxprn) {
    77     ostringstream msg;
    78     msg << "wrong satellite ID, system ID: " << system << " number: " << prn;
    79     throw "t_prn::setValue: " + msg.str();
     57    throw "t_prn::set: wrong satellite ID: " + str;
    8058  }
    8159}
     
    9775    str += str2;
    9876  }
    99   prn.setValue(str);
     77  prn.set(str);
    10078  return in;
    10179}
Note: See TracChangeset for help on using the changeset viewer.