/// <summary> /// Verify that the solenoid module is correct /// </summary> /// <param name="moduleNumber">The module number to check.</param> protected static void CheckSolenoidModule(int moduleNumber) { if (!HALSolenoid.HAL_CheckSolenoidModule(moduleNumber)) { StringBuilder buf = new StringBuilder(); buf.Append("Requested solenoid module is out of range. Minimum: 0, Maximum: "); buf.Append(PCMModules); buf.Append(", Requested: "); buf.Append(moduleNumber); throw new ArgumentOutOfRangeException(nameof(moduleNumber), buf.ToString()); } }
/// <summary> /// Check that the solenoid channel number is valid. /// </summary> /// <remarks>Channel numbers are 0 based on the PCM.</remarks> /// <param name="channel">The channel number to check.</param> protected static void CheckSolenoidChannel(int channel) { if (!HALSolenoid.HAL_CheckSolenoidChannel(channel)) { StringBuilder buf = new StringBuilder(); buf.Append("Requested solenoid channel is out of range. Minimum: 0, Maximum: "); buf.Append(SolenoidChannels); buf.Append(", Requested: "); buf.Append(channel); throw new ArgumentOutOfRangeException(nameof(channel), "Requested solenoid channel number is out of range."); } }