void SimulationECInit(RTC::Manager* manager)
{
  RTC::Properties &props = manager->getConfig();
  RTC::CorbaNaming cn
    = RTC::CorbaNaming(manager->getORB(), props["corba.nameservers"].c_str());
  try{
    CORBA::Object_ptr obj = cn.resolve("ClockGenerator");
    RTC::SimulationExecutionContext::m_cg = OpenHRP::ClockGenerator::_narrow(obj);
    
#if defined(OPENRTM_VERSION042) || defined(OPENRTM_VERSION110)
    manager->registerECFactory("SimulationEC",
			       RTC::ECCreate<RTC::SimulationExecutionContext>,
			       RTC::ECDelete<RTC::OpenHRPExecutionContext>);
#else
	RTC::ExecutionContextFactory::
            instance().addFactory("SimulationEC",
                            ::coil::Creator< ::RTC::ExecutionContextBase,
                            ::RTC::SimulationExecutionContext>,
                            ::coil::Destructor< ::RTC::ExecutionContextBase,
                            ::RTC::OpenHRPExecutionContext>);
#endif
		       
  }catch(RTC::CorbaNaming::NotFound& ex){
    std::cerr << "SimultationExecutionContext: can not find ClockGenerator"
	      << std::endl;
  }
}
Пример #2
0
/*引数にTreeObjectとIPアドレスを追加*/
int rtc_get_rtclist(RTC::CorbaNaming &naming,vector<OtherPort> &rtclist, TreeObject *to, std::string IP_adress){
	
    
    CosNaming::NamingContext_ptr name_cxt = naming.getRootContext();
    
	rtclist.clear();
    vector<string> name;
	name.push_back(IP_adress);
    ListRecursive(name_cxt,rtclist,name,to);
	
    

    for(int i=0;i<(signed)rtclist.size();i++){
		std::string buff = "";
		for(int j=0;j < rtclist[i].buff.size();j++)
		{
			buff += rtclist[i].buff[j];
			buff += "/";
		}
		//System::String^ a = gcnew System::String(buff.c_str());
		
        }
    
    return 0;
}
void SimulationECInit(RTC::Manager* manager)
{
  RTC::Properties &props = manager->getConfig();
  RTC::CorbaNaming cn
    = RTC::CorbaNaming(manager->getORB(), props["corba.nameservers"].c_str());
  try{
    CORBA::Object_ptr obj = cn.resolve("ClockGenerator");
    RTC::SimulationExecutionContext::m_cg = OpenHRP::ClockGenerator::_narrow(obj);

    manager->registerECFactory("SimulationEC",
			       RTC::ECCreate<RTC::SimulationExecutionContext>,
			       RTC::ECDelete<RTC::OpenHRPExecutionContext>);
  }catch(RTC::CorbaNaming::NotFound& ex){
    std::cerr << "SimultationExecutionContext: can not find ClockGenerator"
	      << std::endl;
  }
}