- Messages
- 1,468
- Country

In conjunction with my other thread http://www.fsdeveloper.com/forum/threads/switching-between-generator-voltages.441526/
http://www.fsdeveloper.com/forum/threads/switching-between-generator-voltages.441526/
I really cannot understand why this code is not working. There are four generators, gens 3 and 4 work perfectly with this code but gens 1 & 2 do not. They refuse. The code for them is "exactly" the same and there is no spurious code elsewhere. I'm using black box so I also know that (L:Electrical genalt1 bus voltage,volts) and (L:Electrical genalt2 bus voltage,volts) carry the correct values. It seems that the sim is happy indeed to transfer the values from gens3 and 4 to (L:AC_volts,volts) but for some inexplicable reason refuses to do so for gens 1 and 2. I cannot see anything wrong at all. I thought that a gauge a day would keep the doctor away but this is making me spend more time in bed than I need. The chemo is bad enough but this takes the biscuit.
Here is the offending gauge.
http://www.fsdeveloper.com/forum/threads/switching-between-generator-voltages.441526/
I really cannot understand why this code is not working. There are four generators, gens 3 and 4 work perfectly with this code but gens 1 & 2 do not. They refuse. The code for them is "exactly" the same and there is no spurious code elsewhere. I'm using black box so I also know that (L:Electrical genalt1 bus voltage,volts) and (L:Electrical genalt2 bus voltage,volts) carry the correct values. It seems that the sim is happy indeed to transfer the values from gens3 and 4 to (L:AC_volts,volts) but for some inexplicable reason refuses to do so for gens 1 and 2. I cannot see anything wrong at all. I thought that a gauge a day would keep the doctor away but this is making me spend more time in bed than I need. The chemo is bad enough but this takes the biscuit.
Here is the offending gauge.
Code:
<Gauge Name="AC Selector Switch" Version="1.0">
<Element>
<Select>
<Value>(G:Var1)</Value>
<Case Value="0">
<Image Name="Gen_sel_sw_4.bmp"/>
</Case>
<Case Value="1">
<Image Name="Gen_sel_sw_5.bmp"/>
</Case>
<Case Value="2">
<Image Name="Gen_sel_sw_6.bmp"/>
</Case>
<Case Value="3">
<Image Name="Gen_sel_sw_3.bmp"/>
</Case>
<Case Value="4">
<Image Name="Gen_sel_sw_2.bmp"/>
</Case>
<Case Value="5">
<Image Name="Gen_sel_sw_1.bmp"/>
</Case>
</Select>
</Element>
<Element>
<Select>
<Value>(G:Var1) 0 == (L:Electrical genalt2 bus voltage,volts) (L:AC_volts,volts) != and
if{ 0 (>G:Var1) (L:Electrical genalt2 bus voltage,volts) (>L:AC_volts,volts) 405 (>L:Herz,number) 1 (>L:check1,bool) }</Value>
</Select>
</Element>
<Element>
<Select>
<Value>(G:Var1) 1 == (L:Electrical genalt1 bus voltage,volts) (L:AC_volts,volts) != and
if{ 1 (>G:Var1) (L:Electrical genalt1 bus voltage,volts) (>L:AC_volts,volts) 405 (>L:Herz,number) 1 (>L:check2,bool) }</Value>
</Select>
</Element>
<Element>
<Select>
<Value>(G:Var1) 2 == (L:Gnd_Power_avail,bool) (L:AC_volts,volts) != and
if{ 2 (>G:Var1) 120 (>L:AC_volts,volts) 405 (>L:Herz,number) 1 (>L:check3,bool) } (L:Gnd_Power_avail,bool) 0 ==
if{ 0 (>L:AC_volts,volts) }</Value>
</Select>
</Element>
<Element>
<Select>
<Value>(G:Var1) 3 == (L:Electrical genalt3 bus voltage,volts) (L:AC_volts,volts) != and
if{ 3 (>G:Var1) (L:Electrical genalt3 bus voltage,volts) (>L:AC_volts,volts) 405 (>L:Herz,number) 1 (>L:check4,bool) }</Value>
</Select>
</Element>
<Element>
<Select>
<Value>(G:Var1) 4 == (L:Electrical genalt4 bus voltage,volts) (L:AC_volts,volts) != and
if{ 4 (>G:Var1) (L:Electrical genalt4 bus voltage,volts) (>L:AC_volts,volts) 1 (>L:check5,bool) }</Value>
</Select>
</Element>
<Element>
<Select>
<Value>(G:Var1) 5 == (L:ELRAT_Power_avail,bool) (L:AC_volts,volts) != and
if{ 5 (>G:Var1) 120 (>L:AC_volts,volts) 405 (>L:Herz,number) 1 (>L:check6,bool) }</Value>
</Select>
</Element>
<Mouse>
<Tooltip>AC Selector Switch</Tooltip>
<Area Left="0" Top="0" Width="281" Height="190">
<Cursor Type="Hand"/>
<Click>0 (>G:Var1) 1 (>L:Sound_click,enum) 0 (>L:AC_volts,volts) (L:E2GEN_running,bool) 1 ==
if{ (L:Electrical genalt2 bus voltage,volts) (>L:AC_volts,volts) 4 (>L:needle flicker2, volts) (L:check1,bool) 1 ==
if{ 0 (>L:check1,bool) } }</Click>
</Area>
<Area Left="0" Top="191" Width="281" Height="190">
<Cursor Type="Hand"/>
<Click>1 (>G:Var1) 1 (>L:Sound_click,enum) 0 (>L:AC_volts,volts) (L:E1GEN_running,bool) 1 ==
if{ (L:Electrical genalt1 bus voltage,volts) (>L:AC_volts,volts) 4 (>L:needle flicker2, volts) (L:check2,bool) 1 ==
if{ 0 (>L:check2,bool) } }</Click>
</Area>
<Area Left="0" Top="382" Width="281" Height="190">
<Cursor Type="Hand"/>
<Click>2 (>G:Var1) 1 (>L:Sound_click,enum) 0 (>L:AC_volts,volts) (L:Gnd_Power_avail,bool) 1 ==
if{ 120 (>L:AC_volts,volts) 7 (>L:needle flicker2, volts) (L:check3,bool) 1 ==
if{ 0 (>L:check3,bool) } }</Click>
</Area>
<Area Left="282" Top="0" Width="280" Height="190">
<Cursor Type="Hand"/>
<Click>3 (>G:Var1) 1 (>L:Sound_click,enum) 0 (>L:AC_volts,volts) (L:E3GEN_running,bool) 1 ==
if{ (L:Electrical genalt3 bus voltage,volts) (>L:AC_volts,volts) 4 (>L:needle flicker2, volts) (L:check4,bool) 1 ==
if{ 0 (>L:check4,bool) } }</Click>
</Area>
<Area Left="282" Top="191" Width="280" Height="190">
<Cursor Type="Hand"/>
<Click>4 (>G:Var1) 1 (>L:Sound_click,enum) 0 (>L:AC_volts,volts) (L:E4GEN_running,bool) 1 ==
if{ (L:Electrical genalt4 bus voltage,volts) (>L:AC_volts,volts) 5 (>L:needle flicker2, volts) (L:check5,bool) 1 ==
if{ 0 (>L:check5,bool) } }</Click>
</Area>
<Area Left="282" Top="382" Width="280" Height="190">
<Cursor Type="Hand"/>
<Click>5 (>G:Var1) 1 (>L:Sound_click,enum) 0 (>L:AC_volts,volts) (L:ELRAT_Power_avail,bool) 1 ==
if{ 120 (>L:AC_volts,volts) 7 (>L:needle flicker2, volts) (L:check6,bool) 1 ==
if{ 0 (>L:check6,bool) } }</Click>
</Area>
</Mouse>
</Gauge>