56 lines
1.7 KiB
Dart
56 lines
1.7 KiB
Dart
|
// ignore_for_file: constant_identifier_names
|
||
|
|
||
|
import 'parser.dart';
|
||
|
import 'sentence.dart';
|
||
|
|
||
|
const TypeALF = "ALF";
|
||
|
|
||
|
class ALF {
|
||
|
int numFragments; // 0
|
||
|
int fragmentNumber; // 1
|
||
|
int messageID; // 2
|
||
|
Time time; // 3
|
||
|
String category; // 4
|
||
|
String priority; // 5
|
||
|
String state; // 6
|
||
|
String manufacturerMnemonicCode; // 7
|
||
|
int alertIdentifier; // 8
|
||
|
int alertInstance; // 9
|
||
|
int revisionCounter; // 10
|
||
|
int escalationCounter; // 11
|
||
|
String text; // 12
|
||
|
ALF(
|
||
|
{required this.numFragments,
|
||
|
required this.fragmentNumber,
|
||
|
required this.messageID,
|
||
|
required this.time,
|
||
|
required this.category,
|
||
|
required this.priority,
|
||
|
required this.state,
|
||
|
required this.manufacturerMnemonicCode,
|
||
|
required this.alertIdentifier,
|
||
|
required this.alertInstance,
|
||
|
required this.revisionCounter,
|
||
|
required this.escalationCounter,
|
||
|
required this.text});
|
||
|
static ALF newALF(BaseSentence s) {
|
||
|
var p = Parser(s);
|
||
|
|
||
|
return ALF(
|
||
|
numFragments: p.int64(0, "number of fragments"),
|
||
|
fragmentNumber: p.int64(1, "fragment number"),
|
||
|
messageID: p.int64(2, "message ID"),
|
||
|
time: p.time(3, "time"),
|
||
|
category: p.enumString(4, "alarm category", ["A", "B", "C"]),
|
||
|
priority: p.enumString(5, "alarm priority", ["E", "A", "C", "W"]),
|
||
|
state: p.enumString(6, "alarm state", ["A", "S", "O", "U", "V", "N"]),
|
||
|
manufacturerMnemonicCode: p.string(7, "manufacturer mnemonic code"),
|
||
|
alertIdentifier: p.int64(8, "alert identifier"),
|
||
|
alertInstance: p.int64(9, "alert instance"),
|
||
|
revisionCounter: p.int64(10, "revision counter"),
|
||
|
escalationCounter: p.int64(11, "escalation counter"),
|
||
|
text: p.string(12, "alert text"),
|
||
|
);
|
||
|
}
|
||
|
}
|