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
1fec6357
Commit
1fec6357
authored
May 18, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'experimental' of github.com:kliment/Printrun into experimental
parents
a4759865
d8277e61
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
gviz.py
printrun/gviz.py
+4
-5
pronterface.py
pronterface.py
+4
-7
No files found.
printrun/gviz.py
View file @
1fec6357
...
@@ -185,7 +185,6 @@ class gviz(wx.Panel):
...
@@ -185,7 +185,6 @@ class gviz(wx.Panel):
def
layerdown
(
self
):
def
layerdown
(
self
):
if
self
.
layerindex
>
0
:
if
self
.
layerindex
>
0
:
self
.
layerindex
-=
1
self
.
layerindex
-=
1
# Display layer info on statusbar (Jezmy)
self
.
parent
.
SetStatusText
(
"Layer
%
d - Going Down - Z =
%.03
f mm"
%
(
self
.
layerindex
+
1
,
self
.
layers
[
self
.
layerindex
]),
0
)
self
.
parent
.
SetStatusText
(
"Layer
%
d - Going Down - Z =
%.03
f mm"
%
(
self
.
layerindex
+
1
,
self
.
layers
[
self
.
layerindex
]),
0
)
self
.
dirty
=
1
self
.
dirty
=
1
wx
.
CallAfter
(
self
.
Refresh
)
wx
.
CallAfter
(
self
.
Refresh
)
...
@@ -353,7 +352,6 @@ class gviz(wx.Panel):
...
@@ -353,7 +352,6 @@ class gviz(wx.Panel):
arc
=
[
_x
(
start_pos
[
0
]),
_y
(
start_pos
[
1
]),
arc
=
[
_x
(
start_pos
[
0
]),
_y
(
start_pos
[
1
]),
_x
(
target
[
0
]),
_y
(
target
[
1
]),
_x
(
target
[
0
]),
_y
(
target
[
1
]),
_x
(
start_pos
[
0
]
+
target
[
5
]),
_y
(
start_pos
[
1
]
+
target
[
6
])]
_x
(
start_pos
[
0
]
+
target
[
5
]),
_y
(
start_pos
[
1
]
+
target
[
6
])]
# FIXME : verify this works : why not reverse endpoints 4, 5
if
gline
.
command
==
"G2"
:
# clockwise, reverse endpoints
if
gline
.
command
==
"G2"
:
# clockwise, reverse endpoints
arc
[
0
],
arc
[
1
],
arc
[
2
],
arc
[
3
]
=
arc
[
2
],
arc
[
3
],
arc
[
0
],
arc
[
1
]
arc
[
0
],
arc
[
1
],
arc
[
2
],
arc
[
3
]
=
arc
[
2
],
arc
[
3
],
arc
[
0
],
arc
[
1
]
...
@@ -378,12 +376,12 @@ class gviz(wx.Panel):
...
@@ -378,12 +376,12 @@ class gviz(wx.Panel):
def
_x
(
x
):
def
_x
(
x
):
return
x
-
self
.
build_dimensions
[
3
]
return
x
-
self
.
build_dimensions
[
3
]
start_pos
=
self
.
hilightpos
[:]
if
hilight
else
self
.
lastpos
[:]
if
gline
.
command
not
in
[
"G0"
,
"G1"
,
"G2"
,
"G3"
]:
if
gline
.
command
not
in
[
"G0"
,
"G1"
,
"G2"
,
"G3"
]:
return
return
target
=
self
.
hilightpos
[:]
if
hilight
else
self
.
lastpos
[:]
start_pos
=
self
.
hilightpos
[:]
if
hilight
else
self
.
lastpos
[:]
target
=
start_pos
[:]
target
[
5
]
=
0.0
target
[
5
]
=
0.0
target
[
6
]
=
0.0
target
[
6
]
=
0.0
if
gline
.
x
!=
None
:
target
[
0
]
=
gline
.
x
if
gline
.
x
!=
None
:
target
[
0
]
=
gline
.
x
...
@@ -417,6 +415,7 @@ class gviz(wx.Panel):
...
@@ -417,6 +415,7 @@ class gviz(wx.Panel):
if
gline
.
command
==
"G2"
:
# clockwise, reverse endpoints
if
gline
.
command
==
"G2"
:
# clockwise, reverse endpoints
arc
[
0
],
arc
[
1
],
arc
[
2
],
arc
[
3
]
=
arc
[
2
],
arc
[
3
],
arc
[
0
],
arc
[
1
]
arc
[
0
],
arc
[
1
],
arc
[
2
],
arc
[
3
]
=
arc
[
2
],
arc
[
3
],
arc
[
0
],
arc
[
1
]
if
not
hilight
:
self
.
arcs
[
z
]
.
append
(
arc
)
self
.
arcs
[
z
]
.
append
(
arc
)
self
.
arcpens
[
z
]
.
append
(
self
.
arcpen
)
self
.
arcpens
[
z
]
.
append
(
self
.
arcpen
)
else
:
else
:
...
...
pronterface.py
View file @
1fec6357
...
@@ -121,7 +121,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -121,7 +121,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
skeinp
=
None
self
.
skeinp
=
None
self
.
monitor_interval
=
3
self
.
monitor_interval
=
3
self
.
paused
=
False
self
.
paused
=
False
self
.
sentlines
=
Queue
.
Queue
(
3
0
)
self
.
sentlines
=
Queue
.
Queue
(
0
)
self
.
cpbuttons
=
[
self
.
cpbuttons
=
[
SpecialButton
(
_
(
"Motors off"
),
(
"M84"
),
(
250
,
250
,
250
),
None
,
0
,
_
(
"Switch all motors off"
)),
SpecialButton
(
_
(
"Motors off"
),
(
"M84"
),
(
250
,
250
,
250
),
None
,
0
,
_
(
"Switch all motors off"
)),
SpecialButton
(
_
(
"Check temp"
),
(
"M105"
),
(
225
,
200
,
200
),
(
2
,
5
),
(
1
,
1
),
_
(
"Check current hotend temperature"
)),
SpecialButton
(
_
(
"Check temp"
),
(
"M105"
),
(
225
,
200
,
200
),
(
2
,
5
),
(
1
,
1
),
_
(
"Check current hotend temperature"
)),
...
@@ -256,7 +256,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -256,7 +256,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
pass
pass
try
:
try
:
self
.
sentlines
.
put_nowait
(
line
)
self
.
sentlines
.
put_nowait
(
line
)
except
:
except
Queue
.
Full
:
pass
pass
#threading.Thread(target = self.gviz.addgcode, args = (line, 1)).start()
#threading.Thread(target = self.gviz.addgcode, args = (line, 1)).start()
#self.gwindow.p.addgcode(line, hilight = 1)
#self.gwindow.p.addgcode(line, hilight = 1)
...
@@ -1091,11 +1091,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -1091,11 +1091,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
break
break
time
.
sleep
(
0.25
)
time
.
sleep
(
0.25
)
while
not
self
.
sentlines
.
empty
():
while
not
self
.
sentlines
.
empty
():
try
:
gc
=
self
.
sentlines
.
get_nowait
()
gc
=
self
.
sentlines
.
get_nowait
()
wx
.
CallAfter
(
self
.
gviz
.
addgcode
,
gc
,
1
)
wx
.
CallAfter
(
self
.
gviz
.
addgcode
,
gc
,
1
)
except
:
break
wx
.
CallAfter
(
self
.
status
.
SetStatusText
,
_
(
"Not connected to printer."
))
wx
.
CallAfter
(
self
.
status
.
SetStatusText
,
_
(
"Not connected to printer."
))
def
capture
(
self
,
func
,
*
args
,
**
kwargs
):
def
capture
(
self
,
func
,
*
args
,
**
kwargs
):
...
...
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