Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef GRIPPER_MESSAGE_H
00018 #define GRIPPER_MESSAGE_H
00019 
00020 #ifdef ROS
00021 #include "simple_message/typed_message.h"
00022 #include "simple_message/simple_message.h"
00023 #include "simple_message/shared_types.h"
00024 
00025 #endif
00026 
00027 #ifdef MOTOPLUS
00028 #include "typed_message.h"
00029 #include "simple_message.h"
00030 #include "shared_types.h"
00031 
00032 #endif
00033 
00034 
00035 namespace mtconnect_cnc_robot_example
00036 {
00037 namespace gripper_message
00038 {
00039 
00043 namespace GripperOperationTypes
00044 {
00045   enum GripperOperationType
00046   {
00047     INVALID = 0,
00048     INIT,
00049     OPEN,
00050     CLOSE
00051   };
00052 }
00053 typedef GripperOperationTypes::GripperOperationType GripperOperationType;
00054 
00058 
00066 class GripperMessage : public industrial::typed_message::TypedMessage
00067 
00068 {
00069 public:
00076   GripperMessage(void);
00081   ~GripperMessage(void);
00089   bool init(industrial::simple_message::SimpleMessage & msg);
00090 
00097   void init(GripperOperationType operation);
00098 
00103   void init();
00104 
00105   
00106   bool load(industrial::byte_array::ByteArray *buffer);
00107   bool unload(industrial::byte_array::ByteArray *buffer);
00108 
00109   unsigned int byteLength()
00110   {
00111     return sizeof(industrial::shared_types::shared_int(operation_));
00112   }
00113 
00114   GripperOperationType operation_;
00115 
00116 private:
00117 
00118 
00119 };
00120 
00121 }
00122 }
00123 
00124 #endif