Merge branch 'dev' into preflight
This commit is contained in:
commit
ab603af179
7 changed files with 133 additions and 36 deletions
|
@ -134,7 +134,6 @@ var adr_3_fault = props.globals.getNode("/controls/navigation/adirscp/lights/adr
|
|||
var air_data_switch = props.globals.getNode("/controls/navigation/switching/air-data", 1);
|
||||
|
||||
# Create Nodes:
|
||||
var alt_diff = props.globals.initNode("/instrumentation/pfd/alt-diff", 0.0, "DOUBLE");
|
||||
var heading = props.globals.initNode("/instrumentation/pfd/heading-deg", 0.0, "DOUBLE");
|
||||
var horizon_pitch = props.globals.initNode("/instrumentation/pfd/horizon-pitch", 0.0, "DOUBLE");
|
||||
var horizon_ground = props.globals.initNode("/instrumentation/pfd/horizon-ground", 0.0, "DOUBLE");
|
||||
|
@ -1690,7 +1689,7 @@ var canvas_PFD_1 = {
|
|||
me["ALT_tens"].setTranslation(0, altTens * 1.392);
|
||||
|
||||
ap_alt_cur = ap_alt.getValue();
|
||||
alt_diff_cur = alt_diff.getValue();
|
||||
alt_diff_cur = dmc.DMController.DMCs[0].outputs[7].getValue();
|
||||
if (alt_diff_cur >= -565 and alt_diff_cur <= 565) {
|
||||
me["ALT_target"].setTranslation(0, (alt_diff_cur / 100) * -48.66856);
|
||||
me["ALT_target_digit"].setText(sprintf("%03d", math.round(ap_alt_cur / 100)));
|
||||
|
@ -2462,7 +2461,7 @@ var canvas_PFD_2 = {
|
|||
me["ALT_tens"].setTranslation(0, altTens * 1.392);
|
||||
|
||||
ap_alt_cur = ap_alt.getValue();
|
||||
alt_diff_cur = alt_diff.getValue();
|
||||
alt_diff_cur = dmc.DMController.DMCs[1].outputs[7].getValue();
|
||||
if (alt_diff_cur >= -565 and alt_diff_cur <= 565) {
|
||||
me["ALT_target"].setTranslation(0, (alt_diff_cur / 100) * -48.66856);
|
||||
me["ALT_target_digit"].setText(sprintf("%03d", math.round(ap_alt_cur / 100)));
|
||||
|
|
|
@ -13,11 +13,12 @@ var DMC = {
|
|||
d.airspeeds = [props.globals.getNode("/systems/navigation/adr/output/cas-1", 1), props.globals.getNode("/systems/navigation/adr/output/cas-2", 1), props.globals.getNode("/systems/navigation/adr/output/cas-3", 1)];
|
||||
d.altitudes = [props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-1-capt", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-2-capt", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-3-capt", 1)];
|
||||
d.machs = [props.globals.getNode("/systems/navigation/adr/output/mach-1", 1), props.globals.getNode("/systems/navigation/adr/output/mach-2", 1), props.globals.getNode("/systems/navigation/adr/output/mach-3", 1)];
|
||||
d.altitudesPfd = [props.globals.getNode("instrumentation/altimeter[0]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[1]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[2]/indicated-altitude-ft-pfd", 1)];
|
||||
d.altitudesPfd = [props.globals.getNode("/instrumentation/altimeter[0]/indicated-altitude-ft-pfd", 1), props.globals.getNode("/instrumentation/altimeter[1]/indicated-altitude-ft-pfd", 1), props.globals.getNode("/instrumentation/altimeter[2]/indicated-altitude-ft-pfd", 1)];
|
||||
d.sats = [props.globals.getNode("/systems/navigation/adr/output/sat-1", 1), props.globals.getNode("/systems/navigation/adr/output/sat-2", 1), props.globals.getNode("/systems/navigation/adr/output/sat-3", 1)];
|
||||
d.tats = [props.globals.getNode("/systems/navigation/adr/output/tat-1", 1), props.globals.getNode("/systems/navigation/adr/output/tat-2", 1), props.globals.getNode("/systems/navigation/adr/output/tat-3", 1)];
|
||||
d.trends = [props.globals.getNode("instrumentation/pfd/speed-lookahead-1", 1), props.globals.getNode("instrumentation/pfd/speed-lookahead-2", 1), props.globals.getNode("instrumentation/pfd/speed-lookahead-3", 1)];
|
||||
d.outputs = [nil, nil, nil, nil, nil, nil, nil]; # airspeed, altitude, mach, pfd altitude, sat, tat, speed trend
|
||||
d.trends = [props.globals.getNode("/instrumentation/pfd/speed-lookahead-1", 1), props.globals.getNode("/instrumentation/pfd/speed-lookahead-2", 1), props.globals.getNode("/instrumentation/pfd/speed-lookahead-3", 1)];
|
||||
d.altitudeDiffs = [props.globals.getNode("//instrumentation/pfd/alt-diff[0]", 1), props.globals.getNode("//instrumentation/pfd/alt-diff[1]", 1), props.globals.getNode("//instrumentation/pfd/alt-diff[2]", 1)];
|
||||
d.outputs = [nil, nil, nil, nil, nil, nil, nil, nil]; # airspeed, altitude, mach, pfd altitude, sat, tat, speed trend, altitudeDiffs
|
||||
return d;
|
||||
},
|
||||
changeActiveADIRS: func(newADIRS) {
|
||||
|
@ -32,6 +33,7 @@ var DMC = {
|
|||
me.outputs[4] = me.sats[ADIRS];
|
||||
me.outputs[5] = me.tats[ADIRS];
|
||||
me.outputs[6] = me.trends[ADIRS];
|
||||
me.outputs[7] = me.altitudeDiffs[ADIRS];
|
||||
},
|
||||
setOutputsNil: func() {
|
||||
me.outputs[0] = nil;
|
||||
|
@ -41,6 +43,7 @@ var DMC = {
|
|||
me.outputs[4] = nil;
|
||||
me.outputs[5] = nil;
|
||||
me.outputs[6] = nil;
|
||||
me.outputs[7] = nil;
|
||||
},
|
||||
update: func() {
|
||||
if (systems.ADIRS.ADIRunits[me.activeADIRS].operative and systems.ADIRS.ADIRunits[me.activeADIRS].outputOn) {
|
||||
|
@ -71,8 +74,8 @@ var DMController = {
|
|||
|
||||
# update DMC2 to correct properties for first officer PFD
|
||||
me.DMCs[1].altitudes = [props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-1-fo", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-2-fo", 1), props.globals.getNode("/systems/navigation/adr/output/baro-alt-corrected-3-fo", 1)];
|
||||
me.DMCs[1].altitudesPfd = [props.globals.getNode("instrumentation/altimeter[3]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[4]/indicated-altitude-ft-pfd", 1), props.globals.getNode("instrumentation/altimeter[5]/indicated-altitude-ft-pfd", 1)];
|
||||
|
||||
me.DMCs[1].altitudesPfd = [props.globals.getNode("/instrumentation/altimeter[3]/indicated-altitude-ft-pfd", 1), props.globals.getNode("/instrumentation/altimeter[4]/indicated-altitude-ft-pfd", 1), props.globals.getNode("/instrumentation/altimeter[5]/indicated-altitude-ft-pfd", 1)];
|
||||
me.DMCs[1].altitudeDiffs = [props.globals.getNode("//instrumentation/pfd/alt-diff[3]", 1), props.globals.getNode("//instrumentation/pfd/alt-diff[4]", 1), props.globals.getNode("//instrumentation/pfd/alt-diff[5]", 1)];
|
||||
me._init = 1;
|
||||
}
|
||||
},
|
||||
|
|
|
@ -180,7 +180,7 @@ 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("NO METAR 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"),
|
||||
|
|
|
@ -383,4 +383,25 @@ foreach (var name; keys(input)) {
|
|||
emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 Libraries", name, input[name]));
|
||||
}
|
||||
|
||||
# TODO split EFIS altimeters
|
||||
var newinhg = nil;
|
||||
setlistener("/instrumentation/altimeter/setting-inhg", func() {
|
||||
newinhg = getprop("/instrumentation/altimeter/setting-inhg");
|
||||
setprop("/instrumentation/altimeter[1]/setting-inhg", newinhg);
|
||||
setprop("/instrumentation/altimeter[2]/setting-inhg", newinhg);
|
||||
setprop("/instrumentation/altimeter[3]/setting-inhg", newinhg);
|
||||
setprop("/instrumentation/altimeter[4]/setting-inhg", newinhg);
|
||||
setprop("/instrumentation/altimeter[5]/setting-inhg", newinhg);
|
||||
}, 0, 0);
|
||||
|
||||
var newhpa = nil;
|
||||
setlistener("/instrumentation/altimeter/setting-hpa", func() {
|
||||
newhpa = getprop("/instrumentation/altimeter/setting-hpa");
|
||||
setprop("/instrumentation/altimeter[1]/setting-hpa", newhpa);
|
||||
setprop("/instrumentation/altimeter[2]/setting-hpa", newhpa);
|
||||
setprop("/instrumentation/altimeter[3]/setting-hpa", newhpa);
|
||||
setprop("/instrumentation/altimeter[4]/setting-hpa", newhpa);
|
||||
setprop("/instrumentation/altimeter[5]/setting-hpa", newhpa);
|
||||
}, 0, 0);
|
||||
|
||||
setprop("/systems/acconfig/libraries-loaded", 1);
|
||||
|
|
|
@ -168,12 +168,12 @@ var AOC = {
|
|||
|
||||
var serverString = "";
|
||||
if (me.server.getValue() == "vatsim") {
|
||||
serverString = "https://api.flybywiresim.com/metar?source=vatsim&icao=";
|
||||
serverString = "https://api.flybywiresim.com/metar/" ~ airport ~ "?source=vatsim";
|
||||
} else {
|
||||
serverString = defaultServer;
|
||||
serverString = defaultServer ~ airport;
|
||||
}
|
||||
|
||||
http.load(serverString ~ airport)
|
||||
http.load(serverString)
|
||||
.fail(func(r) me.downloadFail(i, r))
|
||||
.done(func(r) {
|
||||
var errs = [];
|
||||
|
@ -212,7 +212,23 @@ var AOC = {
|
|||
},
|
||||
processMETAR: func(r, i) {
|
||||
var raw = r.response;
|
||||
if (find('"statusCode":404',raw) != -1) {
|
||||
me.received = 0;
|
||||
me.sent = 0;
|
||||
mcdu.mcdu_message(i, "NO METAR AVAILABLE");
|
||||
return;
|
||||
}
|
||||
|
||||
if (me.server.getValue() == "vatsim") {
|
||||
if (find("metar", raw) != -1) {
|
||||
raw = split('"metar":"', raw)[1];
|
||||
raw = split('","source":"Vatsim"}', raw)[0];
|
||||
} else {
|
||||
me.received = 0;
|
||||
me.sent = 0;
|
||||
mcdu.mcdu_message(i, "BAD SERVER RESPONSE");
|
||||
return;
|
||||
}
|
||||
me.lastMETAR = raw;
|
||||
} else if (find("<raw_text>", raw) != -1) {
|
||||
raw = split("<raw_text>", raw)[1];
|
||||
|
@ -330,7 +346,7 @@ var ATIS = {
|
|||
},
|
||||
processATIS: func(r, i) {
|
||||
var raw = r.response;
|
||||
if (r.response == "FBW_ERROR: D-ATIS not available at this airport" or find("atis not avail",r.response) != -1 or find('"statusCode":404',r.response) != -1) {
|
||||
if (raw == "FBW_ERROR: D-ATIS not available at this airport" or find("atis not avail",raw) != -1 or find('"statusCode":404',raw) != -1) {
|
||||
me.received = 0;
|
||||
me.sent = 0;
|
||||
mcdu.mcdu_message(i,"NO D-ATIS AVAILABLE");
|
||||
|
|
|
@ -2137,37 +2137,25 @@
|
|||
<condition>
|
||||
<and>
|
||||
<or>
|
||||
<and>
|
||||
<and>
|
||||
<greater-than>
|
||||
<property>/fdm/jsbsim/fcs/left-brake-cmd-norm</property>
|
||||
<value>0.95</value>
|
||||
</greater-than>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/gear/gear[0]/wow</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</or>
|
||||
<equals>
|
||||
<property>/gear/gear[1]/wow</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</and>
|
||||
<and>
|
||||
<greater-than>
|
||||
<property>/fdm/jsbsim/fcs/right-brake-cmd-norm</property>
|
||||
<value>0.95</value>
|
||||
</greater-than>
|
||||
<or>
|
||||
<equals>
|
||||
<property>/gear/gear[0]/wow</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</or>
|
||||
<equals>
|
||||
<property>/gear/gear[2]/wow</property>
|
||||
<value>1</value>
|
||||
</equals>
|
||||
</and>
|
||||
</or>
|
||||
<greater-than>
|
||||
|
|
|
@ -136,9 +136,79 @@
|
|||
<property>/it-autoflight/internal/alt</property>
|
||||
</input>
|
||||
<reference>
|
||||
<property>/instrumentation/altimeter/indicated-altitude-ft</property>
|
||||
<property>/instrumentation/altimeter[0]/indicated-altitude-ft</property>
|
||||
</reference>
|
||||
<output>/instrumentation/pfd/alt-diff</output>
|
||||
<output>/instrumentation/pfd/alt-diff[0]</output>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<name>Altitude bug diff</name>
|
||||
<type>gain</type>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<gain>1.0</gain>
|
||||
<input>
|
||||
<property>/it-autoflight/internal/alt</property>
|
||||
</input>
|
||||
<reference>
|
||||
<property>/instrumentation/altimeter[1]/indicated-altitude-ft</property>
|
||||
</reference>
|
||||
<output>/instrumentation/pfd/alt-diff[1]</output>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<name>Altitude bug diff</name>
|
||||
<type>gain</type>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<gain>1.0</gain>
|
||||
<input>
|
||||
<property>/it-autoflight/internal/alt</property>
|
||||
</input>
|
||||
<reference>
|
||||
<property>/instrumentation/altimeter[2]/indicated-altitude-ft</property>
|
||||
</reference>
|
||||
<output>/instrumentation/pfd/alt-diff[2]</output>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<name>Altitude bug diff</name>
|
||||
<type>gain</type>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<gain>1.0</gain>
|
||||
<input>
|
||||
<property>/it-autoflight/internal/alt</property>
|
||||
</input>
|
||||
<reference>
|
||||
<property>/instrumentation/altimeter[3]/indicated-altitude-ft</property>
|
||||
</reference>
|
||||
<output>/instrumentation/pfd/alt-diff[3]</output>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<name>Altitude bug diff</name>
|
||||
<type>gain</type>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<gain>1.0</gain>
|
||||
<input>
|
||||
<property>/it-autoflight/internal/alt</property>
|
||||
</input>
|
||||
<reference>
|
||||
<property>/instrumentation/altimeter[4]/indicated-altitude-ft</property>
|
||||
</reference>
|
||||
<output>/instrumentation/pfd/alt-diff[4]</output>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<name>Altitude bug diff</name>
|
||||
<type>gain</type>
|
||||
<update-interval-secs type="double">0.05</update-interval-secs>
|
||||
<gain>1.0</gain>
|
||||
<input>
|
||||
<property>/it-autoflight/internal/alt</property>
|
||||
</input>
|
||||
<reference>
|
||||
<property>/instrumentation/altimeter[5]/indicated-altitude-ft</property>
|
||||
</reference>
|
||||
<output>/instrumentation/pfd/alt-diff[5]</output>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
|
|
Loading…
Add table
Reference in a new issue