Package jmri.jmrix.sprog.update
Class SprogVersion
- java.lang.Object
-
- jmri.jmrix.sprog.update.SprogVersion
-
public class SprogVersion extends java.lang.Object
Class to hold SPROG type and firmware version.
-
-
Field Summary
Fields Modifier and Type Field Description SprogType
sprogType
java.lang.String
sprogVersion
-
Constructor Summary
Constructors Constructor Description SprogVersion(SprogType t)
Construct a new SPROG version object from a SPROG typeSprogVersion(SprogType t, java.lang.String s)
Construct a new SPROG version object from a SPROG type and version.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMajorVersion()
Return major version number for a known SPROG.int
getMinorVersion()
Return minor version number for a known SPROG.boolean
hasBlueLine()
Check if the SPROG has blueline decoder mode.boolean
hasCurrentLimit()
Check if the SPROG has an adjustable current limit.boolean
hasExtraFeatures()
Check if the SPROG has various extra features that were not present in the original firmware.boolean
hasFirmwareLock()
Check if the SPROG has an interlock for the bootloader.boolean
hasZTCMode()
boolean
supportsCVHints()
Check if the SPROG supports use of CV hints when reading.java.lang.String
toString()
java.lang.String
toString(SprogVersion s)
Custom toString with Version Number.
-
-
-
Field Detail
-
sprogVersion
public java.lang.String sprogVersion
-
-
Constructor Detail
-
SprogVersion
public SprogVersion(SprogType t)
Construct a new SPROG version object from a SPROG type- Parameters:
t
- SprogType the type of SPROG
-
SprogVersion
public SprogVersion(SprogType t, java.lang.String s)
Construct a new SPROG version object from a SPROG type and version.- Parameters:
t
- SprogType the type of SPROGs
- String version in "major.minor" format, e.g. "3.1"
-
-
Method Detail
-
getMajorVersion
public int getMajorVersion()
Return major version number for a known SPROG.- Returns:
- major version
-
getMinorVersion
public int getMinorVersion()
Return minor version number for a known SPROG.- Returns:
- minor version
-
hasExtraFeatures
public boolean hasExtraFeatures()
Check if the SPROG has various extra features that were not present in the original firmware. This means later SPROG II versions or any type equal or higher than SPROG 3.- Returns:
- boolean if the current SPROG has extra features
-
hasBlueLine
public boolean hasBlueLine()
Check if the SPROG has blueline decoder mode.- Returns:
- true if the SPROG has blueline decoder support
-
hasCurrentLimit
public boolean hasCurrentLimit()
Check if the SPROG has an adjustable current limit.- Returns:
- true if the SPROG has adjustable current limit
-
hasFirmwareLock
public boolean hasFirmwareLock()
Check if the SPROG has an interlock for the bootloader.- Returns:
- true if the SPROG has firmware interlock
-
hasZTCMode
public boolean hasZTCMode()
-
supportsCVHints
public boolean supportsCVHints()
Check if the SPROG supports use of CV hints when reading. This means SPROG IIv4 or SPROG 3v4 version 4.5 or higher- Returns:
- boolean if the current SPROG supports CV hints when reading
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation of SPROG version
-
toString
public java.lang.String toString(SprogVersion s)
Custom toString with Version Number.- Parameters:
s
- sprog version.- Returns:
- String representation of SPROG version
-
-