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
a09633a2
Commit
a09633a2
authored
Nov 29, 2011
by
kliment
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #107 from cakeller98/Estimated_Time_Status
Improved status line estimated time remaining.
parents
c62f5d5f
33610d53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
pronterface.py
pronterface.py
+13
-6
No files found.
pronterface.py
View file @
a09633a2
...
@@ -1085,18 +1085,25 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
...
@@ -1085,18 +1085,25 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
# self.tgauge.SetValue(int(filter(lambda x:x.startswith("T:"),self.tempreport.split())[0].split(":")[1]))
# self.tgauge.SetValue(int(filter(lambda x:x.startswith("T:"),self.tempreport.split())[0].split(":")[1]))
#except:
#except:
# pass
# pass
fractioncomplete
=
0.0
if
self
.
sdprinting
:
if
self
.
sdprinting
:
fractioncomplete
=
float
(
self
.
percentdone
/
100.0
)
string
+=
_
(
" SD printing:
%04.2
f
%%
"
)
%
(
self
.
percentdone
,)
string
+=
_
(
" SD printing:
%04.2
f
%%
"
)
%
(
self
.
percentdone
,)
if
self
.
p
.
printing
:
if
self
.
p
.
printing
:
secondselapsed
=
int
(
time
.
time
()
-
self
.
starttime
)
fractioncomplete
=
float
(
self
.
p
.
queueindex
)
/
len
(
self
.
p
.
mainqueue
)
fractioncomplete
=
float
(
self
.
p
.
queueindex
)
/
len
(
self
.
p
.
mainqueue
)
string
+=
_
(
" Printing:
%04.2
f
%%
|"
)
%
(
100
*
float
(
self
.
p
.
queueindex
)
/
len
(
self
.
p
.
mainqueue
),)
string
+=
_
(
" Line# "
)
+
str
(
self
.
p
.
queueindex
)
+
_
(
"of "
)
+
str
(
len
(
self
.
p
.
mainqueue
))
+
_
(
" lines |"
)
if
fractioncomplete
>
0.0
:
secondselapsed
=
int
(
time
.
time
()
-
self
.
starttime
)
secondsestimate
=
secondselapsed
/
fractioncomplete
secondsestimate
=
secondselapsed
/
fractioncomplete
secondsremain
=
secondsestimate
-
secondselapsed
secondsremain
=
secondsestimate
-
secondselapsed
string
+=
_
(
" Printing:
%04.2
f
%%
"
)
%
(
100
*
float
(
self
.
p
.
queueindex
)
/
len
(
self
.
p
.
mainqueue
),)
string
+=
_
(
" Est: "
)
+
time
.
strftime
(
'
%
H:
%
M:
%
S'
,
time
.
gmtime
(
secondsremain
))
string
+=
_
(
" Estimated:
%02.0
f"
)
%
(
int
(
secondsremain
/
60
),)
string
+=
_
(
" of: "
)
+
time
.
strftime
(
'
%
H:
%
M:
%
S'
,
time
.
gmtime
(
secondsestimate
))
string
+=
_
(
":
%02.0
f"
)
%
(
int
(
secondsremain
%
60
),)
string
+=
_
(
" Remaining"
)
string
+=
_
(
" of
%02.0
f"
)
%
(
int
(
secondsestimate
/
60
),)
#string+= _(" Est:%02.0f") % (int(secondsremain/60),)
string
+=
_
(
":
%02.0
f Remaining"
)
%
(
int
(
secondsestimate
%
60
),)
#string+= _(":%02.0f") % (int(secondsremain%60),)
#string+= _(" of %02.0f") % (int(secondsestimate/60),)
#string+= _(":%02.0f Remaining") % (int(secondsestimate%60),)
wx
.
CallAfter
(
self
.
status
.
SetStatusText
,
string
)
wx
.
CallAfter
(
self
.
status
.
SetStatusText
,
string
)
wx
.
CallAfter
(
self
.
gviz
.
Refresh
)
wx
.
CallAfter
(
self
.
gviz
.
Refresh
)
if
(
self
.
monitor
and
self
.
p
.
online
):
if
(
self
.
monitor
and
self
.
p
.
online
):
...
...
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