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.Spi
get the spi interface of the MCP23S17 chipsdefault void
init
(ApplicationController controller) needs to be called inside the constructor of your UI-partvoid
default void
Everything that needs to be done to initialize the UI-part itself.void
lookUpChipAndPinNumberToEdge
(int chipNo, int pinNo) lookUpEdge
(int fromIndex, int toIndex) lookUpSegmentIdToSegment
(int segmentId) static LedStrip
Will set up and initialise the LED-Stripvoid
setupModelToUiBindings
(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.void
setupOwnModelToUiBindings
(Game model) This method binds the model reactively to the ledstrips.void
setupUiToActionBindings
(ApplicationController controller) default void
startUp
(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
LedStrip
object
-
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.ledstrip
in 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
Spi
object
-
getInterruptPins
public com.pi4j.io.gpio.digital.DigitalInput[] getInterruptPins()Get the pins to which the chips are connected- Returns:
- an array of
DigitalInput
objects
-
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.
-