Package jmri.jmrix.powerline.dmx512
Class SpecificTrafficController
- java.lang.Object
-
- jmri.jmrix.AbstractMRTrafficController
-
- jmri.jmrix.powerline.SerialTrafficController
-
- jmri.jmrix.powerline.dmx512.SpecificTrafficController
-
- All Implemented Interfaces:
SerialInterface
public class SpecificTrafficController extends SerialTrafficController
Converts Stream-based I/O to/from messages. The "SerialInterface" side sends/receives message objects.The connection to a SerialPortController is via a pair of *Streams, which then carry sequences of characters for transmission. Note that this processing is handled in an independent thread.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrix.AbstractMRTrafficController
AbstractMRTrafficController.RcvNotifier, AbstractMRTrafficController.XmtNotifier
-
-
Field Summary
Fields Modifier and Type Field Description byte[]
dmxArray
-
Fields inherited from class jmri.jmrix.powerline.SerialTrafficController
logDebug, memo
-
Fields inherited from class jmri.jmrix.AbstractMRTrafficController
allowUnexpectedReply, AUTORETRYSTATE, cmdListeners, connectionError, controller, flushReceiveChars, IDLESTATE, istream, listenerQueue, maxRcvExceptionCount, mCurrentMode, mCurrentState, mLastSender, msgQueue, mWaitBeforePoll, NORMALMODE, NOTIFIEDSTATE, OKSENDMSGSTATE, ostream, POLLSTATE, PROGRAMINGMODE, rcvException, rcvThread, replyInDispatch, threadStopRequest, timeoutFlag, timeouts, WAITMSGREPLYSTATE, WAITREPLYINNORMMODESTATE, WAITREPLYINPROGMODESTATE, waitTimePoll, xmtException, xmtRunnable, xmtThread
-
-
Constructor Summary
Constructors Constructor Description SpecificTrafficController(SerialSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getNumberOfIntensitySteps()
This system provides 256 dim stepsvoid
receiveLoop()
Handle incoming characters.boolean
sendDmxSequence(int unitid, byte newStep)
Send a sequence of Dmx messagesboolean
setDmxIntensity(int unitId, byte intensityValue)
set value in dmxArrayprotected void
transmitLoop()
Permanent loop for the transmit thread.-
Methods inherited from class jmri.jmrix.powerline.SerialTrafficController
addSerialListener, endOfMessage, enterNormalMode, enterProgMode, enterProgModeDelayTime, forwardMessage, forwardReply, forwardToPort, getAdapterMemo, getSensorManager, getSerialMessage, newReply, pollMessage, pollReplyHandler, removeSerialListener, sendInsteonSequence, sendSerialMessage, sendX10Sequence, setAdapterMemo, setSensorManager
-
Methods inherited from class jmri.jmrix.AbstractMRTrafficController
addConsoleListener, addHeaderToOutput, addListener, addTrailerToOutput, canReceive, connectionWarn, connectPort, disconnectPort, distributeReply, getLastSender, getPortName, getSynchronizeRx, handleOneIncomingReply, handleTimeout, hasTimeouts, lengthOfByteStream, loadChars, newRcvNotifier, notifyMessage, notifyReply, portReadyToSend, portWarn, portWarnTCP, programmerIdle, readByteProtected, recovery, removeListener, reportReceiveLoopException, resetTimeout, sendMessage, setAllowUnexpectedReply, setSynchronizeRx, status, terminate, terminateThreads, transmitWait, unexpectedReplyStateError, waitForStartOfReply, warnOnTimeout
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.jmrix.powerline.SerialInterface
status
-
-
-
-
Field Detail
-
dmxArray
public byte[] dmxArray
-
-
Constructor Detail
-
SpecificTrafficController
public SpecificTrafficController(SerialSystemConnectionMemo memo)
-
-
Method Detail
-
setDmxIntensity
public boolean setDmxIntensity(int unitId, byte intensityValue)
set value in dmxArray- Parameters:
unitId
- offset in dmxArrayintensityValue
- value to put in dmxArray- Returns:
- true when values ok
-
transmitLoop
protected void transmitLoop()
Description copied from class:AbstractMRTrafficController
Permanent loop for the transmit thread.- Overrides:
transmitLoop
in classAbstractMRTrafficController
-
receiveLoop
public void receiveLoop()
Description copied from class:AbstractMRTrafficController
Handle incoming characters. This is a permanent loop, looking for input messages in character form on the stream connected to the PortController viaAbstractMRTrafficController.connectPort(AbstractPortController)
.Each turn of the loop is the receipt of a single message.
- Overrides:
receiveLoop
in classAbstractMRTrafficController
-
getNumberOfIntensitySteps
public int getNumberOfIntensitySteps()
This system provides 256 dim steps- Overrides:
getNumberOfIntensitySteps
in classSerialTrafficController
- Returns:
- By default, dimming not available.
-
sendDmxSequence
public boolean sendDmxSequence(int unitid, byte newStep)
Send a sequence of Dmx messagesMakes call to update array
- Overrides:
sendDmxSequence
in classSerialTrafficController
- Parameters:
unitid
- which lightnewStep
- new intesity value- Returns:
- true on success
-
-