9 #include <rtm/Manager.h>
10 #include <rtm/DataFlowComponentBase.h>
11 #include <rtm/CorbaPort.h>
12 #include <rtm/DataInPort.h>
13 #include <rtm/DataOutPort.h>
14 #include <rtm/idl/BasicDataTypeSkel.h>
15 #include <rtm/idl/ExtendedDataTypesSkel.h>
16 #include <rtm/idl/InterfaceDataTypesSkel.h>
22 #include <rtm/CorbaNaming.h>
23 #include <rtm/RTObject.h>
24 #include <rtm/CorbaConsumer.h>
27 #ifdef CREATE_EXE_EXCELRTC
50 void ListRecursive(CosNaming::NamingContext_ptr context,std::vector<OtherPort> &rtclist,std::string &name,
TreeObject *to);
52 int rtc_get_rtclist(RTC::CorbaNaming &naming,std::vector<OtherPort> &rtclist,
TreeObject *to, std::string IP_adress);
68 void portConnect(PortService_ptr p1, PortService_var p2);
77 :
public RTC::DataFlowComponentBase
97 virtual RTC::ReturnCode_t onInitialize();
105 virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
113 virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
119 virtual RTC::ReturnCode_t onFinalize();
132 ExcelPortBase* createPort(
OtherPort &op,
int c, std::string l, std::string sn, std::string leng,
bool mstate);
142 void deleteAllPort();
173 void update_cellName();
189 template <
typename T>
202 template <
typename T>
221 template <
typename T,
typename T2>
ExcelPortBase* crPortSeq(
OtherPort &op, std::string tdt,
int c, std::string l, std::string sn, std::string leng,
bool mstate)
223 string PortType = NVUtil::toString(op.
pb->get_port_profile()->properties,
"port.port_type");
225 string tname = op.
buff[op.
buff.size()-2];
228 if(PortType ==
"DataInPort")
231 OutPort<T> *m_outOut =
new OutPort<T>(tname.c_str(),*m_out);
232 addOutPort(tname.c_str(), *m_outOut);
239 mip->setParam(c,l,sn,leng,mstate);
240 OutPorts.push_back(mip);
249 else if(PortType ==
"DataOutPort")
252 InPort<T> *m_inIn =
new InPort<T>(tname.c_str(),*m_in);
254 addInPort(tname.c_str(), *m_inIn);
260 mip->setParam(c,l,sn,leng,mstate);
261 InPorts.push_back(mip);
283 template <
typename T,
typename T2>
ExcelPortBase* crPort(
OtherPort &op, std::string tdt,
int c, std::string l, std::string sn, std::string leng,
bool mstate)
285 string PortType = NVUtil::toString(op.
pb->get_port_profile()->properties,
"port.port_type");
287 string tname = op.
buff[op.
buff.size()-2];
290 if(PortType ==
"DataInPort")
293 OutPort<T> *m_outOut =
new OutPort<T>(tname.c_str(),*m_out);
294 addOutPort(tname.c_str(), *m_outOut);
301 mip->setParam(c,l,sn,leng,mstate);
302 OutPorts.push_back(mip);
311 else if(PortType ==
"DataOutPort")
314 InPort<T> *m_inIn =
new InPort<T>(tname.c_str(),*m_in);
317 addInPort(tname.c_str(), *m_inIn);
323 mip->setParam(c,l,sn,leng,mstate);
324 InPorts.push_back(mip);
347 template <
typename T,
typename T2>
ExcelPortBase* confcrPortSeq(std::string tname, std::string PortType, std::string tdt,
int c, std::string l, std::string sn, std::string leng,
bool mstate)
351 if(PortType ==
"DataOutPort")
354 OutPort<T> *m_outOut =
new OutPort<T>(tname.c_str(),*m_out);
355 addOutPort(tname.c_str(), *m_outOut);
362 ConfOutPorts.push_back(mip);
370 else if(PortType ==
"DataInPort")
373 InPort<T> *m_inIn =
new InPort<T>(tname.c_str(),*m_in);
375 addInPort(tname.c_str(), *m_inIn);
382 ConfInPorts.push_back(mip);
404 template <
typename T,
typename T2>
ExcelPortBase* confcrPort(std::string tname, std::string PortType, std::string tdt,
int c, std::string l, std::string sn, std::string leng,
bool mstate)
408 if(PortType ==
"DataOutPort")
411 OutPort<T> *m_outOut =
new OutPort<T>(tname.c_str(),*m_out);
412 addOutPort(tname.c_str(), *m_outOut);
419 ConfOutPorts.push_back(mip);
427 else if(PortType ==
"DataInPort")
430 InPort<T> *m_inIn =
new InPort<T>(tname.c_str(),*m_in);
433 addInPort(tname.c_str(), *m_inIn);
440 ConfInPorts.push_back(mip);
467 ExcelPortBase* setDPort(std::vector<std::string> pt,
int c, std::string l, std::string sn, std::string leng,
bool mstate,
bool msflag);
473 void delDPort(std::vector<std::string> pt);
530 TreeObject* getRTCTree(std::string IP_adress);
536 void setFilePath(std::string FP);
564 std::string attach_Port;
589 :
public RTC::ConfigurationSetListener
604 void operator()(
const coil::Properties& config_set)
615 void getProperty(coil::Properties& prop,
const char* key, T& value)
617 if (prop.findNode(key) != 0)
620 if (coil::stringTo(tmp, prop[key].c_str()))
630 DLL_EXPORT
void ExcelControlInit(RTC::Manager* manager);