16 #ifndef PSEN_SCAN_V2_STANDALONE_IO_STATE_H 17 #define PSEN_SCAN_V2_STANDALONE_IO_STATE_H 41 std::string
name()
const;
55 return fmt::format(
"{} = {}", pin.
name(), pin.
state());
61 std::stringstream strstr;
63 for (
auto it = pins.begin(); std::next(it) < pins.end(); ++it)
82 std::vector<PinState> input()
const;
84 std::vector<PinState> output()
const;
86 int64_t timestamp()
const;
91 std::vector<PinState> changedInputStates(
const IOState& ref_state)
const;
96 std::vector<PinState> changedOutputStates(
const IOState& ref_state)
const;
106 int64_t timestamp_{};
112 #endif // PSEN_SCAN_V2_STANDALONE_IO_STATE_H PinState(uint32_t pin_id, const std::string &name, bool state)
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.
std::string formatPinStates(const std::vector< PinState > &pins)
Formats a vector of PinStates.
std::ostream & operator<<(std::ostream &os, const PinState &pin_state)
Represents the IO PIN field of a monitoring frame.
std::string formatPinState(const PinState &pin)
Formats a PinState just using its name and state. (e.g. Safety 1 intrusion = true) ...
Root namespace in which the software components to communicate with the scanner (firmware-version: 2)...
bool operator!=(const PinState &ps) const