PFD: fix bugs
This commit is contained in:
parent
12e7258f23
commit
6aac392eec
2 changed files with 49 additions and 43 deletions
|
@ -234,10 +234,10 @@ var canvas_pfd = {
|
|||
obj["VS_box"].show();
|
||||
}
|
||||
}),
|
||||
props.UpdateManager.FromHashValue("localizer", 0.01, func(val) {
|
||||
props.UpdateManager.FromHashValue("localizer", 0.0025, func(val) {
|
||||
obj["LOC_pointer"].setTranslation(val * 197, 0);
|
||||
}),
|
||||
props.UpdateManager.FromHashValue("glideslope", 0.01, func(val) {
|
||||
props.UpdateManager.FromHashValue("glideslope", 0.0025, func(val) {
|
||||
obj["GS_pointer"].setTranslation(0, val * -197);
|
||||
}),
|
||||
props.UpdateManager.FromHashList(["athr", "thrustLvrClb"], 1, func(val) {
|
||||
|
@ -331,7 +331,7 @@ var canvas_pfd = {
|
|||
}
|
||||
}),
|
||||
props.UpdateManager.FromHashList(["apBox","apMode"], nil, func(val) {
|
||||
obj["FMA_athr"].setText(val.apMode);
|
||||
obj["FMA_ap"].setText(val.apMode);
|
||||
if (val.apBox and val.apMode != " ") {
|
||||
obj["FMA_ap_box"].show();
|
||||
} else {
|
||||
|
@ -692,7 +692,7 @@ var canvas_pfd = {
|
|||
obj["QNH_setting"].setText(sprintf("%2.2f", val.altimeterInhg));
|
||||
}
|
||||
}),
|
||||
props.UpdateManager.FromHashList(["altimeterStd","altitudeAutopilot"], 25, func(val) {
|
||||
props.UpdateManager.FromHashList(["altimeterStd","altitudeAutopilot"], 1, func(val) {
|
||||
if (val.altimeterStd == 1) {
|
||||
if (val.altitudeAutopilot < 10000) {
|
||||
obj["ALT_digit_UP"].setText(sprintf("%s", "FL " ~ val.altitudeAutopilot / 100));
|
||||
|
@ -1219,36 +1219,42 @@ var canvas_pfd = {
|
|||
obj["Metric_cur_alt"].hide();
|
||||
}
|
||||
}),
|
||||
props.UpdateManager.FromHashValue("altitudePFD", 0.5, func(val) {
|
||||
obj["Metric_cur_alt"].setText(sprintf("%5.0f", val * 0.3048));
|
||||
|
||||
obj.middleAltText = roundaboutAlt(val / 100);
|
||||
|
||||
obj["ALT_five"].setText(sprintf("%03d", abs(obj.middleAltText + 10)));
|
||||
obj["ALT_four"].setText(sprintf("%03d", abs(obj.middleAltText + 5)));
|
||||
obj["ALT_three"].setText(sprintf("%03d", abs(obj.middleAltText)));
|
||||
obj["ALT_two"].setText(sprintf("%03d", abs(obj.middleAltText - 5)));
|
||||
obj["ALT_one"].setText(sprintf("%03d", abs(obj.middleAltText - 10)));
|
||||
|
||||
if (val < 0) {
|
||||
obj["ALT_neg"].show();
|
||||
props.UpdateManager.FromHashList(["altitudePFD","altError"], 0.5, func(val) {
|
||||
if (!val.altError) {
|
||||
obj["Metric_cur_alt"].setText(sprintf("%5.0f", val.altitudePFD * 0.3048));
|
||||
|
||||
obj.middleAltText = roundaboutAlt(val.altitudePFD / 100);
|
||||
|
||||
obj["ALT_five"].setText(sprintf("%03d", abs(obj.middleAltText + 10)));
|
||||
obj["ALT_four"].setText(sprintf("%03d", abs(obj.middleAltText + 5)));
|
||||
obj["ALT_three"].setText(sprintf("%03d", abs(obj.middleAltText)));
|
||||
obj["ALT_two"].setText(sprintf("%03d", abs(obj.middleAltText - 5)));
|
||||
obj["ALT_one"].setText(sprintf("%03d", abs(obj.middleAltText - 10)));
|
||||
|
||||
if (val.altitudePFD < 0) {
|
||||
obj["ALT_neg"].show();
|
||||
} else {
|
||||
obj["ALT_neg"].hide();
|
||||
}
|
||||
} else {
|
||||
obj["ALT_neg"].hide();
|
||||
}
|
||||
}),
|
||||
props.UpdateManager.FromHashValue("altitudePFD", 0.1, func(val) {
|
||||
obj.altOffset = val / 500 - int(val / 500);
|
||||
obj.middleAltOffset = nil;
|
||||
|
||||
if (obj.altOffset > 0.5) {
|
||||
obj.middleAltOffset = -(obj.altOffset - 1) * 243.3424;
|
||||
} else {
|
||||
obj.middleAltOffset = -obj.altOffset * 243.3424;
|
||||
props.UpdateManager.FromHashList(["altitudePFD","altError"], 0.1, func(val) {
|
||||
if (!val.altError) {
|
||||
obj.altOffset = val / 500 - int(val.altitudePFD / 500);
|
||||
obj.middleAltOffset = nil;
|
||||
|
||||
if (obj.altOffset > 0.5) {
|
||||
obj.middleAltOffset = -(obj.altOffset - 1) * 243.3424;
|
||||
} else {
|
||||
obj.middleAltOffset = -obj.altOffset * 243.3424;
|
||||
}
|
||||
|
||||
obj["ALT_scale"].setTranslation(0, -obj.middleAltOffset);
|
||||
obj["ALT_scale"].update();
|
||||
obj["ALT_tens"].setTranslation(0, num(right(sprintf("%02d", val.altitudePFD), 2)) * 1.392);
|
||||
}
|
||||
|
||||
obj["ALT_scale"].setTranslation(0, -obj.middleAltOffset);
|
||||
obj["ALT_scale"].update();
|
||||
obj["ALT_tens"].setTranslation(0, num(right(sprintf("%02d", val), 2)) * 1.392);
|
||||
}),
|
||||
props.UpdateManager.FromHashValue("altitudeDigits", 1, func(val) {
|
||||
obj["ALT_digits"].setText(sprintf("%d", val));
|
||||
|
@ -1695,6 +1701,7 @@ var canvas_pfd = {
|
|||
alt_going2 = 0;
|
||||
amber_going2 = 0;
|
||||
}
|
||||
me["ALT_box"].show();
|
||||
me["ALT_box_flash"].hide();
|
||||
me["ALT_box_amber"].hide();
|
||||
} else {
|
||||
|
@ -2073,14 +2080,14 @@ var canvas_pfd = {
|
|||
getAOAForPFD1: func() {
|
||||
if (air_data_switch.getValue() != -1 and adr_1_switch.getValue() and !adr_1_fault.getValue()) return aoa_1.getValue();
|
||||
if (air_data_switch.getValue() == -1 and adr_3_switch.getValue() and !adr_3_fault.getValue()) return aoa_3.getValue();
|
||||
return nil;
|
||||
return 0;
|
||||
},
|
||||
|
||||
# Get Angle of Attack from ADR2 or, depending on Switching panel, ADR3
|
||||
getAOAForPFD2: func() {
|
||||
if (air_data_switch.getValue() != 1 and adr_2_switch.getValue() and !adr_2_fault.getValue()) return aoa_2.getValue();
|
||||
if (air_data_switch.getValue() == 1 and adr_3_switch.getValue() and !adr_3_fault.getValue()) return aoa_3.getValue();
|
||||
return nil;
|
||||
return 0;
|
||||
},
|
||||
|
||||
# Convert difference between magnetic heading and track measured in degrees to pixel for display on PFDs
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
|
@ -37,13 +36,13 @@
|
|||
units="pt"
|
||||
inkscape:snap-global="false"
|
||||
showguides="true"
|
||||
inkscape:current-layer="ALT_group"
|
||||
inkscape:current-layer="svg2"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:window-y="-11"
|
||||
inkscape:window-x="-11"
|
||||
inkscape:cy="673.69595"
|
||||
inkscape:cx="1065.6983"
|
||||
inkscape:zoom="5.6568545"
|
||||
inkscape:cy="228.04193"
|
||||
inkscape:cx="941.86619"
|
||||
inkscape:zoom="2.8284273"
|
||||
showgrid="false"
|
||||
id="namedview371"
|
||||
inkscape:window-height="974"
|
||||
|
@ -2397,15 +2396,15 @@
|
|||
inkscape:connector-curvature="0"
|
||||
id="path1283"
|
||||
d="m 856.4002,481.90842 2.2e-4,-15.92813 h 52.07464 v 93.34657 h -52.07457 v -15.26583"
|
||||
style="fill:#000000;fill-opacity:1;stroke:#ffff00;stroke-width:3.19994998;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||
style="fill:#000000;fill-opacity:1;stroke:#ffff00;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path1285"
|
||||
d="m 770.31078,481.90873 86.08971,-3.1e-4"
|
||||
style="fill:none;fill-opacity:1;stroke:#ffff00;stroke-width:3.19994998;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||
style="fill:none;fill-opacity:1;stroke:#ffff00;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
|
||||
<path
|
||||
style="fill:none;fill-opacity:1;stroke:#ffff00;stroke-width:3.19994998;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
style="fill:none;fill-opacity:1;stroke:#ffff00;stroke-width:3.19995;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||
d="m 770.31078,544.06163 86.08971,-6e-4"
|
||||
id="path1287"
|
||||
inkscape:connector-curvature="0"
|
||||
|
@ -2631,26 +2630,26 @@
|
|||
transform="scale(0.87678236,1.1405339)"
|
||||
id="FMA_dh"
|
||||
y="115.05846"
|
||||
x="831.23047"
|
||||
x="826.09802"
|
||||
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.657577"
|
||||
xml:space="preserve"
|
||||
inkscape:label="#text983"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:34px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke-width:0.657577"
|
||||
y="115.05846"
|
||||
x="831.23047"
|
||||
x="826.09802"
|
||||
id="tspan4301"
|
||||
sodipodi:role="line">RADIO</tspan></text>
|
||||
<text
|
||||
inkscape:label="#text983"
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;display:inline;fill:#179ab7;fill-opacity:1;stroke:none;stroke-width:0.657577"
|
||||
x="934.0097"
|
||||
x="937.43134"
|
||||
y="115.05846"
|
||||
id="FMA_dhn"
|
||||
transform="scale(0.87678236,1.1405339)"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4305"
|
||||
x="934.0097"
|
||||
x="937.43134"
|
||||
y="115.05846"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:34px;line-height:1.25;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:center;text-anchor:middle;fill:#179ab7;fill-opacity:1;stroke-width:0.657577">0250</tspan></text>
|
||||
<g
|
||||
|
|
Before Width: | Height: | Size: 348 KiB After Width: | Height: | Size: 348 KiB |
Loading…
Reference in a new issue