Airbag: bug fix
This commit is contained in:
parent
b3afca0662
commit
c7d0f834d0
|
@ -486,20 +486,21 @@ var Safety = {
|
|||
if(math.abs(me.accXProp.getValue() * FT2M) > me.airbagAccelerationLimit){
|
||||
#active Front
|
||||
me.frontAirbagProp.setValue(1);
|
||||
me.safetySystemTimer.stop();
|
||||
}
|
||||
#side airbag
|
||||
if(math.abs(me.accYProp.getValue() * FT2M) > me.airbagAccelerationLimit){
|
||||
#active side
|
||||
me.sideAirbagProp.setValue(1);
|
||||
me.safetySystemTimer.stop();
|
||||
}
|
||||
},
|
||||
reset: func(){
|
||||
#resetting stops the system
|
||||
me.safetySystemTimer.stop();
|
||||
me.frontAirbagProp.setValue(0);
|
||||
me.frontAirbagProp.setValue(0);
|
||||
me.sideAirbagProp.setValue(0);
|
||||
},
|
||||
init: func(){
|
||||
#initialize or reinitialize
|
||||
me.frontAirbagProp.setValue(0);
|
||||
me.sideAirbagProp.setValue(0);
|
||||
if(me.safetySystemTimer == nil) me.safetySystemTimer = maketimer(me.updateInterval, func me.update());
|
||||
|
|
|
@ -135,12 +135,22 @@
|
|||
</button>
|
||||
<button>
|
||||
<halign>left</halign>
|
||||
<legend>Toggle Airbag</legend>
|
||||
<legend>Enable/Repair Airbag</legend>
|
||||
<pref-width>120</pref-width>
|
||||
<pref-height>28</pref-height>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>followme.safety.toggle()</script>
|
||||
<script>followme.safety.init()</script>
|
||||
</binding>
|
||||
</button>
|
||||
<button>
|
||||
<halign>left</halign>
|
||||
<legend>Disable Airbag</legend>
|
||||
<pref-width>120</pref-width>
|
||||
<pref-height>28</pref-height>
|
||||
<binding>
|
||||
<command>nasal</command>
|
||||
<script>followme.safety.stop()</script>
|
||||
</binding>
|
||||
</button>
|
||||
</group>
|
||||
|
|
Loading…
Reference in New Issue