September 19, 201213 yr Commercial Member I'm content enough with the progress I've made - much thanks to many developers from here stearing me in the right direction, especially Jan - that I've decided to post my code for custom map symbols on a navigation display. Here is what I use for airports: <Element> <Visible>@NDARPTVIS</Visible> <FormattedText X="100" Y="70" Font="Calibri" FontSize="20" Color="#0080B0" Adjust="Left" Bright="Yes"> <String> %(0 (>@c:NearestAIRPORTCurrentLine))%((@c:NearestAIRPORTCurrentIdent))%!s! %((@c:NearestAIRPORTCurrentDistance,nmiles) (L:ND-RNG-FACTOR,number) * (>L:ND-ARPT-DST0,number) (@c:NearestAIRPORTCurrentTrueBearing,degrees) (>L:ND-ARPT-BRG0,degrees)) </String> <Axis X="-15" Y="-5"/> </FormattedText> <Element> <Position X="-12.5" Y="-12.5"/> <Visible>(@c:NearestAIRPORTCurrentIdent) slen 1 ></Visible> <Image Name="ND-ARPT.bmp" Bright="Yes"/> <Clip Left="0" Right="560" Top="0" Bottom="585"/> </Element> <!--====================SHIFT-X====================--> <Shift> <Value>(L:ND-ARPT-BRG0,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:ND-ARPT-DST0,number) *</Value> <Nonlinearity> <Item Value="-25" X="010" Y="0"/> <Item Value="-20" X="064" Y="0"/> <Item Value="-10" X="172" Y="0"/> <Item Value= "0" X="280" Y="0"/> <Item Value="10" X="388" Y="0"/> <Item Value="20" X="388" Y="0"/> <Item Value="25" X="550" Y="0"/> </Nonlinearity> </Shift> <!--====================SHIFT-Y====================--> <Shift> <Value>(L:ND-ARPT-BRG0,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:ND-ARPT-DST0,number) *</Value> <Nonlinearity> <Item Value="40" X="0" Y="082"/> <Item Value="30" X="0" Y="190"/> <Item Value="20" X="0" Y="298"/> <Item Value="10" X="0" Y="406"/> <Item Value="0" X="0" Y="514"/> <Item Value="-10" X="0" Y="622"/> </Nonlinearity> </Shift> <Clip Left="0" Right="560" Top="0" Bottom="585"/> </Element> *Obviously must set up the nearestairport gps variables prior to use. The macro NDARPTVIS just specifies runway length and airport kind for me. This must be repeated over and over again just changing the variable constant values. The airport one has proved to be very stable. I have also set up for VOR and such but for some reason it's behavior is not too stable yet. I've attached an image of this in action. Some like to use vector images but I find that bitmaps are clearer right now. The attachment is only cropped after taken directly off the sim. All 100% XML. Thanks to everyone for their guidance! Hope you guys can make use of this. Good Day, Engjell Berisha
September 19, 201213 yr Moderator That's looking good! Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
September 20, 201213 yr That looks rather nice . What are the ND background dimensions that you are using ? Cheers Karol
September 22, 201213 yr Author Commercial Member Thank you very much for the kind words all! Karol, the dimensions of the ND are 560x600. Good Day, Engjell Berisha
October 17, 201213 yr Author Commercial Member Since starting a new topic seems like a waste and then stupid new avsim forum system won't allow me to ask it on a more appropriate thread, I will ask it here: Anyone experience maximum heights they can extend a rectangle to? Code example: <Rectangle Width="2" Height="2000" Bright="Yes" Color="#FF00FF" FillColor="#FF00FF"> <HeightCode>(L:ND-RTE-SEG2,nmiles) 10.7 *</HeightCode> </Rectangle> I ask this because anything over 2000 in max height yields a line that breaks apart. I have tried increasing width to fix this but that does nothing. I use this rectangle as my flight plan segment line on an navigation display. However often times if the waypoints are over 100 nm away I need the line to be longer that 2000. Any thoughts? Good Day, Engjell Berisha
October 18, 201213 yr Hi, In the ND use the gps flightplan lines and in the HUD the rectangle. Keep distance between waypoints less than 100 nm. I use: <Rectangle Width="2" Height="1600" Bright="Yes" Color="@color"> <HeightCode>@heightcode</HeightCode> </Rectangle> and have no problems. Tried longer heights without succes. Jan "Beatus ille qui procul negotiis..."
October 19, 201213 yr Author Commercial Member Jan, Thanks. I've had the same experience. However keeping legs/segments at 100 nm isn't realistic and sometimes it isn't possible - like on Oceanic flights. Perhaps I can just use the default FP lines and make them look a little better somehow. The next graphic issue I need to tackle is top of climb/descent line; the little green arc that grows and moves showing the point of TOC/D. Any ideas? Have you done this? PS - I have now got the selected departure/arrival runways to display once selected from the waypoint airport var. Good Day, Engjell Berisha
October 19, 201213 yr Yes, from the middle ages, you will get the idea: <Element> <Visible>(L:hsi,enum) 4 ==</Visible> <Arc Radius="80" LineWidth="1" Color="#00ff00" StartAngle="-50" EndAngle="-130" Bright="Yes" /><Axis X="80" Y="0"/> <Shift> <Value>(A:Indicated Altitude,feet) (A:Autopilot altitude lock var,feet) - abs 200 > (A:Indicated Altitude,feet) (A:Autopilot altitude lock var,feet) - (A:Vertical speed,feet per minute) / abs (A:GROUND VELOCITY,knots) * 60 / 0.3125 0.625 1.25 2.5 5 10 6 (L:hsi zoom,number) case * int (>L:rangezoom factor,number) (L:rangezoom factor,number) 2 > if{ (L:rangezoom factor,number) } els{ 0 } } els{ 0 } } </Value> <Nonlinearity><Item Value="0" X="160" Y="400"/><Item Value="20" X="160" Y="340"/></Nonlinearity> <Delay PixelsPerSecond="20"/> </Shift> <Clip Top="100" Bottom="390"/> </Element> Jan "Beatus ille qui procul negotiis..."
October 20, 201213 yr Moderator Jan, just out of couriosity, why do you write your XML script on a single line? Isn't this much easier to read? <Value> (A:Indicated Altitude,feet) (A:Autopilot altitude lock var,feet) - abs 200 > (A:Indicated Altitude,feet) (A:Autopilot altitude lock var,feet) - (A:Vertical speed,feet per minute) / abs (A:GROUND VELOCITY,knots) * 60 / 0.3125 0.625 1.25 2.5 5 10 6 (L:hsi zoom,number) case * int (>L:rangezoom factor,number) (L:rangezoom factor,number) 2 > if{ (L:rangezoom factor,number) } els{ 0 } } els{ 0 } } </Value> Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
October 20, 201213 yr You are right, But when a gauge is "ready" i try to compress it as much as possible. Is editing necessary i use your way without tabs. This was an element off a finished gauge from the Stone Age.... Jan "Beatus ille qui procul negotiis..."
October 21, 201213 yr Author Commercial Member Jan thank you kindly. I just need to refine and interpret your numbers to replace with my own and it is perfect! I think your code is missing something, I assume this is what you meant: <Value> (A:Indicated Altitude,feet) (A:Autopilot altitude lock var,feet) - abs 200 > if{ (A:Indicated Altitude,feet) (A:Autopilot altitude lock var,feet) - (A:Vertical speed,feet per minute) / abs (A:GROUND VELOCITY,knots) * 60 / 0.3125 0.625 1.25 2.5 5 10 6 (L:hsi zoom,number) case * int (>L:rangezoom factor,number) (L:rangezoom factor,number) 2 > if{ (L:rangezoom factor,number) } els{ 0 } } els{ 0 } } <!--==Remove this last bracket?==--> </Value> PS - the code tags won't allow the color tags to work. Good Day, Engjell Berisha
October 21, 201213 yr Hi, You are completely right, a newer version showed: <Value> (A:Indicated Altitude,feet) (A:Autopilot altitude lock var,feet) - abs 200 > if{ (A:Indicated Altitude,feet) (A:Autopilot altitude lock var,feet) - (A:Vertical speed,feet per minute) / abs (A:GROUND VELOCITY,knots) * 60 / 0.3125 0.625 1.25 2.5 5 10 6 (L:hsi zoom,number) case * int (>L:rangezoom factor,number) (L:rangezoom factor,number) 2 > if{ (L:rangezoom factor,number) } els{ 0 } } els{ 0 } </Value> FYI, have in different subpanels 4 nd's operating...send a not corrected one; bad bad. Jan "Beatus ille qui procul negotiis..."
October 21, 201213 yr Moderator Jan, that's simply making more work for yourself. The XML parsing engine will automatically remove the extra spaces and line-feeds as it prepares to convert the XML script into run-time C code... B) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
Create an account or sign in to comment