本文整理汇总了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)