當前位置: 首頁>>代碼示例>>Python>>正文


Python CommConfig.get_config_from_console方法代碼示例

本文整理匯總了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()
開發者ID:JeffRoy,項目名稱:marine-integrations,代碼行數:9,代碼來源:start_driver.py

示例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"
開發者ID:ccenter,項目名稱:marine-integrations,代碼行數:28,代碼來源:run_instrument.py


注:本文中的mi.idk.comm_config.CommConfig.get_config_from_console方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。