New Boeing 787-8 GIT

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Re: New Boeing 787-8 GIT

Wow, I just realized that my final exams (the practicals are over, this is like the main thing) starts day after tomorrow and I've spent all my time on the 787-8 instead of studying.... And now, I seriously need to concentrate and study more.

So well, I won't be working on the 787-8 until March 26th (that last day )... And hopefully, I can get some replies on the questions about rendering camera view to texture and 2d panel scale transformation.

C ya.
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95

Posts: 1223
Joined: Sat Jul 30, 2011 12:59 am
Location: -unknown-
Callsign: MIA0001, OM-EGA
IRC name: omega95
Version: 2.12 git
OS: Ubuntu 13.04

Re: New Boeing 787-8 GIT

Hey guys. After going through like a pound or so of paper, running VNAV calculations to get loose approximations of how high I want to be where, I realized it would be MUCH better to have nasal run the calculations for me. Well, I've managed to add a function into fmc.nas, and it is soooooo close to working. Unfortunately, I've hit a wall. Now, I've been all over the wiki as well as Google, and I just can't seem to find any way around it. Here's the error I get when I execute the function:

Code: Select all
`floating point error in math.ln(): at C:/Users/Dwayne/fgfs-git/fgdata/Aircraft/787-8/Nasal/fmc.nas, line 33  called from: <nasal-console/#1>, line 1`

And below is the contents of fmc.nas, line 33:

Code: Select all
`climb_gs = -314.287 + (75.242 * math.ln(math.int(getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude"))));`

I figured I simply had too many decimal places, and rounded. My numbers had up to about 12 digits to the right of the decimal when I started, yet, here I am with only a quarter of what I started with, and the problem persists. As you can see, I also went to the extent of removing ALL digits to the right of the decimal on my altitudes. I'm at a total loss as to how to fix it.

Any help will be greatly appreciated.
Call Signs: redneck, ATCredn (unspecified freq atc)
FGFSCopilot
FGFSCopilotATCEdition
System Specs
Model: Alienware M15x, OS: Windows 7 Professional 64-bit, RAM: 3 GB, CPU: Intel i3 quad core at 2.4 GHz, GPU: Nvidea GeForce GTX 460M 1.5 GB GDDR5
redneck

Posts: 3630
Joined: Mon Feb 02, 2009 2:17 am
Location: Pennsylvania, USA
Version: 240

Re: New Boeing 787-8 GIT

Check that:
Code: Select all
`getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude")`

returns a nonzero pozitive value?
i4dnf
Retired

Posts: 745
Joined: Wed Sep 09, 2009 7:17 am
Location: LRBS
Callsign: YR-I4D
Version: GIT
OS: Gentoo Linux ~amd64

Re: New Boeing 787-8 GIT

Whenever you have such complex nested expressions causing an error, it's a good idea to split up the whole statement, so that you can get more accurate information, and so that you can easily add debugging code:

Code: Select all
`    climb_gs = -314.287 + (75.242 * math.ln(math.int(getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude"))));`

Code: Select all
`var index=(x - 1);var altitude = getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ index ~"]/altitude");var factor = math.ln(math.int(altitude));climb_gs = -314.287 + (75.242 *  factor);`

You can then easily add any heuristics, and also clamp the value as required:

Code: Select all
`var index=(x - 1);var altitude = getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ index ~"]/altitude");if (!altitude > 0) die("Altitude is not > 0");var factor = math.ln(math.int(altitude));climb_gs = -314.287 + (75.242 *  factor);`
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray

Posts: 11836
Joined: Tue Mar 25, 2008 8:40 am

Re: New Boeing 787-8 GIT

Awesome! Your help has almost fixed it completely. Well, it fixed that one problem, allowing yet another one to appear So... I have this infinite loop somewhere, and I'm not sure where it is. I'm posting the entire function below. Maybe I've just been staring at this thing to long.

