A32X: Much Canvas PFD WIP WOrk

This commit is contained in:
Joshua Davidson 2017-11-15 23:44:56 -05:00
parent 2d38c84277
commit 813b04e09c
2 changed files with 178 additions and 24 deletions

View file

@ -27,6 +27,7 @@ setprop("/controls/flight/aileron-input-fast", 0);
setprop("/controls/flight/elevator-input-fast", 0);
var ASI = 0;
var ASItrgt = 0;
var ASItrgtdiff = 0;
var alt = 0;
var altTens = 0;
var state1 = getprop("/systems/thrust/state1");
@ -131,9 +132,9 @@ var canvas_PFD_1 = {
getKeys: func() {
return ["FMA_man","FMA_manmode","FMA_flxtemp","FMA_thrust","FMA_lvrclb","FMA_pitch","FMA_pitcharm","FMA_pitcharm2","FMA_roll","FMA_rollarm","FMA_combined","FMA_ctr_msg","FMA_catmode","FMA_cattype","FMA_nodh","FMA_dh","FMA_dhn","FMA_ap","FMA_fd",
"FMA_athr","FMA_man_box","FMA_flx_box","FMA_thrust_box","FMA_pitch_box","FMA_pitcharm_box","FMA_roll_box","FMA_rollarm_box","FMA_combined_box","FMA_catmode_box","FMA_cattype_box","FMA_cat_box","FMA_dh_box","FMA_ap_box","FMA_fd_box","FMA_athr_box",
"FMA_Middle1","FMA_Middle2","ASI_scale","ASI_target","ASI_mach","ASI_mach_decimal","ASI_ten_sec","AI_center","AI_bank","AI_slipskid","AI_horizon","AI_horizon_ground","AI_horizon_sky","AI_stick","AI_stick_pos","AI_heading","AI_agl_g","AI_agl","FD_roll",
"FD_pitch","ALT_digits","ALT_tens","VS_pointer","VS_box","VS_digit","QNH","QNH_setting","QNH_std","QNH_box","LOC_pointer","LOC_scale","GS_scale","GS_pointer","CRS_pointer","HDG_target","HDG_scale","HDG_one","HDG_two","HDG_three","HDG_four","HDG_five",
"HDG_six","HDG_seven","HDG_digit_L","HDG_digit_R","TRK_pointer"];
"FMA_Middle1","FMA_Middle2","ASI_scale","ASI_target","ASI_mach","ASI_mach_decimal","ASI_ten_sec","ASI_digit_UP","ASI_digit_DN","ASI_decimal_UP","ASI_decimal_DN","AI_center","AI_bank","AI_slipskid","AI_horizon","AI_horizon_ground","AI_horizon_sky",
"AI_stick","AI_stick_pos","AI_heading","AI_agl_g","AI_agl","FD_roll","FD_pitch","ALT_digits","ALT_tens","VS_pointer","VS_box","VS_digit","QNH","QNH_setting","QNH_std","QNH_box","LOC_pointer","LOC_scale","GS_scale","GS_pointer","CRS_pointer","HDG_target",
"HDG_scale","HDG_one","HDG_two","HDG_three","HDG_four","HDG_five","HDG_six","HDG_seven","HDG_digit_L","HDG_digit_R","TRK_pointer"];
},
update: func() {
state1 = getprop("/systems/thrust/state1");
@ -388,8 +389,16 @@ var canvas_PFD_1 = {
if (getprop("/it-autoflight/input/spd-managed") == 1) {
me["ASI_target"].setColor(0.6901,0.3333,0.7450);
me["ASI_digit_UP"].setColor(0.6901,0.3333,0.7450);
me["ASI_decimal_UP"].setColor(0.6901,0.3333,0.7450);
me["ASI_digit_DN"].setColor(0.6901,0.3333,0.7450);
me["ASI_decimal_DN"].setColor(0.6901,0.3333,0.7450);
} else {
me["ASI_target"].setColor(0.0862,0.5176,0.6470);
me["ASI_digit_UP"].setColor(0.0862,0.5176,0.6470);
me["ASI_decimal_UP"].setColor(0.0862,0.5176,0.6470);
me["ASI_digit_DN"].setColor(0.0862,0.5176,0.6470);
me["ASI_decimal_DN"].setColor(0.0862,0.5176,0.6470);
}
if (getprop("/FMGC/internal/target-ias-pfd") <= 30) {
@ -399,7 +408,43 @@ var canvas_PFD_1 = {
} else {
ASItrgt = getprop("/FMGC/internal/target-ias-pfd") - 30 - ASI;
}
me["ASI_target"].setTranslation(0, ASItrgt * -6.6);
ASItrgtdiff = getprop("/FMGC/internal/target-ias-pfd") - getprop("/instrumentation/airspeed-indicator/indicated-speed-kt");
if (ASItrgtdiff >= -42 and ASItrgtdiff <= 42) {
me["ASI_target"].setTranslation(0, ASItrgt * -6.6);
me["ASI_digit_UP"].hide();
me["ASI_decimal_UP"].hide();
me["ASI_digit_DN"].hide();
me["ASI_decimal_DN"].hide();
me["ASI_target"].show();
} else if (ASItrgtdiff < -42) {
if (getprop("/it-autoflight/input/kts-mach") == 1) {
me["ASI_digit_DN"].setText(sprintf("%3.0f", getprop("/it-autoflight/input/spd-mach") * 1000));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].show();
} else {
me["ASI_digit_DN"].setText(sprintf("%3.0f", getprop("/it-autoflight/input/spd-kts")));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].hide();
}
me["ASI_digit_DN"].show();
me["ASI_digit_UP"].hide();
me["ASI_target"].hide();
} else if (ASItrgtdiff > 42) {
if (getprop("/it-autoflight/input/kts-mach") == 1) {
me["ASI_digit_UP"].setText(sprintf("%3.0f", getprop("/it-autoflight/input/spd-mach") * 1000));
me["ASI_decimal_UP"].show();
me["ASI_decimal_DN"].hide();
} else {
me["ASI_digit_UP"].setText(sprintf("%3.0f", getprop("/it-autoflight/input/spd-kts")));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].hide();
}
me["ASI_digit_UP"].show();
me["ASI_digit_DN"].hide();
me["ASI_target"].hide();
}
me["ASI_ten_sec"].hide();
@ -599,9 +644,9 @@ var canvas_PFD_2 = {
getKeys: func() {
return ["FMA_man","FMA_manmode","FMA_flxtemp","FMA_thrust","FMA_lvrclb","FMA_pitch","FMA_pitcharm","FMA_pitcharm2","FMA_roll","FMA_rollarm","FMA_combined","FMA_ctr_msg","FMA_catmode","FMA_cattype","FMA_nodh","FMA_dh","FMA_dhn","FMA_ap","FMA_fd",
"FMA_athr","FMA_man_box","FMA_flx_box","FMA_thrust_box","FMA_pitch_box","FMA_pitcharm_box","FMA_roll_box","FMA_rollarm_box","FMA_combined_box","FMA_catmode_box","FMA_cattype_box","FMA_cat_box","FMA_dh_box","FMA_ap_box","FMA_fd_box","FMA_athr_box",
"FMA_Middle1","FMA_Middle2","ASI_scale","ASI_target","ASI_mach","ASI_mach_decimal","ASI_ten_sec","AI_center","AI_bank","AI_slipskid","AI_horizon","AI_horizon_ground","AI_horizon_sky","AI_stick","AI_stick_pos","AI_heading","AI_agl_g","AI_agl","FD_roll",
"FD_pitch","ALT_digits","ALT_tens","VS_pointer","VS_box","VS_digit","QNH","QNH_setting","QNH_std","QNH_box","LOC_pointer","LOC_scale","GS_scale","GS_pointer","CRS_pointer","HDG_target","HDG_scale","HDG_one","HDG_two","HDG_three","HDG_four","HDG_five",
"HDG_six","HDG_seven","HDG_digit_L","HDG_digit_R","TRK_pointer"];
"FMA_Middle1","FMA_Middle2","ASI_scale","ASI_target","ASI_mach","ASI_mach_decimal","ASI_ten_sec","ASI_digit_UP","ASI_digit_DN","ASI_decimal_UP","ASI_decimal_DN","AI_center","AI_bank","AI_slipskid","AI_horizon","AI_horizon_ground","AI_horizon_sky",
"AI_stick","AI_stick_pos","AI_heading","AI_agl_g","AI_agl","FD_roll","FD_pitch","ALT_digits","ALT_tens","VS_pointer","VS_box","VS_digit","QNH","QNH_setting","QNH_std","QNH_box","LOC_pointer","LOC_scale","GS_scale","GS_pointer","CRS_pointer","HDG_target",
"HDG_scale","HDG_one","HDG_two","HDG_three","HDG_four","HDG_five","HDG_six","HDG_seven","HDG_digit_L","HDG_digit_R","TRK_pointer"];
},
update: func() {
state1 = getprop("/systems/thrust/state1");
@ -856,8 +901,16 @@ var canvas_PFD_2 = {
if (getprop("/it-autoflight/input/spd-managed") == 1) {
me["ASI_target"].setColor(0.6901,0.3333,0.7450);
me["ASI_digit_UP"].setColor(0.6901,0.3333,0.7450);
me["ASI_decimal_UP"].setColor(0.6901,0.3333,0.7450);
me["ASI_digit_DN"].setColor(0.6901,0.3333,0.7450);
me["ASI_decimal_DN"].setColor(0.6901,0.3333,0.7450);
} else {
me["ASI_target"].setColor(0.0862,0.5176,0.6470);
me["ASI_digit_UP"].setColor(0.0862,0.5176,0.6470);
me["ASI_decimal_UP"].setColor(0.0862,0.5176,0.6470);
me["ASI_digit_DN"].setColor(0.0862,0.5176,0.6470);
me["ASI_decimal_DN"].setColor(0.0862,0.5176,0.6470);
}
if (getprop("/FMGC/internal/target-ias-pfd") <= 30) {
@ -867,7 +920,43 @@ var canvas_PFD_2 = {
} else {
ASItrgt = getprop("/FMGC/internal/target-ias-pfd") - 30 - ASI;
}
me["ASI_target"].setTranslation(0, ASItrgt * -6.6);
ASItrgtdiff = getprop("/FMGC/internal/target-ias-pfd") - getprop("/instrumentation/airspeed-indicator/indicated-speed-kt");
if (ASItrgtdiff >= -42 and ASItrgtdiff <= 42) {
me["ASI_target"].setTranslation(0, ASItrgt * -6.6);
me["ASI_digit_UP"].hide();
me["ASI_decimal_UP"].hide();
me["ASI_digit_DN"].hide();
me["ASI_decimal_DN"].hide();
me["ASI_target"].show();
} else if (ASItrgtdiff < -42) {
if (getprop("/it-autoflight/input/kts-mach") == 1) {
me["ASI_digit_DN"].setText(sprintf("%3.0f", getprop("/it-autoflight/input/spd-mach") * 1000));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].show();
} else {
me["ASI_digit_DN"].setText(sprintf("%3.0f", getprop("/it-autoflight/input/spd-kts")));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].hide();
}
me["ASI_digit_DN"].show();
me["ASI_digit_UP"].hide();
me["ASI_target"].hide();
} else if (ASItrgtdiff > 42) {
if (getprop("/it-autoflight/input/kts-mach") == 1) {
me["ASI_digit_UP"].setText(sprintf("%3.0f", getprop("/it-autoflight/input/spd-mach") * 1000));
me["ASI_decimal_UP"].show();
me["ASI_decimal_DN"].hide();
} else {
me["ASI_digit_UP"].setText(sprintf("%3.0f", getprop("/it-autoflight/input/spd-kts")));
me["ASI_decimal_UP"].hide();
me["ASI_decimal_DN"].hide();
}
me["ASI_digit_UP"].show();
me["ASI_digit_DN"].hide();
me["ASI_target"].hide();
}
me["ASI_ten_sec"].hide();
@ -1026,11 +1115,24 @@ var canvas_PFD_2 = {
me["HDG_seven"].setText(sprintf("%d", me.rightText3));
me["HDG_one"].setText(sprintf("%d", me.leftText3));
me["HDG_target"].setTranslation((getprop("/instrumentation/pfd/hdg-diff") / 10) * 98.5416, 0);
if (getprop("/it-autoflight/custom/show-hdg") == 1) {
if (getprop("/it-autoflight/custom/show-hdg") == 1 and getprop("/instrumentation/pfd/hdg-diff") >= -23.62 and getprop("/instrumentation/pfd/hdg-diff") <= 23.62) {
me["HDG_target"].setTranslation((getprop("/instrumentation/pfd/hdg-diff") / 10) * 98.5416, 0);
me["HDG_digit_L"].hide();
me["HDG_digit_R"].hide();
me["HDG_target"].show();
} else if (getprop("/it-autoflight/custom/show-hdg") == 1 and getprop("/instrumentation/pfd/hdg-diff") < -23.62 and getprop("/instrumentation/pfd/hdg-diff") >= -180) {
me["HDG_digit_L"].setText(sprintf("%3.0f", getprop("/it-autoflight/input/hdg")));
me["HDG_digit_L"].show();
me["HDG_digit_R"].hide();
me["HDG_target"].hide();
} else if (getprop("/it-autoflight/custom/show-hdg") == 1 and getprop("/instrumentation/pfd/hdg-diff") > 23.62 and getprop("/instrumentation/pfd/hdg-diff") <= 180) {
me["HDG_digit_R"].setText(sprintf("%3.0f", getprop("/it-autoflight/input/hdg")));
me["HDG_digit_R"].show();
me["HDG_digit_L"].hide();
me["HDG_target"].hide();
} else {
me["HDG_digit_L"].hide();
me["HDG_digit_R"].hide();
me["HDG_target"].hide();
}

View file

@ -41,9 +41,9 @@
inkscape:window-height="1030"
id="namedview371"
showgrid="false"
inkscape:zoom="2"
inkscape:cx="435.84224"
inkscape:cy="184.55281"
inkscape:zoom="0.70710678"
inkscape:cx="178.44982"
inkscape:cy="505.90235"
inkscape:window-x="1592"
inkscape:window-y="-8"
inkscape:window-maximized="1"
@ -1185,9 +1185,9 @@
<rect
inkscape:label="#rect9211"
y="890.56866"
x="188.53055"
x="146.66983"
height="54.440548"
width="519.64056"
width="603.362"
id="HDG_target_clip"
style="opacity:0.46000001;fill:#ff00ff;fill-opacity:1;stroke:none;stroke-width:1.27696717;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
@ -1217,10 +1217,10 @@
<rect
style="opacity:0.46000001;fill:#ff00ff;fill-opacity:1;stroke:none;stroke-width:1.27696717;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="ASI_target_clip"
width="37.982773"
height="551.97998"
x="122.8552"
y="237.04402"
width="37.907772"
height="678.69348"
x="122.9302"
y="173.68726"
inkscape:label="#rect9211" />
<rect
style="fill:#4c4c4c;fill-opacity:1;stroke:none;stroke-width:2.4000001;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
@ -1999,7 +1999,7 @@
sodipodi:nodetypes="cccc"
inkscape:connector-curvature="0"
id="ASI_target"
d="m 158.57701,491.12121 -1e-5,43.41526 -40.47717,-21.70763 z"
d="m 155.37613,491.12121 -1e-5,43.41526 -40.47717,-21.70763 z"
style="fill:none;fill-opacity:1;stroke:#1684a5;stroke-width:4;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" />
<g
id="ASI_index"
@ -2015,7 +2015,7 @@
sodipodi:nodetypes="cccc"
inkscape:connector-curvature="0"
id="path928"
d="m 142.62916,491.54141 0,-20.391 -17.13886,10.1955 z"
d="m 139.62834,491.54141 0,-20.391 -17.13886,10.1955 z"
style="fill:#c9d121;fill-opacity:1;stroke:none;stroke-width:2.71116304;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
inkscape:label="#path905" />
<path
@ -3113,14 +3113,14 @@
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:30.52176857px;line-height:1.25;font-family:sans-serif;text-align:end;letter-spacing:0px;word-spacing:0px;text-anchor:end;fill:#0dc04b;fill-opacity:1;stroke:none;stroke-width:0.75"
x="45.718079"
x="51.798809"
y="835.1153"
id="ASI_mach_decimal"
transform="scale(0.95383277,1.0484018)"
inkscape:label="#text975"><tspan
sodipodi:role="line"
id="tspan4668"
x="45.718079"
x="51.798809"
y="835.1153"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:48.83483124px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#0dc04b;fill-opacity:1;stroke-width:0.75">.</tspan></text>
<text
@ -3481,4 +3481,56 @@
x="721.2049"
id="tspan4786"
sodipodi:role="line">000</tspan></text>
<text
inkscape:label="#text975"
transform="scale(0.95382555,1.0484097)"
id="ASI_digit_DN"
y="787.28491"
x="95.148567"
style="font-style:normal;font-weight:normal;font-size:30.52176857px;line-height:1.25;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#1684a5;fill-opacity:1;stroke:none;stroke-width:0.75"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#1684a5;fill-opacity:1;stroke-width:0.75"
y="787.28491"
x="95.148567"
id="tspan4686"
sodipodi:role="line">000</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:30.52176857px;line-height:1.25;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#1684a5;fill-opacity:1;stroke:none;stroke-width:0.75"
x="95.148567"
y="220.32645"
id="ASI_digit_UP"
transform="scale(0.95382558,1.0484097)"
inkscape:label="#text975"><tspan
sodipodi:role="line"
id="tspan4690"
x="95.148567"
y="220.32645"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#1684a5;fill-opacity:1;stroke-width:0.75">000</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:30.52176857px;line-height:1.25;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#1684a5;fill-opacity:1;stroke:none;stroke-width:0.75"
x="80.506805"
y="787.28491"
id="ASI_decimal_DN"
transform="scale(0.95382558,1.0484097)"
inkscape:label="#text975"><tspan
sodipodi:role="line"
id="tspan4691"
x="80.506805"
y="787.28491"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#1684a5;fill-opacity:1;stroke-width:0.75">.</tspan></text>
<text
inkscape:label="#text975"
transform="scale(0.95382558,1.0484097)"
id="ASI_decimal_UP"
y="220.32645"
x="80.506668"
style="font-style:normal;font-weight:normal;font-size:30.52176857px;line-height:1.25;font-family:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#1684a5;fill-opacity:1;stroke:none;stroke-width:0.75"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:42px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';text-align:start;text-anchor:start;fill:#1684a5;fill-opacity:1;stroke-width:0.75"
y="220.32645"
x="80.506668"
id="tspan4696"
sodipodi:role="line">.</tspan></text>
</svg>

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 200 KiB