/* **********************************************************************
 * *                                                                    *
 * *  TCF Header File                                                   *
 * *                                                                    *
 * **********************************************************************
 * File: iris/xuif/tcf.C
 *
 *                        COPYRIGHT (c) 2005  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 TCF_H
#define TCF_H

#ifdef TCF_ALLOCATE
#define EXTERN
#else
#define EXTERN extern
#endif

/* Variables */

EXTERN struct serv_task_configuration  tcf_c;
EXTERN UINT1 iXmtPhaseChoices_c;

/*The default width and height are set after first XtManagedChild call*/
EXTERN SINT2 itcf_defl_width_c;   
EXTERN SINT2 itcf_defl_height_c;


void tcf_delelist( char *sdata, UINT4 idata_length );
void tcf_openlist( char *sdata, UINT4 idata_length );

/*-----------------------------------------------------------------------------
  Widgets and their callbacks 
*/
/* TCF */
EXTERN Widget tcf_mainbar;
EXTERN Widget tcf_filebtn, tcf_filepdw;
EXTERN Widget tcf_cmdsbtn, tcf_cmdspdw;
EXTERN Widget tcf_menubtn, tcf_menupdw;
EXTERN Widget tcf_printpdw;
void tcf_file_cbf( Widget wgt_a, int idx_a, XmPushButtonCallbackStruct* cbd_a );

EXTERN Widget tcf_helpbtn, tcf_helppdw;

EXTERN XsFLB* tcf_open;
EXTERN Widget tcf_svaspop;
EXTERN XsFLB* tcf_dele;
EXTERN Widget tcfhelp_fnampop;


void tcf_cmds_cbf( Widget wgt_a, int idx_a, XmPushButtonCallbackStruct* cbd_a );
void tcf_menu_cbf( Widget wgt, int idx_a, XmPushButtonCallbackStruct* cbd );

void tcf_new( char* snam_a, char *stcf_a, UINT4 ilen_a );

/* Header Section  */
EXTERN Widget tcf_desclab, tcf_desctxt;
void tcf_desctxt_cbf( Widget wgt, void *tag, void *cbd );

/* Antenna Section */
EXTERN Widget 
  tcfant_frm,     tcfant_lab,
  tcfant_scanlab, tcfant_scanopt,  tcfant_scanbtns[5], 
  tcfant_pulselab,tcfant_pulseopt, tcfant_pulsebtns[6],
  tcfant_gainlab, tcfant_gainopt,  tcfant_gainbtns[3],
  tcfant_polarlab,tcfant_polaropt, tcfant_polarbtns[4],
  tcfant_velcorlab,tcfant_velcortgl,
  tcfant_speedlab,  tcfant_speedtxt,
  tcfant_elvlab,  tcfant_elvbtn,   tcfant_elvtxt,
  tcfant_azmlab,  tcfant_azmbtn,   tcfant_azmtxt,
  tcfant_angpop,  tcfant_angtxt,   tcfant_angclear, 
  tcfant_angapply,tcfant_angexit,  tcfant_spanpop, 
  tcfant_spanclear,tcfant_spanapply,tcfant_spanexit,
  tcfant_execlab, tcfant_exectxt;
EXTERN XsLAB_TXT     tcfantspanfr, tcfantspanto;
EXTERN Widget tcfant_spanstrtlab, tcfant_spanstrtopt,  tcfant_spanstrtbtns[3]; 
EXTERN XsLAB_OPT     tcfantscan;
EXTERN XsPDW_TXT tcfantreso;


void tcfant_angapply_cbf( Widget wgt, void *tag, void *cbd );
void tcfant_angbtn_cbf( Widget wgt, char* tag,XmAnyCallbackStruct* cbd );
void tcfant_angclear_cbf( Widget wgt, void *tag, void *cbd );
void tcfant_angexit_cbf( Widget wgt, void *tag, void *cbd );
void tcfant_azmtxt_cbf( Widget wgt, void *tag, void *cbd );
void tcfant_elvtxt_cbf( Widget wgt, void *tag, void *cbd );
void tcfant_gain_cbf( Widget wgt_a,int idx_a,XmPushButtonCallbackStruct* cbd_a );
void tcfant_polar_cbf( Widget wgt_a,int idx_a,XmPushButtonCallbackStruct* cbd_a );
void tcfant_pulse_cbf( Widget wgt_a, void *idx_a, void *cbd_a );
void TcfSetRangePulldown(void);
void tcfant_resopdw_cbf( Widget wgt, int idx_a, XmAnyCallbackStruct *cbd );
void tcfant_resotxt_cbf( Widget wgt, void *tag, void *cbd );
void tcfant_scan_cbf( Widget wgt_a, int idx_a, XmPushButtonCallbackStruct* cbd_a );
void tcfant_spanstrt_cbf( Widget wgt_a, int idx_a, XmPushButtonCallbackStruct* cbd_a );
void tcfant_spanapply_cbf( Widget wgt, void *tag, void *cbd );
void tcfant_spanclear_cbf( Widget wgt, void *tag, void *cbd );
void tcfant_spanexit_cbf( Widget wgt, void *tag, void *cbd );
void tcfant_speedtxt_cbf( Widget wgt, void *tag, void *cbd );
void tcfant_velcortgl_cbf( Widget wgt, char* tag, XmToggleButtonCallbackStruct* cbd );
void tcfant_exectxt_cbf( Widget wgt, void *tag, void *cbd );

