00001 // -*- C++ -*- 00010 #ifndef SimViewCam_H 00011 #define SimViewCam_H 00012 00013 #include <rtm/Manager.h> 00014 #include <rtm/DataFlowComponentBase.h> 00015 #include <rtm/CorbaPort.h> 00016 #include <rtm/DataInPort.h> 00017 #include <rtm/DataOutPort.h> 00018 #include <rtm/idl/BasicDataTypeSkel.h> 00019 00020 // Service implementation headers 00021 // <rtc-template block="service_impl_h"> 00022 00023 // </rtc-template> 00024 00025 // Service Consumer stub headers 00026 // <rtc-template block="consumer_stub_h"> 00027 #include "intellirobotStub.h" 00028 00029 // </rtc-template> 00030 00031 #include <cv.h> 00032 #include <cxcore.h> 00033 #include <highgui.h> 00034 00035 using namespace RTC; 00036 00042 class SimViewCam 00043 : public RTC::DataFlowComponentBase 00044 { 00045 public: 00050 SimViewCam(RTC::Manager* manager); 00051 00055 ~SimViewCam(); 00056 00057 // <rtc-template block="public_attribute"> 00058 00059 // </rtc-template> 00060 00061 // <rtc-template block="public_operation"> 00062 00063 // </rtc-template> 00064 00065 /*** 00066 * 00067 * The initialize action (on CREATED->ALIVE transition) 00068 * formaer rtc_init_entry() 00069 * 00070 * @return RTC::ReturnCode_t 00071 * 00072 * 00073 */ 00074 virtual RTC::ReturnCode_t onInitialize(); 00075 00076 /*** 00077 * 00078 * The finalize action (on ALIVE->END transition) 00079 * formaer rtc_exiting_entry() 00080 * 00081 * @return RTC::ReturnCode_t 00082 * 00083 * 00084 */ 00085 virtual RTC::ReturnCode_t onFinalize(); 00086 00087 /*** 00088 * 00089 * The startup action when ExecutionContext startup 00090 * former rtc_starting_entry() 00091 * 00092 * @param ec_id target ExecutionContext Id 00093 * 00094 * @return RTC::ReturnCode_t 00095 * 00096 * 00097 */ 00098 // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id); 00099 00100 /*** 00101 * 00102 * The shutdown action when ExecutionContext stop 00103 * former rtc_stopping_entry() 00104 * 00105 * @param ec_id target ExecutionContext Id 00106 * 00107 * @return RTC::ReturnCode_t 00108 * 00109 * 00110 */ 00111 // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id); 00112 00113 /*** 00114 * 00115 * The activated action (Active state entry action) 00116 * former rtc_active_entry() 00117 * 00118 * @param ec_id target ExecutionContext Id 00119 * 00120 * @return RTC::ReturnCode_t 00121 * 00122 * 00123 */ 00124 // virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id); 00125 00126 /*** 00127 * 00128 * The deactivated action (Active state exit action) 00129 * former rtc_active_exit() 00130 * 00131 * @param ec_id target ExecutionContext Id 00132 * 00133 * @return RTC::ReturnCode_t 00134 * 00135 * 00136 */ 00137 // virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id); 00138 00139 /*** 00140 * 00141 * The execution action that is invoked periodically 00142 * former rtc_active_do() 00143 * 00144 * @param ec_id target ExecutionContext Id 00145 * 00146 * @return RTC::ReturnCode_t 00147 * 00148 * 00149 */ 00150 virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id); 00151 00152 /*** 00153 * 00154 * The aborting action when main logic error occurred. 00155 * former rtc_aborting_entry() 00156 * 00157 * @param ec_id target ExecutionContext Id 00158 * 00159 * @return RTC::ReturnCode_t 00160 * 00161 * 00162 */ 00163 // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id); 00164 00165 /*** 00166 * 00167 * The error action in ERROR state 00168 * former rtc_error_do() 00169 * 00170 * @param ec_id target ExecutionContext Id 00171 * 00172 * @return RTC::ReturnCode_t 00173 * 00174 * 00175 */ 00176 // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id); 00177 00178 /*** 00179 * 00180 * The reset action that is invoked resetting 00181 * This is same but different the former rtc_init_entry() 00182 * 00183 * @param ec_id target ExecutionContext Id 00184 * 00185 * @return RTC::ReturnCode_t 00186 * 00187 * 00188 */ 00189 // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id); 00190 00191 /*** 00192 * 00193 * The state update action that is invoked after onExecute() action 00194 * no corresponding operation exists in OpenRTm-aist-0.2.0 00195 * 00196 * @param ec_id target ExecutionContext Id 00197 * 00198 * @return RTC::ReturnCode_t 00199 * 00200 * 00201 */ 00202 // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id); 00203 00204 /*** 00205 * 00206 * The action that is invoked when execution context's rate is changed 00207 * no corresponding operation exists in OpenRTm-aist-0.2.0 00208 * 00209 * @param ec_id target ExecutionContext Id 00210 * 00211 * @return RTC::ReturnCode_t 00212 * 00213 * 00214 */ 00215 // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id); 00216 00217 00218 protected: 00219 // <rtc-template block="protected_attribute"> 00220 00221 // </rtc-template> 00222 00223 // <rtc-template block="protected_operation"> 00224 00225 // </rtc-template> 00226 00227 // DataInPort declaration 00228 // <rtc-template block="inport_declare"> 00229 TimedLongSeq m_in; 00232 InPort<TimedLongSeq> m_inIn; 00233 00234 // </rtc-template> 00235 00236 00237 // DataOutPort declaration 00238 // <rtc-template block="outport_declare"> 00239 TimedOctetSeq m_out; 00242 OutPort<TimedOctetSeq> m_outOut; 00243 00244 // </rtc-template> 00245 00246 // CORBA Port declaration 00247 // <rtc-template block="corbaport_declare"> 00248 00249 // </rtc-template> 00250 00251 // Service declaration 00252 // <rtc-template block="service_declare"> 00253 00254 // </rtc-template> 00255 00256 // Consumer declaration 00257 // <rtc-template block="consumer_declare"> 00258 00259 // </rtc-template> 00260 00261 private: 00262 // <rtc-template block="private_attribute"> 00263 00264 // </rtc-template> 00265 00266 // <rtc-template block="private_operation"> 00267 00268 // </rtc-template> 00269 00270 IplImage *img_rcv,*img_tmp, *img_snd; 00271 int windowOn; 00272 }; 00273 00274 00275 extern "C" 00276 { 00277 DLL_EXPORT void SimViewCamInit(RTC::Manager* manager); 00278 }; 00279 00280 #endif // SimViewCam_H