001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.hal;
006
007public class PowerDistributionFaults {
008  @SuppressWarnings("MemberName")
009  public final boolean Channel0BreakerFault;
010
011  @SuppressWarnings("MemberName")
012  public final boolean Channel1BreakerFault;
013
014  @SuppressWarnings("MemberName")
015  public final boolean Channel2BreakerFault;
016
017  @SuppressWarnings("MemberName")
018  public final boolean Channel3BreakerFault;
019
020  @SuppressWarnings("MemberName")
021  public final boolean Channel4BreakerFault;
022
023  @SuppressWarnings("MemberName")
024  public final boolean Channel5BreakerFault;
025
026  @SuppressWarnings("MemberName")
027  public final boolean Channel6BreakerFault;
028
029  @SuppressWarnings("MemberName")
030  public final boolean Channel7BreakerFault;
031
032  @SuppressWarnings("MemberName")
033  public final boolean Channel8BreakerFault;
034
035  @SuppressWarnings("MemberName")
036  public final boolean Channel9BreakerFault;
037
038  @SuppressWarnings("MemberName")
039  public final boolean Channel10BreakerFault;
040
041  @SuppressWarnings("MemberName")
042  public final boolean Channel11BreakerFault;
043
044  @SuppressWarnings("MemberName")
045  public final boolean Channel12BreakerFault;
046
047  @SuppressWarnings("MemberName")
048  public final boolean Channel13BreakerFault;
049
050  @SuppressWarnings("MemberName")
051  public final boolean Channel14BreakerFault;
052
053  @SuppressWarnings("MemberName")
054  public final boolean Channel15BreakerFault;
055
056  @SuppressWarnings("MemberName")
057  public final boolean Channel16BreakerFault;
058
059  @SuppressWarnings("MemberName")
060  public final boolean Channel17BreakerFault;
061
062  @SuppressWarnings("MemberName")
063  public final boolean Channel18BreakerFault;
064
065  @SuppressWarnings("MemberName")
066  public final boolean Channel19BreakerFault;
067
068  @SuppressWarnings("MemberName")
069  public final boolean Channel20BreakerFault;
070
071  @SuppressWarnings("MemberName")
072  public final boolean Channel21BreakerFault;
073
074  @SuppressWarnings("MemberName")
075  public final boolean Channel22BreakerFault;
076
077  @SuppressWarnings("MemberName")
078  public final boolean Channel23BreakerFault;
079
080  @SuppressWarnings("MemberName")
081  public final boolean Brownout;
082
083  @SuppressWarnings("MemberName")
084  public final boolean CanWarning;
085
086  @SuppressWarnings("MemberName")
087  public final boolean HardwareFault;
088
089  /**
090   * Constructs from a bitfield.
091   *
092   * @param faults faults
093   */
094  public PowerDistributionFaults(int faults) {
095    Channel0BreakerFault = (faults & 0x1) != 0;
096    Channel1BreakerFault = (faults & 0x2) != 0;
097    Channel2BreakerFault = (faults & 0x4) != 0;
098    Channel3BreakerFault = (faults & 0x8) != 0;
099    Channel4BreakerFault = (faults & 0x10) != 0;
100    Channel5BreakerFault = (faults & 0x20) != 0;
101    Channel6BreakerFault = (faults & 0x40) != 0;
102    Channel7BreakerFault = (faults & 0x80) != 0;
103    Channel8BreakerFault = (faults & 0x100) != 0;
104    Channel9BreakerFault = (faults & 0x200) != 0;
105    Channel10BreakerFault = (faults & 0x400) != 0;
106    Channel11BreakerFault = (faults & 0x800) != 0;
107    Channel12BreakerFault = (faults & 0x1000) != 0;
108    Channel13BreakerFault = (faults & 0x2000) != 0;
109    Channel14BreakerFault = (faults & 0x4000) != 0;
110    Channel15BreakerFault = (faults & 0x8000) != 0;
111    Channel16BreakerFault = (faults & 0x10000) != 0;
112    Channel17BreakerFault = (faults & 0x20000) != 0;
113    Channel18BreakerFault = (faults & 0x40000) != 0;
114    Channel19BreakerFault = (faults & 0x80000) != 0;
115    Channel20BreakerFault = (faults & 0x100000) != 0;
116    Channel21BreakerFault = (faults & 0x200000) != 0;
117    Channel22BreakerFault = (faults & 0x400000) != 0;
118    Channel23BreakerFault = (faults & 0x800000) != 0;
119    Brownout = (faults & 0x1000000) != 0;
120    CanWarning = (faults & 0x2000000) != 0;
121    HardwareFault = (faults & 0x4000000) != 0;
122  }
123}