SinexTypes.cpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
44 #include "StringUtils.hpp"
45 #include "SinexTypes.hpp"
46 
47 using namespace gnsstk::StringUtils;
48 using namespace std;
49 
50 namespace gnsstk
51 {
52 namespace Sinex
53 {
54 
55  const std::string FileReference::BLOCK_TITLE("FILE/REFERENCE");
56  const size_t FileReference::MIN_LINE_LEN;
57  const size_t FileReference::MAX_LINE_LEN;
58 
59 
60  FileReference::operator std::string() const
61  {
62  try
63  {
64  ostringstream ss;
65  ss << DATA_START << formatStr(infoType, 18);
66  ss << ' ' << formatStr(infoValue, 60);
67  return ss.str();
68  }
69  catch (Exception& exc)
70  {
71  GNSSTK_RETHROW(exc);
72  }
73  } // FileReference::operator std::string()
74 
75 
76  void
77  FileReference::operator=(const std::string& line)
78  {
79  static int FIELD_DIVS[] = {0, 19, -1};
80  try
81  {
83  infoType = line.substr(1, 18);
84  infoValue = line.substr(20, 60);
85  }
86  catch (Exception& exc)
87  {
88  GNSSTK_RETHROW(exc);
89  }
90  } // FileReference::operator=()
91 
92 
93  void
94  FileReference::dump(std::ostream& s) const
95  {
96  s << BLOCK_TITLE << " :" << endl;
97  s << " infoType=" << infoType << endl;
98  s << " infoValue=" << infoValue << endl;
99 
100  } // FileReference::dump()
101 
102 
103  const std::string FileComment::BLOCK_TITLE("FILE/COMMENT");
104  const size_t FileComment::MIN_LINE_LEN;
105  const size_t FileComment::MAX_LINE_LEN;
106 
107 
108  FileComment::operator std::string() const
109  {
110  try
111  {
112  ostringstream ss;
113  ss << DATA_START << formatStr(comment, 79, true);
114  return ss.str();
115  }
116  catch (Exception& exc)
117  {
118  GNSSTK_RETHROW(exc);
119  }
120  } // FileComment::operator std::string()
121 
122 
123  void
124  FileComment::operator=(const std::string& line)
125  {
126  try
127  {
129  comment = line.substr(1, 79);
130  }
131  catch (Exception& exc)
132  {
133  GNSSTK_RETHROW(exc);
134  }
135  } // FileComment::operator=()
136 
137 
138  void
139  FileComment::dump(std::ostream& s) const
140  {
141  s << BLOCK_TITLE << " :" << endl;
142  s << " comment=" << comment << endl;
143 
144  } // FileComment::dump()
145 
146 
147  const std::string InputHistory::BLOCK_TITLE("INPUT/HISTORY");
148  const size_t InputHistory::MIN_LINE_LEN;
149  const size_t InputHistory::MAX_LINE_LEN;
150 
151  InputHistory::operator std::string() const
152  {
153  try
154  {
155  const Sinex::Header *ptr = this;
156  string header = (std::string)(*ptr);
157  header[0] = DATA_START;
158  header[1] = fileCode;
159  return header;
160  }
161  catch (Exception& exc)
162  {
163  GNSSTK_RETHROW(exc);
164  }
165  } // InputHistory::operator std::string()
166 
167 
168  void
169  InputHistory::operator=(const std::string& line)
170  {
171  if (line.size() > 1)
172  {
173  string header(line);
174  fileCode = header[1];
175  header[0] = HEAD_TAIL_START;
176  header[1] = '=';
177  try
178  {
180  }
181  catch (Exception& exc)
182  {
183  GNSSTK_RETHROW(exc);
184  }
185  }
186  else
187  {
188  ostringstream ss;
189  ss << "Missing data; inadequate line length ("
190  << line.size() << " < " << MIN_LINE_LEN << ")";
191  Exception exc(ss.str() );
192  GNSSTK_THROW(exc);
193  }
194  } // InputHistory::operator=()
195 
196 
197  void
198  InputHistory::dump(std::ostream& s) const
199  {
200  s << BLOCK_TITLE << " :" << endl;
201  s << " fileCode=" << fileCode << endl;
202  s << " version=" << version << endl;
203  s << " creationAgency=" << creationAgency << endl;
204  s << " dataAgency=" << dataAgency << endl;
205  s << " creationTime=" << (std::string)creationTime << endl;
206  s << " dataTimeStart=" << (std::string)dataTimeStart << endl;
207  s << " dataEndTime=" << (std::string)dataTimeEnd << endl;
208  s << " obsCode=" << obsCode << endl;
209  s << " constraintCode=" << constraintCode << endl;
210  s << " paramCount=" << paramCount << endl;
211  s << " solutionTypes=" << solutionTypes << endl;
212 
213  } // InputHistory::dump()
214 
215 
216  const std::string InputFile::BLOCK_TITLE("INPUT/FILES");
217  const size_t InputFile::MIN_LINE_LEN;
218  const size_t InputFile::MAX_LINE_LEN;
219 
220 
221  InputFile::operator std::string() const
222  {
223  try
224  {
225  ostringstream ss;
226  ss << DATA_START << formatStr(agencyCode, 3);
227  ss << ' ' << (std::string)creationTime;
228  ss << ' ' << formatStr(fileName, 29);
229  ss << ' ' << formatStr(fileDesc, 32);
230  return ss.str();
231  }
232  catch (Exception& exc)
233  {
234  GNSSTK_RETHROW(exc);
235  }
236  } // InputFile::operator std::string()
237 
238 
239  void
240  InputFile::operator=(const std::string& line)
241  {
242  static int FIELD_DIVS[] = {0, 4, 17, 47, -1};
243  try
244  {
245  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
246  agencyCode = line.substr(1, 3);
247  creationTime = line.substr(5, 12);
248  fileName = line.substr(18, 29);
249  fileDesc = line.substr(48, 32);
250  }
251  catch (Exception& exc)
252  {
253  GNSSTK_RETHROW(exc);
254  }
255  } // InputFile::operator=()
256 
257 
258  void
259  InputFile::dump(std::ostream& s) const
260  {
261  s << BLOCK_TITLE << " :" << endl;
262  s << " agencyCode=" << agencyCode << endl;
263  s << " creationTime=" << (std::string)creationTime << endl;
264  s << " fileName=" << fileName << endl;
265  s << " fileDesc=" << fileDesc << endl;
266 
267  } // InputFile::dump()
268 
269 
270  const std::string InputAck::BLOCK_TITLE("INPUT/ACKNOWLEDGMENTS");
271  const size_t InputAck::MIN_LINE_LEN;
272  const size_t InputAck::MAX_LINE_LEN;
273 
274 
275  InputAck::operator std::string() const
276  {
277  try
278  {
279  ostringstream ss;
280  ss << DATA_START << formatStr(agencyCode, 3);
281  ss << ' ' << formatStr(agencyDesc, 75);
282  return ss.str();
283  }
284  catch (Exception& exc)
285  {
286  GNSSTK_RETHROW(exc);
287  }
288  } // InputAck::operator std::string()
289 
290 
291  void
292  InputAck::operator=(const std::string& line)
293  {
294  static int FIELD_DIVS[] = {0, 4, -1};
295  try
296  {
297  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
298  agencyCode = line.substr(1, 3);
299  agencyDesc = line.substr(5, 75);
300  }
301  catch (Exception& exc)
302  {
303  GNSSTK_RETHROW(exc);
304  }
305  } // InputAck::operator=()
306 
307 
308  void
309  InputAck::dump(std::ostream& s) const
310  {
311  s << BLOCK_TITLE << " :" << endl;
312  s << " agencyCode=" << agencyCode << endl;
313  s << " agencyDesc=" << agencyDesc << endl;
314 
315  } // InputAck::dump()
316 
317 
318  const std::string NutationData::BLOCK_TITLE("NUTATION/DATA");
319  const size_t NutationData::MIN_LINE_LEN;
320  const size_t NutationData::MAX_LINE_LEN;
321 
322 
323  NutationData::operator std::string() const
324  {
325  try
326  {
327  ostringstream ss;
328  ss << DATA_START << formatStr(nutationCode, 8);
329  ss << ' ' << formatStr(nutationDesc, 70);
330  return ss.str();
331  }
332  catch (Exception& exc)
333  {
334  GNSSTK_RETHROW(exc);
335  }
336  } // NutationData::operator std::string()
337 
338 
339  void
340  NutationData::operator=(const std::string& line)
341  {
342  static int FIELD_DIVS[] = {0, 9, -1};
343  try
344  {
345  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
346  nutationCode = line.substr(1, 8);
347  nutationDesc = line.substr(10, 70);
348  }
349  catch (Exception& exc)
350  {
351  GNSSTK_RETHROW(exc);
352  }
353  } // NutationData::operator=()
354 
355 
356  void
357  NutationData::dump(std::ostream& s) const
358  {
359  s << BLOCK_TITLE << " :" << endl;
360  s << " nutationCode=" << nutationCode << endl;
361  s << " nutationDesc=" << nutationDesc << endl;
362 
363  } // NutationData::dump()
364 
365 
366  const std::string PrecessionData::BLOCK_TITLE("PRECESSION/DATA");
367  const size_t PrecessionData::MIN_LINE_LEN;
368  const size_t PrecessionData::MAX_LINE_LEN;
369 
370 
371  PrecessionData::operator std::string() const
372  {
373  try
374  {
375  ostringstream ss;
376  ss << DATA_START << formatStr(precessionCode, 8);
377  ss << ' ' << formatStr(precessionDesc, 70);
378  return ss.str();
379  }
380  catch (Exception& exc)
381  {
382  GNSSTK_RETHROW(exc);
383  }
384  } // Precession::operator std::string()
385 
386 
387  void
388  PrecessionData::operator=(const std::string& line)
389  {
390  static int FIELD_DIVS[] = {0, 9, -1};
391  try
392  {
393  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
394  precessionCode = line.substr(1, 8);
395  precessionDesc = line.substr(10, 70);
396  }
397  catch (Exception& exc)
398  {
399  GNSSTK_RETHROW(exc);
400  }
401  } // PrecessionData::operator=()
402 
403 
404  void
405  PrecessionData::dump(std::ostream& s) const
406  {
407  s << BLOCK_TITLE << " :" << endl;
408  s << " precessionCode=" << precessionCode << endl;
409  s << " precessionDesc=" << precessionDesc << endl;
410 
411  } // PrecessionData::dump()
412 
413 
414  const std::string SourceId::BLOCK_TITLE("SOURCE/ID");
415  const size_t SourceId::MIN_LINE_LEN;
416  const size_t SourceId::MAX_LINE_LEN;
417 
418 
419  SourceId::operator std::string() const
420  {
421  try
422  {
423  ostringstream ss;
424  ss << DATA_START << formatStr(sourceCode, 4);
425  ss << ' ' << formatStr(iers, 8);
426  ss << ' ' << formatStr(icrf, 16);
427  ss << ' ' << formatStr(comment, 48);
428  return ss.str();
429  }
430  catch (Exception& exc)
431  {
432  GNSSTK_RETHROW(exc);
433  }
434  } // SourceId::operator std::string()
435 
436 
437  void
438  SourceId::operator=(const std::string& line)
439  {
440  static int FIELD_DIVS[] = {0, 5, 14, 31, -1};
441  try
442  {
443  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
444  sourceCode = line.substr(1, 4);
445  iers = line.substr(6, 8);
446  icrf = line.substr(15, 16);
447  comment = line.substr(32, 48);
448  }
449  catch (Exception& exc)
450  {
451  GNSSTK_RETHROW(exc);
452  }
453  } // SourceId::operator=()
454 
455 
456  void
457  SourceId::dump(std::ostream& s) const
458  {
459  s << BLOCK_TITLE << " :" << endl;
460  s << " sourceCode=" << sourceCode << endl;
461  s << " iers=" << iers << endl;
462  s << " icrf=" << icrf << endl;
463  s << " comment=" << comment << endl;
464 
465  } // SourceId::dump()
466 
467 
468  const string SiteId::BLOCK_TITLE("SITE/ID");
469  const size_t SiteId::MIN_LINE_LEN;
470  const size_t SiteId::MAX_LINE_LEN;
471 
472 
473  SiteId::operator std::string() const
474  {
475  try
476  {
477  std::ostringstream ss;
478  ss << DATA_START << formatStr(siteCode, 4);
479  ss << ' ' << formatStr(pointCode, 2);
480  ss << ' ' << formatStr(monumentId, 9);
481  ss << ' ' << obsCode;
482  ss << ' ' << formatStr(siteDesc, 22);
483  ss << ' ' << formatUint(longitudeDeg, 3);
484  ss << ' ' << formatUint(longitudeMin, 2);
485  ss << ' ' << formatFixed(longitudeSec, 4, 1);
486  ss << ' ' << formatInt(latitudeDeg, 3);
487  ss << ' ' << formatUint(latitudeMin, 2);
488  ss << ' ' << formatFixed(latitudeSec, 4, 1);
489  ss << ' ' << formatFixed(height, 7, 1);
490  return ss.str();
491  }
492  catch (Exception& exc)
493  {
494  GNSSTK_RETHROW(exc);
495  }
496  } // SiteId::operator std::string()
497 
498 
499  void SiteId::operator=(const std::string& line)
500  {
501  static int FIELD_DIVS[] = {0, 5, 8, 18, 20, 43, 47, 50, 55, 59, 62, 67, -1};
502  try
503  {
504  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
505  siteCode = line.substr(1, 4);
506  pointCode = line.substr(6, 2);
507  monumentId = line.substr(9, 9);
508  obsCode = line[19];
509  isValidObsCode(obsCode);
510  siteDesc = line.substr(21, 22);
511  longitudeDeg = asUnsigned(line.substr(44, 3) );
512  longitudeMin = asUnsigned(line.substr(48, 2) );
513  longitudeSec = asFloat(line.substr(51, 4) );
514  latitudeDeg = asInt(line.substr(56, 3) );
515  latitudeMin = asUnsigned(line.substr(60, 2) );
516  latitudeSec = asFloat(line.substr(63, 4) );
517  height = asDouble(line.substr(68, 7) );
518  }
519  catch (Exception& exc)
520  {
521  GNSSTK_RETHROW(exc);
522  }
523  } // SiteId::operator=()
524 
525 
526  void SiteId::dump(ostream& s) const
527  {
528  s << BLOCK_TITLE << " :" << endl;
529  s << " siteCode=" << siteCode << endl;
530  s << " pointCode=" << pointCode << endl;
531  s << " monumentId=" << monumentId << endl;
532  s << " obsCode=" << obsCode << endl;
533  s << " siteDesc=" << siteDesc << endl;
534  s << " longitudeDeg=" << longitudeDeg << endl;
535  s << " longitudeMin=" << (uint16_t)longitudeMin << endl;
536  s << " longitudeSec=" << longitudeSec << endl;
537  s << " latitudeDeg=" << latitudeDeg << endl;
538  s << " latitudeMin=" << (uint16_t)latitudeMin << endl;
539  s << " latitudeSec=" << latitudeSec << endl;
540  s << " height=" << height << endl;
541 
542  } // SiteId::dump()
543 
544 
545  const string SiteData::BLOCK_TITLE("SITE/DATA");
546  const size_t SiteData::MIN_LINE_LEN;
547  const size_t SiteData::MAX_LINE_LEN;
548 
549 
550  SiteData::operator std::string() const
551  {
552  try
553  {
554  std::ostringstream ss;
555  ss << DATA_START << formatStr(siteCodeSol, 4);
556  ss << ' ' << formatStr(pointCodeSol, 2);
557  ss << ' ' << formatStr(solutionIdSol, 4);
558  ss << ' ' << formatStr(siteCodeInp, 4);
559  ss << ' ' << formatStr(pointCodeInp, 2);
560  ss << ' ' << formatStr(solutionIdInp, 4);
561  ss << ' ' << obsCode;
562  ss << ' ' << setw(12) << right << (std::string)timeStart;
563  ss << ' ' << setw(12) << right << (std::string)timeEnd;
564  ss << ' ' << formatStr(agencyCode, 3);
565  ss << ' ' << setw(12) << right << (std::string)creationTime;
566  return ss.str();
567  }
568  catch (Exception& exc)
569  {
570  GNSSTK_RETHROW(exc);
571  }
572  } // SiteData::operator std::string()
573 
574 
575  void SiteData::operator=(const std::string& line)
576  {
577  static int FIELD_DIVS[] = {0, 5, 8, 13, 18, 21, 26, 28, 41, 54, 58, -1};
578  try
579  {
580  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
581  siteCodeSol = line.substr(1, 4);
582  pointCodeSol = line.substr(6, 2);
583  solutionIdSol = line.substr(9, 4);
584  siteCodeInp = line.substr(14, 4);
585  pointCodeInp = line.substr(19, 2);
586  solutionIdInp = line.substr(22, 4);
587  obsCode = line[27];
588  isValidObsCode(obsCode);
589  timeStart = line.substr(29,12);
590  timeEnd = line.substr(42,12);
591  agencyCode = line.substr(55, 3);
592  creationTime = line.substr(59,12);
593  }
594  catch (Exception& exc)
595  {
596  GNSSTK_RETHROW(exc);
597  }
598  } // SiteData::operator=()
599 
600 
601  void SiteData::dump(ostream& s) const
602  {
603  s << BLOCK_TITLE << " :" << endl;
604  s << " siteCodeSol=" << siteCodeSol << endl;
605  s << " pointCodeSol=" << pointCodeSol << endl;
606  s << " solutionIdSol=" << solutionIdSol << endl;
607  s << " siteCodeInp=" << siteCodeInp << endl;
608  s << " pointCodeInp=" << pointCodeInp << endl;
609  s << " solutionIdInp=" << solutionIdInp << endl;
610  s << " obsCode=" << obsCode << endl;
611  s << " timeStart=" << (std::string)timeStart << endl;
612  s << " timeEnd=" << (std::string)timeEnd << endl;
613  s << " agencyCode=" << agencyCode << endl;
614  s << " creationTime=" << (std::string)creationTime << endl;
615 
616  } // SiteData::dump()
617 
618 
619  const string SiteReceiver::BLOCK_TITLE("SITE/RECEIVER");
620  const size_t SiteReceiver::MIN_LINE_LEN;
621  const size_t SiteReceiver::MAX_LINE_LEN;
622 
623 
624  SiteReceiver::operator std::string() const
625  {
626  try
627  {
628  std::ostringstream ss;
629  ss << DATA_START << formatStr(siteCode, 4);
630  ss << ' ' << formatStr(pointCode, 2);
631  ss << ' ' << formatStr(solutionId, 4);
632  ss << ' ' << obsCode;
633  ss << ' ' << setw(12) << right << (std::string)timeSince;
634  ss << ' ' << setw(12) << right << (std::string)timeUntil;
635  ss << ' ' << formatStr(rxType, 20);
636  ss << ' ' << formatStr(rxSerialNo, 5);
637  ss << ' ' << formatStr(rxFirmware, 11);
638  return ss.str();
639  }
640  catch (Exception& exc)
641  {
642  GNSSTK_RETHROW(exc);
643  }
644  } // SiteReceiver::operator std::string()
645 
646 
647  void SiteReceiver::operator=(const std::string& line)
648  {
649  static int FIELD_DIVS[] = {0, 5, 8, 13, 15, 28, 41, 62, 68, -1};
650  try
651  {
652  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
653  siteCode = line.substr(1, 4);
654  pointCode = line.substr(6, 2);
655  solutionId = line.substr(9, 4);
656  obsCode = line[14];
657  isValidObsCode(obsCode);
658  timeSince = line.substr(16,12);
659  timeUntil = line.substr(29,12);
660  rxType = line.substr(42, 20);
661  rxSerialNo = line.substr(63, 5);
662  rxFirmware = line.substr(69, 11);
663  }
664  catch (Exception& exc)
665  {
666  GNSSTK_RETHROW(exc);
667  }
668  } // SiteReceiver::operator=()
669 
670 
671  void SiteReceiver::dump(ostream& s) const
672  {
673  s << BLOCK_TITLE << " :" << endl;
674  s << " siteCode=" << siteCode << endl;
675  s << " pointCode=" << pointCode << endl;
676  s << " solutionId=" << solutionId << endl;
677  s << " obsCode=" << obsCode << endl;
678  s << " timeSince=" << (std::string)timeSince << endl;
679  s << " timeUntil=" << (std::string)timeUntil << endl;
680  s << " rxType=" << rxType << endl;
681  s << " rxSerialNo=" << rxSerialNo << endl;
682  s << " rxFirmware=" << rxFirmware << endl;
683 
684  } // SiteReceiver::dump()
685 
686 
687  const string SiteAntenna::BLOCK_TITLE("SITE/ANTENNA");
688  const size_t SiteAntenna::MIN_LINE_LEN;
689  const size_t SiteAntenna::MAX_LINE_LEN;
690 
691 
692  SiteAntenna::operator std::string() const
693  {
694  try
695  {
696  std::ostringstream ss;
697  ss << DATA_START << formatStr(siteCode, 4);
698  ss << ' ' << formatStr(pointCode, 2);
699  ss << ' ' << formatStr(solutionId, 4);
700  ss << ' ' << obsCode;
701  ss << ' ' << setw(12) << right << (std::string)timeSince;
702  ss << ' ' << setw(12) << right << (std::string)timeUntil;
703  ss << ' ' << formatStr(antennaType, 20);
704  ss << ' ' << formatStr(antennaSerialNo, 5);
705  return ss.str();
706  }
707  catch (Exception& exc)
708  {
709  GNSSTK_RETHROW(exc);
710  }
711  } // SiteAntenna::operator std::string()
712 
713 
714  void SiteAntenna::operator=(const std::string& line)
715  {
716  static int FIELD_DIVS[] = {0, 5, 8, 13, 15, 28, 41, 62, -1};
717  try
718  {
719  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
720  siteCode = line.substr(1, 4);
721  pointCode = line.substr(6, 2);
722  solutionId = line.substr(9, 4);
723  obsCode = line[14];
724  isValidObsCode(obsCode);
725  timeSince = line.substr(16,12);
726  timeUntil = line.substr(29,12);
727  antennaType = line.substr(42, 20);
728  antennaSerialNo = line.substr(63, 5);
729  }
730  catch (Exception& exc)
731  {
732  GNSSTK_RETHROW(exc);
733  }
734  } // SiteAntenna::operator=()
735 
736 
737  void SiteAntenna::dump(ostream& s) const
738  {
739  s << BLOCK_TITLE << " :" << endl;
740  s << " siteCode=" << siteCode << endl;
741  s << " pointCode=" << pointCode << endl;
742  s << " solutionId=" << solutionId << endl;
743  s << " obsCode=" << obsCode << endl;
744  s << " timeSince=" << (std::string)timeSince << endl;
745  s << " timeUntil=" << (std::string)timeUntil << endl;
746  s << " antennaType=" << antennaType << endl;
747  s << " antennaSerialNo=" << antennaSerialNo << endl;
748 
749  } // SiteAntenna::dump()
750 
751 
752  const size_t SitePhaseCenter::MIN_LINE_LEN;
753  const size_t SitePhaseCenter::MAX_LINE_LEN;
754 
755 
756  SitePhaseCenter::operator std::string() const
757  {
758  try
759  {
760  std::ostringstream ss;
761  ss << DATA_START << formatStr(antennaType, 20);
762  ss << ' ' << formatStr(antennaSerialNo, 5);
763  ss << ' ' << formatFixed(offsetA[0], 6, 4);
764  ss << ' ' << formatFixed(offsetA[1], 6, 4);
765  ss << ' ' << formatFixed(offsetA[2], 6, 4);
766  ss << ' ' << formatFixed(offsetB[0], 6, 4);
767  ss << ' ' << formatFixed(offsetB[1], 6, 4);
768  ss << ' ' << formatFixed(offsetB[2], 6, 4);
769  ss << ' ' << formatStr(antennaCalibration, 10);
770  return ss.str();
771  }
772  catch (Exception& exc)
773  {
774  GNSSTK_RETHROW(exc);
775  }
776  } // SitePhaseCenter::operator std::string()
777 
778 
779  void SitePhaseCenter::operator=(const std::string& line)
780  {
781  static int FIELD_DIVS[] = {0, 21, 27, 34, 41, 48, 55, 62, 69, -1};
782  try
783  {
784  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
785  antennaType = line.substr(1, 20);
786  antennaSerialNo = line.substr(22, 5);
787  offsetA[0] = asDouble(line.substr(28, 6) );
788  offsetA[1] = asDouble(line.substr(35, 6) );
789  offsetA[2] = asDouble(line.substr(42, 6) );
790  offsetB[0] = asDouble(line.substr(49, 6) );
791  offsetB[1] = asDouble(line.substr(56, 6) );
792  offsetB[2] = asDouble(line.substr(63, 6) );
793  antennaCalibration = line.substr(70, 10);
794  }
795  catch (Exception& exc)
796  {
797  GNSSTK_RETHROW(exc);
798  }
799  } // SitePhaseCenter::operator=()
800 
801 
802  void SitePhaseCenter::dump(ostream& s) const
803  {
804  s << " antennaType=" << antennaType << endl;
805  s << " antennaSerialNo=" << antennaSerialNo << endl;
806  s << " offsetA_Up=" << offsetA[0] << endl;
807  s << " offsetA_North=" << offsetA[1] << endl;
808  s << " offsetA_East=" << offsetA[2] << endl;
809  s << " offsetB_Up=" << offsetB[0] << endl;
810  s << " offsetB_North=" << offsetB[1] << endl;
811  s << " offsetB_East=" << offsetB[2] << endl;
812  s << " antennaCalibration=" << antennaCalibration << endl;
813 
814  } // SitePhaseCenter::dump()
815 
816 
817  const string SiteGpsPhaseCenter::BLOCK_TITLE("SITE/GPS_PHASE_CENTER");
818 
819 
820  void SiteGpsPhaseCenter::dump(ostream& s) const
821  {
822  s << BLOCK_TITLE << " :" << endl;
824 
825  } // SiteGpsPhaseCenter::dump()
826 
827 
828  const string SiteGalPhaseCenter::BLOCK_TITLE("SITE/GAL_PHASE_CENTER");
829 
830 
831  void SiteGalPhaseCenter::dump(ostream& s) const
832  {
833  s << BLOCK_TITLE << " :" << endl;
835 
836  } // SiteGalPhaseCenter::dump()
837 
838 
839  const string SiteEccentricity::BLOCK_TITLE("SITE/ECCENTRICITY");
840  const size_t SiteEccentricity::MIN_LINE_LEN;
841  const size_t SiteEccentricity::MAX_LINE_LEN;
842 
843 
844  SiteEccentricity::operator std::string() const
845  {
846  try
847  {
848  std::ostringstream ss;
849  ss << DATA_START << formatStr(siteCode, 4);
850  ss << ' ' << formatStr(pointCode, 2);
851  ss << ' ' << formatStr(solutionId, 4);
852  ss << ' ' << obsCode;
853  ss << ' ' << setw(12) << right << (std::string)timeSince;
854  ss << ' ' << setw(12) << right << (std::string)timeUntil;
855  ss << ' ' << formatStr(refSystem, 3);
856  ss << ' ' << formatFixed(eccentricity[0], 8, 4);
857  ss << ' ' << formatFixed(eccentricity[1], 8, 4);
858  ss << ' ' << formatFixed(eccentricity[2], 8, 4);
859  return ss.str();
860  }
861  catch (Exception& exc)
862  {
863  GNSSTK_RETHROW(exc);
864  }
865  } // SiteEccentricity::operator std::string()
866 
867 
868  void SiteEccentricity::operator=(const std::string& line)
869  {
870  static int FIELD_DIVS[] = {0, 5, 8, 13, 15, 28, 41, 45, 54, 63, -1};
871  try
872  {
873  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
874  siteCode = line.substr(1, 4);
875  pointCode = line.substr(6, 2);
876  solutionId = line.substr(9, 4);
877  obsCode = line[14];
878  isValidObsCode(obsCode);
879  timeSince = line.substr(16,12);
880  timeUntil = line.substr(29,12);
881  refSystem = line.substr(42, 3);
882  eccentricity[0] = asDouble(line.substr(46, 8) );
883  eccentricity[1] = asDouble(line.substr(55, 8) );
884  eccentricity[2] = asDouble(line.substr(64, 8) );
885  }
886  catch (Exception& exc)
887  {
888  GNSSTK_RETHROW(exc);
889  }
890  } // SiteEccentricity::operator=()
891 
892 
893  void SiteEccentricity::dump(ostream& s) const
894  {
895  s << BLOCK_TITLE << " :" << endl;
896  s << " siteCode=" << siteCode << endl;
897  s << " pointCode=" << pointCode << endl;
898  s << " solutionId=" << solutionId << endl;
899  s << " obsCode=" << obsCode << endl;
900  s << " timeSince=" << (std::string)timeSince << endl;
901  s << " timeUntil=" << (std::string)timeUntil << endl;
902  s << " refSystem=" << refSystem << endl;
903  s << " uX=" << eccentricity[0] << endl;
904  s << " nY=" << eccentricity[1] << endl;
905  s << " eZ=" << eccentricity[2] << endl;
906 
907  } // SiteEccentricity::dump()
908 
909 
910  const string SatelliteId::BLOCK_TITLE("SATELLITE/ID");
911  const size_t SatelliteId::MIN_LINE_LEN;
912  const size_t SatelliteId::MAX_LINE_LEN;
913 
914 
915  SatelliteId::operator std::string() const
916  {
917  try
918  {
919  std::ostringstream ss;
920  ss << DATA_START << formatStr(svCode, 4);
921  ss << ' ' << formatStr(prn, 2);
922  ss << ' ' << formatStr(cosparId, 9);
923  ss << ' ' << obsCode;
924  ss << ' ' << setw(12) << right << (std::string)timeSince;
925  ss << ' ' << setw(12) << right << (std::string)timeUntil;
926  ss << ' ' << formatStr(antennaType, 20);
927  return ss.str();
928  }
929  catch (Exception& exc)
930  {
931  GNSSTK_RETHROW(exc);
932  }
933  } // SatelliteId::operator std::string()
934 
935 
936  void SatelliteId::operator=(const std::string& line)
937  {
938  static int FIELD_DIVS[] = {0, 5, 8, 18, 20, 33, 46, -1};
939  try
940  {
941  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
942  svCode = line.substr(1, 4);
943  prn = line.substr(6, 2);
944  cosparId = line.substr(9, 9);
945  obsCode = line[19];
946  isValidObsCode(obsCode);
947  timeSince = line.substr(21,12);
948  timeUntil = line.substr(34,12);
949  antennaType = line.substr(47, 20);
950  }
951  catch (Exception& exc)
952  {
953  GNSSTK_RETHROW(exc);
954  }
955  } // SatelliteId::operator=()
956 
957 
958  void SatelliteId::dump(ostream& s) const
959  {
960  s << BLOCK_TITLE << " :" << endl;
961  s << " svCode=" << svCode << endl;
962  s << " prn=" << prn << endl;
963  s << " cosparId=" << cosparId << endl;
964  s << " obsCode=" << obsCode << endl;
965  s << " timeSince=" << (std::string)timeSince << endl;
966  s << " timeUntil=" << (std::string)timeUntil << endl;
967  s << " antennaType=" << antennaType << endl;
968 
969  } // SatelliteId::dump()
970 
971 
972  const string SatellitePhaseCenter::BLOCK_TITLE("SATELLITE/PHASE_CENTER");
975 
976 
977  SatellitePhaseCenter::operator std::string() const
978  {
979  try
980  {
981  std::ostringstream ss;
982  ss << DATA_START << formatStr(svCode, 4);
983  ss << ' ' << freqCodeA;
984  ss << ' ' << formatFixed(offsetA[2], 6, 4);
985  ss << ' ' << formatFixed(offsetA[0], 6, 4);
986  ss << ' ' << formatFixed(offsetA[1], 6, 4);
987  ss << ' ' << freqCodeB;
988  ss << ' ' << formatFixed(offsetB[2], 6, 4);
989  ss << ' ' << formatFixed(offsetB[0], 6, 4);
990  ss << ' ' << formatFixed(offsetB[1], 6, 4);
991  ss << ' ' << formatStr(antennaCalibration, 10);
992  ss << ' ' << pcvType;
993  ss << ' ' << pcvModel;
994  return ss.str();
995  }
996  catch (Exception& exc)
997  {
998  GNSSTK_RETHROW(exc);
999  }
1000  } // SatellitePhaseCenter::operator std::string()
1001 
1002 
1003  void SatellitePhaseCenter::operator=(const std::string& line)
1004  {
1005  static int FIELD_DIVS[] = {0, 5, 7, 14, 21, 28, 30, 37, 44, 51, 62, 64, -1};
1006  try
1007  {
1008  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
1009  svCode = line.substr(1, 4);
1010  freqCodeA = line[6];
1011  offsetA[2] = asDouble(line.substr(8, 6) );
1012  offsetA[0] = asDouble(line.substr(15, 6) );
1013  offsetA[1] = asDouble(line.substr(22, 6) );
1014  freqCodeB = line[29];
1015  offsetB[2] = asDouble(line.substr(31, 6) );
1016  offsetB[0] = asDouble(line.substr(38, 6) );
1017  offsetB[1] = asDouble(line.substr(45, 6) );
1018  antennaCalibration = line.substr(52, 10);
1019  pcvType = line[63];
1020  pcvModel = line[65];
1021  }
1022  catch (Exception& exc)
1023  {
1024  GNSSTK_RETHROW(exc);
1025  }
1026  } // SatellitePhaseCenter::operator=()
1027 
1028 
1029  void SatellitePhaseCenter::dump(ostream& s) const
1030  {
1031  s << BLOCK_TITLE << " :" << endl;
1032  s << " svCode=" << svCode << endl;
1033  s << " freqCodeA=" << freqCodeA << endl;
1034  s << " offsetA.x=" << formatFixed(offsetA[0], 6, 4) << endl;
1035  s << " offsetA.y=" << formatFixed(offsetA[1], 6, 4) << endl;
1036  s << " offsetA.z=" << formatFixed(offsetA[2], 6, 4) << endl;
1037  s << " freqCodeB=" << freqCodeB << endl;
1038  s << " offsetB.x=" << formatFixed(offsetB[0], 6, 4) << endl;
1039  s << " offsetB.y=" << formatFixed(offsetB[1], 6, 4) << endl;
1040  s << " offsetB.z=" << formatFixed(offsetB[2], 6, 4) << endl;
1041  s << " antennaCalibration=" << antennaCalibration << endl;
1042  s << " pcvType=" << pcvType << endl;
1043  s << " pcvModel=" << pcvModel << endl;
1044 
1045  } // SatellitePhaseCenter::dump()
1046 
1047 
1048  const string BiasEpoch::BLOCK_TITLE("BIAS/EPOCHS");
1049  const size_t BiasEpoch::MIN_LINE_LEN;
1050  const size_t BiasEpoch::MAX_LINE_LEN;
1051 
1052 
1053  BiasEpoch::operator std::string() const
1054  {
1055  try
1056  {
1057  std::ostringstream ss;
1058  ss << DATA_START << formatStr(siteCode, 4);
1059  ss << ' ' << formatStr(pointCode, 2);
1060  ss << ' ' << formatStr(solutionId, 4);
1061  ss << ' ' << biasType;
1062  ss << ' ' << setw(12) << right << (std::string)firstTime;
1063  ss << ' ' << setw(12) << right << (std::string)lastTime;
1064  ss << ' ' << setw(12) << right << (std::string)meanTime;
1065  return ss.str();
1066  }
1067  catch (Exception& exc)
1068  {
1069  GNSSTK_RETHROW(exc);
1070  }
1071  } // BiasEpoch::operator std::string()
1072 
1073 
1074  void BiasEpoch::operator=(const std::string& line)
1075  {
1076  static int FIELD_DIVS[] = {0, 5, 8, 13, 15, 28, 41, -1};
1077  try
1078  {
1079  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
1080  siteCode = line.substr(1, 4);
1081  pointCode = line.substr(6, 2);
1082  solutionId = line.substr(9, 4);
1083  biasType = line[14];
1084  firstTime = line.substr(16,12);
1085  lastTime = line.substr(29,12);
1086  meanTime = line.substr(42,12);
1087  }
1088  catch (Exception& exc)
1089  {
1090  GNSSTK_RETHROW(exc);
1091  }
1092  } // BiasEpoch::operator=()
1093 
1094 
1095  void BiasEpoch::dump(ostream& s) const
1096  {
1097  s << BLOCK_TITLE << " :" << endl;
1098  s << " siteCode=" << siteCode << endl;
1099  s << " pointCode=" << pointCode << endl;
1100  s << " solutionId=" << solutionId << endl;
1101  s << " biasType=" << biasType << endl;
1102  s << " firstTime=" << (std::string)firstTime << endl;
1103  s << " lastTime=" << (std::string)lastTime << endl;
1104  s << " meanTime=" << (std::string)meanTime << endl;
1105 
1106  } // BiasEpoch::dump()
1107 
1108 
1109  const string SolutionStatistics::BLOCK_TITLE("SOLUTION/STATISTICS");
1110  const size_t SolutionStatistics::MIN_LINE_LEN;
1111  const size_t SolutionStatistics::MAX_LINE_LEN;
1112 
1113 
1114  SolutionStatistics::operator std::string() const
1115  {
1116  try
1117  {
1118  ostringstream ss;
1119  ss << DATA_START << formatStr(infoType, 30);
1120  ss << ' ' << formatFixed(infoValue, 22, 15);
1121  return ss.str();
1122  }
1123  catch (Exception& exc)
1124  {
1125  GNSSTK_RETHROW(exc);
1126  }
1127  } // SolutionStatistics::operator std::string()
1128 
1129 
1130  void
1131  SolutionStatistics::operator=(const std::string& line)
1132  {
1133  static int FIELD_DIVS[] = {0, 31, -1};
1134  try
1135  {
1136  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
1137  infoType = line.substr(1, 30);
1138  infoValue = asLongDouble(line.substr(32, 22) );
1139  }
1140  catch (Exception& exc)
1141  {
1142  GNSSTK_RETHROW(exc);
1143  }
1144  } // SolutionStatistics::operator=()
1145 
1146 
1147  void
1148  SolutionStatistics::dump(std::ostream& s) const
1149  {
1150  s << BLOCK_TITLE << " :" << endl;
1151  s << " infoType=" << infoType << endl;
1152  s << " infoValue=" << infoValue << endl;
1153 
1154  } // SolutionStatistics::dump()
1155 
1156 
1157  const string SolutionEpoch::BLOCK_TITLE("SOLUTION/EPOCHS");
1158  const size_t SolutionEpoch::MIN_LINE_LEN;
1159  const size_t SolutionEpoch::MAX_LINE_LEN;
1160 
1161 
1162  SolutionEpoch::operator std::string() const
1163  {
1164  try
1165  {
1166  std::ostringstream ss;
1167  ss << DATA_START << formatStr(siteCode, 4);
1168  ss << ' ' << formatStr(pointCode, 2);
1169  ss << ' ' << formatStr(solutionId, 4);
1170  ss << ' ' << obsCode;
1171  ss << ' ' << setw(12) << right << (std::string)startTime;
1172  ss << ' ' << setw(12) << right << (std::string)endTime;
1173  ss << ' ' << setw(12) << right << (std::string)meanTime;
1174  return ss.str();
1175  }
1176  catch (Exception& exc)
1177  {
1178  GNSSTK_RETHROW(exc);
1179  }
1180  } // SolutionEpoch::operator std::string()
1181 
1182 
1183  void SolutionEpoch::operator=(const std::string& line)
1184  {
1185  static int FIELD_DIVS[] = {0, 5, 8, 13, 15, 28, 41, -1};
1186  try
1187  {
1188  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
1189  siteCode = line.substr(1, 4);
1190  pointCode = line.substr(6, 2);
1191  solutionId = line.substr(9, 4);
1192  obsCode = line[14];
1193  isValidObsCode(obsCode);
1194  startTime = line.substr(16,12);
1195  endTime = line.substr(29,12);
1196  meanTime = line.substr(42,12);
1197  }
1198  catch (Exception& exc)
1199  {
1200  GNSSTK_RETHROW(exc);
1201  }
1202  } // SolutionEpoch::operator=()
1203 
1204 
1205  void SolutionEpoch::dump(ostream& s) const
1206  {
1207  s << BLOCK_TITLE << " :" << endl;
1208  s << " siteCode=" << siteCode << endl;
1209  s << " pointCode=" << pointCode << endl;
1210  s << " solutionId=" << solutionId << endl;
1211  s << " obsCode=" << obsCode << endl;
1212  s << " startTime=" << (std::string)startTime << endl;
1213  s << " endTime=" << (std::string)endTime << endl;
1214  s << " meanTime=" << (std::string)meanTime << endl;
1215 
1216  } // SolutionEpoch::dump()
1217 
1218 
1219  const string SolutionEstimate::BLOCK_TITLE("SOLUTION/ESTIMATE");
1220  const size_t SolutionEstimate::MIN_LINE_LEN;
1221  const size_t SolutionEstimate::MAX_LINE_LEN;
1222 
1223 
1224  SolutionEstimate::operator std::string() const
1225  {
1226  try
1227  {
1228  std::ostringstream ss;
1229  ss << DATA_START << formatUint(paramIndex, 5);
1230  ss << ' ' << formatStr(paramType, 6);
1231  ss << ' ' << formatStr(siteCode, 4);
1232  ss << ' ' << formatStr(pointCode, 2);
1233  ss << ' ' << formatStr(solutionId, 4);
1234  ss << ' ' << setw(12) << right << (std::string)epoch;
1235  ss << ' ' << formatStr(paramUnits, 4);
1236  ss << ' ' << constraintCode;
1237  ss << ' ' << formatFor(paramEstimate, 21, 2);
1238  // Erase extra leading space for '-' since StdDev is non-negative
1239  ss << ' ' << formatFor(paramStdDev, 12, 2).erase(0, 1);
1240  return ss.str();
1241  }
1242  catch (Exception& exc)
1243  {
1244  GNSSTK_RETHROW(exc);
1245  }
1246  } // SolutionEstimate::operator std::string()
1247 
1248 
1249  void SolutionEstimate::operator=(const std::string& line)
1250  {
1251  static int FIELD_DIVS[] = {0, 6, 13, 18, 21, 26, 39, 44, 46, 68, -1};
1252  try
1253  {
1254  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
1255  paramIndex = asUnsigned(line.substr(1, 5) );
1256  paramType = line.substr(7, 6);
1257  siteCode = line.substr(14, 4);
1258  pointCode = line.substr(19, 2);
1259  solutionId = line.substr(22, 4);
1260  epoch = line.substr(27,12);
1261  paramUnits = line.substr(40, 4);
1262  constraintCode = line[45];
1263  paramEstimate = asDouble(line.substr(47, 21) );
1264  paramStdDev = asDouble(line.substr(69, 11) );
1265  }
1266  catch (Exception& exc)
1267  {
1268  GNSSTK_RETHROW(exc);
1269  }
1270  } // SolutionEstimate::operator=()
1271 
1272 
1273  void SolutionEstimate::dump(ostream& s) const
1274  {
1275  s << BLOCK_TITLE << " :" << endl;
1276  s << " paramIndex=" << paramIndex << endl;
1277  s << " paramType=" << paramType << endl;
1278  s << " siteCode=" << siteCode << endl;
1279  s << " pointCode=" << pointCode << endl;
1280  s << " solutionId=" << solutionId << endl;
1281  s << " epoch=" << (std::string)epoch << endl;
1282  s << " constraintCode=" << constraintCode << endl;
1283  s << " paramEstimate=" << paramEstimate << endl;
1284  s << " paramStdDev=" << paramStdDev << endl;
1285 
1286  } // SolutionEstimate::dump()
1287 
1288 
1289  const string SolutionApriori::BLOCK_TITLE("SOLUTION/APRIORI");
1290  const size_t SolutionApriori::MIN_LINE_LEN;
1291  const size_t SolutionApriori::MAX_LINE_LEN;
1292 
1293 
1294  SolutionApriori::operator std::string() const
1295  {
1296  try
1297  {
1298  std::ostringstream ss;
1299  ss << DATA_START << formatUint(paramIndex, 5);
1300  ss << ' ' << formatStr(paramType, 6);
1301  ss << ' ' << formatStr(siteCode, 4);
1302  ss << ' ' << formatStr(pointCode, 2);
1303  ss << ' ' << formatStr(solutionId, 4);
1304  ss << ' ' << setw(12) << right << (std::string)epoch;
1305  ss << ' ' << formatStr(paramUnits, 4);
1306  ss << ' ' << constraintCode;
1307  ss << ' ' << formatFor(paramApriori, 21, 2);
1308  // Erase extra leading space for '-' since StdDev is non-negative
1309  ss << ' ' << formatFor(paramStdDev, 12, 2).erase(0, 1);
1310  return ss.str();
1311  }
1312  catch (Exception& exc)
1313  {
1314  GNSSTK_RETHROW(exc);
1315  }
1316  } // SolutionApriori::operator std::string()
1317 
1318 
1319  void SolutionApriori::operator=(const std::string& line)
1320  {
1321  static int FIELD_DIVS[] = {0, 6, 13, 18, 21, 26, 39, 44, 46, 68, -1};
1322  try
1323  {
1324  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
1325  paramIndex = asUnsigned(line.substr(1, 5) );
1326  paramType = line.substr(7, 6);
1327  siteCode = line.substr(14, 4);
1328  pointCode = line.substr(19, 2);
1329  solutionId = line.substr(22, 4);
1330  epoch = line.substr(27,12);
1331  paramUnits = line.substr(40, 4);
1332  constraintCode = line[45];
1333  paramApriori = asDouble(line.substr(47, 21) );
1334  paramStdDev = asDouble(line.substr(69, 11) );
1335  }
1336  catch (Exception& exc)
1337  {
1338  GNSSTK_RETHROW(exc);
1339  }
1340  } // SolutionApriori::operator=()
1341 
1342 
1343  void SolutionApriori::dump(ostream& s) const
1344  {
1345  s << BLOCK_TITLE << " :" << endl;
1346  s << " paramIndex=" << paramIndex << endl;
1347  s << " paramType=" << paramType << endl;
1348  s << " siteCode=" << siteCode << endl;
1349  s << " pointCode=" << pointCode << endl;
1350  s << " solutionId=" << solutionId << endl;
1351  s << " epoch=" << (std::string)epoch << endl;
1352  s << " constraintCode=" << constraintCode << endl;
1353  s << " paramApriori=" << paramApriori << endl;
1354  s << " paramStdDev=" << paramStdDev << endl;
1355 
1356  } // SolutionApriori::dump()
1357 
1358  // BLOCK_TITLE defined only for subclasses of SolutionMatrixEstimate
1361 
1362 
1363  SolutionMatrixEstimate::operator std::string() const
1364  {
1365  try
1366  {
1367  std::ostringstream ss;
1368  ss << DATA_START << formatUint(row, 5);
1369  ss << ' ' << formatUint(col, 5);
1370  ss << ' ' << formatFor(val1, 21, 2);
1371  ss << ' ' << formatFor(val2, 21, 2);
1372  ss << ' ' << formatFor(val3, 21, 2);
1373  return ss.str();
1374  }
1375  catch (Exception& exc)
1376  {
1377  GNSSTK_RETHROW(exc);
1378  }
1379  } // SolutionMatrixEstimate::operator std::string()
1380 
1381 
1382  void SolutionMatrixEstimate::operator=(const std::string& line)
1383  {
1384  static int FIELD_DIVS[] = {0, 6, 12, 34, 56, -1};
1385  try
1386  {
1387  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
1388  row = asUnsigned(line.substr(1, 5) );
1389  col = asUnsigned(line.substr(7, 5) );
1390  val1 = asDouble(line.substr(13, 21) );
1391  val2 = asDouble(line.substr(35, 21) );
1392  val3 = asDouble(line.substr(57, 21) );
1393  }
1394  catch (Exception& exc)
1395  {
1396  GNSSTK_RETHROW(exc);
1397  }
1398  } // SolutionMatrixEstimate::operator=()
1399 
1400 
1401  void SolutionMatrixEstimate::dump(ostream& s) const
1402  {
1403  s << " row=" << row << endl;
1404  s << " col=" << col << endl;
1405  s << " val1=" << val1 << endl;
1406  s << " val2=" << val2 << endl;
1407  s << " val3=" << val3 << endl;
1408 
1409  } // SolutionMatrixEstimate::dump()
1410 
1411 
1412  const string SolutionMatrixEstimateLCorr::BLOCK_TITLE("SOLUTION/MATRIX_ESTIMATE L CORR");
1413 
1414  void SolutionMatrixEstimateLCorr::dump(ostream& s) const
1415  {
1416  s << BLOCK_TITLE << " :" << endl;
1418 
1419  } // SolutionMatrixEstimateLCorr::dump()
1420 
1421 
1422  const string SolutionMatrixEstimateUCorr::BLOCK_TITLE("SOLUTION/MATRIX_ESTIMATE U CORR");
1423 
1424  void SolutionMatrixEstimateUCorr::dump(ostream& s) const
1425  {
1426  s << BLOCK_TITLE << " :" << endl;
1428 
1429  } // SolutionMatrixEstimateUCorr::dump()
1430 
1431 
1432  const string SolutionMatrixEstimateLCova::BLOCK_TITLE("SOLUTION/MATRIX_ESTIMATE L COVA");
1433 
1434  void SolutionMatrixEstimateLCova::dump(ostream& s) const
1435  {
1436  s << BLOCK_TITLE << " :" << endl;
1438 
1439  } // SolutionMatrixEstimateLCova::dump()
1440 
1441 
1442  const string SolutionMatrixEstimateUCova::BLOCK_TITLE("SOLUTION/MATRIX_ESTIMATE U COVA");
1443 
1444  void SolutionMatrixEstimateUCova::dump(ostream& s) const
1445  {
1446  s << BLOCK_TITLE << " :" << endl;
1448 
1449  } // SolutionMatrixEstimateUCova::dump()
1450 
1451 
1452  const string SolutionMatrixEstimateLInfo::BLOCK_TITLE("SOLUTION/MATRIX_ESTIMATE L INFO");
1453 
1454  void SolutionMatrixEstimateLInfo::dump(ostream& s) const
1455  {
1456  s << BLOCK_TITLE << " :" << endl;
1458 
1459  } // SolutionMatrixEstimateLInfo::dump()
1460 
1461 
1462  const string SolutionMatrixEstimateUInfo::BLOCK_TITLE("SOLUTION/MATRIX_ESTIMATE U INFO");
1463 
1464  void SolutionMatrixEstimateUInfo::dump(ostream& s) const
1465  {
1466  s << BLOCK_TITLE << " :" << endl;
1468 
1469  } // SolutionMatrixEstimateUInfo::dump()
1470 
1471 
1472  // BLOCK_TITLE defined only for subclasses of SolutionMatrixApriori
1475 
1476  SolutionMatrixApriori::operator std::string() const
1477  {
1478  try
1479  {
1480  std::ostringstream ss;
1481  ss << DATA_START << formatUint(row, 5);
1482  ss << ' ' << formatUint(col, 5);
1483  ss << ' ' << formatFor(val1, 21, 2);
1484  ss << ' ' << formatFor(val2, 21, 2);
1485  ss << ' ' << formatFor(val3, 21, 2);
1486  return ss.str();
1487  }
1488  catch (Exception& exc)
1489  {
1490  GNSSTK_RETHROW(exc);
1491  }
1492  } // SolutionMatrixApriori::operator std::string()
1493 
1494 
1495  void SolutionMatrixApriori::operator=(const std::string& line)
1496  {
1497  static int FIELD_DIVS[] = {0, 6, 12, 34, 56, -1};
1498  try
1499  {
1500  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
1501  row = asUnsigned(line.substr(1, 5) );
1502  col = asUnsigned(line.substr(7, 5) );
1503  val1 = asDouble(line.substr(13, 21) );
1504  val2 = asDouble(line.substr(35, 21) );
1505  val3 = asDouble(line.substr(57, 21) );
1506  }
1507  catch (Exception& exc)
1508  {
1509  GNSSTK_RETHROW(exc);
1510  }
1511  } // SolutionMatrixApriori::operator=()
1512 
1513 
1514  void SolutionMatrixApriori::dump(ostream& s) const
1515  {
1516  s << " row=" << row << endl;
1517  s << " col=" << col << endl;
1518  s << " val1=" << val1 << endl;
1519  s << " val2=" << val2 << endl;
1520  s << " val3=" << val3 << endl;
1521 
1522  } // SolutionMatrixApriori::dump()
1523 
1524 
1525  const std::string SolutionMatrixAprioriLCorr::BLOCK_TITLE("SOLUTION/MATRIX_APRIORI L CORR");
1526 
1527  void SolutionMatrixAprioriLCorr::dump(ostream& s) const
1528  {
1529  s << BLOCK_TITLE << " :" << endl;
1531 
1532  } // SolutionMatrixAprioriLCorr::dump()
1533 
1534 
1535  const std::string SolutionMatrixAprioriUCorr::BLOCK_TITLE("SOLUTION/MATRIX_APRIORI U CORR");
1536 
1537  void SolutionMatrixAprioriUCorr::dump(ostream& s) const
1538  {
1539  s << BLOCK_TITLE << " :" << endl;
1541 
1542  } // SolutionMatrixAprioriUCorr::dump()
1543 
1544 
1545  const std::string SolutionMatrixAprioriLCova::BLOCK_TITLE("SOLUTION/MATRIX_APRIORI L COVA");
1546 
1547  void SolutionMatrixAprioriLCova::dump(ostream& s) const
1548  {
1549  s << BLOCK_TITLE << " :" << endl;
1551 
1552  } // SolutionMatrixAprioriLCova::dump()
1553 
1554 
1555  const std::string SolutionMatrixAprioriUCova::BLOCK_TITLE("SOLUTION/MATRIX_APRIORI U COVA");
1556 
1557  void SolutionMatrixAprioriUCova::dump(ostream& s) const
1558  {
1559  s << BLOCK_TITLE << " :" << endl;
1561 
1562  } // SolutionMatrixAprioriUCova::dump()
1563 
1564 
1565  const std::string SolutionMatrixAprioriLInfo::BLOCK_TITLE("SOLUTION/MATRIX_APRIORI L INFO");
1566 
1567  void SolutionMatrixAprioriLInfo::dump(ostream& s) const
1568  {
1569  s << BLOCK_TITLE << " :" << endl;
1571 
1572  } // SolutionMatrixAprioriLInfo::dump()
1573 
1574 
1575  const std::string SolutionMatrixAprioriUInfo::BLOCK_TITLE("SOLUTION/MATRIX_APRIORI U INFO");
1576 
1577  void SolutionMatrixAprioriUInfo::dump(ostream& s) const
1578  {
1579  s << BLOCK_TITLE << " :" << endl;
1581 
1582  } // SolutionMatrixAprioriUInfo::dump()
1583 
1584 
1585  const std::string SolutionNormalEquationVector::BLOCK_TITLE("SOLUTION/NORMAL_EQUATION_VECTOR");
1588 
1589 
1590  SolutionNormalEquationVector::operator std::string() const
1591  {
1592  try
1593  {
1594  std::ostringstream ss;
1595  ss << DATA_START << formatUint(paramIndex, 5);
1596  ss << ' ' << formatStr(paramType, 6);
1597  ss << ' ' << formatStr(siteCode, 4);
1598  ss << ' ' << formatStr(pointCode, 2);
1599  ss << ' ' << formatStr(solutionId, 4);
1600  ss << ' ' << setw(12) << right << (std::string)epoch;
1601  ss << ' ' << formatStr(paramUnits, 4);
1602  ss << ' ' << constraintCode;
1603  ss << ' ' << formatFor(value, 21, 2);
1604  return ss.str();
1605  }
1606  catch (Exception& exc)
1607  {
1608  GNSSTK_RETHROW(exc);
1609  }
1610  } // SolutionNormalEquationVector::operator std::string()
1611 
1612 
1613  void SolutionNormalEquationVector::operator=(const std::string& line)
1614  {
1615  static int FIELD_DIVS[] = {0, 6, 13, 18, 21, 26, 39, 44, 46, -1};
1616  try
1617  {
1618  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
1619  paramIndex = asUnsigned(line.substr(1, 5) );
1620  paramType = line.substr(7, 6);
1621  siteCode = line.substr(14, 4);
1622  pointCode = line.substr(19, 2);
1623  solutionId = line.substr(22, 4);
1624  epoch = line.substr(27,12);
1625  paramUnits = line.substr(40, 4);
1626  constraintCode = line[45];
1627  value = asDouble(line.substr(47, 21) );
1628  }
1629  catch (Exception& exc)
1630  {
1631  GNSSTK_RETHROW(exc);
1632  }
1633  } // SolutionNormalEquationVector::operator=()
1634 
1635 
1636  void SolutionNormalEquationVector::dump(ostream& s) const
1637  {
1638  s << BLOCK_TITLE << " :" << endl;
1639  s << " paramIndex=" << paramIndex << endl;
1640  s << " paramType=" << paramType << endl;
1641  s << " siteCode=" << siteCode << endl;
1642  s << " pointCode=" << pointCode << endl;
1643  s << " solutionId=" << solutionId << endl;
1644  s << " epoch=" << (std::string)epoch << endl;
1645  s << " constraintCode=" << constraintCode << endl;
1646  s << " value=" << value << endl;
1647 
1648  } // SolutionNormalEquationVector::dump()
1649 
1650 
1651  // BLOCK_TITLE defined only for subclasses of SolutionNormalEquationMatrix
1654 
1655 
1656  SolutionNormalEquationMatrix::operator std::string() const
1657  {
1658  try
1659  {
1660  std::ostringstream ss;
1661  ss << DATA_START << formatUint(row, 5);
1662  ss << ' ' << formatUint(col, 5);
1663  ss << ' ' << formatFor(val1, 21, 3);
1664  ss << ' ' << formatFor(val2, 21, 3);
1665  ss << ' ' << formatFor(val3, 21, 3);
1666  return ss.str();
1667  }
1668  catch (Exception& exc)
1669  {
1670  GNSSTK_RETHROW(exc);
1671  }
1672  } // SolutionNormalEquationMatrix::operator std::string()
1673 
1674 
1675  void SolutionNormalEquationMatrix::operator=(const std::string& line)
1676  {
1677  static int FIELD_DIVS[] = {0, 6, 12, 34, 56, -1};
1678  try
1679  {
1680  isValidLineStructure(line, MIN_LINE_LEN, MAX_LINE_LEN, FIELD_DIVS);
1681  row = asUnsigned(line.substr(1, 5) );
1682  col = asUnsigned(line.substr(7, 5) );
1683  val1 = asDouble(line.substr(13, 21) );
1684  val2 = asDouble(line.substr(35, 21) );
1685  val3 = asDouble(line.substr(57, 21) );
1686  }
1687  catch (Exception& exc)
1688  {
1689  GNSSTK_RETHROW(exc);
1690  }
1691  } // SolutionNormalEquationMatrix::operator=()
1692 
1693 
1694  void SolutionNormalEquationMatrix::dump(ostream& s) const
1695  {
1696  s << " row=" << row << endl;
1697  s << " col=" << col << endl;
1698  s << " val1=" << val1 << endl;
1699  s << " val2=" << val2 << endl;
1700  s << " val3=" << val3 << endl;
1701 
1702  } // SolutionNormalEquationMatrix::dump()
1703 
1704 
1705  const std::string SolutionNormalEquationMatrixL::BLOCK_TITLE("SOLUTION/NORMAL_EQUATION_MATRIX L");
1706 
1708  {
1709  s << BLOCK_TITLE << " :" << endl;
1711 
1712  } // SolutionNormalEquationMatrixL::dump()
1713 
1714 
1715  const std::string SolutionNormalEquationMatrixU::BLOCK_TITLE("SOLUTION/NORMAL_EQUATION_MATRIX U");
1716 
1718  {
1719  s << BLOCK_TITLE << " :" << endl;
1721 
1722  } // SolutionNormalEquationMatrixU::dump()
1723 
1724 } // namespace Sinex
1725 
1726 } // namespace gnsstk
gnsstk::dump
void dump(vector< SatPass > &SatPassList, ostream &os, bool rev, bool dbug)
Definition: SatPassUtilities.cpp:59
gnsstk::StringUtils::asInt
long asInt(const std::string &s)
Definition: StringUtils.hpp:713
example3.header
header
Definition: example3.py:22
gnsstk::Sinex::formatStr
std::string formatStr(const std::string &value, size_t width, bool allowBlank)
Definition: SinexBase.cpp:173
StringUtils.hpp
gnsstk::Sinex::isValidObsCode
bool isValidObsCode(char c, bool toss)
Definition: SinexBase.cpp:57
gnsstk::StringUtils::asFloat
float asFloat(const std::string &s)
Definition: StringUtils.hpp:1636
gnsstk::StringUtils::asLongDouble
long double asLongDouble(const std::string &s)
Definition: StringUtils.hpp:1652
gnsstk::Sinex::formatFixed
std::string formatFixed(double value, size_t width, size_t precision)
Definition: SinexBase.cpp:233
SinexTypes.hpp
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::Exception
Definition: Exception.hpp:151
gnsstk::Sinex::HEAD_TAIL_START
const char HEAD_TAIL_START
Definition: SinexBase.hpp:60
gnsstk::Sinex::MIN_LINE_LEN
const size_t MIN_LINE_LEN
Definition: SinexBase.hpp:66
example5.epoch
epoch
Definition: example5.py:24
gnsstk::Sinex::isValidLineStructure
bool isValidLineStructure(const std::string &line, size_t minLen, size_t maxLen, int divs[], bool toss)
Definition: SinexBase.cpp:111
gnsstk::Sinex::Header
Definition: SinexHeader.hpp:63
version
string version(string("2.4 9/23/15 rev"))
gnsstk::StringUtils::asDouble
double asDouble(const std::string &s)
Definition: StringUtils.hpp:705
GNSSTK_RETHROW
#define GNSSTK_RETHROW(exc)
Definition: Exception.hpp:369
gnsstk::Sinex::formatFor
std::string formatFor(double value, size_t width, size_t expLen)
Definition: SinexBase.cpp:225
gnsstk::Sinex::MAX_LINE_LEN
const size_t MAX_LINE_LEN
Definition: SinexBase.hpp:67
gnsstk::StringUtils
Definition: IonexStoreStrategy.cpp:44
gnsstk::StringUtils::asUnsigned
unsigned long asUnsigned(const std::string &s)
Definition: StringUtils.hpp:721
std
Definition: Angle.hpp:142
GNSSTK_THROW
#define GNSSTK_THROW(exc)
Definition: Exception.hpp:366
gnsstk::Sinex::formatInt
std::string formatInt(long value, size_t width)
Definition: SinexBase.cpp:189
gnsstk::Sinex::DATA_START
const char DATA_START
Definition: SinexBase.hpp:64
gnsstk::Sinex::formatUint
std::string formatUint(unsigned long value, size_t width)
Definition: SinexBase.cpp:207
gnsstk::Sinex::Header::operator=
void operator=(const std::string &other)
Definition: SinexHeader.cpp:87


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:41