Class BindingModule
java.lang.Object
com.cdarobotics.cdalib.opmodes.modules.Module
com.cdarobotics.cdalib.opmodes.modules.BindingModule
A
Module that runs an action whenever its binding fires. The binding is registered with the
given BindingManager, and the action is triggered edge-wise — once each time the binding
transitions from inactive to active.-
Constructor Summary
ConstructorsConstructorDescriptionBindingModule(BindingManager bindingManager, Binding binding, Runnable action) Creates a binding-driven module, registering the binding with the manager immediately (viaBindingManager.replaceBinding(java.lang.String, java.util.function.BooleanSupplier)) and remembering its id for edge detection. -
Method Summary
Modifier and TypeMethodDescriptionvoidinit()Called once when the OpMode initializes.voidCalled repeatedly during the OpMode init phase, afterModule.init()and beforeModule.start(), while the driver is still on the init screen.voidloop()Called every loop.voidstart()Called once when the OpMode starts (play pressed).voidstop()Called once when the OpMode ends.
-
Constructor Details
-
BindingModule
Creates a binding-driven module, registering the binding with the manager immediately (viaBindingManager.replaceBinding(java.lang.String, java.util.function.BooleanSupplier)) and remembering its id for edge detection.- Parameters:
bindingManager- the manager the binding is registered withbinding- the trigger conditionaction- run once on each rising edge of the binding
-
-
Method Details
-
init
public void init()Description copied from class:ModuleCalled once when the OpMode initializes. -
init_loop
public void init_loop()Description copied from class:ModuleCalled repeatedly during the OpMode init phase, afterModule.init()and beforeModule.start(), while the driver is still on the init screen. -
start
public void start()Description copied from class:ModuleCalled once when the OpMode starts (play pressed). -
loop
public void loop()Description copied from class:ModuleCalled every loop. -
stop
public void stop()Description copied from class:ModuleCalled once when the OpMode ends.
-