Board index FlightGear Development Aircraft

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

Postby omega95 » Thu Mar 08, 2012 4:58 am

redneck wrote in Wed Mar 07, 2012 7:27 pm:Thanks Hooray. I'll be sure to check it out. In other news, Omega went and made some nasty changes to the AP dialog, breaking parts of the Virtual Copilot, and possibly the FGFSCopilot interaction. I was hoping to do some other things while flying, but now that won't be possible.


Alright, first of all tell me why this is NASTY... :evil:

Image

The main reason I changed the dialog is cuz there're problems when you use the generic dialog and have the AP master turned off on the panel.

Now second, the dialog controls the exact same properties the panel controls, thus it does the EXACT SAME THING as the panel. If it breaks something, then that means the panel would already have broken it. Btw, I tested it with the vCopilot and everything (except the sounds you removed) work fine. :P

The only advantages I see in an AP dialog is that you can type in values and you can have it open on screen regardless of your view, and the new dialog provides both and also a more realistic AP panel look. It's about time you start using the AP the way it's supposed to.

--------------------------------------------- AFTER A SHORT WHILE OF SOME TESTING ---------------------------------------------

Hmm, that's weird.. For some reason, when hte dialogs are there, it doesn't let me type anything into the input fields... So well, I commented out the dials (temporarily). It works. Any one have any ideas on why the dials don't let me type anything in the input fields?

Image
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95
 
Posts: 1222
Joined: Sat Jul 30, 2011 1: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

Postby Hooray » Thu Mar 08, 2012 2:13 pm

Without having looked at the code, I assume that that dials simply override the text fields - that is, assuming that they are both using/writing to the same property? So, at first glance, it seems there's simply some "fighting" going on between two different ways of adjusting the target property?

BTW, I think the new AP dialog looks great and much more that it feels much more "natural" than a non-MCP based layout!
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: New Boeing 787-8 GIT

Postby Gijs » Thu Mar 08, 2012 2:29 pm

Untested, but you can probably overcome that by giving the dialos and input fields a <name> tag, and adding that name to your binding like:
Code: Select all
<input>
  <name>dial/field name</name>
  <binding>
    <command>dialog-apply</command>
    <object-name>dial/field name</object-name>
  </binding>
</input>

That will make sure that you only apply one certain input at a time.

But without seeing your code it's hard to give good advice, as you should know :twisted:
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: New Boeing 787-8 GIT

Postby omega95 » Thu Mar 08, 2012 3:53 pm

Gijs wrote in Thu Mar 08, 2012 2:29 pm:Untested, but you can probably overcome that by giving the dialos and input fields a <name> tag, and adding that name to your binding like:
Code: Select all
<input>
  <name>dial/field name</name>
  <binding>
    <command>dialog-apply</command>
    <object-name>dial/field name</object-name>
  </binding>
</input>

That will make sure that you only apply one certain input at a time.

But without seeing your code it's hard to give good advice, as you should know :twisted:


That's AWESOME! It works :D

So I put the dials back and I also did the CLB CON funcion Gijs told me about yesterday. :)

Image
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95
 
Posts: 1222
Joined: Sat Jul 30, 2011 1: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

Postby omega95 » Thu Mar 08, 2012 4:42 pm

Some help here? I wrote a system and warnings logger (for the EICAS) and here're the 2 new nasal files I created. The thing works when you run
Code: Select all
b787.sysinfo.log_msg("Some message here", 0);
and some basic messages that're given when different systems are initialized work too.

But then for some reason, the change check doesn't work. :evil:

