/* **********************************************************************
 * *                                                                    *
 * *   Parameters and Structures for the RCP8 Radar Control Processor   *
 * *                                                                    *
 * **********************************************************************
 * File: include/rcp8
 *
 *                    COPYRIGHT (c) 2002, 2004  BY
 *          SIGMET INCORPORATED, WESTFORD MASSACHUSETTS, U.S.A.
 * 
 * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
 * ONLY  IN  ACCORDANCE WITH  THE  TERMS  OF  SUCH  LICENSE  AND WITH THE
 * INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE  OR  ANY OTHER
 * COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
 * OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
 * TRANSFERED.
 */
#ifndef SIGMET_RCP8_H
#define SIGMET_RCP8_H 1


#define RCP8_UNIQUE( VERSION, MINOREV ) ( ((MINOREV) << 8) | (VERSION) )
#define RCP8_UNIQUE_VERSION( UNIQUE ) (  (UNIQUE)        & 0x00FF )
#define RCP8_UNIQUE_MINOREV( UNIQUE ) ( ((UNIQUE) >>  8) & 0x00FF )

/* RCP8 version numbers follow overall RDA numbering scheme
 */
#define RCP8_VERSION RDA_VERSION
#define RCP8_MINOREV RDA_MINOREV
#define RCP8_BUILD   RDA_BUILD

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 * Tunable parameters
 */
#define NEQUATIONS      80	/* Max number of Boolean equations */

/* Each of the following parameters allocates Logic Equation resources
 * in multiples of eight.
 */
#define NLOC_BYTES       4	/* # of local variable bytes */
#define NTIM_BYTES       2	/* # of timer variable bytes */

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 * Shutdown error codes
 */
#define SHDN_POWERUP   0x00000001 /* Diagnostics Failed   */
#define SHDN_AZTPCHK   0x00000002 /* AZ Tach Inconsistent */
#define SHDN_ELTPCHK   0x00000004 /* EL Tach Inconsistent */
#define SHDN_AZUNRES   0x00000008 /* AZ Axis Unresponsive */
#define SHDN_ELUNRES   0x00000010 /* EL Axis Unresponsive */
#define SHDN_AZFAST    0x00000020 /* AZ Velocity Exceeded */
#define SHDN_ELFAST    0x00000040 /* EL Velocity Exceeded */
#define SHDN_AZPOSLO   0x00000080 /* AZ-LO Shutdown Limit */
#define SHDN_AZPOSHI   0x00000100 /* AZ-HI Shutdown Limit */
#define SHDN_ELPOSLO   0x00000200 /* EL-LO Shutdown Limit */
#define SHDN_ELPOSHI   0x00000400 /* EL-UP Shutdown Limit */
#define SHDN_LIMSWLO   0x00000800 /* EL Lower Lim Switch  */
#define SHDN_LIMSWHI   0x00001000 /* EL Upper Lim Switch  */
#define SHDN_AZSYN     0x00002000 /* AZ synchro problem   */
#define SHDN_ELSYN     0x00004000 /* EL synchro problem   */
#define SHDN_USER1     0x40000000 /* User-Shutdown #1     */
#define SHDN_USER2     0x80000000 /* User-Shutdown #2     */

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 * Sector blanking definitions
 */
#define NSBLNKS 8
struct rcp8_sblnkdef {		/* Setup definitions */
  UINT1 linuse ;		/*   Include this sector in overall test */
  UINT1 lped_angle ;		/*   Use pedestal angle (else earth angle) */
  char  pad2x2[2] ;
  FLT4  felx, fely ;		/*   Elevation boundaries (degrees) */
  FLT4  fazx, fazy ;		/*   Azimuth boundaries (degrees) */
} ;

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 * AZ and EL setup parameters.  This structure contains the setup values
 * in meaningful scientific units.
 */
struct rcp8_aesetup {
  FLT4  fantsim_accel ;		/* Max simulated acceleration (deg/sec/sec) */
  UINT1 lantsim ;		/* Simulate this axis */

