Add trigonometric wind speed calculation to navdisplay; bugfix WPT / DECEL symbol files; correct how the wind arrow / TAS / GS display on the ND and improve the dashed route line
This commit is contained in:
parent
22b76cf0a8
commit
250d177d17
7 changed files with 130 additions and 41 deletions
|
@ -23,8 +23,7 @@ var init = func {
|
||||||
var draw = func{
|
var draw = func{
|
||||||
if(me.decel_grp != nil){
|
if(me.decel_grp != nil){
|
||||||
var spd_ctrl = getprop(me.options.spd_ctrl);
|
var spd_ctrl = getprop(me.options.spd_ctrl);
|
||||||
var spd_managed = (spd_ctrl == me.options.managed_val);
|
if(spd_ctrl)
|
||||||
if(spd_managed)
|
|
||||||
me.decel_grp.setColor(me.style.managed_color);
|
me.decel_grp.setColor(me.style.managed_color);
|
||||||
else
|
else
|
||||||
me.decel_grp.setColor(me.style.selected_color);
|
me.decel_grp.setColor(me.style.selected_color);
|
||||||
|
|
|
@ -82,7 +82,7 @@ var draw = func{
|
||||||
var wp_group = me.element;
|
var wp_group = me.element;
|
||||||
var alt = me.model.alt;
|
var alt = me.model.alt;
|
||||||
var i = me.model.idx;
|
var i = me.model.idx;
|
||||||
var vnav_actv = getprop(me.options.ver_ctrl) == me.options.managed_val;
|
var vnav_actv = getprop(me.options.spd_ctrl) == 1;
|
||||||
var curwp = getprop(me.options.current_wp);
|
var curwp = getprop(me.options.current_wp);
|
||||||
if(alt > 0){
|
if(alt > 0){
|
||||||
var wp_d = me.model.wp.distance_along_route;
|
var wp_d = me.model.wp.distance_along_route;
|
||||||
|
|
|
@ -529,7 +529,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
var lat_ctrl = getprop(me.options.lat_ctrl);
|
var lat_ctrl = getprop(me.options.lat_ctrl);
|
||||||
var is_managed = (lat_ctrl == me.options.managed_val);
|
var is_managed = (lat_ctrl == me.options.managed_val);
|
||||||
var is_active = getprop(me.options.fplan_active);
|
var is_active = getprop(me.options.fplan_active);
|
||||||
(is_managed and is_active ? [] : [32, 16]);
|
(is_managed and is_active ? [] : [12, 12]);
|
||||||
},
|
},
|
||||||
line_dash_alternate_active: [32,16],
|
line_dash_alternate_active: [32,16],
|
||||||
line_dash_temporary: [32,16],
|
line_dash_temporary: [32,16],
|
||||||
|
@ -561,6 +561,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
"fplan_active",
|
"fplan_active",
|
||||||
"lat_ctrl",
|
"lat_ctrl",
|
||||||
"ver_ctrl",
|
"ver_ctrl",
|
||||||
|
"spd_ctrl",
|
||||||
"current_wp",
|
"current_wp",
|
||||||
"wp_count",
|
"wp_count",
|
||||||
"dep_rwy",
|
"dep_rwy",
|
||||||
|
@ -758,21 +759,14 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id: "tas",
|
id: "tas",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) nd.aircraft_source.get_spd() > 100,
|
predicate: func(nd) getprop("/instrumentation/airspeed-indicator/true-speed-kt") >= 60,
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
nd.symbols.tas.setText(sprintf("%3.0f",getprop("/velocities/TAS") ));
|
nd.symbols.tas.setText(sprintf("%3.0f",getprop("/instrumentation/airspeed-indicator/true-speed-kt")));
|
||||||
nd.symbols.tas.show();
|
nd.symbols.tas.show();
|
||||||
},
|
},
|
||||||
is_false: func(nd) nd.symbols.tas.hide(),
|
is_false: func(nd){
|
||||||
},
|
nd.symbols.tas.setText("---");
|
||||||
},
|
}
|
||||||
{
|
|
||||||
id: "tasLbl",
|
|
||||||
impl: {
|
|
||||||
init: func(nd,symbol),
|
|
||||||
predicate: func(nd) nd.aircraft_source.get_spd() > 100,
|
|
||||||
is_true: func(nd) nd.symbols.tasLbl.show(),
|
|
||||||
is_false: func(nd) nd.symbols.tasLbl.hide(),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1006,12 +1000,6 @@ canvas.NDStyles["Airbus"] = {
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
common: func(nd) nd.symbols.gs.setText(sprintf("%3.0f",nd.aircraft_source.get_gnd_spd() )),
|
common: func(nd) nd.symbols.gs.setText(sprintf("%3.0f",nd.aircraft_source.get_gnd_spd() )),
|
||||||
predicate: func(nd) nd.aircraft_source.get_gnd_spd() >= 30,
|
|
||||||
is_true: func(nd) {
|
|
||||||
#nd.symbols.gs.show();
|
|
||||||
nd.symbols.gs.setFontSize(36);
|
|
||||||
},
|
|
||||||
is_false: func(nd) {},#nd.symbols.gs.hide(),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1341,7 +1329,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
nd.get_switch("toggle_display_mode") == "MAP" and !nd.get_switch("toggle_centered")
|
nd.get_switch("toggle_display_mode") == "MAP" and !nd.get_switch("toggle_centered")
|
||||||
and (nd.change_phase != 1)
|
and (nd.change_phase != 1)
|
||||||
and (
|
and (
|
||||||
getprop(nd.options.defaults.lat_ctrl) != nd.options.defaults.managed_val or
|
getprop(nd.options.defaults.lat_ctrl) == 0 or
|
||||||
nd.get_switch("toggle_trk_line")
|
nd.get_switch("toggle_trk_line")
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
@ -1357,7 +1345,8 @@ canvas.NDStyles["Airbus"] = {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["APP","VOR","MAP"]) and nd.get_switch("toggle_centered")
|
predicate: func(nd) (nd.in_mode("toggle_display_mode", ["APP","VOR","MAP"]) and nd.get_switch("toggle_centered")
|
||||||
and (nd.change_phase != 1)
|
and (nd.change_phase != 1)
|
||||||
and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting))),
|
and (nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting))
|
||||||
|
and abs(nd.aircraft_source.get_trk_mag() - nd.aircraft_source.get_hdg_mag()) <= 42),
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
nd.symbols.trkInd2.show();
|
nd.symbols.trkInd2.show();
|
||||||
nd.symbols.trkInd2.setRotation((nd.aircraft_source.get_trk_mag()-nd.aircraft_source.get_hdg_mag())*D2R);
|
nd.symbols.trkInd2.setRotation((nd.aircraft_source.get_trk_mag()-nd.aircraft_source.get_hdg_mag())*D2R);
|
||||||
|
@ -1371,7 +1360,7 @@ canvas.NDStyles["Airbus"] = {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and
|
predicate: func(nd) (nd.get_switch("toggle_display_mode") == "MAP" and
|
||||||
nd.get_switch("toggle_centered") and (nd.change_phase != 1) and
|
nd.get_switch("toggle_centered") and (nd.change_phase != 1) and
|
||||||
getprop(nd.options.defaults.lat_ctrl) != nd.options.defaults.managed_val and
|
getprop(nd.options.defaults.lat_ctrl) == 0 and
|
||||||
(nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting))),
|
(nd.adirs_property.getValue() == 1 or (adirs_3.getValue() == 1 and att_switch.getValue() == nd.attitude_heading_setting))),
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
nd.symbols.trkline2.show();
|
nd.symbols.trkline2.show();
|
||||||
|
@ -1530,24 +1519,26 @@ canvas.NDStyles["Airbus"] = {
|
||||||
id:"wind",
|
id:"wind",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: ALWAYS,
|
predicate: func(nd) (getprop("/instrumentation/airspeed-indicator/true-speed-kt") >= 100),
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
var windDir = getprop("environment/wind-from-heading-deg");
|
var windDir = pts.Instrumentation.PFD.windDirection.getValue() or 0;
|
||||||
if(!nd.get_switch("toggle_true_north"))
|
if(nd.get_switch("toggle_true_north"))
|
||||||
windDir = windDir + getprop("environment/magnetic-variation-deg");
|
windDir = windDir + getprop("environment/magnetic-variation-deg");
|
||||||
nd.symbols.wind.setText(sprintf("%03.0f / %02.0f",windDir,getprop("environment/wind-speed-kt")));
|
nd.symbols.wind.setText(sprintf("%03.0f / %02.0f",windDir,pts.Instrumentation.PFD.windSpeed.getValue() or 0));
|
||||||
},
|
},
|
||||||
is_false: NOTHING,
|
is_false: func(nd) {
|
||||||
|
nd.symbols.wind.setText("---/--");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id:"windArrow",
|
id:"windArrow",
|
||||||
impl: {
|
impl: {
|
||||||
init: func(nd,symbol),
|
init: func(nd,symbol),
|
||||||
predicate: func(nd) (!(nd.in_mode("toggle_display_mode", ["PLAN"]) and (nd.get_switch("toggle_display_type") == "LCD"))),
|
predicate: func(nd) (!(nd.in_mode("toggle_display_mode", ["PLAN"]) and (nd.get_switch("toggle_display_type") == "LCD")) and (pts.Instrumentation.PFD.windSpeed.getValue() or 0) >= 2 and getprop("/instrumentation/airspeed-indicator/true-speed-kt") >= 100),
|
||||||
is_true: func(nd) {
|
is_true: func(nd) {
|
||||||
nd.symbols.windArrow.show();
|
nd.symbols.windArrow.show();
|
||||||
var windArrowRot = getprop("environment/wind-from-heading-deg");
|
var windArrowRot = pts.Instrumentation.PFD.windDirection.getValue() or 0;
|
||||||
if(nd.in_mode("toggle_display_mode", ["MAP","PLAN"])) {
|
if(nd.in_mode("toggle_display_mode", ["MAP","PLAN"])) {
|
||||||
if(nd.get_switch("toggle_true_north"))
|
if(nd.get_switch("toggle_true_north"))
|
||||||
windArrowRot = windArrowRot - nd.aircraft_source.get_trk_tru();
|
windArrowRot = windArrowRot - nd.aircraft_source.get_trk_tru();
|
||||||
|
|
|
@ -204,6 +204,10 @@ var Instrumentation = {
|
||||||
gsDeflection: props.globals.getNode("/instrumentation/nav[0]/gs-needle-deflection-norm"),
|
gsDeflection: props.globals.getNode("/instrumentation/nav[0]/gs-needle-deflection-norm"),
|
||||||
locDeflection: props.globals.getNode("/instrumentation/nav[0]/heading-needle-deflection-norm"),
|
locDeflection: props.globals.getNode("/instrumentation/nav[0]/heading-needle-deflection-norm"),
|
||||||
},
|
},
|
||||||
|
PFD: {
|
||||||
|
windDirection: props.globals.getNode("/instrumentation/pfd/wind-direction"),
|
||||||
|
windSpeed: props.globals.getNode("/instrumentation/pfd/wind-speed"),
|
||||||
|
},
|
||||||
TCAS: {
|
TCAS: {
|
||||||
servicable: props.globals.getNode("/instrumentation/tcas/serviceable"),
|
servicable: props.globals.getNode("/instrumentation/tcas/serviceable"),
|
||||||
Inputs: {
|
Inputs: {
|
||||||
|
|
|
@ -530,7 +530,7 @@
|
||||||
<property>/systems/navigation/probes/tat-1/tat</property>
|
<property>/systems/navigation/probes/tat-1/tat</property>
|
||||||
<quotient>
|
<quotient>
|
||||||
<pow>
|
<pow>
|
||||||
<property>/velocities/TAS</property>
|
<property>/instrumentation/airspeed-indicator/true-speed-kt</property>
|
||||||
<value>2</value>
|
<value>2</value>
|
||||||
</pow>
|
</pow>
|
||||||
<value>7569</value>
|
<value>7569</value>
|
||||||
|
|
|
@ -608,14 +608,6 @@
|
||||||
<output>/systems/pressurization/targetvs</output>
|
<output>/systems/pressurization/targetvs</output>
|
||||||
</filter>
|
</filter>
|
||||||
|
|
||||||
<filter>
|
|
||||||
<name>TAS</name>
|
|
||||||
<type>gain</type>
|
|
||||||
<gain>1.0</gain>
|
|
||||||
<input>/instrumentation/airspeed-indicator/true-speed-kt</input>
|
|
||||||
<output>/velocities/TAS</output>
|
|
||||||
</filter>
|
|
||||||
|
|
||||||
<filter>
|
<filter>
|
||||||
<name>LBtoKG</name>
|
<name>LBtoKG</name>
|
||||||
<type>gain</type>
|
<type>gain</type>
|
||||||
|
|
103
Systems/pfd.xml
103
Systems/pfd.xml
|
@ -574,4 +574,107 @@
|
||||||
<output>/instrumentation/iesi/pitch-deg</output>
|
<output>/instrumentation/iesi/pitch-deg</output>
|
||||||
</filter>
|
</filter>
|
||||||
|
|
||||||
|
<filter>
|
||||||
|
<name>Wind East</name>
|
||||||
|
<type>gain</type>
|
||||||
|
<gain>1.0</gain>
|
||||||
|
<input>
|
||||||
|
<expression>
|
||||||
|
<difference>
|
||||||
|
<product>
|
||||||
|
<property>/velocities/speed-east-fps</property>
|
||||||
|
<value>0.592484</value> <!-- fps to kt -->
|
||||||
|
</product>
|
||||||
|
<product>
|
||||||
|
<cos><deg2rad><property>/orientation/pitch-deg</property></deg2rad></cos>
|
||||||
|
<sin><deg2rad><property>/orientation/heading-deg</property></deg2rad></sin>
|
||||||
|
<!--<floor>-->
|
||||||
|
<property>/systems/navigation/adr/output/tas-3</property>
|
||||||
|
<!--<value>100</value>
|
||||||
|
</floor>-->
|
||||||
|
</product>
|
||||||
|
</difference>
|
||||||
|
</expression>
|
||||||
|
</input>
|
||||||
|
<output>/instrumentation/pfd/wind-speed-east</output>
|
||||||
|
<min>-4096</min>
|
||||||
|
<max>4096</max>
|
||||||
|
</filter>
|
||||||
|
|
||||||
|
<filter>
|
||||||
|
<name>Wind North</name>
|
||||||
|
<type>gain</type>
|
||||||
|
<gain>1.0</gain>
|
||||||
|
<input>
|
||||||
|
<expression>
|
||||||
|
<difference>
|
||||||
|
<product>
|
||||||
|
<property>/velocities/speed-north-fps</property>
|
||||||
|
<value>0.592484</value> <!-- fps to kt -->
|
||||||
|
</product>
|
||||||
|
<product>
|
||||||
|
<cos><deg2rad><property>/orientation/pitch-deg</property></deg2rad></cos>
|
||||||
|
<cos><deg2rad><property>/orientation/heading-deg</property></deg2rad></cos>
|
||||||
|
<!--<floor>-->
|
||||||
|
<property>/systems/navigation/adr/output/tas-3</property>
|
||||||
|
<!--<value>100</value>
|
||||||
|
</floor>-->
|
||||||
|
</product>
|
||||||
|
</difference>
|
||||||
|
</expression>
|
||||||
|
</input>
|
||||||
|
<output>/instrumentation/pfd/wind-speed-north</output>
|
||||||
|
<min>-4096</min>
|
||||||
|
<max>4096</max>
|
||||||
|
</filter>
|
||||||
|
|
||||||
|
<filter>
|
||||||
|
<name>Wind Direction</name>
|
||||||
|
<type>exponential</type>
|
||||||
|
<filter-time>1.28</filter-time>
|
||||||
|
<input>
|
||||||
|
<expression>
|
||||||
|
<sum>
|
||||||
|
<rad2deg>
|
||||||
|
<atan2>
|
||||||
|
<property>/instrumentation/pfd/wind-speed-east</property>
|
||||||
|
<property>/instrumentation/pfd/wind-speed-north</property>
|
||||||
|
</atan2>
|
||||||
|
</rad2deg>
|
||||||
|
<value>180</value>
|
||||||
|
</sum>
|
||||||
|
</expression>
|
||||||
|
</input>
|
||||||
|
<output>/instrumentation/pfd/wind-direction</output>
|
||||||
|
<period>
|
||||||
|
<min>0</min>
|
||||||
|
<max>360</max>
|
||||||
|
</period>
|
||||||
|
</filter>
|
||||||
|
|
||||||
|
<filter>
|
||||||
|
<name>Wind Speed</name>
|
||||||
|
<type>exponential</type>
|
||||||
|
<filter-time>1.28</filter-time>
|
||||||
|
<input>
|
||||||
|
<expression>
|
||||||
|
<sqrt>
|
||||||
|
<sum>
|
||||||
|
<pow>
|
||||||
|
<property>/instrumentation/pfd/wind-speed-east</property>
|
||||||
|
<value>2</value>
|
||||||
|
</pow>
|
||||||
|
<pow>
|
||||||
|
<property>/instrumentation/pfd/wind-speed-north</property>
|
||||||
|
<value>2</value>
|
||||||
|
</pow>
|
||||||
|
</sum>
|
||||||
|
</sqrt>
|
||||||
|
</expression>
|
||||||
|
</input>
|
||||||
|
<output>/instrumentation/pfd/wind-speed</output>
|
||||||
|
<min>0</min>
|
||||||
|
<max>256</max>
|
||||||
|
</filter>
|
||||||
|
|
||||||
</PropertyList>
|
</PropertyList>
|
||||||
|
|
Loading…
Reference in a new issue