// $Id: pdinrs_top.h,v 1.1.1.1 2005/01/10 18:47:02 pdi Exp $
//*****************************************************************************/
// Copyright 1998-2022 Stonie R. Cooper, Licensed under the auspices of GPLv3,
// See top-level copyright disclaimer (COPYRIGHT) and license (LICENSE)
//                    Marietta, Georgia.
// File:            <this file name>
// Author:          <your full name>, <your full title>, PDI
// Documentation:   NA
// Revision Record: (as follows)
//         Rewritten: 20050114 by Stonie R. Cooper
//                  Established initial file for <this file name>.
// Dependencies: 
//*****************************************************************************/

#ifndef PDINRS_TOP_H
#define PDINRS_TOP_H

#include <curses.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <pdinrs.h>
#include <pdinrs_watch.h>
#include <pdinrs_robust_top.h>

typedef struct
{
  char                    channel_label[24];
  char                    current_wmo[81];
  unsigned char           open_actions;
  double                  idr;
  double                  peak_idr;
  time_t                  idr_peak_time;
  double                  odr;
  unsigned int       product_size;
  double                  peak_odr;
  time_t                  odr_peak_time;
	signed int         CurTransit;
	signed int         CurNCFWait;
} top_ele_link_type;

typedef struct
{
  pthread_mutex_t         *online_time_mutex;
  time_t                  seconds_up;
  unsigned char           number_of_channels;
  pthread_mutex_t         *channel_mutex[MAX_CHANNELS];
  pthread_mutex_t         *full_stop_mutex;
  pthread_cond_t          *dfc;
  pthread_mutex_t         *dfm;
  unsigned char           *dff;
  unsigned char           full_stop;
  top_ele_link_type       top_elements[MAX_CHANNELS];
  channel_stats_type      channel_stats[MAX_CHANNELS];
  demod_stats_type        demod_stats[MAX_CHANNELS];
} top_link_type;

void nrs_top(void);

#endif
