My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
NewNetCmd.h
Go to the documentation of this file.
1 // $Id: NewNetCmd.h,v 1.1.1.1 2009/07/06 23:57:07 eml Exp $
2 
3 #ifndef GCP_CONTROL_NEWNETCMD_H
4 #define GCP_CONTROL_NEWNETCMD_H
5 
15 #include "gcp/util/common/NetStruct.h"
16 #include "gcp/util/common/NetUnion.h"
17 
18 #include "genericregs.h"
19 
20 namespace gcp {
21  namespace control {
22 
23  // Define an allocator for an experiment-specific network command
24  // This must be defined by inheritors
25 
26  class NewNetCmd;
27  NewNetCmd* newSpecificNewNetCmd();
28 
29  /*
30  * The first command sent to the controller after startup must be
31  * the following. Note that this command can not be sent at any
32  * other time. When a connection is first initiated to the
33  * translator layer, the scheduler automatically runs its
34  * initialization script. On start-up, the controller will send
35  * this message with start=true, and after the scheduler has
36  * completely sent the initialization script, it will queue this
37  * command to be sent with start=false.
38  */
40  public:
41  bool start;
42 
43  NewNetInitCmd() {
44  NETSTRUCT_BOOL(start);
45  }
46 
47  };
48 
49  //------------------------------------------------------------
50  // Define the contents of the shutdown command.
51  //------------------------------------------------------------
52 
54  public:
55 
56  // Enumerate control-system shutdown options.
57 
58  enum RtcShutdownMethod {
59  HARD_RESTART, // Restart the control system via a reboot
60  SOFT_RESTART, // Re-initialize the running control-system
61  HARD_SHUTDOWN, // Reboot the CPU and wait at the boot prompt
62  SOFT_SHUTDOWN // Terminate the control system but don't reboot
63  };
64 
65  unsigned int method; // A RtcShutdownMethod enumeration identifier
66 
68  NETSTRUCT_UINT(method);
69  }
70 
71  };
72 
73  //------------------------------------------------------------
74  // The feature command conveys a bit-mask to be added or removed
75  // from the set of feature bits to be recorded with one or more
76  // subsequent archive frames. Once a feature bit has been added to
77  // the transient or persistent set of feature bits, it is
78  // guaranteed to be recorded in at least one frame. For transient
79  // markers the feature bits are recorded in the next frame only,
80  // whereas persistent feature markers will continue to appear in
81  // subsequent frames until they are cancelled.
82  //------------------------------------------------------------
83 
85  public:
86 
87  enum FeatureMode {
88  FEATURE_ADD, // Add the new set of feature bits to those
89  // that are to be recorded in subsequent
90  // frames.
91  FEATURE_REMOVE, // Remove the specified set of features from
92  // those that have previously been registered
93  // with FEATURE_ADD
94  FEATURE_ONE // Add the new set of feature bits to the
95  // transient set which is to be recorded just
96  // in the next frame.
97  };
98 
99  unsigned int seq; // The mark-command sequence number of this message
100  unsigned int mode; // What to do with the bit mask
101  unsigned long mask; // The bit-mask to merge with any existing bit mask.
102 
103  NewNetFeatureCmd() {
104  NETSTRUCT_UINT(seq);
105  NETSTRUCT_UINT(mode);
106  NETSTRUCT_ULONG(mask);
107  }
108 
109  };
110 
111  //------------------------------------------------------------
112  // Set the location of an antenna
113  //------------------------------------------------------------
114 
116  public:
117 
118  double north; // The north offset of an antenna
119  double east; // The east offset of an antenna
120  double up; // The up offset of an antenna
121 
123  NETSTRUCT_DOUBLE(north); // The north offset of an antenna
124  NETSTRUCT_DOUBLE(east); // The east offset of an antenna
125  NETSTRUCT_DOUBLE(up); // The up offset of an antenna
126  }
127 
128  };
129 
130 
131  //------------------------------------------------------------
132  // Set the site of this experiment
133  //------------------------------------------------------------
134 
136  public:
137 
138  long lon; // The longitude (east +ve) [-pi..pi]
139  // (milli-arcsec)
140  long lat; // The latitude [-pi/2..pi/2]
141  // (milli-arcsec)
142  long alt; // The altitude (mm)
143 
144  NewNetSiteCmd() {
145  NETSTRUCT_LONG(lon);
146  NETSTRUCT_LONG(lat);
147  NETSTRUCT_LONG(alt);
148  }
149 
150  };
151 
152 
153  //------------------------------------------------------------
154  // The getreg command reads the value of a specified register out
155  // of the register map
156  //------------------------------------------------------------
157 
159  public:
160 
161  unsigned short board; // The host-board of the register
162  unsigned short block; // The block number of the register
163  unsigned short index; // The index of the first element to
164  // be set
165 
166  NewNetGetregCmd() {
167  NETSTRUCT_USHORT(board);
168  NETSTRUCT_USHORT(block);
169  NETSTRUCT_USHORT(index);
170  }
171 
172  };
173 
174  //------------------------------------------------------------
175  // The setreg command sets the value of a specified register to a
176  // given value.
177  //------------------------------------------------------------
178 
180  public:
181 
182  unsigned long value; // The value to write to the register
183  unsigned short board; // The host-board of the register
184  unsigned short block; // The block number of the register
185  unsigned short index; // The index of the first element to
186  // be set
187  unsigned short nreg; // The number of elements to be set
188  unsigned long seq; // The sequence number of this
189  // transaction
190 
191  NewNetSetregCmd() {
192  NETSTRUCT_ULONG(value);
193  NETSTRUCT_USHORT(board);
194  NETSTRUCT_USHORT(block);
195  NETSTRUCT_USHORT(index);
196  NETSTRUCT_USHORT(nreg);
197  NETSTRUCT_ULONG(seq);
198  }
199 
200  };
201 
202  //------------------------------------------------------------
203  // The following object is sent to halt the telescope.
204  //------------------------------------------------------------
205 
207  public:
208 
209  unsigned int seq; // The tracker sequence number of this command
210 
211  NewNetHaltCmd() {
212  NETSTRUCT_UINT(seq);
213  }
214 
215  };
216 
217  //------------------------------------------------------------
218  // The NetScanCmd is used to command the telescope to perform a scan.
219  // Sequential commands containing the same scan name will be combined
220  // to form a scrolling table of offsets of up to SCAN_NET_NPT points
221  // at a time.
222  //
223  // A non-zero sequence number will indicate the start of a new
224  // scan.
225  //------------------------------------------------------------
226 
228  public:
229 
230  static const unsigned SCAN_NET_NPT=10;
231 
232  // Members
233 
234  char name[SCAN_LEN]; // The name of the scan
235  unsigned int seq; // The sequence number of this command
236  unsigned int index[SCAN_NET_NPT];
237  unsigned int npt; // The number of points sent with this
238  // command
239  long azoff[SCAN_NET_NPT];
240  long eloff[SCAN_NET_NPT];
241  long dkoff[SCAN_NET_NPT];
242 
243  NewNetScanCmd() {
244  NETSTRUCT_CHAR_ARR(name, SCAN_LEN);
245  NETSTRUCT_UINT(seq);
246  NETSTRUCT_UINT_ARR(index, SCAN_NET_NPT);
247  NETSTRUCT_UINT(npt);
248  NETSTRUCT_LONG_ARR(azoff, SCAN_NET_NPT);
249  NETSTRUCT_LONG_ARR(eloff, SCAN_NET_NPT);
250  NETSTRUCT_LONG_ARR(dkoff, SCAN_NET_NPT);
251  }
252 
253  };
254 
255 
256  //------------------------------------------------------------
257  // The following object is used to request a telescope slew to a
258  // given mount position.
259  //------------------------------------------------------------
260 
262  public:
263 
264  enum DriveAxis {
265  DRIVE_AZ_AXIS=1, // Slew the azimuth axis
266  DRIVE_EL_AXIS=2, // Slew the elevation axis
267  DRIVE_DK_AXIS=4, // Slew the deck axis
268  DRIVE_ALL_AXES = DRIVE_AZ_AXIS | DRIVE_EL_AXIS | DRIVE_DK_AXIS
269  };
270 
271  char source[SRC_LEN]; // The name of the source
272  unsigned int number; // The catalog number of this source
273  unsigned int seq; // The sequence number of this command
274  unsigned int mask; // A bitwise union of DriveAxes enumerated
275  // bits used to specify which of the
276  // following axis positions are to be
277  // used.
278  long az; // The target azimuth (0..360 degrees in
279  // mas)
280  long el; // The target elevation (0..90 degrees in
281  // mas)
282  long dk; // The target deck angle (-180..180 in
283  // mas)
284  unsigned int type; // A gcp::util::Tracking::Type enumerator
285 
286 
287  NewNetSlewCmd() {
288  NETSTRUCT_CHAR_ARR(source, SRC_LEN);
289  NETSTRUCT_UINT(number);
290  NETSTRUCT_UINT(seq);
291  NETSTRUCT_UINT(mask);
292  NETSTRUCT_LONG(az);
293  NETSTRUCT_LONG(el);
294  NETSTRUCT_LONG(dk);
295  NETSTRUCT_UINT(type);
296  }
297  };
298  //------------------------------------------------------------
299  // The NetTrackCmd is used to command the telescope to track a source.
300  // Sequential commands containing the same source name will be
301  // combined to form a scrolling interpolation table of up to 3 points
302  // at a time.
303  //
304  // On source changes the control program is expected to send three
305  // ephemeris entries for the source, one preceding the current time
306  // and two following it. It is thereafter expected to send a new
307  // ephemeris entry whenever the current time passes that of the
308  // second point in the table. The new entry must be for a later time
309  // than the existing 3rd entry.
310  //
311  // On receipt of a track command with a new source name, the
312  // tracker task will immediately command a slew to the first
313  // position received. It is anticipated that by the time the slew
314  // ends, the control program will have had more than enough time
315  // to send two more entries. If only one more entry has been
316  // received, linear interpolation will be used. If no new entries
317  // have been received then the details of the single entry will be
318  // used without any interpolation.
319  //------------------------------------------------------------
320 
322  public:
323 
324  char source[SRC_LEN]; // The name of the source
325  unsigned int number; // The catalog number of the source
326  unsigned int srcType; // The source type
327  unsigned int seq; // The sequence number of this command
328  long mjd; // The Terrestrial Time at which ra,dec
329  // are valid, as a Modified Julian Day
330  // number
331  long tt; // The number of TT milliseconds into day
332  // 'mjd'
333  long ra; // The desired apparent Right Ascension
334  // (0..360 degrees in mas)
335  long dec; // The desired apparent Declination
336  // (-180..180 degrees in mas)
337  long dist; // The distance to the source if it is
338  // near enough for parallax to be
339  // significant. Specify the distance in
340  // micro-AU Send 0 for distant sources.
341  unsigned int type; // A gcp::util::Tracking::Type enumerator
342 
343  NewNetTrackCmd() {
344  NETSTRUCT_CHAR_ARR(source, SRC_LEN);
345  NETSTRUCT_UINT(number);
346  NETSTRUCT_UINT(srcType);
347  NETSTRUCT_UINT(seq);
348  NETSTRUCT_LONG(mjd);
349  NETSTRUCT_LONG(tt);
350  NETSTRUCT_LONG(ra);
351  NETSTRUCT_LONG(dec);
352  NETSTRUCT_LONG(dist);
353  NETSTRUCT_UINT(type);
354  }
355 
356  };
357 
358  //------------------------------------------------------------
359  // The following command establishes new horizon pointing offsets.
360  //------------------------------------------------------------
361 
362  // The following enumerators specify how new offsets are to
363  // effect existing offsets.
364 
365  enum OffsetMode {
366  OFFSET_ADD, // Add the new offsets to any existing offsets
367  OFFSET_SET // Replace the existing offsets with the new
368  // offsets
369  };
370 
372  public:
373 
374  unsigned int seq; // The tracker sequence number of this command
375  unsigned int axes; // The set of axes to offset, as a union of
376  // SkyAxis enumerators.
377  unsigned int mode; // The effect of the offsets on existing
378  // offsets, chosen from the above
379  // enumerators.
380  double az,el,dk; // The offsets for the azimuth, elevation
381  // and deck axes. Only those values that
382  // correspond to axes included in the
383  // 'axes' set will be used.
384 
386 
387  NETSTRUCT_UINT(seq);
388  NETSTRUCT_UINT(axes);
389  NETSTRUCT_UINT(mode);
390  NETSTRUCT_LONG(az);
391  NETSTRUCT_LONG(el);
392  NETSTRUCT_LONG(dk);
393  }
394 
395  };
396 
397  //------------------------------------------------------------
398  // The following command establishes new equatorial pointing
399  // offsets.
400  //------------------------------------------------------------
401 
403  public:
404 
405  enum EquatAxis { // The set of offsetable equatorial axes
406  EQUAT_RA_AXIS=1, // The Right-Ascension axis
407  EQUAT_DEC_AXIS=2 // The declination axis
408  };
409 
410  unsigned int seq; // The tracker sequence number of this command
411  unsigned int axes; // The set of equatorial axes to offset, as
412  // a union of EquatAxis enumerators
413  unsigned int mode; // The effect of the offsets on existing
414  // offsets, chosen from OffsetMode
415  // enumerators.
416  long ra,dec; // The offsets for the right-ascension and
417  // declination axes. Only those values that
418  // correspond to axes included in the 'axes' set
419  // will be used.
420 
422 
423  NETSTRUCT_UINT(seq);
424  NETSTRUCT_UINT(axes);
425  NETSTRUCT_UINT(mode);
426  NETSTRUCT_LONG(ra);
427  NETSTRUCT_LONG(dec);
428  }
429 
430  };
431 
432 
433  //------------------------------------------------------------
434  // The following command asks the tracker to add to the az and el
435  // tracking offsets such that the image on the tv monitor of the
436  // optical-pointing telescope moves by given amounts horizontally
437  // and vertically.
438  //------------------------------------------------------------
439 
441  public:
442 
443  unsigned int seq; // The tracker sequence number of this command
444  long up; // The amount to move the image up on the display
445  // (mas)
446  long right; // The amount to move the image right on the
447  // display (mas)
448 
450  NETSTRUCT_UINT(seq);
451  NETSTRUCT_LONG(up);
452  NETSTRUCT_LONG(right);
453  }
454 
455  };
456 
457 
458  //------------------------------------------------------------
459  // The following command sets the deck angle at which the vertical
460  // direction on the tv monitor of the optical telescope matches
461  // the direction of increasing topocentric elevation.
462  //------------------------------------------------------------
463 
465  public:
466 
467  long angle; // The deck angle at which the camera image is
468  // upright (mas)
469 
470  NewNetTvAngleCmd() {
471  NETSTRUCT_LONG(angle);
472  }
473 
474  };
475 
476  //------------------------------------------------------------
477  // The SkyOffset command tells the tracker to track a point at a
478  // given fixed sky offset from the normal pointing center,
479  // regardless of elevation or declination. This is used primarily
480  // for making beam maps.
481  //------------------------------------------------------------
482 
484  public:
485 
486  enum SkyXYAxes { // Set members for the NetSkyOffsetCmd
487  // axes member.
488  SKY_X_AXIS = 1, // The NetSkyOffsetCmd::x axis
489  SKY_Y_AXIS = 2, // The NetSkyOffsetCmd::y axis
490  };
491 
492  unsigned int seq; // The tracker sequence number of this command
493  unsigned int axes; // The set of axes to offset, as a union of
494  // SkyXYAxes enumerators.
495  unsigned int mode; // The effect of the new offsets on any
496  // existing offsets, chosen from OffsetMode
497  // enumerators.
498  long x,y; // The 2-dimensional angular offset, expressed as
499  // distances along two great circles that meet at
500  // right angles at the normal pointing center. The
501  // y offset is directed along the great circle
502  // that joins the normal pointing center to the
503  // zenith. The x offset increases along the
504  // perpendicular great circle to this, increasing
505  // from east to west. Both offsets are measured in
506 
508  NETSTRUCT_UINT(seq);
509  NETSTRUCT_UINT(axes);
510  NETSTRUCT_UINT(mode);
511  NETSTRUCT_LONG(x);
512  NETSTRUCT_LONG(y);
513  }
514 
515  };
516 
517  //------------------------------------------------------------
518  // The NetDeckModeCmd command tells the track task how to position
519  // the deck axis while tracking a source.
520  //------------------------------------------------------------
521 
523  public:
524 
525  unsigned int seq; // The tracker sequence number of this command
526  unsigned int mode; // A DeckMode enumerator from genericregs.h
527 
529  NETSTRUCT_UINT(seq);
530  NETSTRUCT_UINT(mode);
531  }
532 
533  };
534 
535  //------------------------------------------------------------
536  // The atmosphere command is used to supply atmospheric parameters
537  // for refraction computations in the weather-station task. It is
538  // not needed when the weather station is functioning.
539  //------------------------------------------------------------
540 
542  public:
543 
544  double temperature; // The outside temperature (mC)
545  double humidity; // The relative humidity (0-1)*1000
546  double pressure; // The atmospheric pressure
547  // (micro-bar)
548  NewNetAtmosCmd() {
549  NETSTRUCT_DOUBLE(temperature);
550  NETSTRUCT_DOUBLE(humidity);
551  NETSTRUCT_DOUBLE(pressure);
552  }
553 
554  };
555 
556  //------------------------------------------------------------
557  // The NetUt1UtcCmd and NetEqnEqxCmd commands are used to send occasional
558  // updates of variable earth orientation parameters.
559  //
560  // For each command the control system retains a table of the 3
561  // most recently received updates. These three values are
562  // quadratically interpolated to yield orientation parameters for
563  // the current time. On connection to the control system, the
564  // control program is expected to send values for the start of the
565  // current day, the start of the following day and the start of
566  // the day after that. Thereafter, at the start of each new day,
567  // it should send parameters for a time two days in the future.
568  //
569  // On startup of the control system, requests for ut1utc and eqex
570  // will return zero. On receipt of the first earth-orientation
571  // command, requests for orientation parameters will return the
572  // received values. On the receipt of the second, requesters will
573  // receive a linear interpolation of the parameters. On receipt of
574  // the third and subsequent commands, requesters will receive
575  // quadratically interpolated values using the parameters of the
576  // three most recently received commands.
577  //------------------------------------------------------------
578 
580  public:
581 
582  long mjd; // The UTC to which this command refers as a
583  // Julian Day number
584  long utc; // The number of UTC milliseconds into day
585  // 'mjd'
586  long ut1utc; // The value of ut1 - utc (us)
587 
588  NewNetUt1UtcCmd() {
589  NETSTRUCT_LONG(mjd);
590  NETSTRUCT_LONG(utc);
591  NETSTRUCT_LONG(ut1utc);
592  }
593 
594  };
595 
597  public:
598 
599  long mjd; // The Terrestrial Time to which this command
600  // refers, as a Modified Julian day number
601  long tt; // The number of TT milliseconds into day
602  // 'mjd'
603  long eqneqx; // The equation of the equinoxes (mas) */
604 
605  NewNetEqnEqxCmd() {
606  NETSTRUCT_LONG(mjd);
607  NETSTRUCT_LONG(tt);
608  NETSTRUCT_LONG(eqneqx);
609  }
610 
611  };
612 
613 
614  //------------------------------------------------------------
615  // The NetEncoderCalsCmd is used to calibrate the scales and
616  // directions of the telescope encoders.
617  //------------------------------------------------------------
618 
620  public:
621 
622  unsigned int seq; // The tracker sequence number of this
623  // command
624  long az; // Azimuth encoder counts per turn
625  long el; // Elevation encoder counts per turn
626  long dk; // Deck encoder counts per turn
627 
629  NETSTRUCT_UINT(seq);
630  NETSTRUCT_LONG(az);
631  NETSTRUCT_LONG(el);
632  NETSTRUCT_LONG(dk);
633  }
634 
635  };
636 
637  //------------------------------------------------------------
638  // The NetEncoderLimitsCmd command tells the tracker task what the
639  // limits on encoder values are.
640  //------------------------------------------------------------
641 
643  public:
644 
645  unsigned int seq; // The tracker sequence number of this command
646  long az_min; // The lower azimuth limit (encoder counts)
647  long az_max; // The upper azimuth limit (encoder counts)
648  long el_min; // The lower elevation limit (encoder counts)
649  long el_max; // The upper elevation limit (encoder counts)
650  long pa_min; // The lower pa limit (encoder counts)
651  long pa_max; // The upper pa limit (encoder counts)
652 
654  NETSTRUCT_UINT(seq);
655  NETSTRUCT_LONG(az_min);
656  NETSTRUCT_LONG(az_max);
657  NETSTRUCT_LONG(el_min);
658  NETSTRUCT_LONG(el_max);
659  NETSTRUCT_LONG(pa_min);
660  NETSTRUCT_LONG(pa_max);
661  }
662 
663  };
664 
665  //------------------------------------------------------------
666  // The NetEncoderZerosCmd is used to set the zero points of the
667  // telescope encoders. The angles are measured relative to the
668  // position at which the encoders show zero counts.
669  //------------------------------------------------------------
670 
672  public:
673 
674  unsigned int seq; // The tracker sequence number of this command
675  double az; // Azimuth encoder angle at zero azimuth, measured
676  // in the direction of increasing azimuth
677  // (radians).
678  double el; // Elevation encoder angle at zero elevation,
679  // measured in the direction of increasing
680  // elevation (radians).
681  double dk; // Deck encoder angle at the deck reference
682  // position, measured clockwise when looking
683  // towards the sky (radians).
684 
686  NETSTRUCT_UINT(seq);
687  NETSTRUCT_DOUBLE(az);
688  NETSTRUCT_DOUBLE(el);
689  NETSTRUCT_DOUBLE(dk);
690  }
691 
692  };
693 
694  //------------------------------------------------------------
695  // The NetSlewRateCmd is used to set the slew speeds of each of
696  // the telescope axes. The speed is specified as a percentage of
697  // the maximum speed available.
698  //------------------------------------------------------------
699 
701  public:
702 
703  unsigned int seq; // The tracker sequence number of this
704  // command
705  unsigned int mask; // A bitwise union of DriveAxes
706  // enumeratedbits, used to specify which of
707  // the following axis rates are to be
708  // applied.
709  long az; // Azimuth slew rate (0-100)
710  long el; // Elevation slew rate (0-100)
711  long dk; // Deck slew rate (0-100)
712 
714  NETSTRUCT_UINT(seq);
715  NETSTRUCT_UINT(mask);
716  NETSTRUCT_LONG(az);
717  NETSTRUCT_LONG(el);
718  NETSTRUCT_LONG(dk);
719  }
720 
721  };
722 
723  //------------------------------------------------------------
724  // The NetTiltsCmd is used to calibrate the axis tilts of the
725  // telescope.
726  //------------------------------------------------------------
727 
729  public:
730 
731  unsigned int seq; // The tracker sequence number of this command
732  long ha; // The hour-angle component of the azimuth-axis
733  // tilt (mas)
734  long lat; // The latitude component of the azimuth-axis
735  // tilt (mas)
736  long el; // The tilt of the elevation axis
737  // perpendicular to the azimuth ring, measured
738  // clockwise around the direction of the
739  // azimuth vector (mas)
740 
741  NewNetTiltsCmd() {
742  NETSTRUCT_UINT(seq);
743  NETSTRUCT_LONG(ha);
744  NETSTRUCT_LONG(lat);
745  NETSTRUCT_LONG(el);
746  }
747 
748  };
749 
750  //------------------------------------------------------------
751  // The NetFlexureCmd is used to calibrate the gravitational
752  // flexure of the telescope.
753  //------------------------------------------------------------
754 
756  public:
757 
758 
759  unsigned int seq; // The tracker sequence number of this command
760  unsigned int mode; // An sza::util::PointingMode enumeration
761  long sFlexure; // Gravitational flexure (milli-arcsec per sine
762  // elevation)
763  long cFlexure; // Gravitational flexure (milli-arcsec per
764  // cosine elevation)
765 
766  NewNetFlexureCmd() {
767 
768  NETSTRUCT_UINT(seq);
769  NETSTRUCT_UINT(mode);
770  NETSTRUCT_LONG(sFlexure);
771  NETSTRUCT_LONG(cFlexure);
772  }
773 
774  };
775 
776  //------------------------------------------------------------
777  // The NetCollimateCmd command is used to calibrate the
778  // collimation of the optical or radio axes.
779  //------------------------------------------------------------
780 
782  public:
783 
784 
785  unsigned int seq; // The tracker sequence number of this command
786  unsigned int mode; // An sza::util::PointingMode enumeration
787  long x; // The magnitude of the azimuthal offset (mas)
788  long y; // The magnitude of the elevation offset
789  // (mas)
790  unsigned int addMode; // The effect of the new offsets on any
791  // existing offsets, chosen from
792  // OffsetMode enumerators.
793 
795 
796  NETSTRUCT_UINT(seq);
797  NETSTRUCT_UINT(mode);
798  NETSTRUCT_LONG(x);
799  NETSTRUCT_LONG(y);
800  NETSTRUCT_UINT(addMode);
801  }
802 
803  };
804 
805  //------------------------------------------------------------
806  // The NetModelCmd command selects between the optical and radio
807  // pointing models.
808  //------------------------------------------------------------
809 
811  public:
812 
813  unsigned int seq; // The tracker sequence number of this command
814  unsigned int mode; // A PointingMode enumeration
815 
816  NewNetModelCmd() {
817  NETSTRUCT_UINT(seq);
818  NETSTRUCT_UINT(mode);
819  }
820 
821  };
822 
823  //------------------------------------------------------------
824  // The NetYearCmd command tells the control system what the
825  // current year is. This is necessary because the gps time-code
826  // reader doesn't supply year information.
827  //------------------------------------------------------------
828 
830  public:
831 
832 
833  short year; // The current Gregorian year
834 
835  NewNetYearCmd() {
836  NETSTRUCT_SHORT(year);
837  }
838 
839  };
840 
841 
842  //------------------------------------------------------------
843  // Gpib commands
844  //------------------------------------------------------------
845 
846  // Specify the maximum size of a GPIB data message. Note that
847  // this effects both the size of network communications buffers
848  // and the size of some message queue nodes, so it shouldn't be
849  // made too large.
850 
851  enum {GPIB_MAX_DATA=80};
852 
853  // The gpib-send command tells the GPIB control task to try to
854  // send the specified message to a given GPIB device.
855 
857  public:
858 
859 
860  unsigned short device; // The generic address of the
861  // target GPIB device (0..30).
862  char message[GPIB_MAX_DATA+1]; // The message to be sent.
863 
865  NETSTRUCT_USHORT(device);
866  NETSTRUCT_CHAR_ARR(message, GPIB_MAX_DATA+1);
867  }
868 
869  };
870 
871  // The gpib-read command tells the GPIB control task to try to
872  // read a message from a given GPIB device.
873 
875  public:
876 
877 
878  unsigned short device; // The generic address of the
879  // source GPIB device (0..30).
880 
882  NETSTRUCT_USHORT(device);
883  }
884 
885  };
886 
887  //------------------------------------------------------------
888  // Turns power on/off to one or more antenna breakers
889  //------------------------------------------------------------
890 
892  public:
893 
894 
895  unsigned int breaker;
896  bool power;
897 
898  NewNetPowerCmd() {
899  NETSTRUCT_UINT(breaker);
900  NETSTRUCT_BOOL(power);
901  }
902 
903  };
904 
905  //------------------------------------------------------------
906  // The pager command controls the 'pager'
907  //------------------------------------------------------------
908 
910  public:
911 
912  // Enumerate the supported pager states.
913 
914  enum PagerState {
915  PAGER_ON, // Turn the pager on
916  PAGER_OFF, // Turn the pager off
917  PAGER_IP, // For internet devices, set an IP address
918  PAGER_EMAIL, // For email pagers, set an email address
919  PAGER_ENABLE, // Enable paging
920  PAGER_DISABLE // Disable paging
921  };
922 
923  unsigned int state; // A PagerState enumerator
924 
925  NewNetPagerCmd() {
926  NETSTRUCT_UINT(state);
927  }
928 
929  };
930 
931  //------------------------------------------------------------
932  // The NetOptCamCntlCmd controls the optical camera
933  //------------------------------------------------------------r.
934 
936  public:
937 
938 
939  unsigned int target; // Which device to control
940  bool on; // Turn device on/off?
941 
943  NETSTRUCT_UINT(target);
944  NETSTRUCT_BOOL(on);
945  }
946 
947  };
948 
949  //------------------------------------------------------------
950  // The NetConfigureFrameGrabberCmd configures the frame grabber.
951  //------------------------------------------------------------
952 
954  public:
955  unsigned int mask; // The mask of parameters to configurec
956  unsigned int channel; // The channel number to selec
957  unsigned int nCombine; // The number of frames to combine
958  bool flatfield; // If true, flatfield the image
959 
961  NETSTRUCT_UINT(mask); // The mask of parameters to configurec
962  NETSTRUCT_UINT(channel); // The channel number to selec
963  NETSTRUCT_UINT(nCombine); // The number of frames to combine
964  NETSTRUCT_BOOL(flatfield); // If true, flatfield the image
965  }
966  };
967 
968  //------------------------------------------------------------
969  // The NetFlatFieldCmd toggles frame grabber flat fielding
970  //------------------------------------------------------------
971 
973  public:
974 
975 
976  bool on; // If true, flat field frame grabber images
977 
979  NETSTRUCT_BOOL(on);
980  }
981 
982  };
983 
984  //============================================================
985  // A class for collecting together various commands that will be
986  // sent across the network
987  //============================================================
988 
990  public:
991 
992  // Enumerate structs that are part of this message
993 
994  enum {
995  NET_INIT_CMD, // Mandatory controller initialization command
996  NET_SHUTDOWN_CMD, // A request to shutdown the control system
997  NET_STROBE_CMD, // A request to take a register snapshot
998  NET_FEATURE_CMD, // Change the set of feature markers to be
999  // recorded in one or more subsequent
1000  // archive frames.
1001 
1002  // Set up commands
1003 
1004  NET_LOCATION_CMD, // Specify the location of an antenna
1005  NET_SITE_CMD, // Specify the location of the experiment
1006 
1007  // Get/Set the value of a register
1008 
1009  NET_GETREG_CMD, // Change the value of a given register
1010  NET_SETREG_CMD, // Change the value of a given register
1011 
1012  // Tracking commands
1013 
1014  NET_HALT_CMD, // Halt the telescope drives
1015  NET_STOP_CMD, // put the telescope in STOP mode
1016  NET_SCAN_CMD, // Scan the telescope
1017  NET_SLEW_CMD, // Slew to a given az,el,dk
1018  NET_TRACK_CMD, // Append to the track of the current source
1019  NET_MOUNT_OFFSET_CMD,// Adjust the az,el,dk tracking offsets
1020  NET_EQUAT_OFFSET_CMD,// Adjust the equatorial ra and dec tracking offsets
1021  NET_TV_OFFSET_CMD, // Adjust the tracking offsets to move a
1022  // star by a on the tv monitor of the
1023  // optical telescope.
1024  NET_TV_ANGLE_CMD, // The deck angle at which the vertical
1025  // direction on the tv monitor of the
1026  // optical telescope matches the
1027  // direction of increasing topocentric
1028  // elevation.
1029  NET_SKY_OFFSET_CMD, // Tell the tracker to continually adjust
1030  // the tracking offsets to maintain the
1031  // telescope pointed at a given fixed sky
1032  // offset from the normal pointing
1033  // center.
1034  NET_DECK_MODE_CMD, // Tell the tracker how to position the
1035  // deck axis while tracking sources.
1036 
1037  // Tracking related
1038 
1039  NET_ATMOS_CMD, // Manually supply atmospheric conditions
1040  // to weather task
1041  NET_UT1UTC_CMD, // Append to the UT1-UTC interpolation table
1042  NET_EQNEQX_CMD, // Append to the
1043  // equation-of-the-equinoxes
1044  // interpolation table
1045 
1046  // Pointing commands
1047 
1048  NET_ENCODER_CALS_CMD, // Tell the tracker task the current
1049  // encoder scales
1050  NET_ENCODER_LIMITS_CMD,// Tell the tracker task the current
1051  // encoder limits
1052  NET_ENCODER_ZEROS_CMD, // Set the zero points of the telescope
1053  // encoders
1054  NET_SLEW_RATE_CMD, // Set the slew rate of each telescope axis
1055  NET_TILTS_CMD, // Calibrate the axis tilts of the telescope
1056  NET_FLEXURE_CMD, // Calibrate the axis flexure of the telescope
1057  NET_COLLIMATE_CMD, // Calibrate the collimation of the telescope
1058  NET_MODEL_CMD, // Select the optical or radio pointing model
1059  NET_YEAR_CMD, // Tell the control system what the current year is
1060 
1061  // Random hardware commands
1062 
1063  NET_GPIB_SEND_CMD, // Send a message to a given GPIB device
1064  NET_GPIB_READ_CMD, // Read a message from a given GPIB device
1065  NET_POWER_CMD, // Turn the power on/off to an antennas power strip
1066  NET_PAGER_CMD, // Turn the pager on or off
1067 
1068  // Optical camera/frame grabber commands
1069 
1070  NET_OPTCAM_CNTL_CMD, // Control the optical camera
1071  NET_CONFIGURE_FG_CMD,// Configure the frame grabber
1072  NET_FLATFIELD_CMD, // Toggle flat fielding of frame grabber frames
1073  };
1074 
1075  // Control commands
1076 
1077  NewNetInitCmd init; // Mandatory controller
1078  // initialization command
1079  NewNetShutdownCmd shutdown; // A request to shutdown the control system
1080  NewNetFeatureCmd feature; // Change the set of feature
1081  // markers to be recorded in one or
1082  // more archive frames.
1083 
1084  // Set-up commands
1085 
1086  NewNetLocationCmd location; // Specify the location of an antenna
1087  NewNetSiteCmd site; // Specify the location of the experiment
1088 
1089  // Get/Set the value of a register
1090 
1091  NewNetGetregCmd getreg; // Change the value of a given register
1092  NewNetSetregCmd setreg; // Change the value of a given register
1093 
1094  // Tracking commands
1095 
1096  NewNetHaltCmd halt; // Halt the telescope drives
1097  NewNetScanCmd scan; // Scan the telescope
1098  NewNetSlewCmd slew; // Slew to a given az,el,dk
1099  NewNetTrackCmd track; // Append to the track of the current source
1100  NewNetMountOffsetCmd mount_offset;// Adjust the az,el,dk tracking offsets
1101  NewNetEquatOffsetCmd equat_offset;// Adjust the equatorial ra
1102  // and dec tracking offsets
1103  NewNetTvOffsetCmd tv_offset; // Adjust the tracking offsets to
1104  // move a star by a on the tv
1105  // monitor of the optical
1106  // telescope.
1107  NewNetTvAngleCmd tv_angle; // The deck angle at which the
1108  // vertical direction on the tv
1109  // monitor of the optical
1110  // telescope matches the direction
1111  // of increasing topocentric
1112  // elevation.
1113  NewNetSkyOffsetCmd sky_offset; // Tell the tracker to
1114  // continually adjust the
1115  // tracking offsets to maintain
1116  // the telescope pointed at a
1117  // given fixed sky offset from
1118  // the normal pointing center.
1119  NewNetDeckModeCmd deck_mode; // Tell the tracker how to
1120  // position the deck axis while
1121  // tracking sources.
1122 
1123  // Tracking related
1124 
1125  NewNetAtmosCmd atmos; // Manually supply atmospheric
1126  // conditions to weather task
1127  NewNetUt1UtcCmd ut1utc; // Append to the UT1-UTC
1128  // interpolation table
1129  NewNetEqnEqxCmd eqneqx; // Append to the
1130  // equation-of-the-equinoxes
1131  // interpolation table
1132 
1133  // Pointing commands
1134 
1135  NewNetEncoderCalsCmd encoder_cals; // Tell the tracker task the
1136  // encoder scales
1137  NewNetEncoderLimitsCmd encoder_limits;// Tell the tracker task
1138  // the current encoder
1139  // limits
1140  NewNetEncoderZerosCmd encoder_zeros; // Set the zero points of
1141  // the telescope encoders
1142  NewNetSlewRateCmd slew_rate; // Set the slew rate of each telescope axis
1143  NewNetTiltsCmd tilts; // Calibrate the axis tilts of the
1144  // telescope
1145  NewNetFlexureCmd flexure; // Calibrate the axis flexure of
1146  // the telescope
1147  NewNetCollimateCmd collimate; // Calibrate the collimation of
1148  // the telescope
1149  NewNetModelCmd model; // Select the optical or radio
1150  // pointing model
1151  NewNetYearCmd year; // Tell the control system what
1152  // the current year is
1153 
1154  // Random hardware commands
1155 
1156  NewNetGpibSendCmd gpib_send; // Send a message to a given GPIB device
1157  NewNetGpibReadCmd gpib_read; // Read a message from a given GPIB device
1158  NewNetPowerCmd power; // Turn the power on/off to an
1159  // antennas power strip
1160  NewNetPagerCmd pager; // Turn the pager on or off
1161 
1162  // Optical camera/frame grabber commands
1163 
1164  NewNetOptCamCntlCmd optcam_cntl;// Control the optical camera
1165  NewNetConfigureFrameGrabberCmd configureFrameGrabber; // Configure
1166  // the
1167  // frame
1168  // grabber
1172  NewNetCmd();
1173 
1177  virtual ~NewNetCmd();
1178 
1179 
1180  }; // End class NewNetCmd
1181 
1182  } // End namespace control
1183 } // End namespace gcp
1184 
1185 
1186 
1187 #endif // End #ifndef GCP_CONTROL_NEWNETCMD_H
Definition: NewNetCmd.h:781
Definition: NewNetCmd.h:856
Definition: NewNetCmd.h:464
Definition: NewNetCmd.h:728
Definition: NewNetCmd.h:541
Definition: NewNetCmd.h:700
Definition: NewNetCmd.h:483
Definition: NewNetCmd.h:989
Definition: NetStruct.h:21
Definition: NewNetCmd.h:909
Definition: NewNetCmd.h:440
Definition: NewNetCmd.h:829
NewNetCmd()
Definition: NewNetCmd.c:10
Definition: NewNetCmd.h:135
Definition: NewNetCmd.h:522
Definition: NewNetCmd.h:619
Definition: NewNetCmd.h:891
Definition: NewNetCmd.h:671
Definition: NewNetCmd.h:596
virtual ~NewNetCmd()
Definition: NewNetCmd.c:54
Definition: NewNetCmd.h:39
Definition: NewNetCmd.h:371
Definition: NewNetCmd.h:227
Definition: NewNetCmd.h:179
Definition: NewNetCmd.h:261
Definition: NewNetCmd.h:402
Definition: NewNetCmd.h:53
Definition: NewNetCmd.h:158
Definition: NewNetCmd.h:84
Definition: NewNetCmd.h:755
Definition: NewNetCmd.h:579
Definition: NewNetCmd.h:972
Definition: NewNetCmd.h:206
Definition: NewNetCmd.h:935
Definition: NewNetCmd.h:810
Definition: NewNetCmd.h:642
Definition: NetUnion.h:23
Definition: NewNetCmd.h:874
Definition: NewNetCmd.h:321
Definition: NewNetCmd.h:115