//
//  Copyright © 2001 - 2002, RESON Inc. All Rights Reserved.
//
//  No part of this file may be reproduced or transmitted in any form or by
//  any means, electronic or mechanical, including photocopy, recording, or
//  information storage or retrieval system, without permission in writing
//  from RESON Inc.
//
//  Filename:   Sensor.h
//
//  Project:    6046
//
//  Author(s):  W. Arcus
//
//  Purpose:    
//
//  Notes:      
//

#if !defined(AFX_SENSOR_H__8D5E3E96_5F2B_428F_ACAA_FEE7BCC7DF61__INCLUDED_)
#define AFX_SENSOR_H__8D5E3E96_5F2B_428F_ACAA_FEE7BCC7DF61__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ProcessInf.h"

class CSensor : public SENSORINFO  
{
public:

                CSensor                 (   void );
                CSensor                 (   const CSensor      &rRhs );
                CSensor                 (   const SENSORINFO   *psSensorInfo );

    virtual    ~CSensor                 (   void );

    CSensor &   operator =              (   const CSensor      &rRhs );
    CSensor &   operator =              (   const SENSORINFO   *psSensorInfo );

                operator SENSORINFO *   ()  const;

    bool        Set                     (   const SENSORINFO    &rsSensorInfo );

    bool        Reset                   (   void );

    // Health monitoring and recovery support (on a per sensor basis).

    void        IncrementFailCount      (   void );
    void        MaxFailCount            (   void );
    void        ClearFailCount          (   void );
    bool        IsMaxFailCount          (   void )  const;

    void        FailAlarm               (   const bool  &rbActive );
    bool        IsFailedAlarmActive     (   void )  const;

private:

    void        CopySensorInfo          (   const SENSORINFO   *psSensorInfo );

    ///////////////
    // Attributes.

    bool        m_bFailAlarmActive;

    const int   m_iMaxFailCount;
    int         m_iFailCount;

};

#endif // !defined(AFX_SENSOR_H__8D5E3E96_5F2B_428F_ACAA_FEE7BCC7DF61__INCLUDED_)
