Package xal.app.knobs
Class BumpGenerator
- java.lang.Object
-
- xal.app.knobs.BumpGenerator
-
public class BumpGenerator extends Object
Generates closed bump knobs using the specified number of correctors
-
-
Field Summary
Fields Modifier and Type Field Description protected xal.model.probe.traj.Trajectory<?>_baseTrajectorybase trajectoryprotected int_bumpCountnumber of bumps to makeprotected BumpShapeAdaptor_bumpShapeAdaptorbump shape adaptor for determining the shape of the bumpprotected int_elementCountnumber of correctors to use in the bumpprotected KnobGroup_knobGroupknob group into which we should add the bumps knobsprotected PlaneAdaptor_planeAdaptorplane (horizontal or vertical) adaptor for handling plane specific behaviorprotected xal.model.probe.Probe<?>_probeonline model probeprotected int_processedBumpCountnumber of bumps processed whether they were successfully made or notprotected xal.sim.scenario.Scenario_scenarioonline model scenarioprotected xal.smf.AcceleratorSeq_sequenceaccelerator sequence where we want the knobsprotected boolean_shouldCancelBumpGenerationindicates whether the generator should cancel generating bumpsprotected boolean_usesLiveModeldetermines whether or not to use a live modelprotected BumpGeneratorListenerEVENT_PROXYproxy which forwards events to registers listenersprotected KnobsModelKNOBS_MODELthe knobs model into which we will be putting the bump knobsprotected xal.tools.messaging.MessageCenterMESSAGE_CENTERmessage center for dispatching events to registered listenersprotected ObjectRUN_LOCKlock for synchronizing runs
-
Constructor Summary
Constructors Constructor Description BumpGenerator(KnobsModel model, KnobGroup group)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBumpGeneratorListener(BumpGeneratorListener listener)register listener for receiving bump generator events from this sourceprotected voidcalculateBaseTrajectory()calculate the base trajectoryprotected double[]calculateBumpFields(List<xal.smf.impl.Dipole> magnets, xal.smf.AcceleratorNode targetNode)calculate the bumpprotected double[]calculateResponse(xal.smf.AcceleratorNode bumpNode, xal.smf.AcceleratorNode endNode, xal.smf.impl.Dipole magnet, double amplitude)calculate the orbitvoidcancelBumpGeneration()set whether the generator should cancel processing bumpsprotected double[]getBaseOrbit(xal.smf.AcceleratorNode bumpNode, xal.smf.AcceleratorNode endNode)calculate the base orbitintgetBumpCount()get the number of bumps to makeBumpShapeAdaptorgetBumpShapeAdaptor()get the bump shape adaptorprotected List<xal.smf.impl.Dipole>getCorrectorsNear(xal.smf.AcceleratorNode node)get correctors near the reference nodeintgetProcessedBumpCount()get the number of bumps processed whether or not the bump was successfully madeprotected KnobmakeBumpKnob(xal.smf.AcceleratorNode node)create a bump knobvoidmakeBumpKnobs()create the bumpsprotected 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 referencevoidremoveBumpGeneratorListener(BumpGeneratorListener listener)remove the listener from receiving bump generator events from this sourcevoidsetBumpElementCount(int count)set the number of bumps elementsvoidsetBumpShapeAdaptor(BumpShapeAdaptor shapeAdaptor)set the bump shape adaptorvoidsetPlaneAdaptor(PlaneAdaptor planeAdaptor)set the plane adaptorvoidsetUsesLiveModel(boolean usesLiveModel)set whether or not to use a live modelbooleanusesLiveModel()determine whether or not we are using the live model
-
-
-
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
-
BumpGenerator
public BumpGenerator(KnobsModel model, KnobGroup group)
Constructor
-
-
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
-
-