//
//  Copyright © 2001 - 2003, 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:   ProcessInfo.h
//
//  Project:    6046.
//
//  Author(s):  P. Moberg - Initial creation.
//              W. Arcus  - Major rework and extension as part of the 7k development.
//
//  Purpose:    Defines the sensor mapping structure and the related data types for
//              various elements.
//
//  Notes:

#if !defined(COMPONENT_H__9D9C76B2_8375_11D4_988B_10500465A0A8__INCLUDED_)
#define COMPONENT_H__9D9C76B2_8375_11D4_988B_10500465A0A8__INCLUDED_

#pragma pack( push, PACK_PROCESSINF_H, 1 )

typedef enum tagEPROCESSINFO
{
    processInfoNameLength   = 64
}
EPROCESSINFO;

typedef struct tagSENSORINFO                                                    // Sensor info structure definition.
{
    char            m_szName                    [ processInfoNameLength ];      // Device name.
    int             m_iPriority;                                                // Not presently used.
    int             m_iFilter;                                                  // Not presently used.
    int             m_iSensorId;                                                // Sensor identifier; see ESENSORID below.
    int             m_iSensorIndex;                                             // Sensor index (dynamicly assigned).
    int             m_iSensorType;                                              // Sensor type; see ESENSORTYPE below.
    int             m_iMediaType;                                               // 0 = TCP/UDP, 1 = COM port; see EMEDIATYPE below.
    int             m_iMediaPort;                                               // TCP/UDP or serial port for data.
    char            m_szMediaName               [ processInfoNameLength ];      // Name such as an address.
    int             m_iSubsystemId;                                             // Sensor specific subsystem id.
    int             m_iActivateOnStart;                                         // 0 = Sensor does NOT go active when it starts, otherwise active.
    int             m_iAccepts7kRecords;                                        // Sensor is capable of accepting routed 7k records.
    int             m_iStartDelay;                                              // Sensor startup delay in seconds relative to the previously delayed sensor startup.
    unsigned long   m_ulDeviceId;                                               // 7k device specific id.
    unsigned short  m_unSystemEnumerator;                                       // 7k system enumeration; permits discrimination amongst multiple devices w/ the same device id.

    static size_t Size( void )
    {
        return sizeof( struct tagSENSORINFO );
    }

    tagSENSORINFO( void )
    {
        memset( this, 0x00, Size() );
    }

    tagSENSORINFO( const tagSENSORINFO &rRhs )
    {
        Copy( rRhs );
    }

    ~tagSENSORINFO( void )      // Don't make virtual, otherwise it will change the sizeof the struct by putting in a vtable ptr.
    {
    }

    tagSENSORINFO & operator = ( const tagSENSORINFO &rRhs )
    {
        if ( &rRhs != this )
        {
            Copy( rRhs );
        }

        return *this;
    }

    void Copy( const tagSENSORINFO &rRhs )
    {
        memcpy( this, &rRhs, Size() );
    }
}
SENSORINFO;

#pragma pack( pop, PACK_PROCESSINF_H )

typedef enum tagESENSORTYPE                                         // Sensor types.
{
    sensorTypeSBP               = 0,                                // Sub bottom profiler.
    sensorTypeSSSLF,                                                // Side scan sonar - low  frequency.
    sensorTypeSSSHF,                                                // Side scan sonar - high frequency.
    sensorTypeMBES,                                                 // Multibeam echo sounder.
    sensorTypeFLS,                                                  // Forward looking sonar.
    sensorTypePOS,                                                  // Position sensor.
    sensorTypeATT,                                                  // Attitude sensor.
    sensorTypeALT,                                                  // Altitude.
    sensorTypeCTD,                                                  // Conductivity Temperature Depth sensor.
    sensorTypeGYRO,                                                 // Gyro (heading) type sensor.
    sensorTypeCOMBO,                                                // Sensor incorporates various generic types.
    sensorTypeRAW                                                   // General unspecified raw data sensor.
}
ESENSORTYPE;

typedef enum tagESENSORID                                           // Sensor identifier.
{
    sensorIdEdgeTechFSDW        = 0,                                // EdgeTech FS-AU system.
    sensorIdSeabat8101_150,                                         // RESON SeaBat 8101, 150 degrees.
    sensorIdMantaVC,                                                // MANTA vehicle controller.
    sensorIdBlueFinVC,                                              // Bluefin vehicle controller (Thales).
    sensorIdRESON7kSonar,                                           // RESON SeaBat 71xx sonar.
    sensorIdRESON7kGeneric                                          // Generic device sending 7k data format records.
}
ESENSORID;

typedef enum tagEMEDIATYPE                                          // Media types.
{
    mediaTypeNIC                = 0,                                // Network interface card.
    mediaTypeSerial,                                                // Serial port.
    mediaTypeInternal                                               // Internal - unknown or unspecified.
}
EMEDIATYPE;

#endif
