Class OrbitCorrectionController
- All Implemented Interfaces:
IConfigurable
Static part of OrbitCorrection procedure, holds references to models and data, which does not change through correction procedure.
- Author:
- igor@scictrl.com
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
ConstantAOC_HORIZONTAL="aoc.horizontal"
static final String
ConstantAOC_MIN_BEAM_CURRENT="aoc.minBeamCurrent"
static final String
ConstantAOC_STEP_WAIT_TIME="aoc.stepWaitTime"
static final String
ConstantAOC_VERTICAL="aoc.vertical"
protected int
Maximum number of steps correction will make when applying correctors. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAutomaticOrbitCorrectionListener.void
addCorrection.void
applyCorrection
(OrbitCorrectionOperator op, Correction corr) applyCorrection.void
Execute undo operation, if possible.calculateCorrection.calculateResponseMatrix.boolean
canUndo()
Returnstrue
if undo operation can be executed.void
checkBeamCurrent.String[]
checkBPMs
(ElementList<BPMonitor> bpms) Makes quick local check of usability of devices and returns array with names of failed devices.boolean
checkDevices
(AutomaticOrbitCorrectionOperator operator, Orientation o, boolean fail) checkDevices.String[]
Makes quick local check of usability of devices and returns array with names of failed devices.void
configure
(org.apache.commons.configuration.Configuration conf) configure.void
debugDataDump.void
dumpData
(AutomaticOrbitCorrectionOperator operator) Dumps all available data into a file for debuggin purposes.void
fireNewCorrection
(Correction correction) fireNewCorrection.void
fireProgressReport
(double progress, String message) fireProgressReport.void
fireStateChange
(OrbitCorrectionOperator.State state, String message) fireStateChange.double
Trys to connect to info server and return currentgetBPMonitors
(Orientation ori) getBPMonitors.double
Getter for the fieldcorrectionScale
.getCorrectors
(Orientation ori) Getter for the fieldcorrectors
.getDataBush.Getter for the fielddataFolder
.Getter for the fieldengine
.double
getMaxStep
(Orientation ori) Getter for the fieldmaxStep
.int
Max count of undo history.double
Getter for the fieldminimalBeamCurrent
.getOrbitCorrectionModel.Getter for the fieldorbitMonitor
.long
Getter for the fieldstepWaitTime
.void
initialize
(ApplicationEngine engine, DataBushServerLocal dbs) initialize.protected void
invalidateAll.boolean
isCorrectHorizontal.boolean
isCorrectVertical.boolean
isDebugDataEnabled.boolean
isMinimalBeamCurrentEnabled.boolean
isRFStepping.Creates new PrintWirtte on new file, where data should be written.void
removeAutomaticOrbitCorrectionListener.void
sendMailNotification
(String message, String debug) sendMailNotification.void
setBPMonitors
(ElementList<BPMonitor> l, Orientation ori) setBPMonitors.void
setCorrectHorizontal
(boolean newCorrectHorizontal) Setter for the fieldcorrectHorizontal
.void
setCorrectionScale
(double correctionScale) Setter for the fieldcorrectionScale
.void
Setter for the fieldcorrectors
.void
setCorrectVertical
(boolean newCorrectVertical) Setter for the fieldcorrectVertical
.void
setDebugDataEnabled
(boolean b) Setter for the fielddebugDataEnabled
.void
setMaxNumberOfSteps
(int maxNumberOfSteps) Setter for the fieldmaxNumberOfSteps
.void
setMaxStep
(Orientation ori, double step) Setter for the fieldmaxStep
.void
setMaxUndo
(int maxUndo) Sets max count of undo history.void
setMinimalBeamCurrent
(double newMinimalBeamCurrent) Setter for the fieldminimalBeamCurrent
.void
setMinimalBeamCurrentEnabled
(boolean b) setMinimalBeamCurrentEnabled.void
setOrbitCorrectionModel.void
setStepWaitTime
(long stepWaitTime) Setter for the fieldstepWaitTime
.void
signalAutomaticOrbitCorrectionEnded.void
signalAutomaticOrbitCorrectionStarted.void
signalOrbitCorrectionEnded.void
signalOrbitCorrectionStarted.startAutomaticOperator.startOperator.boolean
startTest
(AutomaticOrbitCorrectionOperator operator) startTest.void
testBeamCurrent.String[]
testBPMs
(ElementList<BPMonitor> bpms) Makes test of devices and returns array with names of failed devices.boolean
testDevices
(AutomaticOrbitCorrectionOperator operator, Orientation o, boolean fail) testDevices.boolean
testMain
(AutomaticOrbitCorrectionOperator operator, boolean fail) testMain.void
testOnStart
(AutomaticOrbitCorrectionOperator operator) testOnStart.String[]
Makes test of devices and returns array with names of failed devices.
-
Field Details
-
AOC_MIN_BEAM_CURRENT
ConstantAOC_MIN_BEAM_CURRENT="aoc.minBeamCurrent"
- See Also:
-
AOC_STEP_WAIT_TIME
ConstantAOC_STEP_WAIT_TIME="aoc.stepWaitTime"
- See Also:
-
AOC_HORIZONTAL
ConstantAOC_HORIZONTAL="aoc.horizontal"
- See Also:
-
AOC_VERTICAL
ConstantAOC_VERTICAL="aoc.vertical"
- See Also:
-
maxNumberOfSteps
protected int maxNumberOfStepsMaximum number of steps correction will make when applying correctors. 0 means all steps are applied.
-
-
Constructor Details
-
OrbitCorrectionController
public OrbitCorrectionController()Constructor for OrbitCorrectionController.
-
-
Method Details
-
addAutomaticOrbitCorrectionListener
addAutomaticOrbitCorrectionListener.
- Parameters:
listener
- aIOrbitCorrectionListener
object
-
removeAutomaticOrbitCorrectionListener
removeAutomaticOrbitCorrectionListener.
- Parameters:
listener
- aIOrbitCorrectionListener
object
-
fireStateChange
fireStateChange.
- Parameters:
state
- aOrbitCorrectionOperator.State
objectmessage
- aString
object
-
fireNewCorrection
fireNewCorrection.
- Parameters:
correction
- aCorrection
object
-
fireProgressReport
fireProgressReport.
- Parameters:
progress
- a doublemessage
- aString
object
-
getDataFolder
Getter for the field
dataFolder
.- Returns:
- a
File
object
-
newDataFile
Creates new PrintWirtte on new file, where data should be written. After data is being written, the stream must be closed in order data to be preserved.- Returns:
- a
PrintWriter
object
-
sendMailNotification
sendMailNotification.
-
getOrbitMonitor
Getter for the field
orbitMonitor
.- Returns:
- a
OrbitMonitor
object
-
getCorrectors
Getter for the field
correctors
.- Parameters:
ori
- aOrientation
object- Returns:
- a
ElementList
object
-
getDataBush
getDataBush.
- Returns:
- a
DataBush
object
-
getBPMonitors
getBPMonitors.
- Parameters:
ori
- aOrientation
object- Returns:
- a
ElementList
object
-
setOrbitCorrectionModel
setOrbitCorrectionModel.
- Parameters:
model
- aIOrbitCorrectionModel
object
-
getOrbitCorrectionModel
getOrbitCorrectionModel.
- Parameters:
ori
- aOrientation
object- Returns:
- a
IOrbitCorrectionModel
object
-
setStepWaitTime
public void setStepWaitTime(long stepWaitTime) Setter for the field
stepWaitTime
.- Parameters:
stepWaitTime
- a long
-
getStepWaitTime
public long getStepWaitTime()Getter for the field
stepWaitTime
.- Returns:
- a long
-
initialize
initialize.
- Parameters:
engine
- aApplicationEngine
objectdbs
- aDataBushServerLocal
object
-
getEngine
Getter for the field
engine
.- Returns:
- a
ApplicationEngine
object
-
invalidateAll
protected void invalidateAll()invalidateAll.
-
startOperator
startOperator.
- Returns:
- a
OrbitCorrectionOperator
object
-
startAutomaticOperator
startAutomaticOperator.
- Returns:
- a
AutomaticOrbitCorrectionOperator
object
-
startTest
startTest.
- Parameters:
operator
- aAutomaticOrbitCorrectionOperator
object- Returns:
- a boolean
-
calculateCorrection
public Correction calculateCorrection(OrbitCorrectionOperator op, Orientation ori) throws InconsistentDataException calculateCorrection.
- Parameters:
op
- aOrbitCorrectionOperator
objectori
- aOrientation
object- Returns:
- a
Correction
object - Throws:
InconsistentDataException
- if any.
-
setCorrectors
Setter for the field
correctors
.- Parameters:
l
- aElementList
objectori
- aOrientation
object
-
setBPMonitors
setBPMonitors.
- Parameters:
l
- aElementList
objectori
- aOrientation
object
-
calculateResponseMatrix
calculateResponseMatrix.
- Parameters:
op
- aOrbitCorrectionOperator
objectori
- aOrientation
object- Returns:
- a
ResponseMatrix
object
-
getCorrectionScale
public double getCorrectionScale()Getter for the field
correctionScale
.- Returns:
- a double
-
setCorrectionScale
public void setCorrectionScale(double correctionScale) Setter for the field
correctionScale
.- Parameters:
correctionScale
- a double
-
applyCorrection
public void applyCorrection(OrbitCorrectionOperator op, Correction corr) throws IllegalStateException, DataBushPackedException, InconsistentDataException, ControlSystemException applyCorrection.
- Parameters:
op
- aOrbitCorrectionOperator
objectcorr
- aCorrection
object- Throws:
IllegalStateException
- if any.DataBushPackedException
- if any.InconsistentDataException
- if any.ControlSystemException
- if any.
-
applyUndo
public void applyUndo(OrbitCorrectionOperator op) throws IllegalStateException, DataBushPackedException, InconsistentDataException, ControlSystemException Execute undo operation, if possible.
- Parameters:
op
- aOrbitCorrectionOperator
object- Throws:
IllegalStateException
- if any.DataBushPackedException
- if any.InconsistentDataException
- if any.ControlSystemException
- if any.
-
setMaxNumberOfSteps
public void setMaxNumberOfSteps(int maxNumberOfSteps) Setter for the field
maxNumberOfSteps
.- Parameters:
maxNumberOfSteps
- a int
-
signalOrbitCorrectionStarted
public void signalOrbitCorrectionStarted()signalOrbitCorrectionStarted.
-
signalOrbitCorrectionEnded
public void signalOrbitCorrectionEnded()signalOrbitCorrectionEnded.
-
signalAutomaticOrbitCorrectionStarted
public void signalAutomaticOrbitCorrectionStarted()signalAutomaticOrbitCorrectionStarted.
-
signalAutomaticOrbitCorrectionEnded
public void signalAutomaticOrbitCorrectionEnded()signalAutomaticOrbitCorrectionEnded.
-
getMaxStep
Getter for the field
maxStep
.- Parameters:
ori
- aOrientation
object- Returns:
- a double
-
setMaxStep
Setter for the field
maxStep
.- Parameters:
ori
- aOrientation
objectstep
- a double
-
configure
public void configure(org.apache.commons.configuration.Configuration conf) configure.
- Specified by:
configure
in interfaceIConfigurable
- Parameters:
conf
- aConfiguration
object
-
setMaxUndo
public void setMaxUndo(int maxUndo) Sets max count of undo history.- Parameters:
maxUndo
- max count of undo history
-
getMaxUndo
public int getMaxUndo()Max count of undo history.- Returns:
- max count of undo history
-
getMinimalBeamCurrent
public double getMinimalBeamCurrent()Getter for the field
minimalBeamCurrent
.- Returns:
- double
-
isMinimalBeamCurrentEnabled
public boolean isMinimalBeamCurrentEnabled()isMinimalBeamCurrentEnabled.
- Returns:
- a boolean
-
setMinimalBeamCurrent
public void setMinimalBeamCurrent(double newMinimalBeamCurrent) Setter for the field
minimalBeamCurrent
.- Parameters:
newMinimalBeamCurrent
- double
-
setMinimalBeamCurrentEnabled
public void setMinimalBeamCurrentEnabled(boolean b) setMinimalBeamCurrentEnabled.
- Parameters:
b
- a boolean
-
testBeamCurrent
testBeamCurrent.
- Parameters:
operator
- aAutomaticOrbitCorrectionOperator
object
-
getBeamCurrent
Trys to connect to info server and return current- Returns:
- a double
- Throws:
Exception
- if remote get fails
-
isRFStepping
isRFStepping.
- Returns:
- a boolean
- Throws:
Exception
- if any.
-
testOnStart
testOnStart.
- Parameters:
operator
- aAutomaticOrbitCorrectionOperator
object
-
testDevices
testDevices.
- Parameters:
operator
- aAutomaticOrbitCorrectionOperator
objecto
- aOrientation
objectfail
- a boolean- Returns:
- a boolean
-
testMain
testMain.
- Parameters:
operator
- aAutomaticOrbitCorrectionOperator
objectfail
- a boolean- Returns:
- a boolean
-
checkDevices
checkDevices.
- Parameters:
operator
- aAutomaticOrbitCorrectionOperator
objecto
- aOrientation
objectfail
- a boolean- Returns:
- a boolean
-
checkBeamCurrent
checkBeamCurrent.
- Parameters:
operator
- aAutomaticOrbitCorrectionOperator
object
-
testBPMs
Makes test of devices and returns array with names of failed devices.- Parameters:
bpms
- aElementList
object- Returns:
- array with list of failed devices, never
null
-
checkBPMs
Makes quick local check of usability of devices and returns array with names of failed devices.- Parameters:
bpms
- aElementList
object- Returns:
- an array of
String
objects
-
testPowerSupplies
Makes test of devices and returns array with names of failed devices.- Parameters:
l
- aElementList
object- Returns:
- array with list of failed devices, never
null
-
checkPowerSupplies
Makes quick local check of usability of devices and returns array with names of failed devices.- Parameters:
l
- aElementList
object- Returns:
- an array of
String
objects
-
debugDataDump
debugDataDump.
- Parameters:
operator
- aAutomaticOrbitCorrectionOperator
object
-
dumpData
Dumps all available data into a file for debuggin purposes.- Parameters:
operator
- aAutomaticOrbitCorrectionOperator
object
-
setDebugDataEnabled
public void setDebugDataEnabled(boolean b) Setter for the field
debugDataEnabled
.- Parameters:
b
- a boolean
-
isDebugDataEnabled
public boolean isDebugDataEnabled()isDebugDataEnabled.
- Returns:
- a boolean
-
isCorrectHorizontal
public boolean isCorrectHorizontal()isCorrectHorizontal.
- Returns:
- boolean
-
isCorrectVertical
public boolean isCorrectVertical()isCorrectVertical.
- Returns:
- boolean
-
setCorrectHorizontal
public void setCorrectHorizontal(boolean newCorrectHorizontal) Setter for the field
correctHorizontal
.- Parameters:
newCorrectHorizontal
- boolean
-
setCorrectVertical
public void setCorrectVertical(boolean newCorrectVertical) Setter for the field
correctVertical
.- Parameters:
newCorrectVertical
- boolean
-
addCorrection
addCorrection.
- Parameters:
ci
- aCorrectionInstruction
object
-
canUndo
public boolean canUndo()Returnstrue
if undo operation can be executed.- Returns:
true
if undo operation can be executed
-