sysinfo.nas
Code: Select all
var sysinfo = {
   
   log_msg : func(system_msg, type) {
   
      # Message Logging System
      
      ## Move all messages down and get the system_msg on the top
      
      for (var n = (getprop("/instrumentation/sysinfo/max") - 1); n >= 0; n = n - 1) {
      
         setprop("/instrumentation/sysinfo/msg[" ~ (n + 1) ~ "]/message", getprop("/instrumentation/sysinfo/msg[" ~ n ~ "]/message"));
         
         setprop("/instrumentation/sysinfo/msg[" ~ (n + 1) ~ "]/type", getprop("/instrumentation/sysinfo/msg[" ~ n ~ "]/type"));
         
         setprop("/instrumentation/sysinfo/msg[" ~ (n + 1) ~ "]/attend", getprop("/instrumentation/sysinfo/msg[" ~ n ~ "]/attend"));
      
      }
      
      ## Increment MAX Value
      
      setprop("/instrumentation/sysinfo/max", getprop("/instrumentation/sysinfo/max") + 1);
      
      ## Set new message to top level
      
      setprop("/instrumentation/sysinfo/msg/message", getprop("/sim/time/gmt-string") ~ " UTC : " ~ system_msg);
      setprop("/instrumentation/sysinfo/message", system_msg);
      setprop("/instrumentation/sysinfo/msg/type", type);
      
      if ((type == 1) or (type == 2)) {
         setprop("/instrumentation/sysinfo/warning", system_msg);
         setprop("/instrumentation/sysinfo/msg/attend", 1);
      } else {
         setprop("/instrumentation/sysinfo/msg/attend", 0);
      }
         
#      if (type == 0)
#         print("System Message : " ~ system_msg);
#      elsif (type == 2)
#         print("System Warning : " ~ system_msg);
#      else
#         print("System Caution : " ~ system_msg);
         
      # Update Display
      
      me.update_display();
   
   },
   
   update_display : func() {
   
      var first = getprop("/instrumentation/sysinfo/first");
   
      for (var n = first; n < (first + 20); n += 1) {
      
         if (getprop("/instrumentation/sysinfo/msg[" ~ n ~ "]/message") != nil) {
         
            setprop("/instrumentation/sysinfo/disp[" ~ (n - first) ~ "]/message", getprop("/instrumentation/sysinfo/msg[" ~ n ~ "]/message"));
            
            setprop("/instrumentation/sysinfo/disp[" ~ (n - first) ~ "]/type", getprop("/instrumentation/sysinfo/msg[" ~ n ~ "]/type"));
            
            setprop("/instrumentation/sysinfo/disp[" ~ (n - first) ~ "]/attend", getprop("/instrumentation/sysinfo/msg[" ~ n ~ "]/attend"));
         
         }
      
      }
      
      # Check for unattended stuff below
         
         var unattended = 0;
         
         for (var n = (first + 19); n < 999; n += 1) {
         
            if (getprop("/instrumentation/sysinfo/msg[" ~ n ~ "]/message") != nil) {
            
               if (getprop("/instrumentation/sysinfo/msg[" ~ n ~ "]/attend") == 1)
                  unattended = 1;
            
            }
         
         }
      
      setprop("/instrumentation/sysinfo/unattended", unattended);
   
   },
   
   attend : func(disp) {
   
      var first = getprop("/instrumentation/sysinfo/first");
      
      setprop("/instrumentation/sysinfo/msg[" ~ (first + disp) ~ "]/attend", 0);
      
      me.update_display();
   
   },
   
   print_log : func() {
   
      me.log_msg("[SYS] System Log Printed", 0);
      
      print("");
   
      print("======================= Boeing 787-8 System Log =======================");
      
      print("");
      
      print("ACTIVE WARNING : " ~ getprop("/instrumentation/sysinfo/warning"));
      print("ACTIVE MESSAGE : " ~ getprop("/instrumentation/sysinfo/message"));
      
      print("");
      
      print("System Log History:");
      
      print("");
      
      for (var n = 0; n < getprop("/instrumentation/sysinfo/max"); n += 1) {
      
         var type = getprop("/instrumentation/sysinfo/msg[" ~ n ~ "]/type");
         
         var msg = getprop("/instrumentation/sysinfo/msg[" ~ n ~ "]/message");
         
         if (type == 0)
            print("MSG : " ~ msg);
         elsif (type == 2)
            print("WRN : " ~ msg);
         else
            print("CAU : " ~ msg);
      
      }
      
      print("");
      
      print("=======================================================================");
   }
};


syscheck.nas
Code: Select all
# NOTE : I probably left out a LOT of other warning/system based properties... If you have any, please add them in. :)

var sc_tree = "/system_memory";

