Package xal.service.pvlogger.sim
Class PVLoggerDataSource
java.lang.Object
xal.service.pvlogger.sim.PVLoggerDataSource
This class provides an interface for online model with PV logger data source.
- Version:
- 0.2 1 Oct 2015
- Author:
- Paul Chu, Blaz Kranjc TODO Things with hardcoded PV names should be redesigned
-
Constructor Summary
ConstructorsConstructorDescriptionPVLoggerDataSource
(long id) ConstructorPVLoggerDataSource
(long id, PVLogger theLogger) Primary Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
close the PV Logger connectiondouble
get the beam current in mA, we use the first available BCM in the sequence.double
getBeamCurrent
(String bcm) get the beam current in mA, use the BCM specified here.Get the value map for BPM amplitudeGet the value map for BPM phaseGet the value map for horizontal BPM signalsGet the value map for vertical BPM signalsget a channel snapshot for the specified PVget all the channel snapshots.double[]
get the value for the channel snapshot corresponding to the specified PVdouble
getLoggedField
(Electromagnet magnet) Get the magnet's field from the PV Logger Snapshot Throw an exception if the field is not found in the snapshot.Get the value map for magnetsGet the value map for magnet power suppliesboolean
Determine whether logged bend fields are applied in the scenarioprotected Map<String,
ChannelSnapshot> populate the channel snapshot tablevoid
removeModelSourceFromScenario
(AcceleratorSeq sequence, Scenario scenario) Remove this data source from the specified scenariovoid
void
setModelSource
(AcceleratorSeq sequence, Scenario scenario) set the model lattice with PV logger data sourcevoid
setUsesLoggedBendFields
(boolean useLoggedBends) Sets whether to use the logged bend fields in the scenariovoid
updatePVLoggerId
(long id) Update this data source with the data from the specified PV Logger snapshot
-
Constructor Details
-
PVLoggerDataSource
Primary Constructor- Parameters:
id
- the PV Logger IDtheLogger
- existing, connected PV Logger to use
-
PVLoggerDataSource
public PVLoggerDataSource(long id) Constructor- Parameters:
id
- the PV logger ID
-
-
Method Details
-
getUsesLoggedBendFields
public boolean getUsesLoggedBendFields()Determine whether logged bend fields are applied in the scenario -
setUsesLoggedBendFields
public void setUsesLoggedBendFields(boolean useLoggedBends) Sets whether to use the logged bend fields in the scenario -
closeConnection
public void closeConnection()close the PV Logger connection -
updatePVLoggerId
public void updatePVLoggerId(long id) Update this data source with the data from the specified PV Logger snapshot- Parameters:
id
- the PV logger ID
-
populateChannelSnapshotTable
populate the channel snapshot table -
getChannelSnapshot
get a channel snapshot for the specified PV -
getChannelSnapshotValue
get the value for the channel snapshot corresponding to the specified PV -
getMagnetMap
Get the value map for magnets -
getMagnetPSMap
Get the value map for magnet power supplies -
getBPMXMap
Get the value map for horizontal BPM signals -
getBPMYMap
Get the value map for vertical BPM signals -
getBPMAmpMap
Get the value map for BPM amplitude -
getBPMPhaseMap
Get the value map for BPM phase -
removeModelSourceFromScenario
Remove this data source from the specified scenario -
getLoggedField
Get the magnet's field from the PV Logger Snapshot Throw an exception if the field is not found in the snapshot.- Parameters:
magnet
- The magnet to check the snapshot for- Returns:
- field of the magnet from the snapshot
- Throws:
PvLoggerException
- if the field for the magnet is not in the snapshot
-
setModelSource
set the model lattice with PV logger data source- Parameters:
sequence
- accelerator sequencescenario
- Model Scenario object that will be changed
-
setAccelSequence
-
getBeamCurrent
public double getBeamCurrent()get the beam current in mA, we use the first available BCM in the sequence. If the first in the sequence is not available, use MEBT BCM02. If it's also not available, then default to 20mA- Returns:
- beam current
-
getBeamCurrent
get the beam current in mA, use the BCM specified here. If it's not available, use 20mA as default- Parameters:
bcm
- the BCM you want the beam current reading from- Returns:
- beam current
-
getChannelSnapshots
get all the channel snapshots.- Returns:
- channel snapshots in array
-