Package jisa.control

Class Repeat

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.Double>

    public class Repeat
    extends java.lang.Object
    implements java.lang.Iterable<java.lang.Double>
    • Constructor Detail

      • Repeat

        public Repeat​(int count,
                      int delay,
                      Repeat.Measurement measurement)
        Creates a Repeat object - for performing repeat measurements. The repeat will not run until run() is called.
        Parameters:
        count - The number of repeats to perform
        delay - The delay, in milliseconds, to wait before each repeat
        measurement - The measurement to repeat
    • Method Detail

      • run

        public static Repeat run​(int count,
                                 int delay,
                                 Repeat.Measurement measurement)
                          throws java.lang.Exception
        Creates and runs a repeat measurement, returning it as a Repeat object after performing all repeat measurements.
        Parameters:
        count - Number of repeats
        delay - Delay in milliseconds before each repeat
        measurement - The measurement to run
        Returns:
        Repeat object containing the repeated measurements
        Throws:
        java.lang.Exception - Upon error running measurement
      • prepare

        public static Repeat prepare​(int count,
                                     int delay,
                                     Repeat.Measurement measurement)
        Creates a repeat measurement without running it, returning it as a Repeat object. Will not run until run() is called on it.
        Parameters:
        count - Number of repeats
        delay - Delay in milliseconds before each repeat
        measurement - The measurement to run
        Returns:
        Repeat object, awaiting run.
      • runTogether

        public static void runTogether​(Repeat... repeats)
                                throws java.lang.Exception
        Runs multiple repeat measurements together side-by-side. Each Repeat must be configured to have the same count and delay time.
        Parameters:
        repeats - The Repeat objects to run
        Throws:
        java.lang.Exception - Upon measurement error, or if the Repeat objects have differing counts and/or delays.
      • runInParallel

        public static void runInParallel​(Repeat... repeats)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • run

        public void run()
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isComplete

        public boolean isComplete()
      • getValues

        public java.util.List<java.lang.Double> getValues()
      • getValue

        public double getValue​(int repeat)
      • getMin

        public double getMin()
      • getMax

        public double getMax()
      • getRange

        public double getRange()
      • getSum

        public double getSum()
      • getCount

        public int getCount()
      • getDelay

        public int getDelay()
      • getMean

        public double getMean()
      • getVariance

        public double getVariance()
      • getStandardDeviation

        public double getStandardDeviation()
      • iterator

        public java.util.Iterator<java.lang.Double> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.Double>