Class PositionFile

java.lang.Object
jmri.jmrit.XmlFile
jmri.jmrix.rps.PositionFile

public class PositionFile extends XmlFile
Persist RPS configuration information.
  • Field Details

    • doc

      org.jdom2.Document doc
    • root

      org.jdom2.Element root
  • Constructor Details

  • Method Details

    • prepare

      public void prepare()
      Initialize for writing information.

      This is followed by multiple "set" calls, then a "store".

    • setConstants

      public void setConstants(double vSound, int offset, String algorithm)
    • setReceiver

      public void setReceiver(int n, Receiver r)
    • setReceiver

      public void setReceiver(int n, javax.vecmath.Point3d p, boolean active)
    • setCalibrationPoint

      public void setCalibrationPoint(javax.vecmath.Point3d p, Reading r)
    • positionElement

      org.jdom2.Element positionElement(javax.vecmath.Point3d p)
    • positionFromElement

      public javax.vecmath.Point3d positionFromElement(org.jdom2.Element position)
    • readingElement

      org.jdom2.Element readingElement(Reading r)
    • readingFromElement

      public Reading readingFromElement(org.jdom2.Element reading)
    • timeElement

      org.jdom2.Element timeElement(double time)
    • store

      public void store(File file) throws IOException
      Throws:
      IOException
    • loadFile

      public void loadFile(File f) throws org.jdom2.JDOMException, IOException
      Read in the file, and make available for examination.
      Parameters:
      f - file to load.
      Throws:
      org.jdom2.JDOMException - other errors
      IOException - error accessing file
    • getVSound

      public double getVSound()
    • getOffset

      public int getOffset()
    • getAlgorithm

      public String getAlgorithm()
    • maxReceiver

      public int maxReceiver()
      FInd the highest numbered receiver in the file
      Returns:
      highest numbered receiver.
    • getReceiverPosition

      public javax.vecmath.Point3d getReceiverPosition(int n)
      Get the nth receiver position in the file.
      Parameters:
      n - receiver index.
      Returns:
      null if not present
    • getReceiverActive

      public boolean getReceiverActive(int n)
      Get the nth receiver active state in the file.
      Parameters:
      n - receiver index.
      Returns:
      true if not present
    • getReceiverMin

      public int getReceiverMin(int n)
      Get the nth receiver min time.
      Parameters:
      n - receiver index.
      Returns:
      0 if not present
    • getReceiverMax

      public int getReceiverMax(int n)
      Get the nth receiver max time.
      Parameters:
      n - receiver index.
      Returns:
      0 if not present
    • getCalibrationPosition

      public javax.vecmath.Point3d getCalibrationPosition(int n)
      Get the nth calibration position in the file.
      Parameters:
      n - calibration index.
      Returns:
      null if not present
    • getCalibrationReading

      Get the nth calibration reading in the file.
      Parameters:
      n - reading index.
      Returns:
      null if not present
    • defaultLocation

      public static String defaultLocation()
    • defaultFilename

      public static String defaultFilename()