var syscheck = {
   init : func {
        me.UPDATE_INTERVAL = 1;
        me.loopid = 0;
       
        me.fuel_low = 0;
        me.fuel_crit = 0;
       
        me.hyd_pump0_ovht = 0;
        me.hyd_pump1_ovht = 0;
        me.hyd_pump2_ovht = 0;
        me.hyd_pump3_ovht = 0;
       
        me.fuel_pump0_ovht = 0;
        me.fuel_pump1_ovht = 0;
        me.fuel_pump2_ovht = 0;
       
        me.hyd_pump0_fault = 0;
        me.hyd_pump1_fault = 0;
        me.hyd_pump2_fault = 0;
        me.hyd_pump3_fault = 0;
       
        me.fuel_pump0_fault = 0;
        me.fuel_pump1_fault = 0;
        me.fuel_pump2_fault = 0;
       
        me.no_power = 0;
        me.low_power = 0;
      
      me.syscpy_props = [
         "/sim/failure-manager/engines/engine/serviceable",
         "/sim/failure-manager/engines/engine[1]/serviceable",
         "/controls/electric/external-power",
         "/systems/electrical/serviceable",
         "/controls/electric/ram-air-turbine",
         "/systems/electrical/outputs/efis",
         "/controls/fires/fire/on-fire",
         "/controls/fires/fire[1]/on-fire",
         "/controls/fbw/alpha-protect",
         "/controls/fbw/autostable",
         "/controls/fbw/active",
         "/controls/fuel/x-feed",
         "/controls/jettison/arm",
         "/controls/gear-failures/gear[0]/break",
         "/controls/gear-failures/gear[0]/burst",
         "/controls/gear-failures/gear[1]/break",
         "/controls/gear-failures/gear[1]/burst",
         "/controls/gear-failures/gear[2]/break",
         "/controls/gear-failures/gear[2]/burst",
         "/controls/hydraulic/serviceable/system0",
         "/controls/hydraulic/serviceable/system1",
         "/controls/hydraulic/serviceable/system2",
         "/controls/hydraulic/serviceable/system3",
         "/controls/pneumatic/temp/hyd-sys0-eng",
         "/controls/pneumatic/temp/hyd-sys1-eng",
         "/controls/pneumatic/temp/hyd-sys2-elec",
         "/controls/pneumatic/temp/hyd-sys3-elec",
         "/controls/mfd/extra",
         "/autopilot/panel/master",
         "/autopilot/panel/auto-throttle",
         "/controls/pneumatic/equipcooling",
         "/controls/pneumatic/pack1",   
         "/controls/pneumatic/pack2",
         "/controls/pneumatic/temp/fuel-pump-left",
         "/controls/pneumatic/temp/fuel-pump-center",
         "/controls/pneumatic/temp/fuel-pump-right",
         "/autopilot/vnav/vnav-mode",
         "/controls/hydraulic/system[0]/engine-pump",
         "/controls/hydraulic/system[1]/engine-pump",
         "/controls/hydraulic/system[2]/electric-pump",
         "/controls/hydraulic/system[3]/electric-pump",
         "/controls/ice/wing/anti-ice",
         "/controls/ice/eng1/anti-ice",
         "/controls/ice/eng2/anti-ice",
         "/consumables/fuel/total-fuel-kg"
      ];
      
      # Make the first copy
      
      foreach(var prop; me.syscpy_props) {
      
         if (getprop(prop) != nil)
            setprop(sc_tree ~ prop, getprop(prop));
   
      }

        me.reset();
},
   update : func {

   foreach(var prop; me.syscpy_props) {
   
      # First check for a change
      
      if (getprop(prop) != getprop(sc_tree ~ prop))
         me.check_prop(prop);
      
      # Now, copy the new props into the memory
   
      if (getprop(prop) != nil)
         setprop(sc_tree ~ prop, getprop(prop));
   
   }

},
   check_prop : func(prop) {
   
      if (prop == "/controls/electric/external-power")
         if (getprop(prop) != 0)
            sysinfo.log_msg("[ELEC] External Power Connected", 0);
         else
            sysinfo.log_msg("[ELEC] External Power Disconnected", 0);
      
      elsif (prop == "/sim/failure-manager/engines/engine/serviceable")
         if (getprop(prop) != 1)
            sysinfo.log_msg("[ELEC] Engine 1 Failed", 2);
            
      elsif (prop == "/sim/failure-manager/engines/engine[1]/serviceable")
         if (getprop(prop) != 1)
            sysinfo.log_msg("[ELEC] Engine 2 Failed", 2);
      
      elsif (prop == "/systems/electrical/serviceable")
         if (getprop(prop) != 0)
            sysinfo.log_msg("[ELEC] Electrical System Servicable", 0);
         else
            sysinfo.log_msg("[ELEC] Electrical System Failure", 2);
            
      elsif (prop == "/controls/electric/ram-air-turbine")
         if (getprop(prop) != 0)
            sysinfo.log_msg("[ELEC] Ram Air Turbine Activated", 1);
            
      elsif (prop == "/systems/electrical/outputs/efis")
         if ((getprop(prop) < 5) and (me.no_power != 1)) {
            sysinfo.log_msg("[ELEC] Critical Electrical Power Generation", 1);
            me.no_power = 1;
         } elsif ((getprop(prop) < 9) and (me.low_power != 1) and (me.no_power != 1)) {
            sysinfo.log_msg("[ELEC] Low Electrical Power Generation", 1);
            me.low_power = 1;
         }
         
      elsif (prop == "/controls/fires/fire/on-fire")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[ENG] Engine 1 On Fire", 2);
         else
            sysinfo.log_msg("[ENG] Engine 1 Fire Extinguished", 0);
            
      elsif (prop == "/controls/fires/fire[1]/on-fire")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[ENG] Engine 2 On Fire", 2);
         else
            sysinfo.log_msg("[ENG] Engine 2 Fire Extinguished", 0);
            
      elsif (prop == "/controls/fbw/alpha-protect")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[FBW] Alpha-Protection : Preventing Stall", 0);
            
      elsif (prop == "/controls/fbw/autostable")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[FBW] Auto-Stabilization : Stabilizing Aircraft", 0);
         else
            sysinfo.log_msg("[FBW] Auto-Stabilization : Disconnected", 0);         
      
      elsif (prop == "/controls/fbw/active")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[FBW] Fly-By-Wire Engaged and Working", 0);
         else
            sysinfo.log_msg("[FBW] Fly-By-Wire Disconnected", 1);
            
      elsif (prop == "/controls/fuel/x-feed")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[FUEL] Cross-feed Active", 1);
            
      elsif (prop == "/controls/jettison/arm")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[FUEL] Fuel Jettison Armed", 1);
         else
            sysinfo.log_msg("[FUEL] Fuel Jettison Disengaged", 0);
            
      elsif (prop == "/controls/gear-failures/gear[0]/break")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[GEAR] Nose Gear Un-usabled", 2);
            
      elsif (prop == "/controls/gear-failures/gear[0]/burst")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[GEAR] Nose Gear Tires Burst", 2);
            
      elsif (prop == "/controls/gear-failures/gear[1]/break")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[GEAR] Left Main Gear Un-usabled", 2);
            
      elsif (prop == "/controls/gear-failures/gear[1]/burst")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[GEAR] Left Main Gear Tires Burst", 2);
            
      elsif (prop == "/controls/gear-failures/gear[2]/break")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[GEAR] Right Main Gear Un-usabled", 2);
            
      elsif (prop == "/controls/gear-failures/gear[2]/burst")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[GEAR] Right Main Gear Tires Burst", 2);
            
      elsif (prop == "/controls/hydraulic/serviceable/system0")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[HYD] Left Hydraulic System Servicable", 0);
         else
            sysinfo.log_msg("[HYD] Left Hydraulic System Failed", 2);
            
      elsif (prop == "/controls/hydraulic/serviceable/system1")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[HYD] Right Hydraulic System Servicable", 0);
         else
            sysinfo.log_msg("[HYD] Right Hydraulic System Failed", 2);
            
      elsif ((prop == "/controls/hydraulic/serviceable/system2") or (prop == "/controls/hydraulic/serviceable/system3"))
         if (getprop(prop) == 1)
            sysinfo.log_msg("[HYD] Central Hydraulic System Servicable", 0);
         else
            sysinfo.log_msg("[HYD] Central Hydraulic System Failed", 2);
      
      elsif (prop == "/controls/pneumatic/temp/hyd-sys0-eng")
         if ((getprop(prop) > 120) and (me.hyd_pump0_fault != 1)) {
            sysinfo.log_msg("[HYD] Hydraulic E1 Engine Pump Fault", 2);
            me.hyd_pump0_fault = 1;
         } elsif ((getprop(prop) > 70) and (me.hyd_pump0_ovht != 1)) {
            sysinfo.log_msg("[HYD] Hydraulic E1 Engine Pump Overheat", 1);
            me.hyd_pump0_ovht = 1;
         }
         
      elsif (prop == "/controls/pneumatic/temp/hyd-sys1-eng")
         if ((getprop(prop) > 120) and (me.hyd_pump1_fault != 1)) {
            sysinfo.log_msg("[HYD] Hydraulic E2 Engine Pump Fault", 2);
            me.hyd_pump1_fault = 1;
         } elsif ((getprop(prop) > 70) and (me.hyd_pump1_ovht != 1)) {
            sysinfo.log_msg("[HYD] Hydraulic E2 Engine Pump Overheat", 1);
            me.hyd_pump1_ovht = 1;
         }
         
      elsif (prop == "/controls/pneumatic/temp/hyd-sys2-elec")
         if ((getprop(prop) > 120) and (me.hyd_pump2_fault != 1)) {
            sysinfo.log_msg("[HYD] Hydraulic C1 Electric Pump Fault", 2);
            me.hyd_pump2_fault = 1;
         } elsif ((getprop(prop) > 70) and (me.hyd_pump2_ovht != 1)) {
            sysinfo.log_msg("[HYD] Hydraulic C1 Electric Pump Overheat", 1);
            me.hyd_pump2_ovht = 1;
         }
         
      elsif (prop == "/controls/pneumatic/temp/hyd-sys3-elec")
         if ((getprop(prop) > 120) and (me.hyd_pump3_fault != 1)) {
            sysinfo.log_msg("[HYD] Hydraulic C2 Electric Pump Fault", 2);
            me.hyd_pump3_fault = 1;
         } elsif ((getprop(prop) > 70) and (me.hyd_pump3_ovht != 1)) {
            sysinfo.log_msg("[HYD] Hydraulic C2 Electric Pump Overheat", 1);
            me.hyd_pump3_ovht = 1;
         }
         
      elsif (prop == "/controls/mfd/extra")
         if (getprop(prop) == 0)
            sysinfo.log_msg("[MFD] Radar Mode Engaged", 0);
         elsif (getprop(prop) == 1)
            sysinfo.log_msg("[MFD] Satellite Map Engaged", 0);
         elsif (getprop(prop) == 2)
            sysinfo.log_msg("[MFD] Terrain Map Engaged", 0);
         else
            sysinfo.log_msg("[MFD] WXRadar Mode Engaged", 0);
            
      elsif (prop == "/autopilot/panel/master") {
         if (getprop(prop) == 1)
            sysinfo.log_msg("[AP] Master Autopilot Engaged", 0);
         else
            sysinfo.log_msg("[AP] Master Autopilot Disengaged", 1); }
            
      elsif (prop == "/autopilot/panel/auto-throttle")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[AP] Auto-throttle Armed", 0);
         else
            sysinfo.log_msg("[AP] Auto-throttle Disengaged", 1);
            
      elsif (prop == "/controls/pneumatic/equipcooling")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[PNEU] Equipment Cooling Engaged", 0);
         else
            sysinfo.log_msg("[PNEU] Equipment Cooling Disengaged", 1);
            
      elsif (prop == "/controls/pneumatic/pack1")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[PNEU] Air-Conditioning Pack 1 Engaged", 0);
         else
            sysinfo.log_msg("[PNEU] Air-Conditioning Pack 1 Disngaged", 0);
      
      elsif (prop == "/controls/pneumatic/pack2")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[PNEU] Air-Conditioning Pack 2 Engaged", 0);
         else
            sysinfo.log_msg("[PNEU] Air-Conditioning Pack 2 Disngaged", 0);
            
      elsif (prop == "/autopilot/vnav/vnav-mode")
         if (getprop(prop) == "crz-altitude-hold")
            sysinfo.log_msg("[FMC] VNAV Cruise Mode Engaged", 0);
         else
            sysinfo.log_msg("[FMC] VNAV Cruise Mode Disengaged", 0);
            
      elsif (prop == "/controls/hydraulic/system[0]/engine-pump")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[HYD] Hydraulic E1 Engine Pump Activated", 0);
         else
            sysinfo.log_msg("[HYD] Hydraulic E1 Engine Pump De-Activated", 1);
      
      elsif (prop == "/controls/hydraulic/system[1]/engine-pump")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[HYD] Hydraulic E2 Engine Pump Activated", 0);
         else
            sysinfo.log_msg("[HYD] Hydraulic E2 Engine Pump De-Activated", 1);
            
      elsif (prop == "/controls/hydraulic/system[2]/electric-pump")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[HYD] Hydraulic C1 Engine Pump Activated", 0);
         else
            sysinfo.log_msg("[HYD] Hydraulic C1 Engine Pump De-Activated", 1);
            
      elsif (prop == "/controls/hydraulic/system[3]/electric-pump")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[HYD] Hydraulic C2 Engine Pump Activated", 0);
         else
            sysinfo.log_msg("[HYD] Hydraulic C2 Engine Pump De-Activated", 1);
            
      elsif (prop == "/controls/ice/wing/anti-ice")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[HEAT] Wing Anti-Icing Engaged", 0);
         else
            sysinfo.log_msg("[HEAT] Wing Anti-Icing Dis-engaged", 1);
            
      elsif (prop == "/controls/ice/eng1/anti-ice")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[HEAT] Engine 1 Anti-Icing Engaged", 0);
         else
            sysinfo.log_msg("[HEAT] Engine 1 Anti-Icing Dis-engaged", 1);
            
      elsif (prop == "/controls/ice/eng2/anti-ice")
         if (getprop(prop) == 1)
            sysinfo.log_msg("[HEAT] Engine 2 Anti-Icing Engaged", 0);
         else
            sysinfo.log_msg("[HEAT] Engine 2 Anti-Icing Dis-engaged", 1);
            
      elsif (prop == "/controls/pneumatic/temp/fuel-pump-left")
         if ((getprop(prop) > 200) and (me.fuel_pump0_fault != 1)) {
            sysinfo.log_msg("[FUEL] Left Fuel Pump Fault", 2);
            me.fuel_pump0_fault = 1;
         } elsif ((getprop(prop) > 120) and (me.fuel_pump0_ovht != 1)) {
            sysinfo.log_msg("[FUEL] Left Fuel Pump Overheat", 1);
            me.fuel_pump0_ovht = 1;
         }
         
      elsif (prop == "/controls/pneumatic/temp/fuel-pump-center")
         if ((getprop(prop) > 200) and (me.fuel_pump1_fault != 1)) {
            sysinfo.log_msg("[FUEL] Center Fuel Pump Fault", 2);
            me.fuel_pump1_fault = 1;
         } elsif ((getprop(prop) > 120) and (me.fuel_pump1_ovht != 1)) {
            sysinfo.log_msg("[FUEL] Center Fuel Pump Overheat", 1);
            me.fuel_pump1_ovht = 1;
         }
         
      elsif (prop == "/controls/pneumatic/temp/fuel-pump-right")
         if ((getprop(prop) > 200) and (me.fuel_pump2_fault != 1)) {
            sysinfo.log_msg("[FUEL] Right Fuel Pump Fault", 2);
            me.fuel_pump2_fault = 1;
         } elsif ((getprop(prop) > 120) and (me.fuel_pump2_ovht != 1)) {
            sysinfo.log_msg("[FUEL] Right Fuel Pump Overheat", 1);
            me.fuel_pump2_ovht = 1;
         }
         
      elsif (prop == "/consumables/fuel/total-fuel-kg")
         if ((getprop(prop) < 1000) and (me.fuel_crit != 1)) {
            sysinfo.log_msg("[FUEL] Critical Fuel Level", 2);
            me.fuel_crit = 1;
         } elsif ((getprop(prop) < 4000) and (me.fuel_low != 1)) {
            sysinfo.log_msg("[FUEL] Low Fuel Level", 1);
            me.fuel_low = 1;
         }
         
      else
         sysinfo.log_msg("[SYS] Unknown Error: " ~ prop);
      
            
   },
    reset : func {
        me.loopid += 1;
        me._loop_(me.loopid);
    },
    _loop_ : func(id) {
        id == me.loopid or return;
        me.update();
        settimer(func { me._loop_(id); }, me.UPDATE_INTERVAL);
    }

};

