Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef FLATHEADERS
00033 #include "simple_message/messages/joint_traj_pt_full_message.h"
00034 #include "simple_message/joint_data.h"
00035 #include "simple_message/byte_array.h"
00036 #include "simple_message/log_wrapper.h"
00037 #else
00038 #include "joint_traj_pt_full_message.h"
00039 #include "joint_data.h"
00040 #include "byte_array.h"
00041 #include "log_wrapper.h"
00042 #endif
00043
00044 using namespace industrial::shared_types;
00045 using namespace industrial::byte_array;
00046 using namespace industrial::simple_message;
00047 using namespace industrial::joint_traj_pt_full;
00048
00049 namespace industrial
00050 {
00051 namespace joint_traj_pt_full_message
00052 {
00053
00054 JointTrajPtFullMessage::JointTrajPtFullMessage(void)
00055 {
00056 this->init();
00057 }
00058
00059 JointTrajPtFullMessage::~JointTrajPtFullMessage(void)
00060 {
00061
00062 }
00063
00064 bool JointTrajPtFullMessage::init(industrial::simple_message::SimpleMessage & msg)
00065 {
00066 bool rtn = false;
00067 ByteArray data = msg.getData();
00068 this->init();
00069
00070 if (data.unload(this->point_))
00071 {
00072 rtn = true;
00073 }
00074 else
00075 {
00076 LOG_ERROR("Failed to unload joint traj pt data");
00077 }
00078 return rtn;
00079 }
00080
00081 void JointTrajPtFullMessage::init(industrial::joint_traj_pt_full::JointTrajPtFull & point)
00082 {
00083 this->init();
00084 this->point_.copyFrom(point);
00085 }
00086
00087 void JointTrajPtFullMessage::init()
00088 {
00089 this->setMessageType(StandardMsgTypes::JOINT_TRAJ_PT_FULL);
00090 this->point_.init();
00091 }
00092
00093
00094 bool JointTrajPtFullMessage::load(ByteArray *buffer)
00095 {
00096 bool rtn = false;
00097 LOG_COMM("Executing joint traj. pt. message load");
00098 if (buffer->load(this->point_))
00099 {
00100 rtn = true;
00101 }
00102 else
00103 {
00104 rtn = false;
00105 LOG_ERROR("Failed to load joint traj. pt data");
00106 }
00107 return rtn;
00108 }
00109
00110 bool JointTrajPtFullMessage::unload(ByteArray *buffer)
00111 {
00112 bool rtn = false;
00113 LOG_COMM("Executing joint traj pt message unload");
00114
00115 if (buffer->unload(this->point_))
00116 {
00117 rtn = true;
00118 }
00119 else
00120 {
00121 rtn = false;
00122 LOG_ERROR("Failed to unload joint traj pt data");
00123 }
00124 return rtn;
00125 }
00126
00127 }
00128 }
00129