September 8, 201114 yr After a query for a VOR2 gauge, with a working Glideslope, over at Flightsim.com, Jim Robinson pointed us to one he created.I had made the erroneous assumption that the AP wouldn't respond to it. Father Bill(n4gix) pointed out the events necessary for that function. 1 (>K:AP_NAV_SELECT_SET ) (* Select Nav1 to drive autopilot *)2 (>K:AP_NAV_SELECT_SET ) (* Select Nav2 to drive autopilot *) I proceeded to make a 3 way knob with Nav1, GPS, and Nav2, click spots.After fooling with it for a few hours, and no luck, I made the following quickie test gauge and it won't function either.I used the variable called out in the SDK and the text string returns a 0(zero)!The clickspots are recognised(changes to cursor) and the tooltips display properly. <?xml version="1.0" encoding="utf-8"?><Gauge Name="Autopilot Nav Radio Select Switch" Version="1.0"> <Image Name="AP_Dig_Source_Bkgnd.bmp" Luminous="No" /> <Element> <Text X="18" Y="24" Bright="yes" Length="1" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Center" Fixed="no"> <String>%(A:AUTOPILOT NAV SELECTED, number)%!1d!</String> </Text> </Element> <Mouse> <Area Left="0" Right="18" Top="0" Bottom="12"> <Cursor Type="Hand"></Cursor> <Click>1 (>K:AP_NAV_SELECT_SET )</Click> <Tooltip>%Select Autopilot Nav 1 Mode</Tooltip> </Area> <Area Left="0" Right="18" Top="13" Bottom="24"> <Cursor Type="Hand"></Cursor> <Click>2 (>K:AP_NAV_SELECT_SET )</Click> <Tooltip>%Select Autopilot Nav 2 Mode</Tooltip> </Area> </Mouse></Gauge> I fear there is something I've missed...Don
September 8, 201114 yr Jeroen is right, you need the extra set of brackets.However, that does not change the truly bizarre fact that in XML, the K:Event doesn't work, and in C, the A:Var doesn't work.I'll flip you a C gauge that will set the state. Doug
September 8, 201114 yr Author I'll try that. I made so many different changes of spacing, characters, and punctuation I can't remember!Originally, I just copied that element from a working gauge, but could have mucked it when I changed the Variable. I also had a text element in the knob version, that returned zero so, I had bitmaps assigned to 0, 1, and 2 when I was testing that version and they wouldn't change state either. Here's the last full version I tried: <?xml version="1.0" encoding="utf-8"?><Gauge Name="Autopilot Nav Radio Select Switch" Version="1.0"> <Image Name="AP_Source_Bkgnd.bmp" Luminous="No" /> <Element> <Text X="18" Y="24" Bright="yes" Length="1" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Center" Fixed="no"> <String>%(A:AUTOPILOT NAV SELECTED,number)%!1d!</String> </Text> <!--From the SDK: "AUTOPILOT NAV SELECTED" Index of Nav radio selected "Number" --> </Element> <Element> <Visible>(A:GPS DRIVES NAV1,bool) ! </Visible> <Select> <Value>(A:AUTOPILOT NAV SELECTED,number)</Value> <Case Value="0"> <Image Name="Nav_0_Selected.bmp"></Image> </Case> <Case Value="1"> <Image Name="Nav_1_Selected.bmp"></Image> </Case> <Case Value="2"> <Image Name="Nav_2_Selected.bmp"></Image> </Case> </Select> </Element> <Mouse> <Tooltip>%Autopilot Nav/GPS Select</Tooltip> <Area Left="1" Right="35" Top="41" Bottom="76"> <Cursor Type="Hand"></Cursor> <Click>(A:GPS DRIVES NAV1,bool) if{ 1 (>K:TOGGLE_GPS_DRIVES_NAV1) }1 (>K:AP_NAV_SELECT_SET )</Click> <Tooltip>%Select Autopilot Nav 1 Mode</Tooltip> </Area> <Area Left="63" Right="97" Top="41" Bottom="76"> <Cursor Type="Hand"></Cursor> <Click>(A:GPS DRIVES NAV1,bool) if{ 1 (>K:TOGGLE_GPS_DRIVES_NAV1) }2 (>K:AP_NAV_SELECT_SET )</Click> <Tooltip>%Select Autopilot Nav 2 Mode</Tooltip> </Area> <Area Left="32" Right="66" Top="6" Bottom="40"> <Cursor Type="Hand"></Cursor> <Click>(A:GPS DRIVES NAV1,bool) ! (>K:TOGGLE_GPS_DRIVES_NAV1)</Click> <Tooltip>%Select GPS Mode</Tooltip> </Area> </Mouse></Gauge> Clicking the GPS spot toggles GPS mode properly. Clicking either NAV 1 or 2 spot turns off the GPS mode if enabled and shows me the Nav_0_Selected.bmp. I flew a couple of approaches and tried enabling it with a properly tuned NAV 2, no joy...Don
September 8, 201114 yr Author Jeroen is right, you need the extra set of brackets.However, that does not change the truly bizarre fact that in XML, the K:Event doesn't work, and in C, the A:Var doesn't work.I'll flip you a C gauge that will set the state. DougThanks Doug! I was quite baffled why I couldn't find the problem with the event, then further confusion reigned, with the Var retuning zero...Don [edit] the extra brackets fixed the digit as you folks said it would. Thanks BTW, Doug, my handle at yahoo.com
September 8, 201114 yr Yep! the XML strings need to be coded whit double parenthesis. Aditionally there is no Nav 0 for the auto pilot Nav Selected A: parameter it just accept Nav 1 or Nav 2 values. Javier
September 8, 201114 yr Author Ha-Ha, I love it! How embarrassing!! Those missing parenthesis are things that should be second nature to me by now.Literally, hundreds of gauges, and a dozen or so panels, uploaded and shared. The last couple of days though, I have had my head tucked firmly where the sun don't shine! I had no clue what (A:AUTOPILOT NAV SELECTED,number) might actually return, so I created the digital version.It returned a 0. I had not even thought that it could be mucked up, of course! Jeroen and Doug to the rescue! Thanks again, fellas. Also, thanks to Mr Dawson, I now have in my posession a neat little xml-->C translator for those Events."xml L:Event" goes in, "C++ K: Event" comes out. Works a treat!It allowed me to complete my little selector knob, which was the source of my pain and embarrassment! Now to start learning C gauges!(Yeah, Right!)...Don
December 6, 201114 yr However, that does not change the truly bizarre fact that in XML, the K:Event doesn't work, and in C, the A:Var doesn't work.This XML code appears to work for me:<Gauge Name="AP NAV switch" Version="2.0"> <Element> <Select> <Value>(A:Autopilot NAV selected,number)</Value> <Case Value="1"> <Image Name="APNAV1.bmp" /> </Case> <Case Value="2"> <Image Name="APNAV2.bmp" /> </Case> </Select> </Element> <Mouse> <Help ID="AP NAV1/NAV2" /> <Cursor Type="Hand" /> <Click> (A:Autopilot NAV selected,number) (>L:APNAV,number) (L:APNAV,number) 1 == if{ 2 (>K:AP_NAV_SELECT_SET) } (L:APNAV,number) 2 == if{ 1 (>K:AP_NAV_SELECT_SET) } </Click> </Mouse></Gauge> Bert
December 6, 201114 yr Given my XML skills, it is entirely possible that it was my test gauge that was the problem...
December 7, 201114 yr Does this mean you can create 2 ILS gauges with glideslope needles (one on the captain's side and one on the copilot's side) and have them switch independently between NAV1 and NAV2? (i.e. each has a NAV1/NAV2 switch).And does this work in FS9?Thanks, Tom Gibson CalClassic Propliner Page
December 7, 201114 yr Yes,You can display nav 1 or nav 2 on both sides or nav 1 on one side & nav 2 on the other and if tuned to the same ILS fequency you can change the coupling from 1 to 2 during the approach or fly the approach on nav 2. Paul EGLD
December 28, 201114 yr Hi pve,I tryied all .xml codes posted in this tread but for me none it's working as you said.I 'm using RFP 742.Please can you post the right working code as you explained in your post?Gianfranco
December 28, 201114 yr Hi pve,I tryied all .xml codes posted in this tread but for me none it's working as you said.I 'm using RFP 742.Please can you post the right working code as you explained in your post?GianfrancoCheck the [Radios] section of aircraft.cfgIs the aircraft configured to have an ILS on NAV2?Doug
December 28, 201114 yr Moderator Does this mean you can create 2 ILS gauges with glideslope needles (one on the captain's side and one on the copilot's side) and have them switch independently between NAV1 and NAV2? (i.e. each has a NAV1/NAV2 switch).And does this work in FS9?Thanks,Yes, although obviously only one source can drive the AP at a time... ;)One of my current projects has NAV1 driving the pilot's side, and NAV2 driving the copilot's side. In the event of a NAV1 failure, the copilot can take over as PIC and switch the AP to be driven by the NAV2 signals. Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
December 28, 201114 yr I did get this working as you said, thanks. NAV1 gauges on the captain's side and NAV2 gauges on the copilot's side. Works great. I haven't tried changing the AP, since on older AP's they were often driven by only one radio.Thanks again, Tom Gibson CalClassic Propliner Page
Create an account or sign in to comment