/* ****************************
 * *                          *
 * *  IRIS ADIDS header File  *
 * *                          *
 * ****************************
 * File: utils/adids/SigAdids.h
 *
 *                      COPYRIGHT (c) 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 ADIDS_MAX_WIDTH   (324)
#define ADIDS_MAX_HEIGHT  (240)
/* -----------------------------------------------
 * Structures related to the data format.
 */
struct adids_code
{
  UINT1 iPixelValue;
  UINT1 iRepeats;
};

struct adids_single_line
{
  UINT1 iSyncLow;
  UINT1 iSyncHigh;
  UINT1 iActionLow;
  UINT1 iActionHigh;
  UINT1 iLineLow;
  UINT1 iLineHigh;
  struct adids_code Codes[ADIDS_MAX_WIDTH];
};

/* Useful structures for the converters.
 */
struct convert_product_table
{
  int   iCommandCode;      /* System area code */
  char  sSiteName16[20];   /* IRIS sitename */
  int   iPType;            /* IRIS product type */
  char  sPName[16];        /* IRIS product name, null terminated */
};
#define MAX_CONVERT_PRODUCTS (100)

#ifdef SIGMET_USER_LIB_H
/* Information from the config file to customize the convertor */
struct convert_config
{
  struct convert_product_table Products[ MAX_CONVERT_PRODUCTS ];
  UINT1 lLogToFile;
  UINT1 lLogToTerm;
  UINT1 lVerbose;              /* Log more details */
  UINT1 lAppendToLog;          /* Append to previous log file */
  FILE *iLogFile;              /* Open file descriptor to log file */
  SINT4 iProductCount;         /* Number of entries in the product table */
  FILE *pOutFile;              /* File descriptor of output device */
#define OUTPUT_FILE    (0)
#define OUTPUT_SERIAL  (1)
  UINT1 iOutputFormat;         /* Output format, file or serial */
  struct ttyspec SerialSpec;   /* Serial spec, used if serial output */
};
#endif  /* #ifdef SIGMET_USER_LIB_H */

/* Function prototypes 
 */
void LoadSetup                         /* File: BufrSubs.C */
( struct convert_config *pCSetup_a,
  const char* sFile_a,                  /* Filename of config file */
  int iDevice_a );                      /* Device number */

void Lprintf                           /* File: BufrSubs.C */
( const struct convert_config *pCSetup_a,
  const char *sString_a );
