blob: e189ab06dd4d4d4c6b24089c205e597418967374 [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"
Philipp Schrader8702b782023-04-15 17:33:37 -070017 (ngModelChange)="updateTeamSelectionValidity()"
Philipp Schrader817cce32022-03-26 15:00:00 -070018 type="number"
19 id="match_number"
20 min="1"
21 max="999"
22 />
23 </div>
24 <div class="row">
25 <label for="team_number">Team Number</label>
26 <input
27 [(ngModel)]="teamNumber"
Philipp Schrader8702b782023-04-15 17:33:37 -070028 (ngModelChange)="updateTeamSelectionValidity()"
Philipp Schrader817cce32022-03-26 15:00:00 -070029 type="number"
30 id="team_number"
31 min="1"
32 max="9999"
33 />
34 </div>
Philipp Schrader8aeb14f2022-04-08 21:23:18 -070035 <div class="row">
Philipp Schrader30b4a682022-04-16 14:36:17 -070036 <label for="set_number">Set Number</label>
37 <input
38 [(ngModel)]="setNumber"
Philipp Schrader8702b782023-04-15 17:33:37 -070039 (ngModelChange)="updateTeamSelectionValidity()"
Philipp Schrader30b4a682022-04-16 14:36:17 -070040 type="number"
41 id="set_number"
42 min="1"
43 max="10"
44 />
Philipp Schrader8aeb14f2022-04-08 21:23:18 -070045 </div>
46 <div class="row">
Philipp Schrader30b4a682022-04-16 14:36:17 -070047 <label for="comp_level">Comp Level</label>
Philipp Schrader8702b782023-04-15 17:33:37 -070048 <select
49 [(ngModel)]="compLevel"
50 (ngModelChange)="updateTeamSelectionValidity()"
51 type="number"
52 id="comp_level"
53 >
Philipp Schrader8aeb14f2022-04-08 21:23:18 -070054 <option *ngFor="let level of COMP_LEVELS" [ngValue]="level">
55 {{COMP_LEVEL_LABELS[level]}}
56 </option>
57 </select>
58 </div>
Philipp Schradere1498852023-04-15 18:06:45 -070059 <div class="row">
60 <label>
61 <input
62 id="pre_scouting"
63 type="checkbox"
64 [(ngModel)]="preScouting"
65 (ngModelChange)="updateTeamSelectionValidity()"
66 />
67 Pre-scouting
68 </label>
69 </div>
Philipp Schrader817cce32022-03-26 15:00:00 -070070 <div class="buttons">
71 <!-- hack to right align the next button -->
72 <div></div>
Philipp Schrader8702b782023-04-15 17:33:37 -070073 <button
74 class="btn btn-primary"
75 (click)="changeSectionTo('Init');"
76 [disabled]="!teamSelectionIsValid"
77 >
Filip Kujawa0ef334c2023-02-20 19:42:45 -080078 Next
79 </button>
Philipp Schrader817cce32022-03-26 15:00:00 -070080 </div>
81 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -080082 <div *ngSwitchCase="'Init'" id="init" class="container-fluid">
83 <h2>Select Starting Position</h2>
Filip Kujawa1d9add92023-03-03 13:14:40 -080084 <img
85 id="field_starting_positions_image"
86 src="/sha256/b71def525fb78486617a8b350c0ba6907e8ea25f78d4084a932cba8ae922528c/pictures/field/field.jpg"
87 alt="Starting Positions Image"
88 class="img-fluid"
89 />
Filip Kujawa0ef334c2023-02-20 19:42:45 -080090 <div *ngFor="let i of [1, 2, 3, 4]">
91 <label>
Philipp Schrader817cce32022-03-26 15:00:00 -070092 <input
93 type="radio"
Filip Kujawa0ef334c2023-02-20 19:42:45 -080094 name="radio-group"
95 [value]="i"
96 (change)="selectedValue = $event.target.value"
Philipp Schrader817cce32022-03-26 15:00:00 -070097 />
Filip Kujawa0ef334c2023-02-20 19:42:45 -080098 {{ i }}
Philipp Schrader817cce32022-03-26 15:00:00 -070099 </label>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800100 </div>
Philipp Schrader817cce32022-03-26 15:00:00 -0700101 <div class="buttons">
Filip Kujawa375aaac2023-02-28 21:43:47 -0800102 <!-- Creates a responsive stack of full-width, "block buttons". -->
Filip Kujawa36f56082023-03-03 10:58:53 -0800103 <div class="d-grid gap-5">
Filip Kujawa375aaac2023-02-28 21:43:47 -0800104 <button
105 class="btn btn-primary"
106 [disabled]="!selectedValue"
107 (click)="changeSectionTo('Pickup'); addAction({type: 'startMatchAction', position: selectedValue});"
108 >
109 Start Match
110 </button>
111 </div>
Philipp Schrader817cce32022-03-26 15:00:00 -0700112 </div>
113 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800114 <div *ngSwitchCase="'Pickup'" id="PickUp" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800115 <h6 class="text-muted">
116 Last Action: {{actionList[actionList.length - 1].type}}
117 </h6>
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700118 <!--
119 Decrease distance between buttons during auto to make space for auto balancing
120 selection and keep all buttons visible without scrolling on most devices.
121 -->
122 <div
123 [ngClass]="{'d-grid': true, 'gap-3': autoPhase === true, 'gap-5': autoPhase === false}"
124 >
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800125 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
126 <button
127 class="btn btn-danger"
128 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
129 >
130 DEAD
131 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800132 <button
133 class="btn btn-warning"
134 (click)="changeSectionTo('Place'); addAction({type: 'pickupObjectAction', objectType: ObjectType.kCone});"
135 >
136 CONE
137 </button>
138 <button
139 class="btn btn-primary"
140 (click)="changeSectionTo('Place'); addAction({type: 'pickupObjectAction', objectType: ObjectType.kCube});"
141 >
142 CUBE
143 </button>
Filip Kujawa0b4b1e52023-04-15 14:05:40 -0700144 <button
145 *ngIf="autoPhase"
146 class="btn btn-light"
147 (click)="addAction({type: 'mobilityAction', mobility: true});"
148 >
149 Mobility
150 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800151 <!-- 'Balancing' during auto. -->
152 <div *ngIf="autoPhase" class="d-grid gap-2">
153 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700154 <input #docked type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700155 Docked (on the charging station)
Filip Kujawa375aaac2023-02-28 21:43:47 -0800156 </label>
157 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700158 <input #engaged type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700159 Engaged (level &amp; station lights on)
Filip Kujawa375aaac2023-02-28 21:43:47 -0800160 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700161 <label>
162 <input #attempted type="checkbox" />
163 Attempted to dock and engage but failed
164 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800165 <br />
166 <button
167 class="btn btn-info"
Philipp Schradercae289f2023-04-14 22:28:49 -0700168 (click)="addAction({type: 'autoBalanceAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800169 >
170 Submit Balancing
171 </button>
172 </div>
173 <button
174 *ngIf="autoPhase"
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700175 class="btn btn-dark"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800176 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
177 >
178 Start Teleop
179 </button>
180 <button
181 *ngIf="!autoPhase"
182 class="btn btn-info"
183 (click)="changeSectionTo('Endgame')"
184 >
185 Endgame
186 </button>
187 </div>
188 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800189 <div *ngSwitchCase="'Place'" id="Place" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800190 <h6 class="text-muted">
191 Last Action: {{actionList[actionList.length - 1].type}}
192 </h6>
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700193 <!--
194 Decrease distance between buttons during auto to make space for auto balancing
195 selection and keep all buttons visible without scrolling on most devices.
196 -->
197 <div
198 [ngClass]="{'d-grid': true, 'gap-3': autoPhase === true, 'gap-5': autoPhase === false}"
199 >
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800200 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
201 <button
202 class="btn btn-danger"
203 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
204 >
205 DEAD
206 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800207 <button
208 class="btn btn-success"
209 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kHigh});"
210 >
211 HIGH
212 </button>
213 <button
214 class="btn btn-warning"
215 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kMiddle});"
216 >
217 MID
218 </button>
219 <button
220 class="btn btn-danger"
221 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kLow});"
222 >
223 LOW
224 </button>
Filip Kujawa0b4b1e52023-04-15 14:05:40 -0700225 <button
226 *ngIf="autoPhase"
227 class="btn btn-light"
228 (click)="addAction({type: 'mobilityAction', mobility: true});"
229 >
230 Mobility
231 </button>
Filip Kujawa7a045e72023-04-13 08:41:09 -0700232 <!-- Impossible to place supercharged pieces in auto. -->
233 <div *ngIf="autoPhase == false" class="d-grid gap-2">
234 <button
235 class="btn btn-dark"
236 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kSupercharged});"
237 >
238 SUPERCHARGED
239 </button>
240 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800241 <!-- 'Balancing' during auto. -->
Filip Kujawa0b4b1e52023-04-15 14:05:40 -0700242 <div *ngIf="autoPhase" class="d-grid gap-1">
Filip Kujawa375aaac2023-02-28 21:43:47 -0800243 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700244 <input #docked type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700245 Docked (on the charging station)
Filip Kujawa375aaac2023-02-28 21:43:47 -0800246 </label>
247 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700248 <input #engaged type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700249 Engaged (level &amp; station lights on)
Filip Kujawa375aaac2023-02-28 21:43:47 -0800250 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700251 <label>
252 <input #attempted type="checkbox" />
253 Attempted to dock and engage but failed
254 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800255 <br />
256 <button
257 class="btn btn-info"
Philipp Schradercae289f2023-04-14 22:28:49 -0700258 (click)="addAction({type: 'autoBalanceAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800259 >
260 Submit Balancing
261 </button>
262 </div>
263 <button
264 *ngIf="autoPhase"
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700265 class="btn btn-dark"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800266 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
267 >
268 Start Teleop
269 </button>
270 <button
271 *ngIf="!autoPhase"
272 class="btn btn-info"
273 (click)="changeSectionTo('Endgame')"
274 >
275 Endgame
276 </button>
277 </div>
278 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800279 <div *ngSwitchCase="'Endgame'" id="Endgame" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800280 <h6 class="text-muted">
281 Last Action: {{actionList[actionList.length - 1].type}}
282 </h6>
Filip Kujawa36f56082023-03-03 10:58:53 -0800283 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800284 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
285 <button
286 class="btn btn-danger"
287 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
288 >
289 DEAD
290 </button>
Filip Kujawa4413a592023-03-01 10:54:34 -0800291 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700292 <input #docked type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700293 Docked (on the charging station)
Filip Kujawa4413a592023-03-01 10:54:34 -0800294 </label>
295 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700296 <input #engaged type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700297 Engaged (level &amp; station lights on)
Filip Kujawa4413a592023-03-01 10:54:34 -0800298 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700299 <label>
300 <input #attempted type="checkbox" />
301 Attempted to dock and engage but failed
302 </label>
Filip Kujawa4413a592023-03-01 10:54:34 -0800303 <button
Filip Kujawa375aaac2023-02-28 21:43:47 -0800304 *ngIf="!autoPhase"
Filip Kujawa4413a592023-03-01 10:54:34 -0800305 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700306 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa4413a592023-03-01 10:54:34 -0800307 >
Filip Kujawa375aaac2023-02-28 21:43:47 -0800308 End Match
Filip Kujawa4413a592023-03-01 10:54:34 -0800309 </button>
310 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800311 </div>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800312 <div *ngSwitchCase="'Dead'" id="Dead" class="container-fluid">
313 <h2>Robot is dead</h2>
314 <div class="d-grid gap-2">
315 <button
316 class="btn btn-success"
317 (click)="changeSectionTo('Pickup'); addAction({type: 'robotDeathAction', robotOn: true}); "
318 >
319 Revive
320 </button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800321 <button
322 class="btn btn-info"
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700323 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked});"
Filip Kujawa32d13b62023-03-11 17:41:53 -0800324 >
325 End Match
326 </button>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800327 </div>
328 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800329 <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid">
Filip Kujawa36f56082023-03-03 10:58:53 -0800330 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800331 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800332 <button class="btn btn-warning" (click)="submitActions();">Submit</button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800333 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800334 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800335 <div *ngSwitchCase="'Success'" id="Success" class="container-fluid">
336 <h2>Successfully submitted data.</h2>
Philipp Schrader817cce32022-03-26 15:00:00 -0700337 </div>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700338
Philipp Schrader8702b782023-04-15 17:33:37 -0700339 <span class="progress_message" role="alert">{{ progressMessage }}</span>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700340 <span class="error_message" role="alert">{{ errorMessage }}</span>
Philipp Schrader80587432022-03-05 15:41:22 -0800341</ng-container>