Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
7c5efbd6
Commit
7c5efbd6
authored
Nov 13, 2011
by
Kliment Yanev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add port rescan button.
parent
5cd0e23e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
pronterface.py
pronterface.py
+23
-14
No files found.
pronterface.py
View file @
7c5efbd6
...
...
@@ -351,6 +351,22 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
def
OnExit
(
self
,
event
):
self
.
Close
()
def
rescanports
(
self
,
event
=
None
):
scan
=
self
.
scanserial
()
portslist
=
list
(
scan
)
if
self
.
settings
.
port
!=
""
and
self
.
settings
.
port
not
in
portslist
:
portslist
=
[
self
.
settings
.
port
]
+
portslist
self
.
serialport
.
Clear
()
self
.
serialport
.
AppendItems
(
portslist
)
try
:
if
self
.
settings
.
port
in
scan
:
self
.
serialport
.
SetValue
(
self
.
settings
.
port
)
elif
len
(
portslist
)
>
0
:
self
.
serialport
.
SetValue
(
portslist
[
0
])
except
:
pass
def
popwindow
(
self
):
# this list will contain all controls that should be only enabled
# when we're connected to a printer
...
...
@@ -361,21 +377,14 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
#lower section contains the rest of the window - manual controls, console, visualizations
#TOP ROW:
uts
=
self
.
uppertopsizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
uts
.
Add
(
wx
.
StaticText
(
self
.
panel
,
-
1
,
_
(
"Port:"
),
pos
=
(
0
,
5
)),
wx
.
TOP
|
wx
.
LEFT
,
5
)
scan
=
self
.
scanserial
()
portslist
=
list
(
scan
)
if
self
.
settings
.
port
!=
""
and
self
.
settings
.
port
not
in
portslist
:
portslist
+=
[
self
.
settings
.
port
]
self
.
rescanbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
_
(
"Port"
),
pos
=
(
380
,
0
))
self
.
rescanbtn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
rescanports
)
uts
.
Add
(
self
.
rescanbtn
,
wx
.
TOP
|
wx
.
LEFT
,
5
)
self
.
serialport
=
wx
.
ComboBox
(
self
.
panel
,
-
1
,
choices
=
portslist
,
style
=
wx
.
CB_DROPDOWN
|
wx
.
CB_SORT
|
wx
.
CB_READONLY
,
pos
=
(
50
,
0
))
try
:
if
self
.
settings
.
port
in
scan
:
self
.
serialport
.
SetValue
(
self
.
settings
.
port
)
elif
len
(
portslist
)
>
0
:
self
.
serialport
.
SetValue
(
portslist
[
0
])
except
:
pass
choices
=
[],
style
=
wx
.
CB_DROPDOWN
|
wx
.
CB_READONLY
,
pos
=
(
50
,
0
))
self
.
rescanports
()
uts
.
Add
(
self
.
serialport
)
uts
.
Add
(
wx
.
StaticText
(
self
.
panel
,
-
1
,
"@"
,
pos
=
(
250
,
5
)),
wx
.
RIGHT
,
5
)
self
.
baud
=
wx
.
ComboBox
(
self
.
panel
,
-
1
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment