Creating ADF Panel Help

(1/1)

Avsim:
I face some complicated task. I need to make the ADF Loop Antenna Control Switch ("Knob position" gauge - see below) work for 3 ADF modes switched by ADF Mode Selector ("RotatingKnob" gauge - see below): the main COMP (compass) mode; ANT (nondirectional antenna) mode; and the LOOP (loop antenna) mode.

The Cold Dark ADF panel:
http://harrierpanels.avsim.ru/XML/adf_cold_dark.html

Old ADF receivers have several operating modes that the pilot can select. In the COMP mode, both the loop and the sense antennas are used, the pointer is activated, and the ADF tries to point to the station. (This is the normal mode of operation.) Switching the loop antenna control switch to either left or right position will cause the loop antenna and pointer to move left or right. Releasing the switch causes the loop antenna and pointer to rotate and point to
the station again.

The ADF COMP Mode:
http://harrierpanels.avsim.ru/XML/adf_comp_mode.html

I added some code to the "Knob position" gauge but it does not seem to work properly By switching the Loop Antenna Control Switch to the left or right position it does make the RMI pointer or needle rotate accordingly but when the ADF catches the station it doesn't work. Now the "Knob position" gauge looks like this:

<!-- ADF Loop Antenna Control Switch -->

<Element>
<Position X="XXX" Y="YYY"/>
<Image Name="Knobxx.bmp" Luminous="Yes" ImageSizes="XX,YY,xx,yy">
<Axis X="XX" Y="YY"/>
</Image>
<Rotate>
<Value> L:Knob position,enum)</Value>
<Nonlinearity>
<Item Value="-1" Degrees="-20"/>
<Item Value="0" Degrees="0"/>
<Item Value="1" Degrees="20"/>
</Nonlinearity>
</Rotate>
</Element>

<Area Top="XXX" Left="YYY" Width="XX" Height="YY">
<Cursor Type="Downarrow"/>
<Tooltip ID="">ADF Loop Antenna Control Switch: Rotate Left</Tooltip>
<Click Kind="LeftSingle+Leave">
(M:Event) 'LeftSingle' scmp 0 ==
if{ (L:Knob position,enum) -1 != (>L:dsd_xml_sound_id_05,number) -1 (>L:Knob position,enum) }
(M:Event) 'Leave' scmp 0 ==
if{ (L:Knob position,enum) 0 != (>L:dsd_xml_sound_id_06,number) 0 (>L:Knob position,enum) }

<!-- the added code -->

(L:Var7, number) 1 - s0
0 < if{ 359 } els{ l0 }
(>L:Var7, number)

</Click>
</Area>

<Area Top="XXX" Left="YYY" Width="XX" Height="YY">
<Cursor Type="Uparrow"/>
<Tooltip ID="">ADF Loop Antenna Control Switch: Rotate Right</Tooltip>
<Click Kind="LeftSingle+Leave">
(M:Event) 'LeftSingle' scmp 0 ==
if{ (L:Knob position,enum) 1 != (>L:dsd_xml_sound_id_05,number) 1 (>L:Knob position,enum) }
(M:Event) 'Leave' scmp 0 ==
if{ (L:Knob position,enum) 0 != (>L:dsd_xml_sound_id_06,number) 0 (>L:Knob position,enum) }

<!-- the added code -->

(L:Var7, number) 1 +
360 %
(>L:Var7, number)

</Click>
</Area>

<!-- ADF Loop Antenna Control Switch -->

The gauge is supposed to work in connection with the "RotatingKnob" gauge, ADF Signal Strength gauge,
and the RMI gauge provided that the Main Battery is on: (A:Electrical master battery,bool) (or there's a power
from the generator (A:General ENG1 Generator Active,bool)), Avionics is on: (A:Avionics master switch,bool),
ADF Power is on: (L:ADFPower, bool), and the ADF Mode Selector is in any of the 3 positions except OFF:
(L:RotatingKnob,enum) 0 >. The gauges' codes are below:

<!-- ADF Mode Selector -->

<Element>
<Position X="XXX" Y="YYY"/>
<Image Name="Knobxx.bmp" Luminous="Yes" ImageSizes="XX,YY,xx,yy">
<Axis X="XX" Y="YY"/>
</Image>
<Rotate>
<Value Minimum="0" Maximum="90"> L:RotatingKnob,enum)</Value>
<Nonlinearity>
<Item Value="0" Degrees="-45"/>
<Item Value="2" Degrees="15"/>
<Item Value="3" Degrees="45"/>
</Nonlinearity>
<Delay DegreesPerSecond="190"/>
</Rotate>
</Element>

<Area Top="XX" Left="YY" Width="xx" Height="yy">
<Cursor Type="Downarrow"/>
<Tooltip ID="">ADF Mode Selector</Tooltip>
<Click Repeat="Yes">
(L:RotatingKnob,enum) 0 >
if{ 1 (>L:dsd_xml_sound_id_04,number) }
(L:RotatingKnob,enum) -- 0 max (>L:RotatingKnob,enum)
</Click>
</Area>

