Jump to content

how to modify AP source switch to add NAV2


ngtw16a

Recommended Posts

Hello.

 

Long time SIMer, first time at doing mods :)

 

I wanted to modify the NAV/GPS switch to say NAV1/GPS/NAV2 so I can connect NAV2 to the AP.

 

Would this involve modifying the panel? What tools do I need and what do I have to change?

 

I found out the AP_NAV_SELECT_SET command will set the values, just need to figure out how to modify

and 'compile' the switch change.

 

Thank you.

 

~Pat

Link to comment
Share on other sites

A lot depends on what the AP gauge is written in. Is it .xml? C++? If it's .xml, like say autopilot.xml, then a software that can edit .xml files will do the trick. Like NotePad++ for example. Pretty simple, if you know XML at all.

If it's C++, like say autopilot.gau for example, then you'll need the original code, and a C++ compiler to make changes. Very difficult.

I think, maybe, though, all you need to is change the switch, not AP code. The same caveats apply to the switch, though. How hard it is depends on what it's written in. Maybe write a switch for yourself and install that into the panel?

There is a helicopter over on HoverControl, the HC412PE, that has a NAV1-GPS-NAV2 switch on the panel. I'll see if I can figure out if it's part-n-parcel of another gauge or a stand-alone, so to speak.

I'm not real great at XML, but if that's what it's written in, I'll let you know. Or, you can download the helicopter and see about it for yourself. I can post a link to it should you desire.

I know, not real helpful, but the best I can offer. By the way, all you need to edit a panel.cfg file is a simple text editor. Microsoft's NotePad, or, once again, NotePad++, a little freeware program. DO NOT USE A WORD PROCESSOR. They add code into the .cfg files that make them unusable to the simulator.

Pat☺

PS: I am not the same Pat as the OP! :D

[sIGPIC][/sIGPIC]

Had a thought...then there was the smell of something burning, and sparks, and then a big fire, and then the lights went out! I guess I better not do that again!

Sgt, USMC, 10 years proud service, Inactive reserve now :D

Link to comment
Share on other sites

Thank you Pat (Nice name!!)

 

I'll take a look at it. I read Nike Pike's info about XML gauge programming. I think I'm close....

 

First I'm just going to create a new gauge to toggle from NAV1/NAV2....

 

then I'll make a knob switch that can select one of the 3....gotta run before you can crawl :)

 

 

 

(G:Var1, number)

NAV1/NAV2 select

(G:Var1) ! (>G:Var1)

(G:Var1) + 1 (>K:AP_NAV_SELECT_SET)

Link to comment
Share on other sites

Thank you sir. I'm a programmer who knows (enough) about XML---but this gauge stuff...

PHEW....think backwards-- got it...they couldn't use normal if logic and expressions like the rest of the world ?! :)

 

Thankx again--not bad for my first time out :)

Link to comment
Share on other sites

just one more Q if you would...

 

I'm also working on a knob that has 3 settings (0,1,2)...and I'm not sure if I can say this...

 

The first two 'clicks' are in the Area sections...so when I click on the left or right side

it moves the value and knob.

 

but can I ALWAYS have a 'click' outside the area that is ALWAYS executed?

(otherwise I'd have to put the same code in both area clicks)

 

wasn't sure if that was 'legal' or not.

 

NAV/GPS select

(G:Var1) 0 > if{ (G:Var1) -- (>G:Var1) }

 

NAV/GPS select

(G:Var1) 2 G:Var1) }

 

(G:Var1) 1 > if{ // if G:Var1 > 1 = GPS

(A:GPS DRIVES NAV1, bool) ! if{ (>K:TOGGLE_GPS_DRIVES_NAV1) }

} els{

(G:Var1) 1 + (>K:AP_NAV_SELECT_SET)

(A:GPS DRIVES NAV1, bool) if{ (>K:TOGGLE_GPS_DRIVES_NAV1) }

}

Link to comment
Share on other sites

I'm trying to think along, but don't get the main point... What's the use of this new switch?

Is setting to:

nav1 - makes the AP follow the ILS,

nav2 - AP follows VOR

and GPS - AP follows GPS

??

 

(So the new part is that you can make AP fly direct to a VOR beacon?)

 

Or is it something else?

Thanks.

[sIGPIC][/sIGPIC]
Link to comment
Share on other sites

Thanks.

What autopilot mode needs to be on to make it fly to vor?

 

I thought I had created something that selected

1 (>K:AP_NAV_SELECT_SET)

and

2 (>K:AP_NAV_SELECT_SET)

 

the switch I made has some effect, but I can't seem to make the plane fly to VOR with it.

 

After:

1 (>K:AP_NAV_SELECT_SET)

 

approach mode (ILS) works fine.

 

Haven't tested approach mode (ILS if my switch is in position:

2 (>K:AP_NAV_SELECT_SET)

 

 

But I tried "Nav Hold" on the autopilot, after:

2 (>K:AP_NAV_SELECT_SET)

And all I eventually managed to do is make the plane fly AWAY from the VOR keeping it directly behind me.

(but not consistently, when i tried again it wouldn't work ...)

 

I do notice that there is a keyboard shortcut for:

"Autopilot Nav1 hold"

(and that works with the button in my VC)

 

but not a keyboard shortcut for:

"Autopilot Nav2 Hold"

 

I'm thiking tht may be where the/my issue lies.

 

Do you have any tips/suggestions for me?

 

I see no K: variable for:

AP_NAV2_HOLD

either.

 

Is AP_NAV1_HOLD going to follow NAV2 after the:

2 (>K:AP_NAV_SELECT_SET)

?

(I don't think I saw that so far.)

[sIGPIC][/sIGPIC]
Link to comment
Share on other sites

I'll post what I had made.

One switch, 3 positions.

3 clickspots, left middle, and right.

 

As far as I can see it works ok.

But as I said, I can't seem to make the plane actually fly to a vor with the switch in the nav2 position.

 

I'll post the code, plus images, in the next post.

 

Maybe you can explain to me ho to use this creation.:)

Anyway, hope it is of some help.

[sIGPIC][/sIGPIC]
Link to comment
Share on other sites

I should share what I have so far.

 

Create empty folder.

Name Empty folder: ngtw16a_gau

 

Download the following 4 Images and put in that folder.

 

Four Images.

Are Jpeg files when posted on flightsim.com. - Must Convert these files to .bmp

Size should be 180x180 pixels

Filenames should be ok after download. I put the filenames above the Images just in case.

 

Put those Images in that folder.

 

ngtw16a_gau_background.bmp

ngtw16a_gau_background.jpg

 

 

ngtw16a_gau_GPS.bmp

ngtw16a_gau_GPS.jpg

 

 

ngtw16a_gau_NAV1.bmp

ngtw16a_gau_NAV1.jpg

 

 

ngtw16a_gau_NAV2.bmp

ngtw16a_gau_NAV2.jpg

 

 

Create .txt textfile. Name: ngtw16a_gau.txt

 

Put following code in textfile:

I DECIDED TO REMOVE THIS CODE. THIS VERSION DID NOT FULLY WORK.

A BETTER VERSION IS POSTED IN POST 39.
WITH DIFFERENT INSTALL INSTRUCTIONS.

 

Put textfile in folder.

To make textfile into working gauge, change file extension from:

ngtw16a_gau.txt

to

ngtw16a_gau.xml

 

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

Simple install as popup:

[Window Titles] section

I DECIDED TO REMOVE THIS CODE. THIS VERSION DID NOT FULLY WORK.

A BETTER VERSION IS POSTED IN POST 39.
WITH DIFFERENT INSTALL INSTRUCTIONS.

 

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

(becomes quite big, if placing in Main Panel you want a much smaller size)

 

(Also, 3 clickspots, but no edge on the gauge itself. Means that you can't drag the popup around if popup is same size as gauge. I made popup 180x180 and gauge 160x160 to have an edge to drag it by. Doesn't look good, but works.)

 

(Also, the gauge starts off b showing the black background image (with the checkmark).

You could easily change that by swapping the black image for the image:

ngtw16a_gau_GPS.bmp

so it shows that when starting.)

[sIGPIC][/sIGPIC]
Link to comment
Share on other sites

Ok, I am far from the XML programmer you or il88 are, but I noticed one thing.

  


 1 (>K:AP_NAV_SELECT_SET) 1 (>G:Var1) 
nav1




 2 (>K:AP_NAV_SELECT_SET)  2 (>G:Var1) 
Nav2

I noticed in the xml file you wrote that you have Area 2 called twice. Notice the text in red. Shouldn't one of those be Area 1?

It seems to me that the way it is now, both click spots will make the switch do the same thing, instead of 2 different things. Am I mistaken on this?

 

Also, did you put the folder you created, ngtw16a_gau, in the Panel folder of your test plane? It needs to be there or in the Gauges folderof the sim. One of the two. If you only want one plane to use it, in the plane's Panel folder, if you want many planes to use it, in the Gauges folder.

 

Next, and I am far from sure of this, but doesn't it need to made into a .cab file? I mean the whole folder you made, ngtw16a_gau, with the .bmp files and the .xml file all included. Then have CABPACK compress the whole thing into a .cab file. You can use CABPACK, available in the library to accomplish this. It comes with very good instructions included on how-to do that. ONLY have the .bmp and .xml files in it though. Don't include .txt or .jpg files. Again, I am not sure this is necessary, or if it just saves a little disk space.

 

I don't know if any of this is useful or not...

Pat☺

[sIGPIC][/sIGPIC]

Had a thought...then there was the smell of something burning, and sparks, and then a big fire, and then the lights went out! I guess I better not do that again!

Sgt, USMC, 10 years proud service, Inactive reserve now :D

Link to comment
Share on other sites

I'll answer those other questions too.

Yes, the, ngtw16a_gau, folder needs to be moved to either the /panel folder of the aircraft, or to the sim's Main /gauges folder.

 

No, it does not need to be a cab file. A folder will work just as well.

If you have both in the panel folder. The for example xxxxx.cab, and folder xxxxx

Both having gauges with the same name,

then the gauge that is used is the one in the folder.

The folder takes preference over the .cab file in that case. If the .xml is not in the folder, the one in the .cab will be used instead.

[sIGPIC][/sIGPIC]
Link to comment
Share on other sites

As far as I can see the xml part functions.

But wheter it is useful or not is another thing.

The effect of the switch was not as I expected.

 

good:

GPS selected --> Nav hold follows GPS flightplan.

also good:

Nav1 selected --> "Appr Mode" follows the ILS.

 

not so good:

Nav 2 selected -- "Appr Mode" does not follow ILS anymore.

(so seems to work.)

But

Nav 2 selected -- "Nav Hold" does also not fly to VOR.

 

Problem may be that "Nav Hold" button on the autopilot is actually the command "Autopilot NAV1 Hold".

(I tried on Beech Baron and 737).

With my switch set to NAV2 I tried:

NAV Hold

LOC Hold

APP Mode

and Backcourse mode.

but the plane just flew straight on, and did not turn towards the tuned VOR.

 

 

I checked keyboard commands lists, and K:Vars lists, and did not find a "AP_NAV2_HLD" command anywhere.

[sIGPIC][/sIGPIC]
Link to comment
Share on other sites

Only one way that I can make it fly to a VOR.

And that does not require the gauge I made.

 

-Tune VOR frequency on Nav1

-Set OBS indicator to same heading VOR lies in. For that you need to tune VOR on Nav2 as well.

-default Nav/Gps switch set to Nav.

-AP on, Alt hold On, App mode on.

 

Plane follows heading of OBS indicator, not the signal of the VOR. So you can fly another heading to the VOR as well.

 

--------

You can do this with just the default Nav/GPS switch. If set to Nav.

 

My switch works too. If set to Nav1.

 

With my switch to Nav2 I was not able to make it fly to VOR. That's in the same setup, App mode On, but hoping to now use Nav2 as guidance.

Maybe I'm just not selecting the right Autopilot settings?

Or maybe my switch, the command it fires,

2 (>K:AP_NAV_SELECT_SET)

is not the one needed??

Strange, as it is the same command that user ngtw16a used.

[sIGPIC][/sIGPIC]
Link to comment
Share on other sites

I checked keyboard commands lists, and K:Vars lists, and did not find a "AP_NAV2_HLD" command anywhere.

 

I think you're right, I found this definition on a thread from 2002 on this very subject:

 

"Most aircraft have two Navs for redundancy and on instrument approaches, Nav 1 will usually be tuned to the ILS or other approach radian while Nav 2 is tuned to the missed approach VOR or other general vicinity station."

 

Effectively Nav2 is slaved to Nav1, so no switch is necessary.

Tim Wright "The older I get, the better I was..."

Xbox Series X, Asus Prime H510M-K, Intel Core i5-11400F 4.40GHz, 16Gb DDR4 3200, 2TB WD Black NVME SSD, 1TB Samsung SATA SSD

NVidia RTX3060 Ti 8Gb, Logitech Flight Yoke System, CH Pro Pedals, Acer K272HL 27", Windows 11 Home x64

Link to comment
Share on other sites

On case people are trying to use this gauge "as is", I should add something.

The gauge is very "rough and ready". It's just to test basic functionality.

 

A BIG issue is:

gauge has working clickspots,

Set's (G:Var1) value after a click,

And shows image accordingly.

 

My gauge DOES set the simvariable for NAV/GPS.

Which means if you use my gauge, the default NAV/GPS switch DOES change position also.

 

BUT does not:

listen to a SImvariable to show the correct Image!!

That means that is you use the default NAV/GPS switch from a plane, or a keyboard shortcut, the image on my gauge does not change.

 

 

 

 

Which leads to:

click my gauge GPS spot -- GPS mode is selected, and shown on my gauge, and also shown on default NAV/GPS switch.

 

 

But then click default NAV/GPS switch and:

NAV mode is selected, default NAV/GPS switch changes position accordingly, BUT MY GAUGE STAYS IN GPS POSITION.

That does not hamper the basic functionality.

As long as you only use my gauge everything is fine I think.

But it isn't very neat....

[sIGPIC][/sIGPIC]
Link to comment
Share on other sites

THanks Tiger1962.

I don't fully see what you mean by that last sentence "no switch is necessary".

 

I looked for "nav2 hold" + FS on gooogle and found no more then about 7 results. One said it wasn't an option.

 

I think there's only Nav1 hold. AP following Nav1.

No Nav2 Hold.

Nav2 only indicates heading of VOR, but doesn't guide AP.

 

Switching the "source" does make a difference. So I'm not so sure they are always "slaved".

With my switch selecting Nav2 as "source", App mode no longer flies the ILS.

It Has to be in Nav1 "source selection", and NAV mode on, to fly ILS.

 

I'll keep a lookout for a "Nav2 Hold" switch".

 

 

ngtw16a,

Happy testing.:)

 

 

Tom Gibson,

Was the file you tried to link a Nav2 Hold switch?

Would be very interested.

Can you please post Filename?

The Link did not work.

[sIGPIC][/sIGPIC]
Link to comment
Share on other sites

I wonder if the 'NAV' button on the AP sets the NAV_source to 1 by default...

so..you'd have to active AP_nav THEN switch source to Nav2.

 

I'll try that with fsuipc interrogate and see if the AP_NAV switches the source back to 1.

 

FYI...my main reason for this was for VOR-VOR flying..

 

FYI...vor1 - flying away from radial A, vor2- flying TO radial B..

then switching...flying away from radial B to radial C...

 

seemed it would be easier if you could toggle back and forth (rather than changing your radio freqs) but not sure if this is actually available in the REAL plane hardware. I would think you would want a Nav2 hold AP button-- otherwise it might get confusing.

 

Pat (ngtw16a)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...