  UINT1 inbits ;		/* Number of bits used for input */
  UINT1 lbcd_input ;		/* Angle input is BCD (else binang) */
  UINT1 iang_source ;		/* Where input angles come from */
#define ANG_SOURCE_PARALLEL 0	/*   Parallel 'TAG' inputs */
#define ANG_SOURCE_SYNCHRO  1	/*   Synchro-To-Digital conversion */
#define ANG_SOURCE_SHAFTENC 2	/*   A/B/Index shaft encoder */
#define ANG_SOURCE_CUSTOM   3	/*   Internal custom thread */
#define ANG_SOURCE_MAX      3

  SINT4 iShaftTicksPerIndex ;	/* Number of A/B ticks per Index pulse */
  SINT2 iShaftIndxsPerRevol ;	/* Number of Index pulses per revolution */
  UINT1 lShaftReverseDir ;	/* Reverse A/B counting direction */
  UINT1 lShaftSecIO62 ;		/* Use secondary I/O-62 card */
  SINT2 iShaftProxAngle ;	/* Real binang of the proximity sensor */

  SINT2 iSynchroFreqHZ ;	/* Synchro reference frequency (Hertz) */
  UINT1 lSynchroShdnCheck ;	/* Shutdown on synchro errors */

  UINT1 ltcal_shdn_check ;	/* Enable tach calibration shutdowns */
  UINT1 luant_shdn_check ;	/* Enable unresponsive ant shutdowns */

  char pad23x5[5] ;
  FLT4 fangle_offset ;		/* Angle offset from true (degrees) */
  FLT4 fangle_mpypre ;		/* Optional multiplier and offset that */
  FLT4 fangle_offpre ;		/*   can be applied to raw angles. */

  FLT4 fMaxDriveVoltage ;	/* Maximum drive voltage magnitude */

  FLT4 fmotor_psustain ;	/* Motor sustain drives in positive and */
  FLT4 fmotor_nsustain ;	/*  negative directions (D-Units) */

  FLT4 fdrive_pslope ;		/* Nominal drive slopes in positive and */
  FLT4 fdrive_nslope ;		/*  negative directions (D/T-Units) */

  FLT4 fmom_inertia ;		/* Moment of inertia (D / dT/dt) */

  FLT4  fintverr_time ;		/* Integral term: Characteristic time */
  FLT4  fintverr_maxd ;		/* Integral term: Maximum additive drive */
  UINT1 lintverr_inuse ;	/* Integral term: Term is being applied */

  char pad73x1[1] ;
  UINT1 iaccelim_zreach ;	/*   Percentage "reach" toward zero drive */
  UINT1 laccelim_on ;		/*   Limiter On/Off */
  FLT4  faccelim_degss ;	/*   Bound in deg/sec/sec. */

  FLT4 fvel_max ;		/* Maximum servo velocity (T-Units) */
  FLT4 fvel_deadzone ;		/* Velocity feedback deadzone (T-Units) */
  FLT4 fvel_slope ;		/* Velocity feedback slope (D/dT-Units) */

  FLT4 fvel_shdn_margin ;	/* Permissible excess velocity (T-Units) */
  FLT4 fvel_shdn_time ;		/* Maximum time of being in excess (sec) */

  FLT4 ftcal_shdn_pcnt ;	/* Tach-check error percent */
  FLT4 ftcal_shdn_efix ;	/* Tach-check fixed error (deg/sec) */

  FLT4 fuant_shdn_terr ;	/* Unres-ant-check permissible tach error */
  FLT4 fuant_shdn_time ;	/* Maximum time of being in excess (sec) */

  FLT4  fTachFiltSecs ;		/* Tach zero-delay-filter window (sec) */
  SINT4 iTachFiltOrder ;	/* Model order for the smoother */

  FLT4 fdrive_slewtime ;	/* Drive slew rate limit Zero-->Max (sec)*/

  FLT4 fpservo_hyst[2] ;	/* Position servo hysteresis (degrees) */
  FLT4 fpservo_pos[2] ;		/* Position servo break angles (degrees) */
  FLT4 fpservo_slope[3] ;	/* Position servo slopes (T-Units / deg) */

