Class LightningFaultCodes


  • public class LightningFaultCodes
    extends java.lang.Object
    Class representing a set of fault codes, or enumerated things that can go wrong. e.g. an encoder fault. We can use fault monitoring to keep tabs on these potential problems and to associate a name and error message with a problem that could happen. For example, if we are applying power to a motor, but the encoder is not moving, we can write the Encoder Fault to show that something is wrong.
    • Constructor Detail

      • LightningFaultCodes

        public LightningFaultCodes()
    • Method Detail

      • addFaultCode

        public static void addFaultCode​(java.lang.String name,
                                        boolean state)
        Adds a fault code to the registry
        Parameters:
        name - name of the fault code to be added
        state - initial state of the fault code
      • addFaultCode

        public static void addFaultCode​(java.lang.String name)
        Adds a fault code to the registry. The state of this code will be false
        Parameters:
        name - the name of the fault code to be added
      • addFaultCode

        public static void addFaultCode​(LightningFaultCodes.Code code)
        Adds a fault code to the registry
        Parameters:
        code - fault code to be added
      • getFaultCode

        public static LightningFaultCodes.Code getFaultCode​(java.lang.String name)
        Retrieve a specific fault code
        Parameters:
        name - the name of the fault code
        Returns:
        an object representing the fault code
      • getCodes

        public static java.util.List<LightningFaultCodes.Code> getCodes()
        Get a list of all fault codes
        Returns:
        a list of all of the fault codes