Class AbstractFaultMonitor
- java.lang.Object
-
- com.lightningrobotics.common.fault.AbstractFaultMonitor
-
- Direct Known Subclasses:
FaultMonitor,TimedFaultMonitor,UnchangingFaultMonitor
public abstract class AbstractFaultMonitor extends java.lang.ObjectBaseLightningFaultCodes.Codechecking functionality
-
-
Field Summary
Fields Modifier and Type Field Description protected LightningFaultCodes.Codecodeprotected booleanfatalprotected java.lang.Stringmsg
-
Constructor Summary
Constructors Constructor Description AbstractFaultMonitor(LightningFaultCodes.Code code)Creates a new non-fatal abstract fault monitorAbstractFaultMonitor(LightningFaultCodes.Code code, java.lang.String msg)Creates a new non-fatal abstract fault monitorAbstractFaultMonitor(LightningFaultCodes.Code code, java.lang.String msg, boolean fatal)Creates a new abstract fault monitor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancheck()Checks if the fault should be written, and writes the fault if it shouldabstract booleancheckFault()To be overridden, determines if fault should be writtenvoidtrigger()Writes the fault.
-
-
-
Field Detail
-
code
protected LightningFaultCodes.Code code
-
msg
protected java.lang.String msg
-
fatal
protected boolean fatal
-
-
Constructor Detail
-
AbstractFaultMonitor
public AbstractFaultMonitor(LightningFaultCodes.Code code, java.lang.String msg, boolean fatal)
Creates a new abstract fault monitor- Parameters:
code- TheLightningFaultCodes.Codeto be monitoredmsg- The message to use should the fault be writtenfatal- If the fault is fatal and should stop the robot
-
AbstractFaultMonitor
public AbstractFaultMonitor(LightningFaultCodes.Code code, java.lang.String msg)
Creates a new non-fatal abstract fault monitor- Parameters:
code- TheLightningFaultCodes.Codeto be monitoredmsg- The message to use should the fault be written
-
AbstractFaultMonitor
public AbstractFaultMonitor(LightningFaultCodes.Code code)
Creates a new non-fatal abstract fault monitor- Parameters:
code- TheLightningFaultCodes.Codeto be monitored
-
-
Method Detail
-
checkFault
public abstract boolean checkFault()
To be overridden, determines if fault should be written- Returns:
- True if the fault should be written, false otherwise
-
check
public boolean check()
Checks if the fault should be written, and writes the fault if it should- Returns:
- True if the fault should be written, false otherwise
-
trigger
public void trigger()
Writes the fault. If the fault is fatal, cancles and disables theCommandScheduler
-
-