Public Member Functions | Protected Types | Static Protected Attributes | Private Member Functions | Private Attributes | List of all members
devices::LdmrsSopasLayer Class Reference

#include <LdmrsSopasLayer.hpp>

Inheritance diagram for devices::LdmrsSopasLayer:
Inheritance graph
[legend]

Public Member Functions

bool action_flashFieldParameters ()
 
bool action_flashMrsParameters ()
 
bool action_login ()
 
bool action_logout ()
 
bool action_readEvalCases ()
 
bool action_readFields ()
 
bool action_readScanConfig ()
 
bool action_readSerialNumber ()
 
bool action_startMeasure ()
 
bool action_stopMeasure ()
 
bool action_subscribeEvalCaseResults ()
 
bool action_subscribeScanData ()
 
bool action_unSubscribeEvalCaseResults ()
 
bool action_unSubscribeScanData ()
 
bool action_writeEvalCases (const EvalCases &evalCases)
 
bool action_writeField (UINT16 fieldNum, const FieldParameter &para)
 
bool init (Tcp::DisconnectFunction function, void *obj)
 
bool isFieldDataSubscribed () const
 
 LdmrsSopasLayer (Manager *manager, const UINT8 deviceID, std::string ipAddress, UINT16 portNumber, bool weWantFieldData, bool weWantScanData, bool readOnlyMode)
 
bool run ()
 
virtual ~LdmrsSopasLayer ()
 
- Public Member Functions inherited from devices::SopasBase
bool action_getScannerTypeAndVersion ()
 Reads the scanner type and version variable from the sensor and stores it in the member variables. This is done always by name. More...
 
bool connect ()
 Connects to a sensor via tcp and reads the device name. More...
 
bool disconnect ()
 Closes the connection to the LMS. This is the opposite of init(). More...
 
const std::string & getScannerName () const
 
const std::string & getScannerVersion () const
 
virtual bool init (SopasProtocol protocol, std::string ipAddress, UINT16 portNumber, bool weWantScanData, bool weWantFieldData, bool readOnlyMode, Tcp::DisconnectFunction disconnectFunction, void *obj)
 Initialization. More...
 
bool invokeMethod (const std::string &methodeName, BYTE *parameters, UINT16 parametersLength, SopasAnswer *&answer)
 Invoke a method on the sensor. More...
 
bool invokeMethod (UINT16 index, BYTE *parameters, UINT16 parametersLength, SopasAnswer *&answer)
 Invoke a method on the sensor. More...
 
bool isConnected ()
 Returns true if the tcp connection is established. More...
 
bool isReadOnly ()
 
double makeAngleValid (double angle)
 
bool readVariable (const std::string &variableName, SopasAnswer *&answer)
 Reads a variable from the sensor by name. More...
 
bool readVariable (UINT16 index, SopasAnswer *&answer)
 Reads a variable from the sensor by index. More...
 
bool registerEvent (const std::string &eventName)
 Registers an event by name. More...
 
bool registerEvent (UINT16 index)
 Registers an event by index. More...
 
void setEventCallbackFunction (DecoderFunction decoderFunction, const std::string &eventName)
 
void setEventCallbackFunction (DecoderFunction decoderFunction, UINT16 eventIndex)
 
void setReadOnlyMode (bool mode)
 
 SopasBase ()
 Default constructor. More...
 
bool unregisterEvent (const std::string &eventName)
 Unregisters an event by name. More...
 
bool unregisterEvent (UINT16 index)
 Unregisters an event by index. More...
 
bool writeVariable (const std::string &variableName, BYTE *parameters, UINT16 parametersLength)
 Write a variable to the sensor by name. More...
 
bool writeVariable (UINT16 index, BYTE *parameters, UINT16 parametersLength)
 Write a variable to the sensor by index. More...
 
virtual ~SopasBase ()
 Destructor. More...
 

Protected Types

enum  ScanFreqEnum { ScanFreq1250 = 0, ScanFreq2500 = 1, ScanFreq5000 = 2 }
 
enum  SopasEventByIndex_LDMRS { index_event_Scanning = 0x0000, index_event_ScanDataMonitor = 0x0011, index_event_aEvalCaseResult = 0x0029 }
 
