diff --git a/src/ts-VMSd.cpp b/src/ts-VMSd.cpp index 2bec8b4..7913d62 100644 --- a/src/ts-VMSd.cpp +++ b/src/ts-VMSd.cpp @@ -31,13 +31,13 @@ #include #include -#include #include #include #include #include #include #include +#include #include #include #include @@ -64,7 +64,7 @@ class MTVMSd : public LSST::cRIO::CSC { // SAL object to receive all events from other VMS std::shared_ptr _allvmsSAL; - Accelerometer *accelerometer; + SALAccelerometer *accelerometer; }; SALSinkMacro(MTVMS); @@ -124,7 +124,7 @@ void MTVMSd::init() { // spdlog::apply_all([&](std::shared_ptr l) { l->flush(); }); - accelerometer = new Accelerometer(&_vmsApplicationSettings); + accelerometer = new SALAccelerometer(&_vmsApplicationSettings); SPDLOG_INFO("Main: Setting publisher"); VMSPublisher::instance().setSAL(_vmsSAL); diff --git a/utils/vmsrawdump.cpp b/utils/vmsrawdump.cpp index be93b6f..16dbb31 100644 --- a/utils/vmsrawdump.cpp +++ b/utils/vmsrawdump.cpp @@ -138,9 +138,17 @@ void dump_file(const char *filename) { std::cout << std::endl; auto micros_d = duration_cast(system_clock::now().time_since_epoch()).count(); + long int old_micros = 0; while (!file.eof()) { file.read(reinterpret_cast(µs_d), sizeof(micros_d)); + + if (old_micros >= micros_d) { + std::cerr << "Recorded timestamps in file " << filename << " aren't increasing (" + << old_micros << " >= " << micros_d << "), skipping rest of the file!" << std::endl; + return; + } + microseconds micros(micros_d); seconds sec = duration_cast(micros); micros -= sec; @@ -159,6 +167,8 @@ void dump_file(const char *filename) { } std::cout << std::endl; + + old_micros = micros_d; } } catch (const std::ios_base::failure &e) { if (file.eof()) {