A3XX: Fix VOR2/ADF2 on ND ID and DME not showing properly
This commit is contained in:
parent
44d592ca18
commit
7821553444
10 changed files with 112 additions and 22 deletions
|
@ -1,4 +1,10 @@
|
||||||
# A3XX ND Implementation
|
# A3XX ND Canvas
|
||||||
|
# Joshua Davidson (it0uchpods)
|
||||||
|
# Based on work by artix
|
||||||
|
|
||||||
|
##############################################
|
||||||
|
# Copyright (c) Joshua Davidson (it0uchpods) #
|
||||||
|
##############################################
|
||||||
|
|
||||||
var get_local_path = func(file){
|
var get_local_path = func(file){
|
||||||
var aircraft_dir = split("/", getprop("/sim/aircraft-dir"))[-1];
|
var aircraft_dir = split("/", getprop("/sim/aircraft-dir"))[-1];
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
# A3XX ND Canvas
|
||||||
|
# Joshua Davidson (it0uchpods)
|
||||||
|
# Based on work by artix
|
||||||
|
|
||||||
|
##############################################
|
||||||
|
# Copyright (c) Joshua Davidson (it0uchpods) #
|
||||||
|
##############################################
|
||||||
|
|
||||||
var A3XXRouteDriver = {
|
var A3XXRouteDriver = {
|
||||||
new: func(){
|
new: func(){
|
||||||
var m = {
|
var m = {
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
# A3XX ND Canvas
|
||||||
|
# Joshua Davidson (it0uchpods)
|
||||||
|
# Based on work by artix
|
||||||
|
|
||||||
|
##############################################
|
||||||
|
# Copyright (c) Joshua Davidson (it0uchpods) #
|
||||||
|
##############################################
|
||||||
|
|
||||||
canvas.NDConfig = {
|
canvas.NDConfig = {
|
||||||
properties: {
|
properties: {
|
||||||
des_apt: "/autopilot/route-manager/destination/airport",
|
des_apt: "/autopilot/route-manager/destination/airport",
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
# A3XX ND Canvas
|
||||||
|
# Joshua Davidson (it0uchpods)
|
||||||
|
# Based on work by artix
|
||||||
|
|
||||||
|
##############################################
|
||||||
|
# Copyright (c) Joshua Davidson (it0uchpods) #
|
||||||
|
##############################################
|
||||||
|
|
||||||
canvas.RouteDriver = {
|
canvas.RouteDriver = {
|
||||||
new: func(){
|
new: func(){
|
||||||
var m = {
|
var m = {
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
# A3XX ND Canvas
|
||||||
|
# Joshua Davidson (it0uchpods)
|
||||||
|
# Based on work by artix
|
||||||
|
|
||||||
|
##############################################
|
||||||
|
# Copyright (c) Joshua Davidson (it0uchpods) #
|
||||||
|
##############################################
|
||||||
|
|
||||||
var assert_m = canvas.assert_m;
|
var assert_m = canvas.assert_m;
|
||||||
|
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
# A3XX ND Canvas
|
||||||
|
# Joshua Davidson (it0uchpods)
|
||||||
|
# Based on work by artix
|
||||||
|
|
||||||
|
##############################################
|
||||||
|
# Copyright (c) Joshua Davidson (it0uchpods) #
|
||||||
|
##############################################
|
||||||
|
|
||||||
# Override FGDATA/Nasal/canvas/map/navdisplay.mfd
|
# Override FGDATA/Nasal/canvas/map/navdisplay.mfd
|
||||||
|
|
||||||
var default_hash = canvas.default_hash;
|
var default_hash = canvas.default_hash;
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
# A3XX ND Canvas
|
||||||
|
# Joshua Davidson (it0uchpods)
|
||||||
|
# Based on work by artix
|
||||||
|
|
||||||
|
##############################################
|
||||||
|
# Copyright (c) Joshua Davidson (it0uchpods) #
|
||||||
|
##############################################
|
||||||
|
|
||||||
var SymbolPainter = {
|
var SymbolPainter = {
|
||||||
aircraft_dir: nil,
|
aircraft_dir: nil,
|
||||||
getOpts: func(opts){
|
getOpts: func(opts){
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
# A3XX ND Canvas
|
||||||
|
# Joshua Davidson (it0uchpods)
|
||||||
|
# Based on work by artix
|
||||||
|
|
||||||
|
##############################################
|
||||||
|
# Copyright (c) Joshua Davidson (it0uchpods) #
|
||||||
|
##############################################
|
||||||
|
|
||||||
var version = getprop("sim/version/flightgear");
|
var version = getprop("sim/version/flightgear");
|
||||||
var v = split(".", version);
|
var v = split(".", version);
|
||||||
version = num(v[0]~"."~v[1]);
|
version = num(v[0]~"."~v[1]);
|
||||||
|
|
|
@ -1,25 +1,11 @@
|
||||||
# ==============================================================================
|
# A3XX ND Canvas
|
||||||
# Boeing Navigation Display by Gijs de Rooy
|
# Joshua Davidson (it0uchpods)
|
||||||
# See: http://wiki.flightgear.org/Canvas_ND_Framework
|
# Based on work by artix
|
||||||
# ==============================================================================
|
|
||||||
# This file makes use of the MapStructure framework, see: http://wiki.flightgear.org/Canvas_MapStructure
|
|
||||||
#
|
|
||||||
# Sooner or later, some parts will be revamped by coming up with a simple animation framework: http://wiki.flightgear.org/NavDisplay#mapping_vs._SVG_animation
|
|
||||||
|
|
||||||
##
|
##############################################
|
||||||
# pseudo DSL-ish: use these as placeholders in the config hash below
|
# Copyright (c) Joshua Davidson (it0uchpods) #
|
||||||
var ALWAYS = func 1;
|
##############################################
|
||||||
var NOTHING = func nil;
|
|
||||||
|
|
||||||
##
|
|
||||||
# TODO: move ND-specific implementation details into this lookup hash
|
|
||||||
# so that other aircraft and ND types can be more easily supported
|
|
||||||
#
|
|
||||||
# any aircraft-specific ND behavior should be wrapped here,
|
|
||||||
# to isolate/decouple things in the generic NavDisplay class
|
|
||||||
#
|
|
||||||
# TODO: move this to an XML config file (maybe supporting SGCondition and/or SGStateMachine markup for the logic?)
|
|
||||||
#
|
|
||||||
canvas.NDStyles["Airbus"] = {
|
canvas.NDStyles["Airbus"] = {
|
||||||
font_mapper: func(family, weight) {
|
font_mapper: func(family, weight) {
|
||||||
if( family == "Liberation Sans" and weight == "normal" )
|
if( family == "Liberation Sans" and weight == "normal" )
|
||||||
|
@ -1568,6 +1554,48 @@ canvas.NDStyles["Airbus"] = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "vorR",
|
||||||
|
impl: {
|
||||||
|
init: func(nd,symbol),
|
||||||
|
predicate: func(nd) (nd.get_switch("toggle_rh_vor_adf") != 0),
|
||||||
|
is_true: func(nd) {
|
||||||
|
nd.symbols.vorR.show();
|
||||||
|
nd.symbols.vorRId.show();
|
||||||
|
nd.symbols.dmeRDist.show();
|
||||||
|
if(nd.get_switch("toggle_rh_vor_adf") < 0){
|
||||||
|
var adf = "instrumentation/adf[1]/";
|
||||||
|
var navident = getprop(adf~ "ident");
|
||||||
|
var frq = getprop(adf~ "frequencies/selected-khz");
|
||||||
|
if(navident != "")
|
||||||
|
nd.symbols.vorRId.setText(navident);
|
||||||
|
else
|
||||||
|
nd.symbols.vorRId.setText(sprintf("%3d", frq));
|
||||||
|
nd.symbols.dmeRDist.setText("");
|
||||||
|
} else {
|
||||||
|
var nav = nd.get_nav_path("vor", 1);
|
||||||
|
var navID = getprop(nav~"nav-id");
|
||||||
|
var frq = getprop(nav~"frequencies/selected-mhz-fmt");
|
||||||
|
var dme = nd.get_nav_path("dme", 1);
|
||||||
|
var dst = getprop(dme~ "indicated-distance-nm");
|
||||||
|
#print(dme~ "indicated-distance-nm");
|
||||||
|
if(getprop(nav~ "in-range"))
|
||||||
|
nd.symbols.vorRId.setText(navID);
|
||||||
|
else
|
||||||
|
nd.symbols.vorRId.setText(frq);
|
||||||
|
if(getprop(dme~ "in-range"))
|
||||||
|
nd.symbols.dmeRDist.setText(sprintf("%3.1f",
|
||||||
|
dst));
|
||||||
|
else nd.symbols.dmeRDist.setText(" ---");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
is_false: func(nd){
|
||||||
|
nd.symbols.vorR.hide();
|
||||||
|
nd.symbols.vorRId.hide();
|
||||||
|
nd.symbols.dmeRDist.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id:"vorRSym",
|
id:"vorRSym",
|
||||||
impl: {
|
impl: {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
4023
|
4024
|
Reference in a new issue