From 49ce7cd318d00be44c43cffea028a6556104fe18 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Cl=C3=A9ment=20de=20l=27Hamaide?= Date: Tue, 30 Dec 2014 17:19:19 +0100 Subject: [PATCH] Revert "Altimeter: fix output format for hPa/InHg settings" Replaced by some line of Nasal, that way we don't touch the internal precision of the altimeter This reverts commit 84a26de9ae9ade8629dee53cac8b9357f0930690. --- src/Instrumentation/altimeter.cxx | 8 ++++---- src/Instrumentation/altimeter.hxx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Instrumentation/altimeter.cxx b/src/Instrumentation/altimeter.cxx index 00e6bb4b3..a691f1e90 100644 --- a/src/Instrumentation/altimeter.cxx +++ b/src/Instrumentation/altimeter.cxx @@ -52,7 +52,7 @@ Altimeter::~Altimeter () double Altimeter::getSettingInHg() const { - return int(_settingInHg*100.0)/100.0; /* return only 2 decimals: xx.xx */ + return _settingInHg; } void @@ -61,14 +61,14 @@ Altimeter::setSettingInHg( double value ) _settingInHg = value; } -int +double Altimeter::getSettingHPa() const { - return int(_settingInHg * SG_INHG_TO_PA / 100.0); /* return an INT: xxxx */ + return _settingInHg * SG_INHG_TO_PA / 100; } void -Altimeter::setSettingHPa( int value ) +Altimeter::setSettingHPa( double value ) { _settingInHg = value * SG_PA_TO_INHG * 100; } diff --git a/src/Instrumentation/altimeter.hxx b/src/Instrumentation/altimeter.hxx index a9b32d9a4..45c3a4e61 100644 --- a/src/Instrumentation/altimeter.hxx +++ b/src/Instrumentation/altimeter.hxx @@ -43,8 +43,8 @@ public: double getSettingInHg() const; void setSettingInHg( double value ); - int getSettingHPa() const; - void setSettingHPa( int value ); + double getSettingHPa() const; + void setSettingHPa( double value ); private: std::string _name; -- 2.39.5