• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

I need a nudge in the right direction

A second gps unit with cross-fill?

Bob

A second GPS interface, allowing xml code like this:
Code:
'A      EGCC' (>C:fs9GPS:WaypointAirportICAO)
'A      EGLL' (>C:GPS2:WaypointAirportICAO)

Thus allowing code like this:
Code:
	<Element>
		<Select>
		</Select>
		<Position X="3" Y="24"/>
		<Text X="55" Y="7" Bright="No" Length="55" Font="Arial" Color="White" Adjust="Left" VerticalAdjust="Left" Multiline="No">
		<String>%((C:GPS2:WaypointAirportCity))%!s!</String>
		</Text>
	</Element>
	<Element>
		<Position X="60" Y="24"/>
		<Text X="55" Y="7" Bright="No" Length="55" Font="Arial" Color="White" Adjust="Left" VerticalAdjust="Left" Multiline="No">
		<String>%((C:FS9GPS:WaypointAirportCity))%!s!</String>
		</Text>
	</Element>
 
Doug, AFAIK there is no GPS2 class name defined in the gps module, or there is one?

Regarding the Alternate Airport data, I think Bob's suggestion of using FacilityICAO search, combined with FacilityName, FacilityCity, etc, would be the simplest approach.

Also if only 4-letter IDENT needs to be retained, the simplest way would be to save the ASCII code of each letter in a LVar (4 in total) and then restore the string with a basic reconversion and concatenation

Tom
 
Thanks to you both,