  FLT4 fsoftlimits[2] ;		/* Lower and upper soft limits (degrees) */
  FLT4 fshutlimits[2] ;		/* Lower and upper shutdown limits (degrees) */

  UINT1 lsoftlimits_on ;	/* Enforce soft position limits */
  UINT1 lshutlimits_on ;	/* Enforce shutdown position limits */

  UINT1 ltach_positive ;	/* Tachometer sign is okay */
  UINT1 ldrive_positive ;	/* Drive sign is okay */

  FLT4 ftach_cal_level ;	/* Calibration tach level (T-Units) */
  FLT4 ftach_cal_speed ;	/* Calibration velocity (deg/sec) */

  UINT1 lusetach ;		/* Use tachometer for velocities */

  char pad185x3[3] ;
  FLT4 fvtach_fullspeed ;	/* Virtual tach top speed (deg/sec) */
  FLT4 fvtach_time ;		/* Virtual tach differentiation time (sec) */
  FLT4 fvtach_mintravel ;	/* Virtual tach minimum travel in window */
  FLT4 lvtach_model ;		/* Extrapolate tach using antenna model */

  FLT4 ftach_offset ;		/* Tachometer offset value (T-Units) */
  FLT4 fdrive_offset ;		/* Drive offset value (D-Units) */
  SINT1 iDriveUnsigned ;	/* Drive is signed (0), or always NEG/POS (-1/1) */

  char pad213x2[2] ;
  UINT1 lUseBalanceComp ;	/* Apply compensation for unbalanced antenna */
  FLT4 fBalanceCompAngle ;	/*   Neutral angle at which antenna comes to rest */
  FLT4 fBalanceCompDrive ;	/*   Drive required to hold 90Deg offset from neutral */  

  char pad224x3[3] ;
  UINT1 lUseStepper ;		/* This axis is driven by an up/dn stepper motor */
  FLT4 fStepperTicksPerDeg ;	/*   Stepper motor #-ticks per degree of rotation */
} ;

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 * Structure defining one of three axes of the Inertial Navigation Unit.
 */
struct rcp8_inusetup {
  UINT1 lnegate ;		/* Negate sign of this axis */
  char  pad1x3[3] ;
  FLT4  fangle_offset ;		/* Angle offset from true (degrees) */
  FLT4  fsim_amplitude ;	/* Simulated motion amplitude (degrees) */
  FLT4  fsim_center ;		/* Simulated motion center (degrees) */
  FLT4  fsim_period ;		/* Simulated motion period (seconds) */
} ;

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 * Boolean Control Constraints
 */
#define BOOLCOMLEN  80		/* Maximum length of comment text */
#define BOOLEQNLEN 120		/* Maximum length of equation text */

struct rcp8_boolean_save {	/* Saved equation definition */
  char  comment[BOOLCOMLEN] ;	/*   Null terminated comment string */
  char equation[BOOLEQNLEN] ;	/*   Null terminated equation string */
} ;

struct rcp8_adcvar {		/* Analog Boolean test variable definition */
  UINT1 linuse ;		/*   This slot is inuse */

  UINT1 iSumChans[4] ;		/*   Channels being summed */
#define ADCHAN_NUM     10	/*     Selected from this many measured inputs */
#define ADCVAR_NOCHAN		/*     Special code for an unused channel */ \
  ( 2 * ADCHAN_NUM )

#define ADCVAR_NAMELEN  8
  char name[ADCVAR_NAMELEN+1] ; /*   User-supplied name for this variable */
  char pad14x2[2] ;
  FLT4 fCmpVolts ;		/*   Comparison value in Volts */
} ;

struct rcp8_antvar {		/* Antenna Boolean test variable definition */
  UINT1 lInuse ;		/*   This slot is inuse */
  UINT1 lDesired ;		/*   Test desired value (else measured) */
  UINT1 lPedestal ;		/*   Test pedestal units (else Earth units) */
  UINT1 lVelocity ;		/*   Test velocity (else position) */
  UINT1 lAzimuth ;		/*   Test azimuth axis (else elevation axis) */
  UINT1 lCompareGT ;		/*   Use greater-than comparison (else less-than) */
  char pad6x4[4] ;
  SINT2 iTestValue ;		/*   Value to be compared against */
} ;

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 * Structure defining the strategy to be used when making requests for
 * IRIS mode changes in a Dual RCP system.
 */
