/****************************************************************************/
/* Copyright (c) 2014 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : ModtronixOutput.h                                             */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 12/10/2014                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/

#include "SharedData.h"
#include "TimeP.h"

#ifndef _ModtronixOutput_H
#define _ModtronixOutput_H

#define ModtronixOutputName "ModtronixOutput_ShmemName"

/*
CLASS
ModtronixOutput

DESCRIPTION
Output of Modtronix driver

AUTHOR
Henthorn
*/
class ModtronixOutput : public SharedData {

public:

  struct Data {

    // Indicates that the modtronix board initialized and ready
    Boolean ready;
    Boolean goodComms;

    // Power switch status
    //
    int camera_power;
    int light_level;
    int light_power[4];
    int recorder_power;
    int recorder_ready;
    int ctd_power;

    // Env data and alarms
    //
    float humidity;
    float temp;
    float h2o_fwd;
    float h2o_aft;
    int   h2o_alarm;

    // Video analog data
    float video_mean;
    float video_max;

    // Motor stuff
    //
    int   motor_position;
    int   motor_action;

    // AJA information
    //
    float timecode;
    short available_media;
    int   mode;

    // Timestamp
    //
    TimeIF::TimeSpec updateTime;

  };

  ModtronixOutput(Access access = NoAccess, Boolean init = False);

  ~ModtronixOutput();


  ////////////////////////////////////////////////////////////////////
  // Read from shared memory to this object's Data::data element
  void read();

  ////////////////////////////////////////////////////////////////////
  // Write from this object's Data::data element to shared memory
  void write();

  Data data;

};

#endif
