21 #include <fmt/format.h> 22 #include <fmt/ostream.h> 30 PinState::PinState(uint32_t pin_id,
const std::string& name,
bool state) : id_(pin_id), name_(name), state_(state)
61 os << fmt::format(
"PinState(id = {}, name = {}, state = {})", pin_state.
id(), pin_state.
name(), pin_state.
state());
66 : pin_data_(pin_data), timestamp_(timestamp)
107 return os <<
"IOState(timestamp = " << io_state.
timestamp_ <<
" nsec, " << io_state.
pin_data_ <<
")";
PinState(uint32_t pin_id, const std::string &name, bool state)
int64_t timestamp() const
Represents the set of all I/Os of the scanner and their states.
bool operator==(const PinState &ps) const
Represents a single I/O pin.
data_conversion_layer::monitoring_frame::io::PinData pin_data_
static std::vector< PinState > generateChangedOutputStates(const monitoring_frame::io::PinData &new_state, const monitoring_frame::io::PinData &old_state)
static std::vector< PinState > generateChangedInputStates(const monitoring_frame::io::PinData &new_state, const monitoring_frame::io::PinData &old_state)
std::ostream & operator<<(std::ostream &os, const PinState &pin_state)
std::vector< PinState > input() const
Represents the IO PIN field of a monitoring frame.
static std::vector< PinState > generateOutputPinStates(const monitoring_frame::io::PinData &pin_data)
std::vector< PinState > output() const
Root namespace in which the software components to communicate with the scanner (firmware-version: 2)...
bool operator!=(const PinState &ps) const
std::vector< PinState > changedInputStates(const IOState &ref_state) const
std::vector< PinState > changedOutputStates(const IOState &ref_state) const
bool operator==(const IOState &io_state) const
bool operator!=(const IOState &io_state) const
friend std::ostream & operator<<(std::ostream &os, const IOState &io_state)
static std::vector< PinState > generateInputPinStates(const monitoring_frame::io::PinData &pin_data)