本文整理汇总了Python中ion.agents.platform.util.network_util.NetworkUtil.create_network_definition_from_ci_config方法的典型用法代码示例。如果您正苦于以下问题:Python NetworkUtil.create_network_definition_from_ci_config方法的具体用法?Python NetworkUtil.create_network_definition_from_ci_config怎么用?Python NetworkUtil.create_network_definition_from_ci_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ion.agents.platform.util.network_util.NetworkUtil
的用法示例。
在下文中一共展示了NetworkUtil.create_network_definition_from_ci_config方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_create_network_definition_from_ci_config_bad
# 需要导入模块: from ion.agents.platform.util.network_util import NetworkUtil [as 别名]
# 或者: from ion.agents.platform.util.network_util.NetworkUtil import create_network_definition_from_ci_config [as 别名]
def test_create_network_definition_from_ci_config_bad(self):
CFG = DotDict({
'device_type' : "bad_device_type",
})
# device_type
with self.assertRaises(NetworkDefinitionException):
NetworkUtil.create_network_definition_from_ci_config(CFG)
CFG = DotDict({
'device_type' : "PlatformDevice",
})
# missing platform_id
with self.assertRaises(NetworkDefinitionException):
NetworkUtil.create_network_definition_from_ci_config(CFG)
CFG = DotDict({
'device_type' : "PlatformDevice",
'platform_config': {
'platform_id': 'Node1D'
},
})
# missing driver_config
with self.assertRaises(NetworkDefinitionException):
NetworkUtil.create_network_definition_from_ci_config(CFG)
示例2: test_create_network_definition_from_ci_config
# 需要导入模块: from ion.agents.platform.util.network_util import NetworkUtil [as 别名]
# 或者: from ion.agents.platform.util.network_util.NetworkUtil import create_network_definition_from_ci_config [as 别名]
def test_create_network_definition_from_ci_config(self):
CFG = DotDict({
'device_type' : "PlatformDevice",
'platform_config': {
'platform_id': 'Node1D'
},
'driver_config': {'attributes': {'MVPC_pressure_1': {'attr_id': 'MVPC_pressure_1',
'group': 'pressure',
'max_val': 33.8,
'min_val': -3.8,
'monitor_cycle_seconds': 10,
'precision': 0.04,
'read_write': 'read',
'type': 'float',
'units': 'PSI'},
'MVPC_temperature': {'attr_id': 'MVPC_temperature',
'group': 'temperature',
'max_val': 58.5,
'min_val': -1.5,
'monitor_cycle_seconds': 10,
'precision': 0.06,
'read_write': 'read',
'type': 'float',
'units': 'Degrees C'},
'input_bus_current': {'attr_id': 'input_bus_current',
'group': 'power',
'max_val': 50,
'min_val': -50,
'monitor_cycle_seconds': 5,
'precision': 0.1,
'read_write': 'write',
'type': 'float',
'units': 'Amps'},
'input_voltage': {'attr_id': 'input_voltage',
'group': 'power',
'max_val': 500,
'min_val': -500,
'monitor_cycle_seconds': 5,
'precision': 1,
'read_write': 'read',
'type': 'float',
'units': 'Volts'}},
'dvr_cls': 'RSNPlatformDriver',
'dvr_mod': 'ion.agents.platform.rsn.rsn_platform_driver',
'oms_uri': 'embsimulator',
'ports': {'Node1D_port_1': {'port_id': 'Node1D_port_1'},
'Node1D_port_2': {'port_id': 'Node1D_port_2'}},
},
'children': {'d7877d832cf94c388089b141043d60de': {'agent': {'resource_id': 'd7877d832cf94c388089b141043d60de'},
'device_type': 'PlatformDevice',
'platform_config': {'platform_id': 'MJ01C'},
'driver_config': {'attributes': {'MJ01C_attr_1': {'attr_id': 'MJ01C_attr_1',
'group': 'power',
'max_val': 10,
'min_val': -2,
'monitor_cycle_seconds': 5,
'read_write': 'read',
'type': 'int',
'units': 'xyz'},
'MJ01C_attr_2': {'attr_id': 'MJ01C_attr_2',
'group': 'power',
'max_val': 10,
'min_val': -2,
'monitor_cycle_seconds': 5,
'read_write': 'write',
'type': 'int',
'units': 'xyz'}},
'dvr_cls': 'RSNPlatformDriver',
'dvr_mod': 'ion.agents.platform.rsn.rsn_platform_driver',
'oms_uri': 'embsimulator',
'ports': {'MJ01C_port_1': {'port_id': 'MJ01C_port_1'},
'MJ01C_port_2': {'port_id': 'MJ01C_port_2'}}},
'children': {'d0203cb9eb844727b7a8eea77db78e89': {'agent': {'resource_id': 'd0203cb9eb844727b7a8eea77db78e89'},
'platform_config': {'platform_id': 'LJ01D'},
'device_type': 'PlatformDevice',
'driver_config': {'attributes': {'MVPC_pressure_1': {'attr_id': 'MVPC_pressure_1',
'group': 'pressure',
'max_val': 33.8,
'min_val': -3.8,
'monitor_cycle_seconds': 10,
'precision': 0.04,
'read_write': 'read',
'type': 'float',
'units': 'PSI'},
'MVPC_temperature': {'attr_id': 'MVPC_temperature',
'group': 'temperature',
'max_val': 58.5,
'min_val': -1.5,
'monitor_cycle_seconds': 10,
'precision': 0.06,
'read_write': 'read',
'type': 'float',
'units': 'Degrees C'},
'input_bus_current': {'attr_id': 'input_bus_current',
#.........这里部分代码省略.........