Doug,
I think I understand what you are saying with a second input. The ship I work on Has multiple redundancies. On the Bridge alone we have 4 alone making up our Electronic Navigation System tying system A, B, C and E (Emergency back up). These all include separate GPS, Gyro Compass, Magnetic Compass and RADAR inputs, as well as (if it available) we can input via internet through our satellite receivers. We also have independent systems in the Emergency steering room and Engine room should we lose the Bridge. Of course the theory if we lose one the other kicks in and in the event of a complete power loss system "E" kicks in automatically, as well as old school Navigation called the paper chart and sextant (We actually have people that don't know what they are). But I think what I am trying to achieve is rather simple compared to that. Unfortunate, we are stuck with one (I only say that because I am trying to keep everything contained in one XML Document), but just maybe Prepare 3D will open some new doors for all of us.

Bob,
Of course you are right and thank you for the nudge in the right direction. I seem to remember, I think it was Bill (and probably yourself) in one of my posts commenting to avoid using Macros if you don't need to. I will run with your suggestion and let you know how I make out. I would once again like to thank all of you for your support in helping learn and create with coding. Anyways off to get to work on this new path, Take care all and have a great weekend.

Greg
 
Doug, AFAIK there is no GPS2 class name defined in the gps module, or there is one?
Regarding the Alternate Airport data, I think Bob's suggestion of using FacilityICAO search, combined with FacilityName, FacilityCity, etc, would be the simplest approach.
Also if only 4-letter IDENT needs to be retained, the simplest way would be to save the ASCII code of each letter in a LVar (4 in total) and then restore the string with a basic reconversion and concatenation
Tom

I wrote a module which defines the GPS2 class name. It accesses the FS9GPS class and passes all the methods through the new interface, using methods with exactly the same names. The module gets a separate instance of the FS9GPS class, which the xml gauge accesses indirectly through the GPS2 class.
www.douglassdawson.ca/files/GPS2.zip
edit:
A much improved version:
www.douglassdawson.ca/files/multi_gps.zip

Doug
 
Last edited:
I seem to remember, I think it was Bill (and probably yourself) in one of my posts commenting to avoid using Macros if you don't need to..

Greg

Macros are, actually, a handy tool for the programmer when it comes to work with repetitive code. They also help to maintain critical sections organized as to simplify changes and additions. Though very recommendable, they don't affect FS runtime behavior at all. So it is ok not to use macros if one doesn't feel comfortable working with them.

I wrote a module which defines the GPS2 class name. It accesses the FS9GPS class and passes all the methods through the new interface, using methods with exactly the same names. The module gets a separate instance of the FS9GPS class, which the xml gauge accesses indirectly through the GPS2 class.
www.douglassdawson.ca/files/GPS2.zip

Doug

Oh, I didn't know of that gauge. Good work!

Just one question, wouldn't be something similar to using fs9gps:1 and fs9gps:2 variants? Of course there would be only two possible instances in one gauge.

Tom
 
Just one question, wouldn't be something similar to using fs9gps:1 and fs9gps:2 variants? Of course there would be only two possible instances in one gauge.
Tom

Didn't know you could do that...
The module is just new this afternoon, which is why you haven't seen it before.
Doug
 
AFAIK gps module in FSX contains 3 classes:

-fs9gps
this is the typical gps class, the same as in FS9. Instance is local to the gauge that calls it, so different gauges call individual instances of the class and its methods ("var names")

-fs9gps:1 and fs9gps:2
are two global and independant instances of the master class (fs9gps), and are used in the G1000 version. As being global, only one instance of each one is shared between gauges. They also have custom methods that are not present in master fs9gps (popupFPL for example).
And they seem to use the same Map customdraw from master fs9gps.

I didn't make tests on them so far, only took a glance, so I can't make further comments.

Tom
 
Doug

Does your new Module add any new Variables , it strikes me that there are a huge array of capabilities in the background of FSX and the GPS , but we need
Variables to access them.
I think each of us could come up with a list of Variables that we would like to have promulgated.
Examples:
-Airspaces line thickness and colour for each of the approx 24 that exist.
-Slant custom Draw.
-Several to position the Custom Draw View/Window , I have been unable to find
any reference to that facility in the SDK's.

Cheers
Karol
 
Ok I will say it I love this place...
I am the newbie and I love how posts go off on a tangent about FSX and everyone's search to achieve a more realistic approach to FSX, while I have a lot of questions and learning to do to become truly proficient at this, I am amazed at the experience that has helped guide me to achieve the goals with my gauge. So one question is while this forum has true knowledge, understanding and abilities to work with FSX. Why don't the leaders Bob, Bill, Tom, Doug and Karol and the REST of us combine our efforts and design a simulator that truly meets our want and desires and make the simulator a much more realistic place to work and fly in? Sorry I have been staring at this screen since 5:30 this morning and this is my parting thought, because thinking about it, I believe it would be a much better environment to live and play in. I know this is not practical on so many levels and thank everyone for their part in trying to make this a much more realistic simulator. Take Care All and have a relaxing Sunday....

Greg
 
Greg,

Yes, I did hijack your thread. Sorry about that... I'm glad you found all the stuff useful.

Karol,

There is no additional functionality in the module. It is quite literally just a pass through for the existing GPS methods. The graphics stuff is (at least currently) well beyond my capabilities.

Doug
 
Doug

Thank you , both the GPS and FSX are complex beasties.
At least it gives us all a challenge to find ways to get it to do what we require of it.
While I will always be greedy about having more functional Variables, I am at the same time grateful that Microsoft made the flight simulator an open platform with a fairly good range of Variables.

Cheers
Karol
 
No worries Doug - Please ignore my post last night, it was just a passing thought after spending a long day working on my project, I never meant to insinuate or insult anyone. but do believe if some of you had input to FSX it would be a much better simulator. I have always enjoyed reading posts where sideline conversations have developed where "something" was discovered, created or new avenues to producing advancements in the sim are discovered. Trust me it doesn't bother me at all and if my posts spark something that goes a completely different direction and if it helps anyone I am happy to be a part of it.



Macros are, actually, a handy tool for the programmer when it comes to work with repetitive code. They also help to maintain critical sections organized as to simplify changes and additions. Though very recommendable, they don't affect FS runtime behavior at all. So it is ok not to use macros if one doesn't feel comfortable working with them.

Taguilo - Yes you are right and I should of been a little clearer with my statement, at the time it was explained to me and my understanding of it was if you are only going to use the information/input once or twice a macro is not always the best option, but if you are using the in repeatedly then it is definitely the route to follow. As the item I am working is a "one time" Bob's recommendation makes sense eliminating the need for 12 macros to achieve one solution.

Ok where am I at,
Had a bit of a set back with some errors and conflicts so never spent as much time on this as I would of liked on this, but today, after much needed sleep it is looking promising!

I did manage to create the Shift register and is something like this:

Keys:
Code:
<On Key="Alphanumeric"> 
<Visible>(L:ALTAPEntry, enum) 1 ==</Visible> 
(L:ALT-AP-3,enum) (>L:ALT-AP-4,enum)		
(L:ALT-AP-2,enum) (>L:ALT-AP-3,enum)
(L:ALT-AP-1,enum) (>L:ALT-AP-2,enum)
(M:Key) (>L:ALT-AP-1,enum) 				
</On>		
</Keys>

Mouse:
Code:
  <Area Left="478" Top="635" Width="100" Height="25">
    <Visible>(L:EnterAltAP, bool)</Visible>
    <Cursor Type="Hand"/>
    <Click>
     0 (>L:EnterAltAP, bool)
    'A' (>@c:IcaoSearchStartCursor)	
    (L:ALT-AP-4,number) chr (L:ALT-AP-3,number) chr 
    (L:ALT-AP-2,number) chr (L:ALT-AP-1,number) chr scat scat scat  (>@c:IcaoSearchEnterChar) 
    (@c:IcaoSearchMatchedIcaosNumber,number) 0 &gt; 
    if{  }
    0 (>L:ALTAPEntry, enum) 
    0 (>L:SetAlternateAP,bool)	
    1 (>L:FlightPlanDisplay,bool)			
</Click>
  </Area>

Display Line Flight Planner Page
Code:
 %ALTERNATE AIRPORT:\t\t\t%((L:ALT-AP-4,enum) chr (L:ALT-AP-3,enum) chr scat (L:ALT-AP-2,enum) chr scat (L:ALT-AP-1,enum) chr scat)%!s!\n

Which of course display the four digit Ident of the inputted airport. So just a couple quick clarifications if I may.

I understand what Bob is saying to do next using my register (for example)

Code:
(L:ALT-AP-4,enum) chr (L:ALT-AP-3,enum) chr scat (L:ALT-AP-2,enum) chr scat (L:ALT-AP-1,enum) chr scat
(>@c:IcaoSearchCurrentICAO) (>@c:FacilityICAO)

for an ICAO transfer with of course a cycle skipping step in the process.
Now do I have to use the register line in every statement I create from this point forward or can it be condensed? I think that makes sense?

Also for the next portion what would be the best place for my ICAO transfer and cycle skip, <Update>, <Element>, or <Mouse>? I only ask this is because through this process I have eliminated the <Updates> with regards to ICAO transfers and Airport Searches.

Thanks Again

Greg
 
Is this statement correct?

Code:
'A      ' chr (L:ALT-AP-4,enum) chr (L:ALT-AP-3,enum) chr scat (L:ALT-AP-2,enum) chr scat (L:ALT-AP-1,enum) chr scat (>@c:FlightPlanNewWaypointICAO)

I only ask because using Bob's recommendation in Post 18 I tried using
(>@c:FlightPlanNewWaypointIdent) and although it changed waypoints to activate the Alternate Waypoint is was almost like no information was passed other than the Ident. I figured have the ICAO matched to the alternate airport would eliminate, as I am assuming Bob is indicating the best approach to this, may solve the problem, but nothing is loaded when updated.

Thanks
Greg
 
Also for the next portion what would be the best place for my ICAO transfer and cycle skip, <Update>, <Element>, or <Mouse>? I only ask this is because through this process I have eliminated the <Updates> with regards to ICAO transfers and Airport Searches.

Generally speaking, when working with single asynchronious calls it would be better to make the search within a <Mouse> routine, using a flag variable, and then test for the result within an <Element> or <Update> section, according to the flag's conditional status.

Is this statement correct?

Code:
'A      ' chr (L:ALT-AP-4,enum) chr (L:ALT-AP-3,enum) chr scat (L:ALT-AP-2,enum) chr scat (L:ALT-AP-1,enum) chr scat (>@c:FlightPlanNewWaypointICAO)

No, it is not.
'A ' is already a string value, so chr is not valid.

Try:

Code:
'A      '  (L:ALT-AP-4,enum) chr scat (L:ALT-AP-3,enum) chr scat (L:ALT-AP-2,enum) chr scat (L:ALT-AP-1,enum) chr scat (>@c:FlightPlanNewWaypointICAO)

Tom
 
Regarding post #18 you are right, FlightPlanNewWaypointICAO is the correct choice. Sorry about the misleading info. FlightPlanNewWaypointIdent is settable, but it simply gives a name to the waypoint. You still need ICAO, as you point out.

You probably should include

0 (>L:ALT-AP-1,enum)
0 (>L:ALT-AP-2,enum)
0 (>L:ALT-AP-3,enum)
0 (>L:ALT-AP-4,enum)

somewhere before the User keys in his choice of alternate airport Ident. If, for example, he made a mistake the first time, then when he tries it again, he is working with zeroed L:Vars, which is what you need.

Additionally, you could try combining alternate airport Ident keyboard entry with creation of the alternate airport ICAO. Try this and see if it works for you:
Code:
<On Key="Alphanumeric"> 
 <Visible>(L:ALTAPEntry, enum) 1 ==</Visible> 
  (L:ALT-AP-3,enum) (>L:ALT-AP-4,enum)		
  (L:ALT-AP-2,enum) (>L:ALT-AP-3,enum)
  (L:ALT-AP-1,enum) (>L:ALT-AP-2,enum)
  (M:Key) (>L:ALT-AP-1,enum) 
  'A      '  // Letter A followed by six spaces
  (L:ALT-AP-4,enum) chr scat
  (L:ALT-AP-3,enum) chr scat
  (L:ALT-AP-2,enum) chr scat
  (L:ALT-AP-1,enum) chr scat	
  (>@c:FlightPlanNewWaypointICAO)			
</On>

Then you can eliminate the ICAO search code.

BTW, your Mouse code snippet contains the statement if{ } but the trailing bracket is not where it belongs. However, if you eliminate the ICAO search, that statement will be removed too ...
 
Last edited:
Thank you very much, been a long but productive day with this and really can see the light at the end of the tunnel.

I used your suggestion with the keys

Code:
<On Key="Alphanumeric"> 
 <Visible>(L:ALTAPEntry, enum) 1 ==</Visible> 
  (L:ALT-AP-3,enum) (>L:ALT-AP-4,enum)		
  (L:ALT-AP-2,enum) (>L:ALT-AP-3,enum)
  (L:ALT-AP-1,enum) (>L:ALT-AP-2,enum)
  (M:Key) (>L:ALT-AP-1,enum) 
  'A      '
  (L:ALT-AP-4,enum) chr scat
  (L:ALT-AP-3,enum) chr scat
  (L:ALT-AP-2,enum) chr scat
  (L:ALT-AP-1,enum) chr scat	
  (>@c:FlightPlanNewWaypointICAO)			
</On>

and it works great! I will get to the "Set Alternate Airport" mouse section in a minute. Once the Ident is entered the display returns to the Flight Plan Display Page (See Pic) with the addition of a button "Divert"

When this Button is pressed it changes the destination as using Bob's recommendation was what was intended.

Divert to Alternet Airport:
Code:
  <Area Left="648" Top="325" Width="100" Height="25">
  <Visible>(L:DivertToAltAP,bool)</Visible>
  <Cursor Type="Hand" /> 
  <Click> 
[COLOR="Blue"]    (@c:FlightPlanNewWaypointICAO)
    1 (>@c:FlightPlanAddWaypoint)
    2 (>@c:FlightPlanWaypointIndex) (>@c:FlightPlanDeleteWaypoint)[/COLOR]
[COLOR="Red"]    0 (>@c:FlightPlanWaypointIndex) (>@c:FlightPlanDeleteWaypoint)
    1 (>@c:FlightPlanDirectToDestination)[/COLOR]
    0 (>L:ALT-AP-1,enum) 0 (>L:ALT-AP-2,enum) 0 (>L:ALT-AP-3,enum) 0 (>L:ALT-AP-4,enum) 
    0 (>L:EnterAltAP, bool) 
    0 (>L:DivertToAltAP,bool)
    0 (>L:EnterAltAP, bool) 
    1 (>L:FPAirportInit,bool)
</Click>  
  </Area>

Code:
[COLOR="Blue"]    (@c:FlightPlanNewWaypointICAO)
    1 (>@c:FlightPlanAddWaypoint)
    2 (>@c:FlightPlanWaypointIndex) (>@c:FlightPlanDeleteWaypoint)[/COLOR]

This worked well and updated the GPS very nicely, unfortunately messed up the Flight Planner page in my gauge. So I ended up basically creating a new (Direct To) Flight plan with the edition of

Code:
[COLOR="Red"]    0 (>@c:FlightPlanWaypointIndex) (>@c:FlightPlanDeleteWaypoint)
    1 (>@c:FlightPlanDirectToDestination)[/COLOR]

and now the Flight Planner Page displays and almost correctly (see pic).

Finally back to Select Alternate Airport Mouse Section.

Code:
<!-- Set Alternate Airport BUTTON -->
  <Area Left="478" Top="635" Width="100" Height="25">
    <Visible>(L:EnterAltAP, bool)</Visible>
    <Cursor Type="Hand"/>
<Click>
     0 (>L:EnterAltAP, bool)
    'A' (>@c:IcaoSearchStartCursor)	
    (L:ALT-AP-4,number) chr (L:ALT-AP-3,number) chr 
    (L:ALT-AP-2,number) chr (L:ALT-AP-1,number) chr scat scat scat  (>@c:IcaoSearchEnterChar) 
    (@c:FlightPlanNewWaypointICAO) and 
    if{  -1 (>L:AltAPICAOXferCycleSkipCounter, enum)
          6 (>L:AltAPICAOXferCyclesToSkip, enum) 
          0 (>L:AltAPName)
          0 (>L:AltAPCity)

            (@c:FlightPlanNewWaypointICAO) (>@c:FacilityICAO) 

            (L:AltApICAOXferCycleSkipCounter, enum) ++ (>L:AltAPICAOXferCycleSkipCounter, enum)
            (L:AltAPICAOXferCycleSkipCounter, enum) (L:AltAPICAOXferCyclesToSkip, enum) &gt;= if{
      (@c:FacilityName) (>L:AltAPName)
     (@c:FacilityCity) (>L:AltAPCity)
      0 (>L:FPICAOXferCycleSkipCounter, enum) } }
    0 (>L:ALTAPEntry, enum) 
    0 (>L:SetAlternateAP,bool)	
    1 (>L:FlightPlanDisplay,bool)			
    1 (>L:DivertToAltAP,bool)			
</Click>
  </Area>

Very much a work in progress, but am thinking to have the ICAO Transfer and Cycle Counting here. I know the transfer and cycle counter is for from a working code (I will be starting at page 19 in the morning), But is this right with the way the <keys> are set up?

Code:
    'A' (>@c:IcaoSearchStartCursor)	
    (L:ALT-AP-4,number) chr (L:ALT-AP-3,number) chr 
    (L:ALT-AP-2,number) chr (L:ALT-AP-1,number) chr scat scat scat  (>@c:IcaoSearchEnterChar)

I works I just don't know if it is going to cause me grief with attempting the ICAO Transfer/Cycle Counter in this manner.

Thanks again and I am go to bed on a high note that another piece of my puzzle is completed.

Cheers
Greg
 

Attachments

  • Divert Button.jpg
    Divert Button.jpg
    155.4 KB · Views: 483
  • Direct to Alternate.jpg
    Direct to Alternate.jpg
    146.6 KB · Views: 479
Last edited:
Greg

I'm confused about the above ,
Why do you need the Keyboard entry of an "airport ICAO " ?

I might have missed something along the way , but I thought your original
concept was :-

STEP 1. When required , click and initiate a list of the 10 Airport ICAO's that are closest to the Destination airport.
( I was under the impression that you had already achieved that list )

STEP 2. 'Selection and arming' , select the preferred Alternate airport ICAO from your list of 10 , click on that ICAO and transfer it to a L:Var for storage.
ie;
ICAO > L:Var_ALT_ICAO , and
ICAO Name > L:Var_ALT_ICAO_Name , and
ICAO City > L"Var_ALT_ICAO_City
These 3 items then appear on your display screen as you Alternate.

STEP 3. 'Setting Alternate to Flight Plan' , at your discretion when wish to activate the Alternate leg , click DIVERT mouse to transfer
L:Var_ALT_ICAO > FlightPlanNewWaypointICAO
2 > FlightPlanAddWaypoint
2 > FlightPlanActiveWaypoint (set active leg to 2).

Personally I would add the Alternate at "2".
That way you avoid the 'Direct To' , your flight plan would then be ;
(0) Origin => (1) Destination => (2) Alternate.
probably more realistic , RW you fly to the destination or near it , then you might 'Hold' , then give up on waiting for weather improvement , and set you alternate from the vicinity of that destination airport.

I must admit that having the option to Keyboard enter the alternate is a much nicer touch.
Additionally with the Keyboard entry , you are not limited to the list of 10 airports , you can add any from the database , that
flexability is always handy.
My preference is to go with your Keyboard entry method , but I would seriously consider adding the Alternate at "2".

Another point ,
If you are setting an alternate , then it should be
FlightPlanAddWaypoint and 2 > FlightPlanActiveWaypoint (set active leg to 2).

If you are setting a "Divert" , then it should be
FlightPlanDirectToDestination

A subtle but important difference.

Cheers
Karol
 
Last edited:
Greg

... An "Evil and Devious" trick...

If you choose to go the "2 > FlightPlanAddWaypoint" route or method.
Just for fun try the following :-
99 > FlightPlanAddWaypoint

Now when you add your Alternate it WILL appear as Waypoint 2 in your
Flight Plan.
Then ,
Type another airport ICAO and hit your "DIVERT button , that ICAO will now
appear as Waypoint 3 in your flight plan.

You can keep on doing this and create a Long Flight Plan of any length
up to 99 Waypoints.

The 99 Index number in 99 > FlightPlanAddWaypoint allows you to keep on
adding Waypoints at the end of your Flight plan.

As I said Devious , but by the same token a handy facility.

Cheers
Karol
 
Greg,

The Divert to Alternate Airport mouse click code should be:

Code:
<Area Left="648" Top="325" Width="100" Height="25">
<Visible>(L:DivertToAltAP,bool)</Visible>
 <Cursor Type="Hand" /> 
 <Click> 
  1 (>@c:FlightPlanAddWaypoint)
  2 (>@c:FlightPlanDeleteWaypoint)
  0 (>L:EnterAltAP, bool) 
  0 (>L:DivertToAltAP,bool)
  0 (>L:EnterAltAP, bool) 
  1 (>L:FPAirportInit,bool)
 </Click>  
</Area>

[ I presume that the lines 0 (>L:EnterAltAP, bool), 0 (>L:DivertToAltAP,bool), 0 (>L:EnterAltAP, bool) and 1 (>L:FPAirportInit,bool) are what you need but only you can answer that ]

You don't need a Direct To in this situation because the FlightPlanAddWaypoint and FlightPlanDeleteWaypoint lines above edit your Flight Plan sufficiently. Presuming that your aircraft is on autopilot, if you use the revised Divert to Alternate Airport code above, you will see it turn to fly to the Alternate Airport once you press the button. The blue code and red code lines of yours will indeed mess things up.

You still need:

0 (>L:ALT-AP-1,enum) 0 (>L:ALT-AP-2,enum) 0 (>L:ALT-AP-3,enum) 0 (>L:ALT-AP-4,enum)

but it does not belong in the Divert to Alternate Airport mouse click. You need it before the User uses the keyboard to enter the alternate Ident.

Your Select Alternate Airport Mouse section... You admit its a work in progress and there are both logic and syntax mistakes in there, so why don't you work on it more and repost later? As a hint, you don't need an ICAO search anymore. You take care of the alternate airport ICAO when the User enters the alternate airport Ident on the keyboard.

Bob
 
Thank You,

Karol,
I will try and clear this up, more me than you...

Yes step one is in the flight planner page and once you have created your "Flight Plan" the user can then click on "Select Alternate AP" which takes them to the Alternate Airport Page which gives a list of ten airports around the "Destination Airport" within a 100 mile radius. At this point it is providing a reference to the user giving them the ability to view "what's around" and if they exit the Alternate Page it adds/changes nothing allowing the flight to continue as intended, but should the user decide to include an Alternate Airport to their Flight Plan it will provide them with the ability to "Divert" to their Alternate at the push of a button rather than have to set everything up last minute. I don't know if that is RW or not, but personally like that ability.

Step 2 begins when they push the "Set Alternate" button which brings up the keyboard entry box. Thanks for agrees about the Keyboard Entry and you nailed it allowing the user some flexibility and not restricted to the 10 airports because that was the main reason, the other lets just leave a experience levels.

Yes my original thoughts were save this information to (L:Var) for use at a later time or until needed, with the exception of displaying the selected Alternate Airport IDENT, Name and City. But as I work through this using Bob's suggested approach, and if I understand Bob correctly using

Code:
 (@c:FlightPlanNewWaypointICAO)

Eliminates the need for Shift Registers, ICAO transfers, etc. while providing the results that I am looking. My thoughts on what is happening with this method is I am still storing an airport for use at a later time because all I have done is created an New Waypoint, but have not actually done anything with it yet, but in return been provided with everything I need to display desired information on the Flight Planner Display and armed the "Divert" button. Also this can be reloaded anytime in the same manner I would using other methods, simplicity is great and I hope I have this right!

As for not creating waypoint 2 as the alternate right away, mostly personal preference, basically if the Alternate Airport (Waypoint 2) is not used the GPS will activate the next leg, not that it is the end of the world because it would all be deleted when the New Flight Plan is loaded. but I would prefer that if the user lands at their Destination Airport the Flight Plan is done, until the next one is loaded. This is totally my preference at this time.

The rest of what I am working on happening I think you understand and hope I cleared things up a bit, and thank you for your time in helping create this...

Bob,
Thank you, worked with this a bit this morning and realized what I was chasing yesterday. Using what I posted last night:

Code:
 <Area Left="648" Top="325" Width="100" Height="25">
  <Visible>(L:DivertToAltAP,bool)</Visible>
  <Cursor Type="Hand" /> 
  <Click> 
    (@c:FlightPlanNewWaypointICAO)
    1 (>@c:FlightPlanAddWaypoint)
    2 (>@c:FlightPlanWaypointIndex) (>@c:FlightPlanDeleteWaypoint)
    0 (>@c:FlightPlanWaypointIndex) (>@c:FlightPlanDeleteWaypoint)
    1 (>@c:FlightPlanDirectToDestination)
    0 (>L:ALT-AP-1,enum) 0 (>L:ALT-AP-2,enum) 0 (>L:ALT-AP-3,enum) 0 (>L:ALT-AP-4,enum) 
    0 (>L:EnterAltAP, bool) 
    0 (>L:DivertToAltAP,bool)
    0 (>L:EnterAltAP, bool) 
    1 (>L:FPAirportInit,bool)
</Click>  
  </Area>

I basically started out with what you suggested with:

Code:
(@c:FlightPlanNewWaypointICAO)
    1 (>@c:FlightPlanAddWaypoint)
    2 (>@c:FlightPlanWaypointIndex) (>@c:FlightPlanDeleteWaypoint)

Although I now see the point (or better no point) of having (@c:FlightPlanNewWaypointICAO) within the mouse, because where else is the new waypoint going to be created from. What was happening is what you said was happening adding a waypoint, deleting a waypoint thus re-routing the aircraft. Where I went wrong with the above was when that happened I assumed that the Alternate Airport would disappear and when it didn't I added the

Code:
0 (>L:ALT-AP-1,enum) 0 (>L:ALT-AP-2,enum) 0 (>L:ALT-AP-3,enum) 0 (>L:ALT-AP-4,enum)

and the chasing began, With this added the flight Planner would display the Alternate in the Departure line, and I continued to chase it until I ended up with the above. Unfortunately, I forgot, missed, or not thinking was all my problems started with the addition of 0 (>L:ALT-AP-1,enum).......

So what I have now is:
Code:
  <Area Left="648" Top="325" Width="100" Height="25">
  <Visible>(L:DivertToAltAP,bool)</Visible>
  <Cursor Type="Hand" /> 
  <Click> 
    1 (>@c:FlightPlanAddWaypoint)
    2 (>@c:FlightPlanDeleteWaypoint)
    0 (>L:EnterAltAP, bool) 
    0 (>L:DivertToAltAP,bool)
    0 (>L:EnterAltAP, bool) 
    1 (>L:FPAirportInit,bool)
</Click>  
  </Area>

as you suggested. To hide the Alternate Airport data after the "Divert" button is pressed I put an {if}/{else} statement in the Flight Planner <Element> string telling it if the Divert Button = 1 then display (Airport Info) else display (Not Selected). A much better approach, I think.

To clear up one thing with the zeroing of the register, yes I have it zeroed in two places - When the "Create Flight Plan" Button and "Set Alternate" Button is used. The "Create Flight Plan" was because with the destination change the Alternate would change, but am sure you realized that :o

As for the Select Alternate Airport Mouse section, yes I know it a mess and you are right I should not post until it is a more working piece. I posted because, If I am right here, I need something to record and display the keyboard inputs. But as you stated, I don't see the need to perform a search when we have already completed that, but need to look into how to achieve a better way to perform this. Any that is the piece I am working on today and will post when I have something useful and working.

Thanks again all,
Greg
 
Back
Top