forked from artix75/A320neo
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding features from A330 (canvas ND, impoved FMGC and instrmentation)
- Loading branch information
Showing
218 changed files
with
179,840 additions
and
57,309 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
}; |
Oops, something went wrong.