Class PVLoggerDataSource

java.lang.Object
xal.service.pvlogger.sim.PVLoggerDataSource

public class PVLoggerDataSource extends Object
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 Details

    • PVLoggerDataSource

      public PVLoggerDataSource(long id, PVLogger theLogger)
      Primary Constructor
      Parameters:
      id - the PV Logger ID
      theLogger - 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

      protected Map<String,ChannelSnapshot> populateChannelSnapshotTable()
      populate the channel snapshot table
    • getChannelSnapshot

      public ChannelSnapshot getChannelSnapshot(String pv)
      get a channel snapshot for the specified PV
    • getChannelSnapshotValue

      public double[] getChannelSnapshotValue(String pv)
      get the value for the channel snapshot corresponding to the specified PV
    • getMagnetMap

      public Map<String,Double> getMagnetMap()
      Get the value map for magnets
    • getMagnetPSMap

      public Map<String,Double> getMagnetPSMap()
      Get the value map for magnet power supplies
    • getBPMXMap

      public Map<String,Double> getBPMXMap()
      Get the value map for horizontal BPM signals
    • getBPMYMap

      public Map<String,Double> getBPMYMap()
      Get the value map for vertical BPM signals
    • getBPMAmpMap

      public Map<String,Double> getBPMAmpMap()
      Get the value map for BPM amplitude
    • getBPMPhaseMap

      public Map<String,Double> getBPMPhaseMap()
      Get the value map for BPM phase
    • removeModelSourceFromScenario

      public void removeModelSourceFromScenario(AcceleratorSeq sequence, Scenario scenario)
      Remove this data source from the specified scenario
    • getLoggedField

      public double getLoggedField(Electromagnet magnet) throws PvLoggerException
      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

      public void setModelSource(AcceleratorSeq sequence, Scenario scenario)
      set the model lattice with PV logger data source
      Parameters:
      sequence - accelerator sequence
      scenario - Model Scenario object that will be changed
    • setAccelSequence

      public void setAccelSequence(AcceleratorSeq seq)
    • 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

      public double getBeamCurrent(String bcm)
      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

      public ChannelSnapshot[] getChannelSnapshots()
      get all the channel snapshots.
      Returns:
      channel snapshots in array