struct rcp8_drcpIrisModeStrategy {
  UINT1 iStrategy ;		/* Mode switching strategy to use */
  UINT1 lAllowAutoSwitch ;	/* Allow IRIS to switch after setting it */
  UINT1 iDefaultMode ;		/* Default mode for fixed, or if illegal */
  UINT1 lValidModes[7] ;	/* Valid flags for modes 1-7 */
  char  pad10x2[2] ;
} ;
				/* Mode switching strategies */
#define MODESTGY_NONE       0	/*   Do not make any mode change requests */
#define MODESTGY_FIXED      1	/*   Request a fixed mode selection */
#define MODESTGY_INHERIT    2	/*   Inherit mode from other unit */
#define MODESTGY_RESUME     3	/*   Resume last mode from this unit */

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 * Non-Volatile-RAM structure
 */
struct rcp8_nv {
  /* Version Information
   */
  char sVersion[8] ;		/* IRIS version when saved */

  UINT1 version ;		/* Code version that did the last save */
  UINT1 minorev ;		/* Minor revision of that code */

  /* Physical PCI board (unit number) assignments.  Negative value
   * denotes that that card, along with all cards following it, are
   * not to be used.
   */
#define RCP8MAXIO 2		/* Maximum number of I/O-62 cards per RCP8 */
#if defined(IO62MAXUNITS) && (RCP8MAXIO > IO62MAXUNITS)
#error Inconsistent definition of RCP8MAXIO
#endif
  SINT2 iIo62Cards[RCP8MAXIO] ;	/* List of I/O-62 card unit numbers */
  UINT1 lIo62LineDiags ;	/* Run external line diagnostics */

  UINT1 lPCIResetOnShutdown ;	/* Reset all PCI cards upon shutdown */

  UINT1 lRpcIrisServer ;	/* Provide IRIS RPC network status server */

  /* Overall axis setup for AZ and EL
   */
  char pad17x3[3] ;
  struct rcp8_aesetup azsetup ;	/* Azimuth axis parameters */
  struct rcp8_aesetup elsetup ;	/* Elevation axis parameters */

  /* Inertial Navigation Unit (INU) variables.
   */
  UINT4 inu_deadtime ;		/* Dead INU detection time (ms) */
  UINT1 lstabilized ;		/* Perform all moving platform ops */

  UINT1 lInuSimulate ;		/* Run INU simulation code */

  UINT1 linu_inv_ignore ;	/* Ignore invalid bits from INU */
  UINT1 linu_crcignore ;	/* Ignore CRC errors on reception */

  FLT4  fInuMaxPedEL ;		/* Maximum pedestel EL during INU modes */

  char  inu_device[80] ;	/* Device name of INU serial port */
  SINT4 inu_baudrate ;		/* Baud rate for the INU serial data */
  char  sInuSimDevice[80] ;	/* Device name of INU simulator port */
  SINT4 iInuSimBaudRate ;	/* Baud rate for the INU simulator */

  struct rcp8_inusetup rollsetup ;  /* Roll axis parameters */
  struct rcp8_inusetup pitchsetup ; /* Pitch axis parameters */
  struct rcp8_inusetup headsetup ;  /* Heading axis parameters */

  /* Host computer serial I/O variables.
   */
  SINT4 isio_devType ;		/* Type of host computer I/O device */
#define RCP8DEV_NONE       0	/*   Don't use any device */
#define RCP8DEV_SERIAL     1	/*   Serial port or internal FIFO */
#define RCP8DEV_NETWORK    2	/*   Network socket connection */

  char  sio_device[80] ;	/* File name of serial I/O device */
  char  sio_ipAddr[80] ;	/* IP address of network I/O device */
  char  sio_ipIface[16] ;	/* Interface name for network I/O */
  SINT4 isio_ipPort ;		/* Port number for network I/O */
  SINT4 isio_baudrate ;		/* Baud rate for serial I/O */

