|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
io.AbstractDriver
io.AbstractSerialDriver
stella.io.RS485Server
stella.io.NudamConfig
public class NudamConfig
A simple configuration tool for NuDam modules. For this program to work,
the NuDam module must be in the so-called DEFAULT mode, that is the
DEFAULT pin (usually pin number 6) must be connected to GND.
The class opens the serial port with the current settings, as defined
in the RS485Server class. It reads in the current address
(which is, I'd guess always 00 in DEFAULT mode). The new address, baud
rate, input range and checksum-flag are found in the
KEY_NEWADDRESS,
the KEY_NEWBAUD, the KEY_NEWRANGE, and the
KEY_NEWCHECKSUM properties.
After opening the serial port with PropertyResources.init(), call configure()
followed by AbstractSerialDriver.close() to perform the configuration. Do not forget to
unplug the DEFALUT pin after configuration.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class stella.io.RS485Server |
|---|
RS485Server.Checksum, RS485Server.Command, RS485Server.Info, RS485Server.Scan |
| Nested classes/interfaces inherited from class io.AbstractSerialDriver |
|---|
AbstractSerialDriver.Available |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static Map |
CODETOBAUD
A look-up table matching NuDam config codes to baud rates. |
private static String |
DEFADDRESS
The default address is 00 in DEFAULT mode. |
private static String |
DEFNEWBAUD
The default new baud rate. |
private static boolean |
DEFNEWCHECKSUM
The default new baud rate. |
private static String |
DEFNEWRANGE
The default new baud rate. |
private static Map |
INPUTTOVOLT
A look-up table matching NuDam config codes to input ranges. |
static String |
KEY_ADDRESS
The key to the current address |
static String |
KEY_NEWADDRESS
The key to the new address |
static String |
KEY_NEWBAUD
The key to the new address |
static String |
KEY_NEWCHECKSUM
The key to the new address |
static String |
KEY_NEWRANGE
The key to the new address |
private String |
newbaud
The new baud-rate code. |
private String |
newrange
The new input-range code. |
private static Map |
NIBBLETOMODULE
A look-up table matching NuDam read-config data format to NuDam types. |
private static String |
TRAIL
The set-configuration command trailing character. |
| Fields inherited from class stella.io.RS485Server |
|---|
KEY_CHECKCHAR, KEY_CHECKSUM, KEY_CLOSE, KEY_CR, KEY_ECHO, KEY_FAILTIME, KEY_FAILURES, KEY_INVALID, KEY_MAXBUFFER, KEY_MAXBUSY, KEY_QUERYTIME, KEY_REINIT, KEY_RESPONDTIME, KEY_STARTUP, KEY_TIMEBUSY, lock |
| Fields inherited from class io.AbstractSerialDriver |
|---|
inport, KEY_BAUDRATE, KEY_CLOSETIMEOUT, KEY_DATABIT, KEY_FLOWCONTROL, KEY_INBUFFER, KEY_NOTIFYCOOLDOWN, KEY_OUTBUFFER, KEY_PARITYBIT, KEY_PORTNAME, KEY_RECEIVEFRAMING, KEY_RECEIVETHRESHOLD, KEY_RECEIVETIMEOUT, KEY_STOPBIT, KEY_TIMEOUT, outport, staticlock |
| Fields inherited from class io.AbstractDriver |
|---|
KEY_DRIVERNAME |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
NudamConfig(Map prop)
Constructs a new NuDam configuration tool. |
|
| Method Summary | |
|---|---|
void |
configure()
Sends the configure command. |
static void |
main(String[] arg)
Reads in the new configuration from the properties file supplied as the first command line argument. |
| Methods inherited from class stella.io.RS485Server |
|---|
deferCommand, ensureCommand, exit, getCheckSum, getCheckSumming, isReading, open, readString, setCheckSumming, toString, writeCommand, writeString |
| Methods inherited from class io.AbstractSerialDriver |
|---|
close, createPortEventListener, createPortEventListener, deregisterSoleEventListener, disableEvent, enableEvent, getDriverName, isOpen, registerSoleEventListener, resetOriginalParameters |
| Methods inherited from class io.AbstractDriver |
|---|
createDriver, equals, hashCode |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Methods inherited from interface util.Initializable |
|---|
init |
| Field Detail |
|---|
public static final String KEY_ADDRESS
public static final String KEY_NEWADDRESS
public static final String KEY_NEWBAUD
public static final String KEY_NEWRANGE
public static final String KEY_NEWCHECKSUM
private static final String DEFADDRESS
private static final String DEFNEWBAUD
private static final String DEFNEWRANGE
private static final boolean DEFNEWCHECKSUM
private static final String TRAIL
private static final Map CODETOBAUD
private static final Map INPUTTOVOLT
private static final Map NIBBLETOMODULE
private String newbaud
private String newrange
| Constructor Detail |
|---|
public NudamConfig(Map prop)
| Method Detail |
|---|
public void configure()
throws IOException
IOException
public static void main(String[] arg)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||