-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathalLib.h
224 lines (202 loc) · 7.92 KB
/
alLib.h
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 Deutches Elektronen-Synchrotron in der Helmholtz-
* Gemelnschaft (DESY).
* Copyright (c) 2002 Berliner Speicherring-Gesellschaft fuer Synchrotron-
* Strahlung mbH (BESSY).
* Copyright (c) 2002 Southeastern Universities Research Association, as
* Operator of Thomas Jefferson National Accelerator Facility.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* This file is distributed subject to a Software License Agreement found
* in the file LICENSE that is included with this distribution.
\*************************************************************************/
/* alLib.h */
/************************DESCRIPTION***********************************
Group and channel data structure definitions
**********************************************************************/
#ifndef INCalLibh
#define INCalLibh 1
#include "cadef.h"
#include "alh.h"
#include "sllLib.h"
#include "ellLib.h"
typedef struct mask { /* mask bit setting */
unsigned Cancel : 1;
unsigned Disable : 1;
unsigned Ack : 1;
unsigned AckT : 1;
unsigned Log : 1;
unsigned Unused : 11;
} MASK;
typedef struct alarmEvent {
short stat;
short sevr;
short acks;
short ackt;
char value[MAX_STRING_SIZE];
int alarmTime;
void *clink;
} ALARMEVENT;
typedef struct countFilter {
int inputCount;
int inputSeconds;
short stat; /* channel status from CA */
short sev; /* current severity */
short acks; /* highest unack severity */
short ackt; /* acknowledge transients? */
char value[MAX_STRING_SIZE]; /* channel value from CA */
int countIndex;
time_t alarmTime;
time_t *alarmTimeHistory;
void *clink;
XtIntervalId timeoutId;
} COUNTFILTER;
typedef struct forcePVdata {
short index;
void *link;
short linktype;
} FORCEPVCADATA;
#ifndef NO_OF_CALC_PVS
#define NO_OF_CALC_PVS 6
#endif
typedef struct calc {
char *expression; /* calc expression */
char *rpbuf; /* calc expression in reverse polish */
char *name[NO_OF_CALC_PVS]; /* pv name */
chid chid[NO_OF_CALC_PVS]; /* pv channel id */
evid evid[NO_OF_CALC_PVS]; /* pv event id */
FORCEPVCADATA* puser[NO_OF_CALC_PVS]; /* pv current value */
double value[NO_OF_CALC_PVS]; /* pv current value */
} FORCEPV_CALC;
typedef struct forcePV {
char *name; /* pv name */
chid chid; /* pv channel id */
evid evid; /* pv channel event id */
FORCEPVCADATA* puser; /* pv current value */
double currentValue; /* pv current value */
double forceValue; /* pv value for force mask */
double resetValue; /* pv value for reset mask */
short disabled; /* pv disabled? TRUE/FALSE */
MASK forceMask; /* force mask */
FORCEPV_CALC* pcalc;
} FORCEPV;
/* group/channel data structure */
struct gcData {
char *name; /* group name */
char *sevrPVName; /* severityPV name */
FORCEPV *pforcePV; /* forcePV info */
char *alias; /* alias text */
char *command; /* command text */
ELLLIST sevrCommandList; /* alarm severity command list */
short curSevr; /* current severity */
short unackSevr; /* highest unack severity */
short unackBeepSevr; /* highest unack severity for beeping */
short highestBeepSevr; /* highest beep severity */
chid sevrchid; /* sevrPV channel id */
short beepSevr; /* beep severity */
XtIntervalId noAckTimerId;
};
/* group data structure */
struct groupData {
char *name; /* group name */
char *sevrPVName; /* severityPV name */
FORCEPV *pforcePV; /* forcePV info */
char *alias; /* alias text */
char *command; /* command text */
ELLLIST sevrCommandList; /* severity command list */
short curSevr; /* current highestseverity from CA */
short unackSevr; /* highest unack severity */
short unackBeepSevr; /* highest unack severity for beeping */
short highestBeepSevr; /* highest beep severity */
chid sevrchid; /* group sevrPV channel id */
short beepSevr; /* beep severity */
XtIntervalId noAckTimerId;
char *treeSym; /* tree symbols for treeWindow display */
int mask[ALARM_NMASK]; /* no. of channels of masked types*/
int beepSev[ALH_ALARM_NSEV]; /* channels of different beep severity */
int curSev[ALH_ALARM_NSEV]; /* channels of different severity */
int unackSev[ALH_ALARM_NSEV]; /* channels of unacknowledged sevr */
int unackBeepSev[ALH_ALARM_NSEV]; /* channels of unacknowledged sev >= beep sevr */
};
/* channel data structure */
struct chanData {
char *name; /* channel name, or device/attribute */
char *sevrPVName; /* severityPV name */
FORCEPV *pforcePV; /* forcePV info */
char *alias; /* alias text */
char *command; /* command text */
ELLLIST sevrCommandList; /* severity command list */
short curSevr; /* channel severity from CA */
short unackSevr; /* highest unack severity */
short unackBeepSevr; /* highest unack severity for beeping */
short highestBeepSevr; /* highest beep severity */
chid sevrchid; /* sevrPV channel id */
short beepSevr; /* beep severity */
XtIntervalId noAckTimerId;
ELLLIST statCommandList; /* alarm status command list */
COUNTFILTER *countFilter; /* alarm count filter */
MASK curMask; /* current mask setting */
MASK defaultMask; /* default mask setting */
char value[MAX_STRING_SIZE]; /* channel value from CA */
short curStat; /* channel status from CA */
chid chid; /* chid from CA search */
evid evid; /* evid from CA add event */
char *description; /* Info from PV .DESC field */
chid descriptionId; /* his (.DESC) chid */
char *ackPVName; /* ackPV name */
chid ackPVId; /* id of prev. */
short ackPVValue; /* value to ackPV */
ALARMEVENT caAlarmEvent; /* saved ca alarm event data */
};
/* group link */
struct groupLink {
SNODE node; /* single link list node type */
SLIST GuideList; /* guidance link list */
char *guidanceLocation; /* guidance location (url or filename)*/
struct groupLink *parent; /* parent groupLink pointer */
struct groupData *pgroupData; /* group data pointer */
struct mainGroup *pmainGroup; /* mainGroup pointer */
void *lineTreeW; /* line address Tree Window*/
void *lineGroupW; /* line address Group Window*/
int viewCount; /* count of open groups */
int modified; /* modified indicator */
SLIST subGroupList; /* subgroup link list */
SLIST chanList; /* channel link list */
};
/* channel link */
struct chanLink {
SNODE node; /* single link list node type */
SLIST GuideList; /* guidance link list */
char *guidanceLocation; /* guidance location (url or filename)*/
struct groupLink *parent; /* parent groupLinke pointer */
struct chanData *pchanData; /* channel data pointer */
struct mainGroup *pmainGroup; /* mainGroup pointer */
void *lineTreeW; /* line address Tree Window*/
void *lineGroupW; /* line address Group Window*/
int viewCount; /* open/closed indicator */
int modified; /* modified indicator */
};
/* any link */
struct anyLink {
SNODE node; /* single link list node type */
SLIST GuideList; /* guidance link list */
char *guidanceLocation; /* guidance location (url or filename)*/
struct groupLink *parent; /* parent groupLink pointer */
struct gcData *pgcData; /* channel data pointer */
struct mainGroup *pmainGroup; /* mainGroup pointer */
void *lineTreeW; /* line address Tree Window*/
void *lineGroupW; /* line address Group Window*/
int viewCount; /* open/closed count or indicator */
int modified; /* modified indicator */
};
/* guidance link */
struct guideLink {
SNODE node; /* single link list node type */
char *list; /* guidance list address */
};
typedef struct groupLink GLINK;
typedef struct chanLink CLINK;
typedef struct anyLink GCLINK;
#endif /* INCalLibh */