  UINT1 lsio_chat_dflt ;	/* Default control via remote chat */
  UINT1 isio_rcvfmt ;		/* Receive format code */
  UINT1 isio_xmtfmt ;		/* Transmit format code */
  UINT1 lsio_sendtrec ;		/* Send time records */
  UINT1 lsio_control_okay ;	/* Accept control packets from host */

  UINT1 lsio_send_intbite ;	/* Send internal BITE packets */
  UINT1 isio_intbite_id ;	/* ID byte of internal BITE packets */

  UINT1 lsio_send_adcbite ;	/* Send A/D converter Q-BITE packets */
  UINT1 isio_adcbite_id ;	/* ID byte of A/D Q-BITE packets */
  UINT1 lsio_sim_adcbite ;	/* Simulate various fake Q-BITE values */

  UINT1 isio_auxstsbite_id ;	/* ID byte of auxiliary status and */
  UINT1 isio_auxcntbite_id ;	/*   control BITE packets */
  UINT1 lsio_send_auxstsbite ;	/* Send/receive auxiliary status */
  UINT1 lsio_recv_auxcntbite ;	/*   and control BITE packets */

  SINT2 isio_sgen_maxlev ;	/* Signal generator maximum level */
  UINT4 isio_trecms ;		/* Time (ms) between time records */
  UINT4 isio_deadtime ;		/* Dead host detection time (ms) */

  FLT4  fsio_xmtrate ;		/* Desired transmit records/second */

  /* Control output variables
   */
  char  pad940x3[3] ;
  UINT1 irad_option ;		/* Radiate control line protocol */
  FLT4  fRadPlength ;		/* Length of radiate On/Off pulses (sec) */

  FLT4 fResetUnsafeSec ;	/* Length of 'unsafe' period after resets */

  /* The following variables determine which of the status input lines
   * from the Antenna/Transmitter/Receiver are actually being used.
   */
  UINT1 lirismode0_sts ;	/* IRIS mode bit 0 */
  UINT1 lirismode1_sts ;	/* IRIS mode bit 1 */
  UINT1 lirismode2_sts ;	/* IRIS mode bit 2 */
  UINT1 lpwidth0_sts ;		/* Pulse-Width bit 0 */
  UINT1 lpwidth1_sts ;		/* Pulse-Width bit 1 */
  UINT1 lradiate_sts ;		/* Radiate */
  UINT1 lservopwr_sts ;		/* Servo Power */
  UINT1 ltrlocal_sts ;		/* TxRx may be controlled remotely */
  UINT1 ltrpower_sts ;		/* Transmitter/Receiver Power */
  UINT1 llocal_sts ;		/* User local mode */
  UINT1 lstandby_sts ;		/* Standby */
  UINT1 linterlock_sts ;	/* Interlock is open */
  UINT1 lmagcurrent_sts ;	/* Magnetron current */
  UINT1 lairflow_sts ;		/* Airflow */
  UINT1 lwavegp_sts ;		/* WaveGuide pressure */
  UINT1 lelimlo_sts ;		/* Lower limit switch encountered */
  UINT1 lelimhi_sts ;		/* Upper limit switch encountered */
  UINT1 lreset_sts ;		/* External reset */
  UINT1 lnoisegen_on_sts ;	/* Noise source Off/On */
  UINT1 lsiggen_on_sts ;	/* Signal generator Off/On */
  UINT1 lsiggen_cw_sts ;	/* Signal generator Pulse/CW output */
  UINT1 lsiggen_fault_sts ;	/* Signal generator fault */
  UINT1 lsiggen_level_sts ;	/* Signal generator level (dBm) */
  char pad975x11[11] ;

  /* Decide whether limit switch encounters will cause a shutdown.
   */
  UINT1 lelimlo_shdn ;		/* Lower EL limit switch causes shutdown */
  UINT1 lelimhi_shdn ;		/* Upper EL limit switch causes shutdown */

