1
0
Fork 0

Merge branch 'dev' into itaf-update

This commit is contained in:
Josh Davidson 2021-01-17 15:52:33 -05:00
commit 66251b7c5c
17 changed files with 803 additions and 183 deletions

View file

@ -1918,20 +1918,37 @@
<key n="8">
<name>Del</name>
<desc>CLR</desc>
<repeatable type="bool">true</repeatable>
<binding>
<condition>
<property>/FMGC/keyboard-left</property>
</condition>
<command>nasal</command>
<script>mcdu.button("CLR", 0);</script>
<script>mcdu.button("CLR", 0, "down");</script>
</binding>
<binding>
<condition>
<property>/FMGC/keyboard-right</property>
</condition>
<command>nasal</command>
<script>mcdu.button("CLR", 1);</script>
<script>mcdu.button("CLR", 1, "down");</script>
</binding>
<mod-up>
<binding>
<condition>
<property>/FMGC/keyboard-left</property>
</condition>
<command>nasal</command>
<script>mcdu.button("CLR", 0, "up");</script>
</binding>
<binding>
<condition>
<property>/FMGC/keyboard-right</property>
</condition>
<command>nasal</command>
<script>mcdu.button("CLR", 1, "up");</script>
</binding>
</mod-up>
</key>
<key n="11">
<name>Disable MCDU keyboard mode</name>
@ -4643,7 +4660,7 @@
<file>Aircraft/A320-family/Nasal/MCDU/ARRIVAL.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/AIRWAYS.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/CLOSESTAIRPORT.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/RECEIVEDMESSAGES.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/RECEIVEDMESSAGES.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/PILOTWAYPOINT.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/HOLD.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/F-PLN.nas</file>
@ -4651,7 +4668,8 @@
<file>Aircraft/A320-family/Nasal/MCDU/WINDCRZ.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/WINDDES.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/WINDHIST.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/ATIS.nas</file> <!-- Last Dynamic Page -->
<file>Aircraft/A320-family/Nasal/MCDU/ATIS.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/FLIGHTLOG.nas</file> <!-- Last Dynamic Page -->
<file>Aircraft/A320-family/Nasal/MCDU/MCDU.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/INITA.nas</file>
<file>Aircraft/A320-family/Nasal/MCDU/IRSINIT.nas</file>

View file

