XML ADF gauge programming

N101ST

Charter Member
Hello! Hope I might get some help. Been a long time since I have done any xml gauges!

I found an error in my Spartan Executive ADF gauge. I had essentially copied and chopped up the DC3 radio code, (ADF section) in order to use the dial window and frequency range knob for the Bendix ADF-T-12C radio I made. It looks like the error is in the original DC3 code and I have been plinking around trying to fix it with no success! Everything I have tried makes the gauge disappear!

There appears to be no ADF frequencies between 420 and 490! (I just learned this trying to tune the Lincolnton NDB IZN (432 KHz) I see it in the code but I have pretty much forgotten about all knowlege I had on RPN!

Where I see at least part of the error...

from the DC3 Radio, ADF1 MOUSE Section (red show what i percieve to be the discrepancies)

...
(L:ADF1Frequency,kilohertz) 0.5 - (>L:ADF1Frequency,kilohertz)
(** if Band == 0 Wrap at 190 to 100 **)
(** if Band == 1 Wrap at 420 to 190 **)
(** if Band == 2 Wrap at 970 to 490 **)
(** if Band == 3 Wrap at 1700 to 970 **)
(L:ADF1BandSelectorKnob,enum) 0 == if{ (L:ADF1Frequency,kilohertz) 100 < if{ 189.5 (>L:ADF1Frequency,kilohertz) } g0 }
(L:ADF1BandSelectorKnob,enum) 1 == if{ (L:ADF1Frequency,kilohertz) 190 < if{ 420 (>L:ADF1Frequency,kilohertz) } g0 }
(L:ADF1BandSelectorKnob,enum) 2 == if{ (L:ADF1Frequency,kilohertz) 490 < if{ 969.5 (>L:ADF1Frequency,kilohertz) } g0 }
(L:ADF1BandSelectorKnob,enum) 3 == if{ (L:ADF1Frequency,kilohertz) 970 < if{ 1700 (>L:ADF1Frequency,kilohertz) } }
...

next section...

...
(** if Band == 0 Wrap at 190 to 100 **)
(** if Band == 1 Wrap at 420 to 190 **)
(** if Band == 2 Wrap at 970 to 490 **)
(** if Band == 3 Wrap at 1700 to 970 **)
(L:ADF1BandSelectorKnob,enum) 0 == if{ (L:ADF1Frequency,kilohertz) 189.5 > if{ 100 (>L:ADF1Frequency,kilohertz) } g0 }
(L:ADF1BandSelectorKnob,enum) 1 == if{ (L:ADF1Frequency,kilohertz) 420 > if{ 190 (>L:ADF1Frequency,kilohertz) } g0 }
(L:ADF1BandSelectorKnob,enum) 2 == if{ (L:ADF1Frequency,kilohertz) 969.5 > if{ 490 (>L:ADF1Frequency,kilohertz) } g0 }
(L:ADF1BandSelectorKnob,enum) 3 == if{ (L:ADF1Frequency,kilohertz) 1700 > if{ 970 (>L:ADF1Frequency,kilohertz) } }

:0
...

and finally...

...
(L:ADF2BandSelectorKnob,enum) -- s0 0 < if{ 3 } els{ l0 } d d d d (>L:ADF2BandSelectorKnob,enum)
(** Jump Frequency **)
0 == if{ (L:ADF2Frequency,kilohertz) 190 - 0.00436 * 90 * 100 + near (>L:ADF2Frequency,kilohertz) g0 }
1 == if{ (L:ADF2Frequency,kilohertz) 490 - 0.00208 * 230 * 190 + near (>L:ADF2Frequency,kilohertz) g0 }
2 == if{ (L:ADF2Frequency,kilohertz) 970 - 0.00137 * 480 * 490 + near (>L:ADF2Frequency,kilohertz) g0 }
3 == if{ (L:ADF2Frequency,kilohertz) 100 - 0.01111 * 730 * 970 + near (>L:ADF2Frequency,kilohertz) }
:0


I went in and was changing all the 490 values to 420 (or 419.9 when I thought I should!) But Im pretty sure there is something in the math in this last section that Im not doing that is making the gauge not work.

Odd, the original DC3 bitmap shows the 4 selectable ranges as... 100 to 190 ... 190 to 420 ... 490 to 970... 970 to 1700

Any help with this is greatly appreciated
 
I had the same problem with a MN26c Bendix radio for a P61 black Widow (have a look in the warbirds library) . Only three bands and a range 190-1500 but it fonctions not really good.
My program is the following one:

<!-- ADF 1 Band Selector Knob -->
-<Area Height="25" Width="38" Top="150" Left="120">
<Tooltip ID="TOOLTIPTEXT_ADF1_BAND_SELECTOR"/>
-<Area Right="19">
<Cursor Type="DownArrow"/>


<Click>(L:ADF1BandSelectorKnob,enum) -- s0 0 < if{ 2 } els{ l0 } (>L:ADF1BandSelectorKnob,enum)(** Jump Frequency **)(L:ADF1BandSelectorKnob,enum) 0 == if{ (L:ADF1Frequency,kilohertz) 325 - 0.00208 * 175 * 150 + near (>L:ADF1Frequency,kilohertz) g0 }(L:ADF1BandSelectorKnob,enum) 1 == if{ (L:ADF1Frequency,kilohertz) 695 - 0.00137 * 370 * 325 + near (>L:ADF1Frequency,kilohertz) g0 }(L:ADF1BandSelectorKnob,enum) 2 == if{ (L:ADF1Frequency,kilohertz) 150 - 0.01111 * 805 * 695 + near (>L:ADF1Frequency,kilohertz) }:0(* Convert to BCD 32 *)(L:ADF1Frequency,Frequency ADF BCD32) (>K:ADF_COMPLETE_SET) </Click>


</Area>
-<Area Left="18">
<Cursor Type="UpArrow"/>


<Click>(L:ADF1BandSelectorKnob,enum) ++ 4 % (>L:ADF1BandSelectorKnob,enum)(** Jump Frequency **)(L:ADF1BandSelectorKnob,enum) 0 == if{ (L:ADF1Frequency,kilohertz) 695 - 0.00137 * 175 * 150 + near (>L:ADF1Frequency,kilohertz) g0 }(L:ADF1BandSelectorKnob,enum) 1 == if{ (L:ADF1Frequency,kilohertz) 150 - 0.01111 * 370 * 325 + near (>L:ADF1Frequency,kilohertz) g0 }(L:ADF1BandSelectorKnob,enum) 2 == if{ (L:ADF1Frequency,kilohertz) 325 - 0.00208 * 805 * 695 + near (>L:ADF1Frequency,kilohertz) }:0(* Convert to BCD 32 *)(L:ADF1Frequency,Frequency ADF BCD32) (>K:ADF_COMPLETE_SET) </Click>


</Area>


</Area>


<!-- ADF 1 Freq Dial Window -->
-<Area Height="50" Width="50" Top="23" Left="140">
<Tooltip ID="TOOLTIPTEXT_ADF1_FREQ"/>
</Area>
<!-- ADF 1 Freq Tuning Knob -->
-<Area Height="30" Width="26" Top="300" Left="125">
<Tooltip ID="TOOLTIPTEXT_ADF1_FREQ"/>


-<Area Right="13">
<Cursor Type="DownArrow"/>


<Click Repeat="Yes">(** Make the knob rotate through 360 degrees **)(L:ADF1KnobRotation,degrees) 10 - s0 0 < if{ 359 } els{ l0 } (>L:ADF1KnobRotation,degrees)(L:ADF1Frequency,kilohertz) 0.5 - (>L:ADF1Frequency,kilohertz)(** if Band == 0 Wrap at 325 to 150 **)(** if Band == 1 Wrap at 695 to 325 **)(** if Band == 2 Wrap at 1500 to 695 **)(L:ADF1BandSelectorKnob,enum) 0 == if{ (L:ADF1Frequency,kilohertz) 150 < if{ 324.5 (>L:ADF1Frequency,kilohertz) } g0 }(L:ADF1BandSelectorKnob,enum) 1 == if{ (L:ADF1Frequency,kilohertz) 325 < if{ 694.5 (>L:ADF1Frequency,kilohertz) } g0 }(L:ADF1BandSelectorKnob,enum) 2 == if{ (L:ADF1Frequency,kilohertz) 695 < if{ 1500 (>L:ADF1Frequency,kilohertz) } }:0(* Convert to BCD 32 *)(L:ADF1Frequency,Frequency ADF BCD32) (>K:ADF_COMPLETE_SET) </Click>


</Area>


-<Area Left="14">
<Cursor Type="UpArrow"/>


<Click Repeat="Yes">(** Make the knob rotate through 360 degrees **)(L:ADF1KnobRotation,degrees) 10 + 360 % (>L:ADF1KnobRotation,degrees)(L:ADF1Frequency,kilohertz) 0.5 + (>L:ADF1Frequency,kilohertz)(** if Band == 0 Wrap at 325 to 150 **)(** if Band == 1 Wrap at 695 to 325 **)(** if Band == 2 Wrap at 1500 to 695 **)(L:ADF1BandSelectorKnob,enum) 0 == if{ (L:ADF1Frequency,kilohertz) 324.5 > if{ 150 (>L:ADF1Frequency,kilohertz) } g0 }(L:ADF1BandSelectorKnob,enum) 1 == if{ (L:ADF1Frequency,kilohertz) 694.5 > if{ 325 (>L:ADF1Frequency,kilohertz) } g0 }(L:ADF1BandSelectorKnob,enum) 2 == if{ (L:ADF1Frequency,kilohertz) 1500 > if{ 695 (>L:ADF1Frequency,kilohertz) } }:0(* Convert to BCD 32 *)(L:ADF1Frequency,Frequency ADF BCD32) (>K:ADF_COMPLETE_SET) </Click>


</Area>
 
Back
Top