jmri.jmrix.nce
Class NceAIU

java.lang.Object
  extended by jmri.jmrix.nce.NceAIU

public class NceAIU
extends Object

Model an NCE AIU

These AIUs are numbered ala the cab bus, from 1 to 63. AIU number 1 carries sensors 1 to 14; AIU 2 from 17 to 30, etc.

The array of sensor states is used to update sensor known state only when there's a change on the cab bus. This allows for the sensor state to be updated within the program, keeping this updated state until the next change on the cab bus. E.g. you can manually change a state via an icon, and not have it change back the next time that AIU is polled.

Author:
Bob Jacobsen Copyright (C) 2003, 2005

Constructor Summary
NceAIU()
           
 
Method Summary
 Sensor getSensor(int index)
          Return the sensor object for the specified AIU
 void markChanges(int bits)
           
 void registerSensor(Sensor s, int i)
          The numbers here are 0 to 15, not 1 to 16
 void sensorChange(int offset, int newState)
          set state of a single sensor based on AIU input
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NceAIU

public NceAIU()
Method Detail

markChanges

public void markChanges(int bits)
Parameters:
bits - int value of response from poll command

sensorChange

public void sensorChange(int offset,
                         int newState)
set state of a single sensor based on AIU input

Parameters:
offset - sensor number within the current array
newState - new state (Sensor.ACTIVE / .INACTIVE)

registerSensor

public void registerSensor(Sensor s,
                           int i)
The numbers here are 0 to 15, not 1 to 16

Parameters:
s -
i -

getSensor

public Sensor getSensor(int index)
Return the sensor object for the specified AIU

Parameters:
index - AIU index (0..15)
Returns:
sensor object


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