FG1000 PFD Navigation Status Box
This commit is contained in:
parent
7b526adb69
commit
921ce612cb
6 changed files with 1530 additions and 34 deletions
1458
Aircraft/Instruments-3d/FG1000/MFDPages/SurroundPFD.svg
Normal file
1458
Aircraft/Instruments-3d/FG1000/MFDPages/SurroundPFD.svg
Normal file
File diff suppressed because it is too large
Load diff
After Width: | Height: | Size: 77 KiB |
|
@ -29,7 +29,9 @@ var GenericFMSPublisher =
|
||||||
obj.addPropMap("FMSHeadingBug", "/autopilot/settings/heading-bug-deg");
|
obj.addPropMap("FMSHeadingBug", "/autopilot/settings/heading-bug-deg");
|
||||||
obj.addPropMap("FMSSelectedAlt", "/autopilot/settings/target-alt-ft");
|
obj.addPropMap("FMSSelectedAlt", "/autopilot/settings/target-alt-ft");
|
||||||
|
|
||||||
|
obj.addPropMap("FMSMode", "/instrumentation/gps/mode");
|
||||||
obj.addPropMap("FMSLegValid", "/instrumentation/gps/wp/wp[1]/valid");
|
obj.addPropMap("FMSLegValid", "/instrumentation/gps/wp/wp[1]/valid");
|
||||||
|
obj.addPropMap("FMSPreviousLegID", "/instrumentation/gps/wp/wp[0]/ID");
|
||||||
obj.addPropMap("FMSLegID", "/instrumentation/gps/wp/wp[1]/ID");
|
obj.addPropMap("FMSLegID", "/instrumentation/gps/wp/wp[1]/ID");
|
||||||
obj.addPropMap("FMSLegBearingMagDeg", "/instrumentation/gps/wp/wp[1]/bearing-mag-deg");
|
obj.addPropMap("FMSLegBearingMagDeg", "/instrumentation/gps/wp/wp[1]/bearing-mag-deg");
|
||||||
obj.addPropMap("FMSLegDistanceNM", "/instrumentation/gps/wp/wp[1]/distance-nm");
|
obj.addPropMap("FMSLegDistanceNM", "/instrumentation/gps/wp/wp[1]/distance-nm");
|
||||||
|
|
|
@ -17,12 +17,12 @@
|
||||||
# Generic Interface controller.
|
# Generic Interface controller.
|
||||||
|
|
||||||
var nasal_dir = getprop("/sim/fg-root") ~ "/Aircraft/Instruments-3d/FG1000/Nasal/";
|
var nasal_dir = getprop("/sim/fg-root") ~ "/Aircraft/Instruments-3d/FG1000/Nasal/";
|
||||||
|
io.load_nasal(nasal_dir ~ 'Interfaces/NavDataInterface.nas', "fg1000");
|
||||||
io.load_nasal(nasal_dir ~ 'Interfaces/PropertyPublisher.nas', "fg1000");
|
io.load_nasal(nasal_dir ~ 'Interfaces/PropertyPublisher.nas', "fg1000");
|
||||||
io.load_nasal(nasal_dir ~ 'Interfaces/PropertyUpdater.nas', "fg1000");
|
io.load_nasal(nasal_dir ~ 'Interfaces/PropertyUpdater.nas', "fg1000");
|
||||||
io.load_nasal(nasal_dir ~ 'Interfaces/GenericEISPublisher.nas', "fg1000");
|
io.load_nasal(nasal_dir ~ 'Interfaces/GenericEISPublisher.nas', "fg1000");
|
||||||
io.load_nasal(nasal_dir ~ 'Interfaces/GenericNavComPublisher.nas', "fg1000");
|
io.load_nasal(nasal_dir ~ 'Interfaces/GenericNavComPublisher.nas', "fg1000");
|
||||||
io.load_nasal(nasal_dir ~ 'Interfaces/GenericNavComUpdater.nas', "fg1000");
|
io.load_nasal(nasal_dir ~ 'Interfaces/GenericNavComUpdater.nas', "fg1000");
|
||||||
io.load_nasal(nasal_dir ~ 'Interfaces/NavDataInterface.nas', "fg1000");
|
|
||||||
io.load_nasal(nasal_dir ~ 'Interfaces/GenericFMSPublisher.nas', "fg1000");
|
io.load_nasal(nasal_dir ~ 'Interfaces/GenericFMSPublisher.nas', "fg1000");
|
||||||
io.load_nasal(nasal_dir ~ 'Interfaces/GenericFMSUpdater.nas', "fg1000");
|
io.load_nasal(nasal_dir ~ 'Interfaces/GenericFMSUpdater.nas', "fg1000");
|
||||||
io.load_nasal(nasal_dir ~ 'Interfaces/GenericADCPublisher.nas', "fg1000");
|
io.load_nasal(nasal_dir ~ 'Interfaces/GenericADCPublisher.nas', "fg1000");
|
||||||
|
|
|
@ -248,7 +248,6 @@ var PFDInstruments =
|
||||||
},
|
},
|
||||||
ondisplay : func() {
|
ondisplay : func() {
|
||||||
me._group.setVisible(1);
|
me._group.setVisible(1);
|
||||||
me.mfd.setPageTitle(me.title);
|
|
||||||
me.getController().ondisplay();
|
me.getController().ondisplay();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -77,27 +77,36 @@ var HEADER_MAPPING = {
|
||||||
|
|
||||||
var Surround =
|
var Surround =
|
||||||
{
|
{
|
||||||
new : func (mfd, myCanvas, device, svg)
|
new : func (mfd, myCanvas, device, svg, pfd=0)
|
||||||
{
|
{
|
||||||
var obj = { parents : [
|
var obj = { parents : [
|
||||||
Surround,
|
Surround,
|
||||||
MFDPage.new(mfd, myCanvas, device, svg, "Surround", ""),
|
MFDPage.new(mfd, myCanvas, device, svg, "Surround", ""),
|
||||||
] };
|
] };
|
||||||
|
|
||||||
|
obj.pfd = pfd;
|
||||||
|
|
||||||
var textElements = [
|
var textElements = [
|
||||||
"Comm1StandbyFreq", "Comm1SelectedFreq",
|
"Comm1StandbyFreq", "Comm1SelectedFreq",
|
||||||
"Comm2StandbyFreq", "Comm2SelectedFreq",
|
"Comm2StandbyFreq", "Comm2SelectedFreq",
|
||||||
"Nav1StandbyFreq", "Nav1SelectedFreq",
|
"Nav1StandbyFreq", "Nav1SelectedFreq",
|
||||||
"Nav2StandbyFreq", "Nav2SelectedFreq",
|
"Nav2StandbyFreq", "Nav2SelectedFreq",
|
||||||
"Nav1ID", "Nav2ID",
|
"Nav1ID", "Nav2ID",
|
||||||
"Header1Label", "Header1Value",
|
|
||||||
"Header2Label", "Header2Value",
|
|
||||||
"Header3Label", "Header3Value",
|
|
||||||
"Header4Label", "Header4Value",
|
|
||||||
];
|
];
|
||||||
|
|
||||||
obj.addTextElements(textElements);
|
obj.addTextElements(textElements);
|
||||||
|
|
||||||
|
if (pfd) {
|
||||||
|
obj.addTextElements(["HeaderFrom", "HeaderTo", "LegDistance", "LegBRG"]);
|
||||||
|
obj._dto = PFD.HighlightElement.new(obj.pageName, svg, "HeaderDTO", "DTO");
|
||||||
|
obj._leg = PFD.HighlightElement.new(obj.pageName, svg, "HeaderActiveLeg", "Leg");
|
||||||
|
} else {
|
||||||
|
obj.addTextElements(["Header1Label", "Header1Value",
|
||||||
|
"Header2Label", "Header2Value",
|
||||||
|
"Header3Label", "Header3Value",
|
||||||
|
"Header4Label", "Header4Value"]);
|
||||||
|
}
|
||||||
|
|
||||||
obj._comm1selected = PFD.HighlightElement.new(obj.pageName, svg, "Comm1Selected", "Comm1");
|
obj._comm1selected = PFD.HighlightElement.new(obj.pageName, svg, "Comm1Selected", "Comm1");
|
||||||
obj._comm2selected = PFD.HighlightElement.new(obj.pageName, svg, "Comm2Selected", "Comm2");
|
obj._comm2selected = PFD.HighlightElement.new(obj.pageName, svg, "Comm2Selected", "Comm2");
|
||||||
|
|
||||||
|
@ -222,6 +231,33 @@ var Surround =
|
||||||
|
|
||||||
# Update Header data with FMS or ADC data.
|
# Update Header data with FMS or ADC data.
|
||||||
updateHeaderData : func(data) {
|
updateHeaderData : func(data) {
|
||||||
|
|
||||||
|
if (me.pfd) {
|
||||||
|
# From, To, leg distance and leg bearing headers
|
||||||
|
if (data["FMSLegID"]) {
|
||||||
|
if (data["FMSLegID"] == "") {
|
||||||
|
# No Leg, so hide the headers
|
||||||
|
me.setTextElement("HeaderTo", "");
|
||||||
|
me.setTextElement("HeaderFrom", "");
|
||||||
|
me._dto.setVisible(0);
|
||||||
|
me._leg.setVisible(0);
|
||||||
|
} else {
|
||||||
|
me.setTextElement("HeaderTo", data["FMSLegID"]);
|
||||||
|
me._leg.setVisible(1);
|
||||||
|
|
||||||
|
if (data["FMSMode"] == "dto") {
|
||||||
|
me.setTextElement("HeaderFrom", "");
|
||||||
|
me._dto.setVisible(1);
|
||||||
|
} else {
|
||||||
|
me._dto.setVisible(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data["FMSLegDesiredTrack"]) me.setTextElement("LegBRG", sprintf("%i°", data["FMSLegDesiredTrack"]));
|
||||||
|
if (data["FMSLegDistanceNM"]) me.setTextElement("LegDistance", sprintf("%.1fnm", data["FMSLegDistanceNM"]));
|
||||||
|
} else {
|
||||||
|
# MFD - 4 configurable Headers
|
||||||
var headers = ["Header1", "Header2", "Header3", "Header4"];
|
var headers = ["Header1", "Header2", "Header3", "Header4"];
|
||||||
foreach (var header; headers) {
|
foreach (var header; headers) {
|
||||||
|
|
||||||
|
@ -253,6 +289,7 @@ var Surround =
|
||||||
me.setTextElement(header ~ "Value", value);
|
me.setTextElement(header ~ "Value", value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getCurrentPage : func()
|
getCurrentPage : func()
|
||||||
|
|
|
@ -58,7 +58,7 @@ var PFDDisplay =
|
||||||
{'font-mapper': fontmapper});
|
{'font-mapper': fontmapper});
|
||||||
|
|
||||||
canvas.parsesvg(obj._svg,
|
canvas.parsesvg(obj._svg,
|
||||||
'/Aircraft/Instruments-3d/FG1000/MFDPages/Surround.svg',
|
'/Aircraft/Instruments-3d/FG1000/MFDPages/SurroundPFD.svg',
|
||||||
{'font-mapper': fontmapper});
|
{'font-mapper': fontmapper});
|
||||||
|
|
||||||
obj._MFDDevice = canvas.PFD_Device.new(obj._svg, 12, "SoftKey", myCanvas, "PFD");
|
obj._MFDDevice = canvas.PFD_Device.new(obj._svg, 12, "SoftKey", myCanvas, "PFD");
|
||||||
|
@ -70,7 +70,7 @@ var PFDDisplay =
|
||||||
|
|
||||||
# Controller for the header and display on the bottom left which allows selection
|
# Controller for the header and display on the bottom left which allows selection
|
||||||
# of page groups and individual pages using the FMS controller.
|
# of page groups and individual pages using the FMS controller.
|
||||||
obj.Surround = fg1000.Surround.new(obj, myCanvas, obj._MFDDevice, obj._svg);
|
obj.Surround = fg1000.Surround.new(obj, myCanvas, obj._MFDDevice, obj._svg, 1);
|
||||||
obj.SurroundController = obj.Surround.getController();
|
obj.SurroundController = obj.Surround.getController();
|
||||||
|
|
||||||
# Engine Information System. A special case as it's always displayed on the MFD.
|
# Engine Information System. A special case as it's always displayed on the MFD.
|
||||||
|
|
Loading…
Reference in a new issue