|
| ... | Среда, 25.12.2024, 20:42
Приветствую Вас Гость | RSS |
Setting Departure & Destination with XML?
| |
cassini-m | Дата: Пятница, 12.08.2011, 06:47 | Сообщение # 26 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| Code (L:FMC-RTE-1,enum) 1 == if{ (L:FMC-RTE-1-ACT,enum) 0 == (L:FMC-RTE-1-READY,enum) 1 == (L:FMC-RTE-1-ACTIVATE,enum) 1 == and and if{
'A' (>@c:IcaoSearchStartCursor) (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,number) 0 > if{ (@c:IcaoSearchCurrentIcao) (>@c:FlightPlanNewWaypointICAO) }
1 (>@c:FlightPlanDirectToDestination)
'A' (>@c:IcaoSearchStartCursor) (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)
0 (>@c:FlightPlanWaypointIndex)
(@c:IcaoSearchMatchedIcaosNumber,number) 0 > if{ (@c:IcaoSearchCurrentICAO) (>@c:FlightPlanNewWaypointICAO) }
1 (>@c:FlightPlanAddWaypoint)
' ' (>@c:FacilityICAO) ' ' (>@c:IcaoSearchStartCursor)
1 (>L:FMC-RTE-1-ACT,enum) 0 (>L:FMC-RTE-1-ACTIVATE,enum) quit } }
The above code works perfectly. It sets the FMC-RTE-DEST series to the second waypoint of the flight and FMC-RTE-ORGN as the first waypoint. Actually quite simple, I just had some syntax errors that I didn't understand enough to rid.
Thanks everyone! Everything is working very well now, just have to continue coding some other small things. Rest assured I'll be back with more trivial things to ask soon!
|
|
| |
Robert | Дата: Пятница, 12.08.2011, 06:47 | Сообщение # 27 |
Группа: Удаленные
| Glad you got it working. But, what are you doing with the aircraft position waypoint? Is that not still in your Flight Plan?
|
|
| |
cassini-m | Дата: Пятница, 12.08.2011, 06:48 | Сообщение # 28 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| I'm not sure what you mean by aircraft position waypoint.
|
|
| |
Robert | Дата: Пятница, 12.08.2011, 06:48 | Сообщение # 29 |
Группа: Удаленные
| hmmm...
After you execute your code, how many Waypoints do you have in your Flight Plan? And, what are they? Is that what you were expecting?
|
|
| |
cassini-m | Дата: Пятница, 12.08.2011, 06:48 | Сообщение # 30 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| Posted 21 February 2011 - 11:38 PM If the origin is PHMK for example and the destination PHUP, if I activate then execute the code I get a resulting flight plan with two waypoints. Of which PHMK is the first waypoint of the flight plan and PHUP is the second. That's exactly what I was expecting.
Although it was working fine the first day or so. I just tried it twice again and it crashed the simulator. This may be my own doing as I may have unintentionally edited some of the code without knowing so. I will check it as soon as I return from school tomorrow.
|
|
| |
Robert | Дата: Пятница, 12.08.2011, 06:48 | Сообщение # 31 |
Группа: Удаленные
| Interesting. To me, it looks like your code should yield 3 waypoints. FlightPlanDirectToDestination produces two. FlightPlanAddWaypoint adds one. Total = 3.
About the crash to desktop... you say this started after further edits. Does your code now include any of the following gps variables?
FlightPlanDescription FlightPlanDepartureAirportIdent FlightPlanDepartureName FlightPlanDestinationAirportIdent FlightPlanDestinationName
If so, comment them out and see if that fixes your crash.
By the way, are you FS9 or FSX?
Good luck
|
|
| |
cassini-m | Дата: Пятница, 12.08.2011, 06:49 | Сообщение # 32 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| Quote (Robert) Interesting. To me, it looks like your code should yield 3 waypoints. FlightPlanDirectToDestination produces two. FlightPlanAddWaypoint adds one. Total = 3.
About the crash to desktop... you say this started after further edits. Does your code now include any of the following gps variables?
FlightPlanDescription FlightPlanDepartureAirportIdent FlightPlanDepartureName FlightPlanDestinationAirportIdent FlightPlanDestinationName
If so, comment them out and see if that fixes your crash.
By the way, are you FS9 or FSX?
Good luck FlightPlanDirectToDestination only yields one waypoint, in the example case it yields PHUP. And FlightPlanAddWaypoint allows for FlightPlanNewWaypointICAO to go through in the example of PHMK as the second waypoint but it comes in before PHUP.
Actually, I'm not sure I've edited anything. I may have unintentionally but intentionally I've not made any changes. Only the code you see above your post. I've not used any of those variables you mentioned.
I'm personally FS9 but this is made to work on both.
|
|
| |
Robert | Дата: Пятница, 12.08.2011, 06:49 | Сообщение # 33 |
Группа: Удаленные
| If you are starting with no Flight Plan loaded, that is not possible.
|
|
| |
cassini-m | Дата: Пятница, 12.08.2011, 06:50 | Сообщение # 34 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| Code 'A' (>@c:IcaoSearchStartCursor) (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)
0 (>@c:FlightPlanWaypointIndex)
(@c:IcaoSearchMatchedIcaosNumber,number) 0 > if{ (@c:IcaoSearchCurrentIcao) (>@c:FlightPlanNewWaypointICAO) }
1 (>@c:FlightPlanDirectToDestination)
The above code (assuming DEST is equivalent to PHUP) will produce one waypoint that waypoint being PHUP.
Now, from the below code: Code (L:FMC-RTE-1,enum) 1 == if{ (L:FMC-RTE-1-ACT,enum) 0 == (L:FMC-RTE-1-READY,enum) 1 == (L:FMC-RTE-1-ACTIVATE,enum) 1 == and and if{
'A' (>@c:IcaoSearchStartCursor) (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)
0 (>@c:FlightPlanWaypointIndex)
(@c:IcaoSearchMatchedIcaosNumber,number) 0 > if{ (@c:IcaoSearchCurrentIcao) (>@c:FlightPlanNewWaypointICAO) }
1 (>@c:FlightPlanDirectToDestination)
'A' (>@c:IcaoSearchStartCursor) (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)
0 (>@c:FlightPlanWaypointIndex)
(@c:IcaoSearchMatchedIcaosNumber,number) 0 > if{ (@c:IcaoSearchCurrentICAO) (>@c:FlightPlanNewWaypointICAO) }
1 (>@c:FlightPlanAddWaypoint)
' ' (>@c:FacilityICAO) ' ' (>@c:IcaoSearchStartCursor)
1 (>L:FMC-RTE-1-ACT,enum) 0 (>L:FMC-RTE-1-ACTIVATE,enum) } quit }
When I comment out 1 (>@c:FlightPlanAddWaypoint) everything works fine, when I leave it included then the flight simulator crashes. This only happens if (@c:FlightPlanDirectToDestination) equals 1. I assume that this is because the simulator will not allow more then one waypoint when you tell it that the flight plan is a direct flight plan to the destination.
I wish there was a document that explained all the GPS Variables and what end they served although some are self-explanatory, the trouble is some of them require certain conditions.
This is proving quite the troublesome piece of code.
If someone could point out what is wrong in the below code I would greatly appreciate that:
Code <!--==================================FMC-POS-REF-ARPT-LOGIC==================================--> <!--==================================FMC-POS-REF-ARPT-LOGIC==================================--> <!--==================================FMC-POS-REF-ARPT-LOGIC==================================--> <!--==================================FMC-POS-REF-ARPT-LOGIC==================================--> <!--==================================FMC-POS-REF-ARPT-LOGIC==================================-->
(@c:NearestAirportCurrentDistance,Nm) 5 < (L:FMC-POS-REF-ARPT-MATCHED,bool) 1 == and if{ 1 (>L:FMC-IRU-REF,bool) } els{ 0 (>L:FMC-IRU-REF,bool) }
(L:FMC-POS,enum) 1 == (L:FMC-UNIT-4,number) 64 > and if{ 'A' (>@c:IcaoSearchStartCursor)
(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:WaypointAirportICAO) } }
The above code is nestled into one massive Update tag that includes many other variables. When I place this code higher up above some other code it disables all the code underneath it. Why? I can not understand? It doesn't seem to work well either.
Thank You for all your help!
|
|
| |
Robert | Дата: Пятница, 12.08.2011, 06:51 | Сообщение # 35 |
Группа: Удаленные
| That's a nice, thorough response. I hope I am able to help, or help a little more at least.
Concerning your DirectToDestination code section, there's no critical error I see in what you have posted that would cause the sim to crash. Your code works fine, but again, I wonder if you are expecting different results from FlightPlanDirectToDestination than me. I keep saying that it always creates a Flight Plan containing two Waypoints. You keep saying it produces one Waypoint. To keep from going around in a circle yet again, I attach the following xml code. It's a complete gauge, and it uses your exact FlightPlanDirectToDestination code. It works flawlessly. Great job. It just does not behave quite like you keep telling me. I refer to line numbers, so you'll need to copy it into your xml editor. Hopefully, you'll also install the gauge and watch what FlightPlanDirectToDestination does.
Code <Gauge Name="DVA 1" Version="1.0"> <Size X="650" Y="300" />
<Macro Name="c">C:fs9gps</Macro> <Macro Name="C">C:fs9gps</Macro> <Update> </Update> <Element Name="BACKGROUND RECTANGLE"> <Position X="0" Y="0"/> <Rectangle Width="650" Height="300" FillColor="white" Bright="Yes" /> </Element> <Element Name="FLIGHT PLAN EDITOR BACKGROUND RECTANGLE"> <Position X="5" Y="25"/> <Rectangle Width="180" Height="160" FillColor="gray" Bright="Yes"/> </Element> <Element Name="RELOAD GAUGES - Rectangle and 'R' "> <Element Name="Background"> <Position X="634" Y="0"/> <Rectangle Width="16" Height="16" FillColor="red" Bright="Yes"/> </Element> <Element Name="R"> <Position X="637" Y="0"/> <FormattedText X="470" Y="375" Adjust="left" Font="Arial Bold" FontSize="14" Color="white" Bright="Yes"> <String>R</String> </FormattedText> </Element> </Element> <Element Name="ORANGE - CLEAR IDENT ENTRIES"> <Position X="95" Y="50"/> <Rectangle Width="16" Height="16" FillColor="orange" Bright="Yes"/> </Element> <Element Name="GRAY - ORIGIN IDENT"> <Position X="85" Y="110"/> <Rectangle Width="16" Height="16" FillColor="silver" Bright="Yes"/> </Element> <Element Name="PURPLE - DESTINATION IDENT"> <Position X="85" Y="130"/> <Rectangle Width="16" Height="16" FillColor="purple" Bright="Yes"/> </Element> <Element Name="GREEN - MAKE FLIGHT PLAN"> <Position X="85" Y="150"/> <Rectangle Width="16" Height="16" FillColor="green" Bright="Yes"/> </Element> <Element Name="GRAY - ORIGIN IDENT BORDER"> <Position X="85" Y="110"/> <Visible> (L:FPEntry, enum) 1 == </Visible> <Rectangle Width="16" Height="16" Color="white" Bright="Yes"/> </Element> <Element Name="PURPLE - DESTINATION IDENT BORDER"> <Position X="85" Y="130"/> <Visible> (L:FPEntry, enum) 2 == </Visible> <Rectangle Width="16" Height="16" Color="white" Bright="Yes"/> </Element> <Element Name="BUTTON TITLES"> <Position X="10" Y="105"/> <FormattedText X="100" Y="140" Font="Courier New" FontSize="10" LineSpacing="20" Color="#100000" Bright="Yes" > <Color Value="dimgray"/> <String> ORIGIN IDENT\n DESTIN IDENT\n % MAKE FP </String> </FormattedText> </Element> <Element Name="CLEAR and CANCEL KEYBD ENTRY BUTTON TITLE"> <Position X="10" Y="48"/> <FormattedText X="150" Y="60" Font="Courier New" FontSize="10" LineSpacing="15" Color="#100000" Bright="Yes" > <String> CLEAR IDENTS and \n CANCEL KEYBOARD DIRECT ENTRY </String> </FormattedText> </Element> <Element Name="ORIGIN IDENT READBACK"> <Position X="110" Y="112" /> <FormattedText X="50" Y="20" Adjust="left" Fixed="Yes" Font="courier new" Color="#101010" Bright="Yes" FontSize="12"> <String>%((L:FMC-RTE-ORGN-4,enum) chr (L:FMC-RTE-ORGN-3,enum) chr scat (L:FMC-RTE-ORGN-2,enum) chr scat (L:FMC-RTE-ORGN-1,enum) chr scat)%!s!%</String> </FormattedText> </Element> <Element Name="DESTINATION IDENT READBACK"> <Position X="110" Y="132" /> <FormattedText X="50" Y="20" Adjust="left" Fixed="Yes" Font="courier new" Color="#101010" Bright="Yes" FontSize="12"> <String>%((L:FMC-RTE-DEST-4,enum) chr (L:FMC-RTE-DEST-3,enum) chr scat (L:FMC-RTE-DEST-2,enum) chr scat (L:FMC-RTE-DEST-1,enum) chr scat)%!s!%</String> </FormattedText> </Element> <Element Name="FLIGHT PLAN DISPLAY"> <Position X="200" Y="10"/> <FormattedText X="1000" Y="800" Font="Courier New" FontSize="10" LineSpacing="12" Color="#100000" Bright="Yes" > <Color Value="blue"/> <Color Value="darkgreen"/> <String> \{clr2}MAKE FLIGHT PLAN\n\n \{clr3}FlightPlanTitle: %((C:fs9gps:FlightPlanTitle))%!s!\n FlightPlanWaypointsNumber: %((C:fs9gps:FlightPlanWaypointsNumber))%!2d! % FlightPlanIsActiveFlightPlan: %((C:fs9gps:FlightPlanIsActiveFlightPlan))%!2d!\n \n \{clr2}----------------------------- FlightPlanWaypoint -------------------------------\n % ICAO 111 Mag Dist\n Idx 123456789012 Ident Alt Type Hdg Lat Lon Dist Ttl\n %((@c:FlightPlanWaypointsNumber) s2 0 !=) %{if} %(0 sp1) %{loop} %(l1 (>@c:FlightPlanWaypointIndex)) \{clr}%((@c:FlightPlanWaypointIndex))%!-3d! %((@c:FlightPlanWaypointICAO))%!14s! %((@c:FlightPlanWaypointIdent))%!7s! %((@c:FlightPlanWaypointAltitude, feet))%!6d! %((@c:FlightPlanWaypointType))%!5d! %((@c:FlightPlanWaypointMagneticHeading, degrees))%!5d! %((@c:FlightPlanWaypointLatitude, degrees))%!11.5f! %((@c:FlightPlanWaypointLongitude, degrees))%!11.5f! %((@c:FlightPlanWaypointDistance, nmiles))%!9.2f! %((@c:FlightPlanWaypointDistanceTotal, nmiles))%!9.1f!\n %(l1 ++ s1 l2 <) %{next} %{end} </String> </FormattedText> </Element> <!-- <Element Name="USE THIS TO CRASH THE SIM"> <Position X="10" Y="190" /> <FormattedText X="150" Y="20" Adjust="left" Fixed="Yes" Font="courier new" Color="#101010" Bright="Yes" FontSize="12"> <String>%((C:fs9gps:FlightPlanDestinationAirportIdent) slen)%!d!%</String> </FormattedText> </Element> --> <Mouse> <!-- RELOAD GPS GAUGE --> <Area Left="634" Top="0" Width="16" Height="16"> <Cursor Type="Hand"/> <Click> (>K:RELOAD_PANELS) </Click> </Area> <!-- ORANGE - CLEAR IDENTS and CANCEL KEYBD DIRECT ENTRY --> <Area Left="95" Top="50" Width="16" Height="16"> <Cursor Type="Hand"/> <Click> 0 (>L:FMC-RTE-ORGN-1,enum) 0 (>L:FMC-RTE-ORGN-2,enum) 0 (>L:FMC-RTE-ORGN-3,enum) 0 (>L:FMC-RTE-ORGN-4,enum) 0 (>L:FMC-RTE-DEST-1,enum) 0 (>L:FMC-RTE-DEST-2,enum) 0 (>L:FMC-RTE-DEST-3,enum) 0 (>L:FMC-RTE-DEST-4,enum) 0 (>L:FPEntry, enum) </Click> </Area> <!-- GRAY - ENTER ORIGIN IDENT --> <Area Left="85" Top="110" Width="16" Height="16"> <Cursor Type="Hand"/> <Click> 1 (>L:FPEntry, enum) </Click> </Area> <!-- PURPLE - ENTER DESTINATION IDENT --> <Area Left="85" Top="130" Width="16" Height="16"> <Cursor Type="Hand"/> <Click> 2 (>L:FPEntry, enum) </Click> </Area> <!-- GREEN - MAKE FLIGHT PLAN BUTTON --> <Area Left="85" Top="150" Width="16" Height="16"> <Cursor Type="Hand"/> <Click> 'A' (>@c:IcaoSearchStartCursor) (L:FMC-RTE-DEST-4,number) chr (L:FMC-RTE-DEST-3,number) chr (L:FMC-RTE-DEST-2,number) chr (L:FMC-RTE-DEST-1,number) chr scat scat scat (>@c:IcaoSearchEnterChar) 0 (>@c:FlightPlanWaypointIndex) (@c:IcaoSearchMatchedIcaosNumber,number) 0 > if{ (@c:IcaoSearchCurrentIcao) (>@c:FlightPlanNewWaypointICAO) } 1 (>@c:FlightPlanDirectToDestination)
'A' (>@c:IcaoSearchStartCursor) (L:FMC-RTE-ORGN-4,number) chr (L:FMC-RTE-ORGN-3,number) chr (L:FMC-RTE-ORGN-2,number) chr (L:FMC-RTE-ORGN-1,number) chr scat scat scat (>@c:IcaoSearchEnterChar) 0 (>@c:FlightPlanWaypointIndex) (@c:IcaoSearchMatchedIcaosNumber,number) 0 > if{ (@c:IcaoSearchCurrentICAO) (>@c:FlightPlanNewWaypointICAO) } 1 (>@c:FlightPlanAddWaypoint) </Click> </Area> </Mouse>
<Keys> <On Key="Alphanumeric"> <!-- ORIGIN IDENT DIRECT KEYBOARD ENTRY --> <Visible>(L:FPEntry, enum) 1 ==</Visible> (L:FMC-RTE-ORGN-3,enum) (>L:FMC-RTE-ORGN-4,enum) (L:FMC-RTE-ORGN-2,enum) (>L:FMC-RTE-ORGN-3,enum) (L:FMC-RTE-ORGN-1,enum) (>L:FMC-RTE-ORGN-2,enum) (M:Key) (>L:FMC-RTE-ORGN-1, enum) </On> <On Key="Alphanumeric"> <!-- DESTINATION IDENT DIRECT KEYBOARD ENTRY --> <Visible>(L:FPEntry, enum) 2 ==</Visible> (L:FMC-RTE-DEST-3,enum) (>L:FMC-RTE-DEST-4,enum) (L:FMC-RTE-DEST-2,enum) (>L:FMC-RTE-DEST-3,enum) (L:FMC-RTE-DEST-1,enum) (>L:FMC-RTE-DEST-2,enum) (M:Key) (>L:FMC-RTE-DEST-1, enum) </On> </Keys> </Gauge>
Preliminaries:
First, create a flight that has no flight plan. The gauge will show no Flight Plan detail and FlightPlanWaypointsNumber and FlightPlanIsActiveFlightPlan will both be zero. Next, click the gray box and type in - using your keyboard - the four character Origin Ident Then, click the purple box and type in the four character Destination Ident Then, click the green box and your FlightPlanDirectToDestination code will be executed.
This results in three waypoints, the first of which is the current aircraft position. It has to be this way because FlightPlanDirectToDestination is usually used in-flight, so the starting Waypoint must be the precise aircraft position. Now, if you want to see only what FlightPlanDirectToDestination is doing without the FlightPlanAddWaypoint step, then comment out lines 182 through and including 188 and run it again. Now, there's two Waypoints added as a result of FlightPlanDirectToDestination alone.
Even if you had an active Flight Plan with 12 Waypoints, or any number of Waypoints, when you execute FlightPlanDirectToDestination, it will replace all of your existing FP and add a brand new, two-Waypoint FP.
Some observations about your code:
Both of your 0 (>@c:FlightPlanWaypointIndex) statements are unnecessary in their present context. Remove them and see. FlightPlanDirectToDestination does not require an argument. You can specify one as you have done, but it isn't necessary. In fact, you can use 123 (>@c:FlightPlanDirectToDestination) and it does not care.
Concerning the sim crash. I do not think it has to do with the value of the argument used with FlightPlanDirectToDestination - that's irrelevant. But, I believe it does have to do with executing a FlightPlanDirectToDestination statement. As far as I can tell, one must be very careful about gps variables used following a DirectToDestination statement because the first, and often the second Waypoint of a DirectTo Flight Plan has no ICAO. So, if a variable needs the ICAO or Ident of a Waypoint in a DirectTo FP, it may cause the sim to crash. Anyway, that's my theory. But, remove the comment tags at line 130 and 137, and the first time line 134 is executed after a FlightPlanDirectToDestination has been executed, the sim will crash. You may have succeeded in making your sim crash by some other means, but I think you are right that it happens after FlightPlanDirectToDestination. You didn't post your code, so it's impossible to tell, but even if you had, I might only be just guessing.
Your NearestAirportCurrentDistance section. You didn't post the code showing the set-up of your Nearest search. Are you sure you did that correctly? Did you provide sufficient cycle skips to give the gps engine time to run the Nearest search before running the rest of that code? That's where I would look first. Nearest searches are by far and away the biggest cycle consuming operation you can do with the gps module.
Finally, the lack of gps documentation issue. Hang in there. I'll upload something to the BlackBox website in a week or so that will help greatly, I hope.
All of us that work with the gps module are really learning about it in real time. Don't give up.
|
|
| |
@737@ | Дата: Пятница, 12.08.2011, 06:51 | Сообщение # 36 |
Полковник
Группа: Персонал
Сообщений: 104
Награды: 0
Репутация: 0
Замечания: 0%
Статус: Не в сети
| I can confirm the 2 waypoints when using "Direct to". In the normal gps you only see the magenta course line and destination symbol with ICAO; Using custom symbols, including lat and lon, you see the same, but also a symbol at the origin (without ICAO) as a prove that there are 2 waypoints. The first is of course the aircraft position at the moment you press "Direct to".
|
|
| |
@737@ | Дата: Пятница, 12.08.2011, 06:51 | Сообщение # 37 |
Полковник
Группа: Персонал
Сообщений: 104
Награды: 0
Репутация: 0
Замечания: 0%
Статус: Не в сети
| Btw. what is the link to the BlackBox website?
Thanks,
|
|
| |
Robert | Дата: Пятница, 12.08.2011, 06:52 | Сообщение # 38 |
Группа: Удаленные
| Quote (@737@) Btw. what is the link to the BlackBox website? Thanks, www.robbiemcelrath.com/blackbox/
|
|
| |
cassini-m | Дата: Пятница, 12.08.2011, 06:52 | Сообщение # 39 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| I used the gauge as you said, it resulted in a crash again. I think it may have to do with something in my gauge, perhaps one of the macros. But I don't understand what could do this. I'll experiment and see what if anything helps.
As far as the nearest code, I have set it up higher up in the update text but it's several thousand lines of text and I just didn't show it. I'm fairly certain that I've set it up right as I've tested it and get good returns on all the variables. I'm not sure why it's behaving that way but I'll check.
Why isn't (>@c:FlightPlanWaypointIndex) needed? I've always been told that without it the flight plan and waypoints wouldn't work well.
I thought that (>@c:FlightPlanDirectToDestination) wouldn't require an argument but wasn't sure. Thank You.
I also now understand what you meant by Direct to Destination creating two waypoints, but I just meant that it only produces one valid waypoint that actually exists somewhere in the database if you will. A VOR/DME/NDB/INT/ARPT etc. But I do know that it produces and considers the location at the time direct to destination is set as a waypoint. It's just it won't show that on there.
I'll keep experimenting and get back asap.
|
|
| |
cassini-m | Дата: Пятница, 12.08.2011, 06:52 | Сообщение # 40 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| 1 (>@c:FlightPlanAddWaypoint)
Is causing the crash in both cases, your gauge and my gauge.
It only works if I had loaded a flight plan using the flight planner in the beginning. If I were to do that and run the code it would replace the flight plan with the ORGN and DEST variables. It also works as many times after I use it after the flight plan was initially loaded.
|
|
| |
Robert | Дата: Пятница, 12.08.2011, 06:53 | Сообщение # 41 |
Группа: Удаленные
| A DirectToDestination statement only needs to know the latitude and longitude of the destination point. The origin is always the current aircraft position (x,y,z) and the gps module accesses that without any instruction from you. But, you do need to provide the destination lat, lon, which you accomplish when you provide the ICAO of the destination airport (FlightPlanNewWaypointIcao). Summarizing, the basic concept is that DirectToDestination always establishes a two-Waypoint Flight Plan, so there is never any ambiguity about the WaypointIndex of the DirectTo Waypoint - it's always 1, and the current aircraft position Waypoint is always WaypointIndex 0.
Now, if you had an existing Flight Plan already active and you wanted to initiate a DirectTo to, say, WaypointIndex 4 of the Flight Plan, then you would use FlightPlanWaypointIndex as follows: Code 4 (>C:fs9gps:FlightPlanWaypointIndex) (C:fs9gps:FlightPlanWaypointICAO) (>C:fs9gps:FlightPlanNewWaypointICAO) (>C:fs9gps:FlightPlanDirectToDestination)
Afterward, the current aircraft position is WaypointIndex 0 and the old WaypoinIndex 4 is the new WaypointIndex 1.
Concerning the FlightPlanAddWaypoint side of things, the argument itself is the index pointer that tells where in the Flight Plan the new Waypoint is to be added. So, if you want to add a new Waypoint to become the new WaypointIndex 1, the instruction would be:
Code 1 (>C:fs9gps:FlightPlanAddWaypoint)
No FlightPlanWaypointIndex needed.
Don't forget that AddWaypoint does not replace WaypointIndex 1, it just adds the new Waypoint at Index 1 position. Consequently, whatever had been WaypointIndex 1 before, just became WaypointIndex 2. 2 becomes 3, and so forth.
Quote I just meant that it only produces one valid waypoint that actually exists somewhere in the database if you will.
Not necessarily. You can use DirectToDestination to proceed to a user-defined Waypoint. In this case, the new Flight Plan that DirectToDestination produces will include two type 5 Waypoints, neither of which will have an ICAO.
Quote I've always been told that without it the flight plan and waypoints wouldn't work well.
As you know, advice offered in this forum can sometimes be quick, shoot from the hip guessing, not backed up with specific example or explanation. That's all the time most of us have to devote to a response. You need to verify things in detail, for yourself, in order to really learn the truth. Tom Aguilo was very good at reminding people to do that...
Your sim crash ... keep hunting for the cause. I have no problems whatsoever with the gauge I supplied in the previous post. Do you do any operations involving (eg, gps variables that use) either of the two Waypoints created by DirectToDestination? If you don't, or feel you can't, post code, then nobody can help too much.
|
|
| |
cassini-m | Дата: Пятница, 12.08.2011, 06:53 | Сообщение # 42 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| Problem Solved: I had been using FlightPlanDepartureAirportIdent FlightPlanDestinationAirportIdent in another gauge all together, I wasn't aware that it could cause a problem. I suppose the use of those variables anywhere on the panel is dooming.
After going through roughly 10,000 lines or so of code in my FMC gauge, to no avail I just ended up commenting out sections of other gauges when it work fine. I'll have to figure out another way to get those values then.
The only reason I didn't post the code is because I felt it was incredibly length and unrealistic of me to expect anyone to go through it. I thank you all for your input!
I'll post more when I can, for now I've got to run.. Thank You!
|
|
| |
cassini-m | Дата: Пятница, 12.08.2011, 06:53 | Сообщение # 43 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| Back with another problem.... Code <!--========================================RTE-ADD-WPT========================================-->
(L:FMC-RTE-1,enum) 2 >= if{ (L:FMC-UNIT-3,number) 64 > (L:FMC-MSG-DEL-USE,bool) 0 == and if{
'A' (>@c:IcaoSearchStartCursor)
(L:FMC-UNIT-1,number) chr (L:FMC-UNIT-2,number) chr (L:FMC-UNIT-3,number) chr (L:FMC-UNIT-4,number) chr (L:FMC-UNIT-5,number) chr (L:FMC-UNIT-6,number) chr scat scat scat scat scat (>@c:IcaoSearchEnterChar)
(@c:IcaoSearchMatchedIcaosNumber) 1 >= if{
(@c:IcaoSearchCurrentICAO) (>@c:FlightPlanNewWaypointICAO)
(@c:FlightPlanWaypointsNumber,number) 0 == if{ 1 (>@c:FlightPlanDirectToDestination) } els{ (L:FMC-RTE-1,enum) 2 - (>@c:FlightPlanAddWaypoint) }
' ' (>@c:IcaoSearchStartCursor)
1 (>L:FMC-UNIT-EMPTY,bool) quit } els{ 1 (>L:FMC-NOT-IN-DATABASE,bool) } } els{ (L:FMC-MSG-DEL-USE,bool) 1 == if{ (L:FMC-RTE-1,enum) 2 - 1 + (>@c:FlightPlanDeleteWaypoint) } els{ 1 (>L:FMC-INVALID-ENTRY,bool) } } quit }
Now the above will run a ICAO Search for lets say "MKK" if I click the button, the it all works as planned except that MKK is Molokai VOR in Molokai Hawaii. Well the GPS doesn't think so, the GPS sets MKK to a waypoint called MKKJ which no matter what is always 8543.3nm away no matter where I am. The only things it recognizes and sets properly are airports, such as PHDH will yeild the correct airport and set the flight accordingly. If I were to however use "LNY" another VOR on Lanai Island in Hawaii, I do not get a ICAO match and subsequently the message NOT IN DATABASE is displayed. I've tried using both Ident and ICAO for the transfer from ICAO Search to Flight Plan New Waypoint. I wonder what could be causing this.
As for the other stuff, it's all working great!
|
|
| |
Robert | Дата: Пятница, 12.08.2011, 06:54 | Сообщение # 44 |
Группа: Удаленные
| Quote (Robert) A DirectToDestination statement only needs to know the latitude and longitude of the destination point. The origin is always the current aircraft position (x,y,z) and the gps module accesses that without any instruction from you. But, you do need to provide the destination lat, lon, which you accomplish when you provide the ICAO of the destination airport (FlightPlanNewWaypointIcao). Summarizing, the basic concept is that DirectToDestination always establishes a two-Waypoint Flight Plan, so there is never any ambiguity about the WaypointIndex of the DirectTo Waypoint - it's always 1, and the current aircraft position Waypoint is always WaypointIndex 0. Now, if you had an existing Flight Plan already active and you wanted to initiate a DirectTo to, say, WaypointIndex 4 of the Flight Plan, then you would use FlightPlanWaypointIndex as follows: Your ICAO Search is doing exactly what you have told it to do - search only for airports. That's what StartCursor 'A' does. When you enter MKK, the airport match is MKKJ which is an airport in Jamaica. If you want an ICAO Search of only VORs, then StartCursor should be 'V'. If you want an ICAO search of all facility types, StartCursor should be 'AVNW' and that will find Airports, VORs, NDBs, and Intersections/Waypoints.
When you use any StartCursor other than 'A', you will often get more than one match to the Ident that you enter. That's when you will need to search through the results and pick the one you want. StartCursor 'AVNW' is guaranteed to yield many matches as you enter the Ident. As you progressively enter more characters to the Ident string, the number of matches will typically reduce. When you use StartCursor 'A', you will only ever get zero or one match after the Ident has been entered because Airport Idents are themselves unique .
You cannot transfer Idents into Waypoint Groups. The ICAO is the key that unlocks all the Waypoint Group doors in fs9gps - it's got to be an ICAO.
Additionally, I don't know if you are doing this - but, ICAOs are never entered into ICAO Search. Always and only Idents. ICAO Search will attempt to find ICAOs that contain the Ident that you enter. That's why you get MKKJ when all you enter is MKK. That's also why you can get multiple ICAO Search matches.
If you're going to start including all facility types in your ICAO Search, then increase your L:Character, numbers from 4 to 5 characters. Intersections can have a 5 character Ident
|
|
| |
Гость | Дата: Пятница, 12.08.2011, 06:54 | Сообщение # 45 |
Группа: Посетители
| ขอขอบคุณสำหรับความปรารถนาโชคดี
|
|
| |
Robert | Дата: Пятница, 12.08.2011, 06:55 | Сообщение # 46 |
Группа: Удаленные
| Mai bpen rai, khrab
|
|
| |
cassini-m | Дата: Пятница, 12.08.2011, 06:55 | Сообщение # 47 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| My thai is, well it isn't.. Not sure what was said there How would I view all the matches, and select the one I want to use.
|
|
| |
Robert | Дата: Пятница, 12.08.2011, 06:55 | Сообщение # 48 |
Группа: Удаленные
| Hmmm. Display - if someone is going to be working with the gps module, then they really need to know the Element display loop - there's a good example 12 posts up in this thread, and many more in the gps_500 gauge. Selection - re-read you own COM1 Ident thread for a place to start, and dig harder.
Thai - Me: "Good luck: Bill: literally "Thank you for your best wishes of good luck" (not bad, Bill !) Me: "Don't mention it"
|
|
| |
Гость | Дата: Пятница, 12.08.2011, 06:56 | Сообщение # 49 |
Группа: Посетители
| Quote (Robert) Mai bpen rai, khrab That appears to be Welsh, but literal translation has no real sense:
That the head of some, khrab
|
|
| |
Robert | Дата: Пятница, 12.08.2011, 06:56 | Сообщение # 50 |
Группа: Удаленные
| Hahahaha .... no, definitely not Welsh. It's a common Thai saying for don't mention it, not a problem, never mind. Khrab is added at the end for politeness.
|
|
| |
|