Hi Greg,
I certainly understand your questions and frustrations about ICAO transfers and cycle skipping and why and under what circumstances one needs to, or doesn't need to, worry about them. It's a little complicated, isn't it? IMHO, GPS and moving map gauges such as the one you are writing represent relatively sophisticated, arguably high-end XML code that requires an adequate knowledge of flight simulator's XML and a lot of comfort with the gps variables before you have success.
Which brings me to those guidebooks. I spent a fair amount of time on explanations and examples, and all the issues you are currently working are dealt with in the guides and in various xml examples from the forums. Consequently, I often re-direct questions back to the guidebooks, as you know.
Thanks Bob,
And of course you are absolutely right, but have to say a "little complicated" is an understatement. I realize that we all have to start somewhere and fortunately, for me I have had, the support of yourself and many others to guide me as I continue to attempt to learn this. As with yourself in your beginnings , I started in this knowing nothing, As to say I didn't even know what the SDK or XML was. I started by manipulating a few gauges and learned a few what to and many
NOT to do's. Spent many hours searching why my sim crashed when I opened the gauge.
My first serious attempt at creating a gauge was a "simple" auxiliary power unit gauge that while using the (A:APU GENERATOR SWITCH, bool) gives the user, when the aircraft is on the ground, a ground power unit feature "separate" from the APU. Bill was instrumental in helping learn the "basics" and walked me through the process. Then finding Doug's sound gauge and was really excited when he sent me the latest version at the time, finding out that I could then add sounds to APU start, run, shut down and have the GPU run in the background. well It hooked me.
I think it truly amazing what the capabilities of all things FS can provide, even with it's limitations. Now that I have spent many hours starring at code and scratching my head why something doesn't work, I find myself getting annoyed when flying in a session and someone is ripping somebodies gauge apart without the first bit of knowledge as to what it took to create it or even better what the gauge is actually for or capable of.
Although I know I took on a massive undertaking with the NAVRAD with very limited ability, it has become a something, well an obsession anyway to make it something that is functional, easy to use and pleasant look at. With the main focus of not having to leave the cockpit (Flight Planner, Map, etc) to which I hope I am on track. unfortunately my knowledge of coding becomes a road block.
I also fully understand why you re-direct people back to your guidebooks, because yes, you already explained it
AND took the time and effort to make them available for everyone as a reference tool. and to say a "fair amount of time spent" well again I believe that an understatement. It is also a more than "fair" statement to say, although I know enough to be dangerous and potentially disabling, I truly don't understand the full workings of this.
But I am ranting, well procrastinating anyway, so moving on...
That said, why don't you give this a go:
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 d
(>@c:FlightPlanNewWaypointICAO)
(>@c:WaypointAirportICAO)
</On>
I have not tested duplication of the top of the stack with a string value, but I believe it will work. This sequence of code constructs the airport ICAO and then stores it into both
FlightPlanNewWaypointICAO and
WaypointAirportICAO. Those are ICAO transfers, by the way.
Then, when you want to display alternate airport information, simply use something like:
Code:
<Element>
<Visible>(L:DisplayAltAPInfo, bool) 1 ==</Visible>
<Position X="5" Y="16"/>
<FormattedText X="120" Y="20" Adjust="left" Font="Courier New" FontSize="14" Color="white" Bright="Yes">
<String>City: %((@c:WaypointAirportCity))%!s!</String>
</FormattedText>
</Element>
I tried this when I first woke up, and on the surface it never worked "
for me". I will admit haven't spent a lot of time and will pursue this more today, because I am sure it will work, just have to get the logic right.
but back to cycle counting and displays, if I may.
First I truly want to unravel the mystery in my head with this, because I think if I unlock this "mystery" in my head it could potentially open up huge potential when manipulating the gps module.
on my flight planner page the display string is this
Code:
<String>%FLIGHT PLANNER\n\n
%DEPARTURE AIRPORT:\t\t\t%(0 (>@c:FlightPlanWaypointIndex) (@c:FlightPlanWaypointIdent))%{if}%((@c:FlightPlanWaypointIdent))%!s!\t\t
%{else}%Flight is Direct To%{end}%\n
%(0 (>@c:FlightPlanWaypointIndex) (@c:FlightPlanWaypointICAO) (>@c:FacilityICAO) (@c:FacilityName))%!s!\t\t\t\t
%(0 (>@c:FlightPlanWaypointIndex) (@c:FlightPlanWaypointICAO) (>@c:FacilityICAO) (@c:FacilityName) (@c:FacilityCity))%!s!\n\n
%DESTINATION AIRPORT:\t\t\t%(1 (>@c:FlightPlanWaypointIndex) (@c:FlightPlanWaypointIdent))%!1s!\n
%(1 (>@c:FlightPlanWaypointIndex) (@c:FlightPlanWaypointICAO) (>@c:WaypointAirportICAO) (@c:WaypointAirportName))%!s!\t\t\t\t
%(1 (>@c:FlightPlanWaypointIndex) (@c:FlightPlanWaypointICAO) (>@c:WaypointAirportICAO) (@c:WaypointAirportCity))%!s!\n\n
%ALTERNATE AIRPORT:\t\t\t%((L:DivertToAltAP,bool) 1 ==)%{if}%((@c:FacilityIdent))%!s!\n
%((@c:FacilityName))%!s!\t\t\t\t
%((@c:FacilityCity))%!s!%{else}
%NOT SELECTED%{end}%\n\n
%DISTANCE TO DESTINATION:\t\t%((@c:FlightPlanWaypointDistanceTotal, nmiles))%!.1f!\{dpl=nm}\n
%HEADING TO DESTINATION:\t\t%((@c:FlightPlanWaypointMagneticHeading, degrees))%!03d!\{dplo=M}\n
</String>
Now the hurdle I face, If I understand it right, is displaying multiple incidents of the same data groups in the same display page, which I originally overcame by:
Code:
0 (>@c:FlightPlanWaypointIndex) (@c:FlightPlanWaypointICAO) (>@c:FacilityICAO) (@c:FacilityName)
1 (>@c:FlightPlanWaypointIndex) (@c:FlightPlanWaypointICAO) (>@c:WaypointAirportICAO) (@c:WaypointAirportName)
Having 0 (>@c:FlightPlanWaypointIndex) utilize the Facility Group and 1 (>@c:FlightPlanWaypointIndex) utilize the Waypoint Airport Group which alleviated any conflict of the two by separating the ICAO transfers to their respective Data Groups.
With the Edition of the Alternate Airport, I now have created a situation where I need to access the information of the same data group, enter cycle counting.
It would be so much simpler if I could:
Code:
0 (>@c:FlightPlanWaypointIndex) (@c:FlightPlanWaypointICAO) (>@c:FacilityICAO) (@c:FacilityName)
1 (>@c:FlightPlanWaypointIndex) (@c:FlightPlanWaypointICAO) (>@c:WaypointAirportICAO) (@c:WaypointAirportName)
(@c:FlightPlanNewWaypointICAO) (>@c:WaypointAirportICAO) (@c:WaypointAirportName)
No point going here, because I can't, so back to cycle counting.
When I awoke this morning from the couch where I fell asleep with the guidebook, Ironically woke up to page 15. When I realized my
Code:
(L:AltAPCycleCounterInit, enum) 1 == if{
(L:AltAPICAOXferIndexPointer, enum) ++ (>L:AltAPICAOXferIndexPointer, enum)
(L:AltAPICAOXferIndexPointer, enum) (>@c:FlightPlanNewWaypointICAO)
(L:AlternateAPWaypointICAO, enum) == if{
(@c:FlightPlanNewWaypointICAO) (>@c:FacilityICAO)
2 (>L:AltAPCycleCounterInit, enum) } }
will never work, because I am not dealing with an Index Pointer I am dealing with a set variable, although the information is stored there the gps has nothing to index to, I really hope this is right.
Originally that is why I thought about using Robbie's macros to avoid any conflict by adding the ability to store string data to (L:Vars) and just inserting
@ToString(L: DisplayThis) and @ToString(L: DisplayThat), because I could not figure out cycle counting on my last round.
So if I pursue this approach, after I work with you latest suggestion Bob, I need to figure out how to access my stored information in the cycle counter update.
My thoughts, but really need to stop procrastinating and get to work on this.
Thanks Again for everything,
Greg