75 lines
1.6 KiB
C++
75 lines
1.6 KiB
C++
#ifndef _ALADIN_INFORMATION_HPP_
|
|
#define _ALADIN_INFORMATION_HPP_
|
|
#ifndef _COMMON_WINDOWS_HPP_
|
|
#include <common/windows.hpp>
|
|
#endif
|
|
#ifndef _COMMON_ARRAY_HPP_
|
|
#include <common/array.hpp>
|
|
#endif
|
|
|
|
class Information
|
|
{
|
|
public:
|
|
typedef enum Model{MaresGenius=0x40,AladinAirZ,AladinAirZO2,AladinAirXNitrox,SpiroMonitor3Air,
|
|
AladinAirTwin,SpiroMonitor2Plus,AladinSportPlus,AladinPro,AladinProUltra,Unknown};
|
|
typedef enum Standard{Imperial,Metric};
|
|
Information();
|
|
virtual ~Information();
|
|
Model getComputerType(void)const;
|
|
String getComputerTypeString(void)const;
|
|
bool isNitrox(void)const;
|
|
bool isO2(void)const;
|
|
bool isNitroxOnly(void)const;
|
|
bool readFrom(Array<BYTE> &array);
|
|
Standard getStandard(void)const;
|
|
String getStandardString(void)const;
|
|
bool getBeep(void)const;
|
|
private:
|
|
BYTE mComputerType;
|
|
BYTE mExtraInfo1;
|
|
};
|
|
|
|
|
|
inline
|
|
bool Information::isNitrox(void)const
|
|
{
|
|
Model model(getComputerType());
|
|
if(AladinAirXNitrox==model||AladinAirZO2==model||AladinProUltra==model)return true;
|
|
return false;
|
|
}
|
|
|
|
|
|
inline
|
|
bool Information::isO2(void)const
|
|
{
|
|
Model model(getComputerType());
|
|
if(AladinAirZO2==model)return true;
|
|
return false;
|
|
}
|
|
|
|
inline
|
|
bool Information::isNitroxOnly(void)const
|
|
{
|
|
if(isNitrox()&&!isO2())return true;
|
|
return false;
|
|
}
|
|
|
|
inline
|
|
Information::Standard Information::getStandard(void)const
|
|
{
|
|
return (mExtraInfo1&0x01)?Imperial:Metric;
|
|
}
|
|
|
|
inline
|
|
String Information::getStandardString(void)const
|
|
{
|
|
if(Metric==getStandard())return "Metric";
|
|
return "Imperial";
|
|
}
|
|
|
|
inline
|
|
bool Information::getBeep(void)const
|
|
{
|
|
return (mExtraInfo1&0x01)?true:false;
|
|
}
|
|
#endif |