Post by Jorge on Jan 5, 2019 14:10:13 GMT -5
All,
I posted a thread over at FSDeveloper and have had a few nibbles, but was wondering if anyone had any input here.
Any idea how this would be done? Here's what I have so far using freeware alphasim gauges as a basis:
==================================================================
<Gauge Name="pw rr v1" Version="1.0" Author="Jorge L. Rechani">
<!-- Based on original work by Herbert Pralle -->
<!-- of Alphasim. Freeware ADF and VOR radio -->
<!-- by said author of Alphasim were original -->
<!-- gauges this is based on. -->
<Image Name="ADF_backgrnd.bmp"/>
<!-- ADF card with direction numbers -->
<Element>
<Position X="86" Y="86"/>
<Image Name="ADF_card.bmp" Luminous="1">
<Axis X="72" Y="72"/>
</Image>
<Rotate>
<Value>(A:ADF CARD,radians) 3 *</Value>
</Rotate>
</Element>
<!-- ADF1 Needle -->
<Element>
<Position X="86" Y="86"/>
<Image Name="ADF_Needle_01.bmp" Luminous="1">
<Axis X="55" Y="5" PointsTo="East"/>
</Image>
<Rotate>
<Value>(A:ADF SIGNAL:1, number) abs 10 > if{ (A:ADF RADIAL:1,radians) pi 2 / - } els{ 0 }</Value>
<Failures>
<GAUGE_GYRO_HEADING Action="Freeze"/>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
<GAUGE_ADF Action="Freeze"/>
<SYSTEM_ELECTRICAL_AVIONICS Action="0"/>
</Failures>
<Delay DegreesPerSecond="180"/>
</Rotate>
</Element>
<!-- ADF2 Needle -->
<Element>
<Position X="86" Y="86"/>
<Image Name="ADF_Needle_02.bmp" Luminous="1">
<Axis X="55" Y="5" PointsTo="East"/>
</Image>
<Rotate>
<Value>(A:ADF SIGNAL:2, number) abs 10 > if{ (A:ADF RADIAL:2,radians) pi 2 / - } els{ 0 }</Value>
<Failures>
<GAUGE_GYRO_HEADING Action="Freeze"/>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
<GAUGE_ADF Action="Freeze"/>
<SYSTEM_ELECTRICAL_AVIONICS Action="0"/>
</Failures>
<Delay DegreesPerSecond="180"/>
</Rotate>
</Element>
<!-- Flags in case of failures, no signal, etc. -->
<Element>
<Position X="52" Y="57"/>
<Select>
<Value>(A:CIRCUIT GENERAL PANEL ON,bool) (A:Avionics master switch,bool) && (A:ADF SIGNAL:1, number) 10 > &&</Value>
<Case Value="0">
<Image Name="ADF_flag.bmp" Luminous="1">
<Axis X="0" Y="0"/>
</Image>
</Case>
</Select>
</Element>
<Element>
<Position X="100" Y="57"/>
<Select>
<Value>(A:CIRCUIT GENERAL PANEL ON,bool) (A:Avionics master switch,bool) && (A:ADF SIGNAL:2, number) 10 > &&</Value>
<Case Value="0">
<Image Name="ADF_flag.bmp" Luminous="1">
<Axis X="0" Y="0"/>
</Image>
</Case>
</Select>
</Element>
<!-- ADF Masking Cover -->
<Element>
<Position X="0" Y="0"/>
<Image Name="ADF_cover.bmp" Luminous="1"/>
</Element>
<!-- Knob to change the ADF Card / OBS Heading -->
<Element>
<Position X="153" Y="153"/>
<Image Name="ADF_Radio_knob1.bmp">
<Axis X="17" Y="17"/>
</Image>
<Rotate>
<Value>(A:ADF CARD,radians) 3 *</Value>
</Rotate>
</Element>
<!-- Course Lamp -->
<!-- If the Card setting is equal to the radial, -->
<!-- the lamp should come on. -->
<Element>
<Position X="0" Y="141"/>
<Image Name="Course_Lamp_bg.bmp"/>
<Select>
<Value>{ (A:ADF RADIAL:1,radians) pi 2 / - } {(A:ADF CARD,radians) 3 *} == </Value>
<Case Value="1">
<Image Name="Course_Lamp.bmp" Luminous="1">
<Axis X="0" Y="0"/>
</Image>
</Case>
<Case Value="0">
<Image Name="Course_Lamp_bg.bmp" Luminous="1">
<Axis X="0" Y="0"/>
</Image>
</Case>
</Select>
</Element>
<!-- To make sure no negative results for NAV radials -->
<!-- (A:NAV2 RADIAL, degrees) 0 < -->
<!-- if{ 360 (A:NAV2 RADIAL, degrees) + (>L:VOR2 Radial, degrees) } -->
<!-- els{ (A:NAV2 RADIAL, degrees) (>L:VOR2 Radial, degrees) } -->
<!-- Mouse to turn OBS and Card -->
<Mouse>
<Area Left="136" Right="170" Top="136" Bottom="170">
<Area Right="25">
<Click Event="ADF_CARD_DEC" Repeat="Yes"/>
</Area>
<Area Left="25">
<Cursor Type="UpArrow"/>
<Click Event="ADF_CARD_INC" Repeat="Yes"/>
</Area>
</Area>
</Mouse>
<!-- Course Display -->
<Element>
<Position X="95" Y="95"/>
<Text X="28" Y="10" Bright="Yes" Length="3" Font="Arial" Color="antiquewhite" Adjust="Center" VerticalAdjust="Center">
<String>%((A:ADF CARD, degrees))%!03d!</String>
</Text>
</Element>
</Gauge>
==================================================================
Thanks for any input!
Regards,
Jorge
Miami, FL
I posted a thread over at FSDeveloper and have had a few nibbles, but was wondering if anyone had any input here.
I'm trying to get a simple ADF gauge that has a light which lights up when the needle for ADF 1 and the set bearing on the card are equal. This would, in theory, allow for a "beam" type track to the station. In other words, no match between the two and the light would go out. Back where they match, and the light comes back on. You also have ADF 2 for next station reference, so when you are within range of that one you dial it in and dial the card to the course you want to the station.
Think of it as a "poor pilot's" LFRR set.
Any idea how this would be done? Here's what I have so far using freeware alphasim gauges as a basis:
==================================================================
<Gauge Name="pw rr v1" Version="1.0" Author="Jorge L. Rechani">
<!-- Based on original work by Herbert Pralle -->
<!-- of Alphasim. Freeware ADF and VOR radio -->
<!-- by said author of Alphasim were original -->
<!-- gauges this is based on. -->
<Image Name="ADF_backgrnd.bmp"/>
<!-- ADF card with direction numbers -->
<Element>
<Position X="86" Y="86"/>
<Image Name="ADF_card.bmp" Luminous="1">
<Axis X="72" Y="72"/>
</Image>
<Rotate>
<Value>(A:ADF CARD,radians) 3 *</Value>
</Rotate>
</Element>
<!-- ADF1 Needle -->
<Element>
<Position X="86" Y="86"/>
<Image Name="ADF_Needle_01.bmp" Luminous="1">
<Axis X="55" Y="5" PointsTo="East"/>
</Image>
<Rotate>
<Value>(A:ADF SIGNAL:1, number) abs 10 > if{ (A:ADF RADIAL:1,radians) pi 2 / - } els{ 0 }</Value>
<Failures>
<GAUGE_GYRO_HEADING Action="Freeze"/>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
<GAUGE_ADF Action="Freeze"/>
<SYSTEM_ELECTRICAL_AVIONICS Action="0"/>
</Failures>
<Delay DegreesPerSecond="180"/>
</Rotate>
</Element>
<!-- ADF2 Needle -->
<Element>
<Position X="86" Y="86"/>
<Image Name="ADF_Needle_02.bmp" Luminous="1">
<Axis X="55" Y="5" PointsTo="East"/>
</Image>
<Rotate>
<Value>(A:ADF SIGNAL:2, number) abs 10 > if{ (A:ADF RADIAL:2,radians) pi 2 / - } els{ 0 }</Value>
<Failures>
<GAUGE_GYRO_HEADING Action="Freeze"/>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
<GAUGE_ADF Action="Freeze"/>
<SYSTEM_ELECTRICAL_AVIONICS Action="0"/>
</Failures>
<Delay DegreesPerSecond="180"/>
</Rotate>
</Element>
<!-- Flags in case of failures, no signal, etc. -->
<Element>
<Position X="52" Y="57"/>
<Select>
<Value>(A:CIRCUIT GENERAL PANEL ON,bool) (A:Avionics master switch,bool) && (A:ADF SIGNAL:1, number) 10 > &&</Value>
<Case Value="0">
<Image Name="ADF_flag.bmp" Luminous="1">
<Axis X="0" Y="0"/>
</Image>
</Case>
</Select>
</Element>
<Element>
<Position X="100" Y="57"/>
<Select>
<Value>(A:CIRCUIT GENERAL PANEL ON,bool) (A:Avionics master switch,bool) && (A:ADF SIGNAL:2, number) 10 > &&</Value>
<Case Value="0">
<Image Name="ADF_flag.bmp" Luminous="1">
<Axis X="0" Y="0"/>
</Image>
</Case>
</Select>
</Element>
<!-- ADF Masking Cover -->
<Element>
<Position X="0" Y="0"/>
<Image Name="ADF_cover.bmp" Luminous="1"/>
</Element>
<!-- Knob to change the ADF Card / OBS Heading -->
<Element>
<Position X="153" Y="153"/>
<Image Name="ADF_Radio_knob1.bmp">
<Axis X="17" Y="17"/>
</Image>
<Rotate>
<Value>(A:ADF CARD,radians) 3 *</Value>
</Rotate>
</Element>
<!-- Course Lamp -->
<!-- If the Card setting is equal to the radial, -->
<!-- the lamp should come on. -->
<Element>
<Position X="0" Y="141"/>
<Image Name="Course_Lamp_bg.bmp"/>
<Select>
<Value>{ (A:ADF RADIAL:1,radians) pi 2 / - } {(A:ADF CARD,radians) 3 *} == </Value>
<Case Value="1">
<Image Name="Course_Lamp.bmp" Luminous="1">
<Axis X="0" Y="0"/>
</Image>
</Case>
<Case Value="0">
<Image Name="Course_Lamp_bg.bmp" Luminous="1">
<Axis X="0" Y="0"/>
</Image>
</Case>
</Select>
</Element>
<!-- To make sure no negative results for NAV radials -->
<!-- (A:NAV2 RADIAL, degrees) 0 < -->
<!-- if{ 360 (A:NAV2 RADIAL, degrees) + (>L:VOR2 Radial, degrees) } -->
<!-- els{ (A:NAV2 RADIAL, degrees) (>L:VOR2 Radial, degrees) } -->
<!-- Mouse to turn OBS and Card -->
<Mouse>
<Area Left="136" Right="170" Top="136" Bottom="170">
<Area Right="25">
<Click Event="ADF_CARD_DEC" Repeat="Yes"/>
</Area>
<Area Left="25">
<Cursor Type="UpArrow"/>
<Click Event="ADF_CARD_INC" Repeat="Yes"/>
</Area>
</Area>
</Mouse>
<!-- Course Display -->
<Element>
<Position X="95" Y="95"/>
<Text X="28" Y="10" Bright="Yes" Length="3" Font="Arial" Color="antiquewhite" Adjust="Center" VerticalAdjust="Center">
<String>%((A:ADF CARD, degrees))%!03d!</String>
</Text>
</Element>
</Gauge>
==================================================================
Thanks for any input!
Regards,
Jorge
Miami, FL