-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrtsk_diag.ks
56 lines (45 loc) · 1.33 KB
/
rtsk_diag.ks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
////////////////////////////////////////////////////////////////////////////////
// RTSK SYSTEMS DIAGNOSTICS
////////////////////////////////////////////////////////////////////////////////
FUNCTION MM9_ENTER {
// NOTHING
}
FUNCTION MM9_LEAVE {
// NOTHING
}
FUNCTION MM9_TRANSFER {
// NOTHING
}
FUNCTION MM9_COMMAND {
PARAMETER VERB, VALUE.
IF VERB = 1 { // RESET EVENTS
LOCAL I IS 0.
UNTIL I = NUM_EVENTS {
SET EVENTS[I][0] TO "".
SET EVENTS[I][1] TO LOW.
SET EVENTS[I][2] TO 0.
SET I TO I + 1.
}
}
}
FUNCTION MM9_SHOW_EVENTS { PARAMETER DT.
LOCAL I IS 0.
UNTIL I = NUM_EVENTS {
LOCAL PRIO IS "LO".
IF EVENTS[I][1] = HIGH { SET PRIO TO "HI". }
// DRAW EVENT LIST
UI_VARIABLE("EVT"+I, "", (FORMAT_TIME(EVENTS[I][2]) + " " + PRIO + " " + EVENTS[I][0]):PADRIGHT(24), 0,24, TEXT, 0,I).
SET I TO I + 1.
}
TASK_SCHEDULE(5, MM9_SHOW_EVENTS@).
}
////////////////////////////////////////////////////////////////////////////////
// MAJOR MODE 9
////////////////////////////////////////////////////////////////////////////////
MODE_NAMES:ADD(90, "EVENT HISTORY ").
MODE_NAMES:ADD(91, "SYS DIAGNOSTICS ").
MODE_ENTER (9, MM9_ENTER@).
MODE_TRANSFER (9, MM9_TRANSFER@).
MODE_COMMAND (9, MM9_COMMAND@).
MODE_TASK (9, MM9_SHOW_EVENTS@).
MODE_LEAVE (9, MM9_LEAVE@).