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
99411a00
Commit
99411a00
authored
Aug 06, 2012
by
Gary Hodgson
Committed by
Guillaume Seguin
May 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
estimated time
parent
f6b3636e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
projectlayer.py
projectlayer.py
+23
-3
No files found.
projectlayer.py
View file @
99411a00
...
@@ -194,7 +194,7 @@ class SettingsFrame(wx.Frame):
...
@@ -194,7 +194,7 @@ class SettingsFrame(wx.Frame):
return
val
return
val
def
__init__
(
self
,
parent
,
printer
=
None
):
def
__init__
(
self
,
parent
,
printer
=
None
):
wx
.
Frame
.
__init__
(
self
,
parent
,
title
=
"ProjectLayer Control"
,
size
=
(
400
,
4
0
0
))
wx
.
Frame
.
__init__
(
self
,
parent
,
title
=
"ProjectLayer Control"
,
size
=
(
400
,
4
5
0
))
self
.
pronterface
=
parent
self
.
pronterface
=
parent
self
.
display_frame
=
DisplayFrame
(
self
,
title
=
"ProjectLayer Display"
,
printer
=
printer
)
self
.
display_frame
=
DisplayFrame
(
self
,
title
=
"ProjectLayer Display"
,
printer
=
printer
)
...
@@ -281,6 +281,9 @@ class SettingsFrame(wx.Frame):
...
@@ -281,6 +281,9 @@ class SettingsFrame(wx.Frame):
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Current Layer:"
,
pos
=
(
left_label_X_pos
,
info_pos
+
40
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Current Layer:"
,
pos
=
(
left_label_X_pos
,
info_pos
+
40
))
self
.
current_layer
=
wx
.
StaticText
(
self
.
panel
,
-
1
,
"0"
,
pos
=
(
left_value_X_pos
+
20
,
info_pos
+
40
))
self
.
current_layer
=
wx
.
StaticText
(
self
.
panel
,
-
1
,
"0"
,
pos
=
(
left_value_X_pos
+
20
,
info_pos
+
40
))
wx
.
StaticText
(
self
.
panel
,
-
1
,
"Estimated Time:"
,
pos
=
(
left_label_X_pos
,
info_pos
+
60
))
self
.
estimated_time
=
wx
.
StaticText
(
self
.
panel
,
-
1
,
""
,
pos
=
(
left_value_X_pos
+
20
,
info_pos
+
60
))
self
.
SetPosition
((
0
,
0
))
self
.
SetPosition
((
0
,
0
))
self
.
Show
()
self
.
Show
()
...
@@ -291,14 +294,27 @@ class SettingsFrame(wx.Frame):
...
@@ -291,14 +294,27 @@ class SettingsFrame(wx.Frame):
self
.
display_frame
.
Destroy
()
self
.
display_frame
.
Destroy
()
def
set_total_layers
(
self
,
total
):
def
set_total_layers
(
self
,
total
):
self
.
total_layers
.
SetLabel
(
str
(
total
))
self
.
total_layers
.
SetLabel
(
str
(
total
))
self
.
set_estimated_time
()
def
set_current_layer
(
self
,
index
):
def
set_current_layer
(
self
,
index
):
self
.
current_layer
.
SetLabel
(
str
(
index
))
self
.
current_layer
.
SetLabel
(
str
(
index
))
self
.
set_estimated_time
()
def
set_filename
(
self
,
name
):
def
set_filename
(
self
,
name
):
self
.
filename
.
SetLabel
(
name
)
self
.
filename
.
SetLabel
(
name
)
def
set_estimated_time
(
self
):
if
not
self
.
layers
:
print
"No model loaded."
return
current_layer
=
int
(
self
.
current_layer
.
GetLabel
())
remaining_layers
=
len
(
self
.
layers
[
0
])
-
current_layer
# 0.5 for delay between hide and rise
estimated_time
=
remaining_layers
*
(
float
(
self
.
interval
.
GetValue
())
+
float
(
self
.
pause
.
GetValue
())
+
0.5
)
self
.
estimated_time
.
SetLabel
(
time
.
strftime
(
"
%
H:
%
M:
%
S"
,
time
.
gmtime
(
estimated_time
)))
def
parse_svg
(
self
,
name
):
def
parse_svg
(
self
,
name
):
et
=
xml
.
etree
.
ElementTree
.
ElementTree
(
file
=
name
)
et
=
xml
.
etree
.
ElementTree
.
ElementTree
(
file
=
name
)
#xml.etree.ElementTree.dump(et)
#xml.etree.ElementTree.dump(et)
...
@@ -497,12 +513,14 @@ class SettingsFrame(wx.Frame):
...
@@ -497,12 +513,14 @@ class SettingsFrame(wx.Frame):
interval
=
float
(
self
.
interval
.
GetValue
())
interval
=
float
(
self
.
interval
.
GetValue
())
self
.
display_frame
.
interval
=
interval
self
.
display_frame
.
interval
=
interval
self
.
_set_setting
(
'project_interval'
,
interval
)
self
.
_set_setting
(
'project_interval'
,
interval
)
self
.
set_estimated_time
()
self
.
start_calibrate
(
event
)
self
.
start_calibrate
(
event
)
def
update_pause
(
self
,
event
):
def
update_pause
(
self
,
event
):
pause
=
float
(
self
.
pause
.
GetValue
())
pause
=
float
(
self
.
pause
.
GetValue
())
self
.
display_frame
.
pause
=
pause
self
.
display_frame
.
pause
=
pause
self
.
_set_setting
(
'project_pause'
,
pause
)
self
.
_set_setting
(
'project_pause'
,
pause
)
self
.
set_estimated_time
()
self
.
start_calibrate
(
event
)
self
.
start_calibrate
(
event
)
def
update_fullscreen
(
self
,
event
):
def
update_fullscreen
(
self
,
event
):
...
@@ -533,6 +551,7 @@ class SettingsFrame(wx.Frame):
...
@@ -533,6 +551,7 @@ class SettingsFrame(wx.Frame):
return
return
self
.
pause_button
.
SetLabel
(
"Pause"
)
self
.
pause_button
.
SetLabel
(
"Pause"
)
self
.
set_current_layer
(
0
)
self
.
display_frame
.
Raise
()
self
.
display_frame
.
Raise
()
if
(
self
.
fullscreen
.
GetValue
()):
if
(
self
.
fullscreen
.
GetValue
()):
self
.
display_frame
.
ShowFullScreen
(
1
)
self
.
display_frame
.
ShowFullScreen
(
1
)
...
@@ -549,6 +568,7 @@ class SettingsFrame(wx.Frame):
...
@@ -549,6 +568,7 @@ class SettingsFrame(wx.Frame):
def
stop_present
(
self
,
event
):
def
stop_present
(
self
,
event
):
print
"Stop"
print
"Stop"
self
.
pause_button
.
SetLabel
(
"Pause"
)
self
.
pause_button
.
SetLabel
(
"Pause"
)
self
.
set_current_layer
(
0
)
self
.
display_frame
.
running
=
False
self
.
display_frame
.
running
=
False
def
pause_present
(
self
,
event
):
def
pause_present
(
self
,
event
):
...
...
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