-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
135 lines (135 loc) · 3.21 KB
/
config.js
File metadata and controls
135 lines (135 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
require ('./types')
/** @type Config */
module.exports = {
port: 3000,
authString: "password",
initScript: "./setup.sql",
matchLength: 1*60,
freezeDelay: 2.5,
audio: {
leadTime: 0.25,
interrupted: "/sounds/Match Pause_normalized.wav",
sequence:[
{
time: 60,
source: "/sounds/Start Auto_normalized.wav",
},
{
time: 45,
source: "/sounds/Start Teleop_normalized.wav",
},
{
time: 15,
source: "/sounds/Start of End Game_normalized.wav",
},
{
time: 0,
source: "/sounds/Match End_normalized.wav",
}
]
},
scoreboard: {
duration: 15,
rankCol: {
name: "RPA",
width: 2,
func: (t) => t.rpa.toFixed(2)
},
data: [
[
{
name: "Wins",
width: 3,
func: (t) => t.wins
},
{
name: "Losses",
width: 3,
func: (t) => t.losses
},
{
name: "Ties",
width: 3,
func: (t) => t.ties
}
],
[
{
name: "Score",
width: 4,
func: (t) => t.score
},
{
name: "MetA",
width: 3,
func: (t) => t.metA
},
{
name: "MetB",
width: 3,
func: (t) => t.metB
}
]
],
},
postgame: {
duration: 45,
breakdown: [
{
name: "Met A",
func: (a) => a.metA
},
{
name: "Met B",
func: (a) => a.metB
},
{
name: "Met Sum",
func: (a) => a.metA+a.metB
}
]
},
buttons: [
[
{
text: "Low",
score: 1,
metA: 1,
},
{
text: "Mid",
score: 2,
metA: 1,
},
{
text: "High",
score: 3,
metA: 1,
},
],
{
text: "Foul",
score: 10,
metB: 10,
opposing: true,
spaceBefore: 2,
},
{
text: "-1",
score: -1,
metB: 1
}
],
rankPointFunction: (t) => {
return 2*t.wins + 1*t.ties;
},
sortFunction: (a, b)=>{
// Sort by ranking point average, in event of tie sort by average balls/match then average score
let delta = b.rpa - a.rpa;
if(delta == 0)
delta = b.metA/b.numMatches - a.metA/b.numMatches;
if(delta == 0)
delta = b.scoreAvg - a.scoreAvg;
return delta;
},
}