Class TestControl
java.lang.Object
io.github.roboblazers7617.buttonbox.Control
io.github.roboblazers7617.buttonbox.controls.TestControl
- Direct Known Subclasses:
PhysicalTestControl
A test
Control
that sends a float that is increased every time server feedback is updated and outputs it to the client TTY.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
getValue()
void
setupNetworkTables
(NetworkTable table) Called by the Control class when the NetworkTable is set.void
Should set up any simulation-specific things.void
Updates the control's state on the client.void
Interfaces with the buttonbox hardware and updates the state of the physical control.void
Updates the control's state on the server.Methods inherited from class io.github.roboblazers7617.buttonbox.Control
getId, getTable, setTable, updateOnClient
-
Constructor Details
-
TestControl
Creates a new TestControl.- Parameters:
id
- The ID string for the TestControl to use.- See Also:
-
-
Method Details
-
setupSimulation
public void setupSimulation()Description copied from class:Control
Should set up any simulation-specific things.Called as a part of the constructor if the library is running in simulation.
- Overrides:
setupSimulation
in classControl
-
setupNetworkTables
Description copied from class:Control
Called by the Control class when the NetworkTable is set. Not intended to be called outside of the class.This should create all of the NetworkTables publishers and subscribers for the inheritting class.
- Overrides:
setupNetworkTables
in classControl
- Parameters:
table
-NetworkTable
-
updateServer
public void updateServer()Description copied from class:Control
Updates the control's state on the server.This doesn't do anything by default, and should be overridden by the class inheritting this.
- Overrides:
updateServer
in classControl
-
updateClient
public void updateClient()Description copied from class:Control
Updates the control's state on the client. This should get any feedback from the server, but this should not interface with the buttonbox hardware.This doesn't do anything by default, and should be overridden by the class inheritting this.
- Overrides:
updateClient
in classControl
-
updateHardware
public void updateHardware()Description copied from class:Control
Interfaces with the buttonbox hardware and updates the state of the physical control. Called afterControl.updateClient()
.This doesn't do anything by default, and should be overridden by the class inheritting this.
- Overrides:
updateHardware
in classControl
-
getValue
public double getValue()- Returns:
- The current value of the TestControl
-