jmri.jmrix.rps
Class PositionFile

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

public class PositionFile
extends XmlFile

Persist RPS configuration information

Author:
Bob Jacobsen Copyright 2007, 2008

Field Summary
 
Fields inherited from class jmri.jmrit.XmlFile
dtdLocation, xsltLocation
 
Constructor Summary
PositionFile()
           
 
Method Summary
static String defaultFilename()
           
static String defaultLocation()
           
 String getAlgorithm()
           
 Point3d getCalibrationPosition(int n)
          Get the nth calibration position in the file.
 Reading getCalibrationReading(int n)
          Get the nth calibration reading in the file.
 int getOffset()
           
 boolean getReceiverActive(int n)
          Get the nth receiver active state in the file.
 int getReceiverMax(int n)
          Get the nth receiver max time.
 int getReceiverMin(int n)
          Get the nth receiver min time.
 Point3d getReceiverPosition(int n)
          Get the nth receiver position in the file.
 double getVSound()
           
 void loadFile(File f)
          Read in the file, and make available for examination
 int maxReceiver()
          FInd the highest numbered receiver in the file
 Point3d positionFromElement(Element position)
           
 void prepare()
          Initialize for writing information.
 Reading readingFromElement(Element reading)
           
 void setCalibrationPoint(Point3d p, Reading r)
           
 void setConstants(double vSound, int offset, String algorithm)
           
 void setReceiver(int n, Point3d p, boolean active)
           
 void setReceiver(int n, Receiver r)
           
 void store(File file)
           
 
Methods inherited from class jmri.jmrit.XmlFile
addDefaultInfo, backupFileName, checkFile, createFileNameWithDate, dumpElement, ensurePrefsPresent, findFile, getBuilder, getRootViaURI, getVerify, makeBackupFile, makeBackupFile, newDocument, newDocument, prefsDir, reportError1, reportError2, resourcesDir, revertBackupFile, rootFromFile, rootFromName, rootFromURL, scriptsDir, setScriptsFileLocationDefault, setUserFileLocationDefault, setVerify, userFileChooser, userFileChooser, userFileChooser, userFileChooser, userFileLocationDefault, writeXML, xmlDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PositionFile

public PositionFile()
Method Detail

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,
                        Point3d p,
                        boolean active)

setCalibrationPoint

public void setCalibrationPoint(Point3d p,
                                Reading r)

positionFromElement

public Point3d positionFromElement(Element position)

readingFromElement

public Reading readingFromElement(Element reading)

store

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

loadFile

public void loadFile(File f)
              throws JDOMException,
                     IOException
Read in the file, and make available for examination

Throws:
JDOMException
IOException

getVSound

public double getVSound()

getOffset

public int getOffset()

getAlgorithm

public String getAlgorithm()

maxReceiver

public int maxReceiver()
FInd the highest numbered receiver in the file


getReceiverPosition

public Point3d getReceiverPosition(int n)
Get the nth receiver position in the file.

Returns:
null if not present

getReceiverActive

public boolean getReceiverActive(int n)
Get the nth receiver active state in the file.

Returns:
true if not present

getReceiverMin

public int getReceiverMin(int n)
Get the nth receiver min time.

Returns:
0 if not present

getReceiverMax

public int getReceiverMax(int n)
Get the nth receiver max time.

Returns:
0 if not present

getCalibrationPosition

public Point3d getCalibrationPosition(int n)
Get the nth calibration position in the file.

Returns:
null if not present

getCalibrationReading

public Reading getCalibrationReading(int n)
Get the nth calibration reading in the file.

Returns:
null if not present

defaultLocation

public static String defaultLocation()

defaultFilename

public static String defaultFilename()


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads