blob: 828e0362ae5c715769d75c2831787f7ada2e66f9 [file] [log] [blame]
Philipp Schrader6b2e9502022-03-15 23:42:56 -07001<div class="header" #header>
Philipp Schrader2b334272023-04-11 21:27:36 -07002 <h2>
3 <span *ngIf="section != 'Team Selection'">{{teamNumber}}</span>
4 {{section}}
5 </h2>
Philipp Schrader80587432022-03-05 15:41:22 -08006</div>
Philipp Schrader80587432022-03-05 15:41:22 -08007<ng-container [ngSwitch]="section">
Philipp Schrader817cce32022-03-26 15:00:00 -07008 <div
9 *ngSwitchCase="'Team Selection'"
10 id="team_selection"
11 class="container-fluid"
12 >
13 <div class="row">
14 <label for="match_number">Match Number</label>
15 <input
16 [(ngModel)]="matchNumber"
17 type="number"
18 id="match_number"
19 min="1"
20 max="999"
21 />
22 </div>
23 <div class="row">
24 <label for="team_number">Team Number</label>
25 <input
26 [(ngModel)]="teamNumber"
27 type="number"
28 id="team_number"
29 min="1"
30 max="9999"
31 />
32 </div>
Philipp Schrader8aeb14f2022-04-08 21:23:18 -070033 <div class="row">
Philipp Schrader30b4a682022-04-16 14:36:17 -070034 <label for="set_number">Set Number</label>
35 <input
36 [(ngModel)]="setNumber"
37 type="number"
38 id="set_number"
39 min="1"
40 max="10"
41 />
Philipp Schrader8aeb14f2022-04-08 21:23:18 -070042 </div>
43 <div class="row">
Philipp Schrader30b4a682022-04-16 14:36:17 -070044 <label for="comp_level">Comp Level</label>
Philipp Schrader8aeb14f2022-04-08 21:23:18 -070045 <select [(ngModel)]="compLevel" type="number" id="comp_level">
46 <option *ngFor="let level of COMP_LEVELS" [ngValue]="level">
47 {{COMP_LEVEL_LABELS[level]}}
48 </option>
49 </select>
50 </div>
Philipp Schrader817cce32022-03-26 15:00:00 -070051 <div class="buttons">
52 <!-- hack to right align the next button -->
53 <div></div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -080054 <button class="btn btn-primary" (click)="changeSectionTo('Init');">
55 Next
56 </button>
Philipp Schrader817cce32022-03-26 15:00:00 -070057 </div>
58 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -080059 <div *ngSwitchCase="'Init'" id="init" class="container-fluid">
60 <h2>Select Starting Position</h2>
Filip Kujawa1d9add92023-03-03 13:14:40 -080061 <img
62 id="field_starting_positions_image"
63 src="/sha256/b71def525fb78486617a8b350c0ba6907e8ea25f78d4084a932cba8ae922528c/pictures/field/field.jpg"
64 alt="Starting Positions Image"
65 class="img-fluid"
66 />
Filip Kujawa0ef334c2023-02-20 19:42:45 -080067 <div *ngFor="let i of [1, 2, 3, 4]">
68 <label>
Philipp Schrader817cce32022-03-26 15:00:00 -070069 <input
70 type="radio"
Filip Kujawa0ef334c2023-02-20 19:42:45 -080071 name="radio-group"
72 [value]="i"
73 (change)="selectedValue = $event.target.value"
Philipp Schrader817cce32022-03-26 15:00:00 -070074 />
Filip Kujawa0ef334c2023-02-20 19:42:45 -080075 {{ i }}
Philipp Schrader817cce32022-03-26 15:00:00 -070076 </label>
Filip Kujawa0ef334c2023-02-20 19:42:45 -080077 </div>
Philipp Schrader817cce32022-03-26 15:00:00 -070078 <div class="buttons">
Filip Kujawa375aaac2023-02-28 21:43:47 -080079 <!-- Creates a responsive stack of full-width, "block buttons". -->
Filip Kujawa36f56082023-03-03 10:58:53 -080080 <div class="d-grid gap-5">
Filip Kujawa375aaac2023-02-28 21:43:47 -080081 <button
82 class="btn btn-primary"
83 [disabled]="!selectedValue"
84 (click)="changeSectionTo('Pickup'); addAction({type: 'startMatchAction', position: selectedValue});"
85 >
86 Start Match
87 </button>
88 </div>
Philipp Schrader817cce32022-03-26 15:00:00 -070089 </div>
90 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -080091 <div *ngSwitchCase="'Pickup'" id="PickUp" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -080092 <h6 class="text-muted">
93 Last Action: {{actionList[actionList.length - 1].type}}
94 </h6>
Filip Kujawaaa7d11f2023-04-13 09:12:32 -070095 <!--
96 Decrease distance between buttons during auto to make space for auto balancing
97 selection and keep all buttons visible without scrolling on most devices.
98 -->
99 <div
100 [ngClass]="{'d-grid': true, 'gap-3': autoPhase === true, 'gap-5': autoPhase === false}"
101 >
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800102 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
103 <button
104 class="btn btn-danger"
105 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
106 >
107 DEAD
108 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800109 <button
110 class="btn btn-warning"
111 (click)="changeSectionTo('Place'); addAction({type: 'pickupObjectAction', objectType: ObjectType.kCone});"
112 >
113 CONE
114 </button>
115 <button
116 class="btn btn-primary"
117 (click)="changeSectionTo('Place'); addAction({type: 'pickupObjectAction', objectType: ObjectType.kCube});"
118 >
119 CUBE
120 </button>
Filip Kujawa0b4b1e52023-04-15 14:05:40 -0700121 <button
122 *ngIf="autoPhase"
123 class="btn btn-light"
124 (click)="addAction({type: 'mobilityAction', mobility: true});"
125 >
126 Mobility
127 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800128 <!-- 'Balancing' during auto. -->
129 <div *ngIf="autoPhase" class="d-grid gap-2">
130 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700131 <input #docked type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700132 Docked (on the charging station)
Filip Kujawa375aaac2023-02-28 21:43:47 -0800133 </label>
134 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700135 <input #engaged type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700136 Engaged (level &amp; station lights on)
Filip Kujawa375aaac2023-02-28 21:43:47 -0800137 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700138 <label>
139 <input #attempted type="checkbox" />
140 Attempted to dock and engage but failed
141 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800142 <br />
143 <button
144 class="btn btn-info"
Philipp Schradercae289f2023-04-14 22:28:49 -0700145 (click)="addAction({type: 'autoBalanceAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800146 >
147 Submit Balancing
148 </button>
149 </div>
150 <button
151 *ngIf="autoPhase"
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700152 class="btn btn-dark"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800153 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
154 >
155 Start Teleop
156 </button>
157 <button
158 *ngIf="!autoPhase"
159 class="btn btn-info"
160 (click)="changeSectionTo('Endgame')"
161 >
162 Endgame
163 </button>
164 </div>
165 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800166 <div *ngSwitchCase="'Place'" id="Place" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800167 <h6 class="text-muted">
168 Last Action: {{actionList[actionList.length - 1].type}}
169 </h6>
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700170 <!--
171 Decrease distance between buttons during auto to make space for auto balancing
172 selection and keep all buttons visible without scrolling on most devices.
173 -->
174 <div
175 [ngClass]="{'d-grid': true, 'gap-3': autoPhase === true, 'gap-5': autoPhase === false}"
176 >
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800177 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
178 <button
179 class="btn btn-danger"
180 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
181 >
182 DEAD
183 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800184 <button
185 class="btn btn-success"
186 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kHigh});"
187 >
188 HIGH
189 </button>
190 <button
191 class="btn btn-warning"
192 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kMiddle});"
193 >
194 MID
195 </button>
196 <button
197 class="btn btn-danger"
198 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kLow});"
199 >
200 LOW
201 </button>
Filip Kujawa0b4b1e52023-04-15 14:05:40 -0700202 <button
203 *ngIf="autoPhase"
204 class="btn btn-light"
205 (click)="addAction({type: 'mobilityAction', mobility: true});"
206 >
207 Mobility
208 </button>
Filip Kujawa7a045e72023-04-13 08:41:09 -0700209 <!-- Impossible to place supercharged pieces in auto. -->
210 <div *ngIf="autoPhase == false" class="d-grid gap-2">
211 <button
212 class="btn btn-dark"
213 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kSupercharged});"
214 >
215 SUPERCHARGED
216 </button>
217 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800218 <!-- 'Balancing' during auto. -->
Filip Kujawa0b4b1e52023-04-15 14:05:40 -0700219 <div *ngIf="autoPhase" class="d-grid gap-1">
Filip Kujawa375aaac2023-02-28 21:43:47 -0800220 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700221 <input #docked type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700222 Docked (on the charging station)
Filip Kujawa375aaac2023-02-28 21:43:47 -0800223 </label>
224 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700225 <input #engaged type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700226 Engaged (level &amp; station lights on)
Filip Kujawa375aaac2023-02-28 21:43:47 -0800227 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700228 <label>
229 <input #attempted type="checkbox" />
230 Attempted to dock and engage but failed
231 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800232 <br />
233 <button
234 class="btn btn-info"
Philipp Schradercae289f2023-04-14 22:28:49 -0700235 (click)="addAction({type: 'autoBalanceAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800236 >
237 Submit Balancing
238 </button>
239 </div>
240 <button
241 *ngIf="autoPhase"
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700242 class="btn btn-dark"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800243 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
244 >
245 Start Teleop
246 </button>
247 <button
248 *ngIf="!autoPhase"
249 class="btn btn-info"
250 (click)="changeSectionTo('Endgame')"
251 >
252 Endgame
253 </button>
254 </div>
255 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800256 <div *ngSwitchCase="'Endgame'" id="Endgame" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800257 <h6 class="text-muted">
258 Last Action: {{actionList[actionList.length - 1].type}}
259 </h6>
Filip Kujawa36f56082023-03-03 10:58:53 -0800260 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800261 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
262 <button
263 class="btn btn-danger"
264 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
265 >
266 DEAD
267 </button>
Filip Kujawa4413a592023-03-01 10:54:34 -0800268 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700269 <input #docked type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700270 Docked (on the charging station)
Filip Kujawa4413a592023-03-01 10:54:34 -0800271 </label>
272 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700273 <input #engaged type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700274 Engaged (level &amp; station lights on)
Filip Kujawa4413a592023-03-01 10:54:34 -0800275 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700276 <label>
277 <input #attempted type="checkbox" />
278 Attempted to dock and engage but failed
279 </label>
Filip Kujawa4413a592023-03-01 10:54:34 -0800280 <button
Filip Kujawa375aaac2023-02-28 21:43:47 -0800281 *ngIf="!autoPhase"
Filip Kujawa4413a592023-03-01 10:54:34 -0800282 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700283 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa4413a592023-03-01 10:54:34 -0800284 >
Filip Kujawa375aaac2023-02-28 21:43:47 -0800285 End Match
Filip Kujawa4413a592023-03-01 10:54:34 -0800286 </button>
287 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800288 </div>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800289 <div *ngSwitchCase="'Dead'" id="Dead" class="container-fluid">
290 <h2>Robot is dead</h2>
291 <div class="d-grid gap-2">
292 <button
293 class="btn btn-success"
294 (click)="changeSectionTo('Pickup'); addAction({type: 'robotDeathAction', robotOn: true}); "
295 >
296 Revive
297 </button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800298 <button
299 class="btn btn-info"
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700300 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked});"
Filip Kujawa32d13b62023-03-11 17:41:53 -0800301 >
302 End Match
303 </button>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800304 </div>
305 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800306 <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid">
Filip Kujawa36f56082023-03-03 10:58:53 -0800307 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800308 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800309 <button class="btn btn-warning" (click)="submitActions();">Submit</button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800310 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800311 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800312 <div *ngSwitchCase="'Success'" id="Success" class="container-fluid">
313 <h2>Successfully submitted data.</h2>
Philipp Schrader817cce32022-03-26 15:00:00 -0700314 </div>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700315
316 <span class="error_message" role="alert">{{ errorMessage }}</span>
Philipp Schrader80587432022-03-05 15:41:22 -0800317</ng-container>