Package gda.scan

Class TrajectoryScanPreparer

java.lang.Object
gda.factory.FindableBase
gda.scan.TrajectoryScanPreparer
All Implemented Interfaces:
Findable, org.springframework.beans.factory.InitializingBean

public class TrajectoryScanPreparer extends FindableBase implements org.springframework.beans.factory.InitializingBean
Epics controller for Trajectory scan. Contains getters, setters for accessing PVs for time, position, velocity mode, user mode arrays, etc. needed for setting up, building and executing a trajectory scan. Trajectories can also be built up in memory by using the functions addPointsToTrajectory(java.lang.Double[], java.lang.Double[], java.lang.Integer[]),
invalid reference
#addSpectrumToTrajectory
, addPointsForTimingGroups(gda.scan.TurboXasMotorParameters) before sending to Epics using sendProfileValues().
Since:
12/1/2017
  • Constructor Details

    • TrajectoryScanPreparer

      public TrajectoryScanPreparer()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • setProfileTimeArray

      public void setProfileTimeArray(Double[] vals) throws IOException
      Throws:
      IOException
    • setBuildProfile

      public void setBuildProfile() throws Exception
      Throws:
      Exception
    • getBuildProfileStatus

      public TrajectoryScanController.Status getBuildProfileStatus() throws Exception
      Throws:
      Exception
    • setAppendProfile

      public void setAppendProfile() throws Exception
      Throws:
      Exception
    • getAppendProfileStatus

      public TrajectoryScanController.Status getAppendProfileStatus() throws Exception
      Throws:
      Exception
    • setExecuteProfile

      public void setExecuteProfile() throws Exception
      Throws:
      Exception
    • setAbortProfile

      public void setAbortProfile() throws Exception
      Throws:
      Exception
    • setDefaults

      public void setDefaults() throws Exception
      Throws:
      Exception
    • addPointsForTimingGroups

      public void addPointsForTimingGroups(TurboXasMotorParameters motorParameters)
      Setup trajectory scan points using timing groups from TurboXasParameters
      Parameters:
      motorParameters -
    • createTurnaroundParameters

      public List<gda.scan.TrajectoryScanPreparer.TurnaroundParameters> createTurnaroundParameters(TurboXasMotorParameters motorParams, List<TurboSlitTimingGroup> timingGroups)
      Calculate the runup/down distances and times for each spectrum in bi-directional scan. The rundown distance is adjusted to match the runup of next spectrum, to make sure end/start positions between timing groups match up.
      Parameters:
      motorParams -
      Returns:
    • addSpectraBiDirectional

      public void addSpectraBiDirectional(TurboXasMotorParameters motorParameters, List<TurboSlitTimingGroup> timingGroups, List<gda.scan.TrajectoryScanPreparer.TurnaroundParameters> turnaroundParams)
    • addSpectrumToTrajectoryRunupDown

      public void addSpectrumToTrajectoryRunupDown(double spectrumStart, double spectrumEnd, double timeForSpectrum, gda.scan.TrajectoryScanPreparer.TurnaroundParameters turnparams)
    • addSpectraMonoDirectional

      public void addSpectraMonoDirectional(TurboXasMotorParameters motorParameters, List<TurboSlitTimingGroup> timingGroups)
      Adds several repetitions of same spectrum, using
      invalid reference
      #addSpectrumToTrajectorySubdivide(double, double, double, double, double, double, boolean)
      .
      Parameters:
      userStart -
      userEnd -
      startDelta -
      endDelta -
      timeForSpectrum -
      timeBetweenSpectra -
      numRepetitions -
    • addSpectrumToTrajectorySubdivide

      public void addSpectrumToTrajectorySubdivide(double userStart, double userEnd, double startDelta, double endDelta, double timeForSpectrum, double timeBetweenSpectra)
      Same as
      invalid reference
      #addSpectrumToTrajectoryTimes(double, double, double, double, double, double, int)
      except move corresponding to spectrum collection and move back to beginning are subdivided into number of steps (numStepsForSpectrumSweep, numStepsForReturnSweep respectively).
      Parameters:
      userStart -
      userEnd -
      startDelta -
      endDelta -
      timeForSpectrum -
      timeBetweenSpectra -
      includeMoveToInitialPosition - include initial move to start of trajectory (set to true for first spectrum only, since move back to start is added at end of each spectrum sweep)
    • addSubdividedStep

      public void addSubdividedStep(double startPos, double endPos, double timeForMove, int numSteps, int velocityMode)
      Add 'numSteps' positions between startPos and endPos to trajectory (constant speed), taking total of timeForMove seconds for whole move.'
      Parameters:
      startPos - start position
      endPos - end position
      timeForMove - total time to take for move
      numSteps - number of steps to add
      velocityMode - velocity mode to use
    • addPointsToTrajectory

      public void addPointsToTrajectory(Double[] positions, Double[] times, Integer[] velocityMode)
      Add position, time, velocity mode arrays to trajectory point list.
      Parameters:
      positions -
      times -
      velocityMode -
    • addPointToTrajectory

      public void addPointToTrajectory(double position, double time, int velocityMode)
    • sendProfileValues

      public void sendProfileValues() throws Exception
      Send currently stored trajectory scan list values to Epics. (i.e. convert from List to array and send to appropriate PV)
      Throws:
      Exception
    • sendAppendProfileValues

      public void sendAppendProfileValues() throws Exception
      Send trajectory profile to Epics, building and appending as many times as necessary to send all the points. See also sendAppendProfileValues(int).
      Throws:
      Exception
    • sendAppendProfileValues

      public int sendAppendProfileValues(int startPoint) throws Exception
      Build/append profile in Epics; take range of values from trajectory scan list. Build if startPoint==0; otherwise Append. Use 'maxPointsPerProfileBuild' to set the number of profile points sent per build/append operation.
      Parameters:
      startPoint - index of first point in trajectory profile to send.
      Returns:
      index of next point to be sent to Epics
      Throws:
      Exception
    • getTrajectoryPositionsList

      public List<Double> getTrajectoryPositionsList()
    • setTrajectoryPositionList

      public void setTrajectoryPositionList(List<Double> positionProfileValues)
    • getTrajectoryTimesList

      public List<Double> getTrajectoryTimesList()
    • setTrajectoryTimesList

      public void setTrajectoryTimesList(List<Double> timeProfileValues)
    • getTrajectoryVelocityModesList

      public List<Integer> getTrajectoryVelocityModesList()
    • setTrajectoryVelocityModesList

      public void setTrajectoryVelocityModesList(List<Integer> velocityModeProfileValues)
    • clearTrajectoryLists

      public void clearTrajectoryLists()
    • getNumStepsForReturnSweep

      public int getNumStepsForReturnSweep()
    • setNumStepsForReturnSweep

      public void setNumStepsForReturnSweep(int numStepsForReturnSweep)
    • getNumStepsForSpectrumSweep

      public int getNumStepsForSpectrumSweep()
    • setNumStepsForSpectrumSweep

      public void setNumStepsForSpectrumSweep(int numStepsForSpectrumSweep)
    • getMaxTimePerStep

      public double getMaxTimePerStep()
    • setMaxTimePerStep

      public void setMaxTimePerStep(double maxTimePerStep)
    • getUseMaxTimePerStep

      public boolean getUseMaxTimePerStep()
    • setUseMaxTimePerStep

      public void setUseMaxTimePerStep(boolean useMaxTimePerStep)
    • getTrajectoryScanController

      public TrajectoryScanController getTrajectoryScanController()
    • setTrajectoryScanController

      public void setTrajectoryScanController(TrajectoryScanController trajScanController)
    • isTwoWayScan

      public boolean isTwoWayScan()
    • setTwoWayScan

      public void setTwoWayScan(boolean twoWayScan)
    • getTimeForRundown

      public double getTimeForRundown()
    • setTimeForRundown

      public void setTimeForRundown(double minTimeForRundown)
    • isUseFixedTurnaroundDistance

      public boolean isUseFixedTurnaroundDistance()
    • setUseFixedTurnaroundDistance

      public void setUseFixedTurnaroundDistance(boolean useFixedTurnaroundDistance)
    • getTurnaroundDistance

      public double getTurnaroundDistance()
    • setTurnaroundDistance

      public void setTurnaroundDistance(double turnaroundDistance)