java.lang.Object
ch.ladestation.connectncharge.util.mvcbase.PuiBase<Game,ApplicationController>
ch.ladestation.connectncharge.pui.GamePUI
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.ladestation.connectncharge.util.mvcbase.PuiBase
PuiBase.ArrayUpdater<V>, PuiBase.Updater<V> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGamePUI(ApplicationController controller, com.pi4j.context.Context pi4J, LEDAnimator animator) -
Method Summary
Modifier and TypeMethodDescriptioncom.pi4j.io.gpio.digital.DigitalInput[]Get the pins to which the chips are connectedcom.pi4j.io.spi.Spiget the spi interface of the MCP23S17 chipsdefault voidinit(ApplicationController controller) needs to be called inside the constructor of your UI-partvoiddefault voidEverything that needs to be done to initialize the UI-part itself.voidlookUpChipAndPinNumberToEdge(int chipNo, int pinNo) lookUpEdge(int fromIndex, int toIndex) lookUpSegmentIdToSegment(int segmentId) static LedStripWill set up and initialise the LED-StripvoidsetupModelToUiBindings(Game model) this is only used to store the model instance to callsetupOwnModelToUiBindings(Game)later, because otherwise it is impossible to mock the LED-strip class.voidsetupOwnModelToUiBindings(Game model) This method binds the model reactively to the ledstrips.voidsetupUiToActionBindings(ApplicationController controller) default voidstartUp(ApplicationController controller) At the Startup, this method gets called.Methods inherited from class ch.ladestation.connectncharge.util.mvcbase.PuiBase
async, awaitCompletion, onChangeOf, onChangeOf, runLater, shutdown
-
Field Details
-
DEBUG_MSG_REACT_TO_ARR_CHANGE
- See Also:
-
DEBUG_MSG_REACT_TO_CHANGE
- See Also:
-
-
Constructor Details
-
GamePUI
public GamePUI(ApplicationController controller, com.pi4j.context.Context pi4J, LEDAnimator animator)
-
-
Method Details
-
setupLEDStrip
Will set up and initialise the LED-Strip- Returns:
- the
LedStripobject
-
initializeParts
public void initializeParts() -
setupUiToActionBindings
-
setupModelToUiBindings
this is only used to store the model instance to callsetupOwnModelToUiBindings(Game)later, because otherwise it is impossible to mock the LED-strip class.If the mock is passed to the Ctor it cannot be assigned to
this.ledstripin time before super calls setupModelToUiBindings(). So instead call it later but store the model until then.- Parameters:
model-
-
setupOwnModelToUiBindings
This method binds the model reactively to the ledstrips.- Parameters:
model-
-
getSpiInterface
public com.pi4j.io.spi.Spi getSpiInterface()get the spi interface of the MCP23S17 chips- Returns:
- the pi4j
Spiobject
-
getInterruptPins
public com.pi4j.io.gpio.digital.DigitalInput[] getInterruptPins()Get the pins to which the chips are connected- Returns:
- an array of
DigitalInputobjects
-
instanceSegments
public void instanceSegments() -
lookUpChipAndPinNumberToEdge
-
lookUpSegmentIdToSegment
-
lookUpEdge
-
getAllEdges
-
init
needs to be called inside the constructor of your UI-part -
initializeSelf
default void initializeSelf()Everything that needs to be done to initialize the UI-part itself.For GUIs loading stylesheet-files or additional fonts are typical examples.
-
startUp
At the Startup, this method gets called.Perfect, if a function in the controller or in the pui needs to be run exactly once.
-