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
CanMessage
orCanReply
- Since:
- 4.15.2
- See Also:
CbusDummyCS
,CbusEventResponder
,CbusDummyNode
-
-
Field Summary
Fields Modifier and Type Field Description java.util.ArrayList<CbusDummyCS>
_csArr
java.util.ArrayList<CbusEventResponder>
_evResponseArr
java.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 void
addNode(CbusDummyNode nd)
void
dispose()
Disposes of all simulated objects.CbusDummyCS
getCS(int id)
CbusEventResponder
getEv(int id)
CbusDummyNode
getNd(int id)
CbusDummyCS
getNewCS()
CbusEventResponder
getNewEv()
int
getNumCS()
int
getNumEv()
int
getNumNd()
void
init()
void
removeNode(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:
dispose
in interfaceDisposable
-
-