Skip to content

Commit

Permalink
fixed showing value if coming from STD, fixed leaving power saving, D…
Browse files Browse the repository at this point in the history
…emo .mcc file
  • Loading branch information
elral committed Jan 14, 2024
1 parent 9584212 commit 978b532
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
4 changes: 2 additions & 2 deletions KAV_Simulation/Community/devices/kav_efis.device.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
},
{
"id": 2,
"label": "Show STD",
"description": "0 = True, 1 = False"
"label": "Show Mode",
"description": "0 = QFE, 1 = QNH, 2 or 3 = STD"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MobiflightConnector>
<outputs>
<config guid="6768a80d-bc0c-4302-8e87-2ec2bffbd45d">
<active>true</active>
<description>EFIS L - State Condition (0=QFE, 1=QNH, 3=STD)</description>
<settings msdata:InstanceType="MobiFlight.OutputConfigItem, MFConnector, Version=10.0.2.4, Culture=neutral, PublicKeyToken=null" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<source type="SimConnect" VarType="CODE" Value="(L:XMLVAR_Baro1_Mode)" UUID="08af65f2-159e-45c3-8e94-4360e88046dc" />
<test type="Integer" value="0" />
<modifiers />
<display type="CustomDevice" serial="Kav RaspiPico/ SN-E6614C311B6BBF32" trigger="normal" customType="" customName="EFIS L" messageType="2" value="$" />
<preconditions />
<configrefs />
</settings>
</config>
<config guid="c11ed66b-0a00-4cbd-9ad5-ec40e67bb1a2">
<active>true</active>
<description>EFIS L - QNH Value</description>
<settings msdata:InstanceType="MobiFlight.OutputConfigItem, MFConnector, Version=10.0.2.4, Culture=neutral, PublicKeyToken=null" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<source type="SimConnect" VarType="CODE" Value="(L:XMLVAR_Baro1_Mode) 1 &gt; if{ 99 } els{ (L:XMLVAR_Baro_Selector_HPA_1,bool) ! if{ (A:KOHLSMAN SETTING HG, inHg) } els{ (A:KOHLSMAN SETTING HG, mbar) near } }" UUID="98d91496-0202-4e60-b0cc-5157ceb25af5" />
<test type="Float" value="123" />
<modifiers>
<transformation active="True" expression="if($&lt;100, Round($, 2)*100, $)" />
</modifiers>
<display type="CustomDevice" serial="Kav RaspiPico/ SN-E6614C311B6BBF32" trigger="normal" customType="" customName="EFIS L" messageType="1" value="$" />
<preconditions>
<precondition type="config" active="true" ref="6768a80d-bc0c-4302-8e87-2ec2bffbd45d" operand="&lt;" value="2" logic="and" />
</preconditions>
<configrefs>
<configref active="True" ref="6768a80d-bc0c-4302-8e87-2ec2bffbd45d" placeholder="#" testvalue="1" />
</configrefs>
</settings>
</config>
</outputs>
<inputs />
</MobiflightConnector>
4 changes: 3 additions & 1 deletion KAV_Simulation/KAV_A3XX_EFIS_LCD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ void KAV_A3XX_EFIS_LCD::showStd()
// Show Values
void KAV_A3XX_EFIS_LCD::showValue(uint16_t value)
{
_value = value;
if (value > 9999) value = 9999;
if (value < 2000) {
// If value is less than 2000, then it's hPa, so no decimal point.
Expand Down Expand Up @@ -146,6 +145,7 @@ void KAV_A3XX_EFIS_LCD::set(int16_t messageID, char *setPoint)
if (data) {
clearLCD();
} else {
showValue((uint16_t)_value);
if (_mode == 0) {
setQFE(true);
setQNH(false);
Expand All @@ -166,9 +166,11 @@ void KAV_A3XX_EFIS_LCD::set(int16_t messageID, char *setPoint)
if (data == 0) {
setQFE(true);
setQNH(false);
showValue((uint16_t)_value);
} else if (data == 1) {
setQFE(false);
setQNH(true);
showValue((uint16_t)_value);
} else {
showStd();
}
Expand Down
2 changes: 1 addition & 1 deletion KAV_Simulation/KAV_A3XX_EFIS_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class KAV_A3XX_EFIS_LCD
byte _CS;
byte _CLK;
byte _DATA;
uint16_t _value;
uint16_t _value = 0;
uint8_t _mode;

// Methods
Expand Down

0 comments on commit 978b532

Please sign in to comment.