enum  SopasMethodByIndex_LDMRS {
  index_meth_SetAccessMode = 0x0000, index_meth_GetAccessMode = 0x0001, index_meth_Run = 0x0002, index_meth_FlashFieldParameters = 0x0003,
  index_meth_GetDescription = 0x0004, index_meth_CheckPassword = 0x0005, index_meth_MthdFlashLUXParameters = 0x0006, index_meth_mStartMeasure = 0x000b,
  index_meth_mStopMeasure = 0x000c
}
 
enum  SopasVariableByIndex_LDMRS {
  index_var_DeviceIdent = 0x00, index_var_SOPASVersion = 0x01, index_var_LocationName = 0x02, index_var_SerialNumber = 0x03,
  index_var_FirmwareVersion = 0x04, index_var_Scanning = 0x05, index_var_SopasInfo = 0x06, index_var_InternalFeedback = 0x07,
  index_var_TestScanFrequency = 0x08, index_var_CIDChecksum = 0x09, index_var_TestScanActive = 0x0a, index_var_ScanDataConfig = 0x0b,
  index_var_AngleDataConfig = 0x0c, index_var_LayerEchoConfig = 0x0d, index_var_ScanConfig = 0x0e, index_var_MeasMode = 0x0f,
  index_var_ApplRange = 0x10, index_var_DataOutputRange = 0x11, index_var_AutoStartMeasure = 0x12, index_var_field000 = 0x003d,
  index_var_field001 = 0x003e, index_var_field002 = 0x003f, index_var_field003 = 0x0040, index_var_field004 = 0x0041,
  index_var_field005 = 0x0042, index_var_field006 = 0x0043, index_var_field007 = 0x0044, index_var_field008 = 0x0045,
  index_var_field009 = 0x0046, index_var_field010 = 0x0047, index_var_field011 = 0x0048, index_var_field012 = 0x0049,
  index_var_field013 = 0x004a, index_var_field014 = 0x004b, index_var_field015 = 0x004c, index_var_numOfParamFields = 0x004d,
  index_var_evalCaseParam = 0x004e
}
 
- Protected Types inherited from devices::SopasBase
enum  SopasCommand {
  CMD_UNKNOWN = 0, RI = 1, WI = 2, MI = 3,
  AI = 4, EI = 5, SI = 6, RA = 7,
  WA = 8, MA = 9, AA = 10, EA = 11,
  SA = 12, RN = 20, AN = 21, SN = 22,
  FA = 50
}
 
enum  State { CONSTRUCTED, CONNECTED }
 

Static Protected Attributes

static const UINT16 MAX_NUM_OF_FIELDS = 16
 

Private Member Functions

double angleToRad (INT32 angle)
 computes an angle in [rad] from INT32 as 1/10000 deg in scanner coordinate system More...
 
EvalCases colaB_evalCaseDecoder (SopasAnswer *answer)
 
UINT32 colaB_evalCaseEncoder (BYTE *buffer, const EvalCases &evalCases)
 
FieldParametercolaB_fieldDecoder (SopasAnswer *answer)
 
UINT32 colaB_fieldEncoder (BYTE *buffer, const FieldParameter &fieldPara)
 
void evalCaseResultDecoder (SopasEventMessage &frame)
 
SensorStateInfo getSensorStateInfo ()
 
void scanDataDecoder (SopasEventMessage &frame)
 

Private Attributes

double m_angleResolution
 
bool m_beVerbose
 
UINT32 m_deviceId
 
EvalCases m_evalCases
 
Fields m_fields
 
std::string m_ipAddress
 
EvalCaseResults m_lastEvalCaseResults
 
Managerm_manager
 
UINT16 m_portNumber
 
bool m_readOnlyMode
 
double m_scanEndAngle
 
double m_scanFreq
 
double m_scanStartAngle
 

Additional Inherited Members

- Public Types inherited from devices::SopasBase
typedef void(* DecoderFunction) (SopasEventMessage &frame)
 
enum  SopasEncoding { ByName, ByIndex }
 
enum  SopasMessageType {
  MSG_UNKNOWN, MSG_SEND_EVENT, MSG_READ_VARIABLE_ANSWER, MSG_WRITE_VARIABLE_ANSWER,
  MSG_INVOKE_METHOD_ANSWER, MSG_METHOD_RESULT_ANSWER, MSG_REGISTER_EVENT_ANSWER, MSG_EVENT_ACKNOWLEDGE,
  MSG_ERROR
}
 types of answers of the sensor More...
 
enum  SopasProtocol { CoLa_A, CoLa_B }
 
- Static Public Member Functions inherited from devices::SopasBase
static std::string convertSopasErrorCodeToText (UINT16 errorCode)
 
- Static Public Attributes inherited from devices::SopasBase
static const std::string COMMAND_Event_Acknowledge
 
static const std::string COMMAND_Invoke_Method_Answer
 
static const std::string COMMAND_Invoke_Method_ByIndex
 
static const std::string COMMAND_Invoke_Method_ByName
 
static const std::string COMMAND_Method_Result_Answer
 
static const std::string COMMAND_Method_Result_ByIndex
 
static const std::string COMMAND_Method_Result_ByName
 
static const std::string COMMAND_Read_Variable_Answer
 
static const std::string COMMAND_Read_Variable_ByIndex
 
static const std::string COMMAND_Read_Variable_ByName
 
static const std::string COMMAND_Register_Event_Answer
 
static const std::string COMMAND_Register_Event_ByIndex
 
static const std::string COMMAND_Register_Event_ByName
 
static const std::string COMMAND_Send_Event_ByIndex
 
static const std::string COMMAND_Send_Event_ByName
 
static const std::string COMMAND_Write_Variable_Answer
 
static const std::string COMMAND_Write_Variable_ByIndex
 
static const std::string COMMAND_Write_Variable_ByName
 
static const std::string EVENTNAME_SUBSCRIBE_EVALCASES
 
static const std::string EVENTNAME_SUBSCRIBE_SCANS
 
static const UINT16 INDEX_DEVICE_IDENT = 0
 
static const std::string METHODNAME_LOGIN
 
static const std::string METHODNAME_LOGOUT
 
static const std::string METHODNAME_SET_SCANCONFIG
 
static const std::string METHODNAME_START_MEASURE
 
static const std::string METHODNAME_STOP_MEASURE
 
static const std::string VARIABLENAME_DATAOUTPUTRANGE
 
static const std::string VARIABLENAME_DEVICEIDENT
 
static const std::string VARIABLENAME_SCANCONFIG
 
static const std::string VARIABLENAME_SCANDATACONFIG
 
- Protected Member Functions inherited from devices::SopasBase
SopasCommand colaA_decodeCommand (std::string *rxData)
 
bool receiveAnswer (SopasCommand cmd, std::string name, UINT32 timeout, SopasAnswer *&answer)
 Take answer from read thread and decode it. Waits for a certain answer by name. Event data (scans) are filtered and processed by read thread. More...
 
bool receiveAnswer (SopasCommand cmd, UINT16 index, UINT32 timeout, SopasAnswer *&answer)
 
bool receiveAnswer_CoLa_A (SopasCommand cmd, std::string name, UINT32 timeout, SopasAnswer *&answer)
 
bool receiveAnswer_CoLa_A (SopasCommand cmd, UINT16 index, UINT32 timeout, SopasAnswer *&answer)
 
bool receiveAnswer_CoLa_B (SopasCommand cmd, std::string name, UINT32 timeout, SopasAnswer *&answer)
 
bool receiveAnswer_CoLa_B (SopasCommand cmd, UINT16 index, UINT32 timeout, SopasAnswer *&answer)
 
void sendCommandBuffer (UINT8 *buffer, UINT16 len)
 Sends the content of the buffer via TCP to the sensor. More...
 
std::string sopasCommandToString (SopasCommand cmd)
 
SopasCommand stringToSopasCommand (const std::string &cmdString)
 Converts strings in sopas answer buffer to SopasCommand enum. More...
 
- Protected Attributes inherited from devices::SopasBase
bool m_beVerbose
 
bool m_fieldEventIsRegistered
 
bool m_isLoggedIn
 
bool m_scanEventIsRegistered
 
std::string m_scannerName
 Read from scanner. More...
 
std::string m_scannerVersion
 Read from scanner. More...
 
State m_state
 Device info. More...
 
bool m_weWantFieldData
 Flag to enable/disable protection field data reception. More...
 
bool m_weWantScanData
 Flag to enable/disable scan data reception. More...
 

Detailed Description

Definition at line 27 of file LdmrsSopasLayer.hpp.

Member Enumeration Documentation

Enumerator
ScanFreq1250 
ScanFreq2500 
ScanFreq5000 

