jmri.jmrix.loconet.locomon
Class Llnmon

java.lang.Object
  extended by jmri.jmrix.loconet.locomon.Llnmon

public class Llnmon
extends Object

A utility class for formatting LocoNet packets into human-readable text.

Much of this file is a Java-recoding of the display.c file from the llnmon package of John Jabour. Some of the conversions involve explicit decoding of structs defined in loconet.h in that same package. Those parts are (C) Copyright 2001 Ron W. Auld. Use of these parts is by direct permission of the author.

Most major comment blocks here are quotes from the Digitrax Loconet(r) OPCODE SUMMARY: found in the Loconet(r) Personal Edition 1.

Some of the message formats used in this class are Copyright Digitrax, Inc. and used with permission as part of the JMRI project. That permission does not extend to uses in other software products. If you wish to use this code, algorithm or these message formats outside of JMRI, please contact Digitrax Inc for separate permission.

Note that the formatted strings end in a \n, and may contain more than one line separated by \n. Someday this should be converted to proper Java line handling, but for now it has to be handled in locomon, the sole user of this. (It could be handled by moving the code from locomon into the display member here)

Reverse engineering of OPC_MULTI_SENSE was provided by Al Silverstein, used with permission.

Reverse engineering of the Duplex Group/Password/Channel management was provided by Leo Bicknell with help from B. Milhaupt, used with permission.

Author:
Bob Jacobsen Copyright 2001, 2002, 2003

Field Summary
protected  boolean forceHex
          Global flag to indicate the message was not fully parsed, so the hex should be included.
 
Constructor Summary
Llnmon()
           
 
Method Summary
 String displayMessage(LocoNetMessage l)
          This function creates a string representation of a LocoNet buffer.
protected  String format(LocoNetMessage l)
          Format the message into a text string.
static String getDeviceNameFromIPLInfo(int manuf, int type)
           
static String getSlaveNameFromIPLInfo(int manuf, int slaveNum)
           
 void setLocoNetReporterManager(ReporterManager loconetReporterManager)
           
 void setLocoNetSensorManager(SensorManager loconetSensorManager)
          sets the loconet sensor manager which is used to find sensor "user names" from sensor "system names"
 void setLocoNetTurnoutManager(TurnoutManager loconetTurnoutManager)
          sets the loconet turnout manager which is used to find turnout "user names" from turnout "system names"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

forceHex

protected boolean forceHex
Global flag to indicate the message was not fully parsed, so the hex should be included.

Constructor Detail

Llnmon

public Llnmon()
Method Detail

format

protected String format(LocoNetMessage l)
Format the message into a text string. If forceHex is set upon return, the message was not fully parsed.

Parameters:
l - Message to parse
Returns:
String representation

displayMessage

public String displayMessage(LocoNetMessage l)
This function creates a string representation of a LocoNet buffer. The string may be more than one line, and is terminated with a newline.

Returns:
The created string representation.

getDeviceNameFromIPLInfo

public static String getDeviceNameFromIPLInfo(int manuf,
                                              int type)

getSlaveNameFromIPLInfo

public static String getSlaveNameFromIPLInfo(int manuf,
                                             int slaveNum)

setLocoNetTurnoutManager

public void setLocoNetTurnoutManager(TurnoutManager loconetTurnoutManager)
sets the loconet turnout manager which is used to find turnout "user names" from turnout "system names"

Parameters:
loconetTurnoutManager -

setLocoNetSensorManager

public void setLocoNetSensorManager(SensorManager loconetSensorManager)
sets the loconet sensor manager which is used to find sensor "user names" from sensor "system names"

Parameters:
loconetSensorManager -

setLocoNetReporterManager

public void setLocoNetReporterManager(ReporterManager loconetReporterManager)


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