Package jmri.jmrix.can.cbus.simulator
Class CbusSimulator
- java.lang.Object
-
- jmri.jmrix.can.cbus.simulator.CbusSimulator
-
- All Implemented Interfaces:
Disposable
public class CbusSimulator extends java.lang.Object implements Disposable
Simulating a MERG CBUS Command Station + other network objects.By default starts with 1 command station, a node in SLiM mode, and an event request responder.
All simulation responses can be sent as
CanMessageorCanReply- Since:
- 4.15.2
- See Also:
CbusDummyCS,CbusEventResponder,CbusDummyNode
-
-
Field Summary
Fields Modifier and Type Field Description java.util.ArrayList<CbusDummyCS>_csArrjava.util.ArrayList<CbusEventResponder>_evResponseArrjava.util.ArrayList<CbusDummyNode>_ndArr
-
Constructor Summary
Constructors Constructor Description CbusSimulator(CanSystemConnectionMemo sysmemo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNode(CbusDummyNode nd)voiddispose()Disposes of all simulated objects.CbusDummyCSgetCS(int id)CbusEventRespondergetEv(int id)CbusDummyNodegetNd(int id)CbusDummyCSgetNewCS()CbusEventRespondergetNewEv()intgetNumCS()intgetNumEv()intgetNumNd()voidinit()voidremoveNode(CbusDummyNode nd)
-
-
-
Field Detail
-
_csArr
public java.util.ArrayList<CbusDummyCS> _csArr
-
_ndArr
public java.util.ArrayList<CbusDummyNode> _ndArr
-
_evResponseArr
public java.util.ArrayList<CbusEventResponder> _evResponseArr
-
-
Constructor Detail
-
CbusSimulator
public CbusSimulator(@Nonnull CanSystemConnectionMemo sysmemo)
-
-
Method Detail
-
init
public final void init()
-
getNumCS
public int getNumCS()
-
getNumNd
public int getNumNd()
-
getNumEv
public int getNumEv()
-
getCS
public CbusDummyCS getCS(int id)
-
getNd
public CbusDummyNode getNd(int id)
-
addNode
public void addNode(CbusDummyNode nd)
-
removeNode
public void removeNode(CbusDummyNode nd)
-
getEv
public CbusEventResponder getEv(int id)
-
getNewCS
public CbusDummyCS getNewCS()
-
getNewEv
public CbusEventResponder getNewEv()
-
dispose
public void dispose()
Disposes of all simulated objects. CanListeners can be removed and command stations can stop session timers. Does not remove instance from InstanceManager or CAN memo.- Specified by:
disposein interfaceDisposable
-
-