Class DummyAdc

All Implemented Interfaces:
Adc, Device, Configurable, Findable, gda.observable.IObservable

public class DummyAdc extends DeviceBase implements Adc
Dummy implementation of the Adc class
  • Constructor Details

    • DummyAdc

      public DummyAdc()
      The Constructor.
  • Method Details

    • getVoltage

      public double getVoltage(int channel) throws DeviceException
      Description copied from interface: Adc
      Get the current voltage for the specified channel.
      Specified by:
      getVoltage in interface Adc
      Parameters:
      channel - the ADC channel to read
      Returns:
      the current voltage (units are implementation specific)
      Throws:
      DeviceException
    • getVoltages

      public double[] getVoltages() throws DeviceException
      Description copied from interface: Adc
      Get the current voltage from all open channels.
      Specified by:
      getVoltages in interface Adc
      Returns:
      the current voltages (units are implementation specific)
      Throws:
      DeviceException
    • setRange

      public void setRange(int channel, int range) throws DeviceException
      Description copied from interface: Adc
      Set the voltage Range for the specified channel.
      Specified by:
      setRange in interface Adc
      Parameters:
      channel - the ADC channel to set
      range - the range to set (units are implementation specific)
      Throws:
      DeviceException
      See Also:
    • getRange

      public int getRange(int channel) throws DeviceException
      Description copied from interface: Adc
      Get the current voltage Range for the specified channel.
      Specified by:
      getRange in interface Adc
      Parameters:
      channel - the ADC channel to get
      Returns:
      the range (units are implementation specific)
      Throws:
      DeviceException
      See Also:
    • setUniPolar

      public void setUniPolar(int channel, boolean polarity) throws DeviceException
      Description copied from interface: Adc
      Set the unipolar or bipolar mode for a specified channel.
      Specified by:
      setUniPolar in interface Adc
      Parameters:
      channel - the ADC channel to set
      polarity - unipolar mode either true or false
      Throws:
      DeviceException
      See Also:
    • getRanges

      public int[] getRanges() throws DeviceException
      Description copied from interface: Adc
      Get the supported ranges for a particular ADC.
      Specified by:
      getRanges in interface Adc
      Returns:
      the supported voltage ranges (units are implementation specific)
      Throws:
      DeviceException
    • isUniPolarSettable

      public boolean isUniPolarSettable() throws DeviceException
      Description copied from interface: Adc
      Get the polarity capability of the ADC.
      Specified by:
      isUniPolarSettable in interface Adc
      Returns:
      true if UNIPOLAR is supported else assume BIPOLAR
      Throws:
      DeviceException
    • setSampleCount

      public void setSampleCount(int count) throws DeviceException
      Description copied from interface: Adc
      Set the sample count for the ADC monitoring.
      Specified by:
      setSampleCount in interface Adc
      Parameters:
      count - the number of samples to read
      Throws:
      DeviceException
    • setValueSuggester

      public void setValueSuggester(DummyValueSuggester vs)
      Set the method used to generate an appropriate value
      Parameters:
      vs - DummyValueSuggester to be used.