//
//  Copyright © 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:   SystemInfo.h
//
//  Project:    6046
//
//  Author(s):  W. Arcus
//
//  Purpose:    CSystemInfo class definition.
//
//  Notes:      
//

#if !defined(AFX_SYSTEMINFO_H__30C85950_040B_45FD_BBED_DB3AD3DB2A9B__INCLUDED_)
#define AFX_SYSTEMINFO_H__30C85950_040B_45FD_BBED_DB3AD3DB2A9B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#pragma warning( push, 3 )                                                  // Microsoft's STL is dirty so suppress necessary warnings.
#pragma warning( disable : 4018 )
#include <vector>
#pragma warning( default : 4018 )
#pragma warning( pop )

class CSystemInfo
{
public:

    ///////////////
    // Definitions.

    typedef struct tagDEVICEINFO
    {
        unsigned long                   m_ulDeviceId;
        unsigned short                  m_unSubsystemId;
        unsigned short                  m_unSystemEnumerator;

        float                           m_fMinRange;
        float                           m_fMaxRange;
        float                           m_fMinGain;
        float                           m_fMaxGain;
        float                           m_fMinPower;
        float                           m_fMaxPower;
        float                           m_fMinPulseLength;
        float                           m_fMaxPulseLength;
        float                           m_fMinPingRate;
        float                           m_fMaxPingRate;

        std::string                     m_Name;
    }
    DEVICEINFO, *PDEVICEINFO;

    typedef std::vector<DEVICEINFO>     DeviceInfo_t;
    typedef DeviceInfo_t::iterator      DeviceIdIterator_t;

    ///////////////
    // Services.

                                        CSystemInfo                         (   void );
                                        CSystemInfo                         (   const CSystemInfo      &rRhs );

    virtual                            ~CSystemInfo                         (   void );

    CSystemInfo &                       operator =                          (   const CSystemInfo      &rRhs );

    void                                DecodeDeviceInfo                    (   const BYTE             *pby7kRecord );

    DeviceInfo_t                        DeviceInfo                          (   void ) const;

private:

    ///////////////
    // Attributes.

    unsigned __int64                    m_ui64SonarId;
    unsigned long                       m_ulNumberOfDevices;
    DeviceInfo_t                        m_DeviceInfoTable;

    ///////////////
    // Services.

    bool                                DecodeXMLInfo                       (   const char             *pcXMLMessage,
                                                                                const unsigned long    &rulLength,
                                                                                DEVICEINFO             &rDeviceInfo );

};

#endif // !defined(AFX_SYSTEMINFO_H__30C85950_040B_45FD_BBED_DB3AD3DB2A9B__INCLUDED_)
