1
0
Fork 0

Comm PTT listeners; fix fault

This commit is contained in:
Richard Harrison 2019-03-20 08:07:21 +01:00
parent 4c6b103293
commit 480311eeef

View file

@ -566,7 +566,7 @@ var ptt = func(b) setprop("/controls/radios/comm-ptt", b);
_setlistener("/instrumentation/comm[0]/ptt", func { _setlistener("/instrumentation/comm[0]/ptt", func {
var v=getprop("/instrumentation/comm[0]/ptt"); var v=getprop("/instrumentation/comm[0]/ptt");
setprop("/controls/radios/comm-radio-selected", 1); setprop("/controls/radios/comm-radio-selected", 1);
if (v.getValue()) if (v)
setprop("/controls/radios/comm-ptt", 1); setprop("/controls/radios/comm-ptt", 1);
else else
setprop("/controls/radios/comm-ptt", 0); setprop("/controls/radios/comm-ptt", 0);
@ -575,7 +575,7 @@ _setlistener("/instrumentation/comm[0]/ptt", func {
_setlistener("/instrumentation/comm[1]/ptt", func { _setlistener("/instrumentation/comm[1]/ptt", func {
var v=getprop("/instrumentation/comm[1]/ptt"); var v=getprop("/instrumentation/comm[1]/ptt");
setprop("/controls/radios/comm-radio-selected", 2); setprop("/controls/radios/comm-radio-selected", 2);
if (v.getValue()) if (v)
setprop("/controls/radios/comm-ptt", 2); setprop("/controls/radios/comm-ptt", 2);
else else
setprop("/controls/radios/comm-ptt", 0); setprop("/controls/radios/comm-ptt", 0);