mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-13 15:57:14 +02:00
restructure zmq socker interface
zmq socket can now return vector of frames. it knows end of transmission with header.data == 0 it can also send vector of frames
This commit is contained in:
@ -58,6 +58,14 @@ class Frame {
|
||||
other.m_data = nullptr;
|
||||
other.m_rows = other.m_cols = other.m_bitdepth = 0;
|
||||
}
|
||||
// copy constructor
|
||||
Frame(const Frame &other) {
|
||||
m_rows = other.rows();
|
||||
m_cols = other.cols();
|
||||
m_bitdepth = other.bitdepth();
|
||||
m_data = new std::byte[m_rows * m_cols * m_bitdepth / 8];
|
||||
std::memcpy(m_data, other.m_data, m_rows * m_cols * m_bitdepth / 8);
|
||||
}
|
||||
|
||||
template <typename T> NDView<T> view() {
|
||||
std::vector<ssize_t> shape = {m_rows, m_cols};
|
||||
|
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <fmt/format.h>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <sys/types.h>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
|
@ -31,8 +31,7 @@ template <> DetectorType StringTo(std::string name) {
|
||||
else if (name == "ChipTestBoard")
|
||||
return DetectorType::ChipTestBoard;
|
||||
else {
|
||||
auto msg = fmt::format("Could not decode dector from: \"{}\"", name);
|
||||
throw std::runtime_error(msg);
|
||||
throw std::runtime_error("Could not decode dector from: \"" + name + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,8 +41,7 @@ template <> TimingMode StringTo(std::string mode) {
|
||||
else if (mode == "trigger")
|
||||
return TimingMode::Trigger;
|
||||
else {
|
||||
auto msg = fmt::format("Could not decode timing mode from: \"{}\"", mode);
|
||||
throw std::runtime_error(msg);
|
||||
throw std::runtime_error("Could not decode timing mode from: \"" + mode + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user