本文整理匯總了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"