jmri.jmrix.maple
Class OutputBits

java.lang.Object
  extended by jmri.jmrix.maple.OutputBits

public class OutputBits
extends Object

Utility Class supporting output to Maple HMI's

All of the Maple HMI panels receive the same output bits. This keeps them synchronized. Output is sent in "broadcast" mode to Station Address 0. All HMI's receive the output. Output is sent at the end of each polling cycle, whether or not anything has changed. That way, if an HMI panel is plugged in, it will be up-to-date within one polling cycle. Serial systems with unique output bits for each node keep their output array in each node. That code has been moved to this utility class for Maple Systems because all nodes share the same output bits. Coil bits within Maple Systems HMI's are divided into input (1-1000) and output (1001-9000), so input bits are read starting from HMI address 1, and output bits are written starting at HMI address 1001.

Author:
Dave Duchamp, Copyright (C) 2009

Field Summary
protected  byte[] outputArray
           
 
Method Summary
 SerialMessage createOutPacket(int startBitNum, int endBitNum)
          Public Method to create an Transmit packet (SerialMessage)
static int getNumOutputBits()
           
 boolean getOutputBit(int bitNumber)
          Public method get the current state of an output bit.
static int getSendDelay()
           
static OutputBits instance()
           
static void setNumOutputBits(int n)
           
 void setOutputBit(int bitNumber, boolean state)
          Public method setting an output bit.
static void setSendDelay(int n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outputArray

protected byte[] outputArray
Method Detail

setNumOutputBits

public static void setNumOutputBits(int n)

getNumOutputBits

public static int getNumOutputBits()

setSendDelay

public static void setSendDelay(int n)

getSendDelay

public static int getSendDelay()

setOutputBit

public void setOutputBit(int bitNumber,
                         boolean state)
Public method setting an output bit. Note: state = 'true' for 0, 'false' for 1 bits are numbered from 1 (not 0)


getOutputBit

public boolean getOutputBit(int bitNumber)
Public method get the current state of an output bit. Note: returns 'true' for 0, 'false' for 1 bits are numbered from 1 (not 0)


createOutPacket

public SerialMessage createOutPacket(int startBitNum,
                                     int endBitNum)
Public Method to create an Transmit packet (SerialMessage)


instance

public static OutputBits instance()


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