Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
AStA
AStAPrint Admin Business Logic
Commits
b93aaaa6
Commit
b93aaaa6
authored
May 10, 2022
by
Leon Tappe
🔥
Browse files
adjust toner levels to make more practical sense
parent
01bd37e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/src/models/printer_status.dart
View file @
b93aaaa6
...
...
@@ -165,8 +165,8 @@ class PrinterStatus {
Level
_percentageToLevel
(
int
percentage
)
{
if
(
percentage
>=
90
)
return
Level
.
full
;
if
(
percentage
>=
25
)
return
Level
.
mid
;
if
(
percentage
>
0
)
return
Level
.
low
;
if
(
percentage
>=
30
)
return
Level
.
mid
;
if
(
percentage
>
1
0
)
return
Level
.
low
;
return
Level
.
empty
;
}
}
lib/src/printers/printers_bloc.dart
View file @
b93aaaa6
...
...
@@ -308,22 +308,22 @@ class PrintersBloc extends Bloc<PrintersEvent, PrintersState> {
if
(
printer
.
status
.
tonerC
>
100
)
{
printer
.
status
.
tonerC
=
100
;
}
else
if
(
printer
.
status
.
tonerC
<
0
)
{
printer
.
status
.
tonerC
=
0
;
printer
.
status
.
tonerC
=
1
0
;
}
if
(
printer
.
status
.
tonerM
>
100
)
{
printer
.
status
.
tonerM
=
100
;
}
else
if
(
printer
.
status
.
tonerM
<
0
)
{
printer
.
status
.
tonerM
=
0
;
printer
.
status
.
tonerM
=
1
0
;
}
if
(
printer
.
status
.
tonerY
>
100
)
{
printer
.
status
.
tonerY
=
100
;
}
else
if
(
printer
.
status
.
tonerY
<
0
)
{
printer
.
status
.
tonerY
=
0
;
printer
.
status
.
tonerY
=
1
0
;
}
if
(
printer
.
status
.
tonerK
>
100
)
{
printer
.
status
.
tonerK
=
100
;
}
else
if
(
printer
.
status
.
tonerK
<
0
)
{
printer
.
status
.
tonerK
=
0
;
printer
.
status
.
tonerK
=
1
0
;
}
// catch paper levels under 0 to make calculations work properly
...
...
Write
Preview
Supports
Markdown
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