Definition at line 69 of file LdmrsSopasLayer.hpp.

Enumerator
index_event_Scanning 
index_event_ScanDataMonitor 
index_event_aEvalCaseResult 

Definition at line 134 of file LdmrsSopasLayer.hpp.

Enumerator
index_meth_SetAccessMode 
index_meth_GetAccessMode 
index_meth_Run 
index_meth_FlashFieldParameters 
index_meth_GetDescription 
index_meth_CheckPassword 
index_meth_MthdFlashLUXParameters 
index_meth_mStartMeasure 
index_meth_mStopMeasure 

Definition at line 121 of file LdmrsSopasLayer.hpp.

Enumerator
index_var_DeviceIdent 
index_var_SOPASVersion 
index_var_LocationName 
index_var_SerialNumber 
index_var_FirmwareVersion 
index_var_Scanning 
index_var_SopasInfo 
index_var_InternalFeedback 
index_var_TestScanFrequency 
index_var_CIDChecksum 
index_var_TestScanActive 
index_var_ScanDataConfig 
index_var_AngleDataConfig 
index_var_LayerEchoConfig 
index_var_ScanConfig 
index_var_MeasMode 
index_var_ApplRange 
index_var_DataOutputRange 
index_var_AutoStartMeasure 
index_var_field000 
index_var_field001 
index_var_field002 
index_var_field003 
index_var_field004 
index_var_field005 
index_var_field006 
index_var_field007 
index_var_field008 
index_var_field009 
index_var_field010 
index_var_field011 
index_var_field012 
index_var_field013 
index_var_field014 
index_var_field015 
index_var_numOfParamFields 
index_var_evalCaseParam 

Definition at line 77 of file LdmrsSopasLayer.hpp.

Constructor & Destructor Documentation

devices::LdmrsSopasLayer::LdmrsSopasLayer ( Manager manager,
const UINT8  deviceID,
std::string  ipAddress,
UINT16  portNumber,
bool  weWantFieldData,
bool  weWantScanData,
bool  readOnlyMode 
)

Definition at line 20 of file LdmrsSopasLayer.cpp.

devices::LdmrsSopasLayer::~LdmrsSopasLayer ( )
virtual

Definition at line 41 of file LdmrsSopasLayer.cpp.

Member Function Documentation

bool devices::LdmrsSopasLayer::action_flashFieldParameters ( )

Definition at line 186 of file LdmrsSopasLayer.cpp.

bool devices::LdmrsSopasLayer::action_flashMrsParameters ( )

Definition at line 242 of file LdmrsSopasLayer.cpp.

bool devices::LdmrsSopasLayer::action_login ( )

Definition at line 300 of file LdmrsSopasLayer.cpp.

bool devices::LdmrsSopasLayer::action_logout ( )

Definition at line 363 of file LdmrsSopasLayer.cpp.

bool devices::LdmrsSopasLayer::action_readEvalCases ( )

Definition at line 579 of file LdmrsSopasLayer.cpp.

bool devices::LdmrsSopasLayer::action_readFields ( )

Definition at line 879 of file LdmrsSopasLayer.cpp.

bool devices::LdmrsSopasLayer::action_readScanConfig ( )

Definition at line 532 of file LdmrsSopasLayer.cpp.

bool devices::LdmrsSopasLayer::action_readSerialNumber ( )
bool devices::LdmrsSopasLayer::action_startMeasure ( )
bool devices::LdmrsSopasLayer::action_stopMeasure ( )
bool devices::LdmrsSopasLayer::action_subscribeEvalCaseResults ( )

Definition at line 427 of file LdmrsSopasLayer.cpp.

bool devices::LdmrsSopasLayer::action_subscribeScanData ( )

Definition at line 478 of file LdmrsSopasLayer.cpp.

bool devices::LdmrsSopasLayer::action_unSubscribeEvalCaseResults ( )

Definition at line 455 of file LdmrsSopasLayer.cpp.

bool devices::LdmrsSopasLayer::action_unSubscribeScanData ( )

Definition at line 512 of file LdmrsSopasLayer.cpp.

bool devices::LdmrsSopasLayer::action_writeEvalCases ( const EvalCases evalCases)

Definition at line 839 of file LdmrsSopasLayer.cpp.

bool devices::LdmrsSopasLayer::action_writeField ( UINT16  fieldNum,
const FieldParameter para 
)

