/* **********************************************************************
 * *                                                                    *
 * *    Dual Pol Applications library header file                       *
 * *                                                                    *
 * **********************************************************************
 * File: include/dpolapp_lib.h
 *
 *                        COPYRIGHT (c) 2006 BY
 *             VAISALA INC., 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_DPOLAPP_LIB_H
#define SIGMET_DPOLAPP_LIB_H 1

/* dpolapp messages */
#define DPOLAPP_MSGES       128 /*< allocation for DPOLAPP messages */
#define DPOLAPP_MSGSWITCHOFF  3 /*< msg ID repeats DPOLAPP_MSGSWITCHOFF times after which mute */
#define DPOLAPP_ONE_STRING    "but %d data type missing: %s" ///< int & single string add-on to a sig_message
#define DPOLAPP_TWO_STRINGS   "but %d data type(s) missing: %s %s " ///< two strings add-on to a sig_message string 
#define DPOLAPP_MANY_STRINGS  "but %d data type(s) missing: %s %s etc. " ///< > two strings add-on to a sig_message string
//#define DPOLAPP_THREE_STRINGS "but %d data type(s) missing: %s %s %s " ///< three strings add-on to a sig_message string 
//#define DPOLAPP_FOUR_STRINGS  "but %d data type(s) missing: %s %s %s %s " ///< four strings add-on to a sig_message string 
//#define DPOLAPP_FIVE_STRINGS  "but %d data type(s) missing: %s %s %s %s %s " ///< five strings add-on to a sig_message string 
//#define DPOLAPP_SIX_STRINGS   "but %d data type(s) missing: %s %s %s %s %s %s " ///< six strings add-on to a sig_message string 
/*#define DPOLAPP_ONE_STRING    "%d " ///< single string add-on to a sig_message string
#define DPOLAPP_TWO_STRINGS   "%d %d " ///< two strings add-on to a sig_message string
#define DPOLAPP_THREE_STRINGS "%d %d %d " ///< three strings add-on to a sig_message string
#define DPOLAPP_FOUR_STRINGS  "%d %d %d %d " ///< four strings add-on to a sig_message string
#define DPOLAPP_FIVE_STRINGS  "%d %d %d %d %d " ///< five strings add-on to a sig_message string
#define DPOLAPP_SIX_STRINGS   "%d %d %d %d %d %d " ///< six strings add-on to a sig_message string
*/
#define         MSG_SWITCHINGOFF    98 /*< ".. from now on, this message is muted */
#define DPOLAPP_MSG_SWITCHINGOFF    (DPOLLIB_FACILITY+MSG_SWITCHINGOFF)/*< Facility ibid.*/
#define         MSG_UNKNOWN         99 /*< Unknown message */ 
#define DPOLAPP_MSG_UNKNOWN         (DPOLLIB_FACILITY+MSG_UNKNOWN)/*< Facility ibid.*/
#define         MSG_CONFUPDATEOK     1  /*<  Configuration update & task list ok. */ 
#define DPOLAPP_MSG_CONFUPDATEOK    (DPOLLIB_FACILITY+MSG_CONFUPDATEOK)/*< Facility ibid.*/
#define         MSG_CONFUPGRADEOK   2  /*<  Configuration update & task list using internal defaults. */
#define DPOLAPP_MSG_CONFUPGRADEOK   (DPOLLIB_FACILITY+MSG_CONFUPGRADEOK)/*< Facility ibid.*/
#define         MSG_INITENTER       10  /*<  HClassInit called with ptrs OK */ 
#define DPOLAPP_MSG_INITENTER       (DPOLLIB_FACILITY+MSG_INITENTER)/*< Facility ibid.*/
#define         MSG_INITDONE        11  /*<  HClassInit done */ 
#define DPOLAPP_MSG_INITDONE        (DPOLLIB_FACILITY+MSG_INITDONE)/*< Facility ibid.*/
#define         MSG_INITPTRENTER    12  /*<  HClassInitPtrs called with ptrs OK */ 
#define DPOLAPP_MSG_INITPTRENTER    (DPOLLIB_FACILITY+MSG_INITPTRENTER)/*< Facility ibid.*/
#define         MSG_INITPTRDONE     13  /*<  HClassInitPtrs done */ 
#define DPOLAPP_MSG_INITPTRDONE     (DPOLLIB_FACILITY+MSG_INITPTRDONE)/*< Facility ibid.*/
#define         MSG_UPCNFENTER      14  /*<  HClassUpdateConf called with ptrs OK */ 
#define DPOLAPP_MSG_UPCNFENTER      (DPOLLIB_FACILITY+MSG_UPCNFENTER)/*< Facility ibid.*/
#define         MSG_UPCNFSTTFAILS   15  /*<  HClassUpdateConf stat fails */
#define DPOLAPP_MSG_UPCNFSTTFAILS   (DPOLLIB_FACILITY+MSG_UPCNFSTTFAILS)/*< Facility ibid.*/
#define         MSG_UPCNFDONE       16  /*<  HClassUpdateConf done */ 
#define DPOLAPP_MSG_UPCNFDONE       (DPOLLIB_FACILITY+MSG_UPCNFDONE)/*< Facility ibid.*/
#define         MSG_RAYCENTER       17  /*<  HClassRayCalculusF called with ptrs OK */ 
#define DPOLAPP_MSG_RAYCENTER       (DPOLLIB_FACILITY+MSG_RAYCENTER)/*< Facility ibid.*/
#define         MSG_RAYCFATAL       18  /*<  HClassRayCalculusF fatal */ 
#define DPOLAPP_MSG_RAYCFATAL       (DPOLLIB_FACILITY+MSG_RAYCFATAL)/*< Facility ibid.*/
#define         MSG_RAYCDONE        19  /*<  HClassRayCalculusF done */ 
#define DPOLAPP_MSG_RAYCDONE        (DPOLLIB_FACILITY+MSG_RAYCDONE)/*< Facility ibid.*/
#define         MSG_BUNCENTER       20  /*<  HClassBunchCalculusF called with ptrs OK */ 
#define DPOLAPP_MSG_BUNCENTER       (DPOLLIB_FACILITY+MSG_BUNCENTER)/*< Facility ibid.*/
#define         MSG_BUNCFATAL       21  /*<  HClassBunchCalculus fatal */ 
#define DPOLAPP_MSG_BUNCFATAL       (DPOLLIB_FACILITY+MSG_BUNCFATAL)/*< Facility ibid.*/
#define         MSG_BUNCDONE        22  /*<  HClassBunchCalculus done */ 
#define DPOLAPP_MSG_BUNCDONE        (DPOLLIB_FACILITY+MSG_BUNCDONE)           /*< Facility ibid.*/
#define         MSG_MTINMMPPPHCENTER 30/*< mtInitMajorMode_pppHClass called ptrs OK */
#define DPOLAPP_MSG_MTINMMPPPHCENTER (DPOLLIB_FACILITY+MSG_MTINMMPPPHCENTER)/*< Facility ibid.*/
#define         MSG_MTINMMPPPHCDONE  31/*< mtInitMajorMode_pppHClass done: usHCstatus */
#define DPOLAPP_MSG_MTINMMPPPHCDONE  (DPOLLIB_FACILITY+MSG_MTINMMPPPHCDONE) /*< Facility ibid.*/
#define         MSG_MTEXMMPPPHCENTER 32/*< mtExitMajorMode_pppHClass entered; ptrs OK */
#define DPOLAPP_MSG_MTEXMMPPPHCENTER (DPOLLIB_FACILITY+MSG_MTEXMMPPPHCENTER)    /*< Facility ibid.*/
#define         MSG_MTEXMMPPPHCDONE  33/*< mtExitMajorMode_pppHClass done: usHCstatus */
#define DPOLAPP_MSG_MTEXMMPPPHCDONE  (DPOLLIB_FACILITY+MSG_MTEXMMPPPHCDONE)     /*< Facility ibid.*/
#define         MSG_INPRSCPPPHCENTER   34/*< initProcSection_pppHClass entered; ptrs OK */
#define DPOLAPP_MSG_INPRSCPPPHCENTER   (DPOLLIB_FACILITY+MSG_INPRSCPPPHCENTER)/*< Facility ibid.*/
#define         MSG_INPRSCPPPHCNOTASKS 35/*< initProcSection_pppHClass tasks not ok */
#define DPOLAPP_MSG_INPRSCPPPHCNOTASKS (DPOLLIB_FACILITY+MSG_INPRSCPPPHCNOTASKS)/*< ibid.*/
#define         MSG_INPRSCPPPHCNOTINHV 36/*< initProcSection_pppHClass not in H+V mode */
#define DPOLAPP_MSG_INPRSCPPPHCNOTINHV (DPOLLIB_FACILITY+MSG_INPRSCPPPHCNOTINHV)/*< ibid.*/
#define         MSG_INPRSCPPPHCNOWINHV 37/*< initProcSection_pppHClass now in H+V mode */
#define DPOLAPP_MSG_INPRSCPPPHCNOWINHV (DPOLLIB_FACILITY+MSG_INPRSCPPPHCNOWINHV)/*< ibid.*/
#define         MSG_INPRSCPPPHCMISTYPE 38/*< initProcSection_pppHClass tasks not ok */
#define DPOLAPP_MSG_INPRSCPPPHCMISTYPE (DPOLLIB_FACILITY+MSG_INPRSCPPPHCMISTYPE)/*< ibid.*/
#define         MSG_INPRSCPPPHCMISSML  39/*< initProcSection_pppHClass RDA ML unknown */
#define DPOLAPP_MSG_INPRSCPPPHCMISSML (DPOLLIB_FACILITY+MSG_INPRSCPPPHCMISSML)/*< ibid.*/
#define         MSG_INPRSCPPPHCDONE    40/*< initProcSection_pppHClass done: usHCstatus */
#define DPOLAPP_MSG_INPRSCPPPHCDONE    (DPOLLIB_FACILITY+MSG_INPRSCPPPHCDONE) /*< Facility ibid.*/
#define         MSG_EXPRSCPPPHCENTER 41/*< exitProcSection_pppHClass entered; ptrs OK */
#define DPOLAPP_MSG_EXPRSCPPPHCENTER (DPOLLIB_FACILITY+MSG_EXPRSCPPPHCENTER)/*< Facility ibid.*/
#define         MSG_EXPRSCPPPHCDONE  42/*< exitProcSection_pppHClass done: usHCstatus */
#define DPOLAPP_MSG_EXPRSCPPPHCDONE  (DPOLLIB_FACILITY+MSG_EXPRSCPPPHCDONE) /*< Facility ibid.*/
#define         MSG_CTINMMPPPHCENTER 50/*< ctInitMajorMode_pppHClass called ptrs OK */
#define DPOLAPP_MSG_CTINMMPPPHCENTER (DPOLLIB_FACILITY+MSG_CTINMMPPPHCENTER)/*< Facility ibid.*/
#define         MSG_CTINMMPPPHCDONE  51/*< ctInitMajorMode_pppHClass done: usHCstatus */
#define DPOLAPP_MSG_CTINMMPPPHCDONE  (DPOLLIB_FACILITY+MSG_CTINMMPPPHCDONE) /*< Facility ibid.*/
#define         MSG_CTEXMMPPPHCENTER 52/*< ctExitMajorMode_pppHClass entered; ptrs OK */
#define DPOLAPP_MSG_CTEXMMPPPHCENTER (DPOLLIB_FACILITY+MSG_CTEXMMPPPHCENTER)    /*< Facility ibid.*/
#define         MSG_CTEXMMPPPHCDONE  53/*< ctExitMajorMode_pppHClass done: usHCstatus */
#define DPOLAPP_MSG_CTEXMMPPPHCDONE  (DPOLLIB_FACILITY+MSG_CTEXMMPPPHCDONE)     /*< Facility ibid.*/
#define         MSG_HCFRMOUTENTER    54/*< hclassFormatOutput entered; ptrs OK */
#define DPOLAPP_MSG_HCFRMOUTENTER    (DPOLLIB_FACILITY+MSG_HCFRMOUTENTER)   /*< Facility ibid.*/
#define         MSG_HCFRMOUTDONE     55/*< hclassFormatOutput done: usHCstatus */
#define DPOLAPP_MSG_HCFRMOUTDONE     (DPOLLIB_FACILITY+MSG_HCFRMOUTDONE)    /*< Facility ibid.*/
#define         MSG_ASSRES_MULTIOUTS 60/*< HCassignResult: >1 outputs, goes FATAL */
#define DPOLAPP_MSG_ASSRES_MULTIOUTS (DPOLLIB_FACILITY+MSG_ASSRES_MULTIOUTS) /*< Facility ibid.*/
#define         MSG_RTRCFG_FCTFAIL   61/*< HClassRetrieveConfiguration: failed factory goes FATAL, obsolete*/
#define DPOLAPP_MSG_RTRCFG_FCTFAIL   (DPOLLIB_FACILITY+MSG_RTRCFG_FCTFAIL) /*< Facility ibid., obsolete*/
#define         MSG_PRQ_MULTIDER     62/*< HClassPrepareQuality: multiple  derived inputs, goes FATAL*/
#define DPOLAPP_MSG_PRQ_MULTIDER     (DPOLLIB_FACILITY+MSG_PRQ_MULTIDER) /*< Facility ibid.*/
#define         MSG_PRP_MULTIDER     63/*< HClassPrepareQuality: multiple  derived inputs, goes FATAL*/
#define DPOLAPP_MSG_PRP_MULTIDER     (DPOLLIB_FACILITY+MSG_PRP_MULTIDER) /*< Facility ibid.*/
#define         MSG_CHKCNFENTER      70/*< CheckConfiguration entered; ptrs OK */
#define DPOLAPP_MSG_CHKCNFENTER    (DPOLLIB_FACILITY+MSG_CHKCNFENTER)   /*< Facility ibid.*/
#define         MSG_CHKCNFDONE       71/*< CheckConfiguration done: usHCstatus */
#define DPOLAPP_MSG_CHKCNFDONE     (DPOLLIB_FACILITY+MSG_CHKCNFDONE)    /*< Facility ibid.*/
#define         MSG_CHKCNFVERMISM    72/*< CheckConfiguration IRIS/RDA/dpolapp version mismatch */
#define DPOLAPP_MSG_CHKCNFVERMISM  (DPOLLIB_FACILITY+MSG_CHKCNFVERMISM) /*< Facility ibid.*/
#define         MSG_CHKCNFSAVED      73/*< CheckConfiguration save due to user renaming */
#define DPOLAPP_MSG_CHKCNFSAVED    (DPOLLIB_FACILITY+MSG_CHKCNFSAVED) /*< Facility ibid.*/
#define         MSG_LDPSTPENTER      74/*< LoadDPolappSetup entered; ptrs OK */
#define DPOLAPP_MSG_LDPSTPENTER    (DPOLLIB_FACILITY+MSG_LDPSTPENTER)   /*< Facility ibid.*/
#define         MSG_LDPSTPDONE       75/*< LoadDPolappSetup done: usHCstatus */
#define DPOLAPP_MSG_LDPSTPDONE     (DPOLLIB_FACILITY+MSG_LDPSTPDONE)    /*< Facility ibid.*/
#define         MSG_LDPSTPFAIL       76/*< LoadDPolappSetup fails */
#define DPOLAPP_MSG_LDPSTPFAIL     (DPOLLIB_FACILITY+MSG_LDPSTPFAIL) /*< Facility ibid.*/
#define         MSG_LDPSTPDFLUP      77/*< LoadDPolappSetup*/
#define DPOLAPP_MSG_LDPSTPDFLUP    (DPOLLIB_FACILITY+MSG_LDPSTPDFLUP) /*< Facility ibid.*/
#define         MSG_MISLINK          78/*< HClassXXX: missing links, goes FATAL*/
#define DPOLAPP_MSG_MISLINK        (DPOLLIB_FACILITY+MSG_MISLINK) /*< Facility ibid.*/
#define         MSG_LDPSTPFCTFAIL    79/*< LoadDPolappSetup: factory settings failed goes FATAL*/
#define DPOLAPP_MSG_LDPSTPFCTFAIL   (DPOLLIB_FACILITY+MSG_LDPSTPFCTFAIL) /*< Facility ibid., */
#define         MSG_RTRCFG_INFO      80/*< HClassRetrieveConfiguration: retrieved fail info*/
#define DPOLAPP_MSG_RTRCFG_INFO   (DPOLLIB_FACILITY+MSG_RTRCFG_INFO) /*< Facility ibid., */
#define         MSG_CHKCNFFAIL       81/*< CheckConfiguration limits/syntax TEST */
#define DPOLAPP_MSG_CHKCNFFAIL    (DPOLLIB_FACILITY+MSG_CHKCNFFAIL) /*< Facility ibid.*/
#define         MSG_CHKCNFUPGRADED   82/*< CheckConfiguration upgrade due IRIS/RDA/dpolapp version mismatch */
#define DPOLAPP_MSG_CHKCNFUPGRADED (DPOLLIB_FACILITY+MSG_CHKCNFUPGRADED) /*< Facility ibid.*/
#define         MSG_CHKCNFGENERATED  83/*< CheckConfiguration fresh conf generate */
#define DPOLAPP_MSG_CHKCNFGENERATED (DPOLLIB_FACILITY+MSG_CHKCNFGENERATED) /*< Facility ibid.*/
#define         MSG_INITVOL_MISSML   84/*< HClassInitVolume: RAW ML undefined */
#define DPOLAPP_MSG_INITVOL_MISSML (DPOLLIB_FACILITY+MSG_INITVOL_MISSML) /*< Facility ibid.*/ 

