Class ShotPoints.Trials
java.lang.Object
com.crossbotics.ftchelper.finders.ShotPoints.Trials
- Enclosing class:
ShotPoints
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
FieldsModifier and TypeFieldDescriptionstatic final intAt most this many shots wait to be marked (nobody marks more than 10 behind).static final doubleThe marks start again when the distance moves more than this from where they began (inches). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheck(double distanceIn) Every loop, with the distance now: when the robot has moved more thanSPOT_MOVE_INfrom where the marks began, they start again; shots fired at another spot and not marked yet are dropped (they belong to the old spot).voidclear()Forgets every shot and mark (a new table, after a save).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.voidfired(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.tally()The hits and shots marked here.undo()Takes back the last HIT or MISS: that shot waits to be marked again (first in line).intShots waiting to be marked.
-
Field Details
-
SPOT_MOVE_IN
public static final double SPOT_MOVE_INThe marks start again when the distance moves more than this from where they began (inches).- See Also:
-
MAX_UNMARKED
public static final int MAX_UNMARKEDAt 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, RPMhoodDeg- 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
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
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
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
Every loop, with the distance now: when the robot has moved more thanSPOT_MOVE_INfrom 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
The hits and shots marked here.
-