MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / ParseRangeDataRecords

Method ParseRangeDataRecords

lib/mdflib/mdflib/src/dg3block.cpp:254–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

252}
253
254void Dg3Block::ParseRangeDataRecords(std::streambuf& buffer, uint64_t nof_data_bytes,
255 DgRange& range) {
256 if (nof_data_bytes == 0) {
257 return;
258 }
259 for (const auto& channel_group : Cg3() ) {
260 if (channel_group) {
261 channel_group->ResetSampleCounter();
262 }
263 }
264
265 for (uint64_t count = 0; count < nof_data_bytes; /* No ++count here*/) {
266 // 1. Read Record ID
267 uint8_t record_id = 0;
268 if (nof_record_id_ == 1 || nof_record_id_ == 2) {
269 count += ReadNumber(buffer, record_id);
270 }
271 const auto *cg3 = FindCgRecordId(record_id);
272 const auto* cg_range = range.GetCgRange(record_id);
273 if (cg3 == nullptr || cg_range == nullptr) {
274 break;
275 }
276
277 const auto read = cg3->ReadRangeDataRecord(buffer,
278 *this,
279 range);
280 if (read == 0) {
281 break;
282 }
283 count += read;
284 if (nof_record_id_ == 2) {
285 count += ReadNumber(buffer, record_id);
286 }
287 if (range.IsReady()) {
288 break;
289 }
290 }
291}
292
293const Cg3Block *Dg3Block::FindCgRecordId(const uint64_t record_id) const {
294 if (cg_list_.size() == 1) {

Callers

nothing calls this directly

Calls 4

ResetSampleCounterMethod · 0.80
GetCgRangeMethod · 0.80
ReadRangeDataRecordMethod · 0.80
IsReadyMethod · 0.80

Tested by

no test coverage detected