Line | Branch | Exec | Source |
---|---|---|---|
1 | // This file is part of INSTINCT, the INS Toolkit for Integrated | ||
2 | // Navigation Concepts and Training by the Institute of Navigation of | ||
3 | // the University of Stuttgart, Germany. | ||
4 | // | ||
5 | // This Source Code Form is subject to the terms of the Mozilla Public | ||
6 | // License, v. 2.0. If a copy of the MPL was not distributed with this | ||
7 | // file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
8 | |||
9 | #include "VectorNavDataLogger.hpp" | ||
10 | |||
11 | #include "NodeData/IMU/VectorNavBinaryOutput.hpp" | ||
12 | |||
13 | #include "util/Logger.hpp" | ||
14 | #include "util/StringUtil.hpp" | ||
15 | |||
16 | #include <iomanip> // std::setprecision | ||
17 | #include <limits> | ||
18 | |||
19 | #include "internal/NodeManager.hpp" | ||
20 | namespace nm = NAV::NodeManager; | ||
21 | #include "internal/FlowManager.hpp" | ||
22 | |||
23 | #include <imgui_internal.h> | ||
24 | |||
25 | 114 | NAV::VectorNavDataLogger::VectorNavDataLogger() | |
26 |
4/8✓ Branch 1 taken 114 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 114 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 114 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 114 times.
✗ Branch 12 not taken.
|
114 | : Node(typeStatic()) |
27 | { | ||
28 | LOG_TRACE("{}: called", name); | ||
29 | |||
30 | 114 | _fileType = FileType::BINARY; | |
31 | |||
32 | 114 | _hasConfig = true; | |
33 | 114 | _guiConfigDefaultWindowSize = { 444, 92 }; | |
34 | |||
35 |
4/8✓ Branch 1 taken 114 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 114 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 114 times.
✓ Branch 9 taken 114 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
|
342 | nm::CreateInputPin(this, "BinaryOutput", Pin::Type::Flow, { NAV::VectorNavBinaryOutput::type() }, &VectorNavDataLogger::writeObservation); |
36 | 228 | } | |
37 | |||
38 | 232 | NAV::VectorNavDataLogger::~VectorNavDataLogger() | |
39 | { | ||
40 | LOG_TRACE("{}: called", nameId()); | ||
41 | 232 | } | |
42 | |||
43 | 226 | std::string NAV::VectorNavDataLogger::typeStatic() | |
44 | { | ||
45 |
1/2✓ Branch 1 taken 226 times.
✗ Branch 2 not taken.
|
452 | return "VectorNavDataLogger"; |
46 | } | ||
47 | |||
48 | ✗ | std::string NAV::VectorNavDataLogger::type() const | |
49 | { | ||
50 | ✗ | return typeStatic(); | |
51 | } | ||
52 | |||
53 | 112 | std::string NAV::VectorNavDataLogger::category() | |
54 | { | ||
55 |
1/2✓ Branch 1 taken 112 times.
✗ Branch 2 not taken.
|
224 | return "Data Logger"; |
56 | } | ||
57 | |||
58 | ✗ | void NAV::VectorNavDataLogger::guiConfig() | |
59 | { | ||
60 | ✗ | if (FileWriter::guiConfig(".vnb", { ".vnb" }, size_t(id), nameId())) | |
61 | { | ||
62 | ✗ | flow::ApplyChanges(); | |
63 | ✗ | doDeinitialize(); | |
64 | } | ||
65 | |||
66 | ✗ | if (CommonLog::ShowOriginInput(nameId().c_str())) | |
67 | { | ||
68 | ✗ | flow::ApplyChanges(); | |
69 | } | ||
70 | ✗ | } | |
71 | |||
72 | ✗ | [[nodiscard]] json NAV::VectorNavDataLogger::save() const | |
73 | { | ||
74 | LOG_TRACE("{}: called", nameId()); | ||
75 | |||
76 | ✗ | json j; | |
77 | |||
78 | ✗ | j["FileWriter"] = FileWriter::save(); | |
79 | |||
80 | ✗ | return j; | |
81 | ✗ | } | |
82 | |||
83 | 2 | void NAV::VectorNavDataLogger::restore(json const& j) | |
84 | { | ||
85 | LOG_TRACE("{}: called", nameId()); | ||
86 | |||
87 |
1/2✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
|
2 | if (j.contains("FileWriter")) |
88 | { | ||
89 | 2 | FileWriter::restore(j.at("FileWriter")); | |
90 | } | ||
91 | 2 | } | |
92 | |||
93 | 2 | bool NAV::VectorNavDataLogger::onCreateLink([[maybe_unused]] OutputPin& startPin, [[maybe_unused]] InputPin& endPin) | |
94 | { | ||
95 | LOG_TRACE("{}: called for {} ==> {}", nameId(), size_t(startPin.id), size_t(endPin.id)); | ||
96 | |||
97 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
|
2 | if (isInitialized()) |
98 | { | ||
99 | ✗ | deinitialize(); | |
100 | ✗ | initialize(); | |
101 | } | ||
102 | |||
103 | 2 | return true; | |
104 | } | ||
105 | |||
106 | 2 | void NAV::VectorNavDataLogger::flush() | |
107 | { | ||
108 | 2 | _filestream.flush(); | |
109 | 2 | } | |
110 | |||
111 | 6 | bool NAV::VectorNavDataLogger::initialize() | |
112 | { | ||
113 | LOG_TRACE("{}: called", nameId()); | ||
114 | |||
115 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
6 | if (!FileWriter::initialize()) |
116 | { | ||
117 | ✗ | return false; | |
118 | } | ||
119 | |||
120 | 6 | CommonLog::initialize(); | |
121 | |||
122 | 6 | _headerWritten = false; | |
123 | |||
124 | 6 | return true; | |
125 | } | ||
126 | |||
127 | 2 | void NAV::VectorNavDataLogger::deinitialize() | |
128 | { | ||
129 | LOG_TRACE("{}: called", nameId()); | ||
130 | |||
131 | 2 | FileWriter::deinitialize(); | |
132 | 2 | } | |
133 | |||
134 | 30 | void NAV::VectorNavDataLogger::writeObservation(NAV::InputPin::NodeDataQueue& queue, size_t /* pinIdx */) | |
135 | { | ||
136 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | auto obs = std::static_pointer_cast<const VectorNavBinaryOutput>(queue.extract_front()); |
137 | |||
138 |
1/2✓ Branch 0 taken 30 times.
✗ Branch 1 not taken.
|
30 | if (_fileType == FileType::BINARY) |
139 | { | ||
140 | 30 | std::array<const char, 8> zeroData{}; | |
141 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 28 times.
|
30 | if (!_headerWritten) |
142 | { | ||
143 |
2/4✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
|
2 | _filestream.write(obs->timeOutputs ? reinterpret_cast<const char*>(&obs->timeOutputs->timeField) : zeroData.data(), sizeof(vn::protocol::uart::TimeGroup)); |
144 |
3/4✓ Branch 2 taken 1 times.
✓ Branch 3 taken 1 times.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
|
3 | _filestream.write(obs->imuOutputs ? reinterpret_cast<const char*>(&obs->imuOutputs->imuField) : zeroData.data(), sizeof(vn::protocol::uart::ImuGroup)); |
145 |
2/4✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
|
2 | _filestream.write(obs->gnss1Outputs ? reinterpret_cast<const char*>(&obs->gnss1Outputs->gnssField) : zeroData.data(), sizeof(vn::protocol::uart::GpsGroup)); |
146 |
2/4✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
|
2 | _filestream.write(obs->attitudeOutputs ? reinterpret_cast<const char*>(&obs->attitudeOutputs->attitudeField) : zeroData.data(), sizeof(vn::protocol::uart::AttitudeGroup)); |
147 |
3/4✓ Branch 2 taken 1 times.
✓ Branch 3 taken 1 times.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
|
3 | _filestream.write(obs->insOutputs ? reinterpret_cast<const char*>(&obs->insOutputs->insField) : zeroData.data(), sizeof(vn::protocol::uart::InsGroup)); |
148 |
3/4✓ Branch 2 taken 1 times.
✓ Branch 3 taken 1 times.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
|
3 | _filestream.write(obs->gnss2Outputs ? reinterpret_cast<const char*>(&obs->gnss2Outputs->gnssField) : zeroData.data(), sizeof(vn::protocol::uart::GpsGroup)); |
149 | 2 | _headerWritten = true; | |
150 | } | ||
151 | |||
152 |
1/2✓ Branch 2 taken 30 times.
✗ Branch 3 not taken.
|
30 | if (!obs->insTime.empty()) |
153 | { | ||
154 |
1/2✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
|
30 | auto insTimeGPS = obs->insTime.toGPSweekTow(); |
155 | 30 | auto tow = static_cast<double>(insTimeGPS.tow); | |
156 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | _filestream.write(reinterpret_cast<const char*>(&insTimeGPS.gpsCycle), sizeof(insTimeGPS.gpsCycle)); |
157 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | _filestream.write(reinterpret_cast<const char*>(&insTimeGPS.gpsWeek), sizeof(insTimeGPS.gpsWeek)); |
158 |
1/2✓ Branch 1 taken 30 times.
✗ Branch 2 not taken.
|
30 | _filestream.write(reinterpret_cast<const char*>(&tow), sizeof(tow)); |
159 | } | ||
160 | else | ||
161 | { | ||
162 | ✗ | _filestream.write(zeroData.data(), sizeof(int32_t)); | |
163 | ✗ | _filestream.write(zeroData.data(), sizeof(int32_t)); | |
164 | ✗ | _filestream.write(zeroData.data(), sizeof(double)); | |
165 | } | ||
166 | |||
167 | // Group 2 (Time) | ||
168 |
1/2✓ Branch 2 taken 30 times.
✗ Branch 3 not taken.
|
30 | if (obs->timeOutputs) |
169 | { | ||
170 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 30 times.
✗ Branch 6 not taken.
|
30 | if (obs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESTARTUP) |
171 | { | ||
172 |
1/2✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
|
30 | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->timeStartup), sizeof(obs->timeOutputs->timeStartup)); |
173 | } | ||
174 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 30 times.
|
30 | if (obs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMEGPS) |
175 | { | ||
176 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->timeGps), sizeof(obs->timeOutputs->timeGps)); | |
177 | } | ||
178 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 30 times.
✗ Branch 6 not taken.
|
30 | if (obs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSTOW) |
179 | { | ||
180 |
1/2✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
|
30 | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->gpsTow), sizeof(obs->timeOutputs->gpsTow)); |
181 | } | ||
182 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 30 times.
✗ Branch 6 not taken.
|
30 | if (obs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSWEEK) |
183 | { | ||
184 |
1/2✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
|
30 | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->gpsWeek), sizeof(obs->timeOutputs->gpsWeek)); |
185 | } | ||
186 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 30 times.
|
30 | if (obs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESYNCIN) |
187 | { | ||
188 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->timeSyncIn), sizeof(obs->timeOutputs->timeSyncIn)); | |
189 | } | ||
190 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 30 times.
|
30 | if (obs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMEGPSPPS) |
191 | { | ||
192 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->timePPS), sizeof(obs->timeOutputs->timePPS)); | |
193 | } | ||
194 |
3/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✓ Branch 6 taken 18 times.
|
30 | if (obs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMEUTC) |
195 | { | ||
196 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->timeUtc.year), sizeof(obs->timeOutputs->timeUtc.year)); |
197 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->timeUtc.month), sizeof(obs->timeOutputs->timeUtc.month)); |
198 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->timeUtc.day), sizeof(obs->timeOutputs->timeUtc.day)); |
199 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->timeUtc.hour), sizeof(obs->timeOutputs->timeUtc.hour)); |
200 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->timeUtc.min), sizeof(obs->timeOutputs->timeUtc.min)); |
201 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->timeUtc.sec), sizeof(obs->timeOutputs->timeUtc.sec)); |
202 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->timeUtc.ms), sizeof(obs->timeOutputs->timeUtc.ms)); |
203 | } | ||
204 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 30 times.
|
30 | if (obs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_SYNCINCNT) |
205 | { | ||
206 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->syncInCnt), sizeof(obs->timeOutputs->syncInCnt)); | |
207 | } | ||
208 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 30 times.
|
30 | if (obs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_SYNCOUTCNT) |
209 | { | ||
210 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->syncOutCnt), sizeof(obs->timeOutputs->syncOutCnt)); | |
211 | } | ||
212 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 30 times.
✗ Branch 6 not taken.
|
30 | if (obs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESTATUS) |
213 | { | ||
214 |
1/2✓ Branch 4 taken 30 times.
✗ Branch 5 not taken.
|
30 | _filestream.write(reinterpret_cast<const char*>(&obs->timeOutputs->timeStatus.status()), sizeof(obs->timeOutputs->timeStatus.status())); |
215 | } | ||
216 | } | ||
217 | // Group 3 (IMU) | ||
218 |
2/2✓ Branch 2 taken 18 times.
✓ Branch 3 taken 12 times.
|
30 | if (obs->imuOutputs) |
219 | { | ||
220 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 18 times.
|
18 | if (obs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_IMUSTATUS) |
221 | { | ||
222 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->imuOutputs->imuStatus), sizeof(obs->imuOutputs->imuStatus)); | |
223 | } | ||
224 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 18 times.
✗ Branch 6 not taken.
|
18 | if (obs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPMAG) |
225 | { | ||
226 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 18 times.
✗ Branch 7 not taken.
|
18 | _filestream.write(reinterpret_cast<const char*>(obs->imuOutputs->uncompMag.data()), sizeof(obs->imuOutputs->uncompMag)); |
227 | } | ||
228 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 18 times.
✗ Branch 6 not taken.
|
18 | if (obs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPACCEL) |
229 | { | ||
230 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 18 times.
✗ Branch 7 not taken.
|
18 | _filestream.write(reinterpret_cast<const char*>(obs->imuOutputs->uncompAccel.data()), sizeof(obs->imuOutputs->uncompAccel)); |
231 | } | ||
232 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 18 times.
✗ Branch 6 not taken.
|
18 | if (obs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPGYRO) |
233 | { | ||
234 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 18 times.
✗ Branch 7 not taken.
|
18 | _filestream.write(reinterpret_cast<const char*>(obs->imuOutputs->uncompGyro.data()), sizeof(obs->imuOutputs->uncompGyro)); |
235 | } | ||
236 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 18 times.
✗ Branch 6 not taken.
|
18 | if (obs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_TEMP) |
237 | { | ||
238 |
1/2✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
|
18 | _filestream.write(reinterpret_cast<const char*>(&obs->imuOutputs->temp), sizeof(obs->imuOutputs->temp)); |
239 | } | ||
240 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 18 times.
✗ Branch 6 not taken.
|
18 | if (obs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_PRES) |
241 | { | ||
242 |
1/2✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
|
18 | _filestream.write(reinterpret_cast<const char*>(&obs->imuOutputs->pres), sizeof(obs->imuOutputs->pres)); |
243 | } | ||
244 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 18 times.
✗ Branch 6 not taken.
|
18 | if (obs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_DELTATHETA) |
245 | { | ||
246 |
1/2✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
|
18 | _filestream.write(reinterpret_cast<const char*>(&obs->imuOutputs->deltaTime), sizeof(obs->imuOutputs->deltaTime)); |
247 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 18 times.
✗ Branch 7 not taken.
|
18 | _filestream.write(reinterpret_cast<const char*>(obs->imuOutputs->deltaTheta.data()), sizeof(obs->imuOutputs->deltaTheta)); |
248 | } | ||
249 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 18 times.
✗ Branch 6 not taken.
|
18 | if (obs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_DELTAVEL) |
250 | { | ||
251 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 18 times.
✗ Branch 7 not taken.
|
18 | _filestream.write(reinterpret_cast<const char*>(obs->imuOutputs->deltaV.data()), sizeof(obs->imuOutputs->deltaV)); |
252 | } | ||
253 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 18 times.
✗ Branch 6 not taken.
|
18 | if (obs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_MAG) |
254 | { | ||
255 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 18 times.
✗ Branch 7 not taken.
|
18 | _filestream.write(reinterpret_cast<const char*>(obs->imuOutputs->mag.data()), sizeof(obs->imuOutputs->mag)); |
256 | } | ||
257 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 18 times.
✗ Branch 6 not taken.
|
18 | if (obs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ACCEL) |
258 | { | ||
259 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 18 times.
✗ Branch 7 not taken.
|
18 | _filestream.write(reinterpret_cast<const char*>(obs->imuOutputs->accel.data()), sizeof(obs->imuOutputs->accel)); |
260 | } | ||
261 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 18 times.
✗ Branch 6 not taken.
|
18 | if (obs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ANGULARRATE) |
262 | { | ||
263 |
2/4✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 18 times.
✗ Branch 7 not taken.
|
18 | _filestream.write(reinterpret_cast<const char*>(obs->imuOutputs->angularRate.data()), sizeof(obs->imuOutputs->angularRate)); |
264 | } | ||
265 | } | ||
266 | // Group 4 (GNSS1) | ||
267 |
1/2✓ Branch 2 taken 30 times.
✗ Branch 3 not taken.
|
30 | if (obs->gnss1Outputs) |
268 | { | ||
269 |
3/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✓ Branch 6 taken 18 times.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC) |
270 | { | ||
271 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->timeUtc.year), sizeof(obs->gnss1Outputs->timeUtc.year)); |
272 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->timeUtc.month), sizeof(obs->gnss1Outputs->timeUtc.month)); |
273 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->timeUtc.day), sizeof(obs->gnss1Outputs->timeUtc.day)); |
274 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->timeUtc.hour), sizeof(obs->gnss1Outputs->timeUtc.hour)); |
275 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->timeUtc.min), sizeof(obs->gnss1Outputs->timeUtc.min)); |
276 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->timeUtc.sec), sizeof(obs->gnss1Outputs->timeUtc.sec)); |
277 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->timeUtc.ms), sizeof(obs->gnss1Outputs->timeUtc.ms)); |
278 | } | ||
279 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 30 times.
✗ Branch 6 not taken.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TOW) |
280 | { | ||
281 |
1/2✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
|
30 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->tow), sizeof(obs->gnss1Outputs->tow)); |
282 | } | ||
283 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 30 times.
✗ Branch 6 not taken.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_WEEK) |
284 | { | ||
285 |
1/2✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
|
30 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->week), sizeof(obs->gnss1Outputs->week)); |
286 | } | ||
287 |
3/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✓ Branch 6 taken 18 times.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_NUMSATS) |
288 | { | ||
289 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->numSats), sizeof(obs->gnss1Outputs->numSats)); |
290 | } | ||
291 |
3/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✓ Branch 6 taken 18 times.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_FIX) |
292 | { | ||
293 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->fix), sizeof(obs->gnss1Outputs->fix)); |
294 | } | ||
295 |
3/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✓ Branch 6 taken 18 times.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSLLA) |
296 | { | ||
297 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->gnss1Outputs->posLla.data()), sizeof(obs->gnss1Outputs->posLla)); |
298 | } | ||
299 |
3/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✓ Branch 6 taken 18 times.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSECEF) |
300 | { | ||
301 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->gnss1Outputs->posEcef.data()), sizeof(obs->gnss1Outputs->posEcef)); |
302 | } | ||
303 |
3/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✓ Branch 6 taken 18 times.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELNED) |
304 | { | ||
305 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->gnss1Outputs->velNed.data()), sizeof(obs->gnss1Outputs->velNed)); |
306 | } | ||
307 |
3/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✓ Branch 6 taken 18 times.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELECEF) |
308 | { | ||
309 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->gnss1Outputs->velEcef.data()), sizeof(obs->gnss1Outputs->velEcef)); |
310 | } | ||
311 |
3/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✓ Branch 6 taken 18 times.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSU) |
312 | { | ||
313 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->gnss1Outputs->posU.data()), sizeof(obs->gnss1Outputs->posU)); |
314 | } | ||
315 |
3/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✓ Branch 6 taken 18 times.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELU) |
316 | { | ||
317 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->velU), sizeof(obs->gnss1Outputs->velU)); |
318 | } | ||
319 |
3/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✓ Branch 6 taken 18 times.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TIMEU) |
320 | { | ||
321 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->timeU), sizeof(obs->gnss1Outputs->timeU)); |
322 | } | ||
323 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 30 times.
✗ Branch 6 not taken.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TIMEINFO) |
324 | { | ||
325 |
1/2✓ Branch 4 taken 30 times.
✗ Branch 5 not taken.
|
30 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->timeInfo.status.status()), sizeof(obs->gnss1Outputs->timeInfo.status.status())); |
326 |
1/2✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
|
30 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->timeInfo.leapSeconds), sizeof(obs->gnss1Outputs->timeInfo.leapSeconds)); |
327 | } | ||
328 |
3/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✓ Branch 6 taken 18 times.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP) |
329 | { | ||
330 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->dop.gDop), sizeof(obs->gnss1Outputs->dop.gDop)); |
331 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->dop.pDop), sizeof(obs->gnss1Outputs->dop.pDop)); |
332 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->dop.tDop), sizeof(obs->gnss1Outputs->dop.tDop)); |
333 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->dop.vDop), sizeof(obs->gnss1Outputs->dop.vDop)); |
334 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->dop.hDop), sizeof(obs->gnss1Outputs->dop.hDop)); |
335 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->dop.nDop), sizeof(obs->gnss1Outputs->dop.nDop)); |
336 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->dop.eDop), sizeof(obs->gnss1Outputs->dop.eDop)); |
337 | } | ||
338 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 30 times.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_SATINFO) |
339 | { | ||
340 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->satInfo.numSats), sizeof(obs->gnss1Outputs->satInfo.numSats)); | |
341 | |||
342 | ✗ | for (auto& satellite : obs->gnss1Outputs->satInfo.satellites) | |
343 | { | ||
344 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.sys), sizeof(satellite.sys)); | |
345 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.svId), sizeof(satellite.svId)); | |
346 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.flags), sizeof(satellite.flags)); | |
347 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.cno), sizeof(satellite.cno)); | |
348 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.qi), sizeof(satellite.qi)); | |
349 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.el), sizeof(satellite.el)); | |
350 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.az), sizeof(satellite.az)); | |
351 | } | ||
352 | } | ||
353 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 30 times.
|
30 | if (obs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_RAWMEAS) |
354 | { | ||
355 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->raw.tow), sizeof(obs->gnss1Outputs->raw.tow)); | |
356 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->raw.week), sizeof(obs->gnss1Outputs->raw.week)); | |
357 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->gnss1Outputs->raw.numSats), sizeof(obs->gnss1Outputs->raw.numSats)); | |
358 | |||
359 | ✗ | for (auto& satellite : obs->gnss1Outputs->raw.satellites) | |
360 | { | ||
361 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.sys), sizeof(satellite.sys)); | |
362 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.svId), sizeof(satellite.svId)); | |
363 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.freq), sizeof(satellite.freq)); | |
364 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.chan), sizeof(satellite.chan)); | |
365 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.slot), sizeof(satellite.slot)); | |
366 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.cno), sizeof(satellite.cno)); | |
367 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.flags), sizeof(satellite.flags)); | |
368 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.pr), sizeof(satellite.pr)); | |
369 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.cp), sizeof(satellite.cp)); | |
370 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.dp), sizeof(satellite.dp)); | |
371 | } | ||
372 | } | ||
373 | } | ||
374 | // Group 5 (Attitude) | ||
375 |
1/2✓ Branch 2 taken 30 times.
✗ Branch 3 not taken.
|
30 | if (obs->attitudeOutputs) |
376 | { | ||
377 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 30 times.
|
30 | if (obs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_VPESTATUS) |
378 | { | ||
379 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->attitudeOutputs->vpeStatus.status()), sizeof(obs->attitudeOutputs->vpeStatus.status())); | |
380 | } | ||
381 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 30 times.
✗ Branch 6 not taken.
|
30 | if (obs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_YAWPITCHROLL) |
382 | { | ||
383 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 30 times.
✗ Branch 7 not taken.
|
30 | _filestream.write(reinterpret_cast<const char*>(obs->attitudeOutputs->ypr.data()), sizeof(obs->attitudeOutputs->ypr)); |
384 | } | ||
385 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 30 times.
✗ Branch 6 not taken.
|
30 | if (obs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_QUATERNION) |
386 | { | ||
387 |
2/4✓ Branch 4 taken 30 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 30 times.
✗ Branch 8 not taken.
|
30 | _filestream.write(reinterpret_cast<const char*>(obs->attitudeOutputs->qtn.coeffs().data()), sizeof(obs->attitudeOutputs->qtn)); |
388 | } | ||
389 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 30 times.
|
30 | if (obs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_DCM) |
390 | { | ||
391 | ✗ | _filestream.write(reinterpret_cast<const char*>(obs->attitudeOutputs->dcm.data()), sizeof(obs->attitudeOutputs->dcm)); | |
392 | } | ||
393 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 30 times.
|
30 | if (obs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_MAGNED) |
394 | { | ||
395 | ✗ | _filestream.write(reinterpret_cast<const char*>(obs->attitudeOutputs->magNed.data()), sizeof(obs->attitudeOutputs->magNed)); | |
396 | } | ||
397 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 30 times.
|
30 | if (obs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_ACCELNED) |
398 | { | ||
399 | ✗ | _filestream.write(reinterpret_cast<const char*>(obs->attitudeOutputs->accelNed.data()), sizeof(obs->attitudeOutputs->accelNed)); | |
400 | } | ||
401 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 30 times.
|
30 | if (obs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_LINEARACCELBODY) |
402 | { | ||
403 | ✗ | _filestream.write(reinterpret_cast<const char*>(obs->attitudeOutputs->linearAccelBody.data()), sizeof(obs->attitudeOutputs->linearAccelBody)); | |
404 | } | ||
405 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 30 times.
|
30 | if (obs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_LINEARACCELNED) |
406 | { | ||
407 | ✗ | _filestream.write(reinterpret_cast<const char*>(obs->attitudeOutputs->linearAccelNed.data()), sizeof(obs->attitudeOutputs->linearAccelNed)); | |
408 | } | ||
409 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 30 times.
✗ Branch 6 not taken.
|
30 | if (obs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_YPRU) |
410 | { | ||
411 |
2/4✓ Branch 3 taken 30 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 30 times.
✗ Branch 7 not taken.
|
30 | _filestream.write(reinterpret_cast<const char*>(obs->attitudeOutputs->yprU.data()), sizeof(obs->attitudeOutputs->yprU)); |
412 | } | ||
413 | } | ||
414 | // Group 6 (INS) | ||
415 |
2/2✓ Branch 2 taken 12 times.
✓ Branch 3 taken 18 times.
|
30 | if (obs->insOutputs) |
416 | { | ||
417 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_INSSTATUS) |
418 | { | ||
419 |
1/2✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->insOutputs->insStatus.status()), sizeof(obs->insOutputs->insStatus.status())); |
420 | } | ||
421 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_POSLLA) |
422 | { | ||
423 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->insOutputs->posLla.data()), sizeof(obs->insOutputs->posLla)); |
424 | } | ||
425 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_POSECEF) |
426 | { | ||
427 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->insOutputs->posEcef.data()), sizeof(obs->insOutputs->posEcef)); |
428 | } | ||
429 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELBODY) |
430 | { | ||
431 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->insOutputs->velBody.data()), sizeof(obs->insOutputs->velBody)); |
432 | } | ||
433 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELNED) |
434 | { | ||
435 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->insOutputs->velNed.data()), sizeof(obs->insOutputs->velNed)); |
436 | } | ||
437 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELECEF) |
438 | { | ||
439 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->insOutputs->velEcef.data()), sizeof(obs->insOutputs->velEcef)); |
440 | } | ||
441 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_MAGECEF) |
442 | { | ||
443 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->insOutputs->magEcef.data()), sizeof(obs->insOutputs->magEcef)); |
444 | } | ||
445 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_ACCELECEF) |
446 | { | ||
447 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->insOutputs->accelEcef.data()), sizeof(obs->insOutputs->accelEcef)); |
448 | } | ||
449 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_LINEARACCELECEF) |
450 | { | ||
451 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->insOutputs->linearAccelEcef.data()), sizeof(obs->insOutputs->linearAccelEcef)); |
452 | } | ||
453 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_POSU) |
454 | { | ||
455 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->insOutputs->posU), sizeof(obs->insOutputs->posU)); |
456 | } | ||
457 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELU) |
458 | { | ||
459 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->insOutputs->velU), sizeof(obs->insOutputs->velU)); |
460 | } | ||
461 | } | ||
462 | // Group 7 (GNSS2) | ||
463 |
2/2✓ Branch 2 taken 12 times.
✓ Branch 3 taken 18 times.
|
30 | if (obs->gnss2Outputs) |
464 | { | ||
465 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC) |
466 | { | ||
467 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->timeUtc.year), sizeof(obs->gnss2Outputs->timeUtc.year)); |
468 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->timeUtc.month), sizeof(obs->gnss2Outputs->timeUtc.month)); |
469 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->timeUtc.day), sizeof(obs->gnss2Outputs->timeUtc.day)); |
470 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->timeUtc.hour), sizeof(obs->gnss2Outputs->timeUtc.hour)); |
471 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->timeUtc.min), sizeof(obs->gnss2Outputs->timeUtc.min)); |
472 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->timeUtc.sec), sizeof(obs->gnss2Outputs->timeUtc.sec)); |
473 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->timeUtc.ms), sizeof(obs->gnss2Outputs->timeUtc.ms)); |
474 | } | ||
475 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TOW) |
476 | { | ||
477 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->tow), sizeof(obs->gnss2Outputs->tow)); |
478 | } | ||
479 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_WEEK) |
480 | { | ||
481 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->week), sizeof(obs->gnss2Outputs->week)); |
482 | } | ||
483 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_NUMSATS) |
484 | { | ||
485 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->numSats), sizeof(obs->gnss2Outputs->numSats)); |
486 | } | ||
487 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_FIX) |
488 | { | ||
489 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->fix), sizeof(obs->gnss2Outputs->fix)); |
490 | } | ||
491 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSLLA) |
492 | { | ||
493 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->gnss2Outputs->posLla.data()), sizeof(obs->gnss2Outputs->posLla)); |
494 | } | ||
495 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSECEF) |
496 | { | ||
497 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->gnss2Outputs->posEcef.data()), sizeof(obs->gnss2Outputs->posEcef)); |
498 | } | ||
499 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELNED) |
500 | { | ||
501 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->gnss2Outputs->velNed.data()), sizeof(obs->gnss2Outputs->velNed)); |
502 | } | ||
503 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELECEF) |
504 | { | ||
505 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->gnss2Outputs->velEcef.data()), sizeof(obs->gnss2Outputs->velEcef)); |
506 | } | ||
507 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSU) |
508 | { | ||
509 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(obs->gnss2Outputs->posU.data()), sizeof(obs->gnss2Outputs->posU)); |
510 | } | ||
511 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELU) |
512 | { | ||
513 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->velU), sizeof(obs->gnss2Outputs->velU)); |
514 | } | ||
515 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TIMEU) |
516 | { | ||
517 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->timeU), sizeof(obs->gnss2Outputs->timeU)); |
518 | } | ||
519 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TIMEINFO) |
520 | { | ||
521 |
1/2✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->timeInfo.status.status()), sizeof(obs->gnss2Outputs->timeInfo.status.status())); |
522 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->timeInfo.leapSeconds), sizeof(obs->gnss2Outputs->timeInfo.leapSeconds)); |
523 | } | ||
524 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP) |
525 | { | ||
526 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->dop.gDop), sizeof(obs->gnss2Outputs->dop.gDop)); |
527 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->dop.pDop), sizeof(obs->gnss2Outputs->dop.pDop)); |
528 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->dop.tDop), sizeof(obs->gnss2Outputs->dop.tDop)); |
529 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->dop.vDop), sizeof(obs->gnss2Outputs->dop.vDop)); |
530 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->dop.hDop), sizeof(obs->gnss2Outputs->dop.hDop)); |
531 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->dop.nDop), sizeof(obs->gnss2Outputs->dop.nDop)); |
532 |
1/2✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
|
12 | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->dop.eDop), sizeof(obs->gnss2Outputs->dop.eDop)); |
533 | } | ||
534 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 12 times.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_SATINFO) |
535 | { | ||
536 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->satInfo.numSats), sizeof(obs->gnss2Outputs->satInfo.numSats)); | |
537 | |||
538 | ✗ | for (auto& satellite : obs->gnss2Outputs->satInfo.satellites) | |
539 | { | ||
540 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.sys), sizeof(satellite.sys)); | |
541 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.svId), sizeof(satellite.svId)); | |
542 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.flags), sizeof(satellite.flags)); | |
543 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.cno), sizeof(satellite.cno)); | |
544 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.qi), sizeof(satellite.qi)); | |
545 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.el), sizeof(satellite.el)); | |
546 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.az), sizeof(satellite.az)); | |
547 | } | ||
548 | } | ||
549 |
2/4✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 12 times.
|
12 | if (obs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_RAWMEAS) |
550 | { | ||
551 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->raw.tow), sizeof(obs->gnss2Outputs->raw.tow)); | |
552 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->raw.week), sizeof(obs->gnss2Outputs->raw.week)); | |
553 | ✗ | _filestream.write(reinterpret_cast<const char*>(&obs->gnss2Outputs->raw.numSats), sizeof(obs->gnss2Outputs->raw.numSats)); | |
554 | |||
555 | ✗ | for (auto& satellite : obs->gnss2Outputs->raw.satellites) | |
556 | { | ||
557 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.sys), sizeof(satellite.sys)); | |
558 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.svId), sizeof(satellite.svId)); | |
559 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.freq), sizeof(satellite.freq)); | |
560 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.chan), sizeof(satellite.chan)); | |
561 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.slot), sizeof(satellite.slot)); | |
562 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.cno), sizeof(satellite.cno)); | |
563 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.flags), sizeof(satellite.flags)); | |
564 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.pr), sizeof(satellite.pr)); | |
565 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.cp), sizeof(satellite.cp)); | |
566 | ✗ | _filestream.write(reinterpret_cast<const char*>(&satellite.dp), sizeof(satellite.dp)); | |
567 | } | ||
568 | } | ||
569 | } | ||
570 | } | ||
571 | else | ||
572 | { | ||
573 | ✗ | LOG_INFO("{}: If you want to log csv instead of binary, use the 'CsvLogger' instead.", nameId()); | |
574 | } | ||
575 | |||
576 | LOG_DATA("{}: Message logged", nameId()); | ||
577 | 30 | } | |
578 |