Package edu.wpi.first.wpilibj

Examples of edu.wpi.first.wpilibj.Dashboard


  public void act() {
    updateDefaultDashboard();
  }

  public void updateDefaultDashboard() {
    Dashboard lowDashData = DriverStation.getInstance()
        .getDashboardPackerLow();
    lowDashData.addCluster();
    {
      lowDashData.addCluster();
      { // analog modules
        lowDashData.addCluster();
        {
          for (int i = 1; i <= 8; i++) {
            lowDashData.addFloat((float) AnalogModule
                .getInstance(1).getAverageVoltage(i));
          }
        }
        lowDashData.finalizeCluster();
        lowDashData.addCluster();
        {
          for (int i = 1; i <= 8; i++) {
            lowDashData.addFloat((float) AnalogModule
                .getInstance(2).getAverageVoltage(i));
          }
        }
        lowDashData.finalizeCluster();
      }
      lowDashData.finalizeCluster();

      lowDashData.addCluster();
      { // digital modules
        lowDashData.addCluster();
        {
          lowDashData.addCluster();
          {
            int module = 4;
            lowDashData.addByte(DigitalModule.getInstance(module)
                .getRelayForward());
            lowDashData.addByte(DigitalModule.getInstance(module)
                .getRelayForward());
            lowDashData.addShort(DigitalModule.getInstance(module)
                .getAllDIO());
            lowDashData.addShort(DigitalModule.getInstance(module)
                .getDIODirection());
            lowDashData.addCluster();
            {
              for (int i = 1; i <= 10; i++) {
                lowDashData.addByte((byte) DigitalModule
                    .getInstance(module).getPWM(i));
              }
            }
            lowDashData.finalizeCluster();
          }
          lowDashData.finalizeCluster();
        }
        lowDashData.finalizeCluster();

        lowDashData.addCluster();
        {
          lowDashData.addCluster();
          {
            int module = 6;
            lowDashData.addByte(DigitalModule.getInstance(module)
                .getRelayForward());
            lowDashData.addByte(DigitalModule.getInstance(module)
                .getRelayReverse());
            lowDashData.addShort(DigitalModule.getInstance(module)
                .getAllDIO());
            lowDashData.addShort(DigitalModule.getInstance(module)
                .getDIODirection());
            lowDashData.addCluster();
            {
              for (int i = 1; i <= 10; i++) {
                lowDashData.addByte((byte) DigitalModule
                    .getInstance(module).getPWM(i));
              }
            }
            lowDashData.finalizeCluster();
          }
          lowDashData.finalizeCluster();
        }
        lowDashData.finalizeCluster();

      }
      lowDashData.finalizeCluster();

      lowDashData.addByte(Solenoid.getAll());
    }
    lowDashData.finalizeCluster();
    lowDashData.commit();
  }
View Full Code Here


  public void act() {
    updateDefaultDashboard();
  }

  public void updateDefaultDashboard() {
    Dashboard lowDashData = DriverStation.getInstance()
        .getDashboardPackerLow();
    lowDashData.addCluster();
    {
      lowDashData.addCluster();
      { // analog modules
        lowDashData.addCluster();
        {
          for (int i = 1; i <= 8; i++) {
            lowDashData.addFloat((float) AnalogModule
                .getInstance(1).getAverageVoltage(i));
          }
        }
        lowDashData.finalizeCluster();
        lowDashData.addCluster();
        {
          for (int i = 1; i <= 8; i++) {
            lowDashData.addFloat((float) AnalogModule
                .getInstance(2).getAverageVoltage(i));
          }
        }
        lowDashData.finalizeCluster();
      }
      lowDashData.finalizeCluster();

      lowDashData.addCluster();
      { // digital modules
        lowDashData.addCluster();
        {
          lowDashData.addCluster();
          {
            int module = 4;
            lowDashData.addByte(DigitalModule.getInstance(module)
                .getRelayForward());
            lowDashData.addByte(DigitalModule.getInstance(module)
                .getRelayForward());
            lowDashData.addShort(DigitalModule.getInstance(module)
                .getAllDIO());
            lowDashData.addShort(DigitalModule.getInstance(module)
                .getDIODirection());
            lowDashData.addCluster();
            {
              for (int i = 1; i <= 10; i++) {
                lowDashData.addByte((byte) DigitalModule
                    .getInstance(module).getPWM(i));
              }
            }
            lowDashData.finalizeCluster();
          }
          lowDashData.finalizeCluster();
        }
        lowDashData.finalizeCluster();

        lowDashData.addCluster();
        {
          lowDashData.addCluster();
          {
            int module = 6;
            lowDashData.addByte(DigitalModule.getInstance(module)
                .getRelayForward());
            lowDashData.addByte(DigitalModule.getInstance(module)
                .getRelayReverse());
            lowDashData.addShort(DigitalModule.getInstance(module)
                .getAllDIO());
            lowDashData.addShort(DigitalModule.getInstance(module)
                .getDIODirection());
            lowDashData.addCluster();
            {
              for (int i = 1; i <= 10; i++) {
                lowDashData.addByte((byte) DigitalModule
                    .getInstance(module).getPWM(i));
              }
            }
            lowDashData.finalizeCluster();
          }
          lowDashData.finalizeCluster();
        }
        lowDashData.finalizeCluster();

      }
      lowDashData.finalizeCluster();
           
            // Solenoid data: currently not functional
            // API change -- need to instantiate a SolenoidBase before
            // Reading getAll()
      lowDashData.addByte((byte) 0);
    }
    lowDashData.finalizeCluster();
    lowDashData.commit();
  }
View Full Code Here

TOP

Related Classes of edu.wpi.first.wpilibj.Dashboard

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.