Class ShotPoints.Trials

java.lang.Object
com.crossbotics.ftchelper.finders.ShotPoints.Trials
Enclosing class:
ShotPoints

public static final class ShotPoints.Trials extends Object
The Shot Tuner's shots at one spot: each shot fired waits to be marked HIT or MISS, and keeps the speed, hood angle and distance it was FIRED with (not what the screen says when you mark it). Marks go into a ShotPoints.Tally. It also undoes the last mark, drops a shot that never was (the flywheel dipped without a piece), and forgets shots from a spot the robot has left.

 ShotPoints.Trials trials = new ShotPoints.Trials();
 trials.fired(2550, Double.NaN, 2540, 48);   // a shot: 2550 asked, 2540 measured, 48 in away
 trials.mark(true);                          // it went in
 trials.undo();                              // oops, it was a miss: mark it again
 trials.mark(false);
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    At most this many shots wait to be marked (nobody marks more than 10 behind).
    static final double
    The marks start again when the distance moves more than this from where they began (inches).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    check(double distanceIn)
    Every loop, with the distance now: when the robot has moved more than SPOT_MOVE_IN from where the marks began, they start again; shots fired at another spot and not marked yet are dropped (they belong to the old spot).
    void
    Forgets every shot and mark (a new table, after a save).
    Forgets the NEWEST shot not marked yet: a "shot" that never was (the flywheel dipped without a piece going through), so the marks stay in line with the real shots.
    void
    fired(double rpm, double hoodDeg, double measuredRpm, double distanceIn)
    A piece was fed: it waits to be marked.
    mark(boolean hit)
    Marks the OLDEST shot not marked yet (A = HIT, B = MISS), at the speed, hood and spot it was fired with.
    The hits and shots marked here.
    Takes back the last HIT or MISS: that shot waits to be marked again (first in line).
    int
    Shots waiting to be marked.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SPOT_MOVE_IN

      public static final double SPOT_MOVE_IN
      The marks start again when the distance moves more than this from where they began (inches).
      See Also:
    • MAX_UNMARKED

      public static final int MAX_UNMARKED
      At most this many shots wait to be marked (nobody marks more than 10 behind).
      See Also:
  • Constructor Details

    • Trials

      public Trials()
  • Method Details

    • fired

      public void fired(double rpm, double hoodDeg, double measuredRpm, double distanceIn)
      A piece was fed: it waits to be marked.
      Parameters:
      rpm - the speed asked for, RPM
      hoodDeg - the hood angle, degrees (NaN = no hood)
      measuredRpm - the flywheel speed measured as it was fed, RPM (NaN = not known)
      distanceIn - the distance it was fired from, inches (NaN = not known)
    • mark

      public String mark(boolean hit)
      Marks the OLDEST shot not marked yet (A = HIT, B = MISS), at the speed, hood and spot it was fired with.
      Returns:
      a few words for the Driver Station
    • undo

      public String undo()
      Takes back the last HIT or MISS: that shot waits to be marked again (first in line).
      Returns:
      a few words for the Driver Station
    • dropLast

      public String dropLast()
      Forgets the NEWEST shot not marked yet: a "shot" that never was (the flywheel dipped without a piece going through), so the marks stay in line with the real shots.
      Returns:
      a few words for the Driver Station
    • check

      public String check(double distanceIn)
      Every loop, with the distance now: when the robot has moved more than SPOT_MOVE_IN from where the marks began, they start again; shots fired at another spot and not marked yet are dropped (they belong to the old spot).
      Parameters:
      distanceIn - the distance now, inches (NaN = not known: nothing happens)
      Returns:
      "" or a few words for the Driver Station
    • clear

      public void clear()
      Forgets every shot and mark (a new table, after a save).
    • unmarkedCount

      public int unmarkedCount()
      Shots waiting to be marked.
    • tally

      public ShotPoints.Tally tally()
      The hits and shots marked here.