setlistener("sim/signals/fdm-initialized", func
 {
 syscheck.init();
 print("System Logger ....... Initialized");
 });


Btw, I don't get ANY error at all... :|
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95
 
Posts: 1222
Joined: Sat Jul 30, 2011 1: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

Postby omega95 » Thu Mar 08, 2012 5:00 pm

Actually, never mind.. I fixed it by putting the stuff inside the elsifs in { braces }. :D

So here's the thing. All screen messages and warnings come on this display...

Image

White = Message
Yellow = Caution
Red = Warning

When you get a caution or warning, it gets highlighted meaning you have to attend to it. Once you do, you can click on that warning/caution to get rid of the highlight. If you have a highlight (haven't attended to the issue) and you get more stuff above, this thing goes down and an 'UNATTENDED' light comes on and you have to scroll down to attend to it.

You can also hit 'PRINT' and dump the whole log onto the console. :)
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95
 
Posts: 1222
Joined: Sat Jul 30, 2011 1: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

Postby mr_no » Thu Mar 08, 2012 11:42 pm

Great aircraft! Thank you very much! :wink:
Mosquito-XE JT-5B-autogyro Extra-300s STOL-Ch701
User avatar
mr_no
 
Posts: 360
Joined: Thu Jan 19, 2012 3:20 pm

