1
0
Fork 0
fgdata/Aircraft/Instruments-3d/FG1000/Nasal/Interfaces/GenericEISPublisher.nas
Stuart Buchanan 73424c1791 Update NAV/COMM frequencies from properties
- Add new Emesary notification type for NAV/COM data
- Create Update/Publish interfaces using Emesary from properties
- Use interfaces to drive updates to EIS and NAV/COM frequencies
- Change the PageGroupController to a "proper" MFD page
2018-01-05 16:37:39 +00:00

41 lines
1.5 KiB
Text

# EIS Driver using Emesary for a single engined aircraft, e.g. Cessna 172.
var GenericEISPublisher =
{
new : func (frequency=0.25, transmitter = nil) {
var obj = {
parents : [ GenericEISPublisher, PropertyPublisher.new(frequency, transmitter) ],
};
# Hack to handle most aircraft not having proper engine hours
if (getprop("/engines/engine[0]/hours") == nil) setprop("/engines/engine[0]/hours", 157.0);
obj.addPropMap("RPM", "/engines/engine[0]/rpm");
obj.addPropMap("MBusVolts", "/systems/electrical/volts");
obj.addPropMap("EngineHours", "/engines/engine[0]/hours");
obj.addPropMap("FuelFlowGPH", "/engines/engine[0]/fuel-flow-gph");
obj.addPropMap("OilPressurePSI", "/engines/engine[0]/oil-pressure-psi");
obj.addPropMap("OilTemperatureF", "/engines/engine[0]/oil-temperature-degf");
obj.addPropMap("EGTNorm", "/engines/engine[0]/egt-norm");
obj.addPropMap("VacuumSuctionInHG", "/systems/vacuum/suction-inhg");
obj.addPropMap("LeftFuelUSGal", "/consumables/fuel/tank[0]/indicated-level-gal_us");
obj.addPropMap("RightFuelUSGal", "/consumables/fuel/tank[1]/indicated-level-gal_us");
return obj;
},
publish : func() {
var engineData0 = {};
foreach (var propmap; me._propmaps) {
var name = propmap.getName();
engineData0[name] = propmap.getValue();
}
var engineData = [];
append(engineData, engineData0);
me.notify(notifications.PFDEventNotification.EngineData, engineData);
},
};