#define TCFDSP_DATATYPE_CNT 16
EXTERN Widget 
  tcfdsp_frm,       tcfdsp_lab,  
  tcfdsp_datalab,   tcfdsp_databtn,   tcfdsp_datatxt,
  tcfdsp_datapop, tcfdsp_datapoprc,
  tcfdsp_datapoptgls[TCFDSP_DATATYPE_CNT],  tcfdsp_datapopclrbtns, tcfdsp_datapopbtns,
  tcfdsp_datapopbyteopt,  tcfdsp_datapopbytebtns[2], 
  tcfdsp_ZTlab, tcfdsp_ZTopt, tcfdsp_ZTbtns[2],
  tcfdsp_filterlab, tcfdsp_filteropt, tcfdsp_filterbtns[16],
  tcfdsp_inbinlab,  tcfdsp_inbintxt,  
  tcfdsp_outbinlab, tcfdsp_outbintxt,
  tcfdsp_uabrnglab, tcfdsp_uabrngtxt, 
  tcfdsp_playlab,   tcfdsp_playbtn, tcfdsp_playtxt, 
  tcfdsp_playpop,
  tcfdsp_playpopnoiseopt,  tcfdsp_playpopnoisebtns[2],
  tcfdsp_playpopcalopt,  tcfdsp_playpopcalbtns[2],
  tcfdsp_playpopexit,
  tcfdsp_unfoldlab, tcfdsp_unfoldopt, tcfdsp_unfoldbtns[4+CUSTOMTRIGS],
  tcfdsp_prflolab,  tcfdsp_prflotxt,  
  tcfdsp_uabvellab, tcfdsp_uabveltxt,
  tcfdsp_majormodelab, tcfdsp_majormodebtn, tcfdsp_majormodeopt, 
  tcfdsp_majormodebtns[PMODE_MAX_COUNT],
  tcfdsp_majormodepop,
  tcfdsp_majormodepoploprflab, tcfdsp_majormodepoploprftxt,
  tcfdsp_majormodepoplosamplab, tcfdsp_majormodepoplosamptxt,
  tcfdsp_majormodepoploavglab, tcfdsp_majormodepoploavgtxt,
  tcfdsp_majormodepopreflthreshlab, tcfdsp_majormodepopreflthreshtxt,
  tcfdsp_majormodepopvelthreshlab, tcfdsp_majormodepopvelthreshtxt,
  tcfdsp_majormodepopwidthreshlab, tcfdsp_majormodepopwidthreshtxt,
  tcfdsp_majormodepopexit,
  tcfdsp_pcodelab, tcfdsp_pcodeopt, tcfdsp_pcodebtns[3];


EXTERN XsPDW_TXT tcfdspsamp;
void tcf_samppdw_cbf(Widget wgt_a, void *idx_a, void *cbd_a );
void tcf_samptxt_cbf( Widget wgt, void *tag, void *cbd );

EXTERN XsPDW_TXT tcfdspstart;
void tcf_startpdw_cbf(Widget wgt_a, void *idx_a, void *cbd_a );
void tcf_starttxt_cbf( Widget wgt, void *tag, void *cbd );

EXTERN XsPDW_TXT tcfdspspace;
void tcf_spacepdw_cbf(Widget wgt_a, void *idx_a, void *cbd_a );
void tcf_spacetxt_cbf( Widget wgt, void *tag, void *cbd );

EXTERN XsPDW_TXT tcfdsprngavg;
void tcf_rngavgpdw_cbf( Widget wgt_a, void *idx_a, void *cbd_a );
void tcf_rngavgtxt_cbf( Widget wgt, void *tag, void *cbd );

EXTERN XsPDW_TXT tcfdspmaxrng;
void tcf_maxrngpdw_cbf(Widget wgt_a, void *id_a, void *cbd_a);
void tcf_maxrngtxt_cbf( Widget wgt, void *tag, void *cbd );


EXTERN XsPDW_TXT tcfdspprfhi;
void tcf_prfhipdw_cbf(Widget wgt_a, void *idx_a, void *cbd_a);
void tcf_prfhitxt_cbf( Widget wgt, void *tag, void *cbd );

