AshtechALB.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 
39 #include "StringUtils.hpp"
40 #include "BinUtils.hpp"
41 
42 #include "AshtechALB.hpp"
43 #include "AshtechStream.hpp"
44 
45 using namespace std;
46 
47 namespace gnsstk
48  {
49  const char* AshtechALB::myId = "ALB";
50 
51  //---------------------------------------------------------------------------
52  void AshtechALB::reallyGetRecord(FFStream& ffs)
53  {
54  AshtechStream& stream=dynamic_cast<AshtechStream&>(ffs);
55 
56  // make sure the object is reset before starting the search
57  clear(fmtbit | lenbit | crcbit);
58  string& rawData = stream.rawData;
59 
60  // If this object doesn't have an id set yet, assume that the streams
61  // most recent read id is what we need to be
62  if (id == "" && rawData.size()>=11 &&
63  rawData.substr(0,7) == preamble &&
64  rawData[10]==',')
65  id = rawData.substr(7,3);
66 
67  // If that didn't work, or this is object is not of the right type,
68  // then give up.
69  if (id == "" || !checkId(id))
70  return;
71 
72  readBody(stream);
73  }
74 
75  //---------------------------------------------------------------------------
76  void AshtechALB::decode(const std::string& data)
77  {
78  using BinUtils::decodeVar;
79 
80  string str(data);
81  if (debugLevel>1)
82  cout << "ALB " << str.length() << " " << endl;
83  if (str.length() == 138)
84  {
85  ascii=false;
86  header = str.substr(0,11); str.erase(0,11);
87  svid = decodeVar<uint16_t>(str);
88  str.erase(0,1);
89 
90  for (int w=0; w<10; w++)
91  word[w] = decodeVar<uint32_t>(str);
92 
93  (void)decodeVar<uint16_t>(str); // ignore checksum
94  clear(ios_base::goodbit);
95  }
96  }
97 
98  //---------------------------------------------------------------------------
99  void AshtechALB::dump(ostream& out) const noexcept
100  {
101  ostringstream oss;
104 
105  AshtechData::dump(out);
106  oss << getName() << "1:"
107  << " svid:" << svid
108  << " S0W0: ..."
109  << endl;
110  out << oss.str() << flush;
111  }
112 
113 } // namespace gnsstk
example3.svid
svid
Definition: example3.py:19
gnsstk::dump
void dump(vector< SatPass > &SatPassList, ostream &os, bool rev, bool dbug)
Definition: SatPassUtilities.cpp:59
example3.header
header
Definition: example3.py:22
gnsstk::StringUtils::word
std::string word(const std::string &s, const std::string::size_type wordNum=0, const char delimiter=' ')
Definition: StringUtils.hpp:1112
gnsstk::lenbit
static const std::ios_base::iostate lenbit
Definition: DataStatus.hpp:88
gnsstk::FFStream
Definition: FFStream.hpp:119
StringUtils.hpp
gnsstk::crcbit
static const std::ios_base::iostate crcbit
Define additional/other bits are the data requires.
Definition: DataStatus.hpp:86
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::fmtbit
static const std::ios_base::iostate fmtbit
Definition: DataStatus.hpp:87
AshtechStream.hpp
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
AshtechALB.hpp
gnsstk::AshtechStream
Definition: AshtechStream.hpp:54
BinUtils.hpp
example3.data
data
Definition: example3.py:22
std
Definition: Angle.hpp:142
gnsstk::StringUtils::leftJustify
std::string & leftJustify(std::string &s, const std::string::size_type length, const char pad=' ')
Definition: StringUtils.hpp:1582
gnsstk::AshtechStream::rawData
std::string rawData
The raw bytes read from the file.
Definition: AshtechStream.hpp:78
gnsstk::BinUtils::decodeVar
T decodeVar(const std::string &str, std::string::size_type pos)
Definition: BinUtils.hpp:366


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