gripper_message.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2013 Southwest Research Institute
00003 
00004    Licensed under the Apache License, Version 2.0 (the "License");
00005    you may not use this file except in compliance with the License.
00006    You may obtain a copy of the License at
00007 
00008      http://www.apache.org/licenses/LICENSE-2.0
00009 
00010    Unless required by applicable law or agreed to in writing, software
00011    distributed under the License is distributed on an "AS IS" BASIS,
00012    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013    See the License for the specific language governing permissions and
00014    limitations under the License.
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 //#include "longhorn/longhorn.h"
00025 #endif
00026 
00027 #ifdef MOTOPLUS
00028 #include "typed_message.h"
00029 #include "simple_message.h"
00030 #include "shared_types.h"
00031 //#include "longhorn.h"
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 //* GripperMessage
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   // Overrides - SimpleSerialize
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 /* GRIPPER_MESSAGE_H */


mtconnect_cnc_robot_example
Author(s): Jnicho
autogenerated on Mon Jan 6 2014 11:31:45