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
16b5f6db
Commit
16b5f6db
authored
May 18, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup some code
Not sure about that dropping of the self.gwindow.Destroy try block, we'll see
parent
0920bc6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
16 deletions
+10
-16
gviz.py
printrun/gviz.py
+8
-11
pronterface.py
pronterface.py
+2
-5
No files found.
printrun/gviz.py
View file @
16b5f6db
...
@@ -69,18 +69,17 @@ class window(wx.Frame):
...
@@ -69,18 +69,17 @@ class window(wx.Frame):
def
mouse
(
self
,
event
):
def
mouse
(
self
,
event
):
if
event
.
ButtonUp
(
wx
.
MOUSE_BTN_LEFT
):
if
event
.
ButtonUp
(
wx
.
MOUSE_BTN_LEFT
):
if
(
self
.
initpos
is
not
None
)
:
if
self
.
initpos
is
not
None
:
self
.
initpos
=
None
self
.
initpos
=
None
elif
event
.
Dragging
():
elif
event
.
Dragging
():
e
=
event
.
GetPositionTuple
()
e
=
event
.
GetPositionTuple
()
if
self
.
initpos
is
None
or
not
hasattr
(
self
,
"basetrans"
):
if
self
.
initpos
is
None
or
not
hasattr
(
self
,
"basetrans"
):
self
.
initpos
=
e
self
.
initpos
=
e
self
.
basetrans
=
self
.
p
.
translate
self
.
basetrans
=
self
.
p
.
translate
self
.
p
.
translate
=
[
self
.
basetrans
[
0
]
+
(
e
[
0
]
-
self
.
initpos
[
0
]),
self
.
p
.
translate
=
[
self
.
basetrans
[
0
]
+
(
e
[
0
]
-
self
.
initpos
[
0
]),
self
.
basetrans
[
1
]
+
(
e
[
1
]
-
self
.
initpos
[
1
])
]
self
.
basetrans
[
1
]
+
(
e
[
1
]
-
self
.
initpos
[
1
])
]
self
.
p
.
dirty
=
1
self
.
p
.
dirty
=
1
self
.
p
.
Refresh
()
wx
.
CallAfter
(
self
.
p
.
Refresh
)
else
:
else
:
event
.
Skip
()
event
.
Skip
()
...
@@ -174,7 +173,7 @@ class gviz(wx.Panel):
...
@@ -174,7 +173,7 @@ class gviz(wx.Panel):
self
.
layerindex
=
0
self
.
layerindex
=
0
self
.
showall
=
0
self
.
showall
=
0
self
.
dirty
=
1
self
.
dirty
=
1
self
.
Refresh
(
)
wx
.
CallAfter
(
self
.
Refresh
)
def
layerup
(
self
):
def
layerup
(
self
):
if
(
self
.
layerindex
+
1
<
len
(
self
.
layers
)):
if
(
self
.
layerindex
+
1
<
len
(
self
.
layers
)):
...
@@ -182,7 +181,7 @@ class gviz(wx.Panel):
...
@@ -182,7 +181,7 @@ class gviz(wx.Panel):
# Display layer info on statusbar (Jezmy)
# Display layer info on statusbar (Jezmy)
self
.
parent
.
SetStatusText
(
"Layer "
+
str
(
self
.
layerindex
+
1
)
+
" - Going Up - Z = "
+
str
(
self
.
layers
[
self
.
layerindex
])
+
" mm"
,
0
)
self
.
parent
.
SetStatusText
(
"Layer "
+
str
(
self
.
layerindex
+
1
)
+
" - Going Up - Z = "
+
str
(
self
.
layers
[
self
.
layerindex
])
+
" mm"
,
0
)
self
.
dirty
=
1
self
.
dirty
=
1
self
.
Refresh
(
)
wx
.
CallAfter
(
self
.
Refresh
)
def
layerdown
(
self
):
def
layerdown
(
self
):
if
(
self
.
layerindex
>
0
):
if
(
self
.
layerindex
>
0
):
...
@@ -190,7 +189,7 @@ class gviz(wx.Panel):
...
@@ -190,7 +189,7 @@ class gviz(wx.Panel):
# Display layer info on statusbar (Jezmy)
# Display layer info on statusbar (Jezmy)
self
.
parent
.
SetStatusText
(
"Layer "
+
str
(
self
.
layerindex
+
1
)
+
" - Going Down - Z = "
+
str
(
self
.
layers
[
self
.
layerindex
])
+
" mm"
,
0
)
self
.
parent
.
SetStatusText
(
"Layer "
+
str
(
self
.
layerindex
+
1
)
+
" - Going Down - Z = "
+
str
(
self
.
layers
[
self
.
layerindex
])
+
" mm"
,
0
)
self
.
dirty
=
1
self
.
dirty
=
1
self
.
Refresh
(
)
wx
.
CallAfter
(
self
.
Refresh
)
def
setlayer
(
self
,
layer
):
def
setlayer
(
self
,
layer
):
try
:
try
:
...
@@ -222,7 +221,7 @@ class gviz(wx.Panel):
...
@@ -222,7 +221,7 @@ class gviz(wx.Panel):
for
pen
in
self
.
penslist
:
for
pen
in
self
.
penslist
:
pen
.
SetWidth
(
penwidth
)
pen
.
SetWidth
(
penwidth
)
self
.
dirty
=
1
self
.
dirty
=
1
self
.
Refresh
(
)
wx
.
CallAfter
(
self
.
Refresh
)
def
repaint
(
self
):
def
repaint
(
self
):
self
.
blitmap
=
wx
.
EmptyBitmap
(
self
.
GetClientSize
()[
0
],
self
.
GetClientSize
()[
1
],
-
1
)
self
.
blitmap
=
wx
.
EmptyBitmap
(
self
.
GetClientSize
()[
0
],
self
.
GetClientSize
()[
1
],
-
1
)
...
@@ -293,9 +292,7 @@ class gviz(wx.Panel):
...
@@ -293,9 +292,7 @@ class gviz(wx.Panel):
if
self
.
dirty
:
if
self
.
dirty
:
self
.
repaint
()
self
.
repaint
()
self
.
dirty
=
0
self
.
dirty
=
0
sz
=
self
.
GetClientSize
()
dc
.
DrawBitmap
(
self
.
blitmap
,
0
,
0
)
dc
.
DrawBitmap
(
self
.
blitmap
,
0
,
0
)
del
dc
def
addfile
(
self
,
gcode
):
def
addfile
(
self
,
gcode
):
self
.
clear
()
self
.
clear
()
...
...
pronterface.py
View file @
16b5f6db
...
@@ -984,11 +984,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -984,11 +984,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
save_in_rc
(
"set xy_feedrate"
,
"set xy_feedrate
%
d"
%
self
.
settings
.
xy_feedrate
)
self
.
save_in_rc
(
"set xy_feedrate"
,
"set xy_feedrate
%
d"
%
self
.
settings
.
xy_feedrate
)
self
.
save_in_rc
(
"set z_feedrate"
,
"set z_feedrate
%
d"
%
self
.
settings
.
z_feedrate
)
self
.
save_in_rc
(
"set z_feedrate"
,
"set z_feedrate
%
d"
%
self
.
settings
.
z_feedrate
)
self
.
save_in_rc
(
"set e_feedrate"
,
"set e_feedrate
%
d"
%
self
.
settings
.
e_feedrate
)
self
.
save_in_rc
(
"set e_feedrate"
,
"set e_feedrate
%
d"
%
self
.
settings
.
e_feedrate
)
try
:
wx
.
CallAfter
(
self
.
gwindow
.
Destroy
)
self
.
gwindow
.
Destroy
()
wx
.
CallAfter
(
self
.
Destroy
)
except
:
pass
self
.
Destroy
()
def
do_monitor
(
self
,
l
=
""
):
def
do_monitor
(
self
,
l
=
""
):
if
l
.
strip
()
==
""
:
if
l
.
strip
()
==
""
:
...
...
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