Skip to content

Commit

Permalink
Adding features from A330 (canvas ND, impoved FMGC and instrmentation)
Browse files Browse the repository at this point in the history
  • Loading branch information
artix75 committed Apr 8, 2015
1 parent ddd01a8 commit 00213ee
Show file tree
Hide file tree
Showing 218 changed files with 179,840 additions and 57,309 deletions.
360 changes: 340 additions & 20 deletions A320neo-common.xml

Large diffs are not rendered by default.

3,211 changes: 2,663 additions & 548 deletions Models/FlightDeck/a320neo.flightdeck.xml

Large diffs are not rendered by default.

Binary file modified Models/FlightDeck/res/fcu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
140,334 changes: 98,663 additions & 41,671 deletions Models/FlightDeck/res/fd_complete.ac

Large diffs are not rendered by default.

Binary file added Models/FlightDeck/res/sidestick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
680 changes: 680 additions & 0 deletions Models/Instruments/ND/ND.bck.nas

Large diffs are not rendered by default.

61 changes: 37 additions & 24 deletions Models/Instruments/ND/ND.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<PropertyList>

<path>res/nd-empty.ac</path>
<!-- model>
<path>res/ND.ac</path>
<model>
<path>Aircraft/A320neo/Models/Instruments/ND/terrain-map-pixel.xml</path>
<condition>
<and>
Expand All @@ -11,16 +11,16 @@
<value>15</value>
</greater-than>

<property>/instrumentation/efis/input/TERR</property>
<property>/instrumentation/efis/nd/terrain-on-nd</property>

</and>
</condition>

<offsets>
<x-m>0.001</x-m>
</offsets>
</model -->
<panel>
</model>
<!--panel>
<path>Aircraft/A320neo/Models/Instruments/ND/Display.xml</path>
<condition>
<greater-than>
Expand All @@ -43,25 +43,38 @@
<y-m>-0.0771</y-m>
<z-m>0.0739</z-m>
</top-left>
</panel>

<!--panel>
<path>Aircraft/A320neo/Models/Instruments/ND/Display-text.xml</path>
<bottom-left>
<x-m>0.002</x-m>
<y-m>-0.088</y-m>
<z-m>-0.078</z-m>
</bottom-left>
<bottom-right>
<x-m>0.002</x-m>
<y-m>0.088</y-m>
<z-m>-0.078</z-m>
</bottom-right>
<top-left>
<x-m>0.002</x-m>
<y-m>-0.088</y-m>
<z-m>0.097</z-m>
</top-left>
</panel-->
<animation>
<type>select</type>
<object-name>Power.off</object-name>
<condition>
<less-than>
<property>systems/electrical/outputs/efis</property>
<value>15</value>
</less-than>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>ND.screen</object-name>
<condition>
<greater-than>
<property>systems/electrical/outputs/efis</property>
<value>15</value>
</greater-than>
</condition>
</animation>
<animation>
<type>pick</type>
<object-name>ND.screen</object-name>
<action>
<button>0</button>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>canvas_nd.showNd();</script>
</binding>
</action>
</animation>

</PropertyList>
56 changes: 56 additions & 0 deletions Models/Instruments/ND/ND_R.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0"?>
<PropertyList>

<path>res/ND_R.ac</path>
<model>
<path>Aircraft/A320neo/Models/Instruments/ND/terrain-map-pixel.xml</path>
<condition>
<and>
<greater-than>
<property>systems/electrical/outputs/efis</property>
<value>15</value>
</greater-than>

<property>/instrumentation/efis/nd/terrain-on-nd</property>

</and>
</condition>

<offsets>
<x-m>0.001</x-m>
</offsets>
</model>
<animation>
<type>select</type>
<object-name>Power_R.off</object-name>
<condition>
<less-than>
<property>systems/electrical/outputs/efis</property>
<value>15</value>
</less-than>
</condition>
</animation>
<animation>
<type>select</type>
<object-name>ND_R.screen</object-name>
<condition>
<greater-than>
<property>systems/electrical/outputs/efis</property>
<value>15</value>
</greater-than>
</condition>
</animation>
<animation>
<type>pick</type>
<object-name>ND_R.screen</object-name>
<action>
<button>0</button>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>canvas_nd.showNd('right');</script>
</binding>
</action>
</animation>

</PropertyList>
42 changes: 42 additions & 0 deletions Models/Instruments/ND/canvas/A330_ND.nas
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# A330-200 ND Implementation

print('Loading local canvas ND...');


var get_local_path = func(file){
var aircraft_dir = split('/', getprop("/sim/aircraft-dir"))[-1];
return "Aircraft/" ~ aircraft_dir ~ "/Models/Instruments/ND/canvas/"~ file;
};

var version = getprop('sim/version/flightgear');
var v = split('.', version);
version = num(v[0]~'.'~v[1]);

var SymbolLayer = canvas.SymbolLayer;
var SingleSymbolLayer = canvas.SingleSymbolLayer;
var MultiSymbolLayer = canvas.MultiSymbolLayer;
var NavaidSymbolLayer = canvas.NavaidSymbolLayer;
var Symbol = canvas.Symbol;
var Group = canvas.Group;
var Path = canvas.Path;
var DotSym = canvas.DotSym;
var Map = canvas.Map;
var SVGSymbol = canvas.SVGSymbol;
var LineSymbol = canvas.LineSymbol;
var StyleableCacheable = canvas.StyleableCacheable;
var SymbolCache32x32 = canvas.SymbolCache32x32;
var SymbolCache = canvas.SymbolCache;
var Text = canvas.Text;


