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
cee36985
Commit
cee36985
authored
Jun 09, 2011
by
kliment
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Controllable feedrates
parent
34141b51
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
21 deletions
+63
-21
pronsole.py
pronsole.py
+18
-10
pronterface.py
pronterface.py
+45
-11
No files found.
pronsole.py
View file @
cee36985
...
...
@@ -43,6 +43,9 @@ class pronsole(cmd.Cmd):
self
.
processing_rc
=
False
self
.
lastport
=
(
None
,
None
)
self
.
monitoring
=
0
self
.
feedxy
=
3000
self
.
feedz
=
200
self
.
feede
=
300
def
scanserial
(
self
):
...
...
@@ -581,20 +584,20 @@ class pronsole(cmd.Cmd):
if
not
self
.
p
.
online
:
print
"Printer is not online. Unable to move."
return
feed
=
300
feed
=
self
.
feedz
axis
=
"E"
l
=
l
.
split
()
if
(
l
[
0
]
.
lower
()
==
"x"
):
feed
=
3000
feed
=
self
.
feedxy
axis
=
"X"
elif
(
l
[
0
]
.
lower
()
==
"y"
):
feed
=
3000
feed
=
self
.
feedxy
axis
=
"Y"
elif
(
l
[
0
]
.
lower
()
==
"z"
):
feed
=
200
feed
=
self
.
feedz
axis
=
"Z"
elif
(
l
[
0
]
.
lower
()
==
"e"
):
feed
=
300
feed
=
self
.
feede
axis
=
"E"
else
:
print
"Unknown axis."
...
...
@@ -603,16 +606,21 @@ class pronsole(cmd.Cmd):
try
:
dist
=
float
(
l
[
1
])
except
:
print
"Invalid
number
"
print
"Invalid
distance
"
return
try
:
feed
=
int
(
l
[
2
])
except
:
pass
self
.
p
.
send_now
(
"G91"
)
self
.
p
.
send_now
(
"G1 "
+
axis
+
str
(
l
[
1
])
+
" F"
+
str
(
feed
))
self
.
p
.
send_now
(
"G90"
)
def
help_move
(
self
):
print
"Move an axis. Specify the name of the axis and the amount. "
print
"move X 10 will move the X axis forward by 10mm"
print
"move Z -1 will move the Z axis down by 1mm"
print
"move X 10 will move the X axis forward by 10mm at "
,
self
.
feedxy
,
"mm/min (default XY speed)"
print
"move Y 10 5000 will move the Y axis forward by 10mm at 5000mm/min"
print
"move Z -1 will move the Z axis down by 1mm at "
,
self
.
feedz
,
"mm/min (default Z speed)"
print
"Common amounts are in the tabcomplete list."
def
complete_move
(
self
,
text
,
line
,
begidx
,
endidx
):
...
...
@@ -631,7 +639,7 @@ class pronsole(cmd.Cmd):
def
do_extrude
(
self
,
l
,
override
=
None
,
overridefeed
=
300
):
length
=
5
#default extrusion length
feed
=
300
#default speed
feed
=
self
.
feede
#default speed
if
not
self
.
p
.
online
:
print
"Printer is not online. Unable to move."
return
...
...
@@ -671,7 +679,7 @@ class pronsole(cmd.Cmd):
def
do_reverse
(
self
,
l
):
length
=
5
#default extrusion length
feed
=
300
#default speed
feed
=
self
.
feede
#default speed
if
not
self
.
p
.
online
:
print
"Printer is not online. Unable to move."
return
...
...
pronterface.py
View file @
cee36985
...
...
@@ -41,6 +41,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
statuscheck
=
False
self
.
tempreport
=
""
self
.
monitor
=
0
self
.
feedxy
=
3000
self
.
feedz
=
200
self
.
feede
=
300
self
.
paused
=
False
xcol
=
(
255
,
255
,
128
)
ycol
=
(
180
,
180
,
255
)
...
...
@@ -74,8 +77,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
[
"Z-1"
,(
"move Z -1"
),(
110
,
235
+
25
),
zcol
,(
55
,
25
)],
[
"Z-10"
,(
"move Z -10"
),(
110
,
260
+
25
),
zcol
,(
55
,
25
)],
[
"Home"
,(
"home"
),(
110
,
310
),(
250
,
250
,
250
),(
55
,
25
)],
[
"Extrude"
,(
"extrude"
),(
0
,
397
+
1
),(
2
00
,
200
,
200
),(
65
,
25
)],
[
"Reverse"
,(
"reverse"
),(
0
,
397
+
28
),(
2
00
,
200
,
200
),(
65
,
25
)],
[
"Extrude"
,(
"extrude"
),(
0
,
397
+
1
),(
2
25
,
200
,
200
),(
65
,
25
)],
[
"Reverse"
,(
"reverse"
),(
0
,
397
+
28
),(
2
25
,
200
,
200
),(
65
,
25
)],
]
self
.
btndict
=
{}
self
.
popmenu
()
...
...
@@ -227,29 +230,60 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
btn
.
properties
=
i
btn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
procbutton
)
self
.
btndict
[
i
[
1
]]
=
btn
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Heater:"
,
pos
=
(
0
,
34
5
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Heater:"
,
pos
=
(
0
,
34
3
))
self
.
htemp
=
wx
.
ComboBox
(
self
.
panel
,
-
1
,
choices
=
[
self
.
temps
[
i
]
+
" ("
+
i
+
")"
for
i
in
sorted
(
self
.
temps
.
keys
())],
style
=
wx
.
CB_SIMPLE
|
wx
.
CB_DROPDOWN
,
size
=
(
90
,
30
),
pos
=
(
45
,
337
))
style
=
wx
.
CB_SIMPLE
|
wx
.
CB_DROPDOWN
,
size
=
(
90
,
25
),
pos
=
(
45
,
337
))
self
.
htemp
.
SetValue
(
"0"
)
self
.
settbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
"Set"
,
size
=
(
30
,
-
1
),
pos
=
(
135
,
33
7
))
self
.
settbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
"Set"
,
size
=
(
30
,
-
1
),
pos
=
(
135
,
33
5
))
self
.
settbtn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
do_settemp
)
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Bed:"
,
pos
=
(
0
,
37
5
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Bed:"
,
pos
=
(
0
,
37
3
))
self
.
btemp
=
wx
.
ComboBox
(
self
.
panel
,
-
1
,
choices
=
[
self
.
temps
[
i
]
+
" ("
+
i
+
")"
for
i
in
sorted
(
self
.
temps
.
keys
())],
style
=
wx
.
CB_SIMPLE
|
wx
.
CB_DROPDOWN
,
size
=
(
90
,
30
),
pos
=
(
45
,
367
))
choices
=
[
self
.
bed
temps
[
i
]
+
" ("
+
i
+
")"
for
i
in
sorted
(
self
.
temps
.
keys
())],
style
=
wx
.
CB_SIMPLE
|
wx
.
CB_DROPDOWN
,
size
=
(
90
,
25
),
pos
=
(
45
,
367
))
self
.
btemp
.
SetValue
(
"0"
)
self
.
setbbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
"Set"
,
size
=
(
30
,
-
1
),
pos
=
(
135
,
36
7
))
self
.
setbbtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
"Set"
,
size
=
(
30
,
-
1
),
pos
=
(
135
,
36
5
))
self
.
setbbtn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
do_bedtemp
)
self
.
edist
=
wx
.
SpinCtrl
(
self
.
panel
,
-
1
,
"5"
,
min
=
0
,
max
=
1000
,
size
=
(
60
,
30
),
pos
=
(
70
,
397
+
10
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"mm"
,
pos
=
(
130
,
407
+
10
))
self
.
edist
=
wx
.
SpinCtrl
(
self
.
panel
,
-
1
,
"5"
,
min
=
0
,
max
=
1000
,
size
=
(
60
,
25
),
pos
=
(
70
,
398
))
self
.
edist
.
SetBackgroundColour
((
225
,
200
,
200
))
self
.
edist
.
SetForegroundColour
(
"black"
)
wx
.
StaticText
(
self
.
panel
,
-
1
,
"mm"
,
pos
=
(
130
,
407
))
self
.
minibtn
=
wx
.
Button
(
self
.
panel
,
-
1
,
"Mini mode"
,
pos
=
(
690
,
0
))
self
.
minibtn
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
toggleview
)
self
.
xyfeedc
=
wx
.
SpinCtrl
(
self
.
panel
,
-
1
,
"3000"
,
min
=
0
,
max
=
50000
,
size
=
(
60
,
25
),
pos
=
(
25
,
83
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"mm/min"
,
pos
=
(
130
,
407
+
27
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"mm/min"
,
pos
=
(
60
,
69
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"XY:"
,
pos
=
(
2
,
90
-
2
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Z:"
,
pos
=
(
90
,
90
-
2
))
self
.
zfeedc
=
wx
.
SpinCtrl
(
self
.
panel
,
-
1
,
"200"
,
min
=
0
,
max
=
50000
,
size
=
(
60
,
25
),
pos
=
(
105
,
83
))
self
.
efeedc
=
wx
.
SpinCtrl
(
self
.
panel
,
-
1
,
"300"
,
min
=
0
,
max
=
50000
,
size
=
(
60
,
25
),
pos
=
(
70
,
397
+
28
))
self
.
efeedc
.
SetBackgroundColour
((
225
,
200
,
200
))
self
.
efeedc
.
SetForegroundColour
(
"black"
)
self
.
efeedc
.
Bind
(
wx
.
EVT_SPINCTRL
,
self
.
setfeeds
)
self
.
xyfeedc
.
Bind
(
wx
.
EVT_SPINCTRL
,
self
.
setfeeds
)
self
.
zfeedc
.
Bind
(
wx
.
EVT_SPINCTRL
,
self
.
setfeeds
)
self
.
zfeedc
.
SetBackgroundColour
((
180
,
255
,
180
))
self
.
zfeedc
.
SetForegroundColour
(
"black"
)
pass
def
setfeeds
(
self
,
e
):
try
:
self
.
feede
=
int
(
self
.
efeedc
.
GetValue
())
except
:
pass
try
:
self
.
feedz
=
int
(
self
.
zfeedc
.
GetValue
())
except
:
pass
try
:
self
.
feedxy
=
int
(
self
.
xyfeedc
.
GetValue
())
except
:
pass
def
toggleview
(
self
,
e
):
if
(
self
.
mini
):
self
.
mini
=
False
...
...
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