Example #1
0
 /**
  * <summary>
  *   Changes the electric signal sampling method to use.
  * <para>
  *   The <c>HIGH_RATE</c> method uses the highest sampling frequency, without any filtering.
  *   The <c>HIGH_RATE_FILTERED</c> method adds a windowed 7-sample median filter.
  *   The <c>LOW_NOISE</c> method uses a reduced acquisition frequency to reduce noise.
  *   The <c>LOW_NOISE_FILTERED</c> method combines a reduced frequency with the median filter
  *   to get measures as stable as possible when working on a noisy signal.
  *   Remember to call the <c>saveToFlash()</c>
  *   method of the module if the modification must be kept.
  * </para>
  * <para>
  * </para>
  * </summary>
  * <param name="newval">
  *   a value among <c>YGenericSensor.SIGNALSAMPLING_HIGH_RATE</c>,
  *   <c>YGenericSensor.SIGNALSAMPLING_HIGH_RATE_FILTERED</c>, <c>YGenericSensor.SIGNALSAMPLING_LOW_NOISE</c>,
  *   <c>YGenericSensor.SIGNALSAMPLING_LOW_NOISE_FILTERED</c> and <c>YGenericSensor.SIGNALSAMPLING_HIGHEST_RATE</c>
  *   corresponding to the electric signal sampling method to use
  * </param>
  * <para>
  * </para>
  * <returns>
  *   <c>0</c> if the call succeeds.
  * </returns>
  * <para>
  *   On failure, throws an exception or returns a negative error code.
  * </para>
  */
 public int set_signalSampling(int newval)
 {
     if (_func == null)
     {
         throw new YoctoApiProxyException("No GenericSensor connected");
     }
     if (newval == _SignalSampling_INVALID)
     {
         return(YAPI.SUCCESS);
     }
     // our enums start at 0 instead of the 'usual' -1 for invalid
     return(_func.set_signalSampling(newval - 1));
 }