Class TorqueTimeout
java.lang.Object
org.texastorque.torquelib.control.TorqueTimeout
Controls code execution based on an action and a timeout.
-
Constructor Summary
ConstructorDescriptionTorqueTimeout
(double timeout) Create a new TorqueTimeout and specify the timeout. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
calculate
(boolean action) If action is true and it hasn't been true for longer than the timeout, return true.
-
Constructor Details
-
TorqueTimeout
public TorqueTimeout(double timeout) Create a new TorqueTimeout and specify the timeout.- Parameters:
timeout
- The timeout in seconds.
-
-
Method Details
-
calculate
public final boolean calculate(boolean action) If action is true and it hasn't been true for longer than the timeout, return true.- Parameters:
action
- The condition to check.
-