Commit | Line | Data |
---|---|---|
d1add34f GM |
1 | /* |
2 | * Routines to maintain the Operator Information Area. | |
3 | */ | |
4 | ||
5 | #include "oia.h" | |
6 | ||
7 | OIA OperatorInformationArea; | |
8 | ||
9 | static int | |
10 | Insert, | |
11 | SystemLocked, | |
12 | PWait, | |
13 | TWait, | |
14 | OnlineA, | |
15 | Ready3274, | |
16 | MyJob; | |
17 | ||
18 | #define X_AREA_SYSTEM 0xc6, "\xb2\xb8" | |
19 | #define X_AREA_CLOCK 0xc6, "\xf2\xf3" | |
20 | #define X_AREA_NULL 0xc6, "" | |
21 | ||
22 | static void | |
23 | SetXarea(x, xwhy) | |
24 | int x; | |
25 | char *xwhy; | |
26 | { | |
27 | register int i; | |
28 | ||
29 | OperatorInformationArea.x = x; | |
30 | for (i = 0; i < sizeof OperatorInformationArea.xwhy; i++) { | |
31 | if (*xwhy) { | |
32 | OperatorInformationArea.xwhy[i] = *xwhy++; | |
33 | } else { | |
34 | OperatorInformationArea.xwhy[i] = 0; | |
35 | } | |
36 | } | |
37 | } | |
38 | ||
39 | ||
40 | SetInsert(onoff) | |
41 | int onoff; | |
42 | { | |
43 | Insert = onoff; | |
44 | ||
45 | if (onoff) { | |
46 | OperatorInformationArea.insert = OIA_INSERT_ON; | |
47 | } else { | |
48 | OperatorInformationArea.insert = 0; | |
49 | } | |
50 | } | |
51 | ||
52 | SetSystemLocked(onoff) | |
53 | int onoff; | |
54 | { | |
55 | SystemLocked = onoff; | |
56 | ||
57 | if ((PWait == 0) && (TWait == 0)) { | |
58 | SetXArea(X_AREA_SYSTEM); | |
59 | } | |
60 | } | |
61 | ||
62 | SetPWait(onoff) | |
63 | int onoff; | |
64 | { | |
65 | PWait = onoff; | |
66 | ||
67 | if (onoff) { | |
68 | SetXArea(X_AREA_CLOCK); | |
69 | } else { | |
70 | if (SystemLocked) { | |
71 | SetXArea(X_AREA_SYSTEM); | |
72 | } else { | |
73 | SetXArea(X_AREA_NULL); | |
74 | } | |
75 | } | |
76 | } | |
77 | ||
78 | SetTWait(onoff) | |
79 | int onoff; | |
80 | { | |
81 | TWait = onoff; | |
82 | ||
83 | SetPWait(onoff); | |
84 | } | |
85 | ||
86 | SetOnlineA(onoff) | |
87 | int onoff; | |
88 | { | |
89 | OnlineA = onoff; | |
90 | ||
91 | if (onoff) { | |
92 | SetMyJob(1); | |
93 | OperatorInformationArea.online = OIA_ONLINE_A; | |
94 | } else { | |
95 | OperatorInformationArea.online = 0; | |
96 | } | |
97 | } | |
98 | ||
99 | SetReady3274(onoff) | |
100 | int onoff; | |
101 | { | |
102 | Ready3274 = onoff; | |
103 | ||
104 | if (onoff) { | |
105 | OperatorInformationArea.ready = OIA_READY_3274; | |
106 | } else { | |
107 | OperatorInformationArea.ready = 0; | |
108 | } | |
109 | } | |
110 | ||
111 | SetMyJob(onoff) | |
112 | int onoff; | |
113 | { | |
114 | MyJob = onoff; | |
115 | ||
116 | if (onoff) { | |
117 | OperatorInformationArea.ownership = OIA_OWNERSHIP_MYJOB; | |
118 | } else { | |
119 | OperatorInformationArea.ownership = 0; | |
120 | } | |
121 | } |