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
642c6dad
Commit
642c6dad
authored
Dec 21, 2011
by
Kliment Yanev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use callafter to avoid threading issues on gtk
parent
a4f36d13
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
27 deletions
+27
-27
pronterface.py
pronterface.py
+27
-27
No files found.
pronterface.py
View file @
642c6dad
...
@@ -203,20 +203,20 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -203,20 +203,20 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
hsetpoint
=
f
self
.
hsetpoint
=
f
#self.tgauge.SetTarget(int(f))
#self.tgauge.SetTarget(int(f))
if
f
>
0
:
if
f
>
0
:
self
.
htemp
.
SetValue
(
l
)
wx
.
CallAfter
(
self
.
htemp
.
SetValue
,
l
)
self
.
set
(
"last_temperature"
,
str
(
f
))
self
.
set
(
"last_temperature"
,
str
(
f
))
self
.
settoff
.
SetBackgroundColour
(
""
)
wx
.
CallAfter
(
self
.
settoff
.
SetBackgroundColour
,
""
)
self
.
settoff
.
SetForegroundColour
(
""
)
wx
.
CallAfter
(
self
.
settoff
.
SetForegroundColour
,
""
)
self
.
settbtn
.
SetBackgroundColour
(
"#FFAA66"
)
wx
.
CallAfter
(
self
.
settbtn
.
SetBackgroundColour
,
"#FFAA66"
)
self
.
settbtn
.
SetForegroundColour
(
"#660000"
)
wx
.
CallAfter
(
self
.
settbtn
.
SetForegroundColour
,
"#660000"
)
self
.
htemp
.
SetBackgroundColour
(
"#FFDABB"
)
wx
.
CallAfter
(
self
.
htemp
.
SetBackgroundColour
,
"#FFDABB"
)
else
:
else
:
self
.
settoff
.
SetBackgroundColour
(
"#0044CC"
)
wx
.
CallAfter
(
self
.
settoff
.
SetBackgroundColour
,
"#0044CC"
)
self
.
settoff
.
SetForegroundColour
(
"white"
)
wx
.
CallAfter
(
self
.
settoff
.
SetForegroundColour
,
"white"
)
self
.
settbtn
.
SetBackgroundColour
(
""
)
wx
.
CallAfter
(
self
.
settbtn
.
SetBackgroundColour
,
""
)
self
.
settbtn
.
SetForegroundColour
(
""
)
wx
.
CallAfter
(
self
.
settbtn
.
SetForegroundColour
,
""
)
self
.
htemp
.
SetBackgroundColour
(
"white"
)
wx
.
CallAfter
(
self
.
htemp
.
SetBackgroundColour
,
"white"
)
self
.
htemp
.
Refresh
(
)
wx
.
CallAfter
(
self
.
htemp
.
Refresh
)
else
:
else
:
print
_
(
"Printer is not online."
)
print
_
(
"Printer is not online."
)
else
:
else
:
...
@@ -238,20 +238,20 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -238,20 +238,20 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
print
_
(
"Setting bed temperature to "
),
f
,
_
(
" degrees Celsius."
)
print
_
(
"Setting bed temperature to "
),
f
,
_
(
" degrees Celsius."
)
self
.
bsetpoint
=
f
self
.
bsetpoint
=
f
if
f
>
0
:
if
f
>
0
:
self
.
btemp
.
SetValue
(
l
)
wx
.
CallAfter
(
self
.
btemp
.
SetValue
,
l
)
self
.
set
(
"last_bed_temperature"
,
str
(
f
))
self
.
set
(
"last_bed_temperature"
,
str
(
f
))
self
.
setboff
.
SetBackgroundColour
(
""
)
wx
.
CallAfter
(
self
.
setboff
.
SetBackgroundColour
,
""
)
self
.
setboff
.
SetForegroundColour
(
""
)
wx
.
CallAfter
(
self
.
setboff
.
SetForegroundColour
,
""
)
self
.
setbbtn
.
SetBackgroundColour
(
"#FFAA66"
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetBackgroundColour
,
"#FFAA66"
)
self
.
setbbtn
.
SetForegroundColour
(
"#660000"
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetForegroundColour
,
"#660000"
)
self
.
btemp
.
SetBackgroundColour
(
"#FFDABB"
)
wx
.
CallAfter
(
self
.
btemp
.
SetBackgroundColour
,
"#FFDABB"
)
else
:
else
:
self
.
setboff
.
SetBackgroundColour
(
"#0044CC"
)
wx
.
CallAfter
(
self
.
setboff
.
SetBackgroundColour
,
"#0044CC"
)
self
.
setboff
.
SetForegroundColour
(
"white"
)
wx
.
CallAfter
(
self
.
setboff
.
SetForegroundColour
,
"white"
)
self
.
setbbtn
.
SetBackgroundColour
(
""
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetBackgroundColour
,
""
)
self
.
setbbtn
.
SetForegroundColour
(
""
)
wx
.
CallAfter
(
self
.
setbbtn
.
SetForegroundColour
,
""
)
self
.
btemp
.
SetBackgroundColour
(
"white"
)
wx
.
CallAfter
(
self
.
btemp
.
SetBackgroundColour
,
"white"
)
self
.
btemp
.
Refresh
(
)
wx
.
CallAfter
(
self
.
btemp
.
Refresh
)
else
:
else
:
print
_
(
"Printer is not online."
)
print
_
(
"Printer is not online."
)
else
:
else
:
...
@@ -1076,11 +1076,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -1076,11 +1076,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if
l
.
strip
()
==
""
:
if
l
.
strip
()
==
""
:
self
.
monitorbox
.
SetValue
(
not
self
.
monitorbox
.
GetValue
())
self
.
monitorbox
.
SetValue
(
not
self
.
monitorbox
.
GetValue
())
elif
l
.
strip
()
==
"off"
:
elif
l
.
strip
()
==
"off"
:
self
.
monitorbox
.
SetValue
(
False
)
wx
.
CallAfter
(
self
.
monitorbox
.
SetValue
,
False
)
else
:
else
:
try
:
try
:
self
.
monitor_interval
=
float
(
l
)
self
.
monitor_interval
=
float
(
l
)
self
.
monitorbox
.
SetValue
(
self
.
monitor_interval
>
0
)
wx
.
CallAfter
(
self
.
monitorbox
.
SetValue
,
self
.
monitor_interval
>
0
)
except
:
except
:
print
_
(
"Invalid period given."
)
print
_
(
"Invalid period given."
)
self
.
setmonitor
(
None
)
self
.
setmonitor
(
None
)
...
...
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