Skip to content

Commit

Permalink
New Serial Option "Not used" to avoid the error "None serial port sel…
Browse files Browse the repository at this point in the history
…ected" when a serial port is not necessary (#29)
  • Loading branch information
gepd committed May 12, 2016
1 parent 5a901b9 commit 0e66d5c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Languages/en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ msgstr "Serial Port(s)"
msgid "menu_add_ip"
msgstr "Add IP Manually"

msgid "menu_not_used_port"
msgstr "Not Used"

msgid "menu_monitor_serial"
msgstr "Monitor Serial"

Expand Down
3 changes: 3 additions & 0 deletions Languages/es.lang
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ msgstr "Puerto(s) Serial"
msgid "menu_add_ip"
msgstr "Agregar IP Manualmente"

msgid "menu_not_used_port"
msgstr "No usado"

msgid "menu_monitor_serial"
msgstr "Monitor Serial"

Expand Down
3 changes: 3 additions & 0 deletions Languages/ko.lang
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ msgstr "시리얼 포트"
msgid "menu_add_ip"
msgstr "IP 추가하기"

msgid "menu_not_used_port"
msgstr "Not Used"

msgid "menu_monitor_serial"
msgstr "시리얼 모니터"

Expand Down
3 changes: 2 additions & 1 deletion libs/Menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ def createSerialPortsMenu(self):

menu_preset = self.getTemplateMenu(file_name='serial.json')
menu_ports = [
{"caption": _("menu_add_ip"), "command": "add_serial_ip"}]
{"caption": _("menu_add_ip"), "command": "add_serial_ip"},
{"caption": "menu_not_used_port", "command": "select_port", "checkbox": True, "args": {"id_port": "none"}}]

for port in port_list:
temp_info = {}
Expand Down
10 changes: 7 additions & 3 deletions libs/PlatformioCLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def uploadSketchProject(self):
id_port = self.Preferences.get('id_port', '')
current_ports = listSerialPorts()

if(id_port not in current_ports):
if(id_port not in current_ports and id_port != 'none'):
id_port = False

# check port selected
Expand All @@ -360,8 +360,12 @@ def uploadSketchProject(self):
self.message_queue.stopPrint()
return

command = ['run', '-t upload --upload-port %s -e %s' %
(id_port, choosen_env)]
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):
Expand Down

0 comments on commit 0e66d5c

Please sign in to comment.