2018-02-09 18:55:53 +00:00
|
|
|
# Copyright 2018 Stuart Buchanan
|
|
|
|
# This file is part of FlightGear.
|
|
|
|
#
|
2018-05-28 19:15:57 +00:00
|
|
|
# FlightGear is free software: you can redistribute it and/or modify
|
2018-02-09 18:55:53 +00:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# FlightGear is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with FlightGear. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
2018-01-18 19:37:50 +00:00
|
|
|
# Air Data Computer Driver using Emesary to publish data such as
|
|
|
|
#
|
|
|
|
# Airspeed
|
|
|
|
# Orientation
|
|
|
|
# Rate of turn
|
|
|
|
# Heading
|
|
|
|
# Air Temperature
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# For the moment these are just taken directly from the raw properties. They
|
|
|
|
# should probably come from aircraft-specific instrumentation.
|
|
|
|
|
|
|
|
var GenericADCPublisher =
|
|
|
|
{
|
2018-08-01 20:34:01 +00:00
|
|
|
new : func () {
|
|
|
|
|
|
|
|
# Update frequency can be controlled by a property.
|
|
|
|
var frequency = getprop("/instrumentation/FG1000/adc-update-frequency");
|
2019-01-14 22:22:20 +00:00
|
|
|
if (frequency == nil) frequency = 10;
|
2018-01-18 19:37:50 +00:00
|
|
|
|
|
|
|
var obj = {
|
|
|
|
parents : [
|
|
|
|
GenericADCPublisher,
|
2019-01-14 22:22:20 +00:00
|
|
|
PeriodicPropertyPublisher.new(notifications.PFDEventNotification.ADCData, 1.0/frequency)
|
2018-01-18 19:37:50 +00:00
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
obj.addPropMap("ADCTrueAirspeed", "/instrumentation/airspeed-indicator/true-speed-kt");
|
2018-02-26 21:24:21 +00:00
|
|
|
obj.addPropMap("ADCIndicatedAirspeed", "/instrumentation/airspeed-indicator/indicated-speed-kt");
|
2018-01-18 19:37:50 +00:00
|
|
|
|
2018-02-26 21:24:21 +00:00
|
|
|
obj.addPropMap("ADCPitchDeg", "/instrumentation/attitude-indicator/indicated-pitch-deg");
|
|
|
|
obj.addPropMap("ADCRollDeg", "/instrumentation/attitude-indicator/indicated-roll-deg");
|
|
|
|
obj.addPropMap("ADCTurnRate", "/instrumentation/turn-indicator/indicated-turn-rate");
|
|
|
|
obj.addPropMap("ADCSlipSkid", "/instrumentation/slip-skid-ball/indicated-slip-skid");
|
|
|
|
|
|
|
|
# Assume an accurate solid-state compass
|
2018-03-16 15:21:39 +00:00
|
|
|
obj.addPropMap("ADCHeadingMagneticDeg", "/orientation/heading-magnetic-deg");
|
|
|
|
obj.addPropMap("ADCMagneticVariationDeg", "/environment/magnetic-variation-deg");
|
2018-02-26 21:24:21 +00:00
|
|
|
|
|
|
|
obj.addPropMap("ADCAltitudeFT", "/instrumentation/altimeter/indicated-altitude-ft");
|
|
|
|
obj.addPropMap("ADCPressureSettingInHG", "/instrumentation/altimeter/setting-inhg");
|
|
|
|
|
|
|
|
obj.addPropMap("ADCVerticalSpeedFPM", "/instrumentation/vertical-speed-indicator/indicated-speed-fpm");
|
|
|
|
|
|
|
|
obj.addPropMap("ADCOutsideAirTemperatureC", "/environment/temperature-degc");
|
|
|
|
obj.addPropMap("ADCWindHeadingDeg", "/environment/wind-from-heading-deg");
|
|
|
|
obj.addPropMap("ADCWindSpeedKt", "/environment/wind-speed-kt");
|
2019-01-12 21:23:27 +00:00
|
|
|
obj.addPropMap("ADCTimeLocalSec", "/sim/time/local-day-seconds");
|
|
|
|
obj.addPropMap("ADCTimeUTCSec", "/sim/time/utc/day-seconds");
|
2018-01-18 19:37:50 +00:00
|
|
|
return obj;
|
|
|
|
},
|
|
|
|
};
|