Code: Select all
`autogen_alts: func {      # Determine direction of flight      var start_long = getprop("/autopilot/route-manager/route/wp/longitude-deg");      var total = getprop("/autopilot/route-manager/route/num") - 1;      var end_long = getprop("/autopilot/route-manager/route/wp[" ~ total ~ "]/longitude-deg");      if (end_long >= start_long)         setprop("/instrumentation/b787-fmc/vnav-calcs/direction", "East");   # altitude recommendations will be rounded to nearest odd thousand      else         setprop("/instrumentation/b787-fmc/vnav-calcs/direction", "West");   # altitude recommendations will be rounded to nearest even thousand            # Determine climb altitudes      setprop("/instrumentation/b787-fmc/vnav-calcs/wp/altitude", getprop("/instrumentation/altimeter/indicated-altitude-ft"));      var tod_wp = 9999;      var descent_distance = 0;      var vs_climb_climb = 2500;      var distance = 0;      var climb_gs = 0;      var index = 0;      var altitude = 1;      var factor = 1;      for (var y = getprop("/autopilot/route-manager/route/num") - 2; y > 0; y -= 1){         if (descent_distance < 124)            descent_distance += getprop("/autopilot/route-manager/route/wp["~ y ~"]/leg-distance-nm");         else            y = -1;      }      for (var x = 1; x < getprop("/autopilot/route-manager/route/num") - 1; x += 1){         if (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") < 18000)            vs_climb = 2500;         elsif ((getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") >= 18000) and (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") < 26000))            vs_climb = 1800;         else            vs_climb = 1000;         distance = getprop("/autopilot/route-manager/route/wp["~ (x - 1) ~"]/leg-distance-nm");         index=(x - 1);         altitude = getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ index ~"]/altitude");         if (!altitude > 0) die("Altitude is not > 0");         factor = math.ln(altitude);         climb_gs = -314.287 + (75.242 *  factor);         if (climb_gs < 288)            climb_gs = 288;         setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ x ~"]/altitude", vs_climb * (60 * distance / climb_gs) + getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude"));         while ((getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") < 35000) and (x < tod_wp)){            if (getprop("/instrumentation/b787-fmc/vnav-calcs/direction") == "East"){               for (var n = -1000; n < 41000; n += 2000){                  if ((getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") >= n) and (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") < n + 1000))                     setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ x ~"]/altitude", n);                  elsif (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") >= n + 1000)                     setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ x ~"]/altitude", n + 2000);               }            }            else{               for (var n = -2000; n < 40000; n += 2000){                  if ((getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") >= n) and (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") < n + 1000))                     setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ x ~"]/altitude", n);                  elsif (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") >= n + 1000)                     setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ x ~"]/altitude", n + 2000);               }            }         }      }      # Determine descent altitudes      vs_descent = -2300;      var descent_gs = 0;      for (var z = tod_wp; z < getprop("/autopilot/route-manager/route/num") - 1; z += 1){         if (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (z - 1) ~"]/altitude") > 10000)            vs_descent = -2300;         else            vs_descent = -1800;         distance = getprop("/autopilot/route-manager/route/wp["~ (z - 1) ~"]/leg-distance-nm");         descent_gs = -1.682 * math.pow(10, -7) * math.pow(altitudes[z - 1], 2) + 0.017 * getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") + 51.385;         setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude", getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (z - 1) ~"]/altitude") + (vs_climb * (60 * distance) / descent_gs));         if (getprop("/instrumentation/b787-fmc/vnav-calcs/direction") == "East"){            for (var n = 41000; n > -1000; n -= 2000){               if ((getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") <= n) and (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") >= n - 1000))                  setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude", n);               elsif (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") < n - 1000)                  setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude", n - 2000);            }         }         else{            for (var n = 40000; n > -2000; n -= 2000){               if ((getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") <= n) and (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") >= n - 1000))                  setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude", n);               elsif (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") < n - 1000)                  setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude", n - 2000);            }         }      }   }`

EDIT: I made a small edit to the code. I had forgotten to include a forced minimum value for climb_gs. The purpose of setting the minimumn climb_gs to 288 is to ensure that the fmc does not produce a very small groundspeed, and thus produce a very sharp climb prediction, which would exceed the limitations of the aircraft, not to mention the VNAV climb limit. Anyway, it's in there now.
Last edited by redneck on Sat Mar 03, 2012 11:39 am, edited 1 time in total.
Call Signs: redneck, ATCredn (unspecified freq atc)
FGFSCopilot
FGFSCopilotATCEdition
System Specs
Model: Alienware M15x, OS: Windows 7 Professional 64-bit, RAM: 3 GB, CPU: Intel i3 quad core at 2.4 GHz, GPU: Nvidea GeForce GTX 460M 1.5 GB GDDR5
redneck

Posts: 3630
Joined: Mon Feb 02, 2009 2:17 am
Location: Pennsylvania, USA
Version: 240

Re: New Boeing 787-8 GIT

yikes, plenty of code to go through ...

I would suggest to add a bunch of logging statements to each loop to see which loop doesn't terminate properly.

For example, by using a bunch of print() statements or, if the loops are run too frequently, just by using
something like setprop("/my-darn-foreach-loop/is-still-alive",1); as part of the loop body and doing setprop("/my-darn-foreach-loop/is-still-alive",0) once the loop terminates, so that you can inspect what's going on using the property browser.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray

Posts: 11836
Joined: Tue Mar 25, 2008 8:40 am

Re: New Boeing 787-8 GIT

Sorry about that There's one problem with your suggestion. The reason I can tell that I have an infinite loop somewhere is b/c FG freezes completely once I execute it. I'll try the console printing method, and hope it works.

EDIT: I think I might have found the problem. For some reason, I put a while loop inside a for loop. I'll try turning it into an if-statement, and see if it fixes it.
Call Signs: redneck, ATCredn (unspecified freq atc)
FGFSCopilot
FGFSCopilotATCEdition
System Specs
Model: Alienware M15x, OS: Windows 7 Professional 64-bit, RAM: 3 GB, CPU: Intel i3 quad core at 2.4 GHz, GPU: Nvidea GeForce GTX 460M 1.5 GB GDDR5
redneck

Posts: 3630
Joined: Mon Feb 02, 2009 2:17 am
Location: Pennsylvania, USA
Version: 240

Re: New Boeing 787-8 GIT

okay, if that's the problem, you could add another condition to each loop, so that you can easily terminate each loop explicitly using a setprop() call. You could for example add another getprop() check to the loop using "and", so that both conditions need to be satisfied. Or you could just as well use another if statement in the loop body and then use "break" to terminate:

Code: Select all
`var terminate_property = "/loop-killer/loop1";var killme = getprop(terminate_property) or 0;if (killme) break;`
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray

Posts: 11836
Joined: Tue Mar 25, 2008 8:40 am

Re: New Boeing 787-8 GIT

redneck wrote in Sat Mar 03, 2012 11:42 am:EDIT: I think I might have found the problem. For some reason, I put a while loop inside a for loop. I'll try turning it into an if-statement, and see if it fixes it.

Code: Select all
`while ((getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") < 35000) and (x < tod_wp))`

Referring to this code, it shouldn't make a difference as long as you ensure that your loop condition terminates it (i.e. decrement x and the stored altitude being less than 35000 ft).
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray

Posts: 11836
Joined: Tue Mar 25, 2008 8:40 am

Re: New Boeing 787-8 GIT

Actually, turning that while loop into an if-statement seems to have fixed it... sorta. Well, it doesn't freeze FG anymore. After giving myself about a 9-hour break or so, which I did not really want to take, I magically came to the conclusion that I had forgotten to reset the value of tod_wp. I fixed this, believing that it would solve my zero-altitude on the second waypoint, with no other altitudes being generated for the remaining waypoints problem. I ran the function again, only to find another error in which I missed converting an old, no-longer defined vector into a property. So, I fixed that, and now fmc.nas is totally broken again When I run the code in the nasal console, I get this:

Code: Select all
`No such member: fmc: at <nasal-console/#1>, line 1`

And, below you will find the function in its current state:

Code: Select all
`autogen_alts: func {      # Determine direction of flight      var start_long = getprop("/autopilot/route-manager/route/wp/longitude-deg");      var total = getprop("/autopilot/route-manager/route/num") - 1;      var end_long = getprop("/autopilot/route-manager/route/wp[" ~ total ~ "]/longitude-deg");      if (end_long >= start_long)         setprop("/instrumentation/b787-fmc/vnav-calcs/direction", "East");   # altitude recommendations will be rounded to nearest odd thousand      else         setprop("/instrumentation/b787-fmc/vnav-calcs/direction", "West");   # altitude recommendations will be rounded to nearest even thousand            # Determine climb altitudes      setprop("/instrumentation/b787-fmc/vnav-calcs/wp/altitude", getprop("/instrumentation/altimeter/indicated-altitude-ft"));      var tod_wp = 9999;      var descent_distance = 0;      var vs_climb_climb = 2500;      var distance = 0;      var climb_gs = 0;      var index = 0;      var altitude = 1;      var factor = 1;      for (var y = getprop("/autopilot/route-manager/route/num") - 2; y > 0; y -= 1){         if (descent_distance < 124){            descent_distance += getprop("/autopilot/route-manager/route/wp["~ y ~"]/leg-distance-nm");            tod_wp = y;         }         else            y = -1;      }      for (var x = 1; x < getprop("/autopilot/route-manager/route/num") - 1; x += 1){         if (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") < 10000)            vs_climb = 2750;         elsif ((getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") >= 10000) and (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") < 30000))            vs_climb = 2250;         else            vs_climb = 1000;         distance = getprop("/autopilot/route-manager/route/wp["~ (x - 1) ~"]/leg-distance-nm");         index=(x - 1);         altitude = getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ index ~"]/altitude");         if (!altitude > 0) die("Altitude is not > 0");         factor = math.ln(altitude);         climb_gs = -314.287 + (75.242 *  factor);         if (climb_gs < 288)            climb_gs = 288;         setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ x ~"]/climb-gs", climb_gs);         setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ x ~"]/vs-climb", vs_climb);         setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ x ~"]/distance", distance);         setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ x ~"]/altitude", vs_climb * (60 * distance / climb_gs) + getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude"));         if ((getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") < 35000) and (x < tod_wp)){            if (getprop("/instrumentation/b787-fmc/vnav-calcs/direction") == "East"){               for (var n = -1000; n < 41000; n += 2000){                  if ((getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") >= n) and (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") < n + 1000))                     setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ x ~"]/altitude", n);                  elsif (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") >= n + 1000)                     setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ x ~"]/altitude", n + 2000);               }            }            else{               for (var n = -2000; n < 40000; n += 2000){                  if ((getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") >= n) and (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") < n + 1000))                     setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ x ~"]/altitude", n);                  elsif (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (x - 1) ~"]/altitude") >= n + 1000)                     setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ x ~"]/altitude", n + 2000);               }            }         }      }      # Determine descent altitudes      vs_descent = -2300;      var descent_gs = 0;      for (var z = tod_wp; z < getprop("/autopilot/route-manager/route/num") - 1; z += 1){         if (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (z - 1) ~"]/altitude") > 10000)            vs_descent = -2300;         else            vs_descent = -1800;         distance = getprop("/autopilot/route-manager/route/wp["~ (z - 1) ~"]/leg-distance-nm");         descent_gs = -1.682 * math.pow(10, -7) * math.pow(getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (z - 1) ~"]/altitude", 2) + 0.017 * getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") + 51.385;         setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude", getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ (z - 1) ~"]/altitude") + (vs_climb * (60 * distance) / descent_gs));         if (getprop("/instrumentation/b787-fmc/vnav-calcs/direction") == "East"){            for (var n = 41000; n > -1000; n -= 2000){               if ((getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") <= n) and (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") >= n - 1000))                  setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude", n);               elsif (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") < n - 1000)                  setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude", n - 2000);            }         }         else{            for (var n = 40000; n > -2000; n -= 2000){               if ((getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") <= n) and (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") >= n - 1000))                  setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude", n);               elsif (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") < n - 1000)                  setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude", n - 2000);            }         }      }   }`
Call Signs: redneck, ATCredn (unspecified freq atc)
FGFSCopilot
FGFSCopilotATCEdition
System Specs
Model: Alienware M15x, OS: Windows 7 Professional 64-bit, RAM: 3 GB, CPU: Intel i3 quad core at 2.4 GHz, GPU: Nvidea GeForce GTX 460M 1.5 GB GDDR5
redneck

Posts: 3630
Joined: Mon Feb 02, 2009 2:17 am
Location: Pennsylvania, USA
Version: 240

Re: New Boeing 787-8 GIT

Maybe I am missing something, but what you are saying doesn't really make sense, and I cannot spot anything obviously related to the problem you describe - unless of course you managed to introduce a parse error somewhere, so that the fmc namespace/module isn't created properly?

Sorry, but given the information that you have provided so far, I cannot really provide better help at the moment - there's simply too much context info missing.

So, I'd suggest to check for parse errors (i.e. startup window).

If you are using git all the time, you could also just post the diff between the latest (non working) code and the version that previously worked, so that we can spot problems more easily. If you aren't yet using git for this, I'd suggest to start immediately, exactly for these reasons
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray

Posts: 11836
Joined: Tue Mar 25, 2008 8:40 am

Re: New Boeing 787-8 GIT