Definition at line 798 of file LdmrsSopasLayer.cpp.

double devices::LdmrsSopasLayer::angleToRad ( INT32  angle)
private

computes an angle in [rad] from INT32 as 1/10000 deg in scanner coordinate system

Definition at line 938 of file LdmrsSopasLayer.cpp.

EvalCases devices::LdmrsSopasLayer::colaB_evalCaseDecoder ( SopasAnswer answer)
private

Definition at line 600 of file LdmrsSopasLayer.cpp.

UINT32 devices::LdmrsSopasLayer::colaB_evalCaseEncoder ( BYTE buffer,
const EvalCases evalCases 
)
private

Definition at line 670 of file LdmrsSopasLayer.cpp.

FieldParameter * devices::LdmrsSopasLayer::colaB_fieldDecoder ( SopasAnswer answer)
private

Definition at line 949 of file LdmrsSopasLayer.cpp.

UINT32 devices::LdmrsSopasLayer::colaB_fieldEncoder ( BYTE buffer,
const FieldParameter fieldPara 
)
private

Definition at line 1617 of file LdmrsSopasLayer.cpp.

void devices::LdmrsSopasLayer::evalCaseResultDecoder ( SopasEventMessage frame)
privatevirtual

Implements devices::SopasBase.

Definition at line 1376 of file LdmrsSopasLayer.cpp.

SensorStateInfo devices::LdmrsSopasLayer::getSensorStateInfo ( )
private

Definition at line 1537 of file LdmrsSopasLayer.cpp.

bool devices::LdmrsSopasLayer::init ( Tcp::DisconnectFunction  function,
void *  obj 
)

Definition at line 47 of file LdmrsSopasLayer.cpp.

bool devices::LdmrsSopasLayer::isFieldDataSubscribed ( ) const
inline

Definition at line 60 of file LdmrsSopasLayer.hpp.

bool devices::LdmrsSopasLayer::run ( )

Definition at line 139 of file LdmrsSopasLayer.cpp.

void devices::LdmrsSopasLayer::scanDataDecoder ( SopasEventMessage frame)
privatevirtual

Implements devices::SopasBase.

Definition at line 1111 of file LdmrsSopasLayer.cpp.

Member Data Documentation

double devices::LdmrsSopasLayer::m_angleResolution
private

Definition at line 160 of file LdmrsSopasLayer.hpp.

bool devices::LdmrsSopasLayer::m_beVerbose
private

Definition at line 154 of file LdmrsSopasLayer.hpp.

UINT32 devices::LdmrsSopasLayer::m_deviceId
private

Definition at line 153 of file LdmrsSopasLayer.hpp.

EvalCases devices::LdmrsSopasLayer::m_evalCases
private

Definition at line 157 of file LdmrsSopasLayer.hpp.

Fields devices::LdmrsSopasLayer::m_fields
private

Definition at line 158 of file LdmrsSopasLayer.hpp.

std::string devices::LdmrsSopasLayer::m_ipAddress
private

Definition at line 166 of file LdmrsSopasLayer.hpp.

EvalCaseResults devices::LdmrsSopasLayer::m_lastEvalCaseResults
private

Definition at line 156 of file LdmrsSopasLayer.hpp.

Manager* devices::LdmrsSopasLayer::m_manager
private

Definition at line 152 of file LdmrsSopasLayer.hpp.

UINT16 devices::LdmrsSopasLayer::m_portNumber
private

Definition at line 167 of file LdmrsSopasLayer.hpp.

bool devices::LdmrsSopasLayer::m_readOnlyMode
private

Definition at line 168 of file LdmrsSopasLayer.hpp.

double devices::LdmrsSopasLayer::m_scanEndAngle
private

Definition at line 162 of file LdmrsSopasLayer.hpp.

double devices::LdmrsSopasLayer::m_scanFreq
private

Definition at line 163 of file LdmrsSopasLayer.hpp.

double devices::LdmrsSopasLayer::m_scanStartAngle
private

Definition at line 161 of file LdmrsSopasLayer.hpp.

const UINT16 devices::LdmrsSopasLayer::MAX_NUM_OF_FIELDS = 16
staticprotected

Definition at line 118 of file LdmrsSopasLayer.hpp.


The documentation for this class was generated from the following files:


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Sat Jun 8 2019 17:57:33