Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
464d98d1
Commit
464d98d1
authored
5 years ago
by
Scott Lahteine
Browse files
Options
Downloads
Patches
Plain Diff
Short time prefixes, no percent prefix
parent
ccf61eca
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/src/lcd/dogm/status_screen_DOGM.cpp
+11
-17
11 additions, 17 deletions
Marlin/src/lcd/dogm/status_screen_DOGM.cpp
with
11 additions
and
17 deletions
Marlin/src/lcd/dogm/status_screen_DOGM.cpp
+
11
−
17
View file @
464d98d1
...
@@ -335,9 +335,9 @@ void MarlinUI::draw_status_screen() {
...
@@ -335,9 +335,9 @@ void MarlinUI::draw_status_screen() {
#if HAS_PRINT_PROGRESS
#if HAS_PRINT_PROGRESS
#if DISABLED(DOGM_SD_PERCENT)
#if DISABLED(DOGM_SD_PERCENT)
#define _SD_
DURATION
_X(len) (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH) / 2 - (len) * (MENU_FONT_WIDTH) / 2)
#define _SD_
INFO
_X(len) (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH) / 2 - (len) * (MENU_FONT_WIDTH) / 2)
#else
#else
#define _SD_
DURATION
_X(len) (LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH))
#define _SD_
INFO
_X(len) (LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH))
#endif
#endif
#if ENABLED(DOGM_SD_PERCENT)
#if ENABLED(DOGM_SD_PERCENT)
...
@@ -350,14 +350,9 @@ void MarlinUI::draw_status_screen() {
...
@@ -350,14 +350,9 @@ void MarlinUI::draw_status_screen() {
static
u8g_uint_t
estimation_x_pos
=
0
;
static
u8g_uint_t
estimation_x_pos
=
0
;
static
char
estimation_string
[
10
];
static
char
estimation_string
[
10
];
#if BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY)
#if BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY)
#define PROGRESS_TIME_PREFIX "PROG"
#define ELAPSED_TIME_PREFIX "ELAP"
#define SHOW_REMAINING_TIME_PREFIX "REM"
static
u8g_uint_t
progress_x_pos
=
0
;
static
u8g_uint_t
progress_x_pos
=
0
;
static
uint8_t
progress_state
=
0
;
static
uint8_t
progress_state
=
0
;
static
bool
prev_blink
=
0
;
static
bool
prev_blink
=
0
;
#else
#define SHOW_REMAINING_TIME_PREFIX 'R'
#endif
#endif
#endif
#endif
#endif
#endif
...
@@ -407,7 +402,7 @@ void MarlinUI::draw_status_screen() {
...
@@ -407,7 +402,7 @@ void MarlinUI::draw_status_screen() {
progress_string
[
0
]
=
'\0'
;
progress_string
[
0
]
=
'\0'
;
#if ENABLED(SHOW_REMAINING_TIME)
#if ENABLED(SHOW_REMAINING_TIME)
estimation_string
[
0
]
=
'\0'
;
estimation_string
[
0
]
=
'\0'
;
estimation_x_pos
=
_SD_
DURATION
_X
(
0
);
estimation_x_pos
=
_SD_
INFO
_X
(
0
);
#endif
#endif
}
}
else
{
else
{
...
@@ -420,7 +415,7 @@ void MarlinUI::draw_status_screen() {
...
@@ -420,7 +415,7 @@ void MarlinUI::draw_status_screen() {
));
));
}
}
#if BOTH(SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY) // Tri-state progress display mode
#if BOTH(SHOW_REMAINING_TIME, ROTATE_PROGRESS_DISPLAY) // Tri-state progress display mode
progress_x_pos
=
_SD_
DURATION
_X
(
strlen
(
progress_string
)
+
1
);
progress_x_pos
=
_SD_
INFO
_X
(
strlen
(
progress_string
));
#endif
#endif
#endif
#endif
}
}
...
@@ -429,22 +424,22 @@ void MarlinUI::draw_status_screen() {
...
@@ -429,22 +424,22 @@ void MarlinUI::draw_status_screen() {
lastElapsed
=
ev
;
lastElapsed
=
ev
;
const
bool
has_days
=
(
elapsed
.
value
>=
60
*
60
*
24L
);
const
bool
has_days
=
(
elapsed
.
value
>=
60
*
60
*
24L
);
const
uint8_t
len
=
elapsed
.
toDigital
(
elapsed_string
,
has_days
);
const
uint8_t
len
=
elapsed
.
toDigital
(
elapsed_string
,
has_days
);
elapsed_x_pos
=
_SD_
DURATION
_X
(
len
);
elapsed_x_pos
=
_SD_
INFO
_X
(
len
);
#if ENABLED(SHOW_REMAINING_TIME)
#if ENABLED(SHOW_REMAINING_TIME)
if
(
!
(
ev
&
0x3
))
{
if
(
!
(
ev
&
0x3
))
{
duration_t
estimation
=
elapsed
.
value
*
(
100
*
(
PROGRESS_SCALE
)
-
progress
)
/
progress
;
duration_t
estimation
=
elapsed
.
value
*
(
100
*
(
PROGRESS_SCALE
)
-
progress
)
/
progress
;
if
(
estimation
.
value
==
0
)
{
if
(
estimation
.
value
==
0
)
{
estimation_string
[
0
]
=
'\0'
;
estimation_string
[
0
]
=
'\0'
;
estimation_x_pos
=
_SD_
DURATION
_X
(
0
);
estimation_x_pos
=
_SD_
INFO
_X
(
0
);
}
}
else
{
else
{
const
bool
has_days
=
(
estimation
.
value
>=
60
*
60
*
24L
);
const
bool
has_days
=
(
estimation
.
value
>=
60
*
60
*
24L
);
const
uint8_t
len
=
estimation
.
toDigital
(
estimation_string
,
has_days
);
const
uint8_t
len
=
estimation
.
toDigital
(
estimation_string
,
has_days
);
#if BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY)
#if BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY)
estimation_x_pos
=
_SD_
DURATION
_X
(
len
);
estimation_x_pos
=
_SD_
INFO
_X
(
len
);
#else
#else
estimation_x_pos
=
_SD_
DURATION
_X
(
len
+
1
);
estimation_x_pos
=
_SD_
INFO
_X
(
len
+
1
);
#endif
#endif
}
}
}
}
...
@@ -605,17 +600,16 @@ void MarlinUI::draw_status_screen() {
...
@@ -605,17 +600,16 @@ void MarlinUI::draw_status_screen() {
if
(
progress_state
==
0
)
{
if
(
progress_state
==
0
)
{
if
(
progress_string
[
0
])
{
if
(
progress_string
[
0
])
{
lcd_put_u8str
(
PROGRESS_BAR_X
,
EXTRAS_BASELINE
,
PROGRESS_TIME_PREFIX
);
lcd_put_u8str
(
progress_x_pos
,
EXTRAS_BASELINE
,
progress_string
);
lcd_put_u8str
(
progress_x_pos
,
EXTRAS_BASELINE
,
progress_string
);
lcd_put_wchar
(
'%'
);
lcd_put_wchar
(
'%'
);
}
}
}
}
else
if
(
progress_state
==
2
&&
estimation_string
[
0
])
{
else
if
(
progress_state
==
2
&&
estimation_string
[
0
])
{
lcd_put_u8str
(
PROGRESS_BAR_X
,
EXTRAS_BASELINE
,
SHOW_REMAINING_TIME_PREFIX
);
lcd_put_u8str
(
PROGRESS_BAR_X
,
EXTRAS_BASELINE
,
"R:"
);
lcd_put_u8str
(
estimation_x_pos
,
EXTRAS_BASELINE
,
estimation_string
);
lcd_put_u8str
(
estimation_x_pos
,
EXTRAS_BASELINE
,
estimation_string
);
}
}
else
if
(
elapsed_string
[
0
])
{
else
if
(
elapsed_string
[
0
])
{
lcd_put_u8str
(
PROGRESS_BAR_X
,
EXTRAS_BASELINE
,
ELAPSED_TIME_PREFIX
);
lcd_put_u8str
(
PROGRESS_BAR_X
,
EXTRAS_BASELINE
,
"E:"
);
lcd_put_u8str
(
elapsed_x_pos
,
EXTRAS_BASELINE
,
elapsed_string
);
lcd_put_u8str
(
elapsed_x_pos
,
EXTRAS_BASELINE
,
elapsed_string
);
}
}
...
@@ -638,7 +632,7 @@ void MarlinUI::draw_status_screen() {
...
@@ -638,7 +632,7 @@ void MarlinUI::draw_status_screen() {
#if ENABLED(SHOW_REMAINING_TIME)
#if ENABLED(SHOW_REMAINING_TIME)
if
(
blink
&&
estimation_string
[
0
])
{
if
(
blink
&&
estimation_string
[
0
])
{
lcd_put_wchar
(
estimation_x_pos
,
EXTRAS_BASELINE
,
SHOW_REMAINING_TIME_PREFIX
);
lcd_put_wchar
(
estimation_x_pos
,
EXTRAS_BASELINE
,
'R'
);
lcd_put_u8str
(
estimation_string
);
lcd_put_u8str
(
estimation_string
);
}
}
else
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment