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
fdfd7738
Commit
fdfd7738
authored
May 04, 2012
by
Jeremy Hammett
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'experimental' of
https://github.com/kliment/Printrun
into experimental
parents
df5764c6
556ba0fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
16 deletions
+22
-16
pronsole.py
pronsole.py
+2
-0
pronterface.py
pronterface.py
+20
-16
No files found.
pronsole.py
View file @
fdfd7738
...
...
@@ -201,6 +201,7 @@ class Settings:
self
.
e_feedrate
=
300
self
.
slicecommand
=
"python skeinforge/skeinforge_application/skeinforge_utilities/skeinforge_craft.py $s"
self
.
sliceoptscommand
=
"python skeinforge/skeinforge_application/skeinforge.py"
self
.
final_command
=
""
def
_set
(
self
,
key
,
value
):
try
:
...
...
@@ -274,6 +275,7 @@ class pronsole(cmd.Cmd):
self
.
helpdict
[
"temperature_pla"
]
=
_
(
"Extruder temp for PLA (default: 185 deg C)"
)
self
.
helpdict
[
"xy_feedrate"
]
=
_
(
"Feedrate for Control Panel Moves in X and Y (default: 3000mm/min)"
)
self
.
helpdict
[
"z_feedrate"
]
=
_
(
"Feedrate for Control Panel Moves in Z (default: 200mm/min)"
)
self
.
helpdict
[
"final_command"
]
=
_
(
"Executable to run when the print is finished"
)
self
.
commandprefixes
=
'MGT$'
def
set_temp_preset
(
self
,
key
,
value
):
...
...
pronterface.py
View file @
fdfd7738
...
...
@@ -166,6 +166,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
wx
.
CallAfter
(
self
.
pausebtn
.
Disable
)
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
_
(
"Print"
))
import
shlex
param
=
self
.
settings
.
final_command
pararray
=
[
i
.
replace
(
"$s"
,
str
(
self
.
filename
))
.
replace
(
"$t"
,
str
(
time
.
strftime
(
'
%
H:
%
M:
%
S'
,
time
.
gmtime
(
int
(
time
.
time
()
-
self
.
starttime
+
self
.
extra_print_time
)))))
.
encode
()
for
i
in
shlex
.
split
(
param
.
replace
(
"
\\
"
,
"
\\\\
"
)
.
encode
())]
self
.
finalp
=
subprocess
.
Popen
(
pararray
,
stderr
=
subprocess
.
STDOUT
,
stdout
=
subprocess
.
PIPE
)
def
online
(
self
):
print
_
(
"Printer is now online."
)
...
...
@@ -204,8 +208,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if
(
"S"
in
line
):
try
:
temp
=
float
(
line
.
split
(
"S"
)[
1
]
.
split
(
"*"
)[
0
])
self
.
hottgauge
.
SetTarget
(
temp
)
self
.
graph
.
SetExtruder0TargetTemperature
(
temp
)
#
self.hottgauge.SetTarget(temp)
wx
.
CallAfter
(
self
.
graph
.
SetExtruder0TargetTemperature
,
temp
)
except
:
pass
try
:
...
...
@@ -216,8 +220,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if
(
"S"
in
line
):
try
:
temp
=
float
(
line
.
split
(
"S"
)[
1
]
.
split
(
"*"
)[
0
])
self
.
bedtgauge
.
SetTarget
(
temp
)
self
.
graph
.
SetBedTargetTemperature
(
temp
)
#
self.bedtgauge.SetTarget(temp)
wx
.
CallAfter
(
self
.
graph
.
SetBedTargetTemperature
,
temp
)
except
:
pass
try
:
...
...
@@ -254,8 +258,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
p
.
send_now
(
"M104 S"
+
l
)
print
_
(
"Setting hotend temperature to
%
f degrees Celsius."
)
%
f
self
.
hsetpoint
=
f
self
.
hottgauge
.
SetTarget
(
int
(
f
))
self
.
graph
.
SetExtruder0TargetTemperature
(
int
(
f
))
#
self.hottgauge.SetTarget(int(f))
wx
.
CallAfter
(
self
.
graph
.
SetExtruder0TargetTemperature
,
int
(
f
))
if
f
>
0
:
wx
.
CallAfter
(
self
.
htemp
.
SetValue
,
l
)
self
.
set
(
"last_temperature"
,
str
(
f
))
...
...
@@ -291,8 +295,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
p
.
send_now
(
"M140 S"
+
l
)
print
_
(
"Setting bed temperature to
%
f degrees Celsius."
)
%
f
self
.
bsetpoint
=
f
self
.
bedtgauge
.
SetTarget
(
int
(
f
))
self
.
graph
.
SetBedTargetTemperature
(
int
(
f
))
#
self.bedtgauge.SetTarget(int(f))
wx
.
CallAfter
(
self
.
graph
.
SetBedTargetTemperature
,
int
(
f
))
if
f
>
0
:
wx
.
CallAfter
(
self
.
btemp
.
SetValue
,
l
)
self
.
set
(
"last_bed_temperature"
,
str
(
f
))
...
...
@@ -1193,9 +1197,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
def
setmonitor
(
self
,
e
):
self
.
monitor
=
self
.
monitorbox
.
GetValue
()
if
self
.
monitor
:
self
.
graph
.
StartPlotting
(
1000
)
wx
.
CallAfter
(
self
.
graph
.
StartPlotting
,
1000
)
else
:
self
.
graph
.
StopPlotting
(
)
wx
.
CallAfter
(
self
.
graph
.
StopPlotting
)
...
...
@@ -1223,10 +1227,10 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
string
+=
(
self
.
tempreport
.
replace
(
"
\r
"
,
""
)
.
replace
(
"T:"
,
_
(
"Hotend"
)
+
":"
)
.
replace
(
"B:"
,
_
(
"Bed"
)
+
":"
)
.
replace
(
"
\n
"
,
""
)
.
replace
(
"ok "
,
""
))
+
" "
wx
.
CallAfter
(
self
.
tempdisp
.
SetLabel
,
self
.
tempreport
.
strip
()
.
replace
(
"ok "
,
""
))
try
:
self
.
hottgauge
.
SetValue
(
float
(
filter
(
lambda
x
:
x
.
startswith
(
"T:"
),
self
.
tempreport
.
split
())[
0
]
.
split
(
":"
)[
1
]))
self
.
graph
.
SetExtruder0Temperature
(
float
(
filter
(
lambda
x
:
x
.
startswith
(
"T:"
),
self
.
tempreport
.
split
())[
0
]
.
split
(
":"
)[
1
]))
self
.
bedtgauge
.
SetValue
(
float
(
filter
(
lambda
x
:
x
.
startswith
(
"B:"
),
self
.
tempreport
.
split
())[
0
]
.
split
(
":"
)[
1
]))
self
.
graph
.
SetBedTemperature
(
float
(
filter
(
lambda
x
:
x
.
startswith
(
"B:"
),
self
.
tempreport
.
split
())[
0
]
.
split
(
":"
)[
1
]))
#
self.hottgauge.SetValue(float(filter(lambda x:x.startswith("T:"),self.tempreport.split())[0].split(":")[1]))
wx
.
CallAfter
(
self
.
graph
.
SetExtruder0Temperature
,
float
(
filter
(
lambda
x
:
x
.
startswith
(
"T:"
),
self
.
tempreport
.
split
())[
0
]
.
split
(
":"
)[
1
]))
#
self.bedtgauge.SetValue(float(filter(lambda x:x.startswith("B:"),self.tempreport.split())[0].split(":")[1]))
wx
.
CallAfter
(
self
.
graph
.
SetBedTemperature
,
float
(
filter
(
lambda
x
:
x
.
startswith
(
"B:"
),
self
.
tempreport
.
split
())[
0
]
.
split
(
":"
)[
1
]))
except
:
pass
fractioncomplete
=
0.0
...
...
@@ -1288,8 +1292,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
wx
.
CallAfter
(
self
.
tempdisp
.
SetLabel
,
self
.
tempreport
.
strip
()
.
replace
(
"ok "
,
""
))
try
:
#self.hottgauge.SetValue(float(filter(lambda x:x.startswith("T:"),self.tempreport.split())[0].split(":")[1]))
self
.
graph
.
SetExtruder0Temperature
(
float
(
filter
(
lambda
x
:
x
.
startswith
(
"T:"
),
self
.
tempreport
.
split
())[
0
]
.
split
(
":"
)[
1
]))
self
.
graph
.
SetBedTemperature
(
float
(
filter
(
lambda
x
:
x
.
startswith
(
"B:"
),
self
.
tempreport
.
split
())[
0
]
.
split
(
":"
)[
1
]))
wx
.
CallAfter
(
self
.
graph
.
SetExtruder0Temperature
,
float
(
filter
(
lambda
x
:
x
.
startswith
(
"T:"
),
self
.
tempreport
.
split
())[
0
]
.
split
(
":"
)[
1
]))
wx
.
CallAfter
(
self
.
graph
.
SetBedTemperature
,
float
(
filter
(
lambda
x
:
x
.
startswith
(
"B:"
),
self
.
tempreport
.
split
())[
0
]
.
split
(
":"
)[
1
]))
except
:
pass
tstring
=
l
.
rstrip
()
...
...
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