Example #1
0
 /// <summary>
 /// Check that the PDP CAN ID is in valid.
 /// </summary>
 /// <remarks>The default is 0, and this should be used by most teams.</remarks>
 /// <param name="module">The CAN ID to check</param>
 protected static void CheckPDPModule(int module)
 {
     if (!HALPDP.HAL_CheckPDPModule(module))
     {
         StringBuilder buf = new StringBuilder();
         buf.Append("Requested PDP module is out of range. Minimum: 0, Maximum: ");
         buf.Append(PDPModules);
         buf.Append(", Requested: ");
         buf.Append(module);
         throw new ArgumentOutOfRangeException(nameof(module), "Requested PDP module number is out of range.");
     }
 }
Example #2
0
 /// <summary>
 /// Check that the power distribution channel number is valid.
 /// </summary>
 /// <remarks>Channel numbers are 0 based on the PDP.</remarks>
 /// <param name="channel">The channel number to check.</param>
 protected static void CheckPDPChannel(int channel)
 {
     if (!HALPDP.HAL_CheckPDPChannel(channel))
     {
         StringBuilder buf = new StringBuilder();
         buf.Append("Requested PDP channel is out of range. Minimum: 0, Maximum: ");
         buf.Append(PDPChannels);
         buf.Append(", Requested: ");
         buf.Append(channel);
         throw new ArgumentOutOfRangeException(nameof(channel), "Requested PDP channel number is out of range.");
     }
 }