@@ -381,10 +286,12 @@
+
-
+
+
\ No newline at end of file
diff --git a/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/MFD/CJ4_MFD.js b/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/MFD/CJ4_MFD.js
index 9d17094280..92dbccd2a1 100644
--- a/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/MFD/CJ4_MFD.js
+++ b/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/MFD/CJ4_MFD.js
@@ -6,11 +6,14 @@ class CJ4_MFD extends BaseAirliners {
this.showWeather = false;
this.showFms = false;
this.showGwx = false;
+ this.showChecklist = false;
+ this.showPassengerBrief = false;
this.mapDisplayMode = Jet_NDCompass_Display.ROSE;
this.mapNavigationMode = Jet_NDCompass_Navigation.NAV;
this.mapNavigationSource = 0;
this.systemPage1 = CJ4_SystemPage.ENGINES;
this.systemPage2 = CJ4_SystemPage.ELECTRICS;
+ this.showSystemOverlay = 0;
this.modeChangeTimer = -1;
this.initDuration = 11000;
}
@@ -21,17 +24,23 @@ class CJ4_MFD extends BaseAirliners {
this.radioNav.init(NavMode.TWO_SLOTS);
this.systems1 = new CJ4_SystemContainer("System1", "SystemInfos1");
this.systems2 = new CJ4_SystemContainer("System2", "SystemInfos2");
+ this.systemOverlay = new CJ4_SystemOverlayContainer("SystemOverlay", "SystemOverlay");
this.map = new CJ4_MapContainer("Map", "Map");
this.mapOverlay = new CJ4_MapOverlayContainer("MapInfos", "MapOverlay");
this.fms = new CJ4_FMSContainer("Fms", "FMSInfos");
+ this.checklist = new CJ4_Checklist_Container("Checklist", "Checklist");
+ this.passengerBrief = new CJ4_PassengerBrief_Container("PassengerBrief", "PassengerBrief");
this.navBar = new CJ4_NavBarContainer("Nav", "NavBar");
this.popup = new CJ4_PopupMenuContainer("Menu", "PopupMenu");
this.addIndependentElementContainer(this.systems1);
this.addIndependentElementContainer(this.systems2);
+ this.addIndependentElementContainer(this.systemOverlay);
this.addIndependentElementContainer(this.map);
this.addIndependentElementContainer(this.mapOverlay);
this.addIndependentElementContainer(this.navBar);
this.addIndependentElementContainer(this.fms);
+ this.addIndependentElementContainer(this.checklist);
+ this.addIndependentElementContainer(this.passengerBrief);
this.addIndependentElementContainer(this.popup);
this.modeChangeMask = this.getChildById("ModeChangeMask");
this.maxUpdateBudget = 12;
@@ -80,14 +89,42 @@ class CJ4_MFD extends BaseAirliners {
this.mapOverlay.showGwx(false);
}
}
+
+ if (this.showSystemOverlay == 1 || this.showSystemOverlay == 2) {
+ this.systemOverlay.show(true, this.showSystemOverlay);
+ }
+ else{
+ this.systemOverlay.show(false);
+ }
+
if (this.showFms) {
this.systems1.minimize(true);
this.systems2.show(CJ4_SystemPage.NONE);
this.fms.show(true);
+ this.checklist.show(false);
+ this.mapOverlay.setExtended(false);
+ this.passengerBrief.show(false);
+ }
+ else if (this.showChecklist) {
+ this.systems1.minimize(true);
+ this.fms.show(false);
+ this.checklist.show(true);
+ this.mapOverlay.setExtended(false);
+ this.passengerBrief.show(false);
+ }
+ else if (this.showPassengerBrief) {
+ this.systems1.minimize(true);
+ this.fms.show(false);
+ this.checklist.show(false);
+ this.mapOverlay.setExtended(false);
+ this.passengerBrief.show(true);
}
else {
this.fms.show(false);
+ this.checklist.show(false);
+ this.passengerBrief.show(false);
this.systems1.show(this.systemPage1);
+ this.mapOverlay.setExtended(false);
if (this.systemPage1 == CJ4_SystemPage.ENGINES) {
if (this.isExtended && !this.systems2.hasAnnunciations()) {
this.map.setExtended(true);
@@ -147,7 +184,10 @@ class CJ4_MFD extends BaseAirliners {
this.map.toggleSymbol(CJ4_MapSymbol.TRAFFIC);
break;
case "Lwr_Push_SYS":
- this.isExtended = !this.isExtended;
+ this.showSystemOverlay++;
+ if(this.showSystemOverlay == 3){
+ this.showSystemOverlay = 0;
+ }
break;
case "Lwr_Push_ENG":
this.systemPage1 = (this.systemPage1 == CJ4_SystemPage.ENGINES) ? CJ4_SystemPage.ANNUNCIATIONS : CJ4_SystemPage.ENGINES;
@@ -155,10 +195,40 @@ class CJ4_MFD extends BaseAirliners {
case "Lwr_Push_UPR_MENU":
this.fillDictionary(this.popup.dictionary);
this.popup.setMode(CJ4_PopupMenu.UPPER);
+ if(this.popup.mode == CJ4_PopupMenu.UPPER){
+ this.checklist.otherMenusOpen = true;
+ this.passengerBrief.otherMenusOpen = true;
+ }
+ else{
+ this.checklist.otherMenusOpen = false;
+ this.passengerBrief.otherMenusOpen = false;
+ }
break;
case "Lwr_Push_LWR_MENU":
this.fillDictionary(this.popup.dictionary);
this.popup.setMode(CJ4_PopupMenu.LOWER);
+ if(this.popup.mode == CJ4_PopupMenu.LOWER){
+ this.checklist.otherMenusOpen = true;
+ this.passengerBrief.otherMenusOpen = true;
+ }
+ else{
+ this.checklist.otherMenusOpen = false;
+ this.passengerBrief.otherMenusOpen = false;
+ }
+ break;
+ case "Lwr_Push_CKLST_1":
+ this.showFms = false;
+ this.showPassengerBrief = false;
+ this.showChecklist = !this.showChecklist;
+ break;
+ case "Lwr_Push_PASSBRIEF_1":
+ this.showChecklist = false;
+ this.showFms = false;
+ this.showPassengerBrief = !this.showPassengerBrief;
+ break;
+ case "Lwr_Push_ESC":
+ this.checklist.otherMenusOpen = false;
+ this.passengerBrief.otherMenusOpen = false;
break;
}
}
@@ -229,14 +299,32 @@ class CJ4_MFD extends BaseAirliners {
if (sysMode == "OFF") {
this.isExtended = true;
this.showFms = false;
+ this.showChecklist = false;
+ this.showPassengerBrief = false;
}
else if (sysMode == "FMS TEXT") {
this.isExtended = false;
this.showFms = true;
+ this.showChecklist = false;
+ this.showPassengerBrief = false;
+ }
+ else if (sysMode == "SYSTEMS 1/2") {
+ this.isExtended = false;
+ this.showFms = false;
+ this.showChecklist = false;
+ this.showPassengerBrief = false;
}
- else if (sysMode == "SYSTEMS") {
+ else if (sysMode == "CHECKLIST") {
this.isExtended = false;
this.showFms = false;
+ this.showChecklist = true;
+ this.showPassengerBrief = false;
+ }
+ else if (sysMode == "PASS BRIEF") {
+ this.isExtended = false;
+ this.showFms = false;
+ this.showChecklist = false;
+ this.showPassengerBrief = true;
}
if (modeChanged)
this.onModeChanged();
@@ -264,22 +352,20 @@ class CJ4_MFD extends BaseAirliners {
_dict.set(CJ4_PopupMenu_Key.SYS_SRC, "OFF");
else if (this.showFms)
_dict.set(CJ4_PopupMenu_Key.SYS_SRC, "FMS TEXT");
+ else if (this.showChecklist)
+ _dict.set(CJ4_PopupMenu_Key.SYS_SRC, "CHECKLIST");
+ else if (this.showPassengerBrief)
+ _dict.set(CJ4_PopupMenu_Key.SYS_SRC, "PASS BRIEF");
else
- _dict.set(CJ4_PopupMenu_Key.SYS_SRC, "SYSTEMS");
- _dict.changed = false;
+ _dict.set(CJ4_PopupMenu_Key.SYS_SRC, "SYSTEMS 1/2");
}
}
class CJ4_FMSContainer extends NavSystemElementContainer {
constructor(_name, _root) {
super(_name, _root, null);
this.isVisible = undefined;
- this._k = 0;
- }
- static secondsTohhmm(seconds) {
- let h = Math.floor(seconds / 3600);
- seconds -= h * 3600;
- let m = Math.ceil(seconds / 60);
- return h.toFixed(0) + ":" + m.toFixed(0).padStart(2, "0");
+ this.previousWaypoint = undefined;
+ this._flightPlanUpdateCounter = 0;
}
init() {
super.init();
@@ -288,10 +374,11 @@ class CJ4_FMSContainer extends NavSystemElementContainer {
console.log("Root component expected!");
}
else {
- let waypointContainers = this.root.querySelectorAll(".cj4x-navigation-data-flightplan-leg");
+ let waypointContainers = this.root.querySelectorAll(".cj4x-navigation-data-row");
this._previousWaypointContainer = waypointContainers[0];
this._activeWaypointContainer = waypointContainers[1];
this._nextWaypointContainer = waypointContainers[2];
+ this._destinationWaypointContainer = waypointContainers[3];
}
}
show(_value) {
@@ -302,147 +389,1082 @@ class CJ4_FMSContainer extends NavSystemElementContainer {
}
onUpdate(_deltaTime) {
super.onUpdate(_deltaTime);
- if (!this._previousWaypointContainer || !this._activeWaypointContainer || !this._nextWaypointContainer) {
+ if (!this._previousWaypointContainer || !this._activeWaypointContainer || !this._nextWaypointContainer || !this._destinationWaypointContainer) {
if (!this.isInitialized) {
this.init();
}
return;
}
- let flightPlanManager = this.gps.currFlightPlanManager;
- if (flightPlanManager) {
- this._k++;
- if (this._k > 60) {
- flightPlanManager.updateFlightPlan();
- this._k = 0;
- }
- let origin = flightPlanManager.getOrigin();
- let destination = flightPlanManager.getDestination();
- this.root.querySelector(".cj4x-navigation-data-flightplan-name")
- .textContent = (origin ? origin.ident : "---") + " to " + (destination ? destination.ident : "---");
- if (destination) {
- let eteValue = "---";
- if (isFinite(destination.cumulativeEstimatedTimeEnRouteFP)) {
- eteValue = CJ4_FMSContainer.secondsTohhmm(destination.cumulativeEstimatedTimeEnRouteFP);
+
+ if (this.isVisible) {
+ let flightPlanManager = this.gps.currFlightPlanManager;
+ if (flightPlanManager) {
+ this._flightPlanUpdateCounter++;
+ if (this._flightPlanUpdateCounter > 120) {
+ flightPlanManager.updateFlightPlan();
+ this._flightPlanUpdateCounter = 0;
}
- this.root.querySelector(".cj4x-navigation-data-page-foot")
- .querySelector(".cj4x-navigation-data-flight-plan-ete-dest")
- .querySelector(".cj4x-navigation-data-flight-plan-value")
- .textContent = eteValue;
- let distTogoValue = "0";
- if (isFinite(destination.cumulativeDistanceInFP)) {
- distTogoValue = destination.cumulativeDistanceInFP.toFixed(0) + " NM";
+
+ // Grab plane information
+ let lat = SimVar.GetSimVarValue("PLANE LATITUDE", "degree latitude");
+ let long = SimVar.GetSimVarValue("PLANE LONGITUDE", "degree longitude");
+ let aircraftPosition = new LatLong(lat, long);
+ let groundSpeed = SimVar.GetSimVarValue("GPS GROUND SPEED", "knots");
+ const FPWaypoints = flightPlanManager._waypoints[flightPlanManager._currentFlightPlanIndex];
+ const UTCTime = SimVar.GetSimVarValue("E:ZULU TIME", "seconds");
+
+ if (FPWaypoints) {
+ // Grab waypoints
+ let previousWaypointIndex = flightPlanManager.getActiveWaypointIndex() - 1;
+ let previousWaypoint = flightPlanManager.getWaypoint(previousWaypointIndex);
+ let activeIndex = flightPlanManager.getActiveWaypointIndex();
+ let activeWaypoint = FPWaypoints[activeIndex];
+ let nextWaypoint = flightPlanManager.getWaypoint(activeIndex + 1);
+ let destination = flightPlanManager.getDestination();
+
+ // Set ICAOs
+ this._previousWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-ident")
+ .textContent = previousWaypoint ? previousWaypoint.ident : "----";
+ this._activeWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-ident")
+ .textContent = activeWaypoint && destination && activeWaypoint.ident != destination.ident ? activeWaypoint.ident : "----";
+ this._nextWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-ident")
+ .textContent = nextWaypoint && destination && nextWaypoint.ident != destination.ident && nextWaypoint.ident != "USER" ? nextWaypoint.ident : "----";
+ this._destinationWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-ident")
+ .textContent = destination ? destination.ident : "----";
+
+ // Set distances to go
+ const previousWaypointDistance = previousWaypoint ? Avionics.Utils.computeDistance(aircraftPosition, previousWaypoint.infos.coordinates).toFixed(1) : -1;
+ const activeWaypointDistance = activeWaypoint && destination && activeWaypoint.ident != destination.ident ? Avionics.Utils.computeDistance(aircraftPosition, activeWaypoint.infos.coordinates).toFixed(1) : -1;
+ const nextWaypointDistance = nextWaypoint && destination && nextWaypoint.ident != destination.ident && activeWaypoint ? (new Number(activeWaypointDistance) + new Number(Avionics.Utils.computeDistance(activeWaypoint.infos.coordinates, nextWaypoint.infos.coordinates))).toFixed(1) : -1;
+ let destinationDistance = 0;
+ if(destination && activeWaypoint){
+ destinationDistance += new Number(Avionics.Utils.computeDistance(aircraftPosition, activeWaypoint.infos.coordinates));
+ for(let w = activeIndex; w < FPWaypoints.length - 1; w++){
+ destinationDistance += new Number(Avionics.Utils.computeDistance(FPWaypoints[w].infos.coordinates, FPWaypoints[w + 1].infos.coordinates));
+ }
+ destinationDistance = destinationDistance.toFixed(1);
+ }
+
+
+ this._previousWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-distance")
+ .textContent = previousWaypointDistance != -1 ? previousWaypointDistance + "NM" : "---NM";
+ this._activeWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-distance")
+ .textContent = activeWaypointDistance != -1 ? activeWaypointDistance + "NM" : "---NM";
+ this._nextWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-distance")
+ .textContent = nextWaypointDistance != -1 ? nextWaypointDistance + "NM" : "---NM";
+ this._destinationWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-distance")
+ .textContent = destinationDistance != 0 ? destinationDistance + "NM" : "---NM";
+
+ // Set ETE
+ let activeWaypointETEValue = "-:--";
+ if(groundSpeed >= 50 && activeWaypointDistance > 0){
+ activeWaypointETEValue = new Date(this.calcETEseconds(activeWaypointDistance, groundSpeed) * 1000).toISOString().substr(11, 5);
+ }
+
+ let nextWaypointETEValue = "-:--";
+ if(groundSpeed >= 50 && nextWaypointDistance > 0){
+ nextWaypointETEValue = new Date(this.calcETEseconds(nextWaypointDistance, groundSpeed) * 1000).toISOString().substr(11, 5);
+ }
+
+ let destinationWaypointETEValue = "-:--";
+ if(groundSpeed >= 50 && destinationDistance > 0){
+ destinationWaypointETEValue = new Date(this.calcETEseconds(destinationDistance, groundSpeed) * 1000).toISOString().substr(11, 5);
+ }
+
+ this._activeWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-ete")
+ .textContent = activeWaypointETEValue;
+
+ this._nextWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-ete")
+ .textContent = nextWaypointETEValue;
+
+ this._destinationWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-ete")
+ .textContent = destinationWaypointETEValue;
+
+ // Set ETA
+ let previousWaypointETAValue;
+ if (previousWaypoint && previousWaypoint.ident != flightPlanManager.getOrigin().ident) {
+ if(this.previousWaypoint == undefined || this.previousWaypoint.ident != previousWaypoint.ident){
+ const seconds = Number.parseInt(UTCTime);
+ previousWaypointETAValue = Utils.SecondsToDisplayTime(seconds, true, false, false);
+ this.previousWaypoint = previousWaypoint;
+
+ this._previousWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-eta")
+ .textContent = previousWaypointETAValue;
+ }
+ }
+ else{
+ this._previousWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-eta")
+ .textContent = "--:--";
+ }
+
+
+ let activeWaypointETAValue = "--:--";
+ if(groundSpeed >= 50 && activeWaypointDistance > 0){
+ const seconds = Number.parseInt(UTCTime) + (this.calcETEseconds(activeWaypointDistance, groundSpeed));
+ const time = Utils.SecondsToDisplayTime(seconds, true, false, false);
+ activeWaypointETAValue = time;
+ }
+
+ let nextWaypointETAValue = "--:--";
+ if(groundSpeed >= 50 && nextWaypointDistance > 0){
+ const seconds = Number.parseInt(UTCTime) + (this.calcETEseconds(nextWaypointDistance, groundSpeed));
+ const time = Utils.SecondsToDisplayTime(seconds, true, false, false);
+ nextWaypointETAValue = time;
+ }
+
+ let destinationWaypointETAValue = "--:--";
+ if(groundSpeed >= 50 && destinationDistance > 0){
+ const seconds = Number.parseInt(UTCTime) + (this.calcETEseconds(destinationDistance, groundSpeed));
+ const time = Utils.SecondsToDisplayTime(seconds, true, false, false);
+ destinationWaypointETAValue = time;
+ }
+
+ this._activeWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-eta")
+ .textContent = activeWaypointETAValue;
+
+ this._nextWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-eta")
+ .textContent = nextWaypointETAValue;
+
+ this._destinationWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-eta")
+ .textContent = destinationWaypointETAValue;
+
+
+ // Set expected fuel and gross weight
+ if(groundSpeed >= 50){
+ const fuelFlow = (SimVar.GetSimVarValue("CJ4 FUEL FLOW:1", "Pounds per hour") + SimVar.GetSimVarValue("CJ4 FUEL FLOW:2", "Pounds per hour")) / 2;
+ const expectedFuelUsage = (fuelFlow * (this.calcETEseconds(destinationDistance, groundSpeed) / 3600)).toFixed(0);
+ const currentFuel = (SimVar.GetSimVarValue("FUEL WEIGHT PER GALLON", "pounds") * SimVar.GetSimVarValue("FUEL TOTAL QUANTITY", "gallons")).toFixed(0);
+ const expectedFuelAtDestination = (currentFuel - expectedFuelUsage).toFixed(0) < 0 ? 0 : (currentFuel - expectedFuelUsage).toFixed(0);
+ const grossWeight = SimVar.GetSimVarValue("MAX GROSS WEIGHT", "pounds");
+ // const oilQuantity = SimVar.GetSimVarValue("OIL AMOUNT", "pounds")
+ const expectedGrossWeight = expectedFuelAtDestination == 0 ? (grossWeight / 1000).toFixed(2) : ((grossWeight - expectedFuelUsage) / 1000).toFixed(2);
+
+ this._destinationWaypointContainer
+ .querySelector(".cj4x-navigation-data-waypoint-expected-fuel")
+ .textContent = expectedFuelAtDestination + " LB " + expectedGrossWeight + " GW";
+
+ }
+
+ if(activeWaypoint && destination){
+ if(destination.ident == activeWaypoint.ident){
+ this._destinationWaypointContainer
+ .setAttribute("style", "color: magenta");
+ this._activeWaypointContainer
+ .setAttribute("style", "color: white");
+ }
+ else{
+ this._destinationWaypointContainer
+ .setAttribute("style", "color: white");
+ this._activeWaypointContainer
+ .setAttribute("style", "color: magenta");
+ }
+ }
}
- this.root.querySelector(".cj4x-navigation-data-page-foot")
- .querySelector(".cj4x-navigation-data-flight-plan-dist-togo")
- .querySelector(".cj4x-navigation-data-flight-plan-value")
- .textContent = distTogoValue;
}
- let previousWaypointIndex = flightPlanManager.getActiveWaypointIndex() - 1;
- let previousWaypoint = flightPlanManager.getWaypoint(previousWaypointIndex);
- if (previousWaypoint) {
- this._previousWaypointContainer.style.display = "block";
- this._previousWaypointContainer.querySelector(".cj4x-navigation-data-waypoint-ident").textContent = previousWaypoint.ident;
- this._previousWaypointContainer.querySelector(".cj4x-navigation-data-waypoint-coordinates").textContent = previousWaypoint.infos.coordinates.toDegreeString();
- let ataValue = "---";
- if (isFinite(previousWaypoint.estimatedTimeEnRouteFP)) {
- ataValue = CJ4_FMSContainer.secondsTohhmm(previousWaypoint.estimatedTimeOfArrivalFP);
- }
- this._previousWaypointContainer
- .querySelector(".cj4x-navigation-data-waypoint-ata")
- .querySelector(".cj4x-navigation-data-waypoint-value")
- .textContent = ataValue;
- this._previousWaypointContainer
- .querySelector(".cj4x-navigation-data-waypoint-dist")
- .querySelector(".cj4x-navigation-data-waypoint-value")
- .textContent = previousWaypoint.distanceInFP.toFixed(1) + " NM";
+ }
+ }
+ calcETEseconds(distance, currentGroundSpeed) {
+ return (distance / currentGroundSpeed) * 3600;
+ }
+}
+class CJ4_SystemOverlayContainer extends NavSystemElementContainer {
+ constructor(_name, _root) {
+ super(_name, _root, null);
+ this.isVisible = undefined;
+ this.currentPage = 1;
+ }
+ init() {
+ super.init();
+ this.root = this.gps.getChildById(this.htmlElemId);
+ if (!this.root) {
+ console.log("Root component expected!");
+ }
+ else{
+ this.showPage1();
+ }
+ }
+ show(_value, _pageNumber) {
+ if (this.isVisible != _value) {
+ this.isVisible = _value;
+ this.root.setAttribute("visible", (_value) ? "true" : "false");
+ }
+ if(this.isVisible){
+ if(_pageNumber == 1 && this.currentPage != _pageNumber){
+ this.showPage1();
+ this.currentPage = 1;
}
- else {
- this._previousWaypointContainer.style.display = "none";
+ else if(_pageNumber == 2 && this.currentPage != _pageNumber){
+ this.showPage2();
+ this.currentPage = 2;
}
- let activeWaypoint = flightPlanManager.getActiveWaypoint(false, true);
- if (activeWaypoint) {
- this._activeWaypointContainer.style.display = "block";
- this._activeWaypointContainer.querySelector(".cj4x-navigation-data-waypoint-ident").textContent = activeWaypoint.ident;
- this._activeWaypointContainer.querySelector(".cj4x-navigation-data-waypoint-coordinates").textContent = activeWaypoint.infos.coordinates.toDegreeString();
- let etaValue = "---";
- if (isFinite(activeWaypoint.estimatedTimeEnRouteFP)) {
- etaValue = CJ4_FMSContainer.secondsTohhmm(activeWaypoint.estimatedTimeOfArrivalFP);
- }
- let legtValue = "---";
- if (isFinite(activeWaypoint.estimatedTimeEnRouteFP)) {
- legtValue = CJ4_FMSContainer.secondsTohhmm(activeWaypoint.estimatedTimeEnRouteFP);
- }
- this._activeWaypointContainer
- .querySelector(".cj4x-navigation-data-waypoint-eta")
- .querySelector(".cj4x-navigation-data-waypoint-value")
- .textContent = etaValue;
- this._activeWaypointContainer
- .querySelector(".cj4x-navigation-data-waypoint-legt")
- .querySelector(".cj4x-navigation-data-waypoint-value")
- .textContent = legtValue;
- this._activeWaypointContainer
- .querySelector(".cj4x-navigation-data-waypoint-dist")
- .querySelector(".cj4x-navigation-data-waypoint-value")
- .textContent = activeWaypoint.distanceInFP.toFixed(1) + " NM";
- this._activeWaypointContainer
- .querySelector(".cj4x-navigation-data-waypoint-crs")
- .querySelector(".cj4x-navigation-data-waypoint-value")
- .textContent = activeWaypoint.bearingInFP.toFixed(1) + " °";
+ }
+ }
+ showPage1(){
+ if (!this.root)
+ return;
+
+ Utils.RemoveAllChildren(this.root.querySelector(".SystemBody"));
+ this.root.querySelector(".SystemHeader").textContent = "SYSTEMS 1/2";
+
+ var rootSVG = document.createElementNS(Avionics.SVG.NS, "svg");
+ rootSVG.setAttribute("id", "Standard");
+ rootSVG.setAttribute("viewBox", "0 0 1000 1000");
+ this.root.querySelector(".SystemBody").appendChild(rootSVG);
+ {
+ var dcGroup = document.createElementNS(Avionics.SVG.NS, "g");
+ dcGroup.setAttribute("id", "dcGroup");
+ rootSVG.appendChild(dcGroup);
+ var startPosX = 155;
+ var startPosY = 30;
+ var titleText = document.createElementNS(Avionics.SVG.NS, "text");
+ titleText.textContent = "DC ELEC";
+ titleText.setAttribute("x", startPosX.toString());
+ titleText.setAttribute("y", startPosY.toString());
+ titleText.setAttribute("fill", "white");
+ titleText.setAttribute("font-size", "20");
+ titleText.setAttribute("font-family", "Roboto-Light");
+ titleText.setAttribute("text-anchor", "middle");
+ titleText.setAttribute("alignment-baseline", "central");
+ dcGroup.appendChild(titleText);
+ var lineLeft = document.createElementNS(Avionics.SVG.NS, "line");
+ lineLeft.setAttribute("x1", (startPosX - 110).toString());
+ lineLeft.setAttribute("y1", startPosY.toString());
+ lineLeft.setAttribute("x2", (startPosX - 50).toString());
+ lineLeft.setAttribute("y2", startPosY.toString());
+ lineLeft.setAttribute("stroke", "white");
+ lineLeft.setAttribute("stroke-width", "2");
+ dcGroup.appendChild(lineLeft);
+ var lineLeft = document.createElementNS(Avionics.SVG.NS, "line");
+ lineLeft.setAttribute("x1", (startPosX + 50).toString());
+ lineLeft.setAttribute("y1", startPosY.toString());
+ lineLeft.setAttribute("x2", (startPosX + 110).toString());
+ lineLeft.setAttribute("y2", startPosY.toString());
+ lineLeft.setAttribute("stroke", "white");
+ lineLeft.setAttribute("stroke-width", "2");
+ dcGroup.appendChild(lineLeft);
+ var rectMarginX = 40;
+ var rectWidth = 60;
+ var rectHeight = 30;
+ startPosY += rectHeight;
+ var titleText = document.createElementNS(Avionics.SVG.NS, "text");
+ titleText.textContent = "AMP";
+ titleText.setAttribute("x", startPosX.toString());
+ titleText.setAttribute("y", startPosY.toString());
+ titleText.setAttribute("fill", "white");
+ titleText.setAttribute("font-size", "20");
+ titleText.setAttribute("font-family", "Roboto-Light");
+ titleText.setAttribute("text-anchor", "middle");
+ titleText.setAttribute("alignment-baseline", "central");
+ dcGroup.appendChild(titleText);
+ this.DCAmpValueLeft = document.createElementNS(Avionics.SVG.NS, "text");
+ this.DCAmpValueLeft.textContent = "0";
+ this.DCAmpValueLeft.setAttribute("x", (startPosX - rectMarginX - rectWidth * 0.05).toString());
+ this.DCAmpValueLeft.setAttribute("y", startPosY.toString());
+ this.DCAmpValueLeft.setAttribute("fill", "green");
+ this.DCAmpValueLeft.setAttribute("font-size", "22");
+ this.DCAmpValueLeft.setAttribute("font-family", "Roboto-Bold");
+ this.DCAmpValueLeft.setAttribute("text-anchor", "end");
+ this.DCAmpValueLeft.setAttribute("alignment-baseline", "central");
+ dcGroup.appendChild(this.DCAmpValueLeft);
+ this.DCAmpValueRight = document.createElementNS(Avionics.SVG.NS, "text");
+ this.DCAmpValueRight.textContent = "0";
+ this.DCAmpValueRight.setAttribute("x", (startPosX + rectMarginX + rectWidth * 0.95).toString());
+ this.DCAmpValueRight.setAttribute("y", startPosY.toString());
+ this.DCAmpValueRight.setAttribute("fill", "green");
+ this.DCAmpValueRight.setAttribute("font-size", "22");
+ this.DCAmpValueRight.setAttribute("font-family", "Roboto-Bold");
+ this.DCAmpValueRight.setAttribute("text-anchor", "end");
+ this.DCAmpValueRight.setAttribute("alignment-baseline", "central");
+ dcGroup.appendChild(this.DCAmpValueRight);
+ startPosY += rectHeight;
+ var titleText = document.createElementNS(Avionics.SVG.NS, "text");
+ titleText.textContent = "VOLT";
+ titleText.setAttribute("x", startPosX.toString());
+ titleText.setAttribute("y", startPosY.toString());
+ titleText.setAttribute("fill", "white");
+ titleText.setAttribute("font-size", "20");
+ titleText.setAttribute("font-family", "Roboto-Light");
+ titleText.setAttribute("text-anchor", "middle");
+ titleText.setAttribute("alignment-baseline", "central");
+ dcGroup.appendChild(titleText);
+ this.DCVoltValueLeft = document.createElementNS(Avionics.SVG.NS, "text");
+ this.DCVoltValueLeft.textContent = "0";
+ this.DCVoltValueLeft.setAttribute("x", (startPosX - rectMarginX - rectWidth * 0.05).toString());
+ this.DCVoltValueLeft.setAttribute("y", startPosY.toString());
+ this.DCVoltValueLeft.setAttribute("fill", "green");
+ this.DCVoltValueLeft.setAttribute("font-size", "22");
+ this.DCVoltValueLeft.setAttribute("font-family", "Roboto-Bold");
+ this.DCVoltValueLeft.setAttribute("text-anchor", "end");
+ this.DCVoltValueLeft.setAttribute("alignment-baseline", "central");
+ dcGroup.appendChild(this.DCVoltValueLeft);
+ this.DCVoltValueRight = document.createElementNS(Avionics.SVG.NS, "text");
+ this.DCVoltValueRight.textContent = "0";
+ this.DCVoltValueRight.setAttribute("x", (startPosX + rectMarginX + rectWidth * 0.95).toString());
+ this.DCVoltValueRight.setAttribute("y", startPosY.toString());
+ this.DCVoltValueRight.setAttribute("fill", "green");
+ this.DCVoltValueRight.setAttribute("font-size", "22");
+ this.DCVoltValueRight.setAttribute("font-family", "Roboto-Bold");
+ this.DCVoltValueRight.setAttribute("text-anchor", "end");
+ this.DCVoltValueRight.setAttribute("alignment-baseline", "central");
+ dcGroup.appendChild(this.DCVoltValueRight);
+ }
+ {
+ var batteryGroup = document.createElementNS(Avionics.SVG.NS, "g");
+ batteryGroup.setAttribute("id", "batteryGroup");
+ rootSVG.appendChild(batteryGroup);
+ var startPosX = 400;
+ var startPosY = 30;
+ var titleText = document.createElementNS(Avionics.SVG.NS, "text");
+ titleText.textContent = "BATT";
+ titleText.setAttribute("x", startPosX.toString());
+ titleText.setAttribute("y", startPosY.toString());
+ titleText.setAttribute("fill", "white");
+ titleText.setAttribute("font-size", "20");
+ titleText.setAttribute("font-family", "Roboto-Light");
+ titleText.setAttribute("text-anchor", "middle");
+ titleText.setAttribute("alignment-baseline", "central");
+ batteryGroup.appendChild(titleText);
+ var lineLeft = document.createElementNS(Avionics.SVG.NS, "line");
+ lineLeft.setAttribute("x1", (startPosX - 110).toString());
+ lineLeft.setAttribute("y1", startPosY.toString());
+ lineLeft.setAttribute("x2", (startPosX - 40).toString());
+ lineLeft.setAttribute("y2", startPosY.toString());
+ lineLeft.setAttribute("stroke", "white");
+ lineLeft.setAttribute("stroke-width", "2");
+ batteryGroup.appendChild(lineLeft);
+ var lineLeft = document.createElementNS(Avionics.SVG.NS, "line");
+ lineLeft.setAttribute("x1", (startPosX + 40).toString());
+ lineLeft.setAttribute("y1", startPosY.toString());
+ lineLeft.setAttribute("x2", (startPosX + 110).toString());
+ lineLeft.setAttribute("y2", startPosY.toString());
+ lineLeft.setAttribute("stroke", "white");
+ lineLeft.setAttribute("stroke-width", "2");
+ batteryGroup.appendChild(lineLeft);
+ var rectMarginX = 40;
+ var rectWidth = 60;
+ var rectHeight = 30;
+ startPosX -= 35;
+ startPosY += rectHeight;
+ var titleText = document.createElementNS(Avionics.SVG.NS, "text");
+ titleText.textContent = "AMP";
+ titleText.setAttribute("x", startPosX.toString());
+ titleText.setAttribute("y", startPosY.toString());
+ titleText.setAttribute("fill", "white");
+ titleText.setAttribute("font-size", "20");
+ titleText.setAttribute("font-family", "Roboto-Light");
+ titleText.setAttribute("text-anchor", "middle");
+ titleText.setAttribute("alignment-baseline", "central");
+ batteryGroup.appendChild(titleText);
+ this.BATAmpValue = document.createElementNS(Avionics.SVG.NS, "text");
+ this.BATAmpValue.textContent = "-7";
+ this.BATAmpValue.setAttribute("x", (startPosX + rectMarginX + rectWidth * 0.95).toString());
+ this.BATAmpValue.setAttribute("y", startPosY.toString());
+ this.BATAmpValue.setAttribute("fill", "green");
+ this.BATAmpValue.setAttribute("font-size", "22");
+ this.BATAmpValue.setAttribute("font-family", "Roboto-Bold");
+ this.BATAmpValue.setAttribute("text-anchor", "end");
+ this.BATAmpValue.setAttribute("alignment-baseline", "central");
+ batteryGroup.appendChild(this.BATAmpValue);
+ startPosY += rectHeight;
+ var titleText = document.createElementNS(Avionics.SVG.NS, "text");
+ titleText.textContent = "VOLT";
+ titleText.setAttribute("x", startPosX.toString());
+ titleText.setAttribute("y", startPosY.toString());
+ titleText.setAttribute("fill", "white");
+ titleText.setAttribute("font-size", "20");
+ titleText.setAttribute("font-family", "Roboto-Light");
+ titleText.setAttribute("text-anchor", "middle");
+ titleText.setAttribute("alignment-baseline", "central");
+ batteryGroup.appendChild(titleText);
+ this.BATVoltValue = document.createElementNS(Avionics.SVG.NS, "text");
+ this.BATVoltValue.textContent = "24";
+ this.BATVoltValue.setAttribute("x", (startPosX + rectMarginX + rectWidth * 0.95).toString());
+ this.BATVoltValue.setAttribute("y", startPosY.toString());
+ this.BATVoltValue.setAttribute("fill", "green");
+ this.BATVoltValue.setAttribute("font-size", "22");
+ this.BATVoltValue.setAttribute("font-family", "Roboto-Bold");
+ this.BATVoltValue.setAttribute("text-anchor", "end");
+ this.BATVoltValue.setAttribute("alignment-baseline", "central");
+ batteryGroup.appendChild(this.BATVoltValue);
+ startPosY += rectHeight;
+ var titleText = document.createElementNS(Avionics.SVG.NS, "text");
+ titleText.textContent = "TEMP °C";
+ titleText.setAttribute("x", startPosX.toString());
+ titleText.setAttribute("y", startPosY.toString());
+ titleText.setAttribute("fill", "white");
+ titleText.setAttribute("font-size", "20");
+ titleText.setAttribute("font-family", "Roboto-Light");
+ titleText.setAttribute("text-anchor", "middle");
+ titleText.setAttribute("alignment-baseline", "central");
+ batteryGroup.appendChild(titleText);
+ this.BATTempValue = document.createElementNS(Avionics.SVG.NS, "text");
+ this.BATTempValue.textContent = "0";
+ this.BATTempValue.setAttribute("x", (startPosX + rectMarginX + rectWidth * 0.95).toString());
+ this.BATTempValue.setAttribute("y", startPosY.toString());
+ this.BATTempValue.setAttribute("fill", "green");
+ this.BATTempValue.setAttribute("font-size", "22");
+ this.BATTempValue.setAttribute("font-family", "Roboto-Bold");
+ this.BATTempValue.setAttribute("text-anchor", "end");
+ this.BATTempValue.setAttribute("alignment-baseline", "central");
+ batteryGroup.appendChild(this.BATTempValue);
+ }
+ {
+ var oxyGroup = document.createElementNS(Avionics.SVG.NS, "g");
+ oxyGroup.setAttribute("id", "oxyGroup");
+ rootSVG.appendChild(oxyGroup);
+ var startPosX = 620;
+ var startPosY = 30;
+ var titleText = document.createElementNS(Avionics.SVG.NS, "text");
+ titleText.textContent = "OXY PSI";
+ titleText.setAttribute("x", startPosX.toString());
+ titleText.setAttribute("y", startPosY.toString());
+ titleText.setAttribute("fill", "white");
+ titleText.setAttribute("font-size", "20");
+ titleText.setAttribute("font-family", "Roboto-Light");
+ titleText.setAttribute("text-anchor", "middle");
+ titleText.setAttribute("alignment-baseline", "central");
+ oxyGroup.appendChild(titleText);
+ var lineLeft = document.createElementNS(Avionics.SVG.NS, "line");
+ lineLeft.setAttribute("x1", (startPosX - 80).toString());
+ lineLeft.setAttribute("y1", startPosY.toString());
+ lineLeft.setAttribute("x2", (startPosX - 50).toString());
+ lineLeft.setAttribute("y2", startPosY.toString());
+ lineLeft.setAttribute("stroke", "white");
+ lineLeft.setAttribute("stroke-width", "2");
+ oxyGroup.appendChild(lineLeft);
+ var lineLeft = document.createElementNS(Avionics.SVG.NS, "line");
+ lineLeft.setAttribute("x1", (startPosX + 50).toString());
+ lineLeft.setAttribute("y1", startPosY.toString());
+ lineLeft.setAttribute("x2", (startPosX + 80).toString());
+ lineLeft.setAttribute("y2", startPosY.toString());
+ lineLeft.setAttribute("stroke", "white");
+ lineLeft.setAttribute("stroke-width", "2");
+ oxyGroup.appendChild(lineLeft);
+ var gaugeStartX = startPosX + 20;
+ var gaugeStartY = startPosY + 25;
+ var gaugeWidth = 12;
+ var gaugeHeight = 125;
+ this.OXYCursorX = gaugeStartX + gaugeWidth;
+ this.OXYCursorY1 = gaugeStartY + gaugeHeight;
+ this.OXYCursorY2 = gaugeStartY;
+ var rect = document.createElementNS(Avionics.SVG.NS, "rect");
+ rect.setAttribute("x", gaugeStartX.toString());
+ rect.setAttribute("y", gaugeStartY.toString());
+ rect.setAttribute("width", gaugeWidth.toString());
+ rect.setAttribute("height", (gaugeHeight * 0.75).toString());
+ rect.setAttribute("fill", "green");
+ oxyGroup.appendChild(rect);
+ var rect = document.createElementNS(Avionics.SVG.NS, "rect");
+ rect.setAttribute("x", gaugeStartX.toString());
+ rect.setAttribute("y", (gaugeStartY + gaugeHeight * 0.75).toString());
+ rect.setAttribute("width", gaugeWidth.toString());
+ rect.setAttribute("height", (gaugeHeight * 0.25).toString());
+ rect.setAttribute("fill", "darkorange");
+ oxyGroup.appendChild(rect);
+ var gradTexts = ["2400", "", "1200", "", "0"];
+ var gradPercents = [0.0, 0.25, 0.5, 0.75, 1.0];
+ var gradLength = [14, 10, 14, 10, 14];
+ for (var i = 0; i < gradPercents.length; i++) {
+ var line = document.createElementNS(Avionics.SVG.NS, "line");
+ line.setAttribute("x1", (gaugeStartX - gradLength[i]).toString());
+ line.setAttribute("y1", (gaugeStartY + gaugeHeight * gradPercents[i]).toString());
+ line.setAttribute("x2", gaugeStartX.toString());
+ line.setAttribute("y2", (gaugeStartY + gaugeHeight * gradPercents[i]).toString());
+ line.setAttribute("stroke", (i == 4) ? "darkorange" : "green");
+ line.setAttribute("stroke-width", "2");
+ oxyGroup.appendChild(line);
+ var text = document.createElementNS(Avionics.SVG.NS, "text");
+ text.textContent = gradTexts[i];
+ text.setAttribute("x", (gaugeStartX - gradLength[i] - 10).toString());
+ text.setAttribute("y", (gaugeStartY + gaugeHeight * gradPercents[i]).toString());
+ text.setAttribute("fill", "white");
+ text.setAttribute("font-size", "20");
+ text.setAttribute("font-family", "Roboto-Light");
+ text.setAttribute("text-anchor", "end");
+ text.setAttribute("alignment-baseline", "central");
+ oxyGroup.appendChild(text);
}
- else {
- this._activeWaypointContainer.style.display = "none";
+ this.OXYCursor = document.createElementNS(Avionics.SVG.NS, "path");
+ this.OXYCursor.setAttribute("transform", "translate (" + this.OXYCursorX + " " + this.OXYCursorY1 + ")");
+ this.OXYCursor.setAttribute("fill", "green");
+ this.OXYCursor.setAttribute("d", "M0 0 l15 5 l0 -10 l-15 5 Z");
+ oxyGroup.appendChild(this.OXYCursor);
+ }
+ {
+ var hydroGroup = document.createElementNS(Avionics.SVG.NS, "g");
+ hydroGroup.setAttribute("id", "HydroGroup");
+ rootSVG.appendChild(hydroGroup);
+ var startPosX = 840;
+ var startPosY = 30;
+ var titleText = document.createElementNS(Avionics.SVG.NS, "text");
+ titleText.textContent = "HYD";
+ titleText.setAttribute("x", startPosX.toString());
+ titleText.setAttribute("y", startPosY.toString());
+ titleText.setAttribute("fill", "white");
+ titleText.setAttribute("font-size", "20");
+ titleText.setAttribute("font-family", "Roboto-Light");
+ titleText.setAttribute("text-anchor", "middle");
+ titleText.setAttribute("alignment-baseline", "central");
+ hydroGroup.appendChild(titleText);
+ var lineLeft = document.createElementNS(Avionics.SVG.NS, "line");
+ lineLeft.setAttribute("x1", (startPosX - 110).toString());
+ lineLeft.setAttribute("y1", startPosY.toString());
+ lineLeft.setAttribute("x2", (startPosX - 40).toString());
+ lineLeft.setAttribute("y2", startPosY.toString());
+ lineLeft.setAttribute("stroke", "white");
+ lineLeft.setAttribute("stroke-width", "2");
+ hydroGroup.appendChild(lineLeft);
+ var lineLeft = document.createElementNS(Avionics.SVG.NS, "line");
+ lineLeft.setAttribute("x1", (startPosX + 40).toString());
+ lineLeft.setAttribute("y1", startPosY.toString());
+ lineLeft.setAttribute("x2", (startPosX + 110).toString());
+ lineLeft.setAttribute("y2", startPosY.toString());
+ lineLeft.setAttribute("stroke", "white");
+ lineLeft.setAttribute("stroke-width", "2");
+ hydroGroup.appendChild(lineLeft);
+ var rectMarginX = 40;
+ var rectWidth = 60;
+ var rectHeight = 30;
+ startPosY += rectHeight;
+ var titleText = document.createElementNS(Avionics.SVG.NS, "text");
+ titleText.textContent = "PSI";
+ titleText.setAttribute("x", startPosX.toString());
+ titleText.setAttribute("y", startPosY.toString());
+ titleText.setAttribute("fill", "white");
+ titleText.setAttribute("font-size", "20");
+ titleText.setAttribute("font-family", "Roboto-Light");
+ titleText.setAttribute("text-anchor", "middle");
+ titleText.setAttribute("alignment-baseline", "central");
+ hydroGroup.appendChild(titleText);
+ this.HYDPSIValueLeft = document.createElementNS(Avionics.SVG.NS, "text");
+ this.HYDPSIValueLeft.textContent = "0";
+ this.HYDPSIValueLeft.setAttribute("x", (startPosX - rectMarginX - rectWidth * 0.05).toString());
+ this.HYDPSIValueLeft.setAttribute("y", startPosY.toString());
+ this.HYDPSIValueLeft.setAttribute("fill", "green");
+ this.HYDPSIValueLeft.setAttribute("font-size", "22");
+ this.HYDPSIValueLeft.setAttribute("font-family", "Roboto-Bold");
+ this.HYDPSIValueLeft.setAttribute("text-anchor", "end");
+ this.HYDPSIValueLeft.setAttribute("alignment-baseline", "central");
+ hydroGroup.appendChild(this.HYDPSIValueLeft);
+ this.HYDPSIValueRight = document.createElementNS(Avionics.SVG.NS, "text");
+ this.HYDPSIValueRight.textContent = "0";
+ this.HYDPSIValueRight.setAttribute("x", (startPosX + rectMarginX + rectWidth * 0.95).toString());
+ this.HYDPSIValueRight.setAttribute("y", startPosY.toString());
+ this.HYDPSIValueRight.setAttribute("fill", "green");
+ this.HYDPSIValueRight.setAttribute("font-size", "22");
+ this.HYDPSIValueRight.setAttribute("font-family", "Roboto-Bold");
+ this.HYDPSIValueRight.setAttribute("text-anchor", "end");
+ this.HYDPSIValueRight.setAttribute("alignment-baseline", "central");
+ hydroGroup.appendChild(this.HYDPSIValueRight);
+ }
+ {
+ var fuelGroup = document.createElementNS(Avionics.SVG.NS, "g");
+ fuelGroup.setAttribute("id", "FuelGroup");
+ rootSVG.appendChild(fuelGroup);
+ var startPosX = 840;
+ var startPosY = 110;
+ var titleText = document.createElementNS(Avionics.SVG.NS, "text");
+ titleText.textContent = "FUEL";
+ titleText.setAttribute("x", startPosX.toString());
+ titleText.setAttribute("y", startPosY.toString());
+ titleText.setAttribute("fill", "white");
+ titleText.setAttribute("font-size", "20");
+ titleText.setAttribute("font-family", "Roboto-Light");
+ titleText.setAttribute("text-anchor", "middle");
+ titleText.setAttribute("alignment-baseline", "central");
+ fuelGroup.appendChild(titleText);
+ var lineLeft = document.createElementNS(Avionics.SVG.NS, "line");
+ lineLeft.setAttribute("x1", (startPosX - 110).toString());
+ lineLeft.setAttribute("y1", startPosY.toString());
+ lineLeft.setAttribute("x2", (startPosX - 40).toString());
+ lineLeft.setAttribute("y2", startPosY.toString());
+ lineLeft.setAttribute("stroke", "white");
+ lineLeft.setAttribute("stroke-width", "2");
+ fuelGroup.appendChild(lineLeft);
+ var lineLeft = document.createElementNS(Avionics.SVG.NS, "line");
+ lineLeft.setAttribute("x1", (startPosX + 40).toString());
+ lineLeft.setAttribute("y1", startPosY.toString());
+ lineLeft.setAttribute("x2", (startPosX + 110).toString());
+ lineLeft.setAttribute("y2", startPosY.toString());
+ lineLeft.setAttribute("stroke", "white");
+ lineLeft.setAttribute("stroke-width", "2");
+ fuelGroup.appendChild(lineLeft);
+ var rectMarginX = 40;
+ var rectWidth = 60;
+ var rectHeight = 30;
+ startPosY += rectHeight;
+ var titleText = document.createElementNS(Avionics.SVG.NS, "text");
+ titleText.textContent = "PPH";
+ titleText.setAttribute("x", startPosX.toString());
+ titleText.setAttribute("y", startPosY.toString());
+ titleText.setAttribute("fill", "white");
+ titleText.setAttribute("font-size", "20");
+ titleText.setAttribute("font-family", "Roboto-Light");
+ titleText.setAttribute("text-anchor", "middle");
+ titleText.setAttribute("alignment-baseline", "central");
+ fuelGroup.appendChild(titleText);
+ this.FUELPPHValueLeft = document.createElementNS(Avionics.SVG.NS, "text");
+ this.FUELPPHValueLeft.textContent = "0";
+ this.FUELPPHValueLeft.setAttribute("x", (startPosX - rectMarginX - rectWidth * 0.05).toString());
+ this.FUELPPHValueLeft.setAttribute("y", startPosY.toString());
+ this.FUELPPHValueLeft.setAttribute("fill", "green");
+ this.FUELPPHValueLeft.setAttribute("font-size", "22");
+ this.FUELPPHValueLeft.setAttribute("font-family", "Roboto-Bold");
+ this.FUELPPHValueLeft.setAttribute("text-anchor", "end");
+ this.FUELPPHValueLeft.setAttribute("alignment-baseline", "central");
+ fuelGroup.appendChild(this.FUELPPHValueLeft);
+ this.FUELPPHValueRight = document.createElementNS(Avionics.SVG.NS, "text");
+ this.FUELPPHValueRight.textContent = "0";
+ this.FUELPPHValueRight.setAttribute("x", (startPosX + rectMarginX + rectWidth * 0.95).toString());
+ this.FUELPPHValueRight.setAttribute("y", startPosY.toString());
+ this.FUELPPHValueRight.setAttribute("fill", "green");
+ this.FUELPPHValueRight.setAttribute("font-size", "22");
+ this.FUELPPHValueRight.setAttribute("font-family", "Roboto-Bold");
+ this.FUELPPHValueRight.setAttribute("text-anchor", "end");
+ this.FUELPPHValueRight.setAttribute("alignment-baseline", "central");
+ fuelGroup.appendChild(this.FUELPPHValueRight);
+ startPosY += rectHeight;
+ var titleText = document.createElementNS(Avionics.SVG.NS, "text");
+ titleText.textContent = "°C";
+ titleText.setAttribute("x", startPosX.toString());
+ titleText.setAttribute("y", startPosY.toString());
+ titleText.setAttribute("fill", "white");
+ titleText.setAttribute("font-size", "20");
+ titleText.setAttribute("font-family", "Roboto-Light");
+ titleText.setAttribute("text-anchor", "middle");
+ titleText.setAttribute("alignment-baseline", "central");
+ fuelGroup.appendChild(titleText);
+ this.FUELTempValueLeft = document.createElementNS(Avionics.SVG.NS, "text");
+ this.FUELTempValueLeft.textContent = "15";
+ this.FUELTempValueLeft.setAttribute("x", (startPosX - rectMarginX - rectWidth * 0.05).toString());
+ this.FUELTempValueLeft.setAttribute("y", startPosY.toString());
+ this.FUELTempValueLeft.setAttribute("fill", "green");
+ this.FUELTempValueLeft.setAttribute("font-size", "22");
+ this.FUELTempValueLeft.setAttribute("font-family", "Roboto-Bold");
+ this.FUELTempValueLeft.setAttribute("text-anchor", "end");
+ this.FUELTempValueLeft.setAttribute("alignment-baseline", "central");
+ fuelGroup.appendChild(this.FUELTempValueLeft);
+ this.FUELTempValueRight = document.createElementNS(Avionics.SVG.NS, "text");
+ this.FUELTempValueRight.textContent = "15";
+ this.FUELTempValueRight.setAttribute("x", (startPosX + rectMarginX + rectWidth * 0.95).toString());
+ this.FUELTempValueRight.setAttribute("y", startPosY.toString());
+ this.FUELTempValueRight.setAttribute("fill", "green");
+ this.FUELTempValueRight.setAttribute("font-size", "22");
+ this.FUELTempValueRight.setAttribute("font-family", "Roboto-Bold");
+ this.FUELTempValueRight.setAttribute("text-anchor", "end");
+ this.FUELTempValueRight.setAttribute("alignment-baseline", "central");
+ fuelGroup.appendChild(this.FUELTempValueRight);
+ }
+ }
+ showPage2() {
+ if (!this.root)
+ return;
+ Utils.RemoveAllChildren(this.root.querySelector(".SystemBody"));
+ this.root.querySelector(".SystemHeader").textContent = "SYSTEMS 2/2";
+
+ var rootSVG = document.createElementNS(Avionics.SVG.NS, "svg");
+ rootSVG.setAttribute("id", "Minimized");
+ rootSVG.setAttribute("viewBox", "0 0 1000 1000");
+ this.root.querySelector(".SystemBody").appendChild(rootSVG);
+ {
+ var trimGroup = document.createElementNS(Avionics.SVG.NS, "g");
+ trimGroup.setAttribute("id", "TrimGroup");
+ rootSVG.appendChild(trimGroup);
+ var startPosX = 55;
+ var startPosY = 30;
+ var blockPosX = startPosX;
+ var blockPosY = startPosY;
+ var lineSize = 15;
+ var line = document.createElementNS(Avionics.SVG.NS, "line");
+ line.setAttribute("x1", blockPosX.toString());
+ line.setAttribute("y1", blockPosY.toString());
+ line.setAttribute("x2", (blockPosX + lineSize).toString());
+ line.setAttribute("y2", blockPosY.toString());
+ line.setAttribute("stroke", "white");
+ line.setAttribute("stroke-width", "2");
+ trimGroup.appendChild(line);
+ var line = document.createElementNS(Avionics.SVG.NS, "line");
+ line.setAttribute("x1", blockPosX.toString());
+ line.setAttribute("y1", blockPosY.toString());
+ line.setAttribute("x2", blockPosX.toString());
+ line.setAttribute("y2", (blockPosY + lineSize).toString());
+ line.setAttribute("stroke", "white");
+ line.setAttribute("stroke-width", "2");
+ trimGroup.appendChild(line);
+ var textStartY = blockPosY + lineSize + 15;
+ var textSpacingY = 18;
+ var text = document.createElementNS(Avionics.SVG.NS, "text");
+ text.textContent = "T";
+ text.setAttribute("x", blockPosX.toString());
+ text.setAttribute("y", (textStartY + textSpacingY * 0).toString());
+ text.setAttribute("fill", "white");
+ text.setAttribute("font-size", "20");
+ text.setAttribute("font-family", "Roboto-Light");
+ text.setAttribute("text-anchor", "middle");
+ text.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(text);
+ var text = document.createElementNS(Avionics.SVG.NS, "text");
+ text.textContent = "R";
+ text.setAttribute("x", blockPosX.toString());
+ text.setAttribute("y", (textStartY + textSpacingY * 1).toString());
+ text.setAttribute("fill", "white");
+ text.setAttribute("font-size", "20");
+ text.setAttribute("font-family", "Roboto-Light");
+ text.setAttribute("text-anchor", "middle");
+ text.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(text);
+ var text = document.createElementNS(Avionics.SVG.NS, "text");
+ text.textContent = "I";
+ text.setAttribute("x", blockPosX.toString());
+ text.setAttribute("y", (textStartY + textSpacingY * 2).toString());
+ text.setAttribute("fill", "white");
+ text.setAttribute("font-size", "20");
+ text.setAttribute("font-family", "Roboto-Light");
+ text.setAttribute("text-anchor", "middle");
+ text.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(text);
+ var text = document.createElementNS(Avionics.SVG.NS, "text");
+ text.textContent = "M";
+ text.setAttribute("x", blockPosX.toString());
+ text.setAttribute("y", (textStartY + textSpacingY * 3).toString());
+ text.setAttribute("fill", "white");
+ text.setAttribute("font-size", "20");
+ text.setAttribute("font-family", "Roboto-Light");
+ text.setAttribute("text-anchor", "middle");
+ text.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(text);
+ var lineStartY = (textStartY + textSpacingY * 3) + 15;
+ var line = document.createElementNS(Avionics.SVG.NS, "line");
+ line.setAttribute("x1", blockPosX.toString());
+ line.setAttribute("y1", lineStartY.toString());
+ line.setAttribute("x2", blockPosX.toString());
+ line.setAttribute("y2", (lineStartY + lineSize).toString());
+ line.setAttribute("stroke", "white");
+ line.setAttribute("stroke-width", "2");
+ trimGroup.appendChild(line);
+ var line = document.createElementNS(Avionics.SVG.NS, "line");
+ line.setAttribute("x1", blockPosX.toString());
+ line.setAttribute("y1", (lineStartY + lineSize).toString());
+ line.setAttribute("x2", (blockPosX + lineSize).toString());
+ line.setAttribute("y2", (lineStartY + lineSize).toString());
+ line.setAttribute("stroke", "white");
+ line.setAttribute("stroke-width", "2");
+ trimGroup.appendChild(line);
+
+ {
+ blockPosX = startPosX + 160;
+ blockPosY = startPosY + 25;
+ var text = document.createElementNS(Avionics.SVG.NS, "text");
+ text.textContent = "AIL";
+ text.setAttribute("x", blockPosX.toString());
+ text.setAttribute("y", blockPosY.toString());
+ text.setAttribute("fill", "white");
+ text.setAttribute("font-size", "20");
+ text.setAttribute("font-family", "Roboto-Light");
+ text.setAttribute("text-anchor", "middle");
+ text.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(text);
+ blockPosY += 30;
+ var gaugeWidth = 120;
+ var gaugeHeight = 11;
+ var rect = document.createElementNS(Avionics.SVG.NS, "rect");
+ rect.setAttribute("x", (blockPosX - gaugeWidth * 0.5).toString());
+ rect.setAttribute("y", blockPosY.toString());
+ rect.setAttribute("width", gaugeWidth.toString());
+ rect.setAttribute("height", gaugeHeight.toString());
+ rect.setAttribute("fill", "black");
+ rect.setAttribute("stroke", "white");
+ rect.setAttribute("stroke-width", "2");
+ trimGroup.appendChild(rect);
+ var text = document.createElementNS(Avionics.SVG.NS, "text");
+ text.textContent = "L";
+ text.setAttribute("x", (blockPosX - gaugeWidth * 0.5 - 10).toString());
+ text.setAttribute("y", (blockPosY + gaugeHeight * 0.5).toString());
+ text.setAttribute("fill", "white");
+ text.setAttribute("font-size", "20");
+ text.setAttribute("font-family", "Roboto-Light");
+ text.setAttribute("text-anchor", "end");
+ text.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(text);
+ var text = document.createElementNS(Avionics.SVG.NS, "text");
+ text.textContent = "R";
+ text.setAttribute("x", (blockPosX + gaugeWidth * 0.5 + 10).toString());
+ text.setAttribute("y", (blockPosY + gaugeHeight * 0.5).toString());
+ text.setAttribute("fill", "white");
+ text.setAttribute("font-size", "20");
+ text.setAttribute("font-family", "Roboto-Light");
+ text.setAttribute("text-anchor", "start");
+ text.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(text);
+ var rect = document.createElementNS(Avionics.SVG.NS, "rect");
+ rect.setAttribute("x", (blockPosX - gaugeWidth * 0.15).toString());
+ rect.setAttribute("y", blockPosY.toString());
+ rect.setAttribute("width", (gaugeWidth * 0.15).toString());
+ rect.setAttribute("height", gaugeHeight.toString());
+ rect.setAttribute("fill", "green");
+ trimGroup.appendChild(rect);
+ var rect = document.createElementNS(Avionics.SVG.NS, "rect");
+ rect.setAttribute("x", blockPosX.toString());
+ rect.setAttribute("y", blockPosY.toString());
+ rect.setAttribute("width", (gaugeWidth * 0.15).toString());
+ rect.setAttribute("height", gaugeHeight.toString());
+ rect.setAttribute("fill", "green");
+ trimGroup.appendChild(rect);
+ this.AileronCursorX1 = blockPosX - gaugeWidth * 0.5;
+ this.AileronCursorX2 = blockPosX + gaugeWidth * 0.5;
+ this.AileronCursorY = blockPosY;
+ this.AileronCursor = document.createElementNS(Avionics.SVG.NS, "path");
+ this.AileronCursor.setAttribute("transform", "translate (" + this.AileronCursorX1 + " " + this.AileronCursorY + ")");
+ this.AileronCursor.setAttribute("fill", "white");
+ this.AileronCursor.setAttribute("d", "M0 0 l-5 -15 l10 0 l-5 15 Z");
+ trimGroup.appendChild(this.AileronCursor);
}
- let nextWaypointIndex = flightPlanManager.getActiveWaypointIndex() + 1;
- let nextWaypoint = flightPlanManager.getWaypoint(nextWaypointIndex);
- if (nextWaypoint) {
- this._nextWaypointContainer.style.display = "block";
- this._nextWaypointContainer.querySelector(".cj4x-navigation-data-waypoint-ident").textContent = nextWaypoint.ident;
- this._nextWaypointContainer.querySelector(".cj4x-navigation-data-waypoint-coordinates").textContent = nextWaypoint.infos.coordinates.toDegreeString();
- let etaValue = "---";
- let legtValue = "---";
- //start of CWB edits to confirm if activeWaypoint exists
-
- if (activeWaypoint) {
- if (isFinite(activeWaypoint.estimatedTimeEnRouteFP)) {
- etaValue = CJ4_FMSContainer.secondsTohhmm(nextWaypoint.estimatedTimeOfArrivalFP);
- }
-
- if (isFinite(activeWaypoint.estimatedTimeEnRouteFP)) {
- legtValue = CJ4_FMSContainer.secondsTohhmm(nextWaypoint.estimatedTimeEnRouteFP);
- }
- };
-
- //end of CWB edits
-
- //if (isFinite(activeWaypoint.estimatedTimeEnRouteFP)) {
- // etaValue = CJ4_FMSContainer.secondsTohhmm(nextWaypoint.estimatedTimeOfArrivalFP);
- //}
- //let legtValue = "---";
- //if (isFinite(activeWaypoint.estimatedTimeEnRouteFP)) {
- // legtValue = CJ4_FMSContainer.secondsTohhmm(nextWaypoint.estimatedTimeEnRouteFP);
- //}
- this._nextWaypointContainer
- .querySelector(".cj4x-navigation-data-waypoint-eta")
- .querySelector(".cj4x-navigation-data-waypoint-value")
- .textContent = etaValue;
- this._nextWaypointContainer
- .querySelector(".cj4x-navigation-data-waypoint-legt")
- .querySelector(".cj4x-navigation-data-waypoint-value")
- .textContent = legtValue;
- this._nextWaypointContainer
- .querySelector(".cj4x-navigation-data-waypoint-dist")
- .querySelector(".cj4x-navigation-data-waypoint-value")
- .textContent = nextWaypoint.distanceInFP.toFixed(1) + " NM";
- this._nextWaypointContainer
- .querySelector(".cj4x-navigation-data-waypoint-crs")
- .querySelector(".cj4x-navigation-data-waypoint-value")
- .textContent = nextWaypoint.bearingInFP.toFixed(1) + " °";
+
+ {
+ blockPosX = startPosX + 310 + 110;
+ blockPosY = startPosY + 25;
+ blockPosY += 30;
+ var gaugeWidth = 120;
+ var gaugeHeight = 11;
+ var rect = document.createElementNS(Avionics.SVG.NS, "rect");
+ rect.setAttribute("x", (blockPosX - gaugeWidth * 0.5).toString());
+ rect.setAttribute("y", blockPosY.toString());
+ rect.setAttribute("width", gaugeWidth.toString());
+ rect.setAttribute("height", gaugeHeight.toString());
+ rect.setAttribute("fill", "black");
+ rect.setAttribute("stroke", "white");
+ rect.setAttribute("stroke-width", "2");
+ trimGroup.appendChild(rect);
+ var text = document.createElementNS(Avionics.SVG.NS, "text");
+ text.textContent = "L";
+ text.setAttribute("x", (blockPosX - gaugeWidth * 0.5 - 10).toString());
+ text.setAttribute("y", (blockPosY + gaugeHeight * 0.5).toString());
+ text.setAttribute("fill", "white");
+ text.setAttribute("font-size", "20");
+ text.setAttribute("font-family", "Roboto-Light");
+ text.setAttribute("text-anchor", "end");
+ text.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(text);
+ var text = document.createElementNS(Avionics.SVG.NS, "text");
+ text.textContent = "R";
+ text.setAttribute("x", (blockPosX + gaugeWidth * 0.5 + 10).toString());
+ text.setAttribute("y", (blockPosY + gaugeHeight * 0.5).toString());
+ text.setAttribute("fill", "white");
+ text.setAttribute("font-size", "20");
+ text.setAttribute("font-family", "Roboto-Light");
+ text.setAttribute("text-anchor", "start");
+ text.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(text);
+ var rect = document.createElementNS(Avionics.SVG.NS, "rect");
+ rect.setAttribute("x", (blockPosX - gaugeWidth * 0.15).toString());
+ rect.setAttribute("y", blockPosY.toString());
+ rect.setAttribute("width", (gaugeWidth * 0.15).toString());
+ rect.setAttribute("height", gaugeHeight.toString());
+ rect.setAttribute("fill", "green");
+ trimGroup.appendChild(rect);
+ var rect = document.createElementNS(Avionics.SVG.NS, "rect");
+ rect.setAttribute("x", blockPosX.toString());
+ rect.setAttribute("y", blockPosY.toString());
+ rect.setAttribute("width", (gaugeWidth * 0.15).toString());
+ rect.setAttribute("height", gaugeHeight.toString());
+ rect.setAttribute("fill", "green");
+ trimGroup.appendChild(rect);
+ this.RudderCursorX1 = blockPosX - gaugeWidth * 0.5;
+ this.RudderCursorX2 = blockPosX + gaugeWidth * 0.5;
+ this.RudderCursorY = blockPosY + gaugeHeight;
+ this.RudderCursor = document.createElementNS(Avionics.SVG.NS, "path");
+ this.RudderCursor.setAttribute("transform", "translate (" + this.RudderCursorX1 + " " + this.RudderCursorY + ")");
+ this.RudderCursor.setAttribute("fill", "white");
+ this.RudderCursor.setAttribute("d", "M0 0 l-5 15 l10 0 l-5 -15 Z");
+ trimGroup.appendChild(this.RudderCursor);
+ blockPosY += 30 + gaugeHeight;
+ var text = document.createElementNS(Avionics.SVG.NS, "text");
+ text.textContent = "RUD";
+ text.setAttribute("x", blockPosX.toString());
+ text.setAttribute("y", blockPosY + 2);
+ text.setAttribute("fill", "white");
+ text.setAttribute("font-size", "20");
+ text.setAttribute("font-family", "Roboto-Light");
+ text.setAttribute("text-anchor", "middle");
+ text.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(text);
}
- else {
- this._nextWaypointContainer.style.display = "none";
+
+ {
+ blockPosX = startPosX + 280 + 110 + 180 + 120;
+ blockPosY = startPosY + 10;
+ var text = document.createElementNS(Avionics.SVG.NS, "text");
+ text.textContent = "ELEV";
+ text.setAttribute("x", (blockPosX - 80).toString());
+ text.setAttribute("y", blockPosY.toString());
+ text.setAttribute("fill", "white");
+ text.setAttribute("font-size", "22");
+ text.setAttribute("font-family", "Roboto-Light");
+ text.setAttribute("text-anchor", "middle");
+ text.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(text);
+
+ this.AileronRadians = document.createElementNS(Avionics.SVG.NS, "text");
+ this.AileronRadians.textContent = "2.6";
+ this.AileronRadians.setAttribute("x", (blockPosX + 80).toString());
+ this.AileronRadians.setAttribute("y", blockPosY.toString());
+ this.AileronRadians.setAttribute("fill", "white");
+ this.AileronRadians.setAttribute("font-size", "22");
+ this.AileronRadians.setAttribute("font-family", "Roboto-Light");
+ this.AileronRadians.setAttribute("text-anchor", "middle");
+ this.AileronRadians.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(this.AileronRadians);
+
+ var text = document.createElementNS(Avionics.SVG.NS, "text");
+ text.textContent = "ND";
+ text.setAttribute("x", (blockPosX + 6).toString());
+ text.setAttribute("y", blockPosY.toString());
+ text.setAttribute("fill", "white");
+ text.setAttribute("font-size", "20");
+ text.setAttribute("font-family", "Roboto-Light");
+ text.setAttribute("text-anchor", "middle");
+ text.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(text);
+ var gaugeStartX = blockPosX;
+ var gaugeStartY = blockPosY + 19;
+ var gaugeWidth = 11;
+ var gaugeHeight = 85;
+ var rect = document.createElementNS(Avionics.SVG.NS, "rect");
+ rect.setAttribute("x", gaugeStartX.toString());
+ rect.setAttribute("y", gaugeStartY.toString());
+ rect.setAttribute("width", gaugeWidth.toString());
+ rect.setAttribute("height", gaugeHeight.toString());
+ rect.setAttribute("fill", "black");
+ rect.setAttribute("stroke", "white");
+ rect.setAttribute("stroke-width", "2");
+ trimGroup.appendChild(rect);
+ var rect = document.createElementNS(Avionics.SVG.NS, "rect");
+ rect.setAttribute("x", gaugeStartX.toString());
+ rect.setAttribute("y", (gaugeStartY + gaugeHeight * 0.25).toString());
+ rect.setAttribute("width", gaugeWidth.toString());
+ rect.setAttribute("height", (gaugeHeight * 0.25).toString());
+ rect.setAttribute("fill", "green");
+ trimGroup.appendChild(rect);
+
+
+ this.ElevatorCursorRX = gaugeStartX + gaugeWidth;
+ this.ElevatorCursorRY1 = gaugeStartY + gaugeHeight;
+ this.ElevatorCursorRY2 = gaugeStartY;
+ this.ElevatorCursorR = document.createElementNS(Avionics.SVG.NS, "path");
+ this.ElevatorCursorR.setAttribute("transform", "translate (" + this.ElevatorCursorRX + " " + this.ElevatorCursorRY2 + ")");
+ this.ElevatorCursorR.setAttribute("fill", "white");
+ this.ElevatorCursorR.setAttribute("d", "M0 0 l15 -5 l0 10 l-15 -5 Z");
+ trimGroup.appendChild(this.ElevatorCursorR);
+
+ this.ElevatorTextR = document.createElementNS(Avionics.SVG.NS, "text");
+ this.ElevatorTextR.textContent = "R";
+ this.ElevatorTextR.setAttribute("x", (this.ElevatorCursorRX + 25).toString());
+ this.ElevatorTextR.setAttribute("y", (this.ElevatorCursorRY2 + ((this.ElevatorCursorRY1 - this.ElevatorCursorRY2) * 0.50)).toString());
+ this.ElevatorTextR.setAttribute("fill", "white");
+ this.ElevatorTextR.setAttribute("font-size", "20");
+ this.ElevatorTextR.setAttribute("font-family", "Roboto-Light");
+ this.ElevatorTextR.setAttribute("text-anchor", "middle");
+ this.ElevatorTextR.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(this.ElevatorTextR);
+
+
+ this.ElevatorCursorLX = (gaugeStartX - gaugeWidth) + 11;
+ this.ElevatorCursorLY2 = gaugeStartY;
+ this.ElevatorCursorL = document.createElementNS(Avionics.SVG.NS, "path");
+ this.ElevatorCursorL.setAttribute("transform", "translate (" + this.ElevatorCursorLX + " " + this.ElevatorCursorLY2 + ")");
+ this.ElevatorCursorL.setAttribute("fill", "white");
+ this.ElevatorCursorL.setAttribute("d", "M0 0 l-15 5 l0 -10 l15 5 Z");
+ trimGroup.appendChild(this.ElevatorCursorL);
+
+ this.ElevatorTextL = document.createElementNS(Avionics.SVG.NS, "text");
+ this.ElevatorTextL.textContent = "L";
+ this.ElevatorTextL.setAttribute("x", (this.ElevatorCursorLX - 25).toString());
+ this.ElevatorTextL.setAttribute("y", (this.ElevatorCursorRY2 + ((this.ElevatorCursorRY1 - this.ElevatorCursorRY2) * 0.50)).toString());
+ this.ElevatorTextL.setAttribute("fill", "white");
+ this.ElevatorTextL.setAttribute("font-size", "20");
+ this.ElevatorTextL.setAttribute("font-family", "Roboto-Light");
+ this.ElevatorTextL.setAttribute("text-anchor", "middle");
+ this.ElevatorTextL.setAttribute("alignment-baseline", "central");
+ trimGroup.appendChild(this.ElevatorTextL);
+
+ var text = document.createElementNS(Avionics.SVG.NS, "text");
+ text.textContent = "NU";
+ text.setAttribute("x", (blockPosX + 18).toString());
+ text.setAttribute("y", (gaugeStartY + gaugeHeight + 28).toString());
+ text.setAttribute("fill", "white");
+ text.setAttribute("font-size", "20");
+ text.setAttribute("font-family", "Roboto-Light");
+ text.setAttribute("text-anchor", "end");
+ text.setAttribute("alignment-baseline", "bottom");
+ trimGroup.appendChild(text);
+ }
+ }
+ }
+ onUpdate(_deltaTime) {
+ super.onUpdate(_deltaTime);
+
+ if (!this.root)
+ return;
+
+ if(this.isVisible){
+ if(this.currentPage == 1){
+ let GenAmp1 = SimVar.GetSimVarValue("ELECTRICAL GENALT BUS AMPS:1", "amperes");
+ this.DCAmpValueLeft.textContent = Math.round(GenAmp1).toString();
+ let GenAmp2 = SimVar.GetSimVarValue("ELECTRICAL GENALT BUS AMPS:2", "amperes");
+ this.DCAmpValueRight.textContent = Math.round(GenAmp2).toString();
+ let GenVolt1 = SimVar.GetSimVarValue("ELECTRICAL GENALT BUS VOLTAGE:1", "volts");
+ this.DCVoltValueLeft.textContent = Math.round(GenVolt1).toString();
+ let GenVolt2 = SimVar.GetSimVarValue("ELECTRICAL GENALT BUS VOLTAGE:2", "volts");
+ this.DCVoltValueRight.textContent = Math.round(GenVolt2).toString();
+ let BatAmp = SimVar.GetSimVarValue("ELECTRICAL BATTERY LOAD:1", "amperes");
+ this.BATAmpValue.textContent = Math.round(BatAmp).toString();
+ let BatVolt = SimVar.GetSimVarValue("ELECTRICAL BATTERY VOLTAGE:1", "volts");
+ this.BATVoltValue.textContent = Math.round(BatVolt).toString();
+ this.BATTempValue.textContent = "--";
+ let HydPSI1 = SimVar.GetSimVarValue("ENG HYDRAULIC PRESSURE:1", "psi");
+ this.HYDPSIValueLeft.textContent = Math.round(HydPSI1).toString();
+ let HydPSI2 = SimVar.GetSimVarValue("ENG HYDRAULIC PRESSURE:2", "psi");
+ this.HYDPSIValueRight.textContent = Math.round(HydPSI2).toString();
+ let PPHEng1 = SimVar.GetSimVarValue("CJ4 FUEL FLOW:1", "Pounds per hour");
+ this.FUELPPHValueLeft.textContent = Math.round(PPHEng1).toString();
+ let PPHEng2 = SimVar.GetSimVarValue("CJ4 FUEL FLOW:2", "Pounds per hour");
+ this.FUELPPHValueRight.textContent = Math.round(PPHEng2).toString();
+ this.FUELTempValueLeft.textContent = "--";
+ this.FUELTempValueRight.textContent = "--";
+ }
+ else if (this.currentPage == 2){
+ let AilPct = (SimVar.GetSimVarValue("AILERON TRIM PCT", "percent over 100") + 1.0) * 0.5;
+ let ail_x = this.AileronCursorX1 + (this.AileronCursorX2 - this.AileronCursorX1) * AilPct;
+ this.AileronCursor.setAttribute("transform", "translate (" + ail_x + " " + this.AileronCursorY + ")");
+ let RudPct = (SimVar.GetSimVarValue("RUDDER TRIM PCT", "percent over 100") + 1.0) * 0.5;
+ let rud_x = this.RudderCursorX1 + (this.RudderCursorX2 - this.RudderCursorX1) * RudPct;
+ this.RudderCursor.setAttribute("transform", "translate (" + rud_x + " " + this.RudderCursorY + ")");
+ let ElevPct = (SimVar.GetSimVarValue("ELEVATOR TRIM PCT", "percent over 100") + 1.0) * 0.5;
+ let elev_y = this.ElevatorCursorRY1 + (this.ElevatorCursorRY2 - this.ElevatorCursorRY1) * ElevPct;
+ this.ElevatorCursorR.setAttribute("transform", "translate (" + this.ElevatorCursorRX + " " + elev_y + ")");
+ this.ElevatorCursorL.setAttribute("transform", "translate (" + this.ElevatorCursorLX + " " + elev_y + ")");
+ let ailRadians = (SimVar.GetSimVarValue("ELEVATOR TRIM POSITION", "radian"));
+ this.AileronRadians.textContent = (ailRadians * 180 / Math.PI).toFixed(1).toString();
}
}
}
}
registerInstrument("cj4-mfd-element", CJ4_MFD);
+
//# sourceMappingURL=CJ4_MFD.js.map
\ No newline at end of file
diff --git a/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/MFD/CJ4_MFD_Checklist.js b/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/MFD/CJ4_MFD_Checklist.js
new file mode 100644
index 0000000000..467733c626
--- /dev/null
+++ b/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/MFD/CJ4_MFD_Checklist.js
@@ -0,0 +1,666 @@
+class Checklist{
+ constructor(_name) {
+ this.name = _name; // NORMAL CHECKLIST
+ this.sections = []; // TAKEOFF, DESCENT
+ }
+}
+
+class NormalChecklist extends Checklist {
+ constructor() {
+ super("NORMAL CHECKLIST MENU");
+ this.sections = [
+ {
+ name: "BEFORE STARTING ENGINES",
+ checklistItems: [
+ {
+ name: "BATTERY SWITCH",
+ value: "ON",
+ key: false
+ },
+ {
+ name: "EMERGENCY LIGHTS SWITCH",
+ value: "ARMED",
+ key: false
+ },
+ {
+ name: "STANDBY FLIGHT DISPLAY SWITCH",
+ value: "ON",
+ key: false
+ },
+ {
+ name: "AVIONICS SWITCH",
+ value: "DISPATCH",
+ key: false
+ },
+ {
+ name: "PARKING BRAKE",
+ value: "SET",
+ key: false
+ },
+ {
+ name: "WHEEL CHOCKS",
+ value: "REMOVE",
+ key: false
+ },
+ {
+ name: "CABIN DOOR",
+ value: "CLOSED",
+ key: false
+ },
+ {
+ name: "PASSENGER BRIEFING",
+ value: "COMPLETE",
+ key: false
+ },
+ {
+ name: "SEATS/BELTS/PEDALS",
+ value: "ADJUST/SECTURE",
+ key: false
+ },
+ {
+ name: "EXTERIOR LIGHTS",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "EICAS",
+ value: "CHECK",
+ key: false
+ },
+ {
+ name: "FMS",
+ value: "CHECK/SET",
+ key: false
+ },
+ {
+ name: "CLIMATE CONTROL SELECTOR",
+ value: "OFF",
+ key: false
+ }
+
+
+ ]
+ },
+ {
+ name: "STARTING ENGINES",
+ checklistItems: [
+ {
+ name: "THROTTLES",
+ value: "IDLE",
+ key: false
+ },
+ {
+ name: "ENGINE STARTER BUTTON",
+ value: "PUSH",
+ key: false
+ },
+ {
+ name: "ENGINE RUN/STOP BUTTON",
+ value: "RUN",
+ key: false
+ },
+ {
+ name: "ITT",
+ value: "CHECK FOR RISE",
+ key: false
+ },
+ {
+ name: "EICAS",
+ value: "CHECK",
+ key: false
+ },
+ {
+ name: "OPPOSITE ENGINE",
+ value: "START",
+ key: false
+ },
+ {
+ name: "EXTERNAL POWER",
+ value: "DISCONNECTED",
+ key: false
+ },
+ {
+ name: "ELECTRICAL SYSTEM",
+ value: "CHECK",
+ key: false
+ }
+ ]
+ },
+ {
+ name: "BEFORE TAXI",
+ checklistItems: [
+ {
+ name: "AVIONICS SWITCH",
+ value: "ON",
+ key: false
+ },
+ {
+ name: "CLIMATE CONTROL SELECTOR",
+ value: "NORM",
+ key: false
+ },
+ {
+ name: "PASS LIGHTS SAFETY BUTTON",
+ value: "ON",
+ key: false
+ },
+ {
+ name: "TRIMS",
+ value: "CHECK/SET",
+ key: false
+ },
+ {
+ name: "FLIGHT CONTROLS",
+ value: "FREE/CORRECT",
+ key: false
+ },
+ {
+ name: "SPEEDBRAKES/GROUND SPOILERS",
+ value: "CHECK",
+ key: false
+ },
+ {
+ name: "FLAPS",
+ value: "CHECK/SET",
+ key: false
+ },
+ {
+ name: "HYDRAULIC PRESSURE",
+ value: "CHECK",
+ key: false
+ },
+ {
+ name: "ENGINE ONLY ANTI-ICE",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "TAKEOFF DATA",
+ value: "CONFIRM/SET",
+ key: false
+ },
+ {
+ name: "AVIONICS",
+ value: "CHECK/SET",
+ key: false
+ },
+ {
+ name: "AUTOPILOT",
+ value: "ENGAGE/DISCONNECT",
+ key: false
+ },
+ {
+ name: "ALTIMETER",
+ value: "SET/CHECK",
+ key: false
+ },
+ {
+ name: "PRESSURIZATION",
+ value: "VERIFY/SET",
+ key: false
+ },
+ {
+ name: "EICAS",
+ value: "CHECK",
+ key: false
+ },
+ {
+ name: "AFT DIVIDER DOORS",
+ value: "LATCHED OPEN",
+ key: false
+ }
+ ]
+ },
+ {
+ name: "TAXI",
+ checklistItems: [
+ {
+ name: "EXTERIOR LIGHTS",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "BRAKES",
+ value: "APPLY/HOLD",
+ key: false
+ },
+ {
+ name: "PARKING BRAKE",
+ value: "RELEASE",
+ key: false
+ },
+ {
+ name: "BRAKES",
+ value: "CHECK",
+ key: false
+ },
+ {
+ name: "NOSEWHEEL STEERING",
+ value: "CHECK",
+ key: false
+ },
+ {
+ name: "FLIGHT INSTRUMENTS",
+ value: "CHECK",
+ key: false
+ }
+ ]
+ },
+ {
+ name: "BEFORE TAKEOFF",
+ checklistItems: [
+ {
+ name: "ICE PROTECTION SYSTEM",
+ value: "CHECK",
+ key: false
+ },
+ {
+ name: "RUDDER BIAS SYSTEM",
+ value: "CHECK",
+ key: false
+ },
+ {
+ name: "SEATS",
+ value: "UPRIGHT/OUTBOARD",
+ key: false
+ },
+ {
+ name: "FLAPS",
+ value: "CHECK/SET",
+ key: false
+ },
+ {
+ name: "SPEED BRAKES",
+ value: "0%",
+ key: false
+ },
+ {
+ name: "TRIMS (3)",
+ value: "SET FOR TAKEOFF",
+ key: false
+ },
+ {
+ name: "CREW BRIEFING",
+ value: "COMPLETE",
+ key: false
+ },
+ {
+ name: "TCAS",
+ value: "TA/RA",
+ key: false
+ },
+ {
+ name: "RADAR",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "GA BUTTON",
+ value: "PUSH",
+ key: false
+ },
+ {
+ name: "BATTERY AMPS",
+ value: "VERIFY 20 OR LESS",
+ key: false
+ },
+ {
+ name: "ICE PROTECTION SYSTEMS",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "PITOT/STATIC HEAT BUTTONS",
+ value: "ON",
+ key: false
+ },
+ {
+ name: "EXTERIOR LIGHTS",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "EICAS",
+ value: "CHECK",
+ key: false
+ }
+ ]
+ },
+ {
+ name: "TAKEOFF",
+ checklistItems: [
+ {
+ name: "THROTTLES",
+ value: "TAKEOFF",
+ key: false
+ },
+ {
+ name: "N1 COMMAND BUGS",
+ value: "GREEN CHEVRON",
+ key: false
+ },
+ {
+ name: "BRAKES",
+ value: "RELEASE",
+ key: false
+ },
+ {
+ name: "CONTROL WHEEL",
+ value: "ROTATE AT VR",
+ key: false
+ }
+ ]
+ },
+ {
+ name: "AFTER TAKEOFF/CLIMB",
+ checklistItems: [
+ {
+ name: "LANDING GEAR",
+ value: "UP",
+ key: false
+ },
+ {
+ name: "FLAPS",
+ value: "0\xB0",
+ key: false
+ },
+ {
+ name: "THROTTLES",
+ value: "CLIMB",
+ key: false
+ },
+ {
+ name: "YAW DAMPER",
+ value: "ON",
+ key: false
+ },
+ {
+ name: "AUTOPILOT",
+ value: "AS DESIRED",
+ key: false
+ },
+ {
+ name: "ICE PROTECTION SYSTEMS",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "PASS LIGHTS BUTTONS",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "LANDING LIGHTS BUTTON",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "PRESSURIZATION",
+ value: "CHECK",
+ key: false
+ },
+ {
+ name: "ALTIMETERS",
+ value: "SET/CROSSCHECK",
+ key: false
+ }
+ ]
+ },
+ {
+ name: "CRUISE",
+ checklistItems: [
+ {
+ name: "THROTTLES",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "PRESSURIZATION",
+ value: "CHECK",
+ key: false
+ },
+ {
+ name: "ICE PROTECTION SYSTEMS",
+ value: "AS REQUIRED",
+ key: false
+ }
+ ]
+ },
+ {
+ name: "DESCENT",
+ checklistItems: [
+ {
+ name: "PRESSURIZATION",
+ value: "VERIFY/SET LDG ELEV",
+ key: false
+ },
+ {
+ name: "ICE PROTECTION SYSTEMS",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "ALTIMETERS",
+ value: "SET/CROSSCHECK",
+ key: false
+ },
+ {
+ name: "EXTERIOR LIGHTS",
+ value: "AS REQUIRED",
+ key: false
+ }
+ ]
+ },
+ {
+ name: "APPROACH",
+ checklistItems: [
+ {
+ name: "LANDING DATA",
+ value: "CONFIRM",
+ key: false
+ },
+ {
+ name: "CREW BRIEFING",
+ value: "COMPLETE",
+ key: false
+ },
+ {
+ name: "AVIONICS/FLIGHT INSTRUMENTS",
+ value: "CHECK",
+ key: false
+ },
+ {
+ name: "MINIMUMS",
+ value: "SET",
+ key: false
+ },
+ {
+ name: "FUEL TRANSFER SELECTOR",
+ value: "OFF",
+ key: false
+ },
+ {
+ name: "EXTERIOR LIGHTS",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "ICE PROTECTION SYSTEMS",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "FLAPS",
+ value: "15\xB0",
+ key: false
+ },
+ {
+ name: "PASSENGER BRIEFING",
+ value: "COMPLETE",
+ key: false
+ },
+ {
+ name: "SEATS",
+ value: "UPRIGHT AND OUTBOARD",
+ key: false
+ },
+ {
+ name: "SEAT BELTS",
+ value: "ADJUSTED/SECURE",
+ key: false
+ },
+ {
+ name: "PASS LIGHTS SAFETY BUTTON",
+ value: "ON",
+ key: false
+ },
+ {
+ name: "PRESSURIZATION",
+ value: "< 0.5 PSI BEFORE LDG",
+ key: false
+ }
+ ]
+ },
+ {
+ name: "BEFORE LANDING",
+ checklistItems: [
+ {
+ name: "LANDING GEAR",
+ value: "DOWN (3 GREEN)",
+ key: false
+ },
+ {
+ name: "FLAPS",
+ value: "35\xB0",
+ key: false
+ },
+ {
+ name: "SPEED BRAKES",
+ value: "0%",
+ key: false
+ },
+ {
+ name: "AIRSPEED",
+ value: "VREF",
+ key: false
+ },
+ {
+ name: "AUTOPILOT AND YAW DAMPER",
+ value: "DISENGAGE",
+ key: false
+ }
+ ]
+ },
+ {
+ name: "LANDING",
+ checklistItems: [
+ {
+ name: "THROTTLES",
+ value: "IDLE",
+ key: false
+ },
+ {
+ name: "BRAKES (AFTER NLG TOUCHDOWN)",
+ value: "APPLY",
+ key: false
+ },
+ {
+ name: "GROUND SPOILERS",
+ value: "EXTEND",
+ key: false
+ }
+ ]
+ },
+ {
+ name: "ALL ENGINE GO-AROUND",
+ checklistItems: [
+ {
+ name: "GA BUTTON",
+ value: "PUSH",
+ key: false
+ },
+ {
+ name: "THROTTLES",
+ value: "TO",
+ key: false
+ },
+ {
+ name: "PITCH ALTITUDE",
+ value: "7.5\xB0, THEN AS REQ'D",
+ key: false
+ },
+ {
+ name: "FLAPS",
+ value: "15\xB0",
+ key: false
+ },
+ {
+ name: "LANDING GEAR",
+ value: "UP",
+ key: false
+ },
+ {
+ name: "FLAPS",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "AIRSPEED",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "THROTTLES",
+ value: "AS REQUIRED",
+ key: false
+ },
+ {
+ name: "YAW DAMPER",
+ value: "ON",
+ key: false
+ },
+ {
+ name: "AUTOPILOT",
+ value: "AS DESIRED",
+ key: false
+ }
+ ]
+ },
+ {
+ name: "AFTER LANDING",
+ checklistItems: [
+ {
+ name: "SPEEDBRAKES",
+ value: "0%",
+ key: false
+ },
+ {
+ name: "FLAPS",
+ value: "0\xB0",
+ key: false
+ },
+ {
+ name: "PITOT/STATIC HEAT BUTTONS",
+ value: "OFF",
+ key: false
+ },
+ {
+ name: "ICE PROTECTION SYSTEMS",
+ value: "OFF/AS REQUIRED",
+ key: false
+ },
+ {
+ name: "RADAR",
+ value: "STANDBY",
+ key: false
+ },
+ {
+ name: "EXTERIOR LIGHTS",
+ value: "AS REQUIRED",
+ key: false
+ }
+ ]
+ },
+ ];
+ }
+}
\ No newline at end of file
diff --git a/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/PFD/CJ4_PFD.html b/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/PFD/CJ4_PFD.html
index 48a864d80e..b9d7fd12af 100644
--- a/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/PFD/CJ4_PFD.html
+++ b/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/PFD/CJ4_PFD.html
@@ -205,7 +205,7 @@
-
+
diff --git a/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/Shared/CJ4_Shared.js b/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/Shared/CJ4_Shared.js
index 88f8b9c59e..15ea90fffb 100644
--- a/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/Shared/CJ4_Shared.js
+++ b/src/workingtitle-vcockpits-instruments-cj4/html_ui/Pages/VCockpit/Instruments/Airliners/CJ4/Shared/CJ4_Shared.js
@@ -2819,7 +2819,7 @@ class CJ4_NavBarContainer extends NavSystemElementContainer {
if (rat)
this.ratElement.textContent = rat.toFixed(0);
else
- this.ratElement.textContent = "---";
+ this.ratElement.textContent = 0;
}
if (this.utcElement) {
let utcTime = "";
@@ -3276,7 +3276,9 @@ class CJ4_PopupMenu_UPPER extends CJ4_PopupMenu_Handler {
this.addTitle("FORMAT", this.textSize, 0.45);
this.addRadio("OFF", this.textSize, [CJ4_PopupMenu_Key.SYS_SRC]);
this.addRadio("FMS TEXT", this.textSize, [CJ4_PopupMenu_Key.SYS_SRC]);
- this.addRadio("SYSTEMS", this.textSize, [CJ4_PopupMenu_Key.SYS_SRC]);
+ this.addRadio("CHECKLIST", this.textSize, [CJ4_PopupMenu_Key.SYS_SRC]);
+ this.addRadio("PASS BRIEF", this.textSize, [CJ4_PopupMenu_Key.SYS_SRC]);
+ this.addRadio("SYSTEMS 1/2", this.textSize, [CJ4_PopupMenu_Key.SYS_SRC]);
}
this.endSection();
}
@@ -3374,4 +3376,414 @@ class CJ4_PopupMenu_LOWER extends CJ4_PopupMenu_Handler {
this.root.appendChild(page);
}
}
-//# sourceMappingURL=CJ4_Shared.js.map
\ No newline at end of file
+
+class CJ4_Checklist_Container extends NavSystemElementContainer {
+ constructor(_name, _root) {
+ super(_name, _root, null);
+ this.isVisible = undefined;
+ this.dictionary = new Avionics.Dictionary();
+ this.otherMenusOpen = false;
+ this.checklists = undefined;
+ }
+ init() {
+ super.init();
+ this.root = this.gps.getChildById(this.htmlElemId);
+ if (!this.root) {
+ console.log("Root component expected!");
+ }
+ }
+ onUpdate(_dTime) {
+ super.onUpdate(_dTime);
+ if (this.handler)
+ this.handler.onUpdate(_dTime);
+ }
+ show(_value) {
+ if (this.isVisible != _value) {
+ this.isVisible = _value;
+ this.root.setAttribute("visible", (_value) ? "true" : "false");
+
+ if(this.isVisible == true){
+ if(this.checklists == undefined){
+ this.checklists = [
+ new NormalChecklist
+ ];
+ }
+ this.handler = new CJ4_MFDChecklist(this.root, this.dictionary, this.checklists);
+ }
+ else if(this.isVisible == false){
+ Utils.RemoveAllChildren(this.root);
+ this.handler = null;
+ }
+ }
+ }
+ onEvent(_event) {
+ super.onEvent(_event);
+ if (this.handler && this.handler.reactsOnEvent(_event)) {
+ switch (_event) {
+ case "Upr_DATA_PUSH":
+ case "Lwr_DATA_PUSH":
+ if(!this.otherMenusOpen){
+ this.handler.onActivate();
+ if(this.handler.highlightItem){
+ if(this.handler.onChecklistItemPage && this.handler.highlightItem.checkboxVal){
+ this.handler.highlight(this.handler.highlightId + 1);
+ this.handler.changeCurrentSelectionIndex(1);
+ }
+ }
+ }
+ break;
+ case "Upr_DATA_DEC":
+ case "Lwr_DATA_DEC":
+ if(!this.otherMenusOpen)
+ this.handler.onDataDec();
+ break;
+ case "Upr_DATA_INC":
+ case "Lwr_DATA_INC":
+ if(!this.otherMenusOpen)
+ this.handler.onDataInc();
+ break;
+ case "Upr_MENU_ADV_DEC":
+ case "Lwr_MENU_ADV_DEC":
+ if(!this.otherMenusOpen){
+ this.handler.onMenuDec();
+ this.handler.changeCurrentSelectionIndex(-1);
+ }
+ break;
+ case "Upr_MENU_ADV_INC":
+ case "Lwr_MENU_ADV_INC":
+ if(!this.otherMenusOpen){
+ this.handler.onMenuInc();
+ this.handler.changeCurrentSelectionIndex(1);
+ }
+ break;
+ case "Upr_Push_ESC":
+ case "Lwr_Push_ESC":
+ if (!this.handler.isOnMainPage && !this.otherMenusOpen) {
+ this.handler.escapeCbk();
+ }
+ break;
+ }
+ }
+ }
+}
+class CJ4_MFDChecklist extends WTMenu.Checklist_Menu_Handler {
+ constructor(_root, _dictionary, _checklists) {
+ super();
+ // Styling
+ this.titleSize = 13;
+ this.textSize = 13;
+ this.root = _root;
+ this.menuLeft = 75;
+ this.menuWidth = 350;
+ this.dictionary = _dictionary;
+ this.maximumItemsPerPage = 7;
+
+ // Logic
+ this.onChecklistItemPage = false;
+ this.checklists = _checklists;
+
+ this.currentMenu = this.showMainPage.bind(this);
+ this.currentPage = 1;
+ this.totalPages = 1;
+ this.currentItemIndex = 0;
+ this.totalSectionItems = this.checklists.length;
+
+ this.showMainPage();
+ }
+ refreshPage() {
+ if(this.currentMenu){
+ this.currentMenu();
+ }
+ }
+ changeCurrentSelectionIndex(_delta){
+ // Checklist item scrolling
+ if((this.currentItemIndex + _delta) >= 0 && (this.currentItemIndex + _delta < this.totalSectionItems)){
+ this.currentItemIndex += _delta;
+ let startAtLastPageItem = false;
+
+ // Handle page transition
+ const newPage = Math.ceil((this.currentItemIndex + 1) / this.maximumItemsPerPage);
+ if(newPage != this.currentPage && newPage >= 1){
+ if(newPage < this.currentPage) startAtLastPageItem = true;
+ this.currentPage = newPage;
+ this.refreshPage();
+ if(startAtLastPageItem) this.highlight(6); // Starts highlight on last item of previous page
+ }
+
+ }
+ }
+ showMainPage(_highlight = 0) {
+ this.onChecklistItemPage = false;
+ this.currentItemIndex = 0;
+
+ this.currentMenu = this.showMainPage.bind(this, _highlight);
+ this.currentPage = 1;
+ this.totalPages = Math.ceil(this.checklists.length / this.maximumItemsPerPage);
+ this.totalSectionItems = this.checklists.length;
+
+ let page = document.createElementNS(Avionics.SVG.NS, "svg");
+ page.setAttribute("id", "ViewBox");
+ page.setAttribute("viewBox", "0 0 500 500");
+ let sectionRoot = this.openMenu();
+ {
+ this.beginSection();
+ {
+ this.addChecklistTitle("CHECKLIST INDEX", this.titleSize, 1.0, this.currentPage, this.totalPages);
+ this.addChecklistTitle("", this.titleSize, 1.0);
+ }
+ this.endSection();
+ this.beginSection();
+ {
+ for(let i = 0; i < this.checklists.length; i++){
+ this.addSubMenu(this.checklists[i].name, this.textSize, this.showChecklist.bind(this, this.checklists[i]));
+ }
+ }
+ this.endSection();
+ }
+ this.closeMenu();
+ this.escapeCbk = () => {};
+ this.highlight(_highlight);
+ page.appendChild(sectionRoot);
+ Utils.RemoveAllChildren(this.root);
+ this.root.appendChild(page);
+ }
+ showChecklist(_checklist) {
+ this.onChecklistItemPage = false;
+
+ this.currentMenu = this.showChecklist.bind(this, _checklist);
+ this.totalPages = Math.ceil(_checklist.sections.length / this.maximumItemsPerPage);
+ this.totalSectionItems = _checklist.sections.length;
+
+ let page = document.createElementNS(Avionics.SVG.NS, "svg");
+ page.setAttribute("id", "ViewBox");
+ page.setAttribute("viewBox", "0 0 500 500");
+
+ let sectionRoot = this.openMenu();
+ {
+ this.beginSection();
+ {
+ this.addChecklistTitle(_checklist.name, this.titleSize, 1.0, this.currentPage, this.totalPages);
+ this.addChecklistTitle("", this.titleSize, 1.0);
+ }
+ this.endSection();
+ this.beginSection();
+ {
+ let checklistSections = _checklist.sections;
+ let startingItem = (this.currentPage * this.maximumItemsPerPage) - this.maximumItemsPerPage;
+ let endItem = Math.min(checklistSections.length, startingItem + this.maximumItemsPerPage);
+ for(let i = startingItem; i < endItem; i++){
+ if(checklistSections[i]){
+ let sectionComplete = true;
+ for(let x = 0; x < checklistSections[i].checklistItems.length; x++){
+ if(!checklistSections[i].checklistItems[x].key){
+ sectionComplete = false;
+ }
+ }
+ this.addSubMenu(_checklist.sections[i].name, this.textSize, (() => {this.currentItemIndex = 0; this.currentPage = 1; this.showChecklistSection(_checklist, i)}).bind(this), sectionComplete ? "#11d011" : "white");
+ if(sectionComplete){
+ if(i <= checklistSections.length - 1){
+ this.highlight(i + 1);
+ this.currentItemIndex = i + 1;
+ }
+ else{
+ this.highlight(i);
+ this.currentItemIndex = i;
+ }
+ }
+ }
+ }
+ }
+ this.endSection();
+ }
+ this.closeMenu();
+ this.escapeCbk = this.showMainPage.bind(this, 0);
+ page.appendChild(sectionRoot);
+ Utils.RemoveAllChildren(this.root);
+ this.root.appendChild(page);
+ }
+ showChecklistSection(_checklist, _section_id) {
+ this.onChecklistItemPage = true;
+
+ this.currentMenu = this.showChecklistSection.bind(this, _checklist, _section_id);
+ this.totalPages = Math.ceil(_checklist.sections[_section_id].checklistItems.length / this.maximumItemsPerPage);
+ this.totalSectionItems = _checklist.sections[_section_id].checklistItems.length;
+ if(_checklist.sections[_section_id].checklistItems.length % 7 == 0){
+ this.totalPages += 1;
+ this.totalSectionItems += 1;
+ }
+ // (this.totalPages - (_checklist.sections[_section_id].checklistItems.length / 7)).toFixed(2)) == 0.16
+
+ let page = document.createElementNS(Avionics.SVG.NS, "svg");
+ page.setAttribute("id", "ViewBox");
+ page.setAttribute("viewBox", "0 0 500 500");
+
+ let sectionRoot = this.openMenu();
+ {
+ this.beginSection();
+ {
+ this.addChecklistTitle(_checklist.name, this.titleSize, 1.0, this.currentPage, this.totalPages);
+ this.addChecklistTitle(_checklist.sections[_section_id].name, this.titleSize, 1.0, undefined, undefined,"left");
+ }
+ this.endSection();
+ this.beginSection();
+ {
+ let checklistItems = _checklist.sections[_section_id].checklistItems;
+ let startingItem = (this.currentPage * this.maximumItemsPerPage) - this.maximumItemsPerPage;
+ let endItem = Math.min(checklistItems.length, startingItem + this.maximumItemsPerPage);
+ for(let i = startingItem; i < endItem; i++){
+ if(checklistItems[i]){
+ this.addChecklistItem(_checklist.sections[_section_id].checklistItems[i], this.textSize);
+ }
+ }
+
+ if(endItem == checklistItems.length && _section_id < _checklist.sections.length - 1){
+ if(checklistItems.length % 7 != 0){
+ this.addChecklistTitle("", this.titleSize, 1.0);
+ this.addSubMenu("CKLST COMPLETE: NEXT " + _checklist.name, this.textSize, (() => {this.currentItemIndex = 0; this.currentPage = 1; this.showChecklistSection(_checklist, _section_id + 1);}).bind(this));
+ }
+ else{
+ if(this.currentPage == this.totalPages){
+ this.addSubMenu("CKLST COMPLETE: NEXT " + _checklist.name, this.textSize, (() => {this.currentItemIndex = 0; this.currentPage = 1; this.showChecklistSection(_checklist, _section_id + 1);}).bind(this));
+ }
+ }
+ }
+ }
+ this.endSection();
+ }
+ this.closeMenu();
+ this.escapeCbk = (() => {this.showChecklist(_checklist);}).bind(this);
+ page.appendChild(sectionRoot);
+ Utils.RemoveAllChildren(this.root);
+ this.root.appendChild(page);
+ }
+}
+class CJ4_PassengerBrief_Container extends NavSystemElementContainer {
+ constructor(_name, _root) {
+ super(_name, _root, null);
+ this.isVisible = undefined;
+ this.dictionary = new Avionics.Dictionary();
+ this.otherMenusOpen = false;
+ }
+ init() {
+ super.init();
+ this.root = this.gps.getChildById(this.htmlElemId);
+ if (!this.root) {
+ console.log("Root component expected!");
+ }
+ }
+ onUpdate(_dTime) {
+ super.onUpdate(_dTime);
+ if (this.handler)
+ this.handler.onUpdate(_dTime);
+ }
+ show(_value) {
+ if (this.isVisible != _value) {
+ this.isVisible = _value;
+ this.root.setAttribute("visible", (_value) ? "true" : "false");
+
+ if(this.isVisible == true){
+ this.handler = new CJ4_PassengerBrief(this.root, this.dictionary);
+ }
+ else if(this.isVisible == false){
+ Utils.RemoveAllChildren(this.root);
+ this.handler = null;
+ }
+ }
+ }
+ onEvent(_event) {
+ super.onEvent(_event);
+ if (this.handler && this.handler.reactsOnEvent(_event)) {
+ switch (_event) {
+ case "Upr_DATA_PUSH":
+ case "Lwr_DATA_PUSH":
+ if(!this.otherMenusOpen){
+ this.handler.onActivate();
+ }
+ break;
+ case "Upr_DATA_DEC":
+ case "Lwr_DATA_DEC":
+ if(!this.otherMenusOpen)
+ this.handler.onDataDec();
+ break;
+ case "Upr_DATA_INC":
+ case "Lwr_DATA_INC":
+ if(!this.otherMenusOpen)
+ this.handler.onDataInc();
+ break;
+ case "Upr_MENU_ADV_DEC":
+ case "Lwr_MENU_ADV_DEC":
+ if(!this.otherMenusOpen){
+ this.handler.onMenuDec();
+ }
+ break;
+ case "Upr_MENU_ADV_INC":
+ case "Lwr_MENU_ADV_INC":
+ if(!this.otherMenusOpen){
+ this.handler.onMenuInc();
+ }
+ break;
+ case "Upr_Push_ESC":
+ case "Lwr_Push_ESC":
+ if (!this.handler.isOnMainPage && !this.otherMenusOpen) {
+ this.handler.escapeCbk();
+ }
+ break;
+ }
+ }
+ }
+}
+class CJ4_PassengerBrief extends WTMenu.PassengerBrief_Menu_Handler {
+ constructor(_root, _dictionary) {
+ super();
+ // Styling
+ this.titleSize = 13;
+ this.textSize = 13;
+ this.root = _root;
+ this.menuLeft = 75;
+ this.menuWidth = 350;
+ this.dictionary = _dictionary;
+
+ // Logic
+ this.showMainPage();
+ }
+ refreshPage() {
+ if(this.currentMenu){
+ this.currentMenu();
+ }
+ }
+ showMainPage(_highlight = 0) {
+ let page = document.createElementNS(Avionics.SVG.NS, "svg");
+ page.setAttribute("id", "ViewBox");
+ page.setAttribute("viewBox", "0 0 500 500");
+ let sectionRoot = this.openMenu();
+ {
+ this.beginSection();
+ {
+ this.addPassBriefTitle("PASSENGER BRIEFING MENU", this.titleSize, 1.0);
+ this.addPassBriefTitle("", this.titleSize, 1.0);
+ }
+ this.endSection();
+ this.beginSection();
+ {
+ this.addPassBriefItem("TAKEOFF (LONG)", this.textSize);
+ this.addPassBriefItem("TAKEOFF (SHORT)", this.textSize);
+ this.addPassBriefItem("LANDING", this.textSize);
+ this.addPassBriefItem("TURBULENCE", this.textSize);
+ this.addPassBriefItem("SEATBELT", this.textSize);
+ this.addPassBriefItem("PASSENGER SAFETY", this.textSize);
+ this.addPassBriefItem("OXYGEN MASK DEPLOYMENT", this.textSize);
+ }
+ this.endSection();
+ }
+ this.closeMenu();
+ this.escapeCbk = () => {};
+ this.highlight(_highlight);
+ page.appendChild(sectionRoot);
+ Utils.RemoveAllChildren(this.root);
+ this.root.appendChild(page);
+ }
+}
+
+
+
+//# sourceMappingURL=CJ4_Shared.js.map