/// <summary> /// Checks the state of the vehicle and flashes the warning LEDs if necessary. /// </summary> /// private void checkVehicleState() { scriptVehicleData.GetData(ref vehicleData); VehicleSafetyControl.State state = vehicleData.safetyState; // any changes? if (state != oldState) { switch (state) { case VehicleSafetyControl.State.NOMINAL: { // no more blinking setLed(ledLeft, 0); setLed(ledRight, 0); break; } case VehicleSafetyControl.State.OVERHEAT_WHEEL_L: { // left LED blink setLedColour(ledLeft, scriptConfiguration.warningLightColour); setLed(ledLeft, 99, 500, 50); break; } case VehicleSafetyControl.State.OVERHEAT_WHEEL_R: { // right LED blink setLedColour(ledRight, scriptConfiguration.warningLightColour); setLed(ledRight, 99, 500, 50); break; } case VehicleSafetyControl.State.ABORT: { changeHudPage(HudPage.ABORT); break; } } oldState = state; } }
/// <summary> /// Checks the state of the vehicle and flashes the warning LEDs if necessary. /// </summary> /// private void checkVehicleState() { scriptVehicleData.GetData(ref vehicleData); VehicleSafetyControl.State state = vehicleData.safetyState; // any changes? if ( state != oldState ) { switch ( state ) { case VehicleSafetyControl.State.NOMINAL: { // no more blinking setLed(ledLeft, 0); setLed(ledRight, 0); break; } case VehicleSafetyControl.State.OVERHEAT_WHEEL_L: { // left LED blink setLedColour(ledLeft, scriptConfiguration.warningLightColour); setLed(ledLeft, 99, 500, 50); break; } case VehicleSafetyControl.State.OVERHEAT_WHEEL_R: { // right LED blink setLedColour(ledRight, scriptConfiguration.warningLightColour); setLed(ledRight, 99, 500, 50); break; } case VehicleSafetyControl.State.ABORT: { changeHudPage(HudPage.ABORT); break; } } oldState = state; } }