Package jmri.jmrix.rps
Class PositionFile
java.lang.Object
jmri.jmrit.XmlFile
jmri.jmrix.rps.PositionFile
Persist RPS configuration information.
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.jmrit.XmlFile
XmlFile.Validate -
Field Summary
FieldsModifier and TypeFieldDescription(package private) org.jdom2.Document(package private) org.jdom2.ElementFields inherited from class jmri.jmrit.XmlFile
dtdLocation, xsltLocation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic Stringjavax.vecmath.Point3dgetCalibrationPosition(int n) Get the nth calibration position in the file.getCalibrationReading(int n) Get the nth calibration reading in the file.intbooleangetReceiverActive(int n) Get the nth receiver active state in the file.intgetReceiverMax(int n) Get the nth receiver max time.intgetReceiverMin(int n) Get the nth receiver min time.javax.vecmath.Point3dgetReceiverPosition(int n) Get the nth receiver position in the file.doublevoidRead in the file, and make available for examination.intFInd the highest numbered receiver in the file(package private) org.jdom2.ElementpositionElement(javax.vecmath.Point3d p) javax.vecmath.Point3dpositionFromElement(org.jdom2.Element position) voidprepare()Initialize for writing information.(package private) org.jdom2.ElementreadingFromElement(org.jdom2.Element reading) voidsetCalibrationPoint(javax.vecmath.Point3d p, Reading r) voidsetConstants(double vSound, int offset, String algorithm) voidsetReceiver(int n, javax.vecmath.Point3d p, boolean active) voidsetReceiver(int n, Receiver r) void(package private) org.jdom2.ElementtimeElement(double time) Methods inherited from class jmri.jmrit.XmlFile
addDefaultInfo, backupFileName, checkFile, createFileNameWithDate, dumpElement, findFile, getBuilder, getDefaultDtdLocation, getDefaultValidate, getDtdLocation, getProcessingInstructionHRef, getProcessingInstructionType, getRoot, getValidate, makeBackupFile, makeBackupFile, newDocument, newDocument, revertBackupFile, rootFromFile, rootFromInputStream, rootFromName, rootFromURL, setDefaultDtdLocation, setDefaultValidate, setDtdLocation, setValidate, userFileChooser, userFileChooser, writeXML, xmlDir
-
Field Details
-
Constructor Details
-
PositionFile
public PositionFile()
-
-
Method Details
-
prepare
Initialize for writing information.This is followed by multiple "set" calls, then a "store".
-
setConstants
-
setReceiver
-
setReceiver
-
setCalibrationPoint
-
positionElement
-
positionFromElement
-
readingElement
-
readingFromElement
-
timeElement
-
store
- Throws:
IOException
-
loadFile
Read in the file, and make available for examination.- Parameters:
f- file to load.- Throws:
org.jdom2.JDOMException- other errorsIOException- error accessing file
-
getVSound
-
getOffset
-
getAlgorithm
-
maxReceiver
FInd the highest numbered receiver in the file- Returns:
- highest numbered receiver.
-
getReceiverPosition
Get the nth receiver position in the file.- Parameters:
n- receiver index.- Returns:
- null if not present
-
getReceiverActive
Get the nth receiver active state in the file.- Parameters:
n- receiver index.- Returns:
- true if not present
-
getReceiverMin
Get the nth receiver min time.- Parameters:
n- receiver index.- Returns:
- 0 if not present
-
getReceiverMax
Get the nth receiver max time.- Parameters:
n- receiver index.- Returns:
- 0 if not present
-
getCalibrationPosition
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
-
defaultFilename
-