本文整理匯總了Python中libs.Tools.toggleSerialMonitor方法的典型用法代碼示例。如果您正苦於以下問題:Python Tools.toggleSerialMonitor方法的具體用法?Python Tools.toggleSerialMonitor怎麽用?Python Tools.toggleSerialMonitor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類libs.Tools
的用法示例。
在下文中一共展示了Tools.toggleSerialMonitor方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: uploadSketchProject
# 需要導入模塊: from libs import Tools [as 別名]
# 或者: from libs.Tools import toggleSerialMonitor [as 別名]
def uploadSketchProject(self):
'''
Upload the sketch to the select board to the select COM port
it returns an error if any com port is selected
'''
id_port = self.Preferences.get('id_port', '')
current_ports = listSerialPorts()
if(id_port not in current_ports and id_port != 'none'):
id_port = False
# check port selected
if(not id_port):
current_time = time.strftime('%H:%M:%S')
self.message_queue.put('none_port_select_{0}', current_time)
self.execute = False
if(not self.execute):
self.message_queue.stopPrint()
return
# Stop serial monitor
Tools.closeSerialMonitors(self.Preferences)
# Compiling code
choosen_env = self.buildSketchProject()
if(not choosen_env):
return
if(self.Commands.error_running):
self.message_queue.stopPrint()
return
up_port = '--upload-port %s' % id_port
if(id_port == 'none'):
up_port = ''
command = ['run', '-t upload %s -e %s' %
(up_port, choosen_env)]
self.Commands.runCommand(command)
if(not self.Commands.error_running):
autorun = self.Preferences.get('autorun_monitor', False)
if(autorun):
Tools.toggleSerialMonitor()
self.Preferences.set('autorun_monitor', False)
self.message_queue.stopPrint()
示例2: run
# 需要導入模塊: from libs import Tools [as 別名]
# 或者: from libs.Tools import toggleSerialMonitor [as 別名]
def run(self):
Tools.toggleSerialMonitor(self.window)