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
013c9f0b
Commit
013c9f0b
authored
Aug 06, 2011
by
Kliment
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add estimated filament length used.
Print elapsed time at end of print.
parent
97a530d5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
+25
-8
pronsole.py
pronsole.py
+14
-0
pronterface.py
pronterface.py
+11
-8
No files found.
pronsole.py
View file @
013c9f0b
...
@@ -19,6 +19,20 @@ except:
...
@@ -19,6 +19,20 @@ except:
def
dosify
(
name
):
def
dosify
(
name
):
return
os
.
path
.
split
(
name
)[
1
]
.
split
(
"."
)[
0
][:
8
]
+
".g"
return
os
.
path
.
split
(
name
)[
1
]
.
split
(
"."
)[
0
][:
8
]
+
".g"
def
totalelength
(
g
):
tot
=
0
cur
=
0
for
i
in
g
:
if
"E"
in
i
and
(
"G1"
in
i
or
"G0"
in
i
):
try
:
cur
=
float
(
i
.
split
(
"E"
)[
1
]
.
split
(
" "
)[
0
])
except
:
pass
elif
"G92"
in
i
and
"E0"
in
i
:
tot
+=
cur
return
tot
class
Settings
:
class
Settings
:
#def _temperature_alias(self): return {"pla":210,"abs":230,"off":0}
#def _temperature_alias(self): return {"pla":210,"abs":230,"off":0}
#def _temperature_validate(self,v):
#def _temperature_validate(self,v):
...
...
pronterface.py
View file @
013c9f0b
...
@@ -121,7 +121,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -121,7 +121,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
mini
=
False
self
.
mini
=
False
self
.
p
.
sendcb
=
self
.
sentcb
self
.
p
.
sendcb
=
self
.
sentcb
self
.
p
.
startcb
=
self
.
startcb
self
.
p
.
startcb
=
self
.
startcb
#
self.p.endcb=self.endcb
self
.
p
.
endcb
=
self
.
endcb
self
.
starttime
=
0
self
.
starttime
=
0
self
.
curlayer
=
0
self
.
curlayer
=
0
self
.
cur_button
=
None
self
.
cur_button
=
None
...
@@ -130,11 +130,13 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -130,11 +130,13 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
starttime
=
time
.
time
()
self
.
starttime
=
time
.
time
()
def
endcb
(
self
):
def
endcb
(
self
):
print
"Print took "
+
str
(
int
(
time
.
time
()
-
self
.
starttime
)
/
60
)
+
" minutes."
if
(
self
.
p
.
queueindex
==
0
):
wx
.
CallAfter
(
self
.
pausebtn
.
Hide
)
print
"Print took "
+
str
(
int
(
time
.
time
()
-
self
.
starttime
)
/
60
)
+
" minutes "
+
str
(
int
(
time
.
time
()
-
self
.
starttime
)
%
60
)
+
" seconds"
wx
.
CallAfter
(
self
.
pausebtn
.
Disable
)
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
"Print"
)
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
"Print"
)
def
online
(
self
):
def
online
(
self
):
print
"Printer is now online"
print
"Printer is now online"
wx
.
CallAfter
(
self
.
connectbtn
.
Disable
)
wx
.
CallAfter
(
self
.
connectbtn
.
Disable
)
...
@@ -524,7 +526,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -524,7 +526,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
topsizer
.
Fit
(
self
)
self
.
topsizer
.
Fit
(
self
)
# disable all printer controls until we connect to a printer
# disable all printer controls until we connect to a printer
self
.
pausebtn
.
Hid
e
()
self
.
pausebtn
.
Disabl
e
()
for
i
in
self
.
printerControls
:
for
i
in
self
.
printerControls
:
i
.
Disable
()
i
.
Disable
()
...
@@ -934,7 +936,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -934,7 +936,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
wx
.
CallAfter
(
self
.
printbtn
.
Enable
)
wx
.
CallAfter
(
self
.
printbtn
.
Enable
)
wx
.
CallAfter
(
self
.
status
.
SetStatusText
,
"Loaded "
+
self
.
filename
+
",
%
d lines"
%
(
len
(
self
.
f
),))
wx
.
CallAfter
(
self
.
status
.
SetStatusText
,
"Loaded "
+
self
.
filename
+
",
%
d lines"
%
(
len
(
self
.
f
),))
wx
.
CallAfter
(
self
.
pausebtn
.
Hid
e
)
wx
.
CallAfter
(
self
.
pausebtn
.
Disabl
e
)
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
"Print"
)
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
"Print"
)
threading
.
Thread
(
target
=
self
.
loadviz
)
.
start
()
threading
.
Thread
(
target
=
self
.
loadviz
)
.
start
()
...
@@ -981,12 +983,13 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -981,12 +983,13 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
status
.
SetStatusText
(
"Loaded "
+
name
+
",
%
d lines"
%
(
len
(
self
.
f
),))
self
.
status
.
SetStatusText
(
"Loaded "
+
name
+
",
%
d lines"
%
(
len
(
self
.
f
),))
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
"Print"
)
wx
.
CallAfter
(
self
.
printbtn
.
SetLabel
,
"Print"
)
wx
.
CallAfter
(
self
.
pausebtn
.
SetLabel
,
"Pause"
)
wx
.
CallAfter
(
self
.
pausebtn
.
SetLabel
,
"Pause"
)
wx
.
CallAfter
(
self
.
pausebtn
.
Hid
e
)
wx
.
CallAfter
(
self
.
pausebtn
.
Disabl
e
)
if
self
.
p
.
online
:
if
self
.
p
.
online
:
wx
.
CallAfter
(
self
.
printbtn
.
Enable
)
wx
.
CallAfter
(
self
.
printbtn
.
Enable
)
threading
.
Thread
(
target
=
self
.
loadviz
)
.
start
()
threading
.
Thread
(
target
=
self
.
loadviz
)
.
start
()
def
loadviz
(
self
):
def
loadviz
(
self
):
print
pronsole
.
totalelength
(
self
.
f
),
"mm of filament used in this print"
self
.
gviz
.
clear
()
self
.
gviz
.
clear
()
self
.
gwindow
.
p
.
clear
()
self
.
gwindow
.
p
.
clear
()
for
i
in
self
.
f
:
for
i
in
self
.
f
:
...
@@ -1107,7 +1110,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -1107,7 +1110,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
wx
.
CallAfter
(
self
.
connectbtn
.
Enable
);
wx
.
CallAfter
(
self
.
connectbtn
.
Enable
);
wx
.
CallAfter
(
self
.
printbtn
.
Disable
);
wx
.
CallAfter
(
self
.
printbtn
.
Disable
);
wx
.
CallAfter
(
self
.
pausebtn
.
Hid
e
);
wx
.
CallAfter
(
self
.
pausebtn
.
Disabl
e
);
for
i
in
self
.
printerControls
:
for
i
in
self
.
printerControls
:
wx
.
CallAfter
(
i
.
Disable
)
wx
.
CallAfter
(
i
.
Disable
)
...
...
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