1
0
Fork 0
fgdata/Aircraft/Instruments-3d/ISFD/ISFDGenericController.nas

108 lines
2.2 KiB
Text
Raw Normal View History

var GenericController =
{
2019-01-17 09:46:04 +00:00
new : func (isfd)
{
var obj = {
parents : [GenericController],
2019-01-17 09:46:04 +00:00
_isfd: isfd,
_altimeterProp : "/instrumentation/altimeter/",
_airspeedProp : "/instrumentation/airspeed-indicator/",
_attitudeProp : "/instrumentation/attitude-indicator/",
_navRadio: "/instrumentation/nav[0]/",
_isSTDBaro : 0,
2019-01-17 09:54:39 +00:00
_isHPa : 1,
2019-01-17 09:46:04 +00:00
_approachMode : 0
};
2019-01-17 09:46:04 +00:00
return obj;
},
2019-01-17 09:46:04 +00:00
update : func
{
},
2019-01-17 09:46:04 +00:00
getAltitudeFt : func
{
2019-01-17 09:46:04 +00:00
return getprop(me._altimeterProp ~ "indicated-altitude-ft");
},
2019-01-17 09:46:04 +00:00
getIndicatedAirspeedKnots : func
{
2019-01-17 09:46:04 +00:00
return getprop(me._airspeedProp ~ "indicated-speed-kt");
},
2019-01-17 09:46:04 +00:00
getHeadingDeg : func
{
# compass / gyro source for this?
return getprop("/orientation/heading-deg");
},
2019-01-17 09:46:04 +00:00
getPitchDeg : func
{
2019-01-17 09:46:04 +00:00
return getprop(me._attitudeProp ~ "indicated-pitch-deg");
},
2019-01-17 09:46:04 +00:00
getBankAngleDeg : func
{
return getprop(me._attitudeProp ~ "indicated-roll-deg");
},
2019-01-17 09:46:04 +00:00
isSTDBarometricPressure : func
{
2019-01-17 09:46:04 +00:00
return me._isSTDBaro;
},
2019-01-17 09:46:04 +00:00
toggleSTDBarometricPressure : func
{
2019-01-17 09:46:04 +00:00
me._isSTDBaro = (me._isSTDBaro == 0);
},
2019-01-17 09:46:04 +00:00
isHPaBarometer : func
{
return me._isHPa;
},
2019-01-17 09:46:04 +00:00
toggleHPaBarometer : func
{
me._isHPa = (me._isHPa == 0);
},
getBarometricPressureSettingInHg : func
{
if (me._isSTDBaro) return 29.92;
return getprop(me._altimeterProp ~ "setting-inhg");
},
getBarometricPressureSettingHPa : func
{
if (me._isSTDBaro) return 1013;
return getprop(me._altimeterProp ~ "setting-hpa");
},
setBarometricPressureSettingInHg : func (inHg)
{
setprop(me._altimeterProp ~ "setting-inhg", inHg);
},
setBarometricPressureSettingHPa : func (hpa)
{
setprop(me._altimeterProp ~ "setting-hpa", hpa);
},
isApproachMode: func { return me._approachMode; },
toggleApproachMode : func { me._approachMode = (me._approachMode == 0); },
isLocalizerValid: func { return getprop(me._navRadio ~ "in-range"); },
isGSValid: func { return getprop(me._navRadio ~ "gs-in-range");},
getLocalizerDeviationNorm: func {
return getprop(me._navRadio ~ "heading-needle-deflection-norm");
},
getGSDeviationNorm: func {
return getprop(me._navRadio ~ "gs-needle-deflection-norm");
},
}