00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- 00002 00003 // -- BEGIN LICENSE BLOCK ---------------------------------------------- 00004 00024 // -- END LICENSE BLOCK ------------------------------------------------ 00025 00026 //---------------------------------------------------------------------- 00033 //---------------------------------------------------------------------- 00034 00035 #ifndef SICK_SAFETYSCANNERS_DATA_PROCESSING_PARSEGENERALSYSTEMSTATE_H 00036 #define SICK_SAFETYSCANNERS_DATA_PROCESSING_PARSEGENERALSYSTEMSTATE_H 00037 00038 #include <sick_safetyscanners/datastructure/Data.h> 00039 #include <sick_safetyscanners/datastructure/DerivedValues.h> 00040 #include <sick_safetyscanners/datastructure/PacketBuffer.h> 00041 00042 #include <sick_safetyscanners/data_processing/ReadWriteHelper.h> 00043 00044 #include <vector> 00045 00046 namespace sick { 00047 namespace data_processing { 00048 00052 class ParseGeneralSystemState 00053 { 00054 public: 00058 ParseGeneralSystemState(); 00059 00068 datastructure::GeneralSystemState 00069 parseUDPSequence(const sick::datastructure::PacketBuffer& buffer, 00070 datastructure::Data& data) const; 00071 00072 private: 00073 std::shared_ptr<sick::data_processing::ReadWriteHelper> m_reader_ptr; 00074 00075 void setDataInGeneralSystemState(const uint8_t*& data_ptr, 00076 datastructure::GeneralSystemState& general_System_state) const; 00077 void 00078 setStatusBitsInGeneralSystemState(const uint8_t*& data_ptr, 00079 datastructure::GeneralSystemState& general_System_state) const; 00080 void setSafeCutOffPathInGeneralSystemState( 00081 const uint8_t*& data_ptr, datastructure::GeneralSystemState& general_System_state) const; 00082 void setNonSafeCutOffPathInGeneralSystemState( 00083 const uint8_t*& data_ptr, datastructure::GeneralSystemState& general_System_state) const; 00084 void setResetRequiredCutOffPathInGeneralSystemState( 00085 const uint8_t*& data_ptr, datastructure::GeneralSystemState& general_System_state) const; 00086 void setCurrentMonitoringCasesInGeneralSystemState( 00087 const uint8_t*& data_ptr, datastructure::GeneralSystemState& general_System_state) const; 00088 void setErrorsInGeneralSystemState(const uint8_t*& data_ptr, 00089 datastructure::GeneralSystemState& general_System_state) const; 00090 bool checkIfPreconditionsAreMet(const datastructure::Data& data) const; 00091 bool checkIfGeneralSystemStateIsPublished(const datastructure::Data& data) const; 00092 bool checkIfDataContainsNeededParsedBlocks(const datastructure::Data& data) const; 00093 }; 00094 00095 } // namespace data_processing 00096 } // namespace sick 00097 00098 #endif // SICK_SAFETYSCANNERS_DATA_PROCESSING_PARSEGENERALSYSTEMSTATE_H