From b1f4386f49dc2a61f9de992c1251979cd32b5e81 Mon Sep 17 00:00:00 2001 From: Petr Kubanek Date: Tue, 11 Jun 2024 15:30:22 +0200 Subject: [PATCH] Changes in newFPGA interface --- src/vmscli.cpp | 5 +++-- utils/vmsrawdump.cpp | 14 +++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/vmscli.cpp b/src/vmscli.cpp index 6e4c4eb..2d340f6 100644 --- a/src/vmscli.cpp +++ b/src/vmscli.cpp @@ -47,7 +47,7 @@ class VMScli : public SimpleFPGACliApp { int record(command_vec cmds); protected: - virtual SimpleFPGA* newFPGA(const char* dir) override; + virtual SimpleFPGA* newFPGA(const char* dir, bool& fpga_singleton) override; private: std::string _subsystem = ""; @@ -145,10 +145,11 @@ int VMScli::record(command_vec cmds) { return 0; } -SimpleFPGA* VMScli::newFPGA(const char* dir) { +SimpleFPGA* VMScli::newFPGA(const char* dir, bool& fpga_singleton) { _settings = SettingReader::instance().loadVMSApplicationSettings(_subsystem); SPDLOG_INFO("Creating FPGA"); FPGA::instance().populate(&_settings); + fpga_singleton = true; return &FPGA::instance(); } diff --git a/utils/vmsrawdump.cpp b/utils/vmsrawdump.cpp index 4cf0913..be93b6f 100644 --- a/utils/vmsrawdump.cpp +++ b/utils/vmsrawdump.cpp @@ -97,15 +97,6 @@ using namespace std::chrono; void dump_file(const char *filename) { std::ifstream file; - for (int i = 1; i <= 8; i++) { - std::cout << "Acc" << +i; - if (i < 8) { - std::cout << ","; - } - } - - std::cout << std::endl; - try { // auto file = std::ifstream(argv[i], std::ifstream::in | // std::fstream::binary); @@ -129,6 +120,11 @@ void dump_file(const char *filename) { uint8_t sensors = subsystem[len - 1]; subsystem[len - 1] = 0; + if (!(sensors == 3 || sensors == 6)) { + std::cerr << "Expect to see 3 or 6 sensors in " << filename << ", saw " << +sensors << "." + << std::endl; + } + std::cout << subsystem << " time (UTC)"; int i;