diff --git a/Models/Instruments/ND/canvas/A3XX_ND.nas b/Models/Instruments/ND/canvas/A3XX_ND.nas index c4725e03..52d1107f 100644 --- a/Models/Instruments/ND/canvas/A3XX_ND.nas +++ b/Models/Instruments/ND/canvas/A3XX_ND.nas @@ -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 aircraft_dir = split("/", getprop("/sim/aircraft-dir"))[-1]; diff --git a/Models/Instruments/ND/canvas/A3XX_ND_drivers.nas b/Models/Instruments/ND/canvas/A3XX_ND_drivers.nas index 60aea759..4c26c30f 100644 --- a/Models/Instruments/ND/canvas/A3XX_ND_drivers.nas +++ b/Models/Instruments/ND/canvas/A3XX_ND_drivers.nas @@ -1,3 +1,11 @@ +# A3XX ND Canvas +# Joshua Davidson (it0uchpods) +# Based on work by artix + +############################################## +# Copyright (c) Joshua Davidson (it0uchpods) # +############################################## + var A3XXRouteDriver = { new: func(){ var m = { diff --git a/Models/Instruments/ND/canvas/ND_config.nas b/Models/Instruments/ND/canvas/ND_config.nas index 7b76636a..ce9bca65 100644 --- a/Models/Instruments/ND/canvas/ND_config.nas +++ b/Models/Instruments/ND/canvas/ND_config.nas @@ -1,3 +1,11 @@ +# A3XX ND Canvas +# Joshua Davidson (it0uchpods) +# Based on work by artix + +############################################## +# Copyright (c) Joshua Davidson (it0uchpods) # +############################################## + canvas.NDConfig = { properties: { des_apt: "/autopilot/route-manager/destination/airport", diff --git a/Models/Instruments/ND/canvas/framework/MapDrivers.nas b/Models/Instruments/ND/canvas/framework/MapDrivers.nas index 514d513c..417ed044 100644 --- a/Models/Instruments/ND/canvas/framework/MapDrivers.nas +++ b/Models/Instruments/ND/canvas/framework/MapDrivers.nas @@ -1,3 +1,11 @@ +# A3XX ND Canvas +# Joshua Davidson (it0uchpods) +# Based on work by artix + +############################################## +# Copyright (c) Joshua Davidson (it0uchpods) # +############################################## + canvas.RouteDriver = { new: func(){ var m = { diff --git a/Models/Instruments/ND/canvas/framework/canvas.nas b/Models/Instruments/ND/canvas/framework/canvas.nas index 8aafbbdd..121c4e3c 100644 --- a/Models/Instruments/ND/canvas/framework/canvas.nas +++ b/Models/Instruments/ND/canvas/framework/canvas.nas @@ -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; # -------------------------------- diff --git a/Models/Instruments/ND/canvas/framework/navdisplay.nas b/Models/Instruments/ND/canvas/framework/navdisplay.nas index 1beca82d..73c6eceb 100644 --- a/Models/Instruments/ND/canvas/framework/navdisplay.nas +++ b/Models/Instruments/ND/canvas/framework/navdisplay.nas @@ -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 var default_hash = canvas.default_hash; diff --git a/Models/Instruments/ND/canvas/helpers.nas b/Models/Instruments/ND/canvas/helpers.nas index 180a59f5..cd326179 100644 --- a/Models/Instruments/ND/canvas/helpers.nas +++ b/Models/Instruments/ND/canvas/helpers.nas @@ -1,3 +1,11 @@ +# A3XX ND Canvas +# Joshua Davidson (it0uchpods) +# Based on work by artix + +############################################## +# Copyright (c) Joshua Davidson (it0uchpods) # +############################################## + var SymbolPainter = { aircraft_dir: nil, getOpts: func(opts){ diff --git a/Models/Instruments/ND/canvas/loaders.nas b/Models/Instruments/ND/canvas/loaders.nas index ae93d2c4..4c6298a0 100644 --- a/Models/Instruments/ND/canvas/loaders.nas +++ b/Models/Instruments/ND/canvas/loaders.nas @@ -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 v = split(".", version); version = num(v[0]~"."~v[1]); diff --git a/Models/Instruments/ND/canvas/style.nas b/Models/Instruments/ND/canvas/style.nas index 95d41166..2843291e 100644 --- a/Models/Instruments/ND/canvas/style.nas +++ b/Models/Instruments/ND/canvas/style.nas @@ -1,25 +1,11 @@ -# ============================================================================== -# Boeing Navigation Display by Gijs de Rooy -# See: http://wiki.flightgear.org/Canvas_ND_Framework -# ============================================================================== -# 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 +# A3XX ND Canvas +# Joshua Davidson (it0uchpods) +# Based on work by artix -## -# pseudo DSL-ish: use these as placeholders in the config hash below -var ALWAYS = func 1; -var NOTHING = func nil; +############################################## +# Copyright (c) Joshua Davidson (it0uchpods) # +############################################## -## -# 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"] = { font_mapper: func(family, weight) { 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", impl: { diff --git a/revision.txt b/revision.txt index 050e0b7f..40d687f5 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4023 \ No newline at end of file +4024 \ No newline at end of file