1
0
Fork 0

Fix in code definition of hpa.

In current code hpa is indirectly defined as 10^5 pascals.
The present commit indirectly defines it as 10^2 pascals.
This commit is contained in:
jimishol 2021-11-04 10:27:47 +02:00 committed by James Turner
parent 7a7b875b58
commit fb6da32cec
3 changed files with 17 additions and 17 deletions

View file

@ -103,7 +103,7 @@ var staticPressure = "systems/static/pressure-inhg";
var pressureUnits = { "inHg" : 0, "hPa" : 1 }; var pressureUnits = { "inHg" : 0, "hPa" : 1 };
var baroSettingUnit = pressureUnits["inHg"]; var baroSettingUnit = pressureUnits["inHg"];
var baroSettingInhg = 29.92; var baroSettingInhg = 29.92;
var baroSettingHpa = baroSettingInhg * 0.03386389; var baroSettingHpa = baroSettingInhg * 33.86389;
var baroSettingAdjusting = 0; var baroSettingAdjusting = 0;
var baroButtonDown = 0; var baroButtonDown = 0;
var baroTimerRunning = 0; var baroTimerRunning = 0;
@ -1542,7 +1542,7 @@ var adjustBaroSettingInhg = func(amount) {
# Adjust baro setting inHg by amount, # Adjust baro setting inHg by amount,
# and sync baro setting hPa. # and sync baro setting hPa.
baroSettingInhg = baroSettingInhg + amount; baroSettingInhg = baroSettingInhg + amount;
baroSettingHpa = baroSettingInhg * 0.03386389; baroSettingHpa = baroSettingInhg * 33.86389;
settingBaroSettingHpa.setDoubleValue(baroSettingHpa); settingBaroSettingHpa.setDoubleValue(baroSettingHpa);
settingBaroSettingInhg.setDoubleValue(baroSettingInhg); settingBaroSettingInhg.setDoubleValue(baroSettingInhg);
@ -1553,7 +1553,7 @@ var adjustbaroSettingHpa = func(amount) {
# Adjust baro setting hPa by amount, # Adjust baro setting hPa by amount,
# and sync baro setting inHg. # and sync baro setting inHg.
baroSettingHpa = baroSettingHpa + amount; baroSettingHpa = baroSettingHpa + amount;
baroSettingInhg = baroSettingHpa / 0.03386389; baroSettingInhg = baroSettingHpa / 33.86389;
settingBaroSettingHpa.setDoubleValue(baroSettingHpa); settingBaroSettingHpa.setDoubleValue(baroSettingHpa);
settingBaroSettingInhg.setDoubleValue(baroSettingInhg); settingBaroSettingInhg.setDoubleValue(baroSettingInhg);
@ -1574,7 +1574,7 @@ var knobSmallUp = func {
} }
elsif (baroSettingUnit == pressureUnits["hPa"]) elsif (baroSettingUnit == pressureUnits["hPa"])
{ {
adjustbaroSettingHpa(0.001); adjustbaroSettingHpa(1);
} }
} }
elsif (baroTimerRunning == 0 and elsif (baroTimerRunning == 0 and
@ -1616,7 +1616,7 @@ var knobLargeUp = func {
} }
elsif (baroSettingUnit == pressureUnits["hPa"]) elsif (baroSettingUnit == pressureUnits["hPa"])
{ {
adjustbaroSettingHpa(0.1); adjustbaroSettingHpa(100);
} }
} }
elsif (baroTimerRunning == 0 and elsif (baroTimerRunning == 0 and
@ -1658,7 +1658,7 @@ var knobSmallDown = func {
} }
elsif (baroSettingUnit == pressureUnits["hPa"]) elsif (baroSettingUnit == pressureUnits["hPa"])
{ {
adjustbaroSettingHpa(-0.001); adjustbaroSettingHpa(-1);
} }
} }
elsif (baroTimerRunning == 0 and elsif (baroTimerRunning == 0 and
@ -1700,7 +1700,7 @@ var knobLargeDown = func {
} }
elsif (baroSettingUnit == pressureUnits["hPa"]) elsif (baroSettingUnit == pressureUnits["hPa"])
{ {
adjustbaroSettingHpa(-0.1); adjustbaroSettingHpa(-100);
} }
} }
elsif (baroTimerRunning == 0 and elsif (baroTimerRunning == 0 and

View file

@ -496,8 +496,8 @@ properties' values.
<type>textranslate</type> <type>textranslate</type>
<object-name>hpa-digit2</object-name> <object-name>hpa-digit2</object-name>
<property>/autopilot/KAP140/settings/baro-setting-hpa</property> <property>/autopilot/KAP140/settings/baro-setting-hpa</property>
<factor>0.1</factor> <factor>0.0001</factor>
<step>1</step> <step>1000</step>
<bias>0.0005</bias> <bias>0.0005</bias>
<axis> <axis>
<x>1</x> <x>1</x>
@ -509,8 +509,8 @@ properties' values.
<type>textranslate</type> <type>textranslate</type>
<object-name>hpa-digit3</object-name> <object-name>hpa-digit3</object-name>
<property>/autopilot/KAP140/settings/baro-setting-hpa</property> <property>/autopilot/KAP140/settings/baro-setting-hpa</property>
<factor>1</factor> <factor>0.001</factor>
<step>0.1</step> <step>100</step>
<bias>0.0005</bias> <bias>0.0005</bias>
<axis> <axis>
<x>1</x> <x>1</x>
@ -522,8 +522,8 @@ properties' values.
<type>textranslate</type> <type>textranslate</type>
<object-name>hpa-digit4</object-name> <object-name>hpa-digit4</object-name>
<property>/autopilot/KAP140/settings/baro-setting-hpa</property> <property>/autopilot/KAP140/settings/baro-setting-hpa</property>
<factor>10</factor> <factor>0.010</factor>
<step>0.01</step> <step>10</step>
<bias>0.0005</bias> <bias>0.0005</bias>
<axis> <axis>
<x>1</x> <x>1</x>
@ -535,8 +535,8 @@ properties' values.
<type>textranslate</type> <type>textranslate</type>
<object-name>hpa-digit5</object-name> <object-name>hpa-digit5</object-name>
<property>/autopilot/KAP140/settings/baro-setting-hpa</property> <property>/autopilot/KAP140/settings/baro-setting-hpa</property>
<factor>100</factor> <factor>0.100</factor>
<step>0.001</step> <step>1</step>
<bias>0.0005</bias> <bias>0.0005</bias>
<axis> <axis>
<x>1</x> <x>1</x>

View file

@ -757,7 +757,7 @@ properties' values.
<type>number-value</type> <type>number-value</type>
<property>/autopilot/KAP140/settings/baro-setting-hpa</property> <property>/autopilot/KAP140/settings/baro-setting-hpa</property>
<scale>1</scale> <scale>1</scale>
<format>%01.3f</format> <format>%04.0f</format>
</chunk> </chunk>
</chunks> </chunks>
<transformations> <transformations>
@ -1028,4 +1028,4 @@ properties' values.
</actions> </actions>
</PropertyList> </PropertyList>