1
0
Fork 0

FG1000: Local time display, ETE fix.

This commit is contained in:
Stuart Buchanan 2019-01-12 21:23:27 +00:00
parent e69c77aa8e
commit acabed103f
4 changed files with 17 additions and 1 deletions

View file

@ -61,6 +61,8 @@ var GenericADCPublisher =
obj.addPropMap("ADCOutsideAirTemperatureC", "/environment/temperature-degc");
obj.addPropMap("ADCWindHeadingDeg", "/environment/wind-from-heading-deg");
obj.addPropMap("ADCWindSpeedKt", "/environment/wind-speed-kt");
obj.addPropMap("ADCTimeLocalSec", "/sim/time/local-day-seconds");
obj.addPropMap("ADCTimeUTCSec", "/sim/time/utc/day-seconds");
return obj;
},
};

View file

@ -100,7 +100,7 @@ var GenericFMSPublisher =
}
gpsdata["FMSDistance"] = dst;
var spd = getprop("/instrumentation/gps/indicated-ground-speed-kt") or 1.0;
var spd = math.max(getprop("/instrumentation/gps/indicated-ground-speed-kt"), 20.0);
var time_hrs = dst / spd;
gpsdata["FMSEstimatedTimeEnroute"] = time_hrs;

View file

@ -62,6 +62,7 @@ var PFDInstruments =
"SelectedALT-text",
"XPDR-DIGIT-3-text", "XPDR-DIGIT-2-text", "XPDR-DIGIT-1-text", "XPDR-DIGIT-0-text",
"XPDR-MODE-text",
"TIME-text",
]);
# Set clipping for the various tapes
@ -514,6 +515,13 @@ var PFDInstruments =
me.setTextElement("OAT-text", sprintf((abs(oat) < 10) ? "%.1f %s" : "%i %s", oat, "°C"));
},
updateTime : func (time_sec) {
var sec = math.mod(time_sec, 60);
var mins = math.mod((time_sec - sec) / 60, 60);
var hours = math.mod((time_sec - mins - sec) / 3600, 12);
me.setTextElement("TIME-text", sprintf("%02d:%02d:%02d", hours, mins, sec));
},
updateHSI : func (hdg) {
me.getElement("Rose").setRotation(-hdg * D2R);
me.setTextElement("HDG-text", sprintf("%03u°", hdg));

View file

@ -39,6 +39,7 @@ var PFDInstrumentsController =
_selected_alt_ft : 0,
_heading_magnetic_deg : 0,
_mag_var : 0,
_time_sec : 0,
_fp_active : 0,
_fp_current_wp : 0,
@ -245,6 +246,11 @@ var PFDInstrumentsController =
no_data: (data["ADCIndicatedAirspeed"] < 1.0)
);
if ((data["ADCTimeLocalSec"] != nil) and (me._time_sec != data["ADCTimeLocalSec"])) {
me._time_sec = data["ADCTimeLocalSec"];
me.page.updateTime(me._time_sec);
}
return emesary.Transmitter.ReceiptStatus_OK;
},