Merge branch 'dev' into 3D
This commit is contained in:
commit
30d7d2841a
10 changed files with 1923 additions and 2199 deletions
|
@ -871,6 +871,7 @@
|
|||
<du4 type="double">1</du4>
|
||||
<du5 type="double">1</du5>
|
||||
<du6 type="double">1</du6>
|
||||
<iesi type="double">1</iesi>
|
||||
<mcdu1 type="double">1</mcdu1>
|
||||
<mcdu2 type="double">1</mcdu2>
|
||||
<dcdul type="double">1</dcdul>
|
||||
|
@ -1615,6 +1616,10 @@
|
|||
<range type="double">1.0</range>
|
||||
</groundradar>
|
||||
|
||||
<iesi>
|
||||
<att-reset-cmd type="bool">false</att-reset-cmd>
|
||||
</iesi>
|
||||
|
||||
<marker-beacon n="0">
|
||||
<serviceable type="bool">true</serviceable>
|
||||
</marker-beacon>
|
||||
|
|
|
@ -7235,7 +7235,129 @@
|
|||
<object-name>iesi_btn_plus</object-name>
|
||||
<object-name>iesi_btn_rst</object-name>
|
||||
</effect>
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>iesi_btn_rst</object-name>
|
||||
<action>
|
||||
<button>0</button>
|
||||
<repeatable>false</repeatable>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/instrumentation/iesi/att-reset-cmd</property>
|
||||
<value>1</value>
|
||||
</binding>
|
||||
<mod-up>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/instrumentation/iesi/att-reset-cmd</property>
|
||||
<value>0</value>
|
||||
</binding>
|
||||
</mod-up>
|
||||
</action>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>translate</type>
|
||||
<object-name>iesi_btn_rst</object-name>
|
||||
<property>/instrumentation/iesi/att-reset-cmd</property>
|
||||
<factor>0.0025</factor>
|
||||
<axis>
|
||||
<x1-m>-0.53312</x1-m>
|
||||
<y1-m>-0.16166</y1-m>
|
||||
<z1-m>0.16956</z1-m>
|
||||
<x2-m>-0.53977</x2-m>
|
||||
<y2-m>-0.16166</y2-m>
|
||||
<z2-m>0.16765</z2-m>
|
||||
</axis>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>iesi_btn_plus</object-name>
|
||||
<action>
|
||||
<button>0</button>
|
||||
<repeatable>true</repeatable>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/instrumentation/iesi/plus</property>
|
||||
<value>1</value>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>property-adjust</command>
|
||||
<property>controls/lighting/DU/iesi</property>
|
||||
<step>0.05</step>
|
||||
<min>0</min>
|
||||
<max>1</max>
|
||||
</binding>
|
||||
<mod-up>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/instrumentation/iesi/plus</property>
|
||||
<value>0</value>
|
||||
</binding>
|
||||
</mod-up>
|
||||
</action>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>translate</type>
|
||||
<object-name>iesi_btn_plus</object-name>
|
||||
<property>/instrumentation/iesi/plus</property>
|
||||
<factor>0.0025</factor>
|
||||
<axis>
|
||||
<x1-m>-0.53312</x1-m>
|
||||
<y1-m>-0.16166</y1-m>
|
||||
<z1-m>0.16956</z1-m>
|
||||
<x2-m>-0.53977</x2-m>
|
||||
<y2-m>-0.16166</y2-m>
|
||||
<z2-m>0.16765</z2-m>
|
||||
</axis>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>iesi_btn_minus</object-name>
|
||||
<action>
|
||||
<button>0</button>
|
||||
<repeatable>true</repeatable>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/instrumentation/iesi/minus</property>
|
||||
<value>1</value>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>property-adjust</command>
|
||||
<property>controls/lighting/DU/iesi</property>
|
||||
<step>-0.05</step>
|
||||
<min>0</min>
|
||||
<max>1</max>
|
||||
</binding>
|
||||
<mod-up>
|
||||
<binding>
|
||||
<command>property-assign</command>
|
||||
<property>/instrumentation/iesi/minus</property>
|
||||
<value>0</value>
|
||||
</binding>
|
||||
</mod-up>
|
||||
</action>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>translate</type>
|
||||
<object-name>iesi_btn_minus</object-name>
|
||||
<property>/instrumentation/iesi/minus</property>
|
||||
<factor>0.0025</factor>
|
||||
<axis>
|
||||
<x1-m>-0.53312</x1-m>
|
||||
<y1-m>-0.16166</y1-m>
|
||||
<z1-m>0.16956</z1-m>
|
||||
<x2-m>-0.53977</x2-m>
|
||||
<y2-m>-0.16166</y2-m>
|
||||
<z2-m>0.16765</z2-m>
|
||||
</axis>
|
||||
</animation>
|
||||
|
||||
<effect>
|
||||
<inherits-from>Aircraft/A320-family/Models/Effects/clock</inherits-from>
|
||||
<!-- <object-name>clock</object-name>-->
|
||||
|
|
|
@ -13,16 +13,16 @@ var mach_act = 0;
|
|||
|
||||
# props.nas nodes
|
||||
var iesi_init = props.globals.initNode("/instrumentation/iesi/iesi-init", 0, "BOOL");
|
||||
var iesi_time = props.globals.initNode("/instrumentation/iesi/iesi-init-time", 0.0, "DOUBLE");
|
||||
var iesi_reset = props.globals.initNode("/instrumentation/iesi/att-reset", 0, "DOUBLE");
|
||||
var iesi_brt = props.globals.getNode("/controls/lighting/DU/iesi", 1);
|
||||
var iesi_rate = props.globals.getNode("/systems/acconfig/options/iesi-rate", 1);
|
||||
var et = props.globals.getNode("/sim/time/elapsed-sec", 1);
|
||||
var aconfig = props.globals.getNode("/systems/acconfig/autoconfig-running", 1);
|
||||
|
||||
var airspeed = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-speed-kt", 1);
|
||||
var mach = props.globals.getNode("/instrumentation/airspeed-indicator/indicated-mach", 1);
|
||||
var pitch = props.globals.getNode("/orientation/pitch-deg", 1);
|
||||
var roll = props.globals.getNode("/orientation/roll-deg", 1);
|
||||
var skid = props.globals.getNode("/instrumentation/slip-skid-ball/indicated-slip-skid", 1);
|
||||
var pitch = props.globals.getNode("/instrumentation/iesi/pitch-deg", 1);
|
||||
var skid = props.globals.getNode("/instrumentation/iesi/slip-skid", 1);
|
||||
var altitude = props.globals.getNode("/instrumentation/altimeter/indicated-altitude-ft", 1);
|
||||
var altitude_ind = props.globals.getNode("/instrumentation/altimeter/indicated-altitude-ft-pfd", 1);
|
||||
|
||||
|
@ -30,6 +30,8 @@ var altimeter_mode = props.globals.getNode("/instrumentation/altimeter[0]/std",
|
|||
var qnh_hpa = props.globals.getNode("/instrumentation/altimeter/setting-hpa", 1);
|
||||
var qnh_inhg = props.globals.getNode("/instrumentation/altimeter/setting-inhg", 1);
|
||||
|
||||
var _IESITime = 0;
|
||||
|
||||
var canvas_IESI_base = {
|
||||
init: func(canvas_group, file) {
|
||||
var font_mapper = func(family, weight) {
|
||||
|
@ -66,6 +68,10 @@ var canvas_IESI_base = {
|
|||
me.AI_horizon_trans = me["AI_horizon"].createTransform();
|
||||
me.AI_horizon_rot = me["AI_horizon"].createTransform();
|
||||
|
||||
me._showIESI = 0;
|
||||
me._fast = 0;
|
||||
_IESITime = 0.0;
|
||||
|
||||
me.page = canvas_group;
|
||||
|
||||
return me;
|
||||
|
@ -75,19 +81,42 @@ var canvas_IESI_base = {
|
|||
},
|
||||
update: func() {
|
||||
cur_time = et.getValue();
|
||||
# todo consider relay 7XB for power of DC HOT 1
|
||||
# todo transient max 0.2s
|
||||
# todo 20W power consumption
|
||||
if (iesi_reset.getValue() == 1) {
|
||||
if (iesi_init.getBoolValue() and _IESITime + 90 >= et.getValue()) {
|
||||
me._fast = 1;
|
||||
} else {
|
||||
me._fast = 0;
|
||||
}
|
||||
iesi_init.setBoolValue(0);
|
||||
}
|
||||
|
||||
if (systems.ELEC.Bus.dcEss.getValue() >= 25 or (systems.ELEC.Bus.dcHot1.getValue() >= 25 and airspeed.getValue() >= 50 and cur_time >= 5)) {
|
||||
IESI.page.show();
|
||||
me._showIESI = 1;
|
||||
IESI.update();
|
||||
|
||||
if (aconfig.getValue() != 1 and iesi_init.getValue() != 1) {
|
||||
iesi_init.setBoolValue(1);
|
||||
iesi_time.setValue(cur_time);
|
||||
if (me._fast) {
|
||||
_IESITime = cur_time - 80;
|
||||
me._fast = 0;
|
||||
} else {
|
||||
_IESITime = cur_time;
|
||||
}
|
||||
} else if (aconfig.getValue() == 1 and iesi_init.getValue() != 1) {
|
||||
iesi_init.setBoolValue(1);
|
||||
iesi_time.setValue(cur_time - 87);
|
||||
_IESITime = cur_time - 87;
|
||||
}
|
||||
} else {
|
||||
me._showIESI = 0;
|
||||
iesi_init.setBoolValue(0);
|
||||
}
|
||||
|
||||
if (me._showIESI and iesi_brt.getValue() > 0.01) {
|
||||
IESI.page.show();
|
||||
} else {
|
||||
IESI.page.hide();
|
||||
}
|
||||
},
|
||||
|
@ -98,14 +127,20 @@ var canvas_IESI = {
|
|||
var m = {parents: [canvas_IESI, canvas_IESI_base]};
|
||||
m.init(canvas_group, file);
|
||||
m._cachedInhg = -99;
|
||||
|
||||
m._machWasAbove50 = 0;
|
||||
m._roll = 0;
|
||||
return m;
|
||||
},
|
||||
getKeys: func() {
|
||||
return ["IESI","IESI_Init","ASI_scale","ASI_mach","ASI_mach_decimal","AI_center","AI_horizon","AI_bank","AI_slipskid","ALT_scale","ALT_one","ALT_two","ALT_three","ALT_four","ALT_five","ALT_digits","ALT_tens","ALT_meters","QNH_setting","QNH_std"];
|
||||
return ["IESI","IESI_Init","ASI_scale","ASI_mach","ASI_mach_decimal","AI_center","AI_horizon","AI_bank","AI_slipskid","ALT_scale","ALT_one","ALT_two","ALT_three","ALT_four","ALT_five","ALT_digits","ALT_tens","ALT_meters","QNH_setting","QNH_std","negText","negText2","AI_bank_scale"];
|
||||
},
|
||||
update: func() {
|
||||
if (iesi_time.getValue() + 90 >= et.getValue()) {
|
||||
if (qnh_inhg.getValue() != me._cachedInhg) {
|
||||
me._cachedInhg = qnh_inhg.getValue();
|
||||
me.updateQNH();
|
||||
}
|
||||
|
||||
if (_IESITime + 90 >= et.getValue()) {
|
||||
me["IESI"].hide();
|
||||
me["IESI_Init"].show();
|
||||
return;
|
||||
|
@ -115,22 +150,27 @@ var canvas_IESI = {
|
|||
}
|
||||
|
||||
# Airspeed
|
||||
# Subtract 30, since the scale starts at 30, but don"t allow less than 0, or more than 420 situations
|
||||
# Subtract 30, since the scale starts at 30, but don't allow less than 0, or more than 520 knots
|
||||
airspeed_act = airspeed.getValue();
|
||||
mach_act = mach.getValue();
|
||||
if (airspeed_act <= 30) {
|
||||
ASI = 0;
|
||||
} else if (airspeed_act >= 420) {
|
||||
ASI = 390;
|
||||
} else if (airspeed_act >= 520) {
|
||||
ASI = 490;
|
||||
} else {
|
||||
ASI = airspeed_act - 30;
|
||||
}
|
||||
me["ASI_scale"].setTranslation(0, ASI * 8.295);
|
||||
|
||||
if (mach_act >= 0.5) {
|
||||
me._machWasAbove50 = 1;
|
||||
me["ASI_mach_decimal"].show();
|
||||
me["ASI_mach"].show();
|
||||
} elsif (mach_act >= 0.45 and me._machWasAbove50) {
|
||||
me["ASI_mach_decimal"].show();
|
||||
me["ASI_mach"].show();
|
||||
} else {
|
||||
me._machWasAbove50 = 0;
|
||||
me["ASI_mach_decimal"].hide();
|
||||
me["ASI_mach"].hide();
|
||||
}
|
||||
|
@ -142,14 +182,29 @@ var canvas_IESI = {
|
|||
}
|
||||
|
||||
# Attitude
|
||||
me._roll = pts.Orientation.roll.getValue();
|
||||
me.AI_horizon_trans.setTranslation(0, pitch.getValue() * 16.74);
|
||||
me.AI_horizon_rot.setRotation(-roll.getValue() * D2R, me["AI_center"].getCenter());
|
||||
me.AI_horizon_rot.setRotation(me._roll * D2R, me["AI_center"].getCenter());
|
||||
|
||||
me["AI_slipskid"].setTranslation(math.clamp(skid.getValue(), -7, 7) * -15, 0);
|
||||
me["AI_bank"].setRotation(-roll.getValue() * D2R);
|
||||
me["AI_slipskid"].setTranslation(skid.getValue(), 0);
|
||||
me["AI_bank"].setRotation(me._roll * D2R);
|
||||
|
||||
# Altitude
|
||||
me.altitude = altitude.getValue();
|
||||
if (me.altitude > 50000) {
|
||||
me.altitude = 50000;
|
||||
} elsif (me.altitude < -2000) {
|
||||
me.altitude = -2000;
|
||||
}
|
||||
|
||||
if (me.altitude < 0) {
|
||||
me["negText"].show();
|
||||
me["negText2"].show();
|
||||
} else {
|
||||
me["negText"].hide();
|
||||
me["negText2"].hide();
|
||||
}
|
||||
|
||||
me.altOffset = me.altitude / 500 - int(me.altitude / 500);
|
||||
me.middleAltText = roundaboutAlt(me.altitude / 100);
|
||||
me.middleAltOffset = nil;
|
||||
|
@ -166,15 +221,17 @@ var canvas_IESI = {
|
|||
me["ALT_two"].setText(sprintf("%03d", abs(me.middleAltText-5)));
|
||||
me["ALT_one"].setText(sprintf("%03d", abs(me.middleAltText-10)));
|
||||
|
||||
me["ALT_digits"].setText(sprintf("%s", altitude_ind.getValue()));
|
||||
me["ALT_meters"].setText(sprintf("%5.0f", me.altitude * 0.3048));
|
||||
altTens = num(right(sprintf("%02d", altitude.getValue()), 2));
|
||||
me["ALT_tens"].setTranslation(0, altTens * 3.16);
|
||||
|
||||
if (qnh_inhg.getValue() != me._cachedInhg) {
|
||||
me._cachedInhg = qnh_inhg.getValue();
|
||||
me.updateQNH();
|
||||
me.altitudeText = altitude_ind.getValue();
|
||||
if (me.altitude < 0 and me.altitudeText > 20) {
|
||||
me.altitudeText = 20;
|
||||
} elsif (me.altitude > 0 and me.altitudeText > 500) {
|
||||
me.altitudeText = 500;
|
||||
}
|
||||
|
||||
me["ALT_digits"].setText(sprintf("%s", me.altitudeText));
|
||||
me["ALT_meters"].setText(sprintf("%5.0f", math.round(me.altitude * 0.3048, 10)));
|
||||
altTens = num(right(sprintf("%02d", me.altitude), 2));
|
||||
me["ALT_tens"].setTranslation(0, altTens * 3.16);
|
||||
},
|
||||
updateQNH: func() {
|
||||
if (altimeter_mode.getBoolValue()) {
|
||||
|
@ -231,4 +288,4 @@ var roundabout = func(x) {
|
|||
var roundaboutAlt = func(x) {
|
||||
var y = x * 0.2 - int(x * 0.2);
|
||||
return y < 0.5 ? 5 * int(x * 0.2) : 5 + 5 * int(x * 0.2);
|
||||
};
|
||||
};
|
|
@ -19,15 +19,15 @@
|
|||
</action>
|
||||
</animation>
|
||||
|
||||
<!--animation>
|
||||
<animation>
|
||||
<type>material</type>
|
||||
<object-name>pfd1.screen</object-name>
|
||||
<object-name>iesi.screen</object-name>
|
||||
<emission>
|
||||
<red>1</red>
|
||||
<green>1</green>
|
||||
<blue>1</blue>
|
||||
<factor-prop>controls/lighting/DU/iesi</factor-prop>
|
||||
</emission>
|
||||
</animation-->
|
||||
</animation>
|
||||
|
||||
</PropertyList>
|
||||
|
|
File diff suppressed because it is too large
Load diff
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 113 KiB |
|
@ -36,7 +36,7 @@ var thr2 = props.globals.getNode("/controls/engines/engine[1]/throttle-pos", 1);
|
|||
var wow0 = props.globals.getNode("/gear/gear[0]/wow");
|
||||
var wow1 = props.globals.getNode("/gear/gear[1]/wow");
|
||||
var wow2 = props.globals.getNode("/gear/gear[2]/wow");
|
||||
var pitch = props.globals.getNode("/orientation/pitch-deg", 1);
|
||||
var pitch = props.globals.getNode("/instrumentation/pfd/pitch-deg-non-linear", 1);
|
||||
var roll = props.globals.getNode("/orientation/roll-deg", 1);
|
||||
var elapsedtime = props.globals.getNode("/sim/time/elapsed-sec", 1);
|
||||
var du1_lgt = props.globals.getNode("/controls/lighting/DU/du1", 1);
|
||||
|
|
File diff suppressed because it is too large
Load diff
Before Width: | Height: | Size: 369 KiB After Width: | Height: | Size: 339 KiB |
|
@ -14,7 +14,14 @@ var SimbriefParser = {
|
|||
var stamp = systime();
|
||||
http.save("https://www.simbrief.com/api/xml.fetcher.php?username=" ~ username, getprop('/sim/fg-home') ~ "/Export/A320-family-simbrief.xml")
|
||||
.fail(func me.failure(i))
|
||||
.done(func me.read(getprop('/sim/fg-home') ~ "/Export/A320-family-simbrief.xml", i));
|
||||
.done(func {
|
||||
var errs = [];
|
||||
call(me.read, [(getprop('/sim/fg-home') ~ "/Export/A320-family-simbrief.xml"),i], SimbriefParser, {}, errs);
|
||||
if (size(errs) > 0) {
|
||||
debug.printerror(errs);
|
||||
me.failure(i);
|
||||
}
|
||||
});
|
||||
},
|
||||
failure: func(i) {
|
||||
mcdu.mcdu_message(i, "SIMBRIEF DOWNLOAD FAILED");
|
||||
|
@ -25,141 +32,198 @@ var SimbriefParser = {
|
|||
if (data != nil) {
|
||||
if (data.getChild("OFP") == nil) {
|
||||
print("XML file " ~ xml ~ " not a valid Simbrief file");
|
||||
me.failure(i);
|
||||
return;
|
||||
} else {
|
||||
me.node = data;
|
||||
me.parseOFP();
|
||||
mcdu.mcdu_message(i, "AOC ACT F-PLN UPLINK");
|
||||
if (me.parseOFP() == nil) {
|
||||
print("Failure to parse Simbrief OFP");
|
||||
me.failure(i);
|
||||
} else {
|
||||
mcdu.mcdu_message(i, "AOC ACT F-PLN UPLINK");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print("Error reading " ~ xml);
|
||||
me.failure(i);
|
||||
}
|
||||
},
|
||||
tryFindByCoord: func(coords, id, type) {
|
||||
var result = nil;
|
||||
if (type == "nav") {
|
||||
result = findNavaidsByID(id);
|
||||
} elsif (type == "fix") {
|
||||
result = findFixesByID(id);
|
||||
} else {
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (size(result) == 0) { return nil; }
|
||||
foreach (var test; result) {
|
||||
if (math.abs(test.lat - coords.lat()) < 0.01666666666 and math.abs(test.lon - coords.lon()) < 0.01666666666) {
|
||||
return test;
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
},
|
||||
buildFlightplan: func() {
|
||||
# Flightplan stuff
|
||||
fmgc.flightPlanController.flightplans[3] = createFlightplan();
|
||||
fmgc.flightPlanController.flightplans[3].cleanPlan();
|
||||
|
||||
# INITA
|
||||
var departureID = me.OFP.getNode("origin/icao_code").getValue();
|
||||
var departures = findAirportsByICAO(departureID);
|
||||
var destinationID = me.OFP.getNode("destination/icao_code").getValue();
|
||||
var destinations = findAirportsByICAO(destinationID);
|
||||
|
||||
if (departures != nil and size(departures) != 0 and destinations != nil and size(destinations) != 0) {
|
||||
fmgc.flightPlanController.flightplans[3].departure = departures[0];
|
||||
fmgc.flightPlanController.flightplans[3].destination = destinations[0];
|
||||
fmgc.FMGCInternal.arrApt = destinationID;
|
||||
fmgc.FMGCInternal.depApt = departureID;
|
||||
|
||||
fmgc.FMGCInternal.toFromSet = 1;
|
||||
fmgc.FMGCNodes.toFromSet.setValue(1);
|
||||
|
||||
fmgc.updateArptLatLon();
|
||||
fmgc.updateARPT();
|
||||
} else {
|
||||
me.cleanupInvalid();
|
||||
return nil;
|
||||
}
|
||||
|
||||
var runwayStore = departures[0].runways[me.OFP.getNode("origin/plan_rwy").getValue()];
|
||||
if (runwayStore != nil) {
|
||||
fmgc.flightPlanController.flightplans[3].departure_runway = runwayStore;
|
||||
}
|
||||
|
||||
runwayStore = destinations[0].runways[me.OFP.getNode("destination/plan_rwy").getValue()];
|
||||
if (runwayStore != nil) {
|
||||
fmgc.flightPlanController.flightplans[3].destination_runway = runwayStore;
|
||||
}
|
||||
|
||||
var alternateID = me.OFP.getNode("alternate/icao_code").getValue();
|
||||
var alternates = findAirportsByICAO(alternateID);
|
||||
if (alternates != nil and size(alternates) != 0) {
|
||||
fmgc.FMGCInternal.altAirport = alternateID;
|
||||
fmgc.FMGCInternal.altAirportSet = 1;
|
||||
}
|
||||
|
||||
var wps = [];
|
||||
var ofpNavlog = me.OFP.getNode("navlog");
|
||||
var ofpFixes = ofpNavlog.getChildren("fix");
|
||||
var ident = "";
|
||||
var coords = nil;
|
||||
var wp = nil;
|
||||
var _foundSID = 0;
|
||||
var _foundSTAR = 0;
|
||||
var _foundTOC = 0;
|
||||
var _foundTOD = 0;
|
||||
var _sid = nil;
|
||||
var _star = nil;
|
||||
|
||||
foreach (var ofpFix; ofpFixes) {
|
||||
if (ofpFix.getNode("is_sid_star").getBoolValue()) {
|
||||
if (!_foundSID) {
|
||||
_sid = fmgc.flightPlanController.flightplans[3].departure.getSid(ofpFix.getNode("via_airway").getValue());
|
||||
if (_sid != nil) {
|
||||
_foundSID = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ofpFix.getNode("is_sid_star").getBoolValue()) {
|
||||
if (!_foundSTAR) {
|
||||
_star = fmgc.flightPlanController.flightplans[3].destination.getStar(ofpFix.getNode("via_airway").getValue());
|
||||
if (_star != nil) {
|
||||
_foundSTAR = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ofpFix.getNode("is_sid_star").getBoolValue() and _foundSID and _foundSTAR) {
|
||||
continue;
|
||||
} # todo what happens if you don't find one but find the other
|
||||
|
||||
ident = ofpFix.getNode("ident").getValue();
|
||||
if (find(departureID, ident) != -1 or find(destinationID, ident) != -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ident == "TOC") {
|
||||
_foundTOC = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ident == "TOD") {
|
||||
_foundTOC = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
coords = geo.Coord.new();
|
||||
coords.set_latlon(
|
||||
ofpFix.getNode("pos_lat").getValue(),
|
||||
ofpFix.getNode("pos_long").getValue());
|
||||
|
||||
wp = me.tryFindByCoord(coords,ident,"fix");
|
||||
wp = me.tryFindByCoord(coords,ident,"nav");
|
||||
if (wp == nil) {
|
||||
wp = createWP(coords, ident);
|
||||
}
|
||||
|
||||
append(wps, wp);
|
||||
}
|
||||
|
||||
fmgc.flightPlanController.flightplans[3].insertWaypoints(wps, 1);
|
||||
if (_sid != nil) {
|
||||
fmgc.flightPlanController.flightplans[3].sid = _sid;
|
||||
}
|
||||
if (_star != nil) {
|
||||
fmgc.flightPlanController.flightplans[3].star = _star;
|
||||
}
|
||||
fmgc.flightPlanController.destroyTemporaryFlightPlan(3, 1);
|
||||
fmgc.windController.updatePlans();
|
||||
fmgc.updateRouteManagerAlt();
|
||||
|
||||
return 1;
|
||||
},
|
||||
parseOFP: func() {
|
||||
me.OFP = me.node.getChild("OFP");
|
||||
me.store1 = nil;
|
||||
me.store2 = nil;
|
||||
|
||||
me.store1 = me.OFP.getChild("params");
|
||||
var units = me.store1.getChild("units").getValue();
|
||||
|
||||
me.store1 = me.OFP.getChild("general");
|
||||
me.store2 = me.OFP.getChild("alternate");
|
||||
fmgc.FMGCInternal.flightNum = (me.store1.getChild("icao_airline").getValue() or "") ~ (me.store1.getChild("flight_number").getValue() or "");
|
||||
if (me.buildFlightplan() == nil) {
|
||||
return nil;
|
||||
}
|
||||
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.store1.getChild("costindex").getValue();
|
||||
fmgc.FMGCInternal.costIndex = me.OFP.getNode("general/costindex").getValue();
|
||||
fmgc.FMGCInternal.costIndexSet = 1;
|
||||
fmgc.FMGCNodes.costIndex.setValue(fmgc.FMGCInternal.costIndex);
|
||||
fmgc.FMGCInternal.tropo = me.store1.getChild("avg_tropopause").getValue();
|
||||
fmgc.FMGCInternal.tropo = me.OFP.getNode("general/avg_tropopause").getValue();
|
||||
fmgc.FMGCInternal.tropoSet = 1;
|
||||
fmgc.FMGCInternal.crzFt = me.store1.getChild("initial_altitude").getValue();
|
||||
fmgc.FMGCInternal.crzFl = me.store1.getChild("initial_altitude").getValue() / 100;
|
||||
fmgc.altvert();
|
||||
fmgc.FMGCInternal.crzSet = 1;
|
||||
|
||||
# Set cruise altitude
|
||||
fmgc.FMGCInternal.crzFt = me.OFP.getNode("general/initial_altitude").getValue();
|
||||
fmgc.FMGCInternal.crzFl = fmgc.FMGCInternal.crzFt / 100;
|
||||
fmgc.FMGCInternal.crzTemp = (((fmgc.FMGCInternal.crzFt / 1000) * -2) + 15) + me.OFP.getNode("general/avg_temp_dev").getValue();
|
||||
fmgc.FMGCInternal.crzProg = fmgc.FMGCInternal.crzFt / 100;
|
||||
mcdu.updateCrzLvlCallback();
|
||||
fmgc.FMGCInternal.crzTemp = (((me.store1.getChild("initial_altitude").getValue() / 1000) * -2) + 15) + me.store1.getChild("avg_temp_dev").getValue();
|
||||
fmgc.FMGCInternal.crzTempSet = 1;
|
||||
fmgc.FMGCInternal.crzProg = me.store1.getChild("initial_altitude").getValue() / 100;
|
||||
if (num(me.store1.getChild("avg_wind_comp").getValue()) >= 0) {
|
||||
fmgc.FMGCInternal.tripWind = "TL" ~ abs(me.store1.getChild("avg_wind_comp").getValue());
|
||||
fmgc.FMGCInternal.crzSet = 1;
|
||||
fmgc.altvert();
|
||||
|
||||
var windComp = me.OFP.getNode("general/avg_wind_comp").getValue();
|
||||
if (num(windComp) >= 0) {
|
||||
fmgc.FMGCInternal.tripWind = "TL" ~ abs(windComp);
|
||||
} else {
|
||||
fmgc.FMGCInternal.tripWind = "HD" ~ abs(me.store1.getChild("avg_wind_comp").getValue());
|
||||
fmgc.FMGCInternal.tripWind = "HD" ~ abs(windComp);
|
||||
}
|
||||
fmgc.FMGCInternal.tripWindValue = abs(me.store1.getChild("avg_wind_comp").getValue());
|
||||
|
||||
fmgc.FMGCInternal.altAirport = me.store2.getChild("icao_code").getValue();
|
||||
fmgc.FMGCInternal.altAirportSet = 1;
|
||||
|
||||
# Flightplan stuff
|
||||
fmgc.flightPlanController.flightplans[3] = createFlightplan();
|
||||
|
||||
# INITA
|
||||
me.store1 = me.OFP.getChild("origin");
|
||||
me.store2 = me.OFP.getChild("destination");
|
||||
|
||||
fmgc.FMGCInternal.depApt = me.store1.getChild("icao_code").getValue();
|
||||
fmgc.FMGCInternal.arrApt = me.store2.getChild("icao_code").getValue();
|
||||
fmgc.FMGCInternal.toFromSet = 1;
|
||||
fmgc.FMGCNodes.toFromSet.setValue(1);
|
||||
fmgc.flightPlanController.flightplans[3].departure = airportinfo(fmgc.FMGCInternal.depApt);
|
||||
fmgc.flightPlanController.flightplans[3].destination = airportinfo(fmgc.FMGCInternal.arrApt);
|
||||
fmgc.FMGCInternal.altSelected = 0;
|
||||
fmgc.updateArptLatLon();
|
||||
fmgc.updateARPT();
|
||||
call(func() {
|
||||
fmgc.flightPlanController.flightplans[3].departure_runway = airportinfo(fmgc.FMGCInternal.depApt).runways[me.store1.getChild("plan_rwy").getValue()];
|
||||
fmgc.flightPlanController.flightplans[3].destination_runway = airportinfo(fmgc.FMGCInternal.arrApt).runways[me.store2.getChild("plan_rwy").getValue()];
|
||||
});
|
||||
|
||||
me.store1 = me.OFP.getChild("navlog").getChildren();
|
||||
if (size(me.store1) != 0) {
|
||||
var firstIsSID = 0;
|
||||
var SIDID = "";
|
||||
if (me.store1[0].getChild("is_sid_star").getValue() == 1) {
|
||||
if (fmgc.flightPlanController.flightplans[3].departure.getSid(me.store1[0].getChild("via_airway").getValue()) != nil) {
|
||||
firstIsSID = 1;
|
||||
SIDID = me.store1[0].getChild("via_airway").getValue();
|
||||
}
|
||||
}
|
||||
var lastIsSTAR = 0;
|
||||
var STARID = "";
|
||||
if (me.store1[-1].getChild("is_sid_star").getValue() == 1) {
|
||||
if (fmgc.flightPlanController.flightplans[3].destination.getStar(me.store1[-1].getChild("via_airway").getValue()) != nil) {
|
||||
lastIsSTAR = 1;
|
||||
STARID = me.store1[-1].getChild("via_airway").getValue();
|
||||
}
|
||||
}
|
||||
|
||||
var lastSIDIndex = -999;
|
||||
var firstSTARIndex = -999;
|
||||
var TOCinSIDflag = 0;
|
||||
var TODinSTARflag = 0;
|
||||
for (var i = 0; i < size(me.store1); i = i + 1) {
|
||||
if (firstIsSID) {
|
||||
if (me.store1[i].getChild("is_sid_star").getValue() == 0 or me.store1[i].getChild("via_airway").getValue() != SIDID) {
|
||||
lastSIDIndex = i - 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = lastSIDIndex == -999 ? 0 : lastSIDIndex; i < size(me.store1); i = i + 1) {
|
||||
if (STARID != "") {
|
||||
if (me.store1[i].getChild("is_sid_star").getValue() == 1 and me.store1[i].getChild("via_airway").getValue() == STARID) {
|
||||
firstSTARIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var max = firstSTARIndex == -999 ? size(me.store1) - 1 : firstSTARIndex - 1;
|
||||
for (var i = lastSIDIndex == -999 ? 0 : lastSIDIndex + 2; i < max; i = i + 1) {
|
||||
if (me.store1[i].getChild("ident").getValue() == "TOC" or me.store1[i].getChild("ident").getValue() == "TOD") { continue; }
|
||||
var coord = geo.Coord.new();
|
||||
coord.set_latlon(me.store1[i].getChild("pos_lat").getValue(), me.store1[i].getChild("pos_long").getValue());
|
||||
var fixes = findFixesByID(coord, me.store1[i].getChild("ident").getValue());
|
||||
var navaids = findNavaidsByID(coord, me.store1[i].getChild("ident").getValue());
|
||||
if (size(fixes) > 0) {
|
||||
fmgc.flightPlanController.flightplans[3].appendWP(createWPFrom(fixes[0]));
|
||||
} else if (size(navaids) > 0) {
|
||||
fmgc.flightPlanController.flightplans[3].appendWP(createWPFrom(navaids[0]));
|
||||
} else {
|
||||
var WP = createWP(coord, me.store1[i].getChild("ident").getValue());
|
||||
fmgc.flightPlanController.flightplans[3].appendWP(WP);
|
||||
}
|
||||
}
|
||||
fmgc.flightPlanController.flightplans[3].sid = fmgc.flightPlanController.flightplans[3].departure.getSid(SIDID);
|
||||
fmgc.flightPlanController.flightplans[3].star = fmgc.flightPlanController.flightplans[3].destination.getStar(STARID);
|
||||
}
|
||||
fmgc.flightPlanController.destroyTemporaryFlightPlan(3, 1);
|
||||
|
||||
fmgc.windController.updatePlans();
|
||||
fmgc.updateRouteManagerAlt();
|
||||
fmgc.FMGCInternal.tripWindValue = abs(windComp);
|
||||
|
||||
|
||||
# INITB
|
||||
me.store1 = me.OFP.getChild("fuel");
|
||||
me.store2 = me.OFP.getChild("weights");
|
||||
if (units == "lbs") {
|
||||
if (me.OFP.getNode("params/units").getValue() == "lbs") {
|
||||
fmgc.FMGCInternal.taxiFuel = me.store1.getChild("taxi").getValue() / 1000;
|
||||
fmgc.FMGCInternal.taxiFuelSet = 1;
|
||||
fmgc.FMGCInternal.altFuel = me.store1.getChild("alternate_burn").getValue() / 1000;
|
||||
|
@ -206,5 +270,7 @@ var SimbriefParser = {
|
|||
fmgc.FMGCInternal.blockCalculating = 0;
|
||||
fmgc.blockCalculating.setValue(0);
|
||||
fmgc.FMGCInternal.blockConfirmed = 1;
|
||||
|
||||
return 1;
|
||||
},
|
||||
};
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<!-- Copyright (c) 2020 Jonathan Redpath -->
|
||||
|
||||
<system name="A320: APU">
|
||||
<system name="A320: MISC">
|
||||
|
||||
<channel name="CVR" execrate="8">
|
||||
|
||||
|
@ -28,5 +28,15 @@
|
|||
</switch>
|
||||
|
||||
</channel>
|
||||
|
||||
<channel name="IESI" execrate="8">
|
||||
|
||||
<actuator name="/instrumentation/iesi/att-reset">
|
||||
<input>/instrumentation/iesi/att-reset-cmd</input>
|
||||
<rate_limit sense="incr">0.5</rate_limit>
|
||||
<rate_limit sense="decr">100</rate_limit>
|
||||
</actuator>
|
||||
|
||||
</channel>
|
||||
|
||||
</system>
|
||||
|
|
|
@ -309,6 +309,33 @@
|
|||
<filter-time>0.32</filter-time>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<name>Pitch PFD</name>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/orientation/pitch-deg</property>
|
||||
<entry><ind>-90.0</ind><dep>-57.50</dep></entry>
|
||||
<entry><ind>-80.0</ind><dep>-47.50</dep></entry>
|
||||
<entry><ind>-50.0</ind><dep>-32.50</dep></entry>
|
||||
<entry><ind>-30.0</ind><dep>-22.50</dep></entry>
|
||||
<entry><ind>-20.0</ind><dep>-17.50</dep></entry>
|
||||
<entry><ind>-15.0</ind><dep>-13.75</dep></entry>
|
||||
<entry><ind>-10.0</ind><dep>-10.00</dep></entry>
|
||||
<entry><ind> 0.0</ind><dep> 0.00</dep></entry>
|
||||
<entry><ind> 27.5</ind><dep> 27.50</dep></entry>
|
||||
<entry><ind> 30.0</ind><dep> 28.75</dep></entry>
|
||||
<entry><ind> 50.0</ind><dep> 38.75</dep></entry>
|
||||
<entry><ind> 80.0</ind><dep> 53.75</dep></entry>
|
||||
<entry><ind> 90.0</ind><dep> 63.75</dep></entry>
|
||||
</table>
|
||||
</expression>
|
||||
</input>
|
||||
<output>/instrumentation/pfd/pitch-deg-non-linear</output>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<name>Ground Horizon</name>
|
||||
<type>gain</type>
|
||||
|
@ -464,5 +491,45 @@
|
|||
<output>/instrumentation/pfd/slip-skid</output>
|
||||
<filter-time>0.16</filter-time>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<name>IESI Slip/Skid Indicator</name>
|
||||
<debug>false</debug>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/fdm/jsbsim/accelerations/Ny</property>
|
||||
<entry><ind>-0.20</ind><dep>-105</dep></entry>
|
||||
<entry><ind>-0.01</ind><dep> 0</dep></entry>
|
||||
<entry><ind> 0.00</ind><dep> 0</dep></entry>
|
||||
<entry><ind> 0.01</ind><dep> 0</dep></entry>
|
||||
<entry><ind> 0.20</ind><dep> 105</dep></entry>
|
||||
</table>
|
||||
</expression>
|
||||
</input>
|
||||
<output>/instrumentation/iesi/slip-skid</output>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<name>IESI Pitch</name>
|
||||
<debug>false</debug>
|
||||
<type>gain</type>
|
||||
<gain>1</gain>
|
||||
<input>
|
||||
<expression>
|
||||
<table>
|
||||
<property>/orientation/pitch-deg</property>
|
||||
<entry><ind>-80</ind><dep>-65</dep></entry>
|
||||
<entry><ind>-50</ind><dep>-50</dep></entry>
|
||||
<entry><ind> 0</ind><dep> 0</dep></entry>
|
||||
<entry><ind> 50</ind><dep> 50</dep></entry>
|
||||
<entry><ind> 80</ind><dep> 65</dep></entry>
|
||||
</table>
|
||||
</expression>
|
||||
</input>
|
||||
<output>/instrumentation/iesi/pitch-deg</output>
|
||||
</filter>
|
||||
|
||||
</PropertyList>
|
||||
|
|
Loading…
Reference in a new issue