  /* Optional serial stream to report TAG angles.
   */
  UINT4 lstag_inuse ;		/* Serial TAG stream in use */
  SINT4 istag_baudrate ;	/* Speed of the interface */
  char   stag_device[80] ;	/* Device name of serial TAG port */
  SINT4 istag_format ;		/* Transmission format (one of RCVnn) */

  /* Optional antenna sector blanking.
   */
  UINT4 lsblnk_inuse ;		/* Implement sector blanking */
  struct rcp8_sblnkdef sblnkdefs[ NSBLNKS ] ; /* Blanked area definitions */

  /* Boolean equations, timers and miscellaneous variables.
   */
  UINT4 lbool_enab ;		/* Enable logic equations */
  struct rcp8_boolean_save boolist[NEQUATIONS] ;

#define NTIMER_VARS (NTIM_BYTES * 8)
  SINT1 itimer_var_modes [ NTIMER_VARS ] ; /* Operating mode */
  UINT4 itimer_var_sec100[ NTIMER_VARS ] ; /* Period in seconds*100 */
  UINT4 itimer_var_hitime[ NTIMER_VARS ] ; /* High time for CLOCKs */
#define TMODE_UNUSED  -1	/* Unused timer (free slot) */
#define TMODE_RETRIG   0	/* Retriggeragle (rising edge resets count) */
#define TMODE_SINGLE   1	/* Rising edges ignored once triggered */
#define TMODE_FILTER   2	/* Simple delay of input */
#define TMODE_RETARD   3	/* Holdoff leading edge */
#define TMODE_EXTEND   4	/* Extend falling edge */
#define TMODE_CLOCK    5	/* Periodic clock tick */
#define TMODE_CHANGE   6	/* Like RETRIG, but for any change */
#define TMODE_FICKLE   7	/* Cleanup a capricious input */
#define TMODE_NAMELIST \
  "Retrig", "Single", "Filter", "Retard", "Extend", "Clock", "Change", "Fickle"
#define TMODE_NAMELIST_LCASE \
  "retrig", "single", "filter", "retard", "extend", "clock", "change", "fickle"
#define TMODE_MODELIST \
  TMODE_RETRIG, TMODE_SINGLE, TMODE_FILTER, TMODE_RETARD, TMODE_EXTEND, \
  TMODE_CLOCK , TMODE_CHANGE, TMODE_FICKLE

  UINT2 iantstop_vel ;		/* Minimum velocity (binang/sec) and time */
  UINT2 iantstop_ms ;		/*  (milliseconds) for stopped antenna. */

#define ADCVAR_NUM 16		/* Boolean vars for user analog voltages */
  struct rcp8_adcvar adcvars[ ADCVAR_NUM ] ;

#define ANTVAR_NUM 16		/* Boolean vars for antenna Pos/Vel tests */
  struct rcp8_antvar antvars[ ANTVAR_NUM ] ;

  /* Optional HPIB devices.
   */
  UINT1 lhpib_inuse ;		/* RCP02 supports HPIB */
  UINT1 ihpib_sys_id ;		/* System controller ID */

  UINT1 lhpib_sgen_inuse ;	/* Signal generator is attached */
  UINT1 ihpib_sgen_id ;		/* Signal generator ID */
  UINT1 lhpib_sgen_haspulm ;	/* Signal generator has pulse modulation */

#define HPIB_MINID   0		/* Bounds on valid HPIB IDs */
#define HPIB_MAXID  30

  char  pad17913x3[3] ;

  /* Dual-System Parameters
   */
  struct rcp8_drcpIrisModeStrategy drcp_stratInactive ;
  struct rcp8_drcpIrisModeStrategy drcp_stratActive ;

  UINT1 idrcp_pwrMode ;		/* Initial drcp mode to powerup into */
  char  cdrcp_nameCh ;		/* Single-character "name" of this device */

  char  pad17942x2[2] ;

  FLT4  fdrcp_moreTime ;	/* Additional OFF time (sec) between switchings */
  FLT4  fdrcp_coolTime ;	/* Cooldown time after becoming inactive */