Re: New Boeing 787-8 GIT

Postby omega95 » Fri Mar 09, 2012 10:51 am

According the Smart Cockpit's 787-8 Flight Operations and Instruments PDF, the FMC has an automatic word completion box. (will be referred to as AWC from here) The keypad on the touchscreen CDUs are not supposed to be on the screen it seems! They're supposed to be on the panel NEXT to the Touchscreen CDUs so I moved them there. Aand, I just completed the automatic word completion box. :D Just a quick addition to the model and 2 nasal files (1 with the cdu input check loop and another with the functions required (search(cdu, input), select(cdu, index) and parseWords())...

The vocabulary (FMC-DB/Vocabulary/Possible_Words.xml) has only 5 words now (TEST WORD 1, TEST WORD 2, TESTING THIS and TESTING THAT) :mrgreen: But then when redneck wakes up, I'll get him to put in all 3808 airports in the full FMC DB and all Navaids, Fixes and runways we can get.

So here's some shots and a basic idea of what happens...

1. You can type in the CDU(s) normally like you always have and the AWC will automatically give you a list of possible words in the FMC's Vocab starting with what you typed.
Image

2. You can then select on the word you want by clicking on it.
Image

3. Then, click on the big SELECT button to select that word and put it into the cdu input field. :)
Image

