diff --git a/jsonpack.py b/jsonpack.py old mode 100644 new mode 100755 diff --git a/main.py b/main.py old mode 100644 new mode 100755 diff --git a/oprs.py b/oprs.py old mode 100644 new mode 100755 index 5e7fdf8..32a06c6 --- a/oprs.py +++ b/oprs.py @@ -235,39 +235,46 @@ def getProcessedData(eventName): alliance = file.split('-')[2] matchdata = matchlist[int(match.split('qm')[1])-1] - scoutdata = jsonpack.unpack(openFile(dataroot+eventName+'/'+file)) - key = file.split('-')[1] - - makeObject(tmpMatchData, key) - makeArray(tmpMatchData[key], 'blue') - makeArray(tmpMatchData[key], 'red') - makeArray(tmpMatchData[key], 'bluewins') - makeArray(tmpMatchData[key], 'blueScores') - makeArray(tmpMatchData[key], 'redScores') - - tmpMatchData[key]['blue'] = matchdata['blue'] - tmpMatchData[key]['red'] = matchdata['red'] - - tmpMatchData[key]['blueScores'].append(scoutdata['blueScore']) - tmpMatchData[key]['redScores'].append(scoutdata['redScore']) - - if alliance == 'blue': - tmpMatchData[key]['bluewins'].append(scoutdata['win']) - else: - tmpMatchData[key]['bluewins'].append(not scoutdata['win']) - - team = scoutdata['team'] - makeObject(teamResults, team) - makeNumber(teamResults[team], 'autoPerformance') - teamResults[team]['autoPerformance'] += int(scoutdata['autoPerformance']) - makeNumber(teamResults[team], 'teleopPerformance') - teamResults[team]['teleopPerformance'] += int(scoutdata['teleopPerformance']) - makeNumber(teamResults[team], 'overallPerformance') - teamResults[team]['overallPerformance'] += int(scoutdata['overallPerformance']) - makeNumber(teamResults[team], 'endState') - teamResults[team]['endState'] += int(scoutdata['endState']) - makeNumber(teamResults[team], 'scoreArea') - teamResults[team]['scoreArea'] += int(scoutdata['scoreArea']) + #print(dataroot+eventName+'/'+file) + try: + scoutdata = jsonpack.unpack(openFile(dataroot+eventName+'/'+file)) + + key = file.split('-')[1] + + makeObject(tmpMatchData, key) + makeArray(tmpMatchData[key], 'blue') + makeArray(tmpMatchData[key], 'red') + makeArray(tmpMatchData[key], 'bluewins') + makeArray(tmpMatchData[key], 'blueScores') + makeArray(tmpMatchData[key], 'redScores') + + tmpMatchData[key]['blue'] = matchdata['blue'] + tmpMatchData[key]['red'] = matchdata['red'] + + tmpMatchData[key]['blueScores'].append(scoutdata['blueScore']) + tmpMatchData[key]['redScores'].append(scoutdata['redScore']) + + if alliance == 'blue': + tmpMatchData[key]['bluewins'].append(scoutdata['win']) + else: + tmpMatchData[key]['bluewins'].append(not scoutdata['win']) + + team = scoutdata['team'] + makeObject(teamResults, team) + makeNumber(teamResults[team], 'autoPerformance') + teamResults[team]['autoPerformance'] += int(scoutdata['autoPerformance']) + makeNumber(teamResults[team], 'teleopPerformance') + teamResults[team]['teleopPerformance'] += int(scoutdata['teleopPerformance']) + makeNumber(teamResults[team], 'overallPerformance') + teamResults[team]['overallPerformance'] += int(scoutdata['overallPerformance']) + makeNumber(teamResults[team], 'endState') + teamResults[team]['endState'] += int(scoutdata['endState']) + makeNumber(teamResults[team], 'scoreArea') + teamResults[team]['scoreArea'] += int(scoutdata['scoreArea']) + + except: + continue + #print(tmpMatchData) oprData = [] @@ -363,4 +370,4 @@ def getProcessedData(eventName): teamOPR['scoreArea'] = 0 - return oprData, pinvInaccuracy \ No newline at end of file + return oprData, pinvInaccuracy diff --git a/tools/fakescout.py b/tools/fakescout.py old mode 100644 new mode 100755 diff --git a/tools/practice.py b/tools/practice.py old mode 100644 new mode 100755 diff --git a/tools/tbadownloader.py b/tools/tbadownloader.py old mode 100644 new mode 100755 diff --git a/web/leaderboard.html b/web/leaderboard.html old mode 100644 new mode 100755 diff --git a/web/matchscout.html b/web/matchscout.html index ba3b898..2338042 100755 --- a/web/matchscout.html +++ b/web/matchscout.html @@ -112,8 +112,9 @@
Prompts:
How fast was the robot able to score?
+Was the robot easily defended?
+How did the human player do?
Did anything unusual happen?
-Did the robot blow up?