//
//  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__469D0B74_A77A_4A8B_84D9_5C6F83C9DC96__INCLUDED_)
#define AFX_SENSOR_H__469D0B74_A77A_4A8B_84D9_5C6F83C9DC96__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Subsystem.h"
#include "..\..\ProcessInf.h"

class CSensor : public CSubsystem  
{
public:

    ///////////////
    // Services.

                CSensor         (   CCommandProcessor          *pSonarCommandProcessor  = NULL,
                                    CDataProcessor             *pSonarDataProcessor     = NULL );

    virtual    ~CSensor         (   void );

    // Standard sensor interface methods.

    bool        Startup         (   int                         iSubsystemId,
                                    int                         iSensorIndex,
                                    DWORD                       dwThreadId,
                                    unsigned int                uiDataReadyMessageId,
                                    unsigned int                uiReplyReadyMessageId,
                                    int                         iActivateOnStartup );

    bool        Shutdown        (   int                         iSensorIndex );

    bool        Load            (   BYTE                       *pbyData,
                                    unsigned long              *pulSize,
                                    unsigned long              *pulTimestamp );

    bool        SendCommand     (   int                         iClientIndex,
                                    char                       *pszCommand );

    bool        RetrieveStatus  (   BYTE                       *pbyData,
                                    unsigned long              *pulSize,
                                    unsigned long              *pulTimestamp,
                                    int                        *piClientIndex );

    // NOTE: for the EdgeTech system, these methods are implemented at the system and not subsystem
    // level and therefore can be found in the CSensorList class.

    //bool        IsSensorHealthy (   void );
    //
    //bool        Reset           (   void );

    bool        RouteMessage    (   const BYTE                 *pbyMessage,
                                    const unsigned long        &rulSize,
                                    const unsigned long        &rulTimeStamp );

    bool        Identify        (   SENSORINFO                 *psSensorInfo );

    // Extended interface methods.

    bool        SetSystemTime   (   void );

private:


    ///////////////
    // Services.

                CSensor         (   const CSensor          &rRhs );             // Not implemented.
    CSensor &   operator =      (   const CSensor          &rRhs );             // Not implemented.

};

#endif // !defined(AFX_SENSOR_H__469D0B74_A77A_4A8B_84D9_5C6F83C9DC96__INCLUDED_)
