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
f972ebee
Commit
f972ebee
authored
Apr 04, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #524: correctly set status text in gcview
parent
e9c59669
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
gcview.py
printrun/gcview.py
+15
-0
gviz.py
printrun/gviz.py
+3
-3
No files found.
printrun/gcview.py
View file @
f972ebee
...
@@ -412,11 +412,26 @@ class GcodeViewFrame(GvizBaseFrame, GcodeViewLoader):
...
@@ -412,11 +412,26 @@ class GcodeViewFrame(GvizBaseFrame, GcodeViewLoader):
self
.
Bind
(
wx
.
EVT_TOOL
,
lambda
x
:
self
.
glpanel
.
inject
(),
id
=
6
)
self
.
Bind
(
wx
.
EVT_TOOL
,
lambda
x
:
self
.
glpanel
.
inject
(),
id
=
6
)
self
.
Bind
(
wx
.
EVT_TOOL
,
lambda
x
:
self
.
glpanel
.
editlayer
(),
id
=
7
)
self
.
Bind
(
wx
.
EVT_TOOL
,
lambda
x
:
self
.
glpanel
.
editlayer
(),
id
=
7
)
def
setlayercb
(
self
,
layer
):
self
.
layerslider
.
SetValue
(
layer
)
self
.
update_status
(
""
)
def
update_status
(
self
,
extra
):
layer
=
self
.
model
.
num_layers_to_draw
filtered
=
[
k
for
k
,
v
in
self
.
model
.
layer_idxs_map
.
iteritems
()
if
v
==
layer
]
if
filtered
:
z
=
filtered
[
0
]
message
=
_
(
"Layer
%
d -
%
s Z =
%.03
f mm"
)
%
(
layer
+
1
,
extra
,
z
)
else
:
message
=
_
(
"Entire object"
)
wx
.
CallAfter
(
self
.
SetStatusText
,
message
,
0
)
def
process_slider
(
self
,
event
):
def
process_slider
(
self
,
event
):
new_layer
=
self
.
layerslider
.
GetValue
()
new_layer
=
self
.
layerslider
.
GetValue
()
new_layer
=
min
(
self
.
model
.
max_layers
+
1
,
new_layer
)
new_layer
=
min
(
self
.
model
.
max_layers
+
1
,
new_layer
)
new_layer
=
max
(
1
,
new_layer
)
new_layer
=
max
(
1
,
new_layer
)
self
.
model
.
num_layers_to_draw
=
new_layer
self
.
model
.
num_layers_to_draw
=
new_layer
self
.
update_status
(
""
)
wx
.
CallAfter
(
self
.
Refresh
)
wx
.
CallAfter
(
self
.
Refresh
)
def
set_current_gline
(
self
,
gline
):
def
set_current_gline
(
self
,
gline
):
...
...
printrun/gviz.py
View file @
f972ebee
...
@@ -105,7 +105,7 @@ class GvizWindow(GvizBaseFrame):
...
@@ -105,7 +105,7 @@ class GvizWindow(GvizBaseFrame):
def
process_slider
(
self
,
event
):
def
process_slider
(
self
,
event
):
self
.
p
.
layerindex
=
self
.
layerslider
.
GetValue
()
self
.
p
.
layerindex
=
self
.
layerslider
.
GetValue
()
z
=
self
.
p
.
get_currentz
()
z
=
self
.
p
.
get_currentz
()
self
.
SetStatusText
(
_
(
"Layer
%
d - Going Up
- Z =
%.03
f mm"
)
%
(
self
.
p
.
layerindex
+
1
,
z
),
0
)
wx
.
CallAfter
(
self
.
SetStatusText
,
_
(
"Layer
%
d
- Z =
%.03
f mm"
)
%
(
self
.
p
.
layerindex
+
1
,
z
),
0
)
self
.
p
.
dirty
=
True
self
.
p
.
dirty
=
True
wx
.
CallAfter
(
self
.
p
.
Refresh
)
wx
.
CallAfter
(
self
.
p
.
Refresh
)
...
@@ -247,7 +247,7 @@ class Gviz(wx.Panel):
...
@@ -247,7 +247,7 @@ class Gviz(wx.Panel):
if
self
.
layerindex
+
1
<
len
(
self
.
layers
):
if
self
.
layerindex
+
1
<
len
(
self
.
layers
):
self
.
layerindex
+=
1
self
.
layerindex
+=
1
z
=
self
.
get_currentz
()
z
=
self
.
get_currentz
()
self
.
parent
.
SetStatusText
(
_
(
"Layer
%
d - Going Up - Z =
%.03
f mm"
)
%
(
self
.
layerindex
+
1
,
z
),
0
)
wx
.
CallAfter
(
self
.
parent
.
SetStatusText
,
_
(
"Layer
%
d - Going Up - Z =
%.03
f mm"
)
%
(
self
.
layerindex
+
1
,
z
),
0
)
self
.
dirty
=
True
self
.
dirty
=
True
self
.
parent
.
setlayercb
(
self
.
layerindex
)
self
.
parent
.
setlayercb
(
self
.
layerindex
)
wx
.
CallAfter
(
self
.
Refresh
)
wx
.
CallAfter
(
self
.
Refresh
)
...
@@ -256,7 +256,7 @@ class Gviz(wx.Panel):
...
@@ -256,7 +256,7 @@ class Gviz(wx.Panel):
if
self
.
layerindex
>
0
:
if
self
.
layerindex
>
0
:
self
.
layerindex
-=
1
self
.
layerindex
-=
1
z
=
self
.
get_currentz
()
z
=
self
.
get_currentz
()
self
.
parent
.
SetStatusText
(
_
(
"Layer
%
d - Going Down - Z =
%.03
f mm"
)
%
(
self
.
layerindex
+
1
,
z
),
0
)
wx
.
CallAfter
(
self
.
parent
.
SetStatusText
,
_
(
"Layer
%
d - Going Down - Z =
%.03
f mm"
)
%
(
self
.
layerindex
+
1
,
z
),
0
)
self
.
dirty
=
True
self
.
dirty
=
True
self
.
parent
.
setlayercb
(
self
.
layerindex
)
self
.
parent
.
setlayercb
(
self
.
layerindex
)
wx
.
CallAfter
(
self
.
Refresh
)
wx
.
CallAfter
(
self
.
Refresh
)
...
...
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