From 2b846cbddbc0cf39398e85bf56feef812517af29 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Wed, 18 Jul 2012 21:26:33 +0200 Subject: [PATCH] c172p: kma20 audio panel --- Aircraft/c172p/Instruments/kr87-adf/kr87.xml | 3 +- Aircraft/c172p/Nasal/kma20.nas | 41 ++++++++++++++++++++ Aircraft/c172p/c172p-set.xml | 11 ++++++ 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 Aircraft/c172p/Nasal/kma20.nas diff --git a/Aircraft/c172p/Instruments/kr87-adf/kr87.xml b/Aircraft/c172p/Instruments/kr87-adf/kr87.xml index d9a4311a6..811eb9229 100644 --- a/Aircraft/c172p/Instruments/kr87-adf/kr87.xml +++ b/Aircraft/c172p/Instruments/kr87-adf/kr87.xml @@ -11,8 +11,7 @@ select indicator - /instrumentation/adf[0]/serviceable - /instrumentation/adf[0]/power-btn + /instrumentation/adf[0]/operable diff --git a/Aircraft/c172p/Nasal/kma20.nas b/Aircraft/c172p/Nasal/kma20.nas new file mode 100644 index 000000000..e8770762e --- /dev/null +++ b/Aircraft/c172p/Nasal/kma20.nas @@ -0,0 +1,41 @@ +################################################################## +# +# These are the helper functions for the kma20 audio panel +# Maintainer: Thorsten Brehm (brehmt at gmail dot com) +# +# Usage: +# just create one instance of kma20 class for each kma20 panel +# you have in your aircraft: +# kma20.new(0); +# +# KMA20 audio panel properties: +# root: /instrumentation/kma20 +# knob: microphone/radio selector (com1/2) +# auto: selects COM1/2 based on microphone selector +# com1: enable/disable COM1 audio (e.g. for ATIS) +# com2: enable/disable COM2 audio (e.g. for ATIS) +# nav1: enable/disable NAV1 station identifier +# nav2: enable/disable NAV2 station identifier +# adf: enable/disable ADF station identifier +# dme: enable/disable DME station identifier +# mkr: enable/disable marker beacon audio +# sens: beacon receiver sensitivity + +var kma20 = {}; + +kma20.new = func(rootPath) { + var obj = {}; + obj.parents = [kma20]; + + setlistener(rootPath ~ "/com1", func(v) {setprop("/instrumentation/comm/volume", 0.7*(v.getValue() != 0));}, 1); + setlistener(rootPath ~ "/com2", func(v) {setprop("/instrumentation/comm[1]/volume", 0.7*(v.getValue() != 0));}, 1); + setlistener(rootPath ~ "/nav1", func(v) {setprop("/instrumentation/nav/audio-btn", (v.getValue() != 0));}, 1); + setlistener(rootPath ~ "/nav2", func(v) {setprop("/instrumentation/nav[1]/audio-btn", (v.getValue() != 0));}, 1); + setlistener(rootPath ~ "/adf", func(v) {setprop("/instrumentation/adf/ident-audible", (v.getValue() != 0));}, 1); + setlistener(rootPath ~ "/dme", func(v) {setprop("/instrumentation/dme/ident", (v.getValue() != 0));}, 1); + setlistener(rootPath ~ "/mkr", func(v) {setprop("/instrumentation/marker-beacon/audio-btn",(v.getValue() != 0));}, 1); + print( "KMA20 audio panel initialized" ); + return obj; +}; + +var kma20_0 = kma20.new( "/instrumentation/kma20" ); diff --git a/Aircraft/c172p/c172p-set.xml b/Aircraft/c172p/c172p-set.xml index 19b41cc56..f27dffcc8 100644 --- a/Aircraft/c172p/c172p-set.xml +++ b/Aircraft/c172p/c172p-set.xml @@ -195,6 +195,16 @@ Started October 23 2001 by John Check, fgpanels@rockfish.net true + + false + 0.7 + + + @@ -214,6 +224,7 @@ Started October 23 2001 by John Check, fgpanels@rockfish.net Aircraft/c172p/Nasal/doors.nas Aircraft/c172p/Nasal/light.nas Aircraft/c172p/Nasal/tanks.nas + Aircraft/c172p/Nasal/kma20.nas Aircraft/c172p/Nasal/ki266.nas