4. Orr, instead of directly typing the word in the CDU, you can click on the search field and type the word there. Then, click on SEARCH to search for the word and the other steps are the same as if you've typed in into the CDU.
Image

Oh and to get the input back to the CDU, click on the search field (not hte button) again. :)

It'll be up on git as soon as we have some decent vocab. :lol:

Oh and you can also toggle the help box with the help button... but then you would never need to do that.. If you don't want it, you can simply ignore it. It won't affect your CDU typing unless you ask it to.

@Scott, I "think" this is used in the A380 too.. I remember seeing it in a youtube video, but I'm not sure...
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95
 
Posts: 1222
Joined: Sat Jul 30, 2011 1: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

Postby Hooray » Fri Mar 09, 2012 2:14 pm

nice feature - I just hope that you are not using a huge conditonal block for this, but rather a foreach loop and some fuzzy logic ? (btw, good job: I saw you using vectors and foreach for the EICAS)
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: New Boeing 787-8 GIT

Postby omega95 » Fri Mar 09, 2012 2:19 pm

Image

Scott gave me a bash script to get the ICAO Codes of all the airports in the FMC-DB folder and make it into the required xml file (thanks a lot, Scott) and now, when I'm using the AWC, I get a LOT of results. I was looking for KLAX.. I typed KLA and still didn't get it. So, I gave it a 'scroll' functionality (like used in the EICAS SysInfo, Active Route, Flightplan editors etc.) and now, it works great. :) We're still working on increasing it's Vocab.

