/************************************************************************/
/* Copyright 1998 MBARI							*/
/************************************************************************/
#ifndef _DCONDM_H
#define _DCONDM_H
static char DconDm_h_id[] = "$Header: /u/oreilly/rov/tmacs/RCS/DconDm.h,v 1.3 1998/12/18 21:07:21 oreilly Exp $";

/*
$Log: DconDm.h,v $
Revision 1.3  1998/12/18 21:07:21  oreilly
Added documentation

Revision 1.2  1997/03/20 12:33:04  oreilly
*** empty log message ***

 * Revision 1.1  96/10/28  09:13:32  09:13:32  oreilly (Thomas C. O'Reilly)
 * Initial revision
 * 
*/

#include "DataManager.h"
#include "Alarm.h" 
#include "ibcDm.h"
#include "pduMicro.h"
#include "microDm.h"
#include "ersDcon.h"
#include "lightingDcon.h"
#include "powerIbc.h"
#include "vmeIbc.h"
#include "cameraDcon.h"
#include "sensorDcon.h"
#include "sonarDcon.h"
#include "gf_5vDm.h"

/* The definitions of these strings are scattered all over the
mbari header files; not sure which files to include! Define them here
for now! */
#define HUMIDITY_ALARM_DM         "HUMIDITY_ALARM"
#define JBOX_WATER_ALARM_DM       "JBOX_WATER_ALARM"
#define HOUSING_WATER_ALARM_DM    "HOUSING_WATER_ALARM"


/*
CLASS 
DconDm

DESCRIPTION
DconDm creates and contains Data Manager objects that are common to
all Dcons.

AUTHOR
Tom O'Reilly
*/
class DconDm : public ErrorHandler
{
  public:
  
  DconDm(const char *name, const char *dmPrefix);
  
  ~DconDm() 
  {
    if (_dmPrefix)
      free(_dmPrefix);

    if (_name)
      free(_name);
  }

  DmEmptyObject *resetCmd;
  DmEmptyObject *resetEvent;
  DmBooleanObject *ramTest;

  DmNat16Object *humidity;
  DmNat16Object *humidityWarnThresh;
  DmNat16Object *humidityAlarmThresh;

  DmInt16Object *temp;
  DmInt16Object *tempWarnThresh;
  DmInt16Object *tempAlarmThresh;

  DmInt16Object *waterAlarmThreshold;
  BooleanAlarm *housingWaterAlarm;

  DmInt16Object *vicorVoltage;
  DmInt16Object *offsetCurrent;
  DmInt16Object *chan0Current;
  DmInt16Object *chan1Current;
  DmInt16Object *chan2Current;
  DmInt16Object *chan3Current;
  
  DmNat16Object *cardError;

  const char *name();
  
  // Return prefix of data manager items for this dcon type
  const char *dmPrefix();

  MBool hasJbox()
  {
    return _hasJbox;
  }
  
  void hasJbox(MBool yesNo)
  {
    _hasJbox = yesNo;
  }
  
  protected:
  char *_dmPrefix;
  char *_name;
  MBool _hasJbox;
};



#endif


