Commit 0d7c0f2c authored by Leon Tappe's avatar Leon Tappe 🔥
Browse files

add status string getter to status model

parent c2a08b48
...@@ -34,6 +34,88 @@ class PrinterStatus { ...@@ -34,6 +34,88 @@ class PrinterStatus {
tray3: map['tray_3'] as int, tray3: map['tray_3'] as int,
); );
List<String> get copyStatus {
var problems = <String>[];
if (copy != null) {
if (copy == 0) {
return problems;
}
if (((copy >> 0) & 1) == 1 || ((copy >> 4) & 1) == 1) {
problems.add('Sonstiger Fehler');
}
if (((copy >> 1) & 1) == 1) {
problems.add('Tonerstand niedrig');
}
if (((copy >> 2) & 1) == 1) {
problems.add('Gerät in Benutzung');
}
if (((copy >> 3) & 1) == 1) {
problems.add('Vorheizphase');
}
if (((copy >> 5) & 1) == 1) {
problems.add('Vorlageneinzug Deckel offen');
}
if (((copy >> 6) & 1) == 1) {
problems.add('Drucker Deckel offen');
}
if (((copy >> 7) & 1) == 1) {
problems.add('Papier alle');
}
if (((copy >> 8) & 1) == 1) {
problems.add('Papierstau Scanner');
}
if (((copy >> 9) & 1) == 1) {
problems.add('Papierstau Drucker');
}
if (((copy >> 10) & 1) == 1) {
problems.add('Toner alle');
}
if (((copy >> 11) & 1) == 1) {
problems.add('Service rufen');
}
}
return problems;
}
List<String> get scanStatus {
var problems = <String>[];
if (scan != null) {
if (scan == 0) {
return problems;
}
if (((scan >> 0) & 1) == 1) {
problems.add('Vorlagenglas belegt');
}
if (((scan >> 1) & 1) == 1) {
problems.add('Vorlageneinzug Deckel offen');
}
if (((scan >> 2) & 1) == 1) {
problems.add('Papierstau Vorlageneinzug');
}
if (((scan >> 3) & 1) == 1) {
problems.add('Vorlageneinzug Wartungsklappe offen');
}
if (((scan >> 4) & 1) == 1 || ((scan >> 9) & 1) == 1) {
problems.add('Sonstiger Fehler');
}
if (((scan >> 5) & 1) == 1) {
problems.add('User Maintenance');
}
if (((scan >> 6) & 1) == 1) {
problems.add('Service rufen');
}
if (((scan >> 7) & 1) == 1) {
problems.add('Scaneinheit ausgeschaltet');
}
if (((scan >> 8) & 1) == 1) {
problems.add('Gerät in Benutzung');
}
}
return problems;
}
Map<String, dynamic> get toMap => <String, dynamic>{ Map<String, dynamic> get toMap => <String, dynamic>{
'scan': scan, 'scan': scan,
'copy': copy, 'copy': copy,
......
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