Post by leutnantwerner on Apr 3, 2017 2:48:23 GMT -5
Okey,
one last gauge problem I still have: The classic engine start gauge.
I ported the gauge to a switch in the MakeMdl, original code (I already removed the engine selector code!)
Here is my MakeMdl code:
<part>
<Name>switch_cv340_eng_start</Name>
<Animation>
<Parameter>
<Code> (L:Start,bool) 100 * </Code>
<Lag>400</Lag>
</Parameter>
</Animation>
<mouserect>
<cursor>Hand</cursor>
<mouse_flags>LeftSingle</mouse_flags>
<Tooltip_Text>Engine Starter</Tooltip_Text>
<callback_code>
(L:Start, bool) ! (>L:Start, bool)
(L:Start, bool) 1 == (A:Sim on Ground, bool) 1 == && if{ (L:ENGINE_SELECT, enum) (>L:Start1, enum)
(L:Start1, enum) s0
l0 1 == if{ (>K:MIXTURE1_LEAN) (L:Start RPM,enum) (>L:ENGINE1_RPM, number) 1 (>L:ENGINE1_CONTROL, bool) } els{
l0 2 == if{ (>K:MIXTURE2_LEAN) (L:Start RPM,enum) (>L:ENGINE2_RPM, number) 1 (>L:ENGINE2_CONTROL, bool) } } }
els{ 0 (>L:ENGINE1_CONTROL, bool) 0 (>L:ENGINE2_CONTROL, bool) 0 (>L:ENGINE3_CONTROL, bool) 0 (>L:ENGINE4_CONTROL, bool) }
(L:Start, bool) 1 == (A:Sim on Ground, bool) ! && if{ (L:ENGINE_SELECT, enum) (>L:Start1, enum)
(L:Start1, enum) s0
l0 1 == if{ (>K:MIXTURE1_LEAN) } els{
l0 2 == if{ (>K:MIXTURE2_LEAN) } } }
(L:Start, bool) 0 == if{ 0 (>L:Start1, enum) }
</callback_code>
</mouserect>
</part>
... and the rest of the original code as a control light at the instrument panel:
Problem is, it works only when the engine was started once before, or fails at all.
Cheers
Bernie
one last gauge problem I still have: The classic engine start gauge.
I ported the gauge to a switch in the MakeMdl, original code (I already removed the engine selector code!)
<Gauge Name="ENGINE STARTER" Version="1.0">
<Size X="113" Y="138"/>
<Element>
<Position X="20" Y="78"/>
<Select>
<Value> (L:Start,bool) </Value>
<Case Value="0">
<Image Name="switch2_off.bmp" ImageSizes="12,45"/>
</Case>
<Case Value="1">
<Image Name="switch2_on.bmp" ImageSizes="12,45"/>
</Case>
</Select>
</Element>
<Element>
<Position X="52" Y="78"/>
<Select>
<Value> (L:Start,bool) </Value>
<Case Value="0">
<Image Name="switch2_off.bmp" ImageSizes="12,45"/>
</Case>
<Case Value="1">
<Image Name="switch2_on.bmp" ImageSizes="12,45"/>
</Case>
</Select>
</Element>
<Element>
<Position X="84" Y="78"/>
<Select>
<Value> (L:Start,bool) </Value>
<Case Value="0">
<Image Name="switch2_off.bmp" ImageSizes="12,45"/>
</Case>
<Case Value="1">
<Image Name="switch2_on.bmp" ImageSizes="12,45"/>
</Case>
</Select>
</Element>
<!-- needed when no RPM Control gauge, but not when present -->
<Element>
<Select>
<Value>
(L:Start1, enum) s0
l0 1 == (L:ENGINE_CONTROL_LOADED, bool) ! && if{ 1 (>K:MAGNETO1_INCR) } els{
l0 2 == (L:ENGINE_CONTROL_LOADED, bool) ! && if{ 1 (>K:MAGNETO2_INCR) } }
</Value>
</Select>
</Element>
<Element>
<Select>
<Value>
(L:Start1, enum) s0
l0 1 == (A:General Eng1 Combustion, bool) 1 == && if{ 0 (>L:Start, bool) 0 (>L:Start1, enum) } els{
l0 2 == (A:General Eng2 Combustion, bool) 1 == && if{ 0 (>L:Start, bool) 0 (>L:Start1, enum) } }
</Value>
</Select>
</Element>
<Mouse>
<Tooltip>Engine Starter</Tooltip>
<Cursor Type="Hand"/>
<Click Repeat="Yes"> (L:Start, bool) ! (>L:Start, bool)
(L:Start, bool) 1 == (A:Sim on Ground, bool) 1 == && if{ (L:ENGINE_SELECT, enum) (>L:Start1, enum)
(L:Start1, enum) s0
l0 1 == if{ (>K:MIXTURE1_LEAN) (L:Start RPM,enum) (>L:ENGINE1_RPM, number) 1 (>L:ENGINE1_CONTROL, bool) } els{
l0 2 == if{ (>K:MIXTURE2_LEAN) (L:Start RPM,enum) (>L:ENGINE2_RPM, number) 1 (>L:ENGINE2_CONTROL, bool) } } }
els{ 0 (>L:ENGINE1_CONTROL, bool) 0 (>L:ENGINE2_CONTROL, bool) 0 (>L:ENGINE3_CONTROL, bool) 0 (>L:ENGINE4_CONTROL, bool) }
(L:Start, bool) 1 == (A:Sim on Ground, bool) ! && if{ (L:ENGINE_SELECT, enum) (>L:Start1, enum)
(L:Start1, enum) s0
l0 1 == if{ (>K:MIXTURE1_LEAN) } els{
l0 2 == if{ (>K:MIXTURE2_LEAN) } } }
(L:Start, bool) 0 == if{ 0 (>L:Start1, enum) }
</Click>
</Mouse>
</Gauge>
<Size X="113" Y="138"/>
<Element>
<Position X="20" Y="78"/>
<Select>
<Value> (L:Start,bool) </Value>
<Case Value="0">
<Image Name="switch2_off.bmp" ImageSizes="12,45"/>
</Case>
<Case Value="1">
<Image Name="switch2_on.bmp" ImageSizes="12,45"/>
</Case>
</Select>
</Element>
<Element>
<Position X="52" Y="78"/>
<Select>
<Value> (L:Start,bool) </Value>
<Case Value="0">
<Image Name="switch2_off.bmp" ImageSizes="12,45"/>
</Case>
<Case Value="1">
<Image Name="switch2_on.bmp" ImageSizes="12,45"/>
</Case>
</Select>
</Element>
<Element>
<Position X="84" Y="78"/>
<Select>
<Value> (L:Start,bool) </Value>
<Case Value="0">
<Image Name="switch2_off.bmp" ImageSizes="12,45"/>
</Case>
<Case Value="1">
<Image Name="switch2_on.bmp" ImageSizes="12,45"/>
</Case>
</Select>
</Element>
<!-- needed when no RPM Control gauge, but not when present -->
<Element>
<Select>
<Value>
(L:Start1, enum) s0
l0 1 == (L:ENGINE_CONTROL_LOADED, bool) ! && if{ 1 (>K:MAGNETO1_INCR) } els{
l0 2 == (L:ENGINE_CONTROL_LOADED, bool) ! && if{ 1 (>K:MAGNETO2_INCR) } }
</Value>
</Select>
</Element>
<Element>
<Select>
<Value>
(L:Start1, enum) s0
l0 1 == (A:General Eng1 Combustion, bool) 1 == && if{ 0 (>L:Start, bool) 0 (>L:Start1, enum) } els{
l0 2 == (A:General Eng2 Combustion, bool) 1 == && if{ 0 (>L:Start, bool) 0 (>L:Start1, enum) } }
</Value>
</Select>
</Element>
<Mouse>
<Tooltip>Engine Starter</Tooltip>
<Cursor Type="Hand"/>
<Click Repeat="Yes"> (L:Start, bool) ! (>L:Start, bool)
(L:Start, bool) 1 == (A:Sim on Ground, bool) 1 == && if{ (L:ENGINE_SELECT, enum) (>L:Start1, enum)
(L:Start1, enum) s0
l0 1 == if{ (>K:MIXTURE1_LEAN) (L:Start RPM,enum) (>L:ENGINE1_RPM, number) 1 (>L:ENGINE1_CONTROL, bool) } els{
l0 2 == if{ (>K:MIXTURE2_LEAN) (L:Start RPM,enum) (>L:ENGINE2_RPM, number) 1 (>L:ENGINE2_CONTROL, bool) } } }
els{ 0 (>L:ENGINE1_CONTROL, bool) 0 (>L:ENGINE2_CONTROL, bool) 0 (>L:ENGINE3_CONTROL, bool) 0 (>L:ENGINE4_CONTROL, bool) }
(L:Start, bool) 1 == (A:Sim on Ground, bool) ! && if{ (L:ENGINE_SELECT, enum) (>L:Start1, enum)
(L:Start1, enum) s0
l0 1 == if{ (>K:MIXTURE1_LEAN) } els{
l0 2 == if{ (>K:MIXTURE2_LEAN) } } }
(L:Start, bool) 0 == if{ 0 (>L:Start1, enum) }
</Click>
</Mouse>
</Gauge>
Here is my MakeMdl code:
<part>
<Name>switch_cv340_eng_start</Name>
<Animation>
<Parameter>
<Code> (L:Start,bool) 100 * </Code>
<Lag>400</Lag>
</Parameter>
</Animation>
<mouserect>
<cursor>Hand</cursor>
<mouse_flags>LeftSingle</mouse_flags>
<Tooltip_Text>Engine Starter</Tooltip_Text>
<callback_code>
(L:Start, bool) ! (>L:Start, bool)
(L:Start, bool) 1 == (A:Sim on Ground, bool) 1 == && if{ (L:ENGINE_SELECT, enum) (>L:Start1, enum)
(L:Start1, enum) s0
l0 1 == if{ (>K:MIXTURE1_LEAN) (L:Start RPM,enum) (>L:ENGINE1_RPM, number) 1 (>L:ENGINE1_CONTROL, bool) } els{
l0 2 == if{ (>K:MIXTURE2_LEAN) (L:Start RPM,enum) (>L:ENGINE2_RPM, number) 1 (>L:ENGINE2_CONTROL, bool) } } }
els{ 0 (>L:ENGINE1_CONTROL, bool) 0 (>L:ENGINE2_CONTROL, bool) 0 (>L:ENGINE3_CONTROL, bool) 0 (>L:ENGINE4_CONTROL, bool) }
(L:Start, bool) 1 == (A:Sim on Ground, bool) ! && if{ (L:ENGINE_SELECT, enum) (>L:Start1, enum)
(L:Start1, enum) s0
l0 1 == if{ (>K:MIXTURE1_LEAN) } els{
l0 2 == if{ (>K:MIXTURE2_LEAN) } } }
(L:Start, bool) 0 == if{ 0 (>L:Start1, enum) }
</callback_code>
</mouserect>
</part>
... and the rest of the original code as a control light at the instrument panel:
<Gauge Name="test_start_light" Version="1.0">
<Element>
<Select>
<Value>(L:Start,bool)</Value>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0" />
</Failures>
<Case Value="0">
<Image Name="Light_Off_Red.bmp" ImageSizes="142,142" />
</Case>
<Case Value="1">
<Image Name="Light_On_Red.bmp" Bright="Yes" ImageSizes="142,142" />
</Case>
</Select>
</Element>
<!-- needed when no RPM Control gauge, but not when present -->
<Element>
<Select>
<Value>
(L:Start1, enum) s0
l0 1 == (L:ENGINE_CONTROL_LOADED, bool) ! && if{ 1 (>K:MAGNETO1_INCR) } els{
l0 2 == (L:ENGINE_CONTROL_LOADED, bool) ! && if{ 1 (>K:MAGNETO2_INCR) } }
</Value>
</Select>
</Element>
<Element>
<Select>
<Value>
(L:Start1, enum) s0
l0 1 == (A:General Eng1 Combustion, bool) 1 == && if{ 0 (>L:Start, bool) 0 (>L:Start1, enum) } els{
l0 2 == (A:General Eng2 Combustion, bool) 1 == && if{ 0 (>L:Start, bool) 0 (>L:Start1, enum) } }
</Value>
</Select>
</Element>
<Mouse>
<Tooltip>Engine Start Fire Test LH</Tooltip>
</Mouse>
</Gauge>
<Element>
<Select>
<Value>(L:Start,bool)</Value>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0" />
</Failures>
<Case Value="0">
<Image Name="Light_Off_Red.bmp" ImageSizes="142,142" />
</Case>
<Case Value="1">
<Image Name="Light_On_Red.bmp" Bright="Yes" ImageSizes="142,142" />
</Case>
</Select>
</Element>
<!-- needed when no RPM Control gauge, but not when present -->
<Element>
<Select>
<Value>
(L:Start1, enum) s0
l0 1 == (L:ENGINE_CONTROL_LOADED, bool) ! && if{ 1 (>K:MAGNETO1_INCR) } els{
l0 2 == (L:ENGINE_CONTROL_LOADED, bool) ! && if{ 1 (>K:MAGNETO2_INCR) } }
</Value>
</Select>
</Element>
<Element>
<Select>
<Value>
(L:Start1, enum) s0
l0 1 == (A:General Eng1 Combustion, bool) 1 == && if{ 0 (>L:Start, bool) 0 (>L:Start1, enum) } els{
l0 2 == (A:General Eng2 Combustion, bool) 1 == && if{ 0 (>L:Start, bool) 0 (>L:Start1, enum) } }
</Value>
</Select>
</Element>
<Mouse>
<Tooltip>Engine Start Fire Test LH</Tooltip>
</Mouse>
</Gauge>
Problem is, it works only when the engine was started once before, or fails at all.
Cheers
Bernie