My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
generictypes.h
1 #ifndef generictypes_h
2 #define generictypes_h
3 
4 #include "source.h" /* SRC_NAME_MAX */
5 #include "scan.h" /* SCAN_NAME_MAX */
6 #include "arraymap.h" /* (RegMap *) */
7 
8 /*
9  * Provide a macro that returns the number of elements of an array.
10  */
11 #define DIMENSION(array) (sizeof(array)/sizeof(array[0]))
12 
13 /*-----------------------------------------------------------------------
14  * The Date datatype uses astrom.h::input_utc() to read UTC date and
15  * time values like:
16  *
17  * dd-mmm-yyyy hh:mm:ss.s
18  *
19  * where mmm is a 3-letter month name. It stores the date as a Modified
20  * Julian Date in DoubleVariable's. It provides + and - operators for
21  * the addition and subtraction of Interval values, along with all of the
22  * relational operators except the ~ operator.
23  */
24 DataType *add_DateDataType(Script *sc, char *name);
25 
26 /*-----------------------------------------------------------------------
27  * The Register datatype uses regmap.h::input_RegMapReg() to read
28  * standard SZA archive-register specifications (eg. board.name[3-4]).
29  *
30  * It is stored in a RegisterVariable and supports the != == !~ ~ operators.
31  */
32 DataType *add_RegisterDataType(Script *sc, char *name, ArrayMap *arraymap);
33 
34 typedef struct {
35  Variable v; /* The base-class members of the variable (see script.h) */
36  short regmap; /* Register-map number */
37  short board; /* Register-board number */
38  short block; /* Block number on specified board */
39  short index; /* The first element of the block to be addressed */
40  short nreg; /* The number of elements to be addressed */
42 
43 #define REGISTER_VARIABLE(v) ((RegisterVariable *)(v))
44 
45 
46 /*-----------------------------------------------------------------------
47  * The Wdir datatype is used to record writable directory names.
48  * The path name is stored in a StringVariable. It supports
49  * tilde expansion of home directories.
50  *
51  * It is stored in a StringVariable and supports the != == operators.
52  */
53 DataType *add_WdirDataType(Script *sc, char *name);
54 
55 /*-----------------------------------------------------------------------
56  * The Dir datatype is used to record the names of accessible directories.
57  *
58  * The path name is stored in a StringVariable. It supports
59  * tilde expansion of home directories.
60  *
61  * It is stored in a StringVariable and supports the != == operators.
62  */
63 DataType *add_DirDataType(Script *sc, char *name);
64 
65 /*-----------------------------------------------------------------------
66  * The Dev datatype is used to record the names of accessible devices
67  *
68  * The path name is stored in a StringVariable. It supports
69  * tilde expansion of home directories.
70  *
71  * It is stored in a StringVariable and supports the != == operators.
72  */
73 DataType *add_DevDataType(Script *sc, char *name);
74 
75 /*-----------------------------------------------------------------------
76  * The IntTime datatype is used to specify the hardware integration time
77  * of the SZA electronics, as a power-of-2 exponent to be used to scale
78  * the basic sample interval of 4.096e-4 seconds.
79  *
80  * It is stored in a UintVariable and supports != == <= >= < >.
81  */
82 DataType *add_IntTimeDataType(Script *sc, char *name);
83 
84 /*-----------------------------------------------------------------------
85  * The Board datatype is used to specify an archive register board by
86  * name.
87  *
88  * It is stored in a UintVariable and supports the != == operator.
89  */
90 DataType *add_BoardDataType(Script *sc, char *name, ArrayMap *arraymap);
91 
92 /*-----------------------------------------------------------------------
93  * The Time datatype is used to specify a time of day (UTC or LST).
94  *
95  * It is stored as decimal hours in a DoubleVariable. It supports the
96  * standard arithmentic != == <= >= < > operators.
97  */
98 DataType *add_TimeDataType(Script *sc, char *name);
99 
100 /*-----------------------------------------------------------------------
101  * The Interval datatype is used to specify a time interval.
102  *
103  * It is stored as decimal seconds in a DoubleVariable. It supports the
104  * standard arithmentic != == <= >= < > operators.
105  */
106 DataType *add_IntervalDataType(Script *sc, char *name);
107 
108 /*-----------------------------------------------------------------------
109  * The Antennas datatype is used to select a sub-set of the SZA
110  * receivers.
111  *
112  * It is stored in a SetVariable and supports the standard
113  * set + - !~ ~ != == operators.
114  */
115 DataType *add_AntennasDataType(Script *sc, char *name);
116 
117 /*-----------------------------------------------------------------------
118  * The SysType datatype is used to tell the shutdown and reboot commands
119  * which sub-system to reset.
120  *
121  * It is stored in a ChoiceVariable and supports the != == operators.
122  */
123 DataType *add_SysTypeDataType(Script *sc, char *name);
124 /*
125  * Enumerate the subsystems addressed by the SysType datatype.
126  */
127 typedef enum {
128  SYS_CPU, /* Reboot or shutdown the CPU */
129  SYS_RTC, /* Reboot or shutdown the real-time-control system */
130  SYS_CONTROL, /* Restart or shutdown the control program */
131  SYS_PMAC /* Restart the pmac */
132 } SysType;
133 
134 /*-----------------------------------------------------------------------
135  * The TimeScale datatype is used with Time variables to specify which
136  * time system they refer to.
137  *
138  * It is stored in a ChoiceVariable and supports the != == operators.
139  */
140 DataType *add_TimeScaleDataType(Script *sc, char *name);
141 /*
142  * Enumerate the supported time systems.
143  */
144 typedef enum {
145  TIME_UTC, /* Universal Coordinated Time */
146  TIME_LST /* Local Sidereal Time */
147 } TimeScale;
148 
149 /*-----------------------------------------------------------------------
150  * The SwitchState datatype is used to specify whether to turn a switch
151  * on or off.
152  *
153  * It is stored in a ChoiceVariable and supports the != == operators.
154  */
155 DataType *add_SwitchStateDataType(Script *sc, char *name);
156 /*
157  * Enumerate the supported switch states.
158  */
159 typedef enum {SWITCH_ON, SWITCH_OFF} SwitchState;
160 
161 /*-----------------------------------------------------------------------
162  * The AcquireTargets datatype is used to tell the until() command which
163  * operations to wait for.
164  *
165  * It is stored in a SetVariable and supports the standard
166  * set + - !~ ~ != == operators.
167  */
168 DataType *add_DelayTargetDataType(Script *sc, char *name);
169 
170 /*-----------------------------------------------------------------------
171  * The Scan datatype is used for specification of a scan by its name
172  * in the scan catalog.
173  *
174  * It is stored in a ScanVariable and supports the != == operators.
175  */
176 DataType *add_ScanDataType(Script *sc, char *name);
177 
178 typedef struct {
179  Variable v; /* Generic members of the variable (see script.h) */
180  char name[gcp::control::SCAN_NAME_MAX]; /* The name of the scan */
181 } ScanVariable;
182 
183 #define SCAN_VARIABLE(v) ((ScanVariable *)(v))
184 
185 /*-----------------------------------------------------------------------
186  * The Source datatype is used for specification of a source by its name
187  * in the source catalog.
188  *
189  * It is stored in a SourceVariable and supports the != == operators.
190  */
191 DataType *add_SourceDataType(Script *sc, char *name);
192 
193 typedef struct {
194  Variable v; /* Generic members of the variable (see script.h) */
195  char name[gcp::control::SRC_NAME_MAX]; /* The name of the source */
197 
198 #define SOURCE_VARIABLE(v) ((SourceVariable *)(v))
199 
200 /*-----------------------------------------------------------------------
201  * The TransDev datatype is used for specification of a device by its name
202  * in the transaction catalog.
203  *
204  * It is stored in a TransDevVariable and supports the != == operators.
205  */
206 DataType *add_TransDevDataType(Script *sc, char *name);
207 
208 typedef struct {
209  Variable v; // Generic members of the variable (see script.h)
210  // The name of the device
211  char name[gcp::control::TransactionManager::DEV_NAME_MAX+1];
213 
214 #define TRANSDEV_VARIABLE(v) ((TransDevVariable *)(v))
215 
216 /*-----------------------------------------------------------------------
217  * The TransLocation datatype is used for specification of a location
218  * by its name in the transaction catalog.
219  *
220  * It is stored in a TransLocationVariable
221  */
222 DataType *add_TransLocationDataType(Script *sc, char *name);
223 
224 /*-----------------------------------------------------------------------
225  * The TransSerial datatype is used for specification of a serial
226  * by its name in the transaction catalog.
227  *
228  * It is stored in a TransSerialVariable
229  */
230 DataType *add_TransSerialDataType(Script *sc, char *name);
231 
232 /*-----------------------------------------------------------------------
233  * The TransWho datatype is used for specification of the person
234  * logging the transaction
235  *
236  * It is stored in a TransWhoVariable
237  */
238 DataType *add_TransWhoDataType(Script *sc, char *name);
239 
240 /*-----------------------------------------------------------------------
241  * The TransComment datatype is used for specification of the person
242  * logging the transaction
243  *
244  * It is stored in a TransCommentVariable
245  */
246 DataType *add_TransCommentDataType(Script *sc, char *name);
247 
248 /*-----------------------------------------------------------------------
249  * The Model datatype is used to select between the optical and radio
250  * pointing models.
251  *
252  * It is stored in a ChoiceVariable and supports the != == operators.
253  */
254 DataType *add_ModelDataType(Script *sc, char *name);
255 
256 /*-----------------------------------------------------------------------
257  * The Latitude datatype is used to specify the latitude of a location
258  * on the surface of the Earth (-90..90 degrees).
259  *
260  * It is stored in degrees as a DoubleVariable and supports the
261  * standard arithmetic != == <= >= < > operators.
262  */
263 DataType *add_LatitudeDataType(Script *sc, char *name);
264 
265 /*-----------------------------------------------------------------------
266  * The Longitude datatype is used to specify the longitude of a location
267  * on the surface of the Earth (-180..180 degrees).
268  *
269  * It is stored in degrees as a DoubleVariable and supports the
270  * standard arithmetic != == <= >= < > operators.
271  */
272 DataType *add_LongitudeDataType(Script *sc, char *name);
273 
274 /*-----------------------------------------------------------------------
275  * The Azimuth datatype is used to specify a target azimuth for the
276  * telescope. The azimuths of the compass points are N=0, E=90, S=180
277  * and W=270 degrees (-360..360 degrees).
278  *
279  * It is stored in degrees as a DoubleVariable and supports the
280  * standard arithmetic != == <= >= < > operators.
281  */
282 DataType *add_AzimuthDataType(Script *sc, char *name);
283 
284 /*-----------------------------------------------------------------------
285  * The DeckAngle datatype is used to specify the position of the rotating
286  * platform on which the dishes are mounted (-360..360 degrees).
287  *
288  * It is stored in degrees as a DoubleVariable and supports the
289  * standard arithmetic != == <= >= < > operators.
290  */
291 DataType *add_DeckAngleDataType(Script *sc, char *name);
292 
293 /*-----------------------------------------------------------------------
294  * The Elevation datatype is used to specify the target elevation angle
295  * of the telescope (-90..90 degrees).
296  *
297  * It is stored in degrees as a DoubleVariable and supports the
298  * standard arithmetic != == <= >= < > operators.
299  */
300 DataType *add_ElevationDataType(Script *sc, char *name);
301 
302 /*-----------------------------------------------------------------------
303  * The PointingOffset datatype is used to specify a temporary offset of
304  * one of the telescope axes from the current pointing (-180..180).
305  *
306  * It is stored in degrees as a DoubleVariable and supports the
307  * standard arithmetic != == <= >= < > operators.
308  */
309 DataType *add_PointingOffsetDataType(Script *sc, char *name);
310 
311 /*-----------------------------------------------------------------------
312  * The Flexure datatype is used to specify the degree of gravitational
313  * drooping of the telescope as a function of elevation (-90..90 degrees).
314  *
315  * It is stored in degrees per cosine of elevation as a DoubleVariable
316  * and supports the standard arithmetic != == <= >= < > operators.
317  */
318 DataType *add_FlexureDataType(Script *sc, char *name);
319 
320 /*-----------------------------------------------------------------------
321  * The Tilt datatype is used to specify the misalignment tilt of a
322  * telescope axis (-90..90 degrees).
323  *
324  * It is stored in degrees as a DoubleVariable and supports the
325  * standard arithmetic != == <= >= < > operators.
326  */
327 DataType *add_TiltDataType(Script *sc, char *name);
328 
329 /*-----------------------------------------------------------------------
330  * The Tracking data type is used for specifying the type of tracking,
331  * phase tracking or pointing tracking
332  */
333 DataType *add_TrackingDataType(Script *sc, char *name);
334 
335 /*-----------------------------------------------------------------------
336  * The Altitude datatype is used to specify the height of the telescope
337  * above the standard geodetic spheroid (-10000..10000 meters).
338  *
339  * It is stored in meters as a DoubleVariable and supports the
340  * standard arithmetic != == <= >= < > operators.
341  */
342 DataType *add_AltitudeDataType(Script *sc, char *name);
343 
344 /*-----------------------------------------------------------------------
345  * The GpibDev datatype is used to select a device on the GPIB bus (0..30).
346  *
347  * It is stored in a UintVariable and supports the standard arithmetic
348  * != == <= >= < > operators.
349  */
350 DataType *add_GpibDevDataType(Script *sc, char *name);
351 
352 /*-----------------------------------------------------------------------
353  * The GpibCmd datatype is used to specify a command string to be sent
354  * to a device on the GPIB bus.
355  *
356  * It is stored as a string of at most rtcnetcoms.h::GPIB_MAX_DATA
357  * characters in a StringVariable and supports the != == !~ ~ operators.
358  */
359 DataType *add_GpibCmdDataType(Script *sc, char *name);
360 
361 /*-----------------------------------------------------------------------
362  * The Features datatype is used to specify one or more features to
363  * be highlighted in a subsequent archive frame.
364  */
365 DataType *add_FeaturesDataType(Script *sc, char *name);
366 
367 /*-----------------------------------------------------------------------
368  * The DeckMode datatype is used to tell the tracker task how to
369  * position the deck axis while tracking sources.
370  *
371  * It is stored in a ChoiceVariable and supports the != == operators.
372  */
373 DataType *add_DeckModeDataType(Script *sc, char *name);
374 
375 /*-----------------------------------------------------------------------
376  * The Attenuation datatype is used for configuring channelizer
377  * attenuators to insert attenuations in steps of 1db over the range
378  * 0..31db.
379  *
380  * It is stored in a UintVariable and supports != == <= >= < >.
381  */
382 DataType *add_AttenuationDataType(Script *sc, char *name);
383 
384 /*-----------------------------------------------------------------------
385  * The ArcType datatype is used to tell the close, flush and open
386  * commands which archiving file to operate on.
387  *
388  * It is stored in a ChoiceVariable and supports the != == operators.
389  * The enumerators that become stored in ArcType values are taken from
390  * arcfile.h::ArcFileType.
391  */
392 DataType *add_ArcFileDataType(Script *sc, char *name);
393 
394 /*-----------------------------------------------------------------------
395  * The FeatureChange datatype is used to tell the mark command what to
396  * do with the set of features that it is given.
397  *
398  * It is stored in a ChoiceVariable and supports the != == operators.
399  * The enumerators that become stored in FeatureChange values are taken from
400  * rtcnetcoms.h::FeatureMode.
401  */
402 DataType *add_FeatureChangeDataType(Script *sc, char *name);
403 
404 /*-----------------------------------------------------------------------
405  * The BitMask datatype is used to set bit-mask as a set of 32 bits.
406  *
407  * It is stored in a SetVariable and supports the standard
408  * set + - !~ ~ != == operators.
409  */
410 DataType *add_BitMaskDataType(Script *sc, char *name);
411 
412 /*-----------------------------------------------------------------------
413  * The BitMaskOper datatype is used to specify whether a given bit-mask
414  * should be used to set bits, clear bits or to be used verbatim.
415  *
416  * It is stored in a ChoiceVariable using the enumerators defined in
417  * rtcnetcoms.h, and supports the standard set != and == operators.
418  */
419 DataType *add_BitMaskOperDataType(Script *sc, char *name);
420 
421 /*-----------------------------------------------------------------------
422  * The Script datatype is used for entering the name and arguments
423  * of a script.
424  */
425 DataType *add_ScriptDataType(Script *sc, char *name);
426 
427 typedef struct {
428  Variable v; /* The base-class members of the variable (see script.h) */
429  Script *sc; /* The compiled script */
431 
432 #define SCRIPT_VARIABLE(v) ((ScriptVariable *)(v))
433 
434 /*-----------------------------------------------------------------------
435  * The OptCamTarget datatype is used to specify the target of an optical
436  * camera command.
437  */
438 DataType *add_OptCamTargetDataType(Script *sc, char *name);
439 
440 /*-----------------------------------------------------------------------
441  * The OptCamAction datatype is used to specify the action of an optical
442  * camera command.
443  */
444 DataType *add_OptCamActionDataType(Script *sc, char *name);
445 
446 /*.......................................................................
447  * The OptCamCount datatype is used for specifying optical camera integer
448  * stepper motor steps.
449  *
450  * It is stored in an IntVariable with +10000 used to specify
451  * a device to be switched on, and -10000 used to specify a device to be
452  * switched off. It supports the standard arithmentic
453  * != == <= >= < > operators.
454  */
455 DataType *add_OptCamCountDataType(Script *sc, char *name);
456 
457 /*.......................................................................
458  * The Peak datatype is used for specifying which peak offset from the
459  * frame grabber to return.
460  */
461 DataType *add_PeakDataType(Script *sc, char *name);
462 
463 /*.......................................................................
464  * The Imstat datatype is used for specifying which frame grabber image
465  * statistic to return
466  */
467 DataType *add_ImstatDataType(Script *sc, char *name);
468 
469 /*-----------------------------------------------------------------------
470  * The following datatype is used to set slew rates, in terms of a
471  * percentage of the maximum speed available.
472  *
473  * It is stored in a UintVariable and supports != == <= >= < >.
474  */
475 DataType *add_SlewRateDataType(Script *sc, char *name);
476 
477 /*-----------------------------------------------------------------------
478  * The EmailAction datatype is used to specify whether to enable,
479  * disable, or turn the pager on
480  *
481  * It is stored in a ChoiceVariable using enumerators defined in
482  * rtcnetcoms.h, and supports the != == operators.
483 */
484 DataType *add_EmailActionDataType(Script *sc, char *name);
485 
486 typedef enum {EMAIL_ADD, EMAIL_CLEAR, EMAIL_LIST} EmailAction;
487 
488 /*-----------------------------------------------------------------------
489  * The PagerState datatype is used to specify whether to enable,
490  * disable, or turn the pager on
491  *
492  * It is stored in a ChoiceVariable using enumerators defined in
493  * rtcnetcoms.h, and supports the != == operators.
494 */
495 DataType *add_PagerStateDataType(Script *sc, char *name);
496 
497 /*-----------------------------------------------------------------------
498  * The PagerDev datatype is used to specify a pager device
499  *
500  * It is stored in a ChoiceVariable using enumerators defined in
501  * rtcnetcoms.h, and supports the != == operators.
502 */
503 DataType *add_PagerDevDataType(Script *sc, char *name);
504 
505 /*-----------------------------------------------------------------------
506  * The DcPower datatype is used to specify the target power level for
507  * the downconverter. A value < 0 is used to denote a preset level.
508  *
509  * It is stored in a Double variabel and supports the standard
510  * arithmetic != == <= >= < > operators.
511  */
512 DataType *add_DcPowerDataType(Script *sc, char *name);
513 
514 /*-----------------------------------------------------------------------
515  * The DelayType datatype is used to specify the type of delay to
516  * configure
517  */
518 DataType *add_DelayTypeDataType(Script *sc, char *name);
519 
520 /*-----------------------------------------------------------------------
521  * The RotSense datatype is used to select the sens of the deck
522  * rotation.
523  */
524 DataType *add_RotSenseDataType(Script *sc, char *name);
525 
526 /*-----------------------------------------------------------------------
527  * The ImDir datatype is used to select the orientation of the frame
528  * grabber image axes
529  */
530 DataType *add_ImDirDataType(Script *sc, char *name);
531 
532 
533 DataType *add_FlatfieldModeDataType(Script *sc, char *name);
534 
535 DataType *add_FgChannelDataType(Script *sc, char *name);
536 
537 DataType *add_PointingTelescopesDataType(Script *sc, char *name);
538 
539 #endif
540 
541 
Definition: generictypes.h:193
Definition: generictypes.h:427
Definition: generictypes.h:208
Definition: script.h:867
Definition: script.h:315
Definition: generictypes.h:34
Definition: script.h:992
Definition: arraymap.h:177
Definition: generictypes.h:178