Package xal.app.knobs

Class BumpGenerator


  • public class BumpGenerator
    extends Object
    Generates closed bump knobs using the specified number of correctors
    • Field Detail

      • MESSAGE_CENTER

        protected final xal.tools.messaging.MessageCenter MESSAGE_CENTER
        message center for dispatching events to registered listeners
      • EVENT_PROXY

        protected final BumpGeneratorListener EVENT_PROXY
        proxy which forwards events to registers listeners
      • KNOBS_MODEL

        protected final KnobsModel KNOBS_MODEL
        the knobs model into which we will be putting the bump knobs
      • _sequence

        protected final xal.smf.AcceleratorSeq _sequence
        accelerator sequence where we want the knobs
      • _knobGroup

        protected final KnobGroup _knobGroup
        knob group into which we should add the bumps knobs
      • _planeAdaptor

        protected PlaneAdaptor _planeAdaptor
        plane (horizontal or vertical) adaptor for handling plane specific behavior
      • _bumpShapeAdaptor

        protected BumpShapeAdaptor _bumpShapeAdaptor
        bump shape adaptor for determining the shape of the bump
      • _elementCount

        protected int _elementCount
        number of correctors to use in the bump
      • _scenario

        protected xal.sim.scenario.Scenario _scenario
        online model scenario
      • _probe

        protected xal.model.probe.Probe<?> _probe
        online model probe
      • _baseTrajectory

        protected xal.model.probe.traj.Trajectory<?> _baseTrajectory
        base trajectory
      • RUN_LOCK

        protected final Object RUN_LOCK
        lock for synchronizing runs
      • _bumpCount

        protected int _bumpCount
        number of bumps to make
      • _usesLiveModel

        protected boolean _usesLiveModel
        determines whether or not to use a live model
      • _processedBumpCount

        protected volatile int _processedBumpCount
        number of bumps processed whether they were successfully made or not
      • _shouldCancelBumpGeneration

        protected volatile boolean _shouldCancelBumpGeneration
        indicates whether the generator should cancel generating bumps
    • Constructor Detail

    • Method Detail

      • addBumpGeneratorListener

        public void addBumpGeneratorListener​(BumpGeneratorListener listener)
        register listener for receiving bump generator events from this source
      • removeBumpGeneratorListener

        public void removeBumpGeneratorListener​(BumpGeneratorListener listener)
        remove the listener from receiving bump generator events from this source
      • setUsesLiveModel

        public void setUsesLiveModel​(boolean usesLiveModel)
        set whether or not to use a live model
      • usesLiveModel

        public boolean usesLiveModel()
        determine whether or not we are using the live model
      • setPlaneAdaptor

        public void setPlaneAdaptor​(PlaneAdaptor planeAdaptor)
        set the plane adaptor
      • setBumpShapeAdaptor

        public void setBumpShapeAdaptor​(BumpShapeAdaptor shapeAdaptor)
        set the bump shape adaptor
      • getBumpShapeAdaptor

        public BumpShapeAdaptor getBumpShapeAdaptor()
        get the bump shape adaptor
      • setBumpElementCount

        public void setBumpElementCount​(int count)
        set the number of bumps elements
      • getBumpCount

        public int getBumpCount()
        get the number of bumps to make
      • getProcessedBumpCount

        public int getProcessedBumpCount()
        get the number of bumps processed whether or not the bump was successfully made
      • cancelBumpGeneration

        public void cancelBumpGeneration()
        set whether the generator should cancel processing bumps
      • getCorrectorsNear

        protected List<xal.smf.impl.Dipole> getCorrectorsNear​(xal.smf.AcceleratorNode node)
        get correctors near the reference node
      • nodesSurroundingReference

        protected List<xal.smf.impl.Dipole> nodesSurroundingReference​(List<xal.smf.impl.Dipole> magnets,
                                                                      xal.smf.AcceleratorNode referenceNode)
        get the nearest nodes by proximity, but making sure that there is at least one node on either side of the reference
      • calculateBaseTrajectory

        protected void calculateBaseTrajectory()
        calculate the base trajectory
      • getBaseOrbit

        protected double[] getBaseOrbit​(xal.smf.AcceleratorNode bumpNode,
                                        xal.smf.AcceleratorNode endNode)
        calculate the base orbit
      • calculateResponse

        protected double[] calculateResponse​(xal.smf.AcceleratorNode bumpNode,
                                             xal.smf.AcceleratorNode endNode,
                                             xal.smf.impl.Dipole magnet,
                                             double amplitude)
        calculate the orbit
      • calculateBumpFields

        protected double[] calculateBumpFields​(List<xal.smf.impl.Dipole> magnets,
                                               xal.smf.AcceleratorNode targetNode)
        calculate the bump
      • makeBumpKnob

        protected Knob makeBumpKnob​(xal.smf.AcceleratorNode node)
        create a bump knob
      • makeBumpKnobs

        public void makeBumpKnobs()
        create the bumps