Class OrbitServerApplication

java.lang.Object
org.scictrl.csshell.epics.server.application.AbstractApplication
org.scictrl.csshell.epics.server.application.orbitserver.OrbitServerApplication
All Implemented Interfaces:
Application, OnDemandValueProcessor.ValueProvider

public class OrbitServerApplication extends AbstractApplication

OrbitServerApplication class.

Author:
igor@scictrl.com
  • Field Details

    • PV_Y

      public static final String PV_Y
      Constant PV_Y="PvY"
      See Also:
    • PV_X

      public static final String PV_X
      Constant PV_X="PvX"
      See Also:
    • PV_BBA_Y

      public static final String PV_BBA_Y
      Constant PV_BBA_Y="PvBbaY"
      See Also:
    • PV_BBA_X

      public static final String PV_BBA_X
      Constant PV_BBA_X="PvBbaX"
      See Also:
    • SFX_STAT_X

      public static final String SFX_STAT_X
      Constant SFX_STAT_X=":Stat:X"
      See Also:
    • SFX_STAT_X_AVG

      public static final String SFX_STAT_X_AVG
      Constant SFX_STAT_X_AVG=":Stat:X:AVG"
      See Also:
    • SFX_STAT_X_RMS

      public static final String SFX_STAT_X_RMS
      Constant SFX_STAT_X_RMS=":Stat:X:RMS"
      See Also:
    • SFX_STAT_X_STD

      public static final String SFX_STAT_X_STD
      Constant SFX_STAT_X_STD=":Stat:X:STD"
      See Also:
    • SFX_STAT_X_MAX

      public static final String SFX_STAT_X_MAX
      Constant SFX_STAT_X_MAX=":Stat:X:MAX"
      See Also:
    • SFX_STAT_Y

      public static final String SFX_STAT_Y
      Constant SFX_STAT_Y=":Stat:Y"
      See Also:
    • SFX_STAT_Y_AVG

      public static final String SFX_STAT_Y_AVG
      Constant SFX_STAT_Y_AVG=":Stat:Y:AVG"
      See Also:
    • SFX_STAT_Y_RMS

      public static final String SFX_STAT_Y_RMS
      Constant SFX_STAT_Y_RMS=":Stat:Y:RMS"
      See Also:
    • SFX_STAT_Y_STD

      public static final String SFX_STAT_Y_STD
      Constant SFX_STAT_Y_STD=":Stat:Y:STD"
      See Also:
    • SFX_STAT_Y_MAX

      public static final String SFX_STAT_Y_MAX
      Constant SFX_STAT_Y_MAX=":Stat:Y:MAX"
      See Also:
    • SFX_STAT_STRING

      public static final String SFX_STAT_STRING
      Constant SFX_STAT_STRING=":Stat:String"
      See Also:
    • REFERENCE_X

      public static final String REFERENCE_X
      Constant REFERENCE_X="Reference:X"
      See Also:
    • REFERENCE_Y

      public static final String REFERENCE_Y
      Constant REFERENCE_Y="Reference:Y"
      See Also:
    • REFERENCE_SAVE_CSV

      public static final String REFERENCE_SAVE_CSV
      Constant REFERENCE_SAVE_CSV="Reference:SaveCSV"
      See Also:
    • REFERENCE_COMMENT

      public static final String REFERENCE_COMMENT
      Constant REFERENCE_COMMENT="Reference:Comment"
      See Also:
    • REFERENCE_DIFF_BBAREF

      public static final String REFERENCE_DIFF_BBAREF
      Constant REFERENCE_DIFF_BBAREF="Reference:Diff:BBARef"
      See Also:
    • REFERENCE_DIFF_INJREF

      public static final String REFERENCE_DIFF_INJREF
      Constant REFERENCE_DIFF_INJREF="Reference:Diff:InjRef"
      See Also:
    • REFERENCE_DIFF_INSREF

      public static final String REFERENCE_DIFF_INSREF
      Constant REFERENCE_DIFF_INSREF="Reference:Diff:InsRef"
      See Also:
    • REFERENCE_AS_BBAREF

      public static final String REFERENCE_AS_BBAREF
      Constant REFERENCE_AS_BBAREF="Reference:AsBBARef"
      See Also:
    • REFERENCE_AS_INJREF

      public static final String REFERENCE_AS_INJREF
      Constant REFERENCE_AS_INJREF="Reference:AsInjRef"
      See Also:
    • REFERENCE_AS_INSREF

      public static final String REFERENCE_AS_INSREF
      Constant REFERENCE_AS_INSREF="Reference:AsInsRef"
      See Also:
    • BBAREF_X

      public static final String BBAREF_X
      Constant BBAREF_X="BBARef:X"
      See Also:
    • BBAREF_Y

      public static final String BBAREF_Y
      Constant BBAREF_Y="BBARef:Y"
      See Also:
    • BBAREF_AS_REFERENCE

      public static final String BBAREF_AS_REFERENCE
      Constant BBAREF_AS_REFERENCE="BBARef:AsReference"
      See Also:
    • BBAREF_SAVE_CSV

      public static final String BBAREF_SAVE_CSV
      Constant BBAREF_SAVE_CSV="BBARef:SaveCSV"
      See Also:
    • BBAREF_COMMENT

      public static final String BBAREF_COMMENT
      Constant BBAREF_COMMENT="BBARef:Comment"
      See Also:
    • INSREF_X

      public static final String INSREF_X
      Constant INSREF_X="InsRef:X"
      See Also:
    • INSREF_Y

      public static final String INSREF_Y
      Constant INSREF_Y="InsRef:Y"
      See Also:
    • INSREF_AS_REFERENCE

      public static final String INSREF_AS_REFERENCE
      Constant INSREF_AS_REFERENCE="InsRef:AsReference"
      See Also:
    • INSREF_SAVE_CSV

      public static final String INSREF_SAVE_CSV
      Constant INSREF_SAVE_CSV="InsRef:SaveCSV"
      See Also:
    • INSREF_COMMENT

      public static final String INSREF_COMMENT
      Constant INSREF_COMMENT="InsRef:Comment"
      See Also:
    • INJREF_X

      public static final String INJREF_X
      Constant INJREF_X="InjRef:X"
      See Also:
    • INJREF_Y

      public static final String INJREF_Y
      Constant INJREF_Y="InjRef:Y"
      See Also:
    • INJREF_AS_REFERENCE

      public static final String INJREF_AS_REFERENCE
      Constant INJREF_AS_REFERENCE="InjRef:AsReference"
      See Also:
    • INJREF_SAVE_CSV

      public static final String INJREF_SAVE_CSV
      Constant INJREF_SAVE_CSV="InjRef:SaveCSV"
      See Also:
    • INJREF_COMMENT

      public static final String INJREF_COMMENT
      Constant INJREF_COMMENT="InjRef:Comment"
      See Also:
    • LIVE_X

      public static final String LIVE_X
      Constant LIVE_X="Live:X"
      See Also:
    • LIVE_Y

      public static final String LIVE_Y
      Constant LIVE_Y="Live:Y"
      See Also:
    • LIVE_COMMENT

      public static final String LIVE_COMMENT
      Constant LIVE_COMMENT="Live:Comment"
      See Also:
    • LIVE_RAW_X

      public static final String LIVE_RAW_X
      Constant LIVE_RAW_X="Live:Raw:X"
      See Also:
    • LIVE_RAW_Y

      public static final String LIVE_RAW_Y
      Constant LIVE_RAW_Y="Live:Raw:Y"
      See Also:
    • LIVE_RAW_SAVE

      public static final String LIVE_RAW_SAVE
      Constant LIVE_RAW_SAVE="Live:Raw:SaveMem"
      See Also:
    • LIVE_RAW_COMMENT

      public static final String LIVE_RAW_COMMENT
      Constant LIVE_RAW_COMMENT="Live:Raw:Comment"
      See Also:
    • STATUS_LOADING_ARCHIVE

      public static final String[] STATUS_LOADING_ARCHIVE
      Constant STATUS_LOADING_ARCHIVE
    • ARCHIVE_X

      public static final String[] ARCHIVE_X
      Constant ARCHIVE_X
    • ARCHIVE_Y

      public static final String[] ARCHIVE_Y
      Constant ARCHIVE_Y
    • ARCHIVE_SAVE_CSV

      public static final String[] ARCHIVE_SAVE_CSV
      Constant ARCHIVE_SAVE_CSV
    • ARCHIVE_RAW_X

      public static final String[] ARCHIVE_RAW_X
      Constant ARCHIVE_RAW_X
    • ARCHIVE_RAW_Y

      public static final String[] ARCHIVE_RAW_Y
      Constant ARCHIVE_RAW_Y
    • ARCHIVE_RAW_SAVE

      public static final String[] ARCHIVE_RAW_SAVE
      Constant ARCHIVE_RAW_SAVE
    • ARCHIVE_RAW_SAVE_CSV

      public static final String[] ARCHIVE_RAW_SAVE_CSV
      Constant ARCHIVE_RAW_SAVE_CSV
    • ARCHIVE_REFERENCE_X

      public static final String[] ARCHIVE_REFERENCE_X
      Constant ARCHIVE_REFERENCE_X
    • ARCHIVE_REFERENCE_Y

      public static final String[] ARCHIVE_REFERENCE_Y
      Constant ARCHIVE_REFERENCE_Y
    • ARCHIVE_REFERENCE_SAVE

      public static final String[] ARCHIVE_REFERENCE_SAVE
      Constant ARCHIVE_REFERENCE_SAVE
    • ARCHIVE_REFERENCE_SAVE_CSV

      public static final String[] ARCHIVE_REFERENCE_SAVE_CSV
      Constant ARCHIVE_REFERENCE_SAVE_CSV
    • ARCHIVE_TIME

      public static final String[] ARCHIVE_TIME
      Constant ARCHIVE_TIME
    • ARCHIVE_TIME_USE_PICKER

      public static final String[] ARCHIVE_TIME_USE_PICKER
      Constant ARCHIVE_TIME_USE_PICKER
    • ARCHIVE_TIME_STRING

      public static final String[] ARCHIVE_TIME_STRING
      Constant ARCHIVE_TIME_STRING
    • ARCHIVE_TIME_PICKER

      public static final String[] ARCHIVE_TIME_PICKER
      Constant ARCHIVE_TIME_PICKER
    • ARCHIVE_TIME_PICKER_STRING

      public static final String[] ARCHIVE_TIME_PICKER_STRING
      Constant ARCHIVE_TIME_PICKER_STRING
    • ARCHIVE_TIME_PICKER_y

      public static final String[] ARCHIVE_TIME_PICKER_y
      Constant ARCHIVE_TIME_PICKER_y
    • ARCHIVE_TIME_PICKER_M

      public static final String[] ARCHIVE_TIME_PICKER_M
      Constant ARCHIVE_TIME_PICKER_M
    • ARCHIVE_TIME_PICKER_d

      public static final String[] ARCHIVE_TIME_PICKER_d
      Constant ARCHIVE_TIME_PICKER_d
    • ARCHIVE_TIME_PICKER_H

      public static final String[] ARCHIVE_TIME_PICKER_H
      Constant ARCHIVE_TIME_PICKER_H
    • ARCHIVE_TIME_PICKER_m

      public static final String[] ARCHIVE_TIME_PICKER_m
      Constant ARCHIVE_TIME_PICKER_m
    • ARCHIVE_TIME_PICKER_s

      public static final String[] ARCHIVE_TIME_PICKER_s
      Constant ARCHIVE_TIME_PICKER_s
    • MEM_X

      public static final String MEM_X
      Constant MEM_X="Mem:X"
      See Also:
    • MEM_Y

      public static final String MEM_Y
      Constant MEM_Y="Mem:Y"
      See Also:
    • MEM_COMMENT

      public static final String MEM_COMMENT
      Constant MEM_COMMENT="Mem:Comment"
      See Also:
    • MEM_SAVE_CSV

      public static final String MEM_SAVE_CSV
      Constant MEM_SAVE_CSV="Mem:SaveCSV"
      See Also:
    • MEM_RAW_X

      public static final String MEM_RAW_X
      Constant MEM_RAW_X="Mem:Raw:X"
      See Also:
    • MEM_RAW_Y

      public static final String MEM_RAW_Y
      Constant MEM_RAW_Y="Mem:Raw:Y"
      See Also:
    • MEM_RAW_SAVE_CSV

      public static final String MEM_RAW_SAVE_CSV
      Constant MEM_RAW_SAVE_CSV="Mem:Raw:SaveCSV"
      See Also:
    • MEM_RAW_AS_REFERENCE

      public static final String MEM_RAW_AS_REFERENCE
      Constant MEM_RAW_AS_REFERENCE="Mem:Raw:AsReference"
      See Also:
    • MEM_RAW_COMMENT

      public static final String MEM_RAW_COMMENT
      Constant MEM_RAW_COMMENT="Mem:Raw:Comment"
      See Also:
    • MEM_RAW_CLEAR

      public static final String MEM_RAW_CLEAR
      Constant MEM_RAW_CLEAR="Mem:Raw:Clear"
      See Also:
    • LOAD_X

      public static final String LOAD_X
      Constant LOAD_X="Load:X"
      See Also:
    • LOAD_Y

      public static final String LOAD_Y
      Constant LOAD_Y="Load:Y"
      See Also:
    • LOAD_LOAD_CSV

      public static final String LOAD_LOAD_CSV
      Constant LOAD_LOAD_CSV="Load:LoadCSV"
      See Also:
    • LOAD_SAVE_CSV

      public static final String LOAD_SAVE_CSV
      Constant LOAD_SAVE_CSV="Load:SaveCSV"
      See Also:
    • LOAD_SAVE

      public static final String LOAD_SAVE
      Constant LOAD_SAVE="Load:SaveMem"
      See Also:
    • LOAD_AS_REFERENCE

      public static final String LOAD_AS_REFERENCE
      Constant LOAD_AS_REFERENCE="Load:AsReference"
      See Also:
    • LOAD_AS_BBAREF

      public static final String LOAD_AS_BBAREF
      Constant LOAD_AS_BBAREF="Load:AsBBARef"
      See Also:
    • LOAD_AS_INSREF

      public static final String LOAD_AS_INSREF
      Constant LOAD_AS_INSREF="Load:AsInsRef"
      See Also:
    • LOAD_AS_INJREF

      public static final String LOAD_AS_INJREF
      Constant LOAD_AS_INJREF="Load:AsInjRef"
      See Also:
    • LOAD_COMMENT

      public static final String LOAD_COMMENT
      Constant LOAD_COMMENT="Load:Comment"
      See Also:
    • LOAD_FILE

      public static final String LOAD_FILE
      Constant LOAD_FILE="Load:File"
      See Also:
    • BPM_POSITIONS

      public static final String BPM_POSITIONS
      Constant BPM_POSITIONS="BPM:Positions"
      See Also:
    • BPM_NAMES

      public static final String BPM_NAMES
      Constant BPM_NAMES="BPM:Names"
      See Also:
    • STATUS_IS_REFERENCE_BBA

      public static final String STATUS_IS_REFERENCE_BBA
      Constant STATUS_IS_REFERENCE_BBA="Status:IsReferenceBBA"
      See Also:
    • STATUS_IS_REFERENCE_INJ

      public static final String STATUS_IS_REFERENCE_INJ
      Constant STATUS_IS_REFERENCE_INJ="Status:IsReferenceInj"
      See Also:
    • STATUS_IS_REFERENCE_INS

      public static final String STATUS_IS_REFERENCE_INS
      Constant STATUS_IS_REFERENCE_INS="Status:IsReferenceIns"
      See Also:
    • STATUS_IS_REFERENCE_BAD

      public static final String STATUS_IS_REFERENCE_BAD
      Constant STATUS_IS_REFERENCE_BAD="Status:IsReferenceBad"
      See Also:
    • SAMPLES_SEARCH_TIME_WINDOW

      public static final long SAMPLES_SEARCH_TIME_WINDOW
      Time window dT in milliseconds within which (from -dT to + dT ) search for samples will be performed.
      See Also:
  • Constructor Details

    • OrbitServerApplication

      public OrbitServerApplication()

      Constructor for OrbitServerApplication.

  • Method Details

    • configure

      public void configure(String name, org.apache.commons.configuration.HierarchicalConfiguration config)
      Configures the internals of this application, provides reference to configuration with root inside applications tag. Server structure is not yet initialized, so does not have reference to Database, the Database reference will be available during activate call.
      Specified by:
      configure in interface Application
      Overrides:
      configure in class AbstractApplication
      Parameters:
      name - a String object
      config - configuration with room inside application tag.
    • loadOrbitAsCSV

      protected Orbit loadOrbitAsCSV(String csv) throws IOException

      loadOrbitAsCSV.

      Parameters:
      csv - a String object
      Returns:
      a Orbit object
      Throws:
      IOException - if any.
    • loadOrbitAsCSV

      protected Orbit loadOrbitAsCSV(File orbitFile) throws IOException

      loadOrbitAsCSV.

      Parameters:
      orbitFile - a File object
      Returns:
      a Orbit object
      Throws:
      IOException - if any.
    • loadOrbitAsCSV

      protected Orbit loadOrbitAsCSV(Reader csv) throws IOException

      loadOrbitAsCSV.

      Parameters:
      csv - a Reader object
      Returns:
      a Orbit object
      Throws:
      IOException - if any.
    • saveOrbitAsCSV

      protected void saveOrbitAsCSV(File orbitFile, Orbit orbit, String name, String... comments) throws IOException

      saveOrbitAsCSV.

      Parameters:
      orbitFile - a File object
      orbit - a Orbit object
      name - a String object
      comments - a String object
      Throws:
      IOException - if any.
    • saveOrbitAsCSV

      protected void saveOrbitAsCSV(Appendable print, Orbit orbit, String name, String... comments) throws IOException

      saveOrbitAsCSV.

      Parameters:
      print - a Appendable object
      orbit - a Orbit object
      name - a String object
      comments - a String object
      Throws:
      IOException - if any.
    • saveOrbitAsCSV

      protected String saveOrbitAsCSV(Orbit orbit, String name, String... comments)

      saveOrbitAsCSV.

      Parameters:
      orbit - a Orbit object
      name - a String object
      comments - a String object
      Returns:
      a String object
    • diffRMS

      protected double diffRMS(Orbit a, Orbit b)

      diffRMS.

      Parameters:
      a - a Orbit object
      b - a Orbit object
      Returns:
      a double
    • notifyLinkChange

      protected void notifyLinkChange(String name)
      This method is called whenever record value changed for any record, which belongs to this application (it was added to the application AbstractApplication.addRecord(String, Record)). Implementation class should override this method to intercept the update.
      Overrides:
      notifyLinkChange in class AbstractApplication
      Parameters:
      name - the name of record, that triggered change.
    • notifyRecordChange

      protected void notifyRecordChange(String name, boolean alarmOnly)
      This method is called whenever record value changed for any record, which belongs to this application (it was added to the application AbstractApplication.addRecord(String, Record)). Implementation class should override this method to intercept the update.
      Overrides:
      notifyRecordChange in class AbstractApplication
      Parameters:
      name - the name of record, that triggered change.
      alarmOnly - if true then only alarm has been changed
    • notifyRecordWrite

      protected void notifyRecordWrite(String name)
      This method is called whenever record value has been written for any record, which belongs to this application (it was added to the application AbstractApplication.addRecord(String, Record)). Implementation class should override this method to intercept the update.
      Overrides:
      notifyRecordWrite in class AbstractApplication
      Parameters:
      name - the name of record, that triggered change.
    • getValue

      public Object getValue(Object key)
      Returns new value associated with the provided key.
      Specified by:
      getValue in interface OnDemandValueProcessor.ValueProvider
      Overrides:
      getValue in class AbstractApplication
      Parameters:
      key - a key object to recognize the value if there is more then one processor asking
      Returns:
      the new value
    • activate

      public void activate()
      Application has now reference to Database. Application might want to connect to other records on this server or PVs on other servers. This can not be done until all records from configuration has been loaded. Call to this method signals application that records has been loaded and linking to other values can be commenced.
      Specified by:
      activate in interface Application
      Overrides:
      activate in class AbstractApplication
    • updateOrbit

      protected Orbit updateOrbit(double[] x, double[] y, Orbit ref, String orbitX, String orbitY, boolean hasRef)

      updateOrbit.

      Parameters:
      x - an array of
      invalid reference
      double
      objects
      y - an array of
      invalid reference
      double
      objects
      ref - a Orbit object
      orbitX - a String object
      orbitY - a String object
      hasRef - a boolean
      Returns:
      a Orbit object