#ifndef MESSAGE_ONLY

#ifdef __cplusplus
extern "C" {
#endif

#ifdef SIGMET_INGEST_H
void HClassDoRay                  /* File: HydroClass.C */
( const struct data_ray *pInRay_a,
  SINT4 dbz_dtype_a,
  struct data_ray *pOutRay_a );
#endif  /* #ifdef SIGMET_INGEST_H */

void HClassFreeAllResources(void);     /* File: HydroClass.C */

void HClassFreeVolumeResources(void);  /* File: HydroClass.C */

void HClassInitSweep                   /* File: HydroClass.C */
( BIN2 iNomEl_c );

#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE HClassInitVolume             /* File: HydroClass.C */
( const struct dsp_data_mask *pData_have_a, 
  struct ingest_header *pIhd_a,          
  struct dsp_data_mask *pData_keep_a);   
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */

/* Make a complete HydroClass (HCl) INGEST parameter data file.
 * This is just for one sweep.
 */
#ifdef SIGMET_INGEST_HEADER_DEFINED
MESSAGE HClassMakeDatafile          /* File: HydroClass.C */
( const SINT4 isweep,             
  struct ingest_header *pIhd_a,
  char *spathname_a,           
  struct ingest_data_file * const idaddr_a[NUM_DEFINED_DATA]); 
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */

#ifdef SIGMET_INGEST_HEADER_DEFINED
UINT1 HClassTestForRun
( const struct ingest_header *pIhd_a);
#endif  /* #ifdef SIGMET_INGEST_HEADER_DEFINED */

#ifdef __cplusplus
}
#endif

#ifdef SIGMET_RVP8_H
void mtInitMajorMode_pppHClass( void );   // File: mt_HClassRDA.c 
MESSAGE iConfigErrorDualPol_HClass( const UINT1 iOp_a );  // File: mt_HClassRDA.c
void initProcSection_pppHClass( void ) ;  // File: mt_HClassRDA.c 
void exitProcSection_pppHClass( void );   // File: mt_HClassRDA.c 
void ctInitMajorMode_pppHClass( void );   // File: HClassRDA.c 
/*
UINT1 dpolapp_signal                      // File: HClassRDA.c
( const MESSAGE uiMsg_a, const UINT1 bLatch, const MESSAGE uiMsgLatch_a );  
UINT1 dpolapp_signal_va                   // File: HClassRDA.c
( const MESSAGE uiMsg_a, const UINT1 bLatch, const MESSAGE uiMsgLatch_a, const UINT4 uiCount_a, ...);
*/
#endif // #ifdef SIGMET_RVP8_H 
#endif // #ifndef MESSAGE_ONLY 
#endif // #ifndef SIGMET_DPOLAPP_LIB_H 
