Class MainController
- java.lang.Object
-
- org.bidib.wizard.mvc.main.controller.MainController
-
- All Implemented Interfaces:
MainControllerInterface
public class MainController extends Object implements MainControllerInterface
-
-
Constructor Summary
Constructors Constructor Description MainController(MainModel model, ConnectionPhaseModel connectionPhaseModel, String connectionId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNodeListListener(org.bidib.wizard.api.model.listener.NodeListListener nodeListListener)voidaddNodeSelectionListListener(org.bidib.wizard.api.model.listener.NodeSelectionListener l)voidallBoosterOff()Switch all boosters off.voidallBoosterOn(boolean boosterAndCommandStation, org.bidib.wizard.model.status.CommandStationStatus requestedCommandStationState)Switch all boosters on.voidclearNodes()Clear the nodes.voidcloseConnection()Close the connection.voidhandleConnectionEvent(BidibConnectionEvent event)voidhandleMenuEvent(MainControllerEvent event)booleanhasStartupPassed()voidinit()voidlistenNetBidib()Listen for incoming netBidib connections.voidmapPortType(org.bidib.wizard.common.script.node.types.TargetType portType)Switch the port type.voidopenConnection()Open the connection.voidremoveNodeListListener(org.bidib.wizard.api.model.listener.NodeListListener nodeListListener)voidremoveNodeSelectionListener(org.bidib.wizard.api.model.listener.NodeSelectionListener l)voidreplacePortConfig(org.bidib.wizard.common.script.node.types.TargetType portType, Map<Byte,org.bidib.jbidibc.messages.port.PortConfigValue<?>> portConfig)Replace the port config.voidresetNode(org.bidib.wizard.api.model.NodeInterface node)Reset the node.voidsavePendingChanges()Save the pending changes of the current selected node.voidstart()Start the main controller.voidstop()Stop the main controller and perform the shutdown.voidtransferAccessoryToNode(org.bidib.wizard.api.model.NodeInterface node, org.bidib.wizard.api.model.Accessory accessory)
-
-
-
Constructor Detail
-
MainController
public MainController(MainModel model, ConnectionPhaseModel connectionPhaseModel, String connectionId)
-
-
Method Detail
-
init
@PostConstruct public void init()
-
hasStartupPassed
public boolean hasStartupPassed()
-
clearNodes
public void clearNodes()
Description copied from interface:MainControllerInterfaceClear the nodes.- Specified by:
clearNodesin interfaceMainControllerInterface
-
start
public void start()
Start the main controller.
-
stop
public void stop()
Description copied from interface:MainControllerInterfaceStop the main controller and perform the shutdown.- Specified by:
stopin interfaceMainControllerInterface
-
savePendingChanges
public void savePendingChanges()
Description copied from interface:MainControllerInterfaceSave the pending changes of the current selected node.- Specified by:
savePendingChangesin interfaceMainControllerInterface
-
addNodeListListener
public void addNodeListListener(org.bidib.wizard.api.model.listener.NodeListListener nodeListListener)
- Specified by:
addNodeListListenerin interfaceMainControllerInterface
-
removeNodeListListener
public void removeNodeListListener(org.bidib.wizard.api.model.listener.NodeListListener nodeListListener)
- Specified by:
removeNodeListListenerin interfaceMainControllerInterface
-
addNodeSelectionListListener
public void addNodeSelectionListListener(org.bidib.wizard.api.model.listener.NodeSelectionListener l)
- Specified by:
addNodeSelectionListListenerin interfaceMainControllerInterface
-
removeNodeSelectionListener
public void removeNodeSelectionListener(org.bidib.wizard.api.model.listener.NodeSelectionListener l)
- Specified by:
removeNodeSelectionListenerin interfaceMainControllerInterface
-
handleConnectionEvent
@EventListener public void handleConnectionEvent(BidibConnectionEvent event)
-
openConnection
public void openConnection()
Description copied from interface:MainControllerInterfaceOpen the connection.- Specified by:
openConnectionin interfaceMainControllerInterface
-
listenNetBidib
public void listenNetBidib()
Description copied from interface:MainControllerInterfaceListen for incoming netBidib connections.- Specified by:
listenNetBidibin interfaceMainControllerInterface
-
closeConnection
public void closeConnection()
Description copied from interface:MainControllerInterfaceClose the connection.- Specified by:
closeConnectionin interfaceMainControllerInterface
-
allBoosterOff
public void allBoosterOff()
Description copied from interface:MainControllerInterfaceSwitch all boosters off.- Specified by:
allBoosterOffin interfaceMainControllerInterface
-
allBoosterOn
public void allBoosterOn(boolean boosterAndCommandStation, org.bidib.wizard.model.status.CommandStationStatus requestedCommandStationState)Description copied from interface:MainControllerInterfaceSwitch all boosters on.- Specified by:
allBoosterOnin interfaceMainControllerInterface- Parameters:
boosterAndCommandStation- switch all booster and command station onrequestedCommandStationState- the requested command station state
-
resetNode
public void resetNode(org.bidib.wizard.api.model.NodeInterface node)
Description copied from interface:MainControllerInterfaceReset the node.- Specified by:
resetNodein interfaceMainControllerInterface- Parameters:
node- the node
-
transferAccessoryToNode
public void transferAccessoryToNode(org.bidib.wizard.api.model.NodeInterface node, org.bidib.wizard.api.model.Accessory accessory)- Specified by:
transferAccessoryToNodein interfaceMainControllerInterface
-
replacePortConfig
public void replacePortConfig(org.bidib.wizard.common.script.node.types.TargetType portType, Map<Byte,org.bidib.jbidibc.messages.port.PortConfigValue<?>> portConfig)Description copied from interface:MainControllerInterfaceReplace the port config.- Specified by:
replacePortConfigin interfaceMainControllerInterface- Parameters:
portType- the port typeportConfig- the new port config
-
mapPortType
public void mapPortType(org.bidib.wizard.common.script.node.types.TargetType portType)
Description copied from interface:MainControllerInterfaceSwitch the port type.- Specified by:
mapPortTypein interfaceMainControllerInterface- Parameters:
portType- the port type
-
handleMenuEvent
@EventListener public void handleMenuEvent(MainControllerEvent event)
-
-