
#ifndef UALF_CONVERT_H
#define UALF_CONVERT_H

/* This holds information to customize the convertor */
struct projection_summary
{
  BIN4  iRadarLat;                  /* Latitude of the radar */
  BIN4  iRadarLon;                  /* Longitude */
  FLT8  fRMax;                      /* Range from center to right side of screen */
  BIN4  iCenterLat;                 /* Latitude of center of product */
  BIN4  iCenterLon;                 /* Longitude */
  UINT1 iType;                      /* Type of projection */
  BIN4  iReferenceLat;              /* Latitude of reference point */
  BIN4  iReferenceLon;              /* Longitude */
  SINT4 iXSize, iYSize;             /* Sizes in pixels */
  SINT4 iXScale, iYScale;           /* Scales in cm/pixel */
  SINT4 iXRadPos, iYRadPos;         /* Radar positions in 1/1000 of pixels */
};

struct convert_config
{
  char   sUalfHost[40];
  UINT4  iUalfPort;
  char   sIrisHost[40];
  UINT4  iIrisPort;
  char   sIrisDirectory[DIRECTORY_SIZE];
  UINT4  iNewProductTimeInterval;
  UINT1  lLogToFile;
  UINT1  lLogToTerm;
  UINT1  lVerbose;              /* Log more details */
  UINT1  lDaemon;               /* Run in daemon mode */
  FLT8   fLatMin;
  FLT8   fLatMax;
  FLT8   fLonMin;
  FLT8   fLonMax;
  UINT4  iInitialTimeOffset;    //Time Diff of Host Computer to UALF Data Time
  FILE   *iLogFile;             /* Open file descriptor to log file */
  char   sIngSitename[16];      /* Ingest sitename to use, space padded */
  char   sWarnRegionName[12];
  char   sIconPosCurnt[16];     //Icon name for postive peak current
  char   sIconNegCurnt[16];     //Icon name for negative peak current
  struct projection_summary Projection;
};


class  UalfConvert
{
  private:
    struct convert_config CSetup;
    UINT2 lProcessConfigLine(char *sline_a, struct convert_config *pCSetup_a );
    void  fillProjectionNumbers(struct projection_summary *pProj_a);
   public:
     void  processCommandLine (int iArgc, char *sArgv[]);
     void  loadSetup();
     void  setupLogging();
     void  initializeProdHeader(struct warn_product *pWarnProduct_a);
     UINT1 lProcessAsciiLine (char *sptr_a, struct warn_product *pWarnProduct_a, UINT1 lfirstpass_a);
     void  Usage( void );
     void  Lprintf(const char *sString_a);
     UINT1 isVerbose();
     UINT1 isDaemon();
     char  *getWarnRegionName();
     char  *getIrisDirectory();
     char  *getIrisHost();
     UINT4  getIrisPort();
     char  *getUalfHost();
     UINT4  getUalfPort();
     UINT4  getNewProdTimeInterval();
     FLT8   getLatMin();
     FLT8   getLatMax();
     FLT8   getLonMin();
     FLT8   getLonMax();
     SINT4  getInitialTimeOffset();
};


#endif

