/****************************************************************************/
/* Copyright (c) 2007 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : GncOutput.h                                                   */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 06/07/2007                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/

#ifndef _GNCOUTPUT_H
#define _GNCOUTPUT_H

#include "SharedData.h"

#define GncOutputName "GncOutout"
struct DCState_s;

class GncOutput: public SharedData {
    
public:
    struct DCState_s{
        double lastWallTime;
        double lastWallBearing;
    };
    
    typedef struct DCState_s DCState;
    struct State {
        Boolean sim;
        DCState dc;
    };
    
    
    ////////////////////////////////////////////////////////////////////
    // CTOR
    GncOutput(Access access = NoAccess, Boolean init = False);
    ////////////////////////////////////////////////////////////////////
    // DTOR
    ~GncOutput();
    
    ////////////////////////////////////////////////////////////////////
    // Read output command from shared memory
    void read(State *state);
    
    
    ////////////////////////////////////////////////////////////////////
    // Write output command to shared memory
    void write(State *state);
    
    
    ////////////////////////////////////////////////////////////////////
    // Read from shared memory to this object's state member
    void read();
    
    ////////////////////////////////////////////////////////////////////
    // Write from this object's state member to shared memory
    void write();

    ////////////////////////////////////////////////////////////////////
    // Clear from this object's state member to shared memory
    void clear();

    State state;

};

#endif //_GNCOUTPUT_H