Well, I am now using Git (just for this project right now, since I've had issues trying to build FG Git on Windows). I happen to know that the last time I broke the fmc.nas file, Omega deleted the new function to fix the problem. I backed my copy up, but later decided that it was far too messy to be of much use (it consisted of about 4 or 5 different functions, all used together for this same set of computations, and was probably 1.5 times the size of the one I posted in my last post). So, I rewrote the whole thing from scratch, using a slightly different approach. What I'm trying to say is that there's really no point in committing this to Git, not just b/c it breaks fmc.nas, but also b/c what I've already posted is essentially the diff (minus the comma after the function).

Anyway, it seems I wasn't thorough enough in my scan through the console output during startup. There is a parse error. Only problem is, the line that contains the error consists of only a closing curly brace. I'm looking at it, and I can't' seem to find what's wrong. I'll post the little chunk in question below.

Code: Select all
`else{            for (var n = 40000; n > -2000; n -= 2000){               if ((getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") <= n) and (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") >= n - 1000))                  setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude", n);               elsif (getprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude") < n - 1000)                  setprop("/instrumentation/b787-fmc/vnav-calcs/wp["~ z ~"]/altitude", n - 2000);            }         }`

It points to that very last curly brace. This is actually the last chunk of code in the function. Perhaps, once we manage to get this parse error figured out, it will finally work, AND work right!

The one thing that puzzles me about this is that the other block of code that is nearly identical to this one is fine (at least I think it is, since it's above this chunk of code, but did not result in any errors).

Oh, I found an accidental difference in the two chunks of code. I'm gonna try to fix it, and see what happens (Gee, that was much faster than I expected).
Call Signs: redneck, ATCredn (unspecified freq atc)
FGFSCopilot
FGFSCopilotATCEdition
System Specs
Model: Alienware M15x, OS: Windows 7 Professional 64-bit, RAM: 3 GB, CPU: Intel i3 quad core at 2.4 GHz, GPU: Nvidea GeForce GTX 460M 1.5 GB GDDR5
redneck

Posts: 3630
Joined: Mon Feb 02, 2009 2:17 am
Location: Pennsylvania, USA
Version: 240

Re: New Boeing 787-8 GIT

First of all, I'd like to welcome Oliver (ot-666) to the 787-8 development team. (even though he may not yet know it )

Anyway, did some work on the ground services and stuff. They include - fuel truck (which actually drains/re-fuels the tanks!), external power box (needs to be enabled to get external power), chokes (try moving with them on ), catering truck (nothing much here, just lifts and comes back down according to your input in the dialog), baggage stuff (ramp, trailers and containers, that's all...) and a de-icing truck (it actually removes ice from the aircraft's wings! - not visually, but yea, the aircraft has an ice system)

The fuel truck, baggage stuff, catering vehicle and de-icing truck models are from Oliver's Innsbruck Project (Thanks a lot!) and the external power box and chokes were modeled by me (hehe, simple stuff)...

Anyway, hope you like it. All the ground services' controls are available in the 'Ground Servcices Controls' and 'Fuel Truck Controls' dialogs in the 787-8 menu.

Here're a few shots after I just landed at LOWI (about that, I put in a SID, an IAP and 2 STARs... The TP data're also there, but when you land at LOWI, remember to set your ABS to MAX or atleast 3 )

And other than that, I figured out why the ND RNAV stopped displaying the wps... Fixed that and will push soon.
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95

Posts: 1223
Joined: Sat Jul 30, 2011 12:59 am
Location: -unknown-
Callsign: MIA0001, OM-EGA
IRC name: omega95
Version: 2.12 git
OS: Ubuntu 13.04

Re: New Boeing 787-8 GIT

Are the ground systems generic, like the pushback? Would love to see it being used on all of our airliners
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400

Gijs
Moderator

Posts: 9429
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: New Boeing 787-8 GIT

Gijs wrote in Sun Mar 04, 2012 10:27 am:Are the ground systems generic, like the pushback? Would love to see it being used on all of our airliners

The pushback is but not any of the others.. That gives me an idea... What about complete ground service controls where you specify the door, fuel tank, cargo door positions in the -set.xml and have this dialog that puts these there for you? If we are doing that, where should I move the models, xmls and nasals to?
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95

Posts: 1223
Joined: Sat Jul 30, 2011 12:59 am
Location: -unknown-
Callsign: MIA0001, OM-EGA
IRC name: omega95
Version: 2.12 git
OS: Ubuntu 13.04

PreviousNext