Exemple #1
0
 /// <summary>
 /// Gets the digital value of the provided IO line.
 /// </summary>
 /// <param name="ioLine">The IO line to get its digital value.</param>
 /// <returns>The IOValue of the specified <paramref name="ioLine"/></returns>
 /// <example>To verify if this sample contains a digital value for the
 /// specified <paramref name="ioLine"/>, use the method <see cref="HasDigitalValue(IOLine)"/>.
 /// <code>if (ioSample.HasDigitalValue(IOLine.DIO0_AD0)) {
 /// IOValue value = ioSample.GetDigitalValue(IOLine.DIO0_AD0);
 /// ...
 /// } else {
 /// ...
 /// }
 /// }
 /// </code></example>
 /// <seealso cref="DigitalValues"/>
 /// <seealso cref="HasDigitalValues"/>
 /// <seealso cref="IOLine"/>
 /// <seealso cref="IOValue"/>
 public IOValue GetDigitalValue(IOLine ioLine)
 {
     if (!DigitalValues.ContainsKey(ioLine))
     {
         return(IOValue.UNKNOWN);
     }
     return(DigitalValues[ioLine]);
 }
Exemple #2
0
 /// <summary>
 /// Indicates whether the IO sample contains a digital value for the specified <paramref name="ioLine"/>
 /// </summary>
 /// <param name="ioLine">The IO line to check if has a digital value.</param>
 /// <returns><c>true</c> if the specified <paramref name="ioLine"/> has a digital value, <c>false</c>
 /// otherwises.</returns>
 public bool HasDigitalValue(IOLine ioLine)
 {
     return(DigitalValues.ContainsKey(ioLine));
 }