Class FaultCode


  • public class FaultCode
    extends java.lang.Object
    Error codes for robot and means to log them
    • Constructor Detail

      • FaultCode

        public FaultCode()
    • Method Detail

      • init

        public static void init()
        Push each fault code to the dashboard
      • eachCode

        public static void eachCode​(java.util.function.BiConsumer<LightningFaultCodes.Code,​java.lang.Boolean> fn)
        Runs the given function on each code.
        Parameters:
        fn - The BiConsumer function to perform on each code. The function should take a code and state (true or false) as parameters.
      • write

        public static void write​(LightningFaultCodes.Code code,
                                 java.lang.String msg)
        Writes the fault code, effectively logging that it has been detected in a log file and the system error stream. Per update(), they will be updated automatically on Shuffleboard
        Parameters:
        code - The LightningFaultCodes.Code to be written
        msg - The message to write to the log file
      • dummyLightOn

        public boolean dummyLightOn()
      • toJSONString

        public static java.lang.String toJSONString()
        Gets all the faults as a JSON String
        Returns:
        The faults in JSON format
      • getModel

        public static java.util.Map<java.lang.String,​java.lang.Object> getModel()
        Gets a model of the faults and their states as well as the timestamp
        Returns:
        The model of faults