Initial
This commit is contained in:
82
aladin/information.hpp
Normal file
82
aladin/information.hpp
Normal file
@@ -0,0 +1,82 @@
|
||||
#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
|
||||
#ifndef _ALADIN_RAWDATA_HPP_
|
||||
#include <aladin/rawdata.hpp>
|
||||
#endif
|
||||
|
||||
class File;
|
||||
|
||||
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(RawData &array);
|
||||
bool readFrom(File &inFile);
|
||||
bool writeTo(File &outFile);
|
||||
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
|
||||
Reference in New Issue
Block a user