public override ControllerState GetState() { if (EmergencyBrakingPushButton()) { return(ControllerState.EBPB); } else if (TCSEmergencyBraking()) { return(ControllerState.TCSEmergency); } else if (TCSFullServiceBraking()) { return(ControllerState.TCSFullServ); } else if (OverchargeButtonPressed()) { return(ControllerState.Overcharge); } else if (QuickReleaseButtonPressed()) { return(ControllerState.FullQuickRelease); } else if (NotchController != null && NotchController.NotchCount() > 0) { return(NotchController.GetCurrentNotch().NotchStateType); } else { return(ControllerState.Dummy); } }
public override float?GetStateFraction() { if (EmergencyBrakingPushButton() || TCSEmergencyBraking() || TCSFullServiceBraking() || QuickReleaseButtonPressed() || OverchargeButtonPressed()) { return(null); } else if (NotchController != null) { if (NotchController.NotchCount() == 0) { return(NotchController.CurrentValue); } else { INotchController notch = NotchController.GetCurrentNotch(); if (!notch.Smooth) { if (notch.NotchStateType == ControllerState.Dummy) { return(NotchController.CurrentValue); } else { return(null); } } else { return(NotchController.GetNotchFraction()); } } } else { return(null); } }