diff --git a/.gradle/2.13/taskArtifacts/cache.properties.lock b/.gradle/2.13/taskArtifacts/cache.properties.lock index 73b899e..f6d2a52 100644 Binary files a/.gradle/2.13/taskArtifacts/cache.properties.lock and b/.gradle/2.13/taskArtifacts/cache.properties.lock differ diff --git a/.gradle/2.13/taskArtifacts/fileHashes.bin b/.gradle/2.13/taskArtifacts/fileHashes.bin index 040b66d..6d92a2a 100644 Binary files a/.gradle/2.13/taskArtifacts/fileHashes.bin and b/.gradle/2.13/taskArtifacts/fileHashes.bin differ diff --git a/Spreadsheet generator code generator.py b/Spreadsheet generator code generator.py index 5003464..ed2a01e 100644 --- a/Spreadsheet generator code generator.py +++ b/Spreadsheet generator code generator.py @@ -1,13 +1,14 @@ fields = ['teamNum','teamName','avgAutoScore', 'sdAutoScore','avgTeleOpScore', 'sdTeleOpScore','avgMatchScore','sdMatchScore', 'reachBaselinePercentage','avgAutoKpa', 'sdAutoKpa','avgTeleOpKpa', 'sdTeleOpKpa', - 'avgAutoGears','sdAutoGears','avgTeleOpGears', 'sdTeleOpGears', + 'avgAutoGears','sdAutoGears','autoGearAttemptSuccessPercent','autoGearPegLoc','leftPegPercent', + 'rightPegPercent','centerPegPercent','avgTeleOpGears', 'sdTeleOpGears','avgDroppedGears', 'avgHighGoals','sdHighGoals','avgLowGoals', 'sdLowGoals', 'avgHoppers','avgPointsPerCycle','sdPointsPerCycle','avgCycles', 'sdCycles', 'takeoffPercentage','takeoffAttemptPercentage','takeoffAttemptSuccessPercentage', - 'pilotPlayPercentage', 'autoShootsKey', + 'pilotPlayPercentage', 'hasPickup','hasIntake','isActive','doNotPick', 'frequentRobotCommentStr','frequentPilotCommentStr', 'allComments'] @@ -19,7 +20,7 @@ for field in fields: fileContents+='report.'+field+'+COMMA+' -fileContents+='+\'\\n\';' +fileContents+='\'\\n\';' print(header) print('\n') diff --git a/src/main/java/org/usfirst/frc/team25/scouting/client/data/EventReport.java b/src/main/java/org/usfirst/frc/team25/scouting/client/data/EventReport.java index 0591806..66717b0 100644 --- a/src/main/java/org/usfirst/frc/team25/scouting/client/data/EventReport.java +++ b/src/main/java/org/usfirst/frc/team25/scouting/client/data/EventReport.java @@ -175,24 +175,27 @@ public void setTeamNameList(File list){ public void generateTeamReportSpreadsheet(File outputDirectory){ final String COMMA = ","; - String header = "teamNum,teamName,avgAutoScore,sdAutoScore,avgTeleOpScore,sdTeleOpScore,avgMatchScore," - + "sdMatchScore,reachBaselinePercentage,avgAutoKpa,sdAutoKpa,avgTeleOpKpa,sdTeleOpKpa,avgAutoGears," - + "sdAutoGears,autoGearPeg,avgTeleOpGears,sdTeleOpGears,avgHighGoals,sdHighGoals,avgLowGoals,sdLowGoals,avgHoppers," - + "avgPointsPerCycle,sdPointsPerCycle,avgCycles,sdCycles,takeoffPercentage,takeoffAttemptPercentage," - + "takeoffAttemptSuccessPercentage,pilotPlayPercentage,autoShootsKey,frequentRobotCommentStr,frequentPilotCommentStr,allComments,\n"; + String header = "teamNum,teamName,avgAutoScore,sdAutoScore,avgTeleOpScore,sdTeleOpScore,avgMatchScore,sdMatchScore," + + "reachBaselinePercentage,avgAutoKpa,sdAutoKpa,avgTeleOpKpa,sdTeleOpKpa,avgAutoGears,sdAutoGears," + + "autoGearAttemptSuccessPercent,autoGearPegLoc,leftPegPercent,rightPegPercent,centerPegPercent,avgTeleOpGears," + + "sdTeleOpGears,avgDroppedGears,avgHighGoals,sdHighGoals,avgLowGoals,sdLowGoals,avgHoppers,avgPointsPerCycle," + + "sdPointsPerCycle,avgCycles,sdCycles,takeoffPercentage,takeoffAttemptPercentage,takeoffAttemptSuccessPercentage," + + "pilotPlayPercentage,hasPickup,hasIntake,isActive,doNotPick,frequentRobotCommentStr,frequentPilotCommentStr,allComments,\n"; String fileContents = header; for(int key : teamReports.keySet()){ TeamReport report = teamReports.get(key); fileContents += report.teamNum+COMMA+report.teamName+COMMA+report.avgAutoScore+COMMA+report.sdAutoScore+COMMA+ - report.avgTeleOpScore+COMMA+report.sdTeleOpScore+COMMA+report.avgMatchScore+COMMA+report.sdMatchScore+ - COMMA+report.reachBaselinePercentage+COMMA+report.avgAutoKpa+COMMA+report.sdAutoKpa+COMMA+report.avgTeleOpKpa - +COMMA+report.sdTeleOpKpa+COMMA+report.avgAutoGears+COMMA+report.sdAutoGears+COMMA+report.autoGearPeg+COMMA+report.avgTeleOpGears+COMMA+ - report.sdTeleOpGears+COMMA+report.avgHighGoals+COMMA+report.sdHighGoals+COMMA+report.avgLowGoals+COMMA+ - report.sdLowGoals+COMMA+report.avgHoppers+COMMA+report.avgPointsPerCycle+COMMA+report.sdPointsPerCycle+COMMA+ - report.avgCycles+COMMA+report.sdCycles+COMMA+report.takeoffPercentage+COMMA+report.takeoffAttemptPercentage+ - COMMA+report.takeoffAttemptSuccessPercentage+COMMA+report.pilotPlayPercentage+COMMA+report.autoShootsKey+COMMA - +report.frequentRobotCommentStr+COMMA+report.frequentPilotCommentStr+COMMA+report.allComments+COMMA+'\n'; + report.avgTeleOpScore+COMMA+report.sdTeleOpScore+COMMA+report.avgMatchScore+COMMA+report.sdMatchScore+COMMA+ + report.reachBaselinePercentage+COMMA+report.avgAutoKpa+COMMA+report.sdAutoKpa+COMMA+report.avgTeleOpKpa + +COMMA+report.sdTeleOpKpa+COMMA+report.avgAutoGears+COMMA+report.sdAutoGears+COMMA+report.autoGearAttemptSuccessPercent + +COMMA+report.autoGearPegLoc+COMMA+report.leftPegPercent+COMMA+report.rightPegPercent+COMMA+report.centerPegPercent+ + COMMA+report.avgTeleOpGears+COMMA+report.sdTeleOpGears+COMMA+report.avgDroppedGears+COMMA+report.avgHighGoals+COMMA+ + report.sdHighGoals+COMMA+report.avgLowGoals+COMMA+report.sdLowGoals+COMMA+report.avgHoppers+COMMA+report.avgPointsPerCycle+ + COMMA+report.sdPointsPerCycle+COMMA+report.avgCycles+COMMA+report.sdCycles+COMMA+report.takeoffPercentage+COMMA+ + report.takeoffAttemptPercentage+COMMA+report.takeoffAttemptSuccessPercentage+COMMA+report.pilotPlayPercentage+ + COMMA+report.hasPickup+COMMA+report.hasIntake+COMMA+report.isActive+COMMA+report.doNotPick+COMMA+ + report.frequentRobotCommentStr+COMMA+report.frequentPilotCommentStr+COMMA+report.allComments+COMMA+'\n'; } diff --git a/src/main/java/org/usfirst/frc/team25/scouting/client/data/Statistics.java b/src/main/java/org/usfirst/frc/team25/scouting/client/data/Statistics.java index b594228..4963fb2 100644 --- a/src/main/java/org/usfirst/frc/team25/scouting/client/data/Statistics.java +++ b/src/main/java/org/usfirst/frc/team25/scouting/client/data/Statistics.java @@ -70,6 +70,8 @@ public static double average(ArrayList dataset){ return sum(dataset)/dataset.size(); } + + /** Calculates the success rate of an event in all matches * * @param success Array with number of successes diff --git a/src/main/java/org/usfirst/frc/team25/scouting/client/data/TeamReport.java b/src/main/java/org/usfirst/frc/team25/scouting/client/data/TeamReport.java index 4aff7ee..0d7dcbe 100644 --- a/src/main/java/org/usfirst/frc/team25/scouting/client/data/TeamReport.java +++ b/src/main/java/org/usfirst/frc/team25/scouting/client/data/TeamReport.java @@ -20,24 +20,26 @@ public class TeamReport { double avgPointsPerCycle, avgCycles, sdCycles , reachBaselinePercentage, avgHighGoals, avgLowGoals,sdHighGoals, sdLowGoals, sdPointsPerCycle; - boolean hasPickup, hasIntake, isActive; + double avgAutoScore, avgTeleOpScore, avgMatchScore, avgAutoKpa, avgTeleOpKpa, avgAutoGears, - avgTeleOpGears, avgTotalFuel, avgHoppers, avgDroppedGears; + avgTeleOpGears, avgTotalFuel, avgHoppers; double sdAutoScore, sdTeleOpScore, sdMatchScore, sdAutoKpa, sdTeleOpKpa, sdAutoGears, sdTeleOpGears, sdTotalFuel; - String autoGearPeg = ""; - - double autoGearPercent, autoGearAttemptSuccessPercent, leftPegPercent, centerPegPercent, rightPegPercent; + String autoGearPegLoc = ""; - double avgTeleOpKpaFuelFocus, avgTeleOpGearsGearFocus, fuelFocusPercent, gearFocusPercent; double takeoffAttemptPercentage, takeoffAttemptSuccessPercentage, takeoffPercentage;// attempt is out of all matches; success is for each attempt double pilotPlayPercentage; ArrayList frequentRobotComment, frequentPilotComment; + + double autoGearAttemptSuccessPercent, leftPegPercent, centerPegPercent, rightPegPercent, avgDroppedGears; + boolean hasPickup, hasIntake, isActive, doNotPick; + + double avgTeleOpKpaFuelFocus, avgTeleOpGearsGearFocus, fuelFocusPercent, gearFocusPercent; //TODO calculate these values and update EventReport transient double autoAbility, teleOpAbility, driveTeamAbility, robotQualities; @@ -52,8 +54,12 @@ public class TeamReport { totalReachBaseline, totalAutoShootsKey; ArrayList totalHoppers= new ArrayList<>(), totalFuel= new ArrayList<>(), teleOpGears= new ArrayList<>(), autoScores= new ArrayList<>(), teleOpScores= new ArrayList<>(), matchScores= new ArrayList<>(), - totalCycles= new ArrayList<>(), totalHighGoals= new ArrayList<>(), totalLowGoals= new ArrayList<>(), autoGears= new ArrayList<>(); - ArrayList totalPointsPerCycle = new ArrayList<>(), autoKpas= new ArrayList<>(), teleOpKpa= new ArrayList<>(); + totalCycles= new ArrayList<>(), totalHighGoals= new ArrayList<>(), totalLowGoals= new ArrayList<>(), autoGears= new ArrayList<>(), + totalDroppedGears= new ArrayList<>(), totalTeleOpGearsGearFocus = new ArrayList<>(); + ArrayList totalPointsPerCycle = new ArrayList<>(), autoKpas= new ArrayList<>(), teleOpKpa= new ArrayList<>(),totalTeleOpKpaFuelFocus = new ArrayList<>(); + + int totalAutoGearAttempt, totalAutoGearSuccess, totalLeftPegAttempt, totalLeftPegSuccess, totalCenterPegAttempt, totalCenterPegSuccess, + totalRightPegAttempt, totalRightPegSuccess; public TeamReport(int teamNum){ this.teamNum = teamNum; @@ -81,38 +87,69 @@ void calculateTotals(){ totalTakeoffAttempts = totalTakeoffSuccesses = 0; totalPilotPlaying = totalReachBaseline = totalAutoShootsKey = 0; + totalAutoGearSuccess = totalAutoGearAttempt = 0; + totalLeftPegAttempt = totalLeftPegSuccess = totalCenterPegAttempt = totalCenterPegSuccess = 0; + totalRightPegSuccess = totalRightPegAttempt = 0; - - for(int i = 0; i < entries.size(); i++){ - if(entries.get(i).getTeleOp().isAttemptTakeoff()) + for(ScoutEntry entry : entries){ + if(entry.getTeleOp().isAttemptTakeoff()) totalTakeoffAttempts++; - if(entries.get(i).getTeleOp().isReadyTakeoff()) + if(entry.getTeleOp().isReadyTakeoff()) totalTakeoffSuccesses++; - if(entries.get(i).getPreMatch().isPilotPlaying()) + if(entry.getPreMatch().isPilotPlaying()) totalPilotPlaying++; - if(entries.get(i).auto.isBaselineCrossed()) + if(entry.auto.isBaselineCrossed()) totalReachBaseline++; - /*if(entries.get(i).getAuto().isShootsFromKey()) + /*if(entry.getAuto().isShootsFromKey()) totalAutoShootsKey++;*/ - totalHoppers.add((entries.get(i).auto.isUseHoppers() ? 1 : 0) - + entries.get(i).teleOp.getHopppersUsed()); - totalFuel.add(entries.get(i).auto.getHighGoals()+entries.get(i).auto.getLowGoals() - +entries.get(i).teleOp.getHighGoals()+entries.get(i).teleOp.getLowGoals()); - autoGears.add(entries.get(i).getAuto().isSuccessGear()? 1 : 0); - teleOpGears.add(entries.get(i).getTeleOp().getGearsDelivered()); - teleOpKpa.add(entries.get(i).teleOpKpa); - autoKpas.add(entries.get(i).autoKpa); - autoScores.add(entries.get(i).autoScore); - teleOpScores.add( entries.get(i).teleScore); - matchScores.add(entries.get(i).totalScore); - totalPointsPerCycle.add(entries.get(i).pointsPerCycle); - totalCycles.add(entries.get(i).teleOp.getNumCycles()); + if(entry.auto.isAttemptGear()){ + totalAutoGearAttempt++; + if(entry.auto.getGearPeg().equals("Left")) + totalLeftPegAttempt++; + if(entry.auto.getGearPeg().equals("Center")) + totalCenterPegAttempt++; + if(entry.auto.getGearPeg().equals("Right")) + totalRightPegAttempt++; + + } + + if(entry.auto.isSuccessGear()){ + totalAutoGearSuccess++; + if(entry.auto.getGearPeg().equals("Left")) + totalLeftPegSuccess++; + if(entry.auto.getGearPeg().equals("Center")) + totalCenterPegSuccess++; + if(entry.auto.getGearPeg().equals("Right")) + totalRightPegSuccess++; + + } + + + totalHoppers.add((entry.auto.isUseHoppers() ? 1 : 0) + + entry.teleOp.getHopppersUsed()); + totalFuel.add(entry.auto.getHighGoals()+entry.auto.getLowGoals() + +entry.teleOp.getHighGoals()+entry.teleOp.getLowGoals()); + autoGears.add(entry.getAuto().isSuccessGear()? 1 : 0); + teleOpGears.add(entry.getTeleOp().getGearsDelivered()); + teleOpKpa.add(entry.teleOpKpa); + autoKpas.add(entry.autoKpa); + autoScores.add(entry.autoScore); + teleOpScores.add( entry.teleScore); + matchScores.add(entry.totalScore); + totalPointsPerCycle.add(entry.pointsPerCycle); + totalCycles.add(entry.teleOp.getNumCycles()); + totalDroppedGears.add(entry.teleOp.getGearsDropped()); - totalHighGoals.add( entries.get(i).getAuto().getHighGoals()+entries.get(i).getTeleOp().getHighGoals()); - totalLowGoals.add(entries.get(i).getAuto().getLowGoals()+entries.get(i).getTeleOp().getLowGoals()); + totalHighGoals.add( entry.getAuto().getHighGoals()+entry.getTeleOp().getHighGoals()); + totalLowGoals.add(entry.getAuto().getLowGoals()+entry.getTeleOp().getLowGoals()); + + if(entry.postMatch.getFocus().equals("Gears")) + totalTeleOpGearsGearFocus.add(entry.teleOp.getGearsDelivered()); + if(entry.postMatch.getFocus().equals("Fuel")) + totalTeleOpKpaFuelFocus.add(entry.teleOpKpa); } @@ -142,6 +179,8 @@ public void calculateStats(){ avgTeleOpGears = Statistics.average(Statistics.toDoubleArrayList(teleOpGears)); sdTeleOpGears = Statistics.popStandardDeviation(Statistics.toDoubleArrayList(teleOpGears)); + avgDroppedGears = Statistics.average(Statistics.toDoubleArrayList(totalDroppedGears)); + avgAutoKpa = Statistics.average(autoKpas); sdAutoKpa = Statistics.popStandardDeviation(autoKpas); @@ -153,6 +192,11 @@ public void calculateStats(){ sdAutoGears = Statistics.popStandardDeviation(Statistics.toDoubleArrayList(autoGears)); + autoGearAttemptSuccessPercent = totalAutoGearAttempt!=0 ? (double) totalAutoGearSuccess/totalAutoGearAttempt*100 : 0; + leftPegPercent = totalLeftPegAttempt!= 0 ? (double) totalLeftPegSuccess / totalLeftPegAttempt * 100 : 0; + rightPegPercent = totalRightPegAttempt!= 0 ? (double) totalRightPegSuccess / totalRightPegAttempt * 100 : 0; + centerPegPercent = totalCenterPegAttempt!=0 ? (double) totalCenterPegSuccess / totalCenterPegAttempt * 100 : 0; + avgAutoScore = Statistics.average(Statistics.toDoubleArrayList(autoScores)); sdAutoScore = Statistics.popStandardDeviation(Statistics.toDoubleArrayList(autoScores)); @@ -180,9 +224,15 @@ public void calculateStats(){ avgLowGoals = Statistics.average(Statistics.toDoubleArrayList(totalLowGoals)); sdLowGoals = Statistics.popStandardDeviation(Statistics.toDoubleArrayList(totalLowGoals)); - if(totalAutoShootsKey/((double)entries.size())>=0.50) + avgTeleOpKpaFuelFocus = Statistics.average(totalTeleOpKpaFuelFocus); + avgTeleOpGearsGearFocus = Statistics.average(Statistics.toDoubleArrayList(totalTeleOpGearsGearFocus)); + + fuelFocusPercent = (double) totalTeleOpKpaFuelFocus.size() / entries.size() * 100; + gearFocusPercent = (double) totalTeleOpGearsGearFocus.size() / entries.size() * 100; + + /*if(totalAutoShootsKey/((double)entries.size())>=0.50) autoShootsKey = true; - else autoShootsKey = false; + else autoShootsKey = false;*/ HashMap commentFrequencies = new HashMap<>(); @@ -200,6 +250,17 @@ public void calculateStats(){ if(commentFrequencies.get(key)>=entries.size()/4.0) frequentRobotComment.add(key); + + doNotPick = frequentRobotComment.contains("Do not pick (explain)"); + isActive = frequentRobotComment.contains("Active gear mech."); + hasIntake = frequentRobotComment.contains("Fuel intake"); + hasPickup = frequentRobotComment.contains("Gear pickup"); + + frequentRobotComment.remove("Do not pick (explain)"); + frequentRobotComment.remove("Active gear mech."); + frequentRobotComment.remove("Fuel intake"); + frequentRobotComment.remove("Gear pickup"); + commentFrequencies = new HashMap<>(); for(String key : entries.get(0).getPostMatch().getPilotQuickCommentSelections().keySet()){ @@ -229,8 +290,8 @@ public void calculateStats(){ allComments+=entry.getPostMatch().getRobotComment() + "; "; if(!entry.getPostMatch().getPilotComment().equals("")) allComments+=entry.getPostMatch().getPilotComment()+"; "; - if(!autoGearPeg.contains(entry.getAuto().getGearPeg())) - autoGearPeg+=entry.getAuto().getGearPeg()+"; "; + if(!autoGearPegLoc.contains(entry.getAuto().getGearPeg())) + autoGearPegLoc+=entry.getAuto().getGearPeg()+"; "; } diff --git a/src/main/java/org/usfirst/frc/team25/scouting/client/ui/Window.java b/src/main/java/org/usfirst/frc/team25/scouting/client/ui/Window.java index 9595568..04306c5 100644 --- a/src/main/java/org/usfirst/frc/team25/scouting/client/ui/Window.java +++ b/src/main/java/org/usfirst/frc/team25/scouting/client/ui/Window.java @@ -217,7 +217,7 @@ public static JFrame addIcon(JFrame frame){ public static void initialize(){ - JLabel introText = new JLabel("

Team 25 Scouting Client - v1.3


Press start to select data folder"); + JLabel introText = new JLabel("

Team 25 Scouting Client - v1.4


Press start to select data folder"); introText.setHorizontalAlignment(JLabel.CENTER); introText.setFont(new Font("Arial", Font.PLAIN, 16));