本文整理汇总了Python中ion.util.enhanced_resource_registry_client.EnhancedResourceRegistryClient.find_instrument_device_ids_of_device_using_has_device方法的典型用法代码示例。如果您正苦于以下问题:Python EnhancedResourceRegistryClient.find_instrument_device_ids_of_device_using_has_device方法的具体用法?Python EnhancedResourceRegistryClient.find_instrument_device_ids_of_device_using_has_device怎么用?Python EnhancedResourceRegistryClient.find_instrument_device_ids_of_device_using_has_device使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ion.util.enhanced_resource_registry_client.EnhancedResourceRegistryClient
的用法示例。
在下文中一共展示了EnhancedResourceRegistryClient.find_instrument_device_ids_of_device_using_has_device方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: BaseIntTestPlatform
# 需要导入模块: from ion.util.enhanced_resource_registry_client import EnhancedResourceRegistryClient [as 别名]
# 或者: from ion.util.enhanced_resource_registry_client.EnhancedResourceRegistryClient import find_instrument_device_ids_of_device_using_has_device [as 别名]
#.........这里部分代码省略.........
org_obj = any_old(RT.Org)
log.debug("making the structure for an instrument agent")
i_obj = self._make_instrument_agent_structure(instr_key, org_obj)
self._setup_instruments[instr_key] = i_obj
log.debug("_create_instrument: created instrument %r", instr_key)
return i_obj
def _get_instrument(self, instr_key):
"""
Gets the i_obj constructed by _create_instrument(instr_key).
"""
self.assertIn(instr_key, self._setup_instruments)
i_obj = self._setup_instruments[instr_key]
return i_obj
#################################################################
# instrument-platform linking
#################################################################
def _assign_instrument_to_platform(self, i_obj, p_obj):
log.debug("assigning instrument %r to platform %r",
i_obj.instrument_agent_instance_id, p_obj.platform_id)
self.RR2.assign_instrument_device_to_platform_device_with_has_device(
i_obj.instrument_device_id,
p_obj.platform_device_id)
child_device_ids = self.RR2.find_instrument_device_ids_of_device_using_has_device(p_obj.platform_device_id)
self.assertNotEqual(0, len(child_device_ids))
#################################################################
# some platform topologies
#################################################################
def _create_single_platform(self):
"""
Creates and prepares a platform corresponding to the
platform ID 'LJ01D', which is a leaf in the simulated network.
"""
p_root = self._create_platform('LJ01D')
return p_root
def _create_small_hierarchy(self):
"""
Creates a small platform network consisting of 3 platforms as follows:
Node1D -> MJ01C -> LJ01D
where -> goes from parent to child.
"""
p_root = self._create_platform('Node1D')
p_child = self._create_platform('MJ01C', parent_platform_id='Node1D')
p_grandchild = self._create_platform('LJ01D', parent_platform_id='MJ01C')
self._assign_child_to_parent(p_child, p_root)
self._assign_child_to_parent(p_grandchild, p_child)
return p_root
def _create_hierarchy(self, platform_id, p_objs, parent_obj=None):
"""
示例2: TestInstrumentManagementServiceIntegration
# 需要导入模块: from ion.util.enhanced_resource_registry_client import EnhancedResourceRegistryClient [as 别名]
# 或者: from ion.util.enhanced_resource_registry_client.EnhancedResourceRegistryClient import find_instrument_device_ids_of_device_using_has_device [as 别名]
#.........这里部分代码省略.........
log.debug("Testing child-less parent as a child config")
pconfig_builder._update_cached_predicates() # associations have changed since builder was instantiated
pconfig_builder.set_agent_instance_object(platform_agent_instance_parent_obj)
parent_config = pconfig_builder.prepare(will_launch=False)
verify_child_config(parent_config, platform_device_parent_id)
log.debug("assigning child platform to parent")
self.RR2.assign_platform_device_to_platform_device_with_has_device(platform_device_child_id,
platform_device_parent_id)
child_device_ids = self.RR2.find_platform_device_ids_of_device_using_has_device(platform_device_parent_id)
self.assertNotEqual(0, len(child_device_ids))
log.debug("Testing parent + child as parent config")
pconfig_builder._update_cached_predicates() # associations have changed since builder was instantiated
pconfig_builder.set_agent_instance_object(platform_agent_instance_parent_obj)
parent_config = pconfig_builder.prepare(will_launch=False)
verify_parent_config(parent_config, platform_device_parent_id, platform_device_child_id)
log.debug("making the structure for an instrument agent")
instrument_agent_instance_id, _, instrument_device_id = _make_instrument_agent_structure()
instrument_agent_instance_obj = self.RR2.read(instrument_agent_instance_id)
log.debug("Testing instrument config")
iconfig_builder._update_cached_predicates() # associations have changed since builder was instantiated
iconfig_builder.set_agent_instance_object(instrument_agent_instance_obj)
instrument_config = iconfig_builder.prepare(will_launch=False)
verify_instrument_config(instrument_config, instrument_device_id)
log.debug("assigning instrument to platform")
self.RR2.assign_instrument_device_to_platform_device_with_has_device(instrument_device_id,
platform_device_child_id)
child_device_ids = self.RR2.find_instrument_device_ids_of_device_using_has_device(platform_device_child_id)
self.assertNotEqual(0, len(child_device_ids))
log.debug("Testing entire config")
pconfig_builder._update_cached_predicates() # associations have changed since builder was instantiated
pconfig_builder.set_agent_instance_object(platform_agent_instance_parent_obj)
full_config = pconfig_builder.prepare(will_launch=False)
verify_parent_config(full_config, platform_device_parent_id, platform_device_child_id, instrument_device_id)
#self.fail(parent_config)
#plauncher.prepare(will_launch=False)
@attr('PREP')
def test_prepare_resource_support(self):
"""
create one of each resource and association used by IMS
to guard against problems in ion-definitions
"""
#stuff we control
instrument_agent_instance_id, _ = self.RR.create(any_old(RT.InstrumentAgentInstance))
instrument_agent_id, _ = self.RR.create(any_old(RT.InstrumentAgent))
instrument_model_id, _ = self.RR.create(any_old(RT.InstrumentModel))
instrument_device_id, _ = self.RR.create(any_old(RT.InstrumentDevice))
platform_agent_instance_id, _ = self.RR.create(any_old(RT.PlatformAgentInstance))
platform_agent_id, _ = self.RR.create(any_old(RT.PlatformAgent))
platform_device_id, _ = self.RR.create(any_old(RT.PlatformDevice))
platform_model_id, _ = self.RR.create(any_old(RT.PlatformModel))
sensor_device_id, _ = self.RR.create(any_old(RT.SensorDevice))
sensor_model_id, _ = self.RR.create(any_old(RT.SensorModel))
#stuff we associate to