Commit b93aaaa6 authored by Leon Tappe's avatar Leon Tappe 🔥
Browse files

adjust toner levels to make more practical sense

parent 01bd37e3
...@@ -165,8 +165,8 @@ class PrinterStatus { ...@@ -165,8 +165,8 @@ class PrinterStatus {
Level _percentageToLevel(int percentage) { Level _percentageToLevel(int percentage) {
if (percentage >= 90) return Level.full; if (percentage >= 90) return Level.full;
if (percentage >= 25) return Level.mid; if (percentage >= 30) return Level.mid;
if (percentage > 0) return Level.low; if (percentage > 10) return Level.low;
return Level.empty; return Level.empty;
} }
} }
...@@ -308,22 +308,22 @@ class PrintersBloc extends Bloc<PrintersEvent, PrintersState> { ...@@ -308,22 +308,22 @@ class PrintersBloc extends Bloc<PrintersEvent, PrintersState> {
if (printer.status.tonerC > 100) { if (printer.status.tonerC > 100) {
printer.status.tonerC = 100; printer.status.tonerC = 100;
} else if (printer.status.tonerC < 0) { } else if (printer.status.tonerC < 0) {
printer.status.tonerC = 0; printer.status.tonerC = 10;
} }
if (printer.status.tonerM > 100) { if (printer.status.tonerM > 100) {
printer.status.tonerM = 100; printer.status.tonerM = 100;
} else if (printer.status.tonerM < 0) { } else if (printer.status.tonerM < 0) {
printer.status.tonerM = 0; printer.status.tonerM = 10;
} }
if (printer.status.tonerY > 100) { if (printer.status.tonerY > 100) {
printer.status.tonerY = 100; printer.status.tonerY = 100;
} else if (printer.status.tonerY < 0) { } else if (printer.status.tonerY < 0) {
printer.status.tonerY = 0; printer.status.tonerY = 10;
} }
if (printer.status.tonerK > 100) { if (printer.status.tonerK > 100) {
printer.status.tonerK = 100; printer.status.tonerK = 100;
} else if (printer.status.tonerK < 0) { } else if (printer.status.tonerK < 0) {
printer.status.tonerK = 0; printer.status.tonerK = 10;
} }
// catch paper levels under 0 to make calculations work properly // catch paper levels under 0 to make calculations work properly
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment