Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Astatin3 committed Mar 2, 2024
1 parent 038a415 commit 8731708
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 35 deletions.
Empty file modified jsonpack.py
100644 → 100755
Empty file.
Empty file modified main.py
100644 → 100755
Empty file.
75 changes: 41 additions & 34 deletions oprs.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down Expand Up @@ -363,4 +370,4 @@ def getProcessedData(eventName):
teamOPR['scoreArea'] = 0


return oprData, pinvInaccuracy
return oprData, pinvInaccuracy
Empty file modified tools/fakescout.py
100644 → 100755
Empty file.
Empty file modified tools/practice.py
100644 → 100755
Empty file.
Empty file modified tools/tbadownloader.py
100644 → 100755
Empty file.
Empty file modified web/leaderboard.html
100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion web/matchscout.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ <h3 id="teamPosition">Position: </h3>
<div style="display: inline;">
<p>Prompts:</p>
<p>How fast was the robot able to score?</p>
<p>Was the robot easily defended?</p>
<p>How did the human player do?</p>
<p>Did anything unusual happen?</p>
<p>Did the robot blow up?</p>
</div>
</div>
</div>
Expand Down
Empty file modified web/predictor.html
100644 → 100755
Empty file.
Empty file modified web/selector.html
100644 → 100755
Empty file.
Empty file modified web/src/pico.min.css
100644 → 100755
Empty file.
Empty file modified web/src/socket.io.js
100644 → 100755
Empty file.
Empty file modified web/team.html
100644 → 100755
Empty file.

0 comments on commit 8731708

Please sign in to comment.