33 import SDOPackage, SDOPackage__POA
88 conf.description = prop.getProperty(
"description")
89 conf.id = prop.getName()
190 \var self._deviceProfile SDO DeviceProfile with mutex lock 196 \var self._serviceProfiles SDO ServiceProfileList 210 \var self._organizations SDO OrganizationList 216 self.
_rtcout = OpenRTM_aist.Manager.instance().getLogbuf(
"rtobject.sdo_config")
267 self.
_rtcout.RTC_TRACE(
"set_device_profile()")
269 raise SDOPackage.InvalidParameter(
"dProfile is empty.")
275 self.
_rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
276 raise SDOPackage.InternalError(
"Unknown Error")
328 self.
_rtcout.RTC_TRACE(
"add_service_profile()")
330 raise SDOPackage.InvalidParameter(
"sProfile is empty.")
333 return self.
_sdoservice.addSdoServiceConsumer(sProfile)
335 self.
_rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
336 raise SDOPackage.InternalError(
"Configuration.add_service_profile")
378 self.
_rtcout.RTC_TRACE(
"add_organization()")
380 raise SDOPackage.InvalidParameter(
"org is empty.")
385 self.
_rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
386 raise SDOPackage.InternalError(
"Configuration.add_organization")
434 self.
_rtcout.RTC_TRACE(
"remove_service_profile(%s)", id_)
436 raise SDOPackage.InvalidParameter(
"id is empty.")
439 return self.
_sdoservice.removeSdoServiceConsumer(id_)
441 self.
_rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
442 raise SDOPackage.InternalError(
"Configuration.remove_service_profile")
488 self.
_rtcout.RTC_TRACE(
"remove_organization(%s)", organization_id)
489 if organization_id
is None:
490 raise SDOPackage.InvalidParameter(
"organization_id is empty.")
495 self.
org_id(organization_id))
497 self.
_rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
498 raise SDOPackage.InternalError(
"Configuration.remove_organization")
538 self.
_rtcout.RTC_TRACE(
"get_configuration_parameters()")
544 self.
_rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
545 raise SDOPackage.InternalError(
"Configuration.get_configuration_parameters")
583 self.
_rtcout.RTC_TRACE(
"get_configuration_parameter_values()")
632 self.
_rtcout.RTC_TRACE(
"get_configuration_parameter_value(%s)", name)
634 self.
_rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
635 raise SDOPackage.InvalidParameter(
"Name is empty.")
685 self.
_rtcout.RTC_TRACE(
"set_configuration_parameter(%s, value)", name)
686 if name
is None or value
is None:
687 raise SDOPackage.InvalidParameter(
"Name/Value is empty.")
728 self.
_rtcout.RTC_TRACE(
"get_configuration_sets()")
735 config_sets = [SDOPackage.ConfigurationSet(
"",
"",[])
for i
in range(len_)]
736 for i
in range(len_):
742 self.
_rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
743 raise SDOPackage.InternalError(
"Configuration.get_configuration_sets")
788 self.
_rtcout.RTC_TRACE(
"get_configuration_set(%s)", config_id)
790 raise SDOPackage.InvalidParameter(
"ID is empty")
796 self.
_rtcout.RTC_ERROR(
"No such ConfigurationSet")
797 raise SDOPackage.InternalError(
"No such ConfigurationSet")
799 self.
_rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
800 raise SDOPackage.InternalError(
"Unknown exception")
803 configset = self.
_configsets.getConfigurationSet(config_id)
806 config = SDOPackage.ConfigurationSet(
"",
"",[])
810 self.
_rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
811 raise SDOPackage.InternalError(
"Configuration::get_configuration_set()")
813 return SDOPackage.ConfigurationSet(
"",
"",[])
862 self.
_rtcout.RTC_TRACE(
"set_configuration_set_values()")
863 if not configuration_set
or not configuration_set.id:
864 raise SDOPackage.InvalidParameter(
"ID is empty.")
874 if conf.findNode(
"exported_ports"):
875 exported_ports = conf.getProperty(
"exported_ports").
split(
",")
876 exported_ports_str =
"" 877 for i
in range(len(exported_ports)):
878 keyval = exported_ports[i].
split(
".")
880 exported_ports_str += keyval[0] +
"." + keyval[-1]
882 exported_ports_str += exported_ports[i]
884 if i != (len(exported_ports)-1):
885 exported_ports_str +=
"," 887 conf.setProperty(
"exported_ports",exported_ports_str)
889 return self.
_configsets.setConfigurationSetValues(conf)
891 self.
_rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
892 raise SDOPackage.InternalError(
"Configuration::set_configuration_set_values()")
948 self.
_rtcout.RTC_TRACE(
"get_active_configuration_set()")
950 raise SDOPackage.NotAvailable(
"NotAvailable: Configuration.get_active_configuration_set()")
954 config = SDOPackage.ConfigurationSet(
"",
"",[])
958 self.
_rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
959 raise SDOPackage.InternalError(
"Configuration.get_active_configuration_set()")
961 return SDOPackage.ConfigurationSet(
"",
"",[])
1006 self.
_rtcout.RTC_TRACE(
"add_configuration_set()")
1007 if configuration_set
is None:
1008 raise SDOPackage.InvalidParameter(
"configuration_set is empty.")
1012 config_id = configuration_set.id
1015 return self.
_configsets.addConfigurationSet(config)
1017 self.
_rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1018 raise SDOPackage.InternalError(
"Configuration::add_configuration_set()")
1063 self.
_rtcout.RTC_TRACE(
"remove_configuration_set(%s)", config_id)
1065 raise SDOPackage.InvalidParameter(
"ID is empty.")
1069 return self.
_configsets.removeConfigurationSet(config_id)
1071 self.
_rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1072 raise SDOPackage.InternalError(
"Configuration.remove_configuration_set()")
1129 self.
_rtcout.RTC_TRACE(
"activate_configuration_set(%s)", config_id)
1131 raise SDOPackage.InvalidParameter(
"ID is empty.")
1133 if self.
_configsets.activateConfigurationSet(config_id):
1136 raise SDOPackage.InternalError(
"Configuration.activate_configuration_set()")
1221 return SDOPackage.ServiceProfile(
"",
"",[],
None)
1259 return OpenRTM_aist.uuid1()
1275 name_ = str(nv.name)
1276 return self.
_name == name_
1293 return self.
_id == id_
1309 id_ = str(o.get_organization_id())
1310 return self.
_id == id_
1327 return self.
_id == id_
def set_device_profile(self, dProfile)
[CORBA interface] Set DeviceProfile of SDO
def __init__(self, name_)
def add_organization(self, org)
[CORBA interface] Add Organization
def get_configuration_parameters(self)
[CORBA interface] Getting a list of configuration parameter
def remove_service_profile(self, id_)
[CORBA interface] Remove ServiceProfile
def split(input, delimiter)
Split string by delimiter.
def push_back(seq, elem)
Push the new element back to the CORBA sequence.
Configuration implementation class.
def copyToProperties(prop, nvlist)
Copy to Proeprties from NVList.
The Properties class represents a persistent set of properties.
functor for ConfigurationSet
def add_service_profile(self, sProfile)
[CORBA interface] Set SDO's ServiceProfile
def remove_organization(self, organization_id)
[CORBA interface] Remove the reference of Organization
def toConfigurationSet(conf, prop)
Copy to NVList from Proeprties.
functor for ServiceProfile
def remove_configuration_set(self, config_id)
[CORBA interface] Remove ConfigurationSet
def add_configuration_set(self, configuration_set)
[CORBA interface] Add ConfigurationSet
def set_configuration_parameter(self, name, value)
[CORBA interface] Modify the parameter value
def get_configuration_set(self, config_id)
[CORBA interface] Getting a ConfigurationSet
def get_configuration_parameter_value(self, name)
[CORBA interface] Getting value of configuration parameter
def __init__(self, configAdmin, sdoServiceAdmin)
class constructor
def getServiceProfiles(self)
def get_configuration_parameter_values(self)
[CORBA interface] Getting value list of configuration parameter
def get_active_configuration_set(self)
[CORBA interface] Get active ConfigurationSet
def getDeviceProfile(self)
def find(seq, f)
Return the index of CORBA sequence element that functor matches.
def getServiceProfile(self, id)
def get_configuration_sets(self)
[CORBA interface] Getting list of ConfigurationSet
def set_configuration_set_values(self, configuration_set)
[CORBA interface] Set ConfigurationSet
def activate_configuration_set(self, config_id)
[CORBA interface] Activate ConfigurationSet
def copyFromProperties(nv, prop)
Copy to NVList from Proeprties.
def toProperties(prop, conf)
Copy to Proeprties from NVList.
def getOrganizations(self)