本文整理汇总了Python中mi.idk.comm_config.CommConfig.get_config_from_console方法的典型用法代码示例。如果您正苦于以下问题:Python CommConfig.get_config_from_console方法的具体用法?Python CommConfig.get_config_from_console怎么用?Python CommConfig.get_config_from_console使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mi.idk.comm_config.CommConfig
的用法示例。
在下文中一共展示了CommConfig.get_config_from_console方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fetch_comm_config
# 需要导入模块: from mi.idk.comm_config import CommConfig [as 别名]
# 或者: from mi.idk.comm_config.CommConfig import get_config_from_console [as 别名]
def fetch_comm_config(self):
"""
@brief collect connection information for the logger from the user
"""
config_path = "%s/%s" % (self.metadata.driver_dir(), CommConfig.config_filename())
self.comm_config = CommConfig.get_config_from_console(config_path)
self.comm_config.get_from_console()
示例2: fetch_comm_config
# 需要导入模块: from mi.idk.comm_config import CommConfig [as 别名]
# 或者: from mi.idk.comm_config.CommConfig import get_config_from_console [as 别名]
def fetch_comm_config(self):
"""
@brief collect connection information for the logger from the user
"""
config_path = "%s/%s" % (self.metadata.driver_dir(), CommConfig.config_filename())
self.comm_config = CommConfig.get_config_from_console(config_path)
self.comm_config.display_config()
#self.comm_config.get_from_console()
self.ip_address = self.comm_config.device_addr
self.data_port = self.comm_config.data_port
self.command_port = self.comm_config.command_port
if not (self.ip_address):
self.ip_address = prompt.text( 'Instrument IP Address', self.ip_address )
if not (self.data_port):
continuing = True
while continuing:
sport = prompt.text( 'Instrument Port', self.data_port )
try:
self.data_port = int(sport)
continuing = False
except ValueError as e:
print "Error converting port to number: " + str(e)
print "Please enter a valid port number.\n"