if(version < 3.2){
io.include('canvas_compat.nas');
}

io.include('ND_config.nas');
io.include('framework/canvas.nas');
io.include('framework/navdisplay.nas');
io.include('framework/MapDrivers.nas');
io.include('loaders.nas');
io.include('helpers.nas');
io.include('style.nas');
147 changes: 147 additions & 0 deletions Models/Instruments/ND/canvas/A330_ND_drivers.nas
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
var DISP_SEC_FPLN = 'instrumentation/mcdu/sec-f-pln/disp';

var A330RouteDriver = {
parents: [canvas.RouteDriver],
new: func(){
var m = {
parents: [A330RouteDriver],
plan_wp_info: nil,
updating: 0
};
m.init();
return m;
},
init: func(){
me.route_manager = fmgc.RouteManager.init();
me.fplan_types = [];
me.plans = {};
me.update();
},
update: func(){
if(!getprop('autopilot/route-manager/route/num'))
return;
me.updating = 1;
if(me.route_manager.sequencing) return;
var phase = getprop('/flight-management/phase');
me.fplan_types = [];
me.plans = me.route_manager.allFlightPlans();
me.alternates = me.route_manager.alternates;
append(me.fplan_types, 'current');
if(me.route_manager.getAlternateRoute() != nil){
if(!getprop("/instrumentation/mcdu/f-pln/enabling-altn"))
append(me.fplan_types, 'alternate_current');
}
if(me.plans['temporary'] != nil) append(me.fplan_types, 'temporary');
if(me.plans['secondary'] != nil and getprop(DISP_SEC_FPLN)) {
append(me.fplan_types, 'secondary');
if(me.route_manager.getAlternateRoute('secondary') != nil)
append(me.fplan_types, 'alternate_secondary');
}
if(me.route_manager.missed_approach_planned){
if(phase != 'G/A')
append(me.fplan_types, 'missed');
}
me.phase = phase;
me.updating = 0;
},
getNumberOfFlightPlans: func(){
if(me.route_manager.sequencing or me.updating) return 0;
size(me.fplan_types);
},
getFlightPlanType: func(fpNum){
if(me.route_manager.sequencing or me.updating) return nil;
if(fpNum >= me.getNumberOfFlightPlans()) return nil;
me.fplan_types[fpNum];
},
getFlightPlan: func(fpNum){
if(me.route_manager.sequencing or me.updating) return nil;
var type = me.getFlightPlanType(fpNum);
if(type == nil) return nil;
if(type != 'missed'){
me.getFlightPlanByType(type);
} else {
var srcPlan = me.plans.current;
var fp = srcPlan.clone();
#fp.cleanPlan();
while(fp.getPlanSize())
fp.deleteWP(0);
var missed_appr = me.route_manager.missed_approach;
var idx = me.route_manager.destination_idx;
var size = srcPlan.getPlanSize();
for(var i = idx; i < size; i += 1){
var wp = srcPlan.getWP(i);
fp.appendWP(wp);
}
fp;
}
},
getFlightPlanByType: func(type){
if(me.route_manager.sequencing or me.updating) return nil;
if(find('alternate_', type) == 0)
me.alternates[split('_', type)[1]];
else
me.plans[type];
},
getPlanSize: func(fpNum){
if(me.route_manager.sequencing or me.updating) return 0;
var type = me.getFlightPlanType(fpNum);
if(type == nil) return 0;
if(type == 'missed'){
var missed_approach = me.route_manager.missed_approach;
missed_approach.wp_count;
}
elsif(type == 'current'){
if(me.phase == 'G/A')
me.route_manager.total_wp_count;
else
me.route_manager.wp_count;
} else {
var fp = me.getFlightPlanByType(type);
(fp != nil ? fp.getPlanSize() : 0);
}
},
getWP: func(fpNum, idx){
if(me.route_manager.sequencing or me.updating) return nil;
var type = me.getFlightPlanType(fpNum);
if(type == nil) return 0;
if(type != 'missed'){
var fp = me.getFlightPlanByType(type);
(fp != nil ? fp.getWP(idx) : nil);
} else {
var fp = me.plans['current'];
var missed_approach = me.route_manager.missed_approach;
var offset = missed_approach.first_wp.index;
fp.getWP(offset + idx);
}
},
getPlanModeWP: func(idx){
if(me.route_manager.sequencing or me.updating) return me.plan_wp_info;
var wp = mcdu.f_pln.get_wp(idx);
if(wp != nil){
me.plan_wp_info = {
id: wp.id,
wp_lat: wp.wp_lat,
wp_lon: wp.wp_lon
};
}
return wp;
},
getListeners: func(){
var rm = fmgc.RouteManager;
[
me.route_manager.getSignal(rm.SIGNAL_FP_COPY),
me.route_manager.getSignal(rm.SIGNAL_FP_CREATED),
me.route_manager.getSignal(rm.SIGNAL_FP_DEL),
me.route_manager.getSignal(rm.SIGNAL_FP_EDIT),
DISP_SEC_FPLN
]
},
shouldUpdate: func(){
!me.route_manager.sequencing and !me.updating;
},
hasDiscontinuity: func(fpNum, wptID){
if(me.route_manager.sequencing) return 0;
var type = me.getFlightPlanType(fpNum);
me.route_manager.hasDiscontinuity(wptID, type);
}
};
Loading

0 comments on commit 00213ee

Please sign in to comment.