Skip to content

Commit

Permalink
Updated team report in client
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerng committed Apr 26, 2017
1 parent 78aee9a commit 496e03b
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 8 deletions.
Binary file modified .gradle/2.13/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file modified .gradle/2.13/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/2.13/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file modified .gradle/2.13/taskArtifacts/taskArtifacts.bin
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void calculateStats(){
allTakeoffPercent = Statistics.percentAll(teamOne.takeoffPercentage/100,
teamTwo.takeoffPercentage/100, teamThree.takeoffPercentage/100);
totalGears = teamOne.avgAutoGears+teamOne.avgTeleOpGears+teamTwo.avgAutoGears
+teamTwo.avgTeleOpGears+teamThree.avgAutoGears+teamThree.avgTeleOpGears+1; //include reserve gear
+teamTwo.avgTeleOpGears+teamThree.avgAutoGears+teamThree.avgTeleOpGears;
totalKpa = autoKpa+teleopKpa;

predictedScore = totalKpa;
Expand All @@ -51,11 +51,11 @@ public void calculateStats(){
predictedScore+=40-60*(autoGearPercent/100);
predictedScore+=5*(teamOne.reachBaselinePercentage/100+teamTwo.reachBaselinePercentage/100+teamThree.reachBaselinePercentage/100);
predictedScore+=50*(teamOne.takeoffPercentage/100+teamTwo.takeoffPercentage/100+teamThree.takeoffPercentage/100);
if(totalGears>=12.8) // four rotors
if(totalGears>=11.8) // four rotors
predictedScore+=220;
else if(totalGears>=6.8) //three rotors
else if(totalGears>=5.8) //three rotors
predictedScore+=80;
else if(totalGears>=2.8) // two rotors
else if(totalGears>=1.8) // two rotors
predictedScore+=40;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,17 @@ public String quickTeamReport(int teamNum){
+report.totalReachBaseline+"/"+report.entries.size()+")"
+ "<br>";
formatString+="Place gear: "+Statistics.round(report.avgAutoGears*100,2)+"% ("
+Statistics.round(report.avgAutoGears*report.entries.size(),0)+"/"+report.entries.size()+")"
+report.totalAutoGearSuccess+"/"+report.entries.size()+")"
+"<br>";
formatString+="Avg. kPa: "+ Statistics.round(report.avgAutoKpa, 2)+"<br>";
formatString+="Gear attempt success: "+ Statistics.round(report.avgAutoKpa, 2)+"% ("
+ report.totalAutoGearSuccess+"/"+report.totalAutoGearAttempt+")<br>";
formatString+="Left peg: "+ Statistics.round(report.leftPegPercent, 2)+"% ("
+ report.totalLeftPegSuccess+"/"+report.totalLeftPegAttempt+")<br>";
formatString+="Center peg: "+ Statistics.round(report.centerPegPercent, 2)+"% ("
+ report.totalCenterPegSuccess+"/"+report.totalCenterPegAttempt+")<br>";
formatString+="Right peg: "+ Statistics.round(report.rightPegPercent, 2)+"% ("
+ report.totalRightPegSuccess+"/"+report.totalRightPegAttempt+")<br>";

formatString+="<h3>Tele-Op</h3>";
formatString+="Avg. gears: "+Statistics.round(report.avgTeleOpGears,2)+"<br>";
Expand All @@ -67,6 +75,11 @@ public String quickTeamReport(int teamNum){
formatString+=i+", ";
formatString+="<br>";
formatString+="Avg. kPa: "+Statistics.round(report.avgTeleOpKpa,2)+"<br>";
formatString+="Avg. dropped gears: "+Statistics.round(report.avgDroppedGears,2)+"<br>";
formatString+="Gear focus: "+Statistics.round(report.gearFocusPercent,2)+"%<br>";
formatString+="Avg. gear focus gears: "+Statistics.round(report.avgTeleOpGearsGearFocus,2)+"<br>";
formatString+="Fuel focus: "+Statistics.round(report.fuelFocusPercent,2)+"%<br>";
formatString+="Avg. kPa fuel focus: "+Statistics.round(report.avgTeleOpKpaFuelFocus,2)+"<br>";
formatString+="Takeoff success: " +Statistics.round(report.takeoffPercentage, 2)+"% ("
+ report.totalTakeoffSuccesses+"/"+report.entries.size()+")<br>";
formatString+="Takeoff attempt: " +Statistics.round(report.takeoffAttemptPercentage,2)+"% ("
Expand All @@ -76,6 +89,10 @@ public String quickTeamReport(int teamNum){
formatString+="Total gears: "+Statistics.round(report.avgAutoGears+report.avgTeleOpGears,2)+"<br>";
formatString+="Total kPa: " + Statistics.round(report.avgAutoKpa+report.avgTeleOpKpa,2)+"<br>";
formatString+="Pilot play: "+Statistics.round(report.pilotPlayPercentage,2)+"%<br>";
formatString+="Do not pick: "+(report.doNotPick ? "Yes" : "No" )+"<br>";
formatString+="Gear floor pickup: "+(report.hasPickup ? "Yes" : "No" )+"<br>";
formatString+="Active gear: "+(report.isActive ? "Yes" : "No" )+"<br>";
formatString+="Fuel intake: "+(report.hasIntake ? "Yes" : "No" )+"<br>";
formatString+="Frequent comments: " + report.frequentRobotCommentStr+" "+report.frequentPilotCommentStr;
formatString+="</html>";
return formatString;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ public static ArrayList<Double> toDoubleArrayList(ArrayList<Integer> arr){
/** Calculates arithmetic mean of a dataset
*
* @param dataset Array of numbers
* @return Average of entries in array
* @return Average of entries in array, 0 if dataset.size() is 0
*/
public static double average(ArrayList<Double> dataset){
public static double average(ArrayList<Double> dataset){
if(dataset.size()==0)
return 0;
return sum(dataset)/dataset.size();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

public class Window {

public static final double VERSION_NUMBER = 1.41;

/** When processing data, dataDirectory must have the qualified <code>short_name</code> for the event
* Downloaded data from TBA should be in same folder as well
* Output spreadsheets/summary reports to be written to same folder
Expand Down Expand Up @@ -217,7 +219,7 @@ public static JFrame addIcon(JFrame frame){

public static void initialize(){

JLabel introText = new JLabel("<html><h1>Team 25 Scouting Client - v1.4</h1><br>Press start to select data folder</html>");
JLabel introText = new JLabel("<html><h1>Team 25 Scouting Client - v" + VERSION_NUMBER+"</h1><br>Press start to select data folder</html>");
introText.setHorizontalAlignment(JLabel.CENTER);
introText.setFont(new Font("Arial", Font.PLAIN, 16));

Expand Down

0 comments on commit 496e03b

Please # to comment.