void tcfdsp_databtn_cbf( Widget wgt, void *tag, void *cbd );
void tcfdsp_ZT_cbf(Widget wgt_a, int idx_a, XmPushButtonCallbackStruct* cbd_a );
void tcfdsp_unfold_cbf( Widget wgt_a, int idx_a, XmPushButtonCallbackStruct* cbd_a );
void tcfdsp_majormodebtn_cbf( Widget wgt, void* tag, void* cbd );
void tcfdsp_majormode_cbf( Widget wgt_a, int idx_a, XmPushButtonCallbackStruct* cbd_a );
void tcfdsp_pcode_cbf( Widget wgt_a, int idx_a, XmPushButtonCallbackStruct* cbd_a );
void tcfdsp_filter_cbf(Widget wgt_a, int idx_a, XmPushButtonCallbackStruct* cbd_a );

void tcfdsp_playbtn_cbf( Widget wgt, void* tag, void* cbd );

/* Data Corrections section */

EXTERN Widget 
  tcfdcor_frm,  tcfdcor_lab;
EXTERN Widget 
  tcfdcor_clutmaplab, tcfdcor_clutmaptgl,
  tcfdcor_beamblklab, tcfdcor_beamblktgl,
  tcfdcor_attnlab, tcfdcor_attntgl,
  tcfdcor_targlab, tcfdcor_targtgl,
  tcfdcor_unfoldvclab, tcfdcor_unfoldvctgl,
  tcfdcor_remfallvclab, tcfdcor_remfallvctgl;

void tcfdcor_clutmaptgl_cbf( Widget wgt, char* tag, XmToggleButtonCallbackStruct* cbd );
void tcfdcor_beamblktgl_cbf( Widget wgt, char* tag, XmToggleButtonCallbackStruct* cbd );
void tcfdcor_attntgl_cbf( Widget wgt, char* tag, XmToggleButtonCallbackStruct* cbd );
void tcfdcor_targtgl_cbf( Widget wgt, char* tag, XmToggleButtonCallbackStruct* cbd );
void tcfdcor_unfoldvctgl_cbf( Widget wgt, char* tag, XmToggleButtonCallbackStruct* cbd );
void tcfdcor_remfallvctgl_cbf( Widget wgt, char* tag, XmToggleButtonCallbackStruct* cbd );

/* Data Threshold section */

EXTERN Widget tcfthrs_frm,  tcfthrs_lab;
EXTERN XsPDW_TXT tcfthrst;
EXTERN XsPDW_TXT tcfthrsz;
EXTERN XsPDW_TXT tcfthrsv;
EXTERN XsPDW_TXT tcfthrsw;
EXTERN XsPDW_TXT tcfthrsd;
void tcfthrs_tpdw_cbf( Widget wgt_a, void *idx_a, void *cbd_a );
void tcfthrs_ttxt_cbf( Widget txtwgt, void *tag, void *cbd );
void tcfthrs_zpdw_cbf( Widget wgt_a, void *idx_a, void *cbd_a);
void tcfthrs_ztxt_cbf( Widget txtwgt, void *tag, void *cbd );
void tcfthrs_vpdw_cbf( Widget wgt_a, void *idx_a, void *cbd_a);
void tcfthrs_vtxt_cbf( Widget txtwgt, void *tag, void *cbd );
void tcfthrs_wpdw_cbf(Widget wgt_a, void *idx_a, void *cbd_a);
void tcfthrs_wtxt_cbf( Widget txtwgt, void* tag, void* cbd );
void tcfthrs_dpdw_cbf( Widget wgt_a, void *idx_a, void* cbd_a);
void tcfthrs_dtxt_cbf( Widget txtwgt, void* tag, void* cbd );

EXTERN Widget
  tcfthrs_loglab,   tcfthrs_logscl,   tcfthrs_logtxt,
  tcfthrs_siglab,   tcfthrs_sigscl,   tcfthrs_sigtxt,    
  tcfthrs_csrlab,   tcfthrs_csrscl,   tcfthrs_csrtxt,    
  tcfthrs_sqilab,   tcfthrs_sqiscl,   tcfthrs_sqitxt,
  tcfthrs_deflbtn;

void tcfthrs_scale_cbf( Widget wgt,char* tag,XmScaleCallbackStruct* cbd );
void tcfthrs_text_cbf( Widget txtwgt,char* tag,XmAnyCallbackStruct* cbd );
void tcfthrs_defl_cbf( Widget wgt, void* tag, void* cbd );


EXTERN Widget
  tcfthrs_pntclutlab, tcfthrs_pntclutbtn,
  tcfthrs_threshlab, tcfthrs_threshtxt;
void tcfthrs_pntclut_cbf( Widget wgt, void* tag, void* cbd );
void tcfthrs_thresh_cbf( Widget wgt, void* tag, void *cbd );


EXTERN Widget
  tcfthrs_spklzlab, tcfthrs_spklztgl,  
  tcfthrs_spklvlab, tcfthrs_spklvtgl;
void tcfthrs_spkl_cbf( Widget wgt,char* tag,XmToggleButtonCallbackStruct* cbd );


#define SMSG_DELESCHED "\
A scheduled task can not be deleted until\n\
it is removed from the task scheduler."

#define SMSG_DELEDEFLT "\
The DEFAULT task can not be deleted."

#undef EXTERN
#endif
