38 namespace data_processing {
50 return general_system_state;
53 const std::shared_ptr<std::vector<uint8_t>
const> vec_ptr = buffer.
getBuffer();
54 std::vector<uint8_t>::const_iterator data_ptr =
55 vec_ptr->begin() + data.
getDataHeaderPtr()->getGeneralSystemStateBlockOffset();
58 return general_system_state;
90 std::vector<uint8_t>::const_iterator data_ptr,
102 std::vector<uint8_t>::const_iterator data_ptr,
107 general_system_state.
setRunModeActive(static_cast<bool>(byte & (0x01 << 0)));
117 std::vector<uint8_t>::const_iterator data_ptr,
120 std::vector<bool> safe_cut_off_path;
122 for (uint8_t i = 0; i < 3; i++)
126 for (uint8_t j = 0; j < 8; j++)
133 safe_cut_off_path.push_back(static_cast<bool>(byte & (0x01 << j)));
140 std::vector<uint8_t>::const_iterator data_ptr,
143 std::vector<bool> non_safe_cut_off_path;
145 for (uint8_t i = 0; i < 3; i++)
149 for (uint8_t j = 0; j < 8; j++)
156 non_safe_cut_off_path.push_back(static_cast<bool>(byte & (0x01 << j)));
163 std::vector<uint8_t>::const_iterator data_ptr,
166 std::vector<bool> reset_required_cutoff_path;
168 for (uint8_t i = 0; i < 3; i++)
172 for (uint8_t j = 0; j < 8; j++)
179 reset_required_cutoff_path.push_back(static_cast<bool>(byte & (0x01 << j)));
186 std::vector<uint8_t>::const_iterator data_ptr,
200 std::vector<uint8_t>::const_iterator data_ptr,
205 general_system_state.
setDeviceError(static_cast<bool>(byte & (0x01 << 1)));
void setIsEmpty(bool is_empty)
Set if general system state has been enabled.
void setContaminationError(bool contamination_error)
Set if a contamination error exists.
The GeneralSystemState class. It includes a summary of the current system state, the state of the saf...
void setStatusBitsInGeneralSystemState(std::vector< uint8_t >::const_iterator data_ptr, datastructure::GeneralSystemState &general_system_state) const
A packetbuffer for the raw data from the sensor.
std::shared_ptr< std::vector< uint8_t > const > getBuffer() const
Getter to return a copy of the data saved in the PacketBuffer.
void setCurrentMonitoringCaseNoTable4(const uint8_t ¤t_monitoring_case_no_table_4)
Sets the current monitoring case table 4.
bool checkIfPreconditionsAreMet(const datastructure::Data &data) const
bool checkIfGeneralSystemStateIsPublished(const datastructure::Data &data) const
ParseGeneralSystemState()
Constructor of the parser.
void setRunModeActive(bool run_mode_active)
Setter for run mode.
void setResetRequiredCutOffPathVector(const std::vector< bool > &reset_required_cut_off_path_vector)
Sets the reset state for all cut-off paths.
void setNonSafeCutOffPathVector(const std::vector< bool > &non_safe_cut_off_path_vector)
Sets the state of all non-safe cut-off paths.
uint8_t readUint8LittleEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 8-bit integer at offset in big little encoding.
The data class containing all data blocks of a measurement.
void setDeviceError(bool device_error)
Set if a device error exists.
void setReferenceContourStatus(bool reference_contour_status)
Set the reference contour status.
void setApplicationError(bool application_error)
Set if an application error exists.
void setResetRequiredCutOffPathInGeneralSystemState(std::vector< uint8_t >::const_iterator data_ptr, datastructure::GeneralSystemState &general_system_state) const
void setManipulationStatus(bool manipulation_status)
Set the manipulation status.
void setStandbyModeActive(bool standby_mode_active)
Setter for standby mode.
void setCurrentMonitoringCaseNoTable3(const uint8_t ¤t_monitoring_case_no_table_3)
Sets the current monitoring case table 3.
void setDataInGeneralSystemState(std::vector< uint8_t >::const_iterator data_ptr, datastructure::GeneralSystemState &general_system_state) const
void setCurrentMonitoringCasesInGeneralSystemState(std::vector< uint8_t >::const_iterator data_ptr, datastructure::GeneralSystemState &general_system_state) const
void setCurrentMonitoringCaseNoTable1(const uint8_t ¤t_monitoring_case_no_table_1)
Sets the current monitoring case table 1.
datastructure::GeneralSystemState parseUDPSequence(const sick::datastructure::PacketBuffer &buffer, datastructure::Data &data) const
Parses the udp sequence to read the general system state if enabled.
void setSafeCutOffPathInGeneralSystemState(std::vector< uint8_t >::const_iterator data_ptr, datastructure::GeneralSystemState &general_system_state) const
bool checkIfDataContainsNeededParsedBlocks(const datastructure::Data &data) const
std::shared_ptr< DataHeader > getDataHeaderPtr() const
Gets the data header.
void setCurrentMonitoringCaseNoTable2(const uint8_t ¤t_monitoring_case_no_table_2)
Sets the current monitoring case table 2.
void setErrorsInGeneralSystemState(std::vector< uint8_t >::const_iterator data_ptr, datastructure::GeneralSystemState &general_system_state) const
void setSafeCutOffPathvector(const std::vector< bool > &safe_cut_off_path_vector)
Sets the state of all safe cut-off paths.
void setContaminationWarning(bool contamination_warning)
Set if a contamination warning exists.
void setNonSafeCutOffPathInGeneralSystemState(std::vector< uint8_t >::const_iterator data_ptr, datastructure::GeneralSystemState &general_system_state) const