Systems: Added emergency mode

This commit is contained in:
Sidi Liang 2020-04-04 18:40:13 +08:00
parent 26a847739e
commit f5f3086865
No known key found for this signature in database
GPG Key ID: 79F0A6B20B72F42F
1 changed files with 9 additions and 0 deletions

View File

@ -487,13 +487,22 @@ var Safety = {
if(math.abs(me.accXProp.getValue() * FT2M) > me.airbagAccelerationLimit){
#active Front
me.frontAirbagProp.setValue(1);
me.emergencyMode();
}
#side airbag
if(math.abs(me.accYProp.getValue() * FT2M) > me.sideAirbagAccelerationLimit){
#active side
me.sideAirbagProp.setValue(1);
me.emergencyMode();
}
},
emergencyMode: func(){
indicatorController.setMode(3); #Active malfunction light
if(autospeed.autoSpeedTimer.isRunning) autospeed.stopAutoSpeed();
if(autopilot.road_check_timer.isRunning) autopilot.road_check_timer.stop();
},
reset: func(){
#resetting stops the system
me.safetySystemTimer.stop();