-------- Just saw Hooray's Post ----------

Here's the code...

Code: Select all
var fmcHelp = {

   parseWords : func() {
      
      var root = getprop("/sim/aircraft-dir");
      
      io.read_properties(root ~ "/FMC-DB/Vocabulary/Possible_Words.xml", "/instrumentation/fmcVocabulary/");
      
      sysinfo.log_msg("[FMC] Vocabulary Check ... OK", 0);
   
   },
   search : func(cdu, input) {
   
      var fh_tree = "/instrumentation/fmcHelp[" ~ cdu ~ "]/";
      var vocab = "/instrumentation/fmcVocabulary/words/";
      
      # Clear Result fields
      
      for (var n = 0; n < 8; n += 1) {
      
         setprop(fh_tree~ "result[" ~ n ~ "]/string", "");
      
      }
      
      var inp_size = size(input);
      
      # There're 8 available search result spaces
      
      var result = 0;
      
      for (var n = 0; getprop(vocab ~ "word[" ~ n ~ "]/string") != nil; n += 1) {
      
         if (substr(getprop(vocab~ "word[" ~ n ~ "]/string"), 0, inp_size) == input) {
         
            setprop(fh_tree~ "result[" ~ result ~ "]/string", getprop(vocab~ "word[" ~ n ~ "]/string"));            
            
            result += 1;
         
         }
      
      }
      
      setprop(fh_tree~ "first", 0);
      
      me.update(cdu);
   
   },
   select : func(cdu, index) {
      
      var fh_tree = "/instrumentation/fmcHelp[" ~ cdu ~ "]/";
      
      setprop("/controls/cdu[" ~ cdu ~ "]/input", getprop(fh_tree~ "result[" ~ index ~ "]/string"));
   
   },
   update : func(cdu) {
   
      var first = getprop("/instrumentation/fmcHelp[" ~ cdu ~ "]/first");
      
      for (var n = 0; n < 8; n += 1) {
      
         var result = getprop("/instrumentation/fmcHelp[" ~ cdu ~ "]/result[" ~ (n + first) ~ "]/string");
         
         if (result != nil)
            setprop("/instrumentation/fmcHelp[" ~ cdu ~ "]/disp[" ~ n ~ "]/string", result);
      
      }
   
   }

};


Less than 50 lines. :P

EDIT : Pushed to git

EDIT(2) : New Idea?

Alright, first of all, I don't have that good documentation on most things here, I'm modeling them out of what I have... And all I had from the Smart Cockpit pdf was an image of it. :shock:

So, till we get better documentation, I'm gunna try adding some cool stuff... I was thinking of a 'LEARNER', where when you type an input and use it, the FMC 'learns' it by adding it to the database. :) This way, the DB increases on it's own and we don't have to waste time on it. As it is, even though I made the CDU, I don't know what hte possible inputs can be (I mighta forgotten), so basically, when you use an input, we can get it to learn it. What do you think? Oh and probably once in a while, we can merge the new vocab to git so others can benefit from it.
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95
 
Posts: 1222
Joined: Sat Jul 30, 2011 1: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

Postby Hooray » Fri Mar 09, 2012 2:41 pm

Referring to your "vocabulary check":

Code: Select all
io.read_properties(root ~ "/FMC-DB/Vocabulary/Possible_Words.xml", "/instrumentation/fmcVocabulary/");
     
      sysinfo.log_msg("[FMC] Vocabulary Check ... OK", 0);


you can actually show a real check:

  • move the read_properties call into a separate func (i.e. prepend func)
  • don't directly call the func, but use Nasal's "call" library function
  • this allows you to do exception handling (try/catch in C++/Java) by passing in an empty error vector
  • if the function succeeded, the vector will remain empty - if it failed, the vector will contain errors and be non-zero
  • so you can show a parse error if the vector is non zero


Code: Select all
var vocab_load = func io.read_properties(root ~ "/FMC-DB/Vocabulary/Possible_Words.xml", "/instrumentation/fmcVocabulary/");

var try = func(code,success_func, fail_func, func_args=[], object=nil,namespace=nil) {
 var errors = [];
 call(code,func_args,object,namespace,errors);
 if(size(errors)) fail_func();
 else success_func();
}

var vocab_info = func(msg,type) sysinfo.log_msg("[FMC] Vocabulary Check ... "~msg, type);
try(code:vocab_load,success_func: func vocab_info("OK",0), fail_func: func vocab_info("XML PARSE ERROR",2));

(untested code)

That should give you an XML "parse error" if the file cannot be loaded using read_properties();

http://plausible.org/nasal/lib.html
plausible.org/nasal wrote:call(fn, args=[], me=nil, namespace=nil, error=nil)
Calls the given function with the given arguments and returns the result. The optional arguments can be used to specify the "me" reference for a function call and the local variable namespace. The error argument, if present, must be a vector. If the called function terminates due to a runtime error or die() call, the error (either a string or the argument to die() is appended to the vector, followed by the file name at which the error occurred, followed by the line number in that file, followed in order by each file/line number on the call stack.



Regarding your EDIT2: You'd need to save that info in $FG_HOME to ensure that the location is writable on all FG installations. Not difficult to do - don't know how many people are going to use such a feature and even contribute back their own dictionary?
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: New Boeing 787-8 GIT

Postby omega95 » Fri Mar 09, 2012 4:15 pm

Wow, your check is pretty complicated... :| First, let me try to understand it. :shock:

Regarding your EDIT2: You'd need to save that info in $FG_HOME to ensure that the location is writable on all FG installations. Not difficult to do - don't know how many people are going to use such a feature and even contribute back their own dictionary?


Umm, when I create a merge request to put the plane in fgdata, I'll probably add these:

Code: Select all
WRITE ALLOW $FG_AIRCRAFT/787-8/FMC-DB/Flightplans/*.xml
WRITE ALLOW $FG_AIRCRAFT/787-8/FMC-DB/Vocabulary/*.xml


to IOrules too... Shouldn't that work?

EDIT:

Lol, did you know that type 2 stands for MASTER WARNING!... LOL! A bad vocabulary is NOT a master warning. :lol:
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95
 
Posts: 1222
Joined: Sat Jul 30, 2011 1: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

Postby Hooray » Fri Mar 09, 2012 4:26 pm

Is it working for you?

Sorry, I didn't look at your original code - I just remembered seeing "2" being used for warnings ;-)
In general, it's easier not to use "magic constants", but use symbolic names. For example:

Code: Select all
var msg_type {info:0, caution:1,warning: 2};


PS: I am not sure if an aircraft commit should be allowed/required to modify IORules ...
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: New Boeing 787-8 GIT

Postby omega95 » Fri Mar 09, 2012 5:39 pm

Alright! I got the FMC to learn new words now and it works great. The FMC also gives priority to newly learnt words as they were used by the user itself over the stored words. Anyway, I've taught my 787-8's FMC a couple of words and it remembers them. (mine in the sense, the one installed on my system... you need to teach your 787 on your own :P )

Now, HOPEFULLY I will be taking a break from the 787 till March 14th so I can study for my chem exam. Give me a virtual slap If I get back here b4 the 14th. 8)
Merlion Virtual Airlines - the experience of a flight time...
Get high quality aircraft, airports, video tutorials or development tools from my hangar.
omega95
 
Posts: 1222
Joined: Sat Jul 30, 2011 1: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

Postby redneck » Mon Apr 02, 2012 4:33 am

Hey guys. I recently learned a heck of a lot more about tuning APs. I've changed the heading hold modes by removing the stage 1 PID controllers and replacing them with filters to create a dynamic bank limit such that the plane will make half rate turns, like airliners are supposed to. By using filters, it seems that I've completely eliminated any issues it may have had with overshooting the target heading. Of course, when in LNAV mode, it may overshoot by one or two degrees, but you have to keep in mind that the target is constantly changing at all times in that case, even if it is just a little bit. I suppose that's all for now. Perhaps I'll find a way to improve altitude hold, and maybe even the PID controller for VNAV tomorrow.
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: 3617
Joined: Mon Feb 02, 2009 3:17 am
Location: Pennsylvania, USA
Version: 240

PreviousNext

Return to Aircraft

Who is online

Users browsing this forum: No registered users and 17 guests