<Area Top="XX" Left="YY" Width="xx" Height="yy">
<Cursor Type="Uparrow"/>
<Tooltip ID="">ADF Mode Selector</Tooltip>
<Click Repeat="Yes">
(L:RotatingKnob,enum) 3 <
if{ 1 (>L:dsd_xml_sound_id_03,number) }
(L:RotatingKnob,enum) ++ 3 min (>L:RotatingKnob,enum)
</Click>
</Area>

<!-- ADF Mode Selector -->

------------------------------------------------------

<!-- ADF Signal Strength Gauge -->

<Element>
<Position X="XXX" Y="YYY"/>
<Image Name="Signal_Strength_IND_needle.bmp" ImageSizes="XX,YY,xx,yy">
<Axis X="XXX" Y="YYY"/>
</Image>
<Rotate>
<Value> A:Electrical master battery,bool) if{ (L:ADFPower, bool) (L:RotatingKnob,enum) && if{ (A:Adf signal:1,number) 200000 min } els{ 0 } }
(A:General ENG1 Generator Active,bool) if{ (L:ADFPower, bool) (L:RotatingKnob,enum) && if{ (A:Adf signal:1,number) 200000 min } els{ 0 } }
</Value>
<!-- Roughly an exponential nonlinearity assuming that signal strength -->
<!-- is based on transmitter power and the square of the distance to the transmitter -->
<!-- Each breakpoint is a tick on the meter from left to right -->
<Nonlinearity>
<Item Value="0" Degrees="-45"/>
<Item Value="1000" Degrees="-30"/>
<Item Value="2500" Degrees="-15"/>
<Item Value="7500" Degrees="-0"/>
<Item Value="25000" Degrees="15"/>
<Item Value="67500" Degrees="30"/>
<Item Value="200000" Degrees="45"/>
</Nonlinearity>
<Delay DegreesPerSecond="90"/>
</Rotate>
</Element>

<!-- ADF Signal Strength Gauge -->

------------------------------------------------------

<!-- RMI Gauge -->

<Image Name="ADF1.bmp" Luminous="Yes" ImageSizes="XX,YY,xx,yy">
<Element>
<Select>
<Value> A:ADF Signal:1,bel) ! if{ (L:Var7, number) (L:Var3, number) + (>L:Var7, number) (L:Var7, number) 20 (P:Absolute time,minutes) 60 % + > if{ -0.05 (>L:Var3, number) } (L:Var7, number) (A lane heading degrees gyro,degrees) /-/ < if{ (P:Absolute time,seconds) 60 % 200 / (>L:Var3, number) } } els{ 0 (>L:Var7, number) }
(L:Var9, number) 0 == if{ 0.1 (>L:Var3, number) -0.4 (>L:Var4, number) 1 (>L:Var9, number) }</Value>
</Select>
</Element>

<Element>
<Position X="XXX" Y="YYY"/>
<Image Name="RMI_needle.bmp" Luminous="Yes" ImageSizes="XX,YY,xx,yy">
<Axis X="XX" Y="YY"/>
</Image>
<Rotate>
<Value> A:Electrical master battery,bool) if{ (L:ADFPower, bool) (L:RotatingKnob,enum) && if{ (A:ADF Radial:1,radians) (L:Var7, number) 20 / + } els{ 0 } }
(A:General ENG1 Generator Active,bool) if{ (L:ADFPower, bool) (L:RotatingKnob,enum) && if{ (A:ADF Radial:1,radians) (L:Var7, number) 20 / + } els{ 0 } }
</Value>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="Freeze"/>
<SYSTEM_ELECTRICAL_AVIONICS Action="Freeze"/>
<GAUGE_GYRO_HEADING Action="Freeze"/>
<GAUGE_ADF Action="Freeze"/>
</Failures>
<Delay DegreesPerSecond="90"/>
</Rotate>
</Element>
<Mouse>

<!-- RMI Gauge -->

------------------------------------------------------

In the ANT mode, the loop antenna is disabled and all receiving is done through the sense antenna. I guess the RMI pointer will move (or won't? ) if you switch the loop antenna control switch left or right and stay where you leave it but it has no use for the antenna. (This is the best mode for listening to your favorite ball game.) It is also good for identifying the station. Thus, for this mode I need a code to be added to the "Knob position" gauge (and the RMI gauge) that will cause the RMI pointer to rotate with the help of the loop antenna control switch and to freeze where you leave it (when you release the loop antenna control switch).

The ADF LOOP Mode:
http://harrierpanels.avsim.ru/XML/adf_loop_mode.html

If the LOOP mode is selected, the sense antenna is disabled and all the receiving is done through the loop antenna. Switching the loop antenna control switch to either left or right position will cause the loop antenna and pointer to rotate in the selected direction for as long as the switch is held. Releasing the control switch causes the loop antenna and pointer to stay where it is. You may also notice that the reception gets better when the pointer is 90 degrees away from the station and worse when the pointer is either pointed directly at or 180 degrees away from the station. As to the Signal Strength Indicator in the LOOP mode when the pointer and the loop antenna point directly to the NDB station I guess the signal strength indicator needle will indicate the minimum signal strenght. That's it. I need a code for this mode as well (in connection with the Signal Strength Indicator needle if possible) and would love to hear your ideas!

Navigation

Up one level