Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MarlinKimbra
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
MarlinKimbra
Commits
6abada29
Commit
6abada29
authored
Apr 01, 2015
by
Simone Primarosa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display power used after print finished
parent
2f1d9332
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
Marlin_main.cpp
MarlinKimbra/Marlin_main.cpp
+16
-6
No files found.
MarlinKimbra/Marlin_main.cpp
View file @
6abada29
...
...
@@ -340,8 +340,10 @@ uint8_t debugLevel = 0;
#endif
#if HAS_POWER_CONSUMPTION_SENSOR
float
power_consumption_meas
=
0
;
unsigned
long
power_consumption_hour
=
0.0
;
float
power_consumption_meas
=
0.0
;
unsigned
long
power_consumption_hour
=
0
;
unsigned
long
startpower
=
0
;
unsigned
long
stoppower
=
0
;
#endif
#ifdef LASERBEAM
...
...
@@ -927,13 +929,18 @@ void get_command()
{
if
(
card
.
eof
()){
SERIAL_PROTOCOLLNPGM
(
MSG_FILE_PRINTED
);
stoptime
=
millis
();
stoptime
=
millis
();
stoppower
=
power_consumption_hour
-
startpower
;
char
time
[
30
];
unsigned
long
t
=
(
stoptime
-
starttime
)
/
1000
;
unsigned
long
t
=
(
stoptime
-
starttime
)
/
1000
;
int
hours
,
minutes
;
minutes
=
(
t
/
60
)
%
60
;
hours
=
t
/
60
/
60
;
sprintf_P
(
time
,
PSTR
(
"%i "
MSG_END_HOUR
" %i "
MSG_END_MINUTE
),
hours
,
minutes
);
#if HAS_POWER_CONSUMPTION_SENSOR
sprintf_P
(
time
,
PSTR
(
"%i "
MSG_END_HOUR
" %i "
MSG_END_MINUTE
" %i Wh"
),
hours
,
minutes
,
stoppower
);
#else
sprintf_P
(
time
,
PSTR
(
"%i "
MSG_END_HOUR
" %i "
MSG_END_MINUTE
),
hours
,
minutes
);
#endif
SERIAL_ECHO_START
;
SERIAL_ECHOLN
(
time
);
lcd_setstatus
(
time
,
true
);
...
...
@@ -3625,6 +3632,7 @@ inline void gcode_G92() {
inline
void
gcode_M24
()
{
card
.
startFileprint
();
starttime
=
millis
();
startpower
=
power_consumption_hour
;
}
// M25: Pause SD Print
...
...
@@ -3715,8 +3723,10 @@ inline void gcode_M31() {
card
.
setIndex
(
code_value_long
());
card
.
startFileprint
();
if
(
!
call_procedure
)
if
(
!
call_procedure
)
{
starttime
=
millis
();
//procedure calls count as normal print time.
startpower
=
power_consumption_hour
;
}
}
}
...
...
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