1
0
Fork 0

GPS MONITOR

This commit is contained in:
legoboyvdlp R 2021-01-28 13:59:08 +00:00
parent a32e79b7dc
commit c18c35abc5
4 changed files with 100 additions and 34 deletions

View file

@ -382,6 +382,17 @@ var canvas_MCDU_base = {
var sign2 = degrees2 >= 0 ? "E" : "W";
return sprintf("%d%.1f%s/%07s%s",abs(degrees),minutes,sign,abs(degrees2) ~ minutes2,sign2);
},
getLatLogFormatted2: func(rootpropname) {
var dms = getprop(rootpropname ~ "latitude-deg");
var degrees = int(dms);
var minutes = sprintf("%.1f",abs((dms - degrees) * 60));
var sign = degrees >= 0 ? "N" : "S";
var dms2 = getprop(rootpropname ~ "longitude-deg");
var degrees2 = int(dms2);
var minutes2 = sprintf("%.1f",abs((dms2 - degrees2) * 60));
var sign2 = degrees2 >= 0 ? "E" : "W";
return sprintf("%d %.1f%s/%03s %.1f%s",abs(degrees),minutes,sign,abs(degrees2),minutes2,sign2);
},
getIRSStatus: func(a) {
var irsstatus = "INVAL";
if (systems.ADIRS.ADIRunits[a].operative) {
@ -2471,8 +2482,68 @@ var canvas_MCDU_base = {
me["Simple_R3S"].setText("");
me["Simple_R4S"].setText("");
}
} else if (page == "GPSMON") {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
me.standardFontSize();
me.defaultPageNumbers();
me.showLeft(1, 1, 1, 1, 1, 1);
me.showLeftS(1, 1, 1, 1, 1, 1);
me.showLeftArrow(-1, -1, -1, -1, -1, -1);
me.showCenter(-1, 1, 1, -1, 1, 1);
me.showCenterS(-1, 1, 1, -1, 1, 1);
me.showRight(-1, 1, 1, -1, 1, 1);
me.showRightS(-1, 1, 1, -1, 1, 1);
me.showRightArrow(-1, -1, -1, -1, -1, -1);
me["arrowsDepArr"].hide();
me["PERFAPPR"].hide();
me["PERFGA"].hide();
me["Simple_L0S"].hide();
me["Simple_Title"].show();
me.colorLeft("grn", "grn", "grn", "grn", "grn", "grn");
me.colorLeftS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorCenter("grn", "grn", "grn", "grn", "grn", "grn");
me.colorCenterS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorRight("grn", "grn", "grn", "grn", "grn", "grn");
me.colorRightS("wht", "wht", "wht", "wht", "wht", "wht");
me["Simple_Title"].setText("GPS MONITOR");
me["Simple_L1S"].setText("GPS1 POSITION");
me["Simple_L2S"].setText("TTRK");
me["Simple_L3S"].setText("MERIT");
me["Simple_L3"].setText(sprintf("%3.0d",((rand() * 50) - 25) + 50) ~ "M");
me["Simple_L4S"].setText("GPS2 POSITION");
me["Simple_L5S"].setText("TTRK");
me["Simple_L6S"].setText("MERIT");
me["Simple_L6"].setText(sprintf("%3.0d",((rand() * 50) - 25) + 50) ~ "M");
me["Simple_C2S"].setText("UTC");
me["Simple_C3S"].setText("GPS ALT");
me["Simple_C5S"].setText("UTC");
me["Simple_C6S"].setText("GPS ALT");
me["Simple_R2S"].setText("GS");
me["Simple_R3S"].setText("MODE/SAT");
me["Simple_R3"].setText("NAV/" ~ sprintf("%s",int((rand() * 2) - 1) + 6) ~ " ");
me["Simple_R5S"].setText("GS");
me["Simple_R6S"].setText("MODE/SAT");
me["Simple_R6"].setText("NAV/" ~ sprintf("%s",int((rand() * 2) - 1) + 6) ~ " ");
pageSwitch[i].setBoolValue(1);
}
me["Simple_L1"].setText(me.getLatLogFormatted2("/position/"));
me["Simple_L2"].setText(sprintf("%-5.1f",pts.Instrumentation.GPS.trackMag.getValue() + magvar()));
me["Simple_L4"].setText(me.getLatLogFormatted2("/position/"));
me["Simple_L5"].setText(sprintf("%-5.1f",pts.Instrumentation.GPS.trackMag.getValue() + magvar()));
me["Simple_C2"].setText(pts.Sim.Time.gmtString.getValue());
me["Simple_C5"].setText(pts.Sim.Time.gmtString.getValue());
me["Simple_C3"].setText(sprintf("%5.0f",pts.Instrumentation.GPS.altitude.getValue()));
me["Simple_C6"].setText(sprintf("%5.0f",pts.Instrumentation.GPS.altitude.getValue()));
me["Simple_R2"].setText(sprintf("%3.0f",pts.Instrumentation.GPS.gs.getValue()));
me["Simple_R5"].setText(sprintf("%3.0f",pts.Instrumentation.GPS.gs.getValue()));
} else if (page == "RADNAV") {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHide();

View file

@ -173,6 +173,13 @@ var Instrumentation = {
pnlModeNum: [props.globals.initNode("/instrumentation/efis[0]/mfd/pnl_mode-num", 2, "INT"), props.globals.initNode("/instrumentation/efis[1]/mfd/pnl_mode-num", 2, "INT")],
},
},
GPS: {
altitude: props.globals.getNode("/instrumentation/gps/indicated-altitude-ft"),
latitude: props.globals.getNode("/instrumentation/gps/indicated-latitude-deg"),
longitude: props.globals.getNode("/instrumentation/gps/indicated-longitude-deg"),
trackMag: props.globals.getNode("/instrumentation/gps/indicated-track-magnetic-deg"),
gs: props.globals.getNode("/instrumentation/gps/indicated-ground-speed-kt"),
},
MKVII: {
Inputs: {
Discretes: {
@ -245,6 +252,7 @@ var Sim = {
Time: {
deltaRealtimeSec: props.globals.getNode("/sim/time/delta-realtime-sec"),
elapsedSec: props.globals.getNode("/sim/time/elapsed-sec"),
gmtString: props.globals.getNode("/sim/time/gmt-string"),
UTC: {
day: props.globals.getNode("/sim/time/utc/day"),
month: props.globals.getNode("/sim/time/utc/month"),

View file

@ -5,19 +5,18 @@
var dataInput = func(key, i) {
if (key == "L1") {
setprop("MCDU[" ~ i ~ "]/page", "POSMON");
}
if (key == "L2") {
} elsif (key == "L2") {
setprop("MCDU[" ~ i ~ "]/page", "IRSMON");
}
if (key == "L5") {
} elsif (key == "L3") {
setprop("MCDU[" ~ i ~ "]/page", "GPSMON");
} elsif (key == "L5") {
if (canvas_mcdu.myClosestAirport[i] != nil) {
canvas_mcdu.myClosestAirport[i].del();
}
canvas_mcdu.myClosestAirport[i] = nil;
canvas_mcdu.myClosestAirport[i] = closestAirportPage.new(i);
setprop("MCDU[" ~ i ~ "]/page", "CLOSESTAIRPORT");
}
if (key == "R5") {
} elsif (key == "R5") {
setprop("MCDU[" ~ i ~ "]/page", "PRINTFUNC");
}
}
@ -25,23 +24,17 @@ var dataInput = func(key, i) {
var printInput = func(key, i) {
if (key == "L1") {
setprop("FMGC/print/mcdu/page1/L1auto", 1);
}
if (key == "L2") {
} elsif (key == "L2") {
setprop("FMGC/print/mcdu/page1/L2auto", 1);
}
if (key == "L3") {
} elsif (key == "L3") {
setprop("FMGC/print/mcdu/page1/L3auto", 1);
}
if (key == "L5") {
} elsif (key == "L5") {
setprop("MCDU[" ~ i ~ "]/page", "DATA");
}
if (key == "R1") {
} elsif (key == "R1") {
setprop("FMGC/print/mcdu/page1/R1req", 1);
}
if (key == "R2") {
} elsif (key == "R2") {
setprop("FMGC/print/mcdu/page1/R2req", 1);
}
if (key == "R3") {
} elsif (key == "R3") {
setprop("FMGC/print/mcdu/page1/R3req", 1);
}
}
@ -49,29 +42,21 @@ var printInput = func(key, i) {
var printInput2 = func(key, i) {
if (key == "L1") {
setprop("FMGC/print/mcdu/page2/L1auto", 1);
}
if (key == "L2") {
} elsif (key == "L2") {
setprop("FMGC/print/mcdu/page2/L2auto", 1);
}
if (key == "L3") {
} elsif (key == "L3") {
setprop("FMGC/print/mcdu/page2/L3auto", 1);
}
if (key == "L4") {
} elsif (key == "L4") {
setprop("FMGC/print/mcdu/page2/L4auto", 1);
}
if (key == "L6") {
} elsif (key == "L6") {
setprop("MCDU[" ~ i ~ "]/page", "DATA");
}
if (key == "R1") {
} elsif (key == "R1") {
setprop("FMGC/print/mcdu/page2/R1req", 1);
}
if (key == "R2") {
} elsif (key == "R2") {
setprop("FMGC/print/mcdu/page2/R2req", 1);
}
if (key == "R3") {
} elsif (key == "R3") {
setprop("FMGC/print/mcdu/page2/R3req", 1);
}
if (key == "R4") {
} elsif (key == "R4") {
setprop("FMGC/print/mcdu/page2/R4req", 1);
}
}

View file

@ -534,6 +534,8 @@ var lskbutton = func(btn, i) {
statusInput("L3",i);
} else if (page == "RADNAV") {
radnavInput("L3",i);
} else if (page == "DATA") {
dataInput("L3",i);
} else if (page == "PRINTFUNC") {
printInput("L3",i);
} else if (page == "PRINTFUNC2") {