59 void AntennaStore::addAntenna(
const string& name,
AntexData& antdata)
68 map<string, AntexData>::iterator it;
69 it = antennaMap.find(name);
70 if (it != antennaMap.end())
76 antennaMap[name] = antdata;
82 bool AntennaStore::getAntenna(
const string& name,
AntexData& antdata)
84 map<string, AntexData>::iterator it;
85 it = antennaMap.find(name);
86 if (it != antennaMap.end())
110 bool AntennaStore::getSatelliteAntenna(
const char sys,
const int n,
114 map<string, AntexData>::const_iterator it;
115 for (it = antennaMap.begin(); it != antennaMap.end(); it++)
117 if (it->second.isRxAntenna)
121 if (it->second.systemChar != sys)
125 if (inputPRN && it->second.PRN == n)
131 if (!inputPRN && it->second.SVN == n)
142 void AntennaStore::getNames(vector<string>& names)
145 map<string, AntexData>::iterator it;
146 for (it = antennaMap.begin(); it != antennaMap.end(); it++)
147 names.push_back(it->first);
151 void AntennaStore::getReceiverNames(vector<string>& names)
154 map<string, AntexData>::iterator it;
155 for (it = antennaMap.begin(); it != antennaMap.end(); it++)
157 if (it->second.isRxAntenna)
159 names.push_back(it->first);
169 void AntennaStore::includeReceivers(vector<string>& names)
171 namesToInclude = names;
172 if (antennaMap.size() == 0)
178 map<string, AntexData>::iterator it;
179 vector<string> rejects;
180 for (it = antennaMap.begin(); it != antennaMap.end(); it++)
182 if (it->second.isRxAntenna)
185 for (j = 0; j < namesToInclude.size(); j++)
187 if (it->first == namesToInclude[j])
195 rejects.push_back(it->first);
199 for (j = 0; j < rejects.size(); j++)
200 antennaMap.erase(rejects[j]);
225 time.setTimeSystem(TimeSystem::Any);
226 time1 = time2 =
time;
229 time1 += double(2 * 86400);
230 time2 -= double(2 * 86400);
234 antstrm.
open(filename.c_str(), ios::in);
235 if (!antstrm.is_open())
237 Exception e(
"Could not open file " + filename);
240 antstrm.exceptions(fstream::failbit);
246 if (!anthdr.isValid())
258 Exception ge(
string(
"Std exception: ") + e.what());
285 string name = antdata.
name();
290 for (i = 0; i < namesToInclude.size(); i++)
292 if (name == namesToInclude[i])
294 addAntenna(name, antdata);
302 (includeSats == 1 && antdata.
systemChar ==
'G'))
306 addAntenna(name, antdata);
342 Triple AntennaStore::ComToPcVector(
const char sys,
const int n,
349 bool dualFrequency =
true;
352 if (getSatelliteAntenna(sys, n, name, antenna))
392 dualFrequency =
false;
401 ((154 * 154) / (116.5 * 116.5)) - 1.0;
402 fact1 = (alpha + 1.0) / alpha;
403 fact2 = -1.0 / alpha;
412 ss <<
"Invalid satellite system " << sys <<
" PRN " << n;
413 ss <<
" for AntennaStore::ComToPcVector.";
414 InvalidRequest ir(ss.str());
435 for (
int i = 0; i < 3;
437 PCO(i) = (fact1 * pco1[i] + fact2 * pco2[i]) / 1000.0;
443 for (
int i = 0; i < 3;
445 PCO(i) = (fact1 * pco1[i]) / 1000.0;
451 Triple pcoxyz =
Triple(SatPCOXYZ(0), SatPCOXYZ(1), SatPCOXYZ(2));
458 ss <<
"AntennaStore::ComToPcVector. No satellite data found for "
459 << sys <<
" PRN " << n;
460 InvalidRequest ir(ss.str());
478 case SatelliteSystem::GPS:
483 case SatelliteSystem::Galileo:
488 case SatelliteSystem::Glonass:
493 case SatelliteSystem::BeiDou:
501 ss <<
"Invalid satellite system " << sidr;
502 ss <<
" for AntennaStore::ComToPcVector.";
503 InvalidRequest ir(ss.str());
522 s <<
"Dump (" << (detail == 0 ?
"low" : (detail == 1 ?
"medium" :
"high"))
523 <<
" detail) of AntennaStore (" << antennaMap.size() <<
") antennas\n";
524 map<string, AntexData>::iterator it;
525 for (it = antennaMap.begin(); it != antennaMap.end(); it++)
531 it->second.dump(s, detail);
533 s <<
"End of dump of AntennaStore\n";