  UINT1 ldrcp_inuse ;		/* Dual RCP configuration is being used */
  UINT1 ldrcp_unit_a ;		/* This is the "A" unit */
  UINT1 ldrcp_preferred ;	/* This is the "preferred" of the two units */

  UINT1 ldrcp_reset ;		/* The RCP02 can optionally be reset this */
  UINT2 idrcp_resetTime ;	/*   many seconds after becoming inactive. */

  UINT1 idrcp_MntFixedMode[2] ;	/* Fixed IRIS mode and auto switch permission */
  UINT1 ldrcp_MntAutoSw[2] ;	/*   for Maintenance Inactive/Active states. */

  UINT1 ldrcp_allowFlip ;	/* Allow voluntary flipping between units */
  UINT1 ldrcp_wsnst_okay ;	/* Include workstation NST "okay" status */

  /* User-defined text for the two user-defined shutdowns.  This allows
   * a meaningful blinking message to appear on the front panel when the
   * RCP02 is shutdown via logic equations.
   */
  char userShutdownText[2][21] ;
  char pad18006x2[2] ;

  /* Front Panel Display configuration.  Each value is a template that
   * can appear on any of the four lines of the display.
   */
#define FPD_TB       0
#define FPD_EP1      1
#define FPD_EP2      2
#define FPD_EP3      3
#define FPD_PP       4
#define FPD_PV       5
#define FPD_EV1      6
#define FPD_EV2      7
#define FPD_CMD      8
#define FPD_RTS      9
#define FPD_HRP     10
#define FPD_LL      11
#define FPD_TM      12
#define FPD_SS1     13
#define FPD_SS2     14
#define FPD_XX      15
#define FPD_VAR     16
#define FPD_DRCP    17
#define FPD_ENC     18
#define FPD_NCHOICES  19

#define FPDCHOICES { "TB" , "EP1", "EP2", "EP3", "PP" , "PV" , \
		     "EV1", "EV2", "CMD", "RTS", "HRP", "LL" , \
		     "TM" , "SS1", "SS2", "XX" , "VAR", "DRCP",\
                     "Enc", NULL }

