#ifndef ANT_COMMON_H
#define ANT_COMMON_H

#ifdef ANT_COMMON_ALLOCATE
#define EXTERN
#else
#define EXTERN extern
#endif

#define AZ  1
#define EL  2

#define SEL_NONE 0
#define SEL_INC 1
#define SEL_DEC 2
#define SEL_DRAG 3

struct ShapeDef
{  
  XPoint pts[20];
  int    numofpts;
  int    isOutlined;
  GC     gcOutline;
  int    isFilled;
  GC     gcFill;  
  double angle;
  double xScale;
  double yScale;
  int    radiusCenterOffset;
};

struct DrawDef
{ 
  int    type;
  struct ShapeDef selector;
  struct ShapeDef pointer;
  struct ShapeDef pedpointer;
  struct ShapeDef headpointer;
  int    xCenter;
  int    yCenter;
  double incAngle;
  int    moveType;
  int    sunRadius;
  double sunErrVal;
  double sunPos;
  Window win;
  Pixmap drawBuffer;
  Pixmap dial;
  unsigned int width;
  unsigned int height;
};


struct AntInfo
{
  int     mode;
  int     isStopped;
  float   fpos;
  float   fposCur;
  float   fposMin;
  float   fposMax;
  float   fvel;
  float   fvelCur;
  int     velMin;
  int     velMax;
  double  fsunErrMax;
  struct  DrawDef posDrawDef;
};


EXTERN struct AntInfo az, el;



EXTERN int   rotateELPast95Deg;
EXTERN int   sunTrkMode;
EXTERN int   showStablePlatformParams;
EXTERN int   siggenMin_c;
EXTERN int   siggenMax_c;
EXTERN long  siggenCur_c;
EXTERN long  siggenRqst_c;
EXTERN long  antCmdVal_c;
EXTERN long  antStatVal_c;
EXTERN long  antStatCritVal_c;

EXTERN GC  gcSolidRed, gcSolidGreen, gcSolidBlack;
EXTERN GC  gcGreen2, gcGreen4, gcGreen6;
EXTERN GC  gcSolidYellow, gcErase, gcFont;

EXTERN Pixmap lampRedPm, lampGrnPm;

EXTERN Window trpwr_win, rad_win, servpwr_win;
EXTERN Window azstopda_win, elstopda_win;

EXTERN struct dsp_siggen_cal    siggencal_c;
EXTERN struct dsp_manual_setup  dspsetup_c;


/* inform */
void createInformMenu(Widget parent_wgt_a);
void popupInformMenu(void);
void popdownInformMenu(void);

/* iosummary */
void createIOSummaryMenu(Widget parent_wgt_a);
void popupIOSummaryMenu(void);
void popdownIOSummaryMenu(void);

/* timeset */
void createTimeSetMenu(Widget parent_wgt_a);
void popupTimeSetMenu(void);
void popdownTimeSetMenu(void);



void get_time(SINT4* piyear_a, SINT4* piday_a, SINT4* pisecond_a);
void initInfo(void);
void pwrUpAnt(void);

void azPosRqstOutput(FLT4 angle);
void elPosRqstOutput(FLT4 angle);
void initInfo(void);
void initAzElDrawStuff(void);
void initAzElPosVelStuff(void);

void updateRcpSummary(double fage, int in_cnt, int iout_cnt, int iout_err);


void infoUpdateTimeSet(void);

#undef EXTERN
#endif

