/************************************************************************/
/* Copyright 1993 MBARI							*/
/************************************************************************/
/* $Header: /usr/tiburon/unix/gui/proto/RCS/graph.h,v 1.1 1998/01/28 16:17:59 oreilly Exp $		*/
/* Summary  : Include file for Graphing module of ROV User Interface	*/
/* Filename : graph.h							*/
/* Author   : Bob Herlien (rah)						*/
/* Project  : New ROV							*/
/* $Revision: 1.1 $							*/
/* Created  : 01/28/93							*/
/************************************************************************/
/* Modification History:						*/
/* $Log: graph.h,v $
 * Revision 1.1  1998/01/28 16:17:59  oreilly
 * Initial revision
 *
 * Revision 1.6  93/12/17  15:04:45  15:04:45  hebo (Bob Herlien)
 * December Wet Test
 * 
 * Revision 1.4  93/05/27  15:47:54  15:47:54  hebo (Bob Herlien)
 * Data Manager Interface
 * 
*/
/************************************************************************/

#ifndef INCgraphh
#define INCgraphh		1

typedef struct sts_list			/********************************/
{					/* Struct to link DmItemSts structs*/
    struct sts_list	*sl_next;	/* List link			*/
    DM_Item		sl_item;	/* DM_Item handle for Item 0	*/
    DM_Num		sl_nitems;	/* Number of items matching name*/
    DmItemSts		sl_sts;		/* DmItem Status for Item 0	*/
} StsList;				/********************************/

typedef struct display_list		/********************************/
{					/* Struct for finding display items*/
    struct display_list	*dl_next;	/* List link			*/
    char		*dl_name;	/* Item name			*/
    StsList		*dl_sts;	/* StsList entry it matches	*/
} DisplayList;				/********************************/

typedef struct				/********************************/
{					/* Struct for each DM_Type displayed*/
    Widget		te_widget;	/* Display widget		*/
    Widget		te_auxwid1;	/* Aux widget			*/
    Widget		te_auxwid2;	/* Aux widget			*/
    DM_Type		te_type;	/* Data Type			*/
    DM_Size		te_size;	/* Size of Data Type		*/
    Nat32		te_offset;	/* Place in buffer to put value	*/
    MBool		te_changed;	/* User has written to this field*/
    struct graph_list	*te_graph;	/* Ptr back to enclosing GraphList*/
} TypeEntry;				/********************************/

typedef struct graph_list		/********************************/
{					/* Struct to link graphs	*/
    struct graph_list	*gl_link;	/* Linked list link		*/
    DM_Item		gl_item;	/* DM_Item being displayed	*/
    DmItemSts		gl_sts;		/* DmItemSts for item		*/
    TypeEntry		*gl_types;	/* TypeEntry list		*/
    Nat32		gl_ntypes;	/* Number of TypeEntries	*/
    Widget		gl_shell;	/* Shell widget			*/
    Widget		gl_widget;	/* Display widget		*/
    char		*gl_data;	/* DM_Item data			*/
    Nat32		gl_interval;	/* Update interval		*/
    Nat32		gl_gui_period;	/* Consumer period for rest of GUI*/
    XtIntervalId	gl_tmoutid;	/* Timeout ID			*/
} GraphList;				/********************************/

#define SL_NULL		((StsList *)NULL)
#define DL_NULL		((DisplayList *)NULL)
#define GL_NULL		((GraphList *)NULL)

typedef struct log_item			/********************************/
{					/* ITEM struct for logFile	*/
    struct log_item *log_link;		/* Linked list link		*/
    dev_t	log_dev;		/* Device number from fstat	*/
    ino_t	log_inode;		/* Inode number from fstat	*/
    FILE	*log_fp;		/* Log file pointer		*/
    DM_Item	log_dmitem;		/* DM Item ID			*/
    Nat32	log_period;		/* Millisecs per sample		*/
    Nat32	log_flush;		/* No samples between file flush*/
    Nat32	log_flushcnt;		/* Counter for file flushing	*/
    char	*log_data;		/* Item data buffer		*/
    DM_Time	log_time;		/* Time of DM Item data		*/
    Nat32	log_fields;		/* Fields to log (see below)	*/
    DmItemSts	log_sts;		/* DM Item status		*/
    Nat32	log_gui_period;		/* Consumer period for rest of GUI*/
    XtIntervalId log_tmoutid;		/* Timeout ID			*/
} LogItem;				/********************************/

#define LI_NULL	((LogItem *)0)
		/* Widgets in logWidgets array */
#define LOG_DIALOG	0
#define LOG_FORM	1
#define LOG_FNAMETEXTF	2
#define LOG_RATETEXTF	3
#define LOG_NAMETOGGLE	4
#define LOG_DATATOGGLE	5
#define LOG_TIMETOGGLE	6
#define LOG_FLUSHTEXTF	7
#define LOG_OKBUTTON	8
#define NLOGWIDGETS	9

		/* Fields to log	*/
#define LOG_NAME	1
#define	LOG_DATA	2
#define LOG_TIME	4

#endif /* INCgraphh */
