/* **********************************************************************
 * *                                                                    *
 * *                   Real Time Display Function                       *
 * *                                                                    *
 * **********************************************************************
 * File: utils/rtdisp/rtdFunc.h
 *
 *       COPYRIGHT (c) 1996, 1997, 1998, 2000, 2001, 2002, 2003 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.
 */

#define RTDFUNC_H

#ifdef RTDFUNC_ALLOCATE
#define EXTERN
#else
#define EXTERN extern
#endif


////////////////////////////////////////////////////
// 
// RtdFunc Class
// 
///////////////////////////////////////////////////

class RtdFunc
{
  private :
    UINT4    iChildPid;
    UINT4    iSharedMemKeyIdx;
    SINT4    iOverlaySize;
    SINT4    iOverlayId;
    XImage   *rtdImage;
    GC       rtdImageGC;

    MESSAGE openConfFile( volatile const char *sfilename_a,
      volatile struct SharedDataStruct *pSharedData_a );
    MESSAGE saveConfFile( volatile const char *sfilename_a,
      volatile const struct SharedDataStruct *pSharedData_a );
  public :
    UINT4 getChildPid(void);
    void  setChildPid(UINT4 ichild_pid_a);
    UINT4 getSharedMemKeyIdx(void);
    void  setSharedMemKeyIdx(UINT4 ikey_idx_a);
    void  getOverlaySizeAndId(SINT4 *isize_a, SINT4 *iid_a);

    /* rtdAS.C */
    void  xPutImage(SINT4 ix_a, SINT4 iy_a, SINT4 iw_a, SINT4 ih_a);
    void  setupColormap(void);
    void  execInsertProcess(void);
    void  makeAsciiFiles(void);
    SINT2 openFile(const char *filename);
    void  saveAsFile(char *filename);
    SINT2 getNumOfColors(void);
    void  setDataType(UINT4 data_type);
    UINT4 getDataType(void);
    void  setRange(UINT2 rng_opt_menu_pos);
    UINT2 getRangeMenuPos(void);
    void  setRangeUnits(UINT4 rng_units);
    UINT4 getRangeUnits(void);
    UINT2 getIdxFromCurUnits(void);
    void  setSweepLine(UINT2 lsweep_line_on);
    UINT2 getSweepLine(void);
    void  setSweepLineColor(UINT4 isweep_color_pixel);
    void  setTextColorIdx(UINT4 text_color_idx);
    UINT4 getTextColorIdx(void);

    /* rng.C */
    void setRngVals(UINT4 rng_vals[2][4]);
    void getRngVals(UINT4 rng_vals[2][4]);

    /* rhiOpt.C */
    void  setMaxHeight(FLT4 fmax_hgt_a);
    FLT4  getMaxHeight(void);
    void  setRhiScan(UINT2 lrhi_scan_a);
    UINT2 getRhiScan(void);
    void  setRhiLowerLeft(UINT2 lrhi_lower_left_a);
    UINT2 getRhiLowerLeft(void);

    /* overlay.C */
    void  setOverlayRngRings(UINT4 overlay_rng_ring);
    UINT4 getOverlayRngRings(void);
    void  setOverlayName(char *overlay_name);
    char *getOverlayName(void);
    void  setOverlayLayerMask(UINT4 overlay_layer_mask);
    UINT4 getOverlayLayerMask(void);

    /*color.C */
    void setColorVals(struct color_scale_mod_def refl_color,
                    struct color_scale_mod_def velocity_color,
                  struct color_scale_mod_def width_color);
    void getColorVals(struct color_scale_mod_def *refl_color,
                    struct color_scale_mod_def *velocity_color,
                    struct color_scale_mod_def *width_color);
    FLT4 firstLevel( const UINT4 idata_a, const FLT4 fnum_in);
    FLT4 levelStep( const UINT4 idata_a, const FLT4 fnum_in);
    struct color_setup getColorSetup(void);

    /*siteStat.C */
    void  setSiteName3(char *sitename3);
    UINT4 getNumSites(void);
    void  getSiteInfo(UINT4 idx_a, UINT2 *alloced_a, char *site_info_a);
    void  updateSiteList(void);
    void  setPortNum(UINT4 iport_num_a);
    UINT4 getPortNum(void);
};
EXTERN RtdFunc rtdFunc;
#undef EXTERN

