Go to the documentation of this file.00001
00010 #include "ImageData2CameraImage.h"
00011
00012
00013
00014 static const char* imagedata2cameraimage_spec[] =
00015 {
00016 "implementation_id", "ImageData2CameraImage",
00017 "type_name", "ImageData2CameraImage",
00018 "description", "imagedata2cameraimage component",
00019 "version", HRPSYS_PACKAGE_VERSION,
00020 "vendor", "AIST",
00021 "category", "example",
00022 "activity_type", "DataFlowComponent",
00023 "max_instance", "10",
00024 "language", "C++",
00025 "lang_type", "compile",
00026
00027
00028 ""
00029 };
00030
00031
00032 ImageData2CameraImage::ImageData2CameraImage(RTC::Manager* manager)
00033 : RTC::DataFlowComponentBase(manager),
00034
00035 m_dataIn("imageIn", m_data.data.image),
00036 m_dataOut("imageOut", m_data),
00037
00038 dummy(0)
00039 {
00040 }
00041
00042 ImageData2CameraImage::~ImageData2CameraImage()
00043 {
00044 }
00045
00046
00047
00048 RTC::ReturnCode_t ImageData2CameraImage::onInitialize()
00049 {
00050 std::cout << m_profile.instance_name << ": onInitialize()" << std::endl;
00051
00052
00053
00054
00055
00056
00057
00058
00059 addInPort("imageIn", m_dataIn);
00060
00061
00062 addOutPort("imageOut", m_dataOut);
00063
00064
00065
00066
00067
00068
00069
00070
00071 m_data.error_code = 0;
00072
00073 return RTC::RTC_OK;
00074 }
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 RTC::ReturnCode_t ImageData2CameraImage::onActivated(RTC::UniqueId ec_id)
00100 {
00101 std::cout << m_profile.instance_name<< ": onActivated(" << ec_id << ")" << std::endl;
00102 return RTC::RTC_OK;
00103 }
00104
00105 RTC::ReturnCode_t ImageData2CameraImage::onDeactivated(RTC::UniqueId ec_id)
00106 {
00107 std::cout << m_profile.instance_name<< ": onDeactivated(" << ec_id << ")" << std::endl;
00108 return RTC::RTC_OK;
00109 }
00110
00111 RTC::ReturnCode_t ImageData2CameraImage::onExecute(RTC::UniqueId ec_id)
00112 {
00113 if (m_dataIn.isNew()){
00114 m_dataIn.read();
00115 m_dataOut.write();
00116 }
00117 return RTC::RTC_OK;
00118 }
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157 extern "C"
00158 {
00159
00160 void ImageData2CameraImageInit(RTC::Manager* manager)
00161 {
00162 RTC::Properties profile(imagedata2cameraimage_spec);
00163 manager->registerFactory(profile,
00164 RTC::Create<ImageData2CameraImage>,
00165 RTC::Delete<ImageData2CameraImage>);
00166 }
00167
00168 };
00169
00170