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

Method ReadData

lib/mdflib/mdflib/src/mdfreader.cpp:507–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

505}
506
507bool MdfReader::ReadData(IDataGroup &data_group) {
508 if (!instance_ || !file_) {
509 MDF_ERROR() << "No instance created. File: " << filename_;
510 return false;
511 }
512
513 bool shall_close = !IsOpen() && Open();
514 if (!IsOpen()) {
515 MDF_ERROR() << "Didn't open the file. File: " << filename_;
516 return false;
517 }
518
519 bool error = false;
520 try {
521 if (instance_->IsMdf4()) {
522 auto &dg4 = dynamic_cast<detail::Dg4Block &>(data_group);
523 dg4.ReadData(*file_);
524 } else {
525 auto &dg3 = dynamic_cast<detail::Dg3Block &>(data_group);
526 dg3.ReadData(*file_);
527 }
528 } catch (const std::exception &err) {
529 MDF_ERROR() << "Didn't read the file information blocks. Error: "
530 << err.what() << ", File: " << filename_;
531 error = true;
532 }
533
534 if (shall_close) {
535 Close();
536 }
537 return !error;
538}
539
540bool MdfReader::ReadPartialData(IDataGroup &data_group, size_t min_sample,
541 size_t max_sample) {

Callers 2

ExportAttachmentDataMethod · 0.45
ReadSrDataMethod · 0.45

Calls 1

IsMdf4Method · 0.45

Tested by

no test coverage detected