#define FPDSTATUS(IVAL) (((IVAL) == FPD_SS1) || ((IVAL) == FPD_SS2))

  UINT2 ifpd_template[2] ;	/* Choice of template for each display line */
  UINT4 ifpd_redrawms ;		/* Desired redraw time (ms) */

  UINT1 lfpd_azp100 ;		/* Display hundredths for AZ position */
  UINT1 lfpd_elp100 ;		/* Display hundredths for EL position */
  UINT1 lfpd_azv100 ;		/* Display hundredths for AZ velocity */
  UINT1 lfpd_elv100 ;		/* Display hundredths for EL velocity */

  /* Optional WSR-88D DCU data stream (antenna/pedestal data)
   */
  UINT4 ldcu_inuse ;		/* Data stream in use */
  SINT4 idcu_position_bits;     /* Number of bits in binary angles (13 or 14) */
  SINT4 idcu_biteid ;		/* ID for standard DCU BITE packets */
  SINT4 idcu_biteid_st[2] ;	/* IDs for SelfTest #1 and #2 BITE packets */
  SINT4 idcu_baudrate ;		/* Speed of the interface */
  SINT4 idcu_parity ;		/* Parity choice */
  FLT4  fdcu_azposmpy ;		/* Azimuth position multipler */
  FLT4  fdcu_elposmpy ;		/* Elevation position multipler */
  FLT4  fdcu_azvelmpy ;		/* Azimuth velocity multipler */
  FLT4  fdcu_elvelmpy ;		/* Elevation velocity multipler */
  FLT4  fdcu_angleLagMS ;	/* Fixed time lag (miliseconds) of angles */
  char   dcu_device[80] ;	/* Device name of serial port */
  char   dcu_deviceSim[80] ;	/*   and optional simulator port */

  /* Optional WSR-88D DAU data stream (BITE/Status data)
   */
  UINT4 ldau_inuse ;		/* Data stream in use */
  SINT4 idau_biteid ;		/* ID for standard BITE packets */
  SINT4 idau_Qbiteid ;		/* ID for quantitative BITE packets */
  SINT4 idau_baudrate ;		/* Speed of the interface */
  SINT4 idau_parity ;		/* Parity choice */
  char   dau_device[80] ;	/* Device name of serial port */
  char   dau_deviceSim[80] ;	/*   and optional simulator port */
  
  /* Optional Kavouras TCU data stream (Radiate/BITE data)
   */
  UINT4 lkavtcu_inuse ;		/* Data stream in use */
  SINT4 ikavtcu_biteid ;	/* ID for standard BITE packets */
  SINT4 ikavtcu_Qbiteid ;	/* ID for quantitative BITE packets */
  char   kavtcu_device[80] ;	/* Device name of serial port */
  char   kavtcu_deviceSim[80] ;	/*   and optional simulator port */

  /* Optional Andrew-Kintec pedestal interface.
   */
  UINT4 landrew_inuse ;		/* Use Andrew interface, not RCP02 servos */
  UINT4 landrew_useposvel ;     /* Get Pos/Vel from serial status stream */
  UINT4 iandrew_biteid ;	/* ID for pedestal BITE packets */
  UINT4 landrew_mapstatus ;	/* Map ACU status --> numbered variables */
  UINT4 landrew_useoffsets ;	/* Read and apply angle offsets from ACU */
  UINT4 landrew_suboffsets ;	/* Subtract those offsets (else add) */
  char   andrew_device[80] ;	/* Device name of serial port */
  char   andrew_deviceSim[80] ;	/*   and optional simulator port */

  /* Optional Applied Systems Transmitter interface.
   */
  UINT4 lappsys_inuse ;		/* Use the transmitter interface */
  UINT4 iappsys_model ;		/* Model number (177, 377, etc) */
  SINT4 iappsys_biteid ;	/* ID for standard BITE packets */
  SINT4 iappsys_Qbiteid ;	/* ID for quantitative BITE packets */
  SINT4 iappsys_mapSts ;	/* Starting number of Status and Control */
  SINT4 iappsys_mapCnt ;	/*   bits that are mapped to the transmitter. */
  char   appsys_device[80] ;	/* Device name of serial port */
  char   appsys_deviceSim[80] ;	/*   and optional simulator port */

  /* Optional Orbit pedestal interface
   */
  UINT4 lorbit_inuse ;		/* Use the transmitter interface */
  SINT4 iorbit_biteid ;		/* ID for standard BITE packets */
  SINT4 iorbit_mapSts ;	        /* Starting number of Status and Control */
  FLT4  forbit_angleLagMS ;	/* Fixed time lag (milliseconds) of angles */
  char   orbit_device[80] ;	/* Device name of serial port */

  /* Optional second antenna on the same pedestal
   */
  UINT4 lAuxAnt_inuse ;		/* Use a secondary antenna */
  FLT4  fAuxAnt_offsetAZ ;	/* Add these angles to the primary antenna */
  FLT4  fAuxAnt_offsetEL ;	/*   position to get the secondary position. */
  SINT4 iAuxAnt_irisMode ;	/* Use second antenna beginning w/this IRIS mode */
  UINT1 lAuxAnt_axisRev ;	/* "Reverse" AZ/EL angles for secondary antenna */

  UINT1 lErrorsToChat;          /* Send error signals to chat terminal as well as stderr */
  char pad19058x2[2] ;

  /* Optional shaft encoder configuration
   */
  UINT1 lShaftEncoderSimulator; /* Simulate the shaft encoder */
  UINT1 lShaftAutoCal ;		/* Enable automatic calibration */
  char pad19062x2[2];

  /* Optional CAN bus configuration
   */
  UINT4 lcanbus_inuse ;		/* Enable the CAN-Bus interface thread */
  SINT4 icanbus_biteid ;	/* ID for standard BITE packets */
  SINT4 icanbus_Qbiteid ;	/* ID for quantitative BITE packets */
} ;
#endif /* #ifndef SIGMET_RCP8_H */
