Skip to content

Commit

Permalink
Changes in newFPGA interface
Browse files Browse the repository at this point in the history
  • Loading branch information
pkubanek committed Jun 11, 2024
1 parent 93eb41b commit b1f4386
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/vmscli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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();
}
Expand Down
14 changes: 5 additions & 9 deletions utils/vmsrawdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit b1f4386

Please sign in to comment.