@ -196,10 +196,10 @@ var renderingSettings = {
check: func() {
var rembrandt = getprop("/sim/rendering/rembrandt/enabled");
var ALS = getprop("/sim/rendering/shaders/skydome");
var customSettings = getprop("/sim/rendering/shaders/custom-settings") == 1;
var landmass = getprop("/sim/rendering/shaders/landmass") >= 4;
var model = getprop("/sim/rendering/shaders/model") >= 2;
if (!rembrandt and (!ALS or !customSettings or !landmass or !model)) {
if (!rembrandt and (!ALS or !landmass or !model)) {
rendering_dlg.open();
}
},
@ -255,6 +255,15 @@ var writeSettings = func {
# Panel States #
################
# Abort auto-config and close dialog
var abortPanelStates = func {
if (getprop("/systems/acconfig/autoconfig-running") == 1) {
setprop("/systems/acconfig/autoconfig-running", 0);
}
ps_load_dlg.close();
spinning.stop();
}
# Cold and Dark
var colddark = func {
if (getprop("/systems/acconfig/mismatch-code") == "0x000") {
@ -351,6 +360,10 @@ var beforestart = func {
}
}
var beforestart_b = func {
if (getprop("/systems/acconfig/autoconfig-running") == 0) {
colddark();
return 0; # auto-config aborted
}
# Continue with engine start prep.
systems.FUEL.Switches.pumpLeft1.setValue(1);
systems.FUEL.Switches.pumpLeft2.setValue(1);
@ -438,6 +451,10 @@ var taxi = func {
}
}
var taxi_b = func {
if (getprop("/systems/acconfig/autoconfig-running") == 0) {
colddark();
return 0; # auto-config aborted
}
# Continue with engine start prep, and start engines.
systems.FUEL.Switches.pumpLeft1.setValue(1);
systems.FUEL.Switches.pumpLeft2.setValue(1);
@ -491,6 +508,10 @@ var taxi_b = func {
settimer(taxi_c, 2);
}
var taxi_c = func {
if (getprop("/systems/acconfig/autoconfig-running") == 0) {
colddark();
return 0; # auto-config aborted
}
setprop("/controls/engines/engine-start-switch", 2);
setprop("/controls/engines/engine[0]/cutoff-switch", 0);
setprop("/controls/engines/engine[1]/cutoff-switch", 0);
@ -499,6 +520,10 @@ var taxi_c = func {
}, 10);
}
var taxi_d = func {
if (getprop("/systems/acconfig/autoconfig-running") == 0) {
colddark();
return 0; # auto-config aborted
}
# After Start items.
setprop("/controls/engines/engine-start-switch", 1);
setprop("/controls/apu/master", 0);

View file

@ -15,6 +15,16 @@
<halign>left</halign>
<label>Please wait...</label>
</text>
<button>
<halign>right</halign>
<legend>Abort</legend>
<pref-width>60</pref-width>
<key>Esc</key>
<binding>
<command>nasal</command>
<script>acconfig.abortPanelStates();</script>
</binding>
</button>
</group>
<hrule/>
@ -36,7 +46,7 @@
<valign>center</valign>
<property>/systems/acconfig/spin</property>
<live>1</live>
</text>
</text>
</group>

View file

@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0"?>
<!-- Copyright (c) 2020 Josh Davidson (Octal450) -->
@ -138,86 +138,68 @@
<!-- Knobs -->
<animation>
<type>pick</type>
<type>knob</type>
<object-name>ddrmi_vor_adf_select_1</object-name>
<property>instrumentation/ddrmi/vor-adf-1</property>
<axis>
<object-name>ddrmi_vor_adf_select_1.axis</object-name>
</axis>
<action>
<button>0</button>
<repeatable type="bool">false</repeatable>
<binding>
<command>property-cycle</command>
<command>property-adjust</command>
<property>instrumentation/ddrmi/vor-adf-1</property>
<value>0</value> <!-- OFF -->
<value>1</value> <!-- VOR -->
<value>-1</value> <!-- ADF -->
</binding>
</action>
<action>
<button>1</button>
<repeatable type="bool">false</repeatable>
<binding>
<command>property-cycle</command>
<property>instrumentation/ddrmi/vor-adf-1</property>
<value>-1</value> <!-- ADF -->
<value>1</value> <!-- VOR -->
<value>0</value> <!-- OFF -->
<min>-1</min>
<max>1</max>
</binding>
</action>
</animation>
<animation>
<name>Knob 1 rotate</name>
<object-name>ddrmi_vor_adf_select_1</object-name>
<name>DDRMI vor-adf knob 1</name>
<type>rotate</type>
<object-name>ddrmi_vor_adf_select_1</object-name>
<property>instrumentation/ddrmi/vor-adf-1</property>
<interpolation>
<entry><ind>-1</ind><dep>90</dep></entry>
<entry><ind> 0</ind><dep>45</dep></entry>
<entry><ind> 1</ind><dep> 0</dep></entry>
<entry><ind>-1</ind><dep>90</dep></entry> <!-- ADF -->
<entry><ind> 0</ind><dep>45</dep></entry> <!-- OFF -->
<entry><ind> 1</ind><dep> 0</dep></entry> <!-- VOR -->
</interpolation>
<axis>
<object-name>ddrmi_vor_adf_select_1.axis</object-name>
</axis>
</animation>
<animation>
<type>pick</type>
<type>knob</type>
<object-name>ddrmi_vor_adf_select_2</object-name>
<property>instrumentation/ddrmi/vor-adf-2</property>
<axis>
<object-name>ddrmi_vor_adf_select_2.axis</object-name>
</axis>
<action>
<button>0</button>
<repeatable type="bool">false</repeatable>
<binding>
<command>property-cycle</command>
<command>property-adjust</command>
<property>instrumentation/ddrmi/vor-adf-2</property>
<value>0</value> <!-- OFF -->
<value>1</value> <!-- VOR -->
<value>-1</value> <!-- ADF -->
</binding>
</action>
<action>
<button>1</button>
<repeatable type="bool">false</repeatable>
<binding>
<command>property-cycle</command>
<property>instrumentation/ddrmi/vor-adf-2</property>
<value>-1</value> <!-- ADF -->
<value>1</value> <!-- VOR -->
<value>0</value> <!-- OFF -->
<min>-1</min>
<max>1</max>
</binding>
</action>
</animation>
<animation>
<name>Knob 2 rotate</name>
<object-name>ddrmi_vor_adf_select_2</object-name>
<name>DDRMI vor-adf knob 2</name>
<type>rotate</type>
<object-name>ddrmi_vor_adf_select_2</object-name>
<property>instrumentation/ddrmi/vor-adf-2</property>
<interpolation>
<entry><ind>-1</ind><dep>-90</dep></entry>
<entry><ind> 0</ind><dep>-45</dep></entry>
<entry><ind> 1</ind><dep> 0</dep></entry>
<entry><ind>-1</ind><dep>-90</dep></entry> <!-- ADF -->
<entry><ind> 0</ind><dep>-45</dep></entry> <!-- OFF -->
<entry><ind> 1</ind><dep> 0</dep></entry> <!-- VOR -->
</interpolation>
<axis>
<object-name>ddrmi_vor_adf_select_2.axis</object-name>
</axis>
</animation>
</animation>
<!-- Flags -->
@ -227,7 +209,7 @@
<type>rotate</type>
<property>instrumentation/ddrmi/flag-1</property>
<interpolation>
<entry><ind>0</ind><dep>45</dep></entry>
<entry><ind>0</ind><dep>-45</dep></entry>
<entry><ind>1</ind><dep> 0</dep></entry>
</interpolation>
<axis>
@ -241,7 +223,7 @@
<type>rotate</type>
<property>instrumentation/ddrmi/flag-2</property>
<interpolation>
<entry><ind>0</ind><dep>-45</dep></entry>
<entry><ind>0</ind><dep>45</dep></entry>
<entry><ind>1</ind><dep> 0</dep></entry>
</interpolation>
<axis>
@ -8339,30 +8321,21 @@
</action>
</animation>
<animation>
<name>UTC selector rotate</name>
<type>pick</type>
<name>UTC selector animation</name>
<type>knob</type>
<object-name>clock_knob</object-name>
<property>instrumentation/clock/utc-selector</property>
<axis>
<object-name>clock_knob.axis</object-name>
</axis>
<action>
<button>0</button>
<repeatable type="bool">false</repeatable>
<binding>
<command>property-cycle</command>
<command>property-adjust</command>
<property>instrumentation/clock/utc-selector</property>
<value>0</value><!-- GPS -->
<value>1</value><!-- INT -->
<value>2</value><!-- SET -->
</binding>
</action>
<action>
<button>1</button>
<repeatable type="bool">false</repeatable>
<binding>
<command>property-cycle</command>
<property>instrumentation/clock/utc-selector</property>
<value>2</value><!-- SET -->
<value>1</value><!-- INT -->
<value>0</value><!-- GPS -->
<min>0</min>
<max>2</max>
</binding>
</action>
</animation>
@ -8373,9 +8346,9 @@
<object-name>clock_knob</object-name>
<property>instrumentation/clock/utc-selector</property>
<interpolation>
<entry><ind>0</ind><dep>0</dep></entry>
<entry><ind>1</ind><dep>45</dep></entry>
<entry><ind>2</ind><dep>90</dep></entry>
<entry><ind>2</ind><dep>90</dep></entry> <!-- SET -->
<entry><ind>1</ind><dep>45</dep></entry> <!-- INT -->
<entry><ind>0</ind><dep> 0</dep></entry> <!-- GPS -->
</interpolation>
<axis>
<object-name>clock_knob.axis</object-name>

View file

@ -150,10 +150,20 @@ var baro = props.globals.getNode("/FMGC/internal/baro", 1);
# GA PERF
# AOC - SENSORS
var parking_brake = props.globals.getNode("/controls/gear/brake-parking", 1);
var gear0_wow = props.globals.getNode("/gear/gear[0]/wow", 1);
var doorL1_pos = props.globals.getNode("/sim/model/door-positions/doorl1/position-norm", 1); #FWD door
var doorR1_pos = props.globals.getNode("/sim/model/door-positions/doorr1/position-norm", 1); #FWD door
var doorL4_pos = props.globals.getNode("/sim/model/door-positions/doorl4/position-norm", 1); #AFT door
var doorR4_pos = props.globals.getNode("/sim/model/door-positions/doorr4/position-norm", 1); #AFT door
# Fetch nodes into vectors
var pageProp = [props.globals.getNode("/MCDU[0]/page", 1), props.globals.getNode("/MCDU[1]/page", 1)];
var active = [props.globals.getNode("/MCDU[0]/active", 1), props.globals.getNode("/MCDU[1]/active", 1)];
var activeAtsu = [props.globals.getNode("/MCDU[0]/atsu-active", 1), props.globals.getNode("/MCDU[1]/atsu-active", 1)];
props.globals.initNode("/MCDU[0]/active-system", "", "STRING");
props.globals.initNode("/MCDU[1]/active-system", "", "STRING");
# Conversion factor pounds to kilogram
var LBS2KGS = 0.4535924;
@ -198,23 +208,23 @@ var canvas_MCDU_base = {
me["PERFTO_FE"].setFont(symbol);
me["PERFTO_SE"].setFont(symbol);
me["PERFTO_OE"].setFont(symbol);
me["PERFTO_FE"].setColor(0.8078,0.8039,0.8078);
me["PERFTO_SE"].setColor(0.8078,0.8039,0.8078);
me["PERFTO_OE"].setColor(0.8078,0.8039,0.8078);
me["PERFTO_FE"].setColor(BLUE);
me["PERFTO_SE"].setColor(BLUE);
me["PERFTO_OE"].setColor(BLUE);
me["PERFAPPR_FE"].setFont(symbol);
me["PERFAPPR_SE"].setFont(symbol);
me["PERFAPPR_OE"].setFont(symbol);
me["PERFAPPR_FE"].setColor(0.8078,0.8039,0.8078);
me["PERFAPPR_SE"].setColor(0.8078,0.8039,0.8078);
me["PERFAPPR_OE"].setColor(0.8078,0.8039,0.8078);
me["PERFAPPR_FE"].setColor(BLUE);
me["PERFAPPR_SE"].setColor(BLUE);
me["PERFAPPR_OE"].setColor(BLUE);
me["PERFGA_FE"].setFont(symbol);
me["PERFGA_SE"].setFont(symbol);
me["PERFGA_OE"].setFont(symbol);
me["PERFGA_FE"].setColor(0.8078,0.8039,0.8078);
me["PERFGA_SE"].setColor(0.8078,0.8039,0.8078);
me["PERFGA_OE"].setColor(0.8078,0.8039,0.8078);
me["PERFGA_FE"].setColor(BLUE);
me["PERFGA_SE"].setColor(BLUE);
me["PERFGA_OE"].setColor(BLUE);
me.page = canvas_group;
@ -280,12 +290,25 @@ var canvas_MCDU_base = {
me["PERFTO"].hide();
},
defaultPageNumbers: func() {
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("X/X");
me["Simple_PageNum"].hide();
me["ArrowLeft"].hide();
me["ArrowRight"].hide();
},
showPageNumbers: func(pagno=0,pagcnt=0) {
if (pagno == 0) return me.defaultPageNumbers();
me["Simple_PageNum"].show();
me["Simple_PageNum"].setText((pagcnt>0) ? pagno ~ "/" ~ pagcnt : pagno);
me["ArrowLeft"].show();
me["ArrowRight"].show();
},
showPageNumbersOnly: func(pagno,pagcnt) {
me["Simple_PageNum"].show();
me["Simple_PageNum"].setText(sprintf("%9s",pagno ~ "/" ~ pagcnt));
me["ArrowLeft"].hide();
me["ArrowRight"].hide();
},
hideAllArrows: func() {
me["Simple_L1_Arrow"].hide();
me["Simple_L2_Arrow"].hide();
@ -419,7 +442,7 @@ var canvas_MCDU_base = {
} else {
me["FPLN_Callsign"].hide();
}
me.dynamicPageFunc(myFpln[i].L1, "Simple_L1");
me.dynamicPageFunc(myFpln[i].L2, "Simple_L2");
me.dynamicPageFunc(myFpln[i].L3, "Simple_L3");
@ -497,29 +520,36 @@ var canvas_MCDU_base = {
me.standardFontColour();
me["Simple_L3"].setText(" AIDS");
me["Simple_L4"].setText(" CFDS");
pageSwitch[i].setBoolValue(1);
}
if (active[i].getValue() == 0) {
me["Simple_L1"].setText(" FMGC");
me["Simple_L1"].setColor(1,1,1);
me["Simple_L1"].setColor(WHITE);
me["Simple_L1_Arrow"].setColor(WHITE);
} else if (active[i].getValue() == 1) {
me["Simple_L1"].setText(" FMGC(SEL)");
me["Simple_L1"].setColor(0.0901,0.6039,0.7176);
me["Simple_L1"].setText(" FMGC (SEL)");
me["Simple_L1"].setColor(BLUE);
me["Simple_L1_Arrow"].setColor(BLUE);
} else if (active[i].getValue() == 2) {
me["Simple_L1"].setText(" FMGC");
me["Simple_L1"].setColor(0.0509,0.7529,0.2941);
me["Simple_L1"].setColor(GREEN);
me["Simple_L1_Arrow"].setColor(GREEN);
}
if (activeAtsu[i].getValue() == 0) {
me["Simple_L2"].setText(" ATSU");
me["Simple_L2"].setColor(1,1,1);
me["Simple_L2"].setColor(WHITE);
me["Simple_L2_Arrow"].setColor(WHITE);
} else if (activeAtsu[i].getValue() == 1) {
me["Simple_L2"].setText(" ATSU(SEL)");
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
me["Simple_L2"].setText(" ATSU (SEL)");
me["Simple_L2"].setColor(BLUE);
me["Simple_L2_Arrow"].setColor(BLUE);
} else if (activeAtsu[i].getValue() == 2) {
me["Simple_L2"].setText(" ATSU");
me["Simple_L2"].setColor(0.0509,0.7529,0.2941);
me["Simple_L2"].setColor(GREEN);
me["Simple_L2_Arrow"].setColor(GREEN);
}
} else if (page == "ATSUDLINK") {
if (!pageSwitch[i].getBoolValue()) {
@ -588,6 +618,178 @@ var canvas_MCDU_base = {
me["Simple_R6"].hide();
me["Simple_R6_Arrow"].hide();
}
} else if (page == "FLTLOG") {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
me["Simple_L0S"].hide();
me["ArrowLeft"].hide();
me["ArrowRight"].hide();
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["Simple_C3B"].hide();
me["Simple_C4B"].hide();
me.standardFontSize();
me.standardFontColour();
me.colorCenterS("wht", "wht", "wht", "wht", "wht", "wht");
me.colorCenter("wht", "wht", "wht", "wht", "wht", "wht");
#me["PRINTPAGE"] - TODO missing asterisk at 5L - only useful when printing available
me["Simple_L1S"].setText(" FLT NUM-DATE");
me["Simple_R1S"].setText("ORIG-DEST ");
me["Simple_L1"].setFontSize(small);
me["Simple_R1"].setFontSize(small);
me["Simple_L2"].setFontSize(small);
me["Simple_C2"].setFontSize(small);
me["Simple_R2"].setFontSize(small);
me["Simple_L3"].setFontSize(small);
me["Simple_C3"].setFontSize(small);
me["Simple_R3"].setFontSize(small);
me["Simple_L5"].setText(" PRINT");
me["Simple_L5"].setColor(BLUE);
me["Simple_R5"].setText("SENSORS ");
me["Simple_R5"].setColor(WHITE);
me["Simple_L4"].setFontSize(small);
me["Simple_L4"].setText(" FLIGHT");
me["Simple_C4"].setFontSize(small);
me["Simple_C4"].setText("--TIMES--");
me["Simple_R4"].setFontSize(small);
me["Simple_R4"].setText("BLOCK ");
me["Simple_C2S"].setText("TIME");
me["Simple_R2S"].setText("FOB ");
me["Simple_L2"].setText( " OUT -");
me["Simple_L3S"].setText(" OFF -");
me["Simple_L3"].setText( " ON -");
me["Simple_L4S"].setText(" IN -");
me["Simple_C5"].setFontSize(small);
pageSwitch[i].setBoolValue(1);
}
var logid = 1; #mcdu.FlightLogDatabase.getPageSize(); - one page only - TODO: multi pages
if (logid == 0) logid = 1;
me.showPageNumbersOnly(1,1);
me["Simple_Title"].setText(sprintf("FLT LOG.%04d",logid));
me["Simple_C2"].setText( "--.--"); #TODO - missing ":" char on fontset
me["Simple_C3S"].setText("--.--");
me["Simple_C3"].setText( "--.--");
me["Simple_C4S"].setText("--.--");
me["Simple_R2"].setText( "---.- ");
me["Simple_R3S"].setText("---.- ");
me["Simple_R3"].setText( "---.- ");
me["Simple_R4S"].setText("---.- ");
me.colorCenter("wht", "grn", "grn", "wht", "wht", "wht");
me.colorRight("wht", "grn", "grn", "wht", "wht", "wht");
me.colorLeftS("wht", "wht", "wht", "wht", "grn", "wht");
me.colorCenterS("wht", "wht", "grn", "grn", "grn", "wht");
me.colorRightS("wht", "wht", "grn", "grn", "grn", "wht");
var rowsC = ["Simple_C2","Simple_C3S","Simple_C3","Simple_C4S"];
var rowsR = ["Simple_R2","Simple_R3S","Simple_R3","Simple_R4S"];
var logs = mcdu.FlightLogDatabase.getLogByPage(logid);
var len = size(logs);
var flgtime = 0;
var blktime = 0;
for ( var i = 0; i < len; i = i + 1 ) {
if (logs[i] != nil) { # only valid reports
var p = logs[i].state;
if (p == 4) p = 3; # RETURN-IN
me[rowsC[p]].setText(logs[i].time);
me[rowsR[p]].setText(sprintf("%3.1f ",logs[i].fob));
}
}
var logpage = mcdu.FlightLogDatabase.getPage(logid);
me["Simple_L1"].setText(sprintf("%8s - ",logpage.fltnum) ~ logpage.date);
me["Simple_R1"].setText(logpage.tofrom ~ " ");
me["Simple_L5S"].setText( " " ~ logpage.flttime );
me["Simple_C5S"].setText(sprintf("%02.0f", getprop("/sim/time/utc/hour")) ~ "." ~ sprintf("%02.0f", getprop("/sim/time/utc/minute")) ~ "." ~ sprintf("%02.0f", getprop("/sim/time/utc/second")));
me["Simple_R5S"].setText( logpage.blktime ~ " " );
var fltstate = logpage.fltstate;
if (fltstate == "") {
fltstate = (fmgc.FMGCInternal.toFromSet) ? "BEGIN" : "RESET"; #CHECKME - my best guess, only ready when plan inserted
#TODO Pushback detection -> WPUSH state???
}
me["Simple_C5"].setText(fltstate);
} else if (page == "SENSORS") {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHide();
me["Simple_Title"].setText("SENSORS ");
me.defaultPageNumbers();
me["Simple_L0S"].hide();
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.colorLeftArrow("wht", "wht", "wht", "wht", "wht", "wht");
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["PRINTPAGE"] - TODO missing asterisk at 5L - only useful when printing available
me.standardFontSize();
me.standardFontColour();
me["Simple_L1"].setFontSize(small);
me["Simple_R1"].setFontSize(small);
me["Simple_L2"].setFontSize(small);
me["Simple_R2"].setFontSize(small);
me["Simple_L3"].setFontSize(small);
me["Simple_R3"].setFontSize(small);
me["Simple_L4"].setFontSize(small);
me["Simple_R4"].setFontSize(small);
me.colorRight("grn", "grn", "grn", "grn", "grn", "grn");
me.colorRightS("grn", "grn", "grn", "grn", "grn", "grn");
me["Simple_L1S"].setText(" PARK BRAKE");
me["Simple_L1"].setText( " NOSE STRUT");
me["Simple_L2S"].setText( " L FWD DOOR");
me["Simple_L2"].setText( " R FWD DOOR");
me["Simple_L3S"].setText( " L AFT DOOR");
me["Simple_L3"].setText( " R AFT DOOR");
me["Simple_L4S"].setText( " GND SPEED");
me["Simple_L4"].setText( " FOB");
me["Simple_L5"].setText(" PRINT");
me["Simple_L5"].setColor(BLUE);
me["Simple_L6"].setText(" RETURN");
pageSwitch[i].setBoolValue(1);
}
me["Simple_R1S"].setText(sprintf("%-10s",(parking_brake.getValue() == 1) ? "SET" : "RELEASED"));
me["Simple_R1"].setText(sprintf("%-10s",(gear0_wow.getValue() == 1) ? "GROUND" : "FLIGHT"));
me["Simple_R2S"].setText(sprintf("%-10s",(doorL1_pos.getValue() > 0.1) ? "OPEN" : "CLOSED"));
me["Simple_R2"].setText(sprintf("%-10s",(doorR1_pos.getValue() > 0.1) ? "OPEN" : "CLOSED"));
me["Simple_R3S"].setText(sprintf("%-10s",(doorL4_pos.getValue() > 0.1) ? "OPEN" : "CLOSED"));
me["Simple_R3"].setText(sprintf("%-10s",(doorR4_pos.getValue() > 0.1) ? "OPEN" : "CLOSED"));
me["Simple_R4S"].setText(sprintf("%-10s",sprintf("%03.3f",pts.Velocities.groundspeed.getValue())));
me["Simple_R4"].setText(sprintf("%-10s",sprintf("%03.1f",fmgc.FMGCInternal.fob)));
} else if (page == "AOCCONFIG") {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
@ -912,7 +1114,7 @@ var canvas_MCDU_base = {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHide();
me["Simple_Title"].setText("ATC MENU");
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("1/2");
me["Simple_PageNum"].show();
me["ArrowLeft"].show();
@ -958,7 +1160,7 @@ var canvas_MCDU_base = {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
me["Simple_Title"].setText("TEXT");
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("1/2");
me["Simple_PageNum"].show();
me["ArrowLeft"].show();
@ -1049,7 +1251,7 @@ var canvas_MCDU_base = {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
me["Simple_Title"].setText("ATC MENU");
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("2/2");
me["Simple_PageNum"].show();
me["ArrowLeft"].show();
@ -1146,7 +1348,7 @@ var canvas_MCDU_base = {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHideWithCenter();
me["Simple_Title"].setText("ATS623 ATIS MENU");
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].hide();
me["ArrowLeft"].hide();
me["ArrowRight"].hide();
@ -1825,9 +2027,9 @@ var canvas_MCDU_base = {
me["Simple_Title"].setText(sprintf("%s", " " ~ acType.getValue()));
me.defaultPageNumbers();
me.showLeft(1, 1, 1, -1, 1, 1);
me.showLeft(1, 1, 1, -1, -1, 1);
me["Simple_L0S"].hide();
me.showLeftS(1, 1, 1, -1, 1, 1);
me.showLeftS(1, 1, 1, -1, -1, 1);
me.showLeftArrow(-1, -1, 1, -1, -1, -1);
me.showRight(-1, 1, -1, 1, 1, 1);
me.showRightS(-1, -1, -1, 1, 1, 1);
@ -1850,13 +2052,17 @@ var canvas_MCDU_base = {
me.colorRightS("wht", "wht", "wht", "wht", "grn", "wht");
me.colorRightArrow("wht", "wht", "wht", "wht", "wht", "wht");
me["Simple_L5"].setText("[ ]");
if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 7) { # only on preflight and done phases
me["Simple_L5S"].setText("CHG CODE");
me["Simple_L5S"].show();
me["Simple_L5"].setText("[ ]");
me["Simple_L5"].show();
}
me["Simple_L6"].setText("+0.0/+1.0");
me["Simple_L1S"].setText(" ENG");
me["Simple_L2S"].setText(" ACTIVE NAV DATA BASE");
me["Simple_L3S"].setText(" SECOND NAV DATA BASE");
me["Simple_L5S"].setText("CHG CODE");
me["Simple_L3S"].setText(" SECOND NAV DATA BASE");
me["Simple_L6S"].setText("IDLE/PERF");
me["Simple_R6"].setText("STATUS/XLOAD ");
me["Simple_R6S"].setText("SOFTWARE ");
@ -1907,7 +2113,7 @@ var canvas_MCDU_base = {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHide();
me["Simple_Title"].setText("DATA INDEX");
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("1/2");
me["Simple_PageNum"].show();
me["ArrowLeft"].show();
@ -1947,7 +2153,7 @@ var canvas_MCDU_base = {
if (!pageSwitch[i].getBoolValue()) {
me.defaultHide();
me["Simple_Title"].setText("DATA INDEX");
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("2/2");
me["Simple_PageNum"].show();
me["ArrowLeft"].show();
@ -2228,7 +2434,7 @@ var canvas_MCDU_base = {
me["PERFGA"].hide();
me["Simple_Title"].show();
me["Simple_Title"].setText("INIT");
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("X/X");
me["Simple_PageNum"].hide();
me["ArrowLeft"].show();
@ -2272,12 +2478,12 @@ var canvas_MCDU_base = {
if (!fmgc.FMGCInternal.toFromSet and !fmgc.FMGCInternal.costIndexSet) {
me["INITA_CostIndex"].hide();
me["Simple_L5"].setColor(1,1,1);
me["Simple_L5"].setColor(WHITE);
me["Simple_L5"].show();
me["Simple_L5"].setText("---");
} else if (fmgc.FMGCInternal.costIndexSet) {
me["INITA_CostIndex"].hide();
me["Simple_L5"].setColor(0.0901,0.6039,0.7176);
me["Simple_L5"].setColor(BLUE);
me["Simple_L5"].show();
me["Simple_L5"].setText(sprintf("%s", fmgc.FMGCInternal.costIndex));
} else {
@ -2286,28 +2492,40 @@ var canvas_MCDU_base = {
}
if (!fmgc.FMGCInternal.toFromSet and !fmgc.FMGCInternal.crzSet) {
me["INITA_CruiseFLTemp"].hide();
me["Simple_L6"].setColor(1,1,1);
me["Simple_L6"].setColor(WHITE);
me["Simple_L6"].setText("-----/---g");
} else if (fmgc.FMGCInternal.crzSet and fmgc.FMGCInternal.crzTempSet) {
me["INITA_CruiseFLTemp"].hide();
me["Simple_L6"].setColor(0.0901,0.6039,0.7176);
me["Simple_L6"].setColor(BLUE);
me["Simple_L6"].setText(sprintf("%s", "FL" ~ fmgc.FMGCInternal.crzFl) ~ sprintf("/%sg", fmgc.FMGCInternal.crzTemp));
} else if (fmgc.FMGCInternal.crzSet) {
me["INITA_CruiseFLTemp"].hide();
me["Simple_L6"].setColor(0.0901,0.6039,0.7176);
me["Simple_L6"].setColor(BLUE);
fmgc.FMGCInternal.crzTemp = 15 - (2 * fmgc.FMGCInternal.crzFl / 10);
fmgc.FMGCInternal.crzTempSet = 1;
me["Simple_L6"].setText(sprintf("%s", "FL" ~ fmgc.FMGCInternal.crzFl) ~ sprintf("/%sg", fmgc.FMGCInternal.crzTemp));
} else {
me["INITA_CruiseFLTemp"].show();
me["Simple_L6"].setColor(0.7333,0.3803,0);
me["Simple_L6"].setColor(AMBER);
me["Simple_L6"].setText(" g");
}
if (fmgc.FMGCInternal.coRouteSet) { # show coRoute when valid
me["INITA_CoRoute"].hide();
me["Simple_L1"].setText(fmgc.FMGCInternal.coRoute);
me["Simple_L1"].setColor(BLUE);
me["Simple_L1"].show();
} else {
me["Simple_L1"].hide();
me["INITA_CoRoute"].show();
me["Simple_L1"].setText("NONE");
}
if (fmgc.FMGCInternal.toFromSet) {
me["INITA_CoRoute"].hide();
me["INITA_FromTo"].hide();
me["Simple_L1"].show();
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
me["Simple_L2"].setColor(BLUE);
if (fmgc.FMGCInternal.altAirportSet) {
me["Simple_L2"].setText(fmgc.FMGCInternal.altAirport);
} else {
@ -2320,7 +2538,7 @@ var canvas_MCDU_base = {
me["INITA_CoRoute"].show();
me["INITA_FromTo"].show();
me["Simple_L1"].hide();
me["Simple_L2"].setColor(1,1,1);
me["Simple_L2"].setColor(WHITE);
me["Simple_L2"].setText("----/----------");
me.showRight(-1, 1, 0, 0, 0, 0);
me["Simple_R2S"].show();
@ -2364,7 +2582,7 @@ var canvas_MCDU_base = {
me["Simple_L3S"].setText("FLT NBR");
me["Simple_L5S"].setText("COST INDEX");
me["Simple_L6S"].setText("CRZ FL/TEMP");
me["Simple_L1"].setText("NONE");
#me["Simple_L1"].setText("NONE"); # manage before (coRoute)
me["Simple_L3"].setText(sprintf("%s", fmgc.FMGCInternal.flightNum));
me["Simple_R1S"].setText("FROM/TO ");
me["Simple_R2S"].setText("INIT ");
@ -2666,7 +2884,7 @@ var canvas_MCDU_base = {
me["Simple_R5"].setText(fmgc.FMGCInternal.tripWind);
me["Simple_R6S"].setText("EXTRA/TIME");
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
if (!fmgc.FMGCInternal.fuelRequest) {
me["Simple_L2"].setText("---.-/----");
@ -2706,7 +2924,7 @@ var canvas_MCDU_base = {
me["Simple_R6"].setText("---.-/----");
me["Simple_Title"].setText("INIT");
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
me.colorLeft("ack", "wht", "wht", "wht", "wht", "wht");
me.colorRight("ack", "blu", "amb", "wht", "ack", "wht");
@ -3059,7 +3277,7 @@ var canvas_MCDU_base = {
me["PERFGA"].hide();
me["Simple_Title"].show();
me["Simple_Title"].setText("FUEL PRED");
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
me["Simple_PageNum"].setText("X/X");
me["Simple_PageNum"].hide();
me["ArrowLeft"].show();
@ -3387,7 +3605,7 @@ var canvas_MCDU_base = {
}
me["Simple_Title"].show();
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
me["Simple_Title"].setColor(GREEN);
me["Simple_PageNum"].setText("X/X");
me["Simple_PageNum"].hide();
me["ArrowLeft"].hide();
@ -3570,9 +3788,9 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.phase == 1) {
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
me["Simple_Title"].setColor(GREEN);
} else {
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
}
if (fmgc.flightPlanController.flightplans[2].departure_runway != nil) {
@ -3701,7 +3919,7 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.phase == 2) {
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
me["Simple_Title"].setColor(GREEN);
me.showLeft(0, 0, 0, 0, 1, 0);
me.showLeftS(0, 0, 0, 0, 1, 0);
me.showLeftArrow(0, 0, 0, 0, 1, 1);
@ -3742,7 +3960,7 @@ var canvas_MCDU_base = {
setprop("/FMGC/internal/activate-twice", 0);
}
} else {
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
me.showLeft(0, 0, 0, 0, -1, 0);
me.showLeftS(0, 0, 0, 0, -1, 0);
me.showLeftArrow(0, 0, 0, 0, -1, 0);
@ -3776,10 +3994,10 @@ var canvas_MCDU_base = {
me["Simple_L2S"].setText(" CI");
if (fmgc.FMGCInternal.costIndexSet) {
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
me["Simple_L2"].setColor(BLUE);
me["Simple_L2"].setText(sprintf(" %s", fmgc.FMGCInternal.costIndex));
} else {
me["Simple_L2"].setColor(1,1,1);
me["Simple_L2"].setColor(WHITE);
me["Simple_L2"].setText(" ---");
}
@ -3854,7 +4072,7 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.phase == 3) {
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
me["Simple_Title"].setColor(GREEN);
if (managedSpeed.getValue() == 1) {
me.showLeft(0, 0, 0, -1, 0, 0);
@ -3889,7 +4107,7 @@ var canvas_MCDU_base = {
setprop("/FMGC/internal/activate-twice", 0);
}
} else {
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
me.colorLeft("ack", "ack", "ack", "ack", "ack", "wht");
me.colorLeftS("ack", "ack", "ack", "ack", "ack", "wht");
@ -3916,10 +4134,10 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.costIndexSet) {
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
me["Simple_L2"].setColor(BLUE);
me["Simple_L2"].setText(sprintf(" %s", fmgc.FMGCInternal.costIndex));
} else {
me["Simple_L2"].setColor(1,1,1);
me["Simple_L2"].setColor(WHITE);
me["Simple_L2"].setText(" ---");
}
@ -3992,7 +4210,7 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.phase == 4) {
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
me["Simple_Title"].setColor(GREEN);
me.showLeft(0, 0, 0, 0, 1, 0);
me.showRight(0, 1, 0, 1, 0, 0);
me.showRightS(0, 0, 1, 0, 0, 0);
@ -4032,7 +4250,7 @@ var canvas_MCDU_base = {
setprop("/FMGC/internal/activate-twice", 0);
}
} else {
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
me.showLeft(0, 0, 0, 0, -1, 0);
me.showRight(0, -1, 0, -1, 0, 0);
me.showRightS(0, 0, -1, 0, 0, 0);
@ -4064,10 +4282,10 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.costIndexSet) {
me["Simple_L2"].setColor(0.0901,0.6039,0.7176);
me["Simple_L2"].setColor(BLUE);
me["Simple_L2"].setText(sprintf(" %2.0f", fmgc.FMGCInternal.costIndex));
} else {
me["Simple_L2"].setColor(1,1,1);
me["Simple_L2"].setColor(WHITE);
me["Simple_L2"].setText(" ---");
}
@ -4148,9 +4366,9 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.phase == 5) {
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
me["Simple_Title"].setColor(GREEN);
} else {
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
}
me["Simple_L0S"].setText("DEST");
@ -4331,9 +4549,9 @@ var canvas_MCDU_base = {
}
if (fmgc.FMGCInternal.phase == 6) {
me["Simple_Title"].setColor(0.0509,0.7529,0.2941);
me["Simple_Title"].setColor(GREEN);
} else {
me["Simple_Title"].setColor(1, 1, 1);
me["Simple_Title"].setColor(WHITE);
}
if (thrAccSet.getValue() == 1) {

View file

@ -1705,7 +1705,7 @@
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>mcdu.button("CLR", 0);</script>
<script>mcdu.button("CLR", 0, "down");</script>
<condition>
<and>
<greater-than-equals>
@ -1719,6 +1719,24 @@
</and>
</condition>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>mcdu.button("CLR", 0, "up");</script>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/ac-1</property>
<value>110</value>
</greater-than-equals>
<greater-than>
<property>controls/lighting/DU/mcdu1</property>
<value>0.01</value>
</greater-than>
</and>
</condition>
</binding>
</mod-up>
</action>
</animation>
<animation>

View file

@ -1705,7 +1705,7 @@
<repeatable>true</repeatable>
<binding>
<command>nasal</command>
<script>mcdu.button("CLR", 1);</script>
<script>mcdu.button("CLR", 1, "down");</script>
<condition>
<and>
<greater-than-equals>
@ -1719,6 +1719,24 @@
</and>
</condition>
</binding>
<mod-up>
<binding>
<command>nasal</command>
<script>mcdu.button("CLR", 1, "up");</script>
<condition>
<and>
<greater-than-equals>
<property>systems/electrical/bus/ac-2</property>
<value>110</value>
</greater-than-equals>
<greater-than>
<property>controls/lighting/DU/mcdu2</property>
<value>0.01</value>
</greater-than>
</and>
</condition>
</binding>
</mod-up>
</action>
</animation>
<animation>

View file

@ -169,6 +169,8 @@ var FMGCInternal = {
altAirportSet: 0,
altSelected: 0,
arrApt: "",
coRoute: "",
coRouteSet: 0,
costIndex: 0,
costIndexSet: 0,
crzFt: 10000,
@ -309,6 +311,7 @@ var updateArptLatLon = func {
updateRouteManagerAlt = func() {
setprop("autopilot/route-manager/cruise/altitude-ft", FMGCInternal.crzFt);
# TODO - update FMGCInternal.phase when DES to re-enter in CLIMB/CRUIZE
};
########
@ -970,6 +973,7 @@ var reset_FMGC = func {
mcdu.MCDU_reset(0);
mcdu.MCDU_reset(1);
mcdu.ReceivedMessagesDatabase.clearDatabase();
mcdu.FlightLogDatabase.clearDatabase();
Input.fd1.setValue(fd1);
Input.fd2.setValue(fd2);

View file

@ -1,5 +1,6 @@
# A3XX Simbrief Parser
# Copyright (c) 2020 Jonathan Redpath (legoboyvdlp)
# enhanceded 12/2020 - parse TOD & TOC psedo waypoints, set computer speeds on fix wps, fake coRoute name
var LBS2KGS = 0.4535924;
@ -157,12 +158,16 @@ var SimbriefParser = {
if (ident == "TOC") {
_foundTOC = 1;
continue;
#setprop("/autopilot/route-manager/vnav/tc/latitude-deg",ofpFix.getNode("pos_lat").getValue());
#setprop("/autopilot/route-manager/vnav/tc/longitude-deg",ofpFix.getNode("pos_long").getValue());
#ident = "(T/C)";
}
if (ident == "TOD") {
_foundTOD = 1;
continue;
#setprop("/autopilot/route-manager/vnav/td/latitude-deg",ofpFix.getNode("pos_lat").getValue());
#setprop("/autopilot/route-manager/vnav/td/longitude-deg",ofpFix.getNode("pos_long").getValue());
#ident = "(T/D)";
}
coords = geo.Coord.new();
@ -189,6 +194,34 @@ var SimbriefParser = {
fmgc.flightPlanController.flightplans[3].star = _star;
}
fmgc.flightPlanController.destroyTemporaryFlightPlan(3, 1);
#var idx = 1;
#var plan = fmgc.flightPlanController.flightplans[2];
#var altitude = "";
#var speed = "";
#var wpname = "";
#foreach (var ofpFix; ofpFixes) {
# ident = ofpFix.getNode("ident").getValue();
# if (ident == "TOC") wpname = "(T/C)";
# else if (ident == "TOD") wpname = "(T/D)";
# else wpname = ident;
# wp = plan.getWP(idx); # get leg
# if (wp != nil) {
# if (wp.wp_name == wpname) {
# altitude = ofpFix.getNode("altitude_feet").getValue();
# speed = ofpFix.getNode("ind_airspeed").getValue();
# if (speed>0) wp.setSpeed(speed, "computed");
# if (altitude>0) wp.setAltitude(math.round(altitude, 10), "computed");
#
# idx = idx + 1;
# }
# }
# }
fmgc.windController.updatePlans();
fmgc.updateRouteManagerAlt();
@ -199,6 +232,8 @@ var SimbriefParser = {
if (me.buildFlightplan() == nil) {
return nil;
}
#fmgc.FMGCInternal.coRoute = "SB" ~ me.OFP.getNode("origin/iata_code").getValue() ~ me.OFP.getNode("destination/iata_code").getValue() ~ "00";
#fmgc.FMGCInternal.coRouteSet = 1;
fmgc.FMGCInternal.flightNum = (me.OFP.getNode("general/icao_airline").getValue() or "") ~ (me.OFP.getNode("general/flight_number").getValue() or "");
fmgc.FMGCInternal.flightNumSet = 1;
fmgc.FMGCInternal.costIndex = me.OFP.getNode("general/costindex").getValue();

View file

@ -69,6 +69,7 @@ var scratchpadController = {
sp.scratchpadColour = "wht";
sp.showTypeIMsg = 0;
sp.showTypeIIMsg = 0;
sp.clrmode = 0; # 1 = CLR mode
sp.mcdu = mcdu;
return sp;
},
@ -88,6 +89,11 @@ var scratchpadController = {
me.clearTypeI();
}
if (me.clrmode == 1) { # prevent add chars in CLR mode
me.clear();
}
else if (character == "CLR") me.clrmode = 1;
me.scratchpad = me.scratchpad ~ character;
me.scratchpadColour = "wht";
me.update();
@ -140,6 +146,7 @@ var scratchpadController = {
},
empty: func() {
me.scratchpad = "";
me.clrmode = 0;
me.update();
},
clear: func() {
@ -173,12 +180,16 @@ var MessageController = {
TypeIMessage.new("USING COST INDEX N", 1),TypeIMessage.new("WAIT FOR SYSTEM RESPONSE"),TypeIMessage.new("RWY/LS MISMATCH"),
TypeIMessage.new("VHF3 VOICE MSG NOT GEN"),TypeIMessage.new("NO COMM MSG NOT GEN"),TypeIMessage.new("WX UPLINK"),
TypeIMessage.new("SIMBRIEF DOWNLOAD FAILED"),TypeIMessage.new("MISSING USERNAME"),TypeIMessage.new("AOC ACT F-PLN UPLINK"),
TypeIMessage.new("NO ANSWER TO REQUEST"),TypeIMessage.new("NO D-ATIS AVAILABLE"),TypeIMessage.new("BAD SERVER RESPONSE")
TypeIMessage.new("NO ANSWER TO REQUEST"),TypeIMessage.new("NO D-ATIS AVAILABLE"),TypeIMessage.new("BAD SERVER RESPONSE"),
TypeIMessage.new("WIND DATA UPLINK"),TypeIMessage.new("CHECK ALT WIND"),TypeIMessage.new("INVALID WIND UPLINK"),TypeIMessage.new("WIND UPLINK EXISTS"), #p.533
TypeIMessage.new("FM DATALINK UNAVAIL"),TypeIMessage.new("NOT XMITTED TO ACARS"), #p.559
TypeIMessage.new("PRINTER NOT AVAILABLE"),
]),
typeIIMessages: std.Vector.new([
TypeIIMessage.new("LAT DISCONT AHEAD", "amb", 0),TypeIIMessage.new("MORE DRAG"),TypeIIMessage.new("RWY/LS MISMATCH", "amb", 0),TypeIIMessage.new("STEP DELETED"),
TypeIIMessage.new("STEP NOW"),TypeIIMessage.new("TIME TO EXIT", "amb", 0),TypeIIMessage.new("V1/VR/V2 DISAGREE", "amb", 0),
TypeIIMessage.new("TO SPEED TOO LOW", "amb", 0),
TypeIIMessage.new("CHECK DEST DATA", "amb", 0), #p.533
]),
# to speed to low - new on a320, margin against vmcg / vs1g

View file

@ -68,9 +68,21 @@ var fplnItem = {
me.spd = me.getSpd();
me.alt = me.getAlt();
me.dist = me.getDist();
me._colour = "wht";
if (me.spd[1] != "wht" or me.alt[1] != "wht") {
me._colour = "mag";
if (me.colour != "yel") { # not temporary flightplan
me._colour = "wht";
#if (me.spd[1] != "wht" or me.alt[1] != "wht") {
if (me.spd[1] == me.alt[1]) {
me._colour = me.spd[1];
}
else if (me.spd[1] == "mag" or me.alt[1] == "mag") {
me._colour = "mag";
}
else if (me.spd[1] == "grn" or me.alt[1] == "grn") {
me._colour = "grn";
}
} else { # temporary flightplan
me._colour = "yel";
}
return [me.spd[0] ~ "/" ~ me.alt[0], " " ~ me.dist ~ "NM ", me._colour];
} else {
@ -95,23 +107,25 @@ var fplnItem = {
},
getSpd: func() {
if (me.index == 0 and left(me.wp.wp_name, 4) == fmgc.FMGCInternal.depApt and fmgc.FMGCInternal.v1set) {
return [sprintf("%3.0f", math.round(fmgc.FMGCInternal.v1)), "mag"];
} elsif (me.wp.speed_cstr != nil and me.wp.speed_cstr != 0) {
return [sprintf("%3.0f", me.wp.speed_cstr), "mag"];
return [sprintf("%3.0f", math.round(fmgc.FMGCInternal.v1)), "grn"]; # why "mag"? I think "grn"
} elsif (me.wp.speed_cstr != nil and me.wp.speed_cstr > 0) {
var tcol = (me.wp.speed_cstr_type == "computed" or me.wp.speed_cstr_type == "computed_mach") ? "grn" : "mag"; # TODO - check if only computed
return [sprintf("%3.0f", me.wp.speed_cstr), tcol];
} else {
return ["---", "wht"];
}
},
getAlt: func() {
if (me.index == 0 and left(me.wp.wp_name, 4) == fmgc.FMGCInternal.depApt and fmgc.flightPlanController.flightplans[me.plan].departure != nil) {
return [" " ~ sprintf("%-5.0f", math.round(fmgc.flightPlanController.flightplans[me.plan].departure.elevation * M2FT)), "mag"];
return [" " ~ sprintf("%5.0f", math.round(fmgc.flightPlanController.flightplans[me.plan].departure.elevation * M2FT)), "grn"]; #fixed - aligned to right
} elsif (me.index == (fmgc.flightPlanController.currentToWptIndex.getValue() - 1) and fmgc.flightPlanController.fromWptAlt != nil) {
return [" " ~ fmgc.flightPlanController.fromWptAlt, "mag"];
} elsif (me.wp.alt_cstr != nil and me.wp.alt_cstr != 0) {
} elsif (me.wp.alt_cstr != nil and me.wp.alt_cstr > 0) {
var tcol = (me.wp.alt_cstr_type == "computed" or me.wp.alt_cstr_type == "computed_mach") ? "grn" : "mag"; # TODO - check if only computed
if (me.wp.alt_cstr > fmgc.FMGCInternal.transAlt) {
return [" " ~ sprintf("%-5s", "FL" ~ math.round(num(me.wp.alt_cstr) / 100)), "mag"];
return [" " ~ sprintf("%5s", "FL" ~ math.round(num(me.wp.alt_cstr) / 100)), tcol]; #fixed - aligned to right
} else {
return [" " ~ sprintf("%-5.0f", me.wp.alt_cstr), "mag"];
return [" " ~ sprintf("%5.0f", me.wp.alt_cstr), tcol]; #fixed - aligned to right
}
} else {
return ["------", "wht"];
@ -337,7 +351,7 @@ var fplnPage = { # this one is only created once, and then updated - remember th
if (size(me.outputList) >= 1) {
me.L1 = me.outputList[0].updateLeftText();
me.C1 = me.outputList[0].updateCenterText();
me.C1[1] = "TIME ";
me.C1[1] = (fmgc.flightPlanController.fromWptTime != nil) ? "UTC " : "TIME "; # since TO change to UTC time (1 space left to center)
me.R1 = me.outputList[0].updateRightText();
me.R1[1] = "SPD/ALT ";
} else {

161
Nasal/MCDU/FLIGHTLOG.nas Normal file
View file

@ -0,0 +1,161 @@
# AOC Flight Log system
# Basic OOOI system implementation
var OOOIReport = {
new: func(state,fob="",time="") {
var report = {parents:[OOOIReport]};
report.state = state;
report.fob = (fob != "") ? fob : fmgc.FMGCInternal.fob;
report.time = (time != "") ? time : sprintf("%02d.%02d", getprop("/sim/time/utc/hour"), getprop("/sim/time/utc/minute"));
report.elapsed = int(getprop("/sim/time/elapsed-sec"));
report.gmt = getprop("/sim/time/gmt-string");
report.date = getprop("/sim/time/utc/day");
report.fltnum = (fmgc.FMGCInternal.flightNumSet == 1) ? fmgc.FMGCInternal.flightNum : "----";
report.tofrom = (fmgc.FMGCInternal.toFromSet) ? fmgc.FMGCInternal.depApt ~ "-" ~ fmgc.FMGCInternal.arrApt : "----/----";
return report;
},
};
# Flight phase states: RESET, BEGIN, WPUSH, OUT, OFF, ON, END
var OOOIReportPage = {
new: func(index) {
var page = {parents:[OOOIReportPage]};
page.index = index;
page.fltstate = ""; #UNDEF state RESET/BEGIN/WPUSH
page.fltnum = (fmgc.FMGCInternal.flightNumSet == 1) ? fmgc.FMGCInternal.flightNum : "";
page.date = getprop("/sim/time/utc/day");
page.tofrom = (fmgc.FMGCInternal.toFromSet) ? fmgc.FMGCInternal.depApt ~ "-" ~ fmgc.FMGCInternal.arrApt : "";
page.fltstart = 0;
page.blkstart = 0;
page.flttime = "--.--";
page.blktime = "--.--";
return page;
},
};
var formatSecToHHMM = func(sec) {
var mn = int(sec / 60);
return sprintf("%02d.%02d",int(mn/60),math.mod(mn,60));
}
var FlightLogDatabase = {
database: std.Vector.new(),
pages: std.Vector.new(),
addReport: func(report) {
if (report.state == 0) me.pages.append( OOOIReportPage.new(me.getSize()) );
me.database.append(report);
var pg = me.pages.vector[me.pages.size()-1];
pg.fltnum = report.fltnum;
pg.tofrom = report.tofrom;
if (report.state == 0) {
pg.fltstate = "OUT";
pg.blkstart = report.elapsed;
}
else if (report.state == 1) {
pg.fltstate = "OFF";
pg.fltstart = report.elapsed;
}
else if (report.state == 2) {
pg.fltstate = "ON";
if (pg.fltstart > 0) pg.flttime = formatSecToHHMM(report.elapsed - pg.fltstart);
}
else if (report.state > 2) {
pg.fltstate = "END";
if (pg.blkstart > 0) pg.blktime = formatSecToHHMM(report.elapsed - pg.blkstart);
}
},
getSize: func() {
return me.database.size();
},
getPageSize: func() {
return me.pages.size();
},
clearDatabase: func() {
me.database.clear();
me.pages.clear();
},
getLogs: func() {
var lst = [];
foreach (var log; me.database) {
append(lst,log);
}
return lst;
},
getPage: func(pg) {
return (pg<=me.getPageSize()) ? me.pages.vector[pg-1] : OOOIReportPage.new(0);
},
getLogByPage: func(no) {
var lst = [nil,nil,nil,nil];
if (me.getPageSize() == 0) return lst;
var i = (me.getPageSize()>=no) ? me.pages.vector[no-1].index : 0;
var len = me.getSize();
var v = 0;
var p = 0;
while (i<len) {
p = me.database.vector[i].state;
if (v == 0 or p != 0) lst[v] = me.database.vector[i];
else i = len;
i+=1;
v+=1;
}
return lst;
},
};
var expectedOOOIState = 0; # OOOI states: 0 = out, 1 = OFF, 2 = ON, 3 = IN, 4 = RETURN-IN
var doorL1_pos = props.globals.getNode("/sim/model/door-positions/doorl1/position-norm", 1);
var doorR1_pos = props.globals.getNode("/sim/model/door-positions/doorr1/position-norm", 1);
var doorL4_pos = props.globals.getNode("/sim/model/door-positions/doorl4/position-norm", 1);
var doorR4_pos = props.globals.getNode("/sim/model/door-positions/doorr4/position-norm", 1);
#check for A/C state change - advice me for a better method, please :/
var waitingOOOIChange = maketimer(1, func(){ # 1sec precision
var phase = fmgc.FMGCInternal.phase;
var gs = pts.Velocities.groundspeed.getValue();
var gear0 = pts.Gear.wow[0].getBoolValue();
#print(sprintf("OOOI check: %d %d %.2f %s",expectedOOOIState,phase,gs,gear0));
if (expectedOOOIState == 0) { # OUT
if (gear0 and phase == 0) {
if (gs>9) { # imho - it's useful few speed tollerance, 10kts min speed on taxiways - CHECKME - better with pushback detection?
FlightLogDatabase.addReport(OOOIReport.new(expectedOOOIState));
expectedOOOIState = 1;
}
}
} else if (expectedOOOIState == 1) { # OFF
if (!gear0) {
FlightLogDatabase.addReport(OOOIReport.new(expectedOOOIState));
expectedOOOIState = 2;
}
else if (gs < 1) { # RETURN-IN ?? - rejected takeoff, A/C back to apron - CHECKME
if (doorL1_pos.getValue()>0 or doorR1_pos.getValue()>0 or doorL4_pos.getValue()>0 or doorR4_pos.getValue()>0) {
FlightLogDatabase.addReport(OOOIReport.new(4)); # RETURN-IN
expectedOOOIState = 0;
}
}
} else if (expectedOOOIState == 2) { # ON
if (gear0 and (phase == 7 or phase == 0)) { #done or preflight
FlightLogDatabase.addReport(OOOIReport.new(expectedOOOIState));
expectedOOOIState = 3;
}
} else if (expectedOOOIState == 3) { # IN
if (gear0 and gs < 1) {
if (doorL1_pos.getValue()>0 or doorR1_pos.getValue()>0 or doorL4_pos.getValue()>0 or doorR4_pos.getValue()>0) {
FlightLogDatabase.addReport(OOOIReport.new(expectedOOOIState));
expectedOOOIState = 0;
}
}
}
});
var engine_one_chk_OOOI = setlistener("/engines/engine[0]/state", func {
if (getprop("/engines/engine[0]/state") == 3) {
removelistener(engine_one_chk_OOOI);
waitingOOOIChange.start();
}
},0,0);

View file

@ -5,7 +5,40 @@
var initInputA = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L2") {
if (key == "L1") { #clear coRoute if set
if (scratchpad == "CLR") {
if (fmgc.FMGCInternal.coRouteSet == 1) {
fmgc.FMGCInternal.coRouteSet = 0;
fmgc.FMGCInternal.coRoute = "";
fmgc.FMGCInternal.depApt = "";
fmgc.FMGCInternal.arrApt = "";
fmgc.FMGCInternal.toFromSet = 0;
fmgc.FMGCNodes.toFromSet.setValue(0);
fmgc.windController.resetDesWinds();
setprop("/FMGC/internal/align-ref-lat", 0);
setprop("/FMGC/internal/align-ref-long", 0);
setprop("/FMGC/internal/align-ref-lat-edit", 0);
setprop("/FMGC/internal/align-ref-long-edit", 0);
if (fmgc.FMGCInternal.blockConfirmed) {
fmgc.FMGCInternal.fuelCalculating = 0;
fmgc.fuelCalculating.setValue(0);
fmgc.FMGCInternal.fuelCalculating = 1;
fmgc.fuelCalculating.setValue(1);
}
fmgc.flightPlanController.reset(2);
fmgc.flightPlanController.init();
Simbrief.SimbriefParser.inhibit = 0;
}
mcdu_scratchpad.scratchpads[i].empty();
} else {
var len = size(scratchpad);
if (fmgc.FMGCInternal.coRouteSet == 1 or len != 10) {
mcdu_message(i, "NOT ALLOWED");
} else {
mcdu_message(i, "NOT IN DATA BASE"); # fake message - TODO flightplan loader
}
}
} else if (key == "L2") {
if (scratchpad == "CLR") {
fmgc.FMGCInternal.altAirport = "";
fmgc.FMGCInternal.altAirportSet = 0;
@ -183,7 +216,10 @@ var initInputA = func(key, i) {
}
}
} else if (key == "R1") {
if (scratchpad == "CLR") {
if (fmgc.FMGCInternal.coRouteSet == 1) {
mcdu_message(i, "NOT ALLOWED");
}
else if (scratchpad == "CLR") {
fmgc.FMGCInternal.depApt = "";
fmgc.FMGCInternal.arrApt = "";
fmgc.FMGCInternal.toFromSet = 0;

View file

@ -18,6 +18,7 @@ var MCDU_reset = func(i) {
setprop("it-autoflight/settings/togaspd", 157); #aka v2 clone
setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", "STATUS");
setprop("/MCDU[" ~ i ~ "]/last-atsu-page", "ATSUDLINK");
setprop("/MCDU[" ~ i ~ "]/active-system","");
pageNode[i].setValue("MCDU");
setprop("/FMGC/keyboard-left", 0);
@ -75,6 +76,8 @@ var MCDU_reset = func(i) {
fmgc.FMGCInternal.gndTempSet = 0;
fmgc.FMGCInternal.toFromSet = 0;
fmgc.FMGCNodes.toFromSet.setValue(0);
fmgc.FMGCInternal.coRoute = "";
fmgc.FMGCInternal.coRouteSet = 0;
fmgc.FMGCInternal.tropo = 36090;
fmgc.FMGCInternal.tropoSet = 0;
@ -216,9 +219,11 @@ var lskbutton = func(btn, i) {
pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-fmgc-page"));
mcdu_scratchpad.scratchpads[i].empty();
setprop("/MCDU[" ~ i ~ "]/active", 2);
setprop("/MCDU[" ~ i ~ "]/active-system","fmgc");
}, 2);
} else {
} else {
pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-fmgc-page"));
setprop("/MCDU[" ~ i ~ "]/active-system","fmgc");
mcdu_scratchpad.scratchpads[i].empty();
}
}
@ -372,9 +377,11 @@ var lskbutton = func(btn, i) {
pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-atsu-page"));
mcdu_scratchpad.scratchpads[i].empty();
setprop("/MCDU[" ~ i ~ "]/atsu-active", 2);
setprop("/MCDU[" ~ i ~ "]/active-system","atsu");
}, 2);
} else {
pageNode[i].setValue(getprop("/MCDU[" ~ i ~ "]/last-atsu-page"));
setprop("/MCDU[" ~ i ~ "]/active-system","atsu");
mcdu_scratchpad.scratchpads[i].empty();
}
}
@ -795,6 +802,8 @@ var lskbutton = func(btn, i) {
mcdu_scratchpad.scratchpads[i].empty();
} else if (page == "ATCMENU") {
pageNode[i].setValue("NOTIFICATION");
} else if (page == "FLTLOG") {
mcdu_message(i, "NOT ALLOWED");
} else if (page == "MCDUTEXT") {
atsu.freeTexts[i].selection = 9;
atsu.freeTexts[i].changed = 1;
@ -857,6 +866,8 @@ var lskbutton = func(btn, i) {
canvas_mcdu.myClosestAirport[i].freeze();
} else if (page == "AOCMENU" or page == "ATCMENU" or page == "ATCMENU2") {
pageNode[i].setValue("ATSUDLINK");
} else if (page == "SENSORS") {
pageNode[i].setValue("FLTLOG");
} else if (page == "NOTIFICATION" or page == "CONNECTSTATUS" or page == "MCDUTEXT") {
pageNode[i].setValue("ATCMENU");
} else if (page == "WEATHERREQ" or page == "RECEIVEDMSGS") {
@ -943,6 +954,8 @@ var rskbutton = func(btn, i) {
}
} else if (page == "ATSUDLINK") {
pageNode[i].setValue("AOCMENU");
} else if (page == "AOCMENU") {
pageNode[i].setValue("FLTLOG");
} else if (page == "WEATHERREQ") {
var result = atsu.AOC.newStation(mcdu_scratchpad.scratchpads[i].scratchpad, i);
if (result == 1) {
@ -1203,6 +1216,8 @@ var rskbutton = func(btn, i) {
}
} else if (page == "ATCMENU") {
pageNode[i].setValue("CONNECTSTATUS");
} else if (page == "FLTLOG") {
pageNode[i].setValue("SENSORS");
} else if (page == "WEATHERREQ") {
var result = atsu.AOC.sendReq(i);
if (result == 1) {
@ -1395,8 +1410,15 @@ var pagebutton = func(btn, i) {
page = pageNode[i].getValue();
setprop("/MCDU[" ~ i ~ "]/scratchpad-color", "wht");
if (page != "MCDU") {
# A more flexible system/page tracking for future system expansion
if (getprop("/MCDU[" ~ i ~ "]/active-system") == "fmgc") setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", page);
else setprop("/MCDU[" ~ i ~ "]/last-atsu-page", page);
if (btn == "atc") setprop("/MCDU[" ~ i ~ "]/active-system","atsu");
else setprop("/MCDU[" ~ i ~ "]/active-system","fmgc");
if (btn == "radnav") {
pageNode[i].setValue("RADNAV");
pageNode[i].setValue("RADNAV");
} else if (btn == "prog") {
if (fmgc.FMGCInternal.phase == 0 or fmgc.FMGCInternal.phase == 1) {
pageNode[i].setValue("PROGTO");
@ -1431,12 +1453,13 @@ var pagebutton = func(btn, i) {
} else if (btn == "data") {
pageNode[i].setValue("DATA");
} else if (btn == "mcdu") {
var page = page;
if (page != "ATSUDLINK" and page != "AOCMENU" and page != "AOCCONFIG" and page != "WEATHERREQ" and page != "WEATHERTYPE" and page != "RECEIVEDMSGS" and page != "RECEIVEDMSG" and page != "ATCMENU" and page != "ATCMENU2" and page != "MCDUTEXT" and page != "NOTIFICATION" and page != "CONNECTSTATUS" and page != "COMPANYCALL" and page != "VOICEDIRECTORY" and page != "DATAMODE" and page != "COMMMENU" and page != "COMMSTATUS" and page != "COMMINIT" and page != "ATIS" and page != "ATISDETAIL") {
setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", page);
} else {
setprop("/MCDU[" ~ i ~ "]/last-atsu-page", page);
}
#var page = page;
#if (page != "ATSUDLINK" and page != "AOCMENU" and page != "AOCCONFIG" and page != "WEATHERREQ" and page != "WEATHERTYPE" and page != "RECEIVEDMSGS" and page != "RECEIVEDMSG" and page != "ATCMENU" and page != "ATCMENU2" and page != "MCDUTEXT" and page != "NOTIFICATION" and page != "CONNECTSTATUS" and page != "COMPANYCALL" and page != "VOICEDIRECTORY" and page != "DATAMODE" and page != "COMMMENU" and page != "COMMSTATUS" and page != "COMMINIT" and page != "ATIS" and page != "ATISDETAIL") {
#if (getprop("/MCDU[0]/active-system") == "fmgc") {
# setprop("/MCDU[" ~ i ~ "]/last-fmgc-page", page);
#} else {
# #setprop("/MCDU[" ~ i ~ "]/last-atsu-page", page);
#}
mcdu_message(i, "SELECT DESIRED SYSTEM");
pageNode[i].setValue("MCDU");
} else if (btn == "f-pln" or btn == "airport") {
@ -1475,16 +1498,18 @@ var pagebutton = func(btn, i) {
settimer(func(){
pageNode[i].setValue("ATCMENU");
mcdu_scratchpad.scratchpads[i].empty();
setprop("/MCDU[" ~ i ~ "]/atsu-active", 2);
setprop("/MCDU[" ~ i ~ "]/atsu-active", 2);
}, 2);
} else {
pageNode[i].setValue("ATCMENU");
pageNode[i].setValue("ATCMENU");
}
}
}
}
var button = func(btn, i) {
var buttonCLRDown = [0,0]; # counter for down event
var button = func(btn, i, event = "") {
page = pageNode[i].getValue();
if (page != "MCDU") {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
@ -1493,11 +1518,24 @@ var button = func(btn, i) {
} else if (btn == "SP") {
mcdu_scratchpad.scratchpads[i].addChar(" ");
} else if (btn == "CLR") {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (size(scratchpad) == 0) {
mcdu_scratchpad.scratchpads[i].addChar("CLR");
} else {
mcdu_scratchpad.scratchpads[i].clear();
if (event == "down") {
if (size(scratchpad) > 0) {
if (buttonCLRDown[i] > 4) {
mcdu_scratchpad.scratchpads[i].empty();
}
buttonCLRDown[i] = buttonCLRDown[i] + 1;
}
}
else if (event == "" or buttonCLRDown[i]<=4) {
buttonCLRDown[i] = 0;
#var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad; <- useless??
if (size(scratchpad) == 0) {
mcdu_scratchpad.scratchpads[i].addChar("CLR");
} else {
mcdu_scratchpad.scratchpads[i].clear();
}
} else { # up with buttonCLRDown[i]>4
buttonCLRDown[i] = 0;
}
} else if (btn == "DOT") {
mcdu_scratchpad.scratchpads[i].addChar(".");
@ -1514,6 +1552,12 @@ var mcdu_message = func(i, string, overrideStr = "") {
mcdu_scratchpad.scratchpads[i].override(overrideStr);
}
# Messagge Type II - TODO 5 messages queue - remove only on resolve
var mcdu_messageTypeII = func(i, string, overrideStr = "") {
mcdu_scratchpad.scratchpads[i].showTypeII(mcdu_scratchpad.MessageController.getTypeIIMsgByText(string));
mcdu_scratchpad.scratchpads[i].override(overrideStr);
}
var screenFlash = func(time, i) {
page = pageNode[i].getValue();
pageNode[i].setValue("NONE");

View file

@ -3,6 +3,22 @@
# Copyright (c) 2020 Josh Davidson (Octal450)
# Copyright (c) 2020 Matthew Maring (mattmaring)
# VMCA 109.5 at 0ft
# VMCG 106.5 at 0ft all conf
var standard_VMCA = 109.5; # TODO calculate VMCA/VMCG on altitude (ft) of departure airport (read below)
var standard_VMCG = 106.5;
# TODO - DepArp elevation or current elevation (on ground only!!) -> math.round(fmgc.flightPlanController.flightplans[2].departure.elevation * M2FT))
var perfTOCheckVSpeeds = func(i) {
if (fmgc.FMGCInternal.v1set == 1 and fmgc.FMGCInternal.vrset == 1 and fmgc.FMGCInternal.v2set == 1) { # only when v1/vr/v2 all sets
if (fmgc.FMGCInternal.v1>fmgc.FMGCInternal.vr or fmgc.FMGCInternal.vr > fmgc.FMGCInternal.v2) mcdu_messageTypeII(i,"V1/VR/V2 DISAGREE");
else if (fmgc.FMGCInternal.v1<standard_VMCG or fmgc.FMGCInternal.vr<(standard_VMCA*1.05) or fmgc.FMGCInternal.v2<(standard_VMCA*1.10)) mcdu_messageTypeII(i,"TO SPEED TOO LOW");
#else if (Vr<KVr*VS1G or V2<KV2*VS1G) mcdu_messageTypeII(i,"TO SPEED TOO LOW"); #TODO - check to VS1G and look constant KVr KV2 on manual, not own by me :/
}
}
var perfTOInput = func(key, i) {
var scratchpad = mcdu_scratchpad.scratchpads[i].scratchpad;
if (key == "L1") {
@ -24,6 +40,8 @@ var perfTOInput = func(key, i) {
fmgc.FMGCNodes.v1.setValue(scratchpad);
fmgc.FMGCNodes.v1set.setValue(1);
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeeds(i); # do V-speeds validation
} else {
mcdu_message(i, "NOT ALLOWED");
}
@ -47,6 +65,8 @@ var perfTOInput = func(key, i) {
fmgc.FMGCInternal.vr = scratchpad;
fmgc.FMGCInternal.vrset = 1;
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeeds(i); # do V-speeds validation
} else {
mcdu_message(i, "NOT ALLOWED");
}
@ -73,6 +93,8 @@ var perfTOInput = func(key, i) {
fmgc.updatePitchArm2();
setprop("/it-autoflight/settings/togaspd", scratchpad);
mcdu_scratchpad.scratchpads[i].empty();
perfTOCheckVSpeeds(i); # do V-speeds validation
} else {
mcdu_message(i, "NOT ALLOWED");
}
@ -112,11 +134,19 @@ var perfTOInput = func(key, i) {
var thrreds = size(thrred);
var acc = thracc[1];
var accs = size(acc);
#TODO - manual check - four digit alwway 0000 - default = runaway_elevation + 800 ft, min values runaway_elevation+400ft
if (int(thrred) != nil and (thrreds >= 3 and thrreds <= 5) and thrred >= 400 and thrred <= 39000 and int(acc) != nil and (accs == 3 or accs == 4 or accs == 5) and acc >= 400 and acc <= 39000) {
setprop("/systems/thrust/clbreduc-ft", int(thrred / 10) * 10);
setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10);
setprop("MCDUC/thracc-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
if (thrred<=acc) { # validation
setprop("/systems/thrust/clbreduc-ft", int(thrred / 10) * 10);
setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10);
setprop("MCDUC/thracc-set", 1);
mcdu_scratchpad.scratchpads[i].empty();
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else if (thrreds == 0 and int(acc) != nil and (accs >= 3 and accs <= 5) and acc >= 400 and acc <= 39000) {
setprop("/FMGC/internal/accel-agl-ft", int(acc / 10) * 10);
mcdu_scratchpad.scratchpads[i].empty();

View file

@ -979,8 +979,13 @@
</table>
</scheduled_gain>
<lag_filter name="fbw/tiller-handle">
<actuator name="fbw/tiller-handle-cmd">
<input>fbw/tiller-handle-scheduled</input>
<rate_limit>0.16</rate_limit> <!-- 12/75 -->
</actuator>
<lag_filter name="fbw/tiller-handle">
<input>fbw/tiller-handle-cmd</input>
<c1>20</c1>
</lag_filter>

View file

@ -1 +1 @@
45
46