TCAS --> ABV / BLW work
This commit is contained in:
parent
f7cb3b062e
commit
9355d38c46
3 changed files with 96 additions and 4 deletions
|
@ -776,6 +776,8 @@
|
|||
<atc>
|
||||
<system-knob type="int">0</system-knob>
|
||||
<mode-knob type="int">0</mode-knob>
|
||||
<abv-blw type="int">0</abv-blw>
|
||||
<thrt-all type="int">0</thrt-all>
|
||||
</atc>
|
||||
<apu>
|
||||
<agent-btn type="bool">0</agent-btn>
|
||||
|
|
|
@ -892,7 +892,81 @@
|
|||
</and>
|
||||
</condition>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>rotate</type>
|
||||
<object-name>atc_abv</object-name>
|
||||
<factor>35</factor>
|
||||
<offset-deg>0</offset-deg>
|
||||
<axis>
|
||||
<object-name>atc_abv.axis</object-name>
|
||||
</axis>
|
||||
<property>controls/atc/abv-blw</property>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>atc_abv</object-name>
|
||||
<action>
|
||||
<button>0</button>
|
||||
<button>3</button>
|
||||
<binding>
|
||||
<command>property-cycle</command>
|
||||
<property>controls/atc/abv-blw</property>
|
||||
<value>-1</value>
|
||||
<value>0</value>
|
||||
<value>1</value>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
<button>1</button>
|
||||
<button>4</button>
|
||||
<binding>
|
||||
<command>property-cycle</command>
|
||||
<property>controls/atc/abv-blw</property>
|
||||
<value>1</value>
|
||||
<value>0</value>
|
||||
<value>-1</value>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>rotate</type>
|
||||
<object-name>atc_thrt</object-name>
|
||||
<factor>-30</factor>
|
||||
<offset-deg>0</offset-deg>
|
||||
<axis>
|
||||
<object-name>atc_thrt.axis</object-name>
|
||||
</axis>
|
||||
<property>controls/atc/thrt-all</property>
|
||||
</animation>
|
||||
|
||||
<animation>
|
||||
<type>pick</type>
|
||||
<object-name>atc_thrt</object-name>
|
||||
<action>
|
||||
<button>0</button>
|
||||
<button>3</button>
|
||||
<binding>
|
||||
<command>property-cycle</command>
|
||||
<property>controls/atc/thrt-all</property>
|
||||
<value>0</value>
|
||||
<value>1</value>
|
||||
</binding>
|
||||
</action>
|
||||
<action>
|
||||
<button>1</button>
|
||||
<button>4</button>
|
||||
<binding>
|
||||
<command>property-cycle</command>
|
||||
<property>controls/atc/thrt-all</property>
|
||||
<value>0</value>
|
||||
<value>1</value>
|
||||
</binding>
|
||||
</action>
|
||||
</animation>
|
||||
|
||||
<!-- Primary Flight Displays -->
|
||||
<model>
|
||||
<name>PFD1</name>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Traffic layer
|
||||
#
|
||||
|
||||
var ATCSwitchAbvBlw = props.globals.getNode("/controls/atc/abv-blw");
|
||||
var ATCSwitchThrtAll = props.globals.getNode("/controls/atc/thrt-all");
|
||||
|
||||
var colorByLevel = {
|
||||
# 0: other
|
||||
|
@ -218,13 +220,20 @@ var TrafficLayer = {
|
|||
item.data[k] = item.prop[k].getValue();
|
||||
}
|
||||
}
|
||||
if (oldThreatLevel != item.data['threatLevel']) {
|
||||
var newThrtAll = ATCSwitchThrtAll.getValue();
|
||||
if (oldThreatLevel != item.data['threatLevel'] or newThrtAll != item.data['thrtAllStore']) {
|
||||
item.data['threatLevelDirty'] = 1;
|
||||
item.data['thrtAllStore'] = newThrtAll;
|
||||
}
|
||||
},
|
||||
|
||||
redrawItem: func (item) {
|
||||
#debug.dump("REDRAW ", item.data);
|
||||
if (item.data['thrtAllStore'] == 1) {
|
||||
item.elems.master.hide();
|
||||
return;
|
||||
}
|
||||
|
||||
var lat = item.data['lat'];
|
||||
var lon = item.data['lon'];
|
||||
var alt = item.data['alt'];
|
||||
|
@ -240,8 +249,15 @@ var TrafficLayer = {
|
|||
}
|
||||
|
||||
var altDiff100 = ((item.data['alt'] or me.refAlt) - me.refAlt) / 100;
|
||||
|
||||
if (altDiff100 > 99 or altDiff100 < -99) { # check TCAS vertical range
|
||||
var top = 27;
|
||||
var bottom = -27;
|
||||
if (ATCSwitchAbvBlw.getValue() == -1) {
|
||||
top = 99;
|
||||
}
|
||||
if (ATCSwitchAbvBlw.getValue() == 1) {
|
||||
bottom = -99;
|
||||
}
|
||||
if (altDiff100 > top or altDiff100 < bottom) { # check TCAS vertical range
|
||||
item.elems.master.hide();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue