January 14, 201115 yr Commercial Member Is it possible to use the XML GPS variables to set a flight plan that isn't direct to, direct to destination? As though it is an actual flight plan? Good Day, Engjell Berisha
January 14, 201115 yr Moderator Yes it is, although you won't be able to save the plan to disk.Download the honewell fmc and examine the script to learn how. :( Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
January 14, 201115 yr Author Commercial Member honeywellfmc.zip by Garrett Smith?I downloaded this and worked with it some but it won't let me set the Origin or Destination if I don't have a flight plane active at the time of use. It actually doesn't let me do anything as far as setting a route if there isn't a flight plan loaded already. Good Day, Engjell Berisha
January 14, 201115 yr Moderator Yes, that's the one. I haven't looked at it in a very long time, so obviously "misremembered" (is that even a word?) its capabilities... :( Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
January 14, 201115 yr Author Commercial Member No worries Bill, but you do say this is possible correct? To set the origin in a flight plan and destination using XML I understand you can't create or save the file using xml for the purposes of the flight would this be possible. From what limited knowledge I have I've only see that it's possible to set the destination if you will and in a direct to format. Good Day, Engjell Berisha
January 14, 201115 yr Hi,You can try the "addwaypoint" way.Difficult code, but it could work.Only have experience with navaids, not airports and that works ok.Jan Jan "Beatus ille qui procul negotiis..."
January 15, 201115 yr Author Commercial Member <!--========================================RTE-1-ORGN-DEST-SET========================================-->(L:FMC-RTE,enum) 1 == if{ (L:FMC-RTE-1-ACT,enum) 0 == (L:FMC-RTE-1-READY,enum) 1 == (L:FMC-RTE-ACTIVATE,enum) 1 == and and if{ 'A' (>@c:IcaoSearchStartCursor) 31 (>@c:enteringInput) (L:FMC-RTE-DEST-1,number) chr (L:FMC-RTE-DEST-2,number) chr (L:FMC-RTE-DEST-3,number) chr (L:FMC-RTE-DEST-4,number) chr scat scat scat (>@c:IcaoSearchEnterChar) (@c:IcaoSearchMatchedIcaosNumber) 1 == if{ (@c:IcaoSearchCurrentIcao) (>@c:FacilityICAO) } (@c:FlightPlanWaypointIndex) 0 == (@c:IcaoSearchMatchedIcaosNumber) 1 == (@c:IcaoSearchCurrentIcao) (@c:FacilityICAO) == and and if{ 1 (>@c:FlightPlanWaypointIndex) } (@c:FacilityICAO) (>@c:FlightPlanNewWaypointICAO) 'A' (>@c:IcaoSearchStartCursor) 31 (>@c:enteringInput) (L:FMC-RTE-ORGN-1,number) chr (L:FMC-RTE-ORGN-2,number) chr (L:FMC-RTE-ORGN-3,number) chr (L:FMC-RTE-ORGN-4,number) chr scat scat scat (>@c:IcaoSearchEnterChar) (@c:IcaoSearchMatchedIcaosNumber) 1 == if{ (@c:IcaoSearchCurrentIcao) (>@c:FacilityICAO) } (@c:IcaoSearchCurrentIdent) (>@c:FlightPlanNewWaypointIdent) (L:FlightPlanWaypointIndex,number) (>@c:FlightPlanAddWaypoint) ' ' (>@c:FacilityICAO) ' ' (>@c:IcaoSearchStartCursor) 0 (>L:FMC-RTE-ACTIVATE,enum) quit } } That's what I got right now, but the code only sets the Destinations airport so only the first half of the code works. It's inside a macro that's activated by a click. If you could point out what I'm doing wrong please. :( Good Day, Engjell Berisha
January 16, 201115 yr Author Commercial Member (L:FMC-POS-INIT,enum) 1 == if{ (L:FMC-UNIT-4,number) 64 > if{'A' (>@c:IcaoSearchStartCursor) 31 (>@c:enteringInput) (L:FMC-UNIT-1,number) chr (L:FMC-UNIT-2,number) chr (L:FMC-UNIT-3,number) chr (L:FMC-UNIT-4,number) chr scat scat scat (>@c:IcaoSearchEnterChar) (@c:IcaoSearchMatchedIcaosNumber) 1 == if{ (@c:IcaoSearchCurrentIcao) (>@c:FacilityICAO) (@c:FacilityLatitude,degrees) (>L:FMC-POS-REF-ARPT-LAT,degrees) (@c:FacilityLongitude,degrees) (>L:FMC-POS-REF-ARPT-LON,degrees) (L:FMC-UNIT-1,number) (>L:FMC-POS-REF-ARPT-1,number) (L:FMC-UNIT-2,number) (>L:FMC-POS-REF-ARPT-2,number)(L:FMC-UNIT-3,number) (>L:FMC-POS-REF-ARPT-3,number) (L:FMC-UNIT-4,number) (>L:FMC-POS-REF-ARPT-4,number) 1 (>L:FMC-POS-REF-ARPT,bool) 1 (>L:FMC-UNIT-EMPTY,bool) quit } els{ 1 (>L:FMC-NOT-IN-DATABASE,bool) } } els{ 1 (>L:FMC-INVALID-ENTRY,bool) quit } } Anyone understand why everything in the above piece of code works except the Facility Latitude and Longitude setting to the respective LVar's. Now I've used a string to test weather I get a number for the facility long and lat and I do but the LVar's remain at zero. :( My experience with the GPS Variables is that they're cranky sometimes and I can not figure out why they behave in certain ways at times. Good Day, Engjell Berisha
January 16, 201115 yr <!--========================================RTE-1-ORGN-DEST-SET========================================-->(L:FMC-RTE,enum) 1 == if{ (L:FMC-RTE-1-ACT,enum) 0 == (L:FMC-RTE-1-READY,enum) 1 == (L:FMC-RTE-ACTIVATE,enum) 1 == and and if{ 'A' (>@c:IcaoSearchStartCursor) 31 (>@c:enteringInput) (L:FMC-RTE-DEST-1,number) chr (L:FMC-RTE-DEST-2,number) chr (L:FMC-RTE-DEST-3,number) chr (L:FMC-RTE-DEST-4,number) chr scat scat scat (>@c:IcaoSearchEnterChar) (@c:IcaoSearchMatchedIcaosNumber) 1 == if{ (@c:IcaoSearchCurrentIcao) (>@c:FacilityICAO) } (@c:FlightPlanWaypointIndex) 0 == (@c:IcaoSearchMatchedIcaosNumber) 1 == (@c:IcaoSearchCurrentIcao) (@c:FacilityICAO) == and and if{ 1 (>@c:FlightPlanWaypointIndex) } (@c:FacilityICAO) (>@c:FlightPlanNewWaypointICAO) 'A' (>@c:IcaoSearchStartCursor) 31 (>@c:enteringInput) (L:FMC-RTE-ORGN-1,number) chr (L:FMC-RTE-ORGN-2,number) chr (L:FMC-RTE-ORGN-3,number) chr (L:FMC-RTE-ORGN-4,number) chr scat scat scat (>@c:IcaoSearchEnterChar) (@c:IcaoSearchMatchedIcaosNumber) 1 == if{ (@c:IcaoSearchCurrentIcao) (>@c:FacilityICAO) } (@c:IcaoSearchCurrentIdent) (>@c:FlightPlanNewWaypointIdent) (L:FlightPlanWaypointIndex,number) (>@c:FlightPlanAddWaypoint) ' ' (>@c:FacilityICAO) ' ' (>@c:IcaoSearchStartCursor) 0 (>L:FMC-RTE-ACTIVATE,enum) quit } } That's what I got right now, but the code only sets the Destinations airport so only the first half of the code works. It's inside a macro that's activated by a click. If you could point out what I'm doing wrong please. :( Try(@c:IcaoSearchMatchedIcaosNumber) 0 > Paul EGLD
January 16, 201115 yr Author Commercial Member Tried it, but oddly enough now neither the destination or the origin will set. Good Day, Engjell Berisha
January 30, 201115 yr Author Commercial Member Still haven't figure this one out, but I'm close.I do have anther odd problem though, I am using the FS9GPS module to figure the LAT/LON position of a reference airport entered into the gauge, now here's the code I've been using it's wrapped in a macro and triggered by a click: <!--========================================POSITION-REFERENCE-AIRPORT========================================--> (L:FMC-POS,enum) 1 == if{ (L:FMC-UNIT-4,number) 64 > if{'A' (>@c:IcaoSearchStartCursor) 31 (>@c:enteringInput) (L:FMC-UNIT-1,number) chr (L:FMC-UNIT-2,number) chr (L:FMC-UNIT-3,number) chr (L:FMC-UNIT-4,number) chr scat scat scat (>@c:IcaoSearchEnterChar) (@c:IcaoSearchMatchedIcaosNumber) 1 == if{ (@c:IcaoSearchCurrentIcao) (>@c:FacilityICAO) (@c:FacilityICAO) (>@c:WaypointAirportICAO) (@c:WaypointAirportLatitude,degrees) (>L:FMC-POS-REF-ARPT-LAT,degrees) (@c:WaypointAirportLongitude,degrees) (>L:FMC-POS-REF-ARPT-LON,degrees) (L:FMC-UNIT-1,number) (>L:FMC-POS-REF-ARPT-1,number) (L:FMC-UNIT-2,number) (>L:FMC-POS-REF-ARPT-2,number)(L:FMC-UNIT-3,number) (>L:FMC-POS-REF-ARPT-3,number) (L:FMC-UNIT-4,number) (>L:FMC-POS-REF-ARPT-4,number) 1 (>L:FMC-POS-REF-ARPT,bool) 1 (>L:FMC-UNIT-EMPTY,bool) quit } els{ 1 (>L:FMC-NOT-IN-DATABASE,bool) } } els{ 1 (>L:FMC-INVALID-ENTRY,bool) quit } } Now the problem I have is everything seems to be working except for the LAT LON lvars setting, they only set at one time when I was testing the gauge and had used a string to see the waypoint icao and facility and icao search strings and make sure they were working properly. Now this set the LAT LON lvars properly every time, but since removing the text elements it will no longer work odd thing is I can not understand what they have to do with one another?I have one thought at the moment, I know sometimes the FS9GPS values won't be set or won't allow to set if they're in anything but a click and I don't know why that is.. Good Day, Engjell Berisha
January 30, 201115 yr Moderator Now this set the LAT LON lvars properly every time, but since removing the text elements it will no longer work odd thing is I can not understand what they have to do with one another?Leave in the text elements, but set them to be "invisible." It is necessary for your XML script to dynamically recast the string returned to a FLOAT64 variable value. Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
February 2, 201115 yr A couple of things you might consider:1. You don't need the 31 (>@g:enteringInput). It isn't doing anything for you in its current use. You never need any of the @g functions in your own gauge for that matter. The gps variables are always sufficient to interact with the gps engine. The @g custom functions are part of the gps.dll module and you could make use of them if you want and understand what they do for your code, but it looks like they were written to simplify or facilitate certain parts of the gps_500 gauge (and whatever the equivalent gps xml gauge is in FSX) --- but, again, not required to interact with any part of the gps engine.2. You don't need the double ICAO transfers. First is IcaoSearchCurrentIcao to FacilityIcao. Second is FacilityIcao to WaypointAirportIcao. Either of the following would work: IcaoSearchCurrentIcao to WaypointAirportIcao, then assign the Lat and Lon to your L:Vars just as you have coded it, or IcaoSearchCurrentIcao to FacilityIcao then use FacilityLatitude and Longitude rather than WaypointAirportLatitude and Longitude to set your L:Vars. Why do you need L:Vars anyway since you can read (Get) Lat and Lon from the gps variables in the first place? 3. If you are limiting the Ident / Icao search to just airports, then you actually don't even need IcaoSearch since airport Idents are unique (Idents of the other facilities - NDBs, VOR/ILS/LOC, Intersections are not always unique and IcaoSearch is necessary then). Concatenating 'A _ _ _ _ _ _' (A followed by six spaces) with an airport Ident equals an airport ICAO. If a valid airport Ident is entered into L:FMC-UNIT-X, enum (enum would probably be clinically better than number, I suppose, but number units will work) and StartCursor is 'A', then you will have 1 ICAO match, and no more than 1. The same cannot be said when searching the other facility Ident/Icaos.4. Icao transfers are an "asynchronous" operation. You cannot transfer IcaoSearchCurrentIcao into the WaypointAirport or Facility group and also retrieve information such as Lat and Lon from that group in the same gauge update cycle. There are a couple of cycle skipping techniques. First is cycle counting/toggling. ICAO transfers are usually a one cycle-skip operation and a cycle toggle might work (but don't use that technique with Nearest searches - they require many cycles). But a better approach is to let the gauge tell you when it's ready for the Airport group or Facility group query. This is similar to the approach used in the FS9 gps_500 gauge where, for example, screen display loops of search results do not begin until ItemsNumber is greater than zero (see line 2016 in the gps_500 gauge). For your gauge, you might try delaying the L:Var Lat and Lon set by including something like (C:fs9gps:WaypointAirportRunwaysNumber) 0 > if{ (@c:WaypointAirportLatitude,degrees) (>L:FMC-POS-REF-ARPT-LAT,degrees) (@c:WaypointAirportLongitude,degrees) (>L:FMC-POS-REF-ARPT-LON,degrees) } Another question - I take it you are entering characters using mouse click areas on your gauge rather than direct keyboard entry... is that right? You might try direct keyboard entry and see how you like it. IcaoSearchEnterChar and NameSearchEnterChar really are nice (and very easy) using direct keyboard entry. Try that and see if it helps. Bobp.s., it's too bad that you cannot accomplish what you originally intended - to create a Flight Plan in xml. As Bill said, you cannot save (or create) a Flight Plan in xml. You can edit one that is already loaded using the FlightPlanNewWaypoint and FlightPlanNewApproach variables, but, of course, if the Flight Plan is already loaded, then it already has a departure and destination airport by definition.
February 2, 201115 yr Author Commercial Member Bill, I thought to do that, but was just annoyed by the fact that I had to. I suppose it'll do, thank you.Bob,1 - I have no clue what entering input is for and I was told some time long ago that it was required for an icaosearch so I always included it. I'll try without it.2 - I need them to set as L:Vars because that way they won't change every time I run a search or something as the gauge will use this function many times.3 - I seem to understand the concept of what you're saying, but I think if you could post the code version of what you're trying to tell me it may help more. I believe you're saying that if I did: 'A_ _ _ _ _ _' (>@c:IcaoSearchStartCursor) should refine the search to just Airports - although I'm not sure I've got it perfectly right.4 - I will try including that line and see if it works.5 - I have incorporated a keyboard entry type but it's a really complex gauge so I've to find a way to register keyboard entries into my FMC-UNIT lvars thence work it round that way as the FMC-UNIT lvars allow the user to type anything at any time.So you're saying that I is impossible to set the departure airport and destination via xml? Even if I were to some how figure out a way to add a waypoint to the current flight and make that waypoint the departure airport? Good Day, Engjell Berisha
Create an account or sign in to comment