blob: 24592214a8b517af198e933a201e50411e7baaf3 [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
Filip Kujawab73e94c2023-04-19 09:33:14 -0700145 *ngIf="autoPhase && !mobilityCompleted"
Filip Kujawa0b4b1e52023-04-15 14:05:40 -0700146 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 </div>
166 <button
167 *ngIf="autoPhase"
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700168 class="btn btn-dark"
Filip Kujawae4402712023-04-19 09:45:10 -0700169 (click)="autoPhase = false; addAction({type: 'endAutoPhase'}); addAction({type: 'autoBalanceAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800170 >
171 Start Teleop
172 </button>
173 <button
174 *ngIf="!autoPhase"
175 class="btn btn-info"
176 (click)="changeSectionTo('Endgame')"
177 >
178 Endgame
179 </button>
180 </div>
181 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800182 <div *ngSwitchCase="'Place'" id="Place" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800183 <h6 class="text-muted">
184 Last Action: {{actionList[actionList.length - 1].type}}
185 </h6>
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700186 <!--
187 Decrease distance between buttons during auto to make space for auto balancing
188 selection and keep all buttons visible without scrolling on most devices.
189 -->
190 <div
191 [ngClass]="{'d-grid': true, 'gap-3': autoPhase === true, 'gap-5': autoPhase === false}"
192 >
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800193 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
194 <button
195 class="btn btn-danger"
196 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
197 >
198 DEAD
199 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800200 <button
201 class="btn btn-success"
202 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kHigh});"
203 >
204 HIGH
205 </button>
206 <button
207 class="btn btn-warning"
208 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kMiddle});"
209 >
210 MID
211 </button>
212 <button
213 class="btn btn-danger"
214 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kLow});"
215 >
216 LOW
217 </button>
Filip Kujawa0b4b1e52023-04-15 14:05:40 -0700218 <button
Filip Kujawab73e94c2023-04-19 09:33:14 -0700219 *ngIf="autoPhase && !mobilityCompleted"
Filip Kujawa0b4b1e52023-04-15 14:05:40 -0700220 class="btn btn-light"
221 (click)="addAction({type: 'mobilityAction', mobility: true});"
222 >
223 Mobility
224 </button>
Filip Kujawa7a045e72023-04-13 08:41:09 -0700225 <!-- Impossible to place supercharged pieces in auto. -->
226 <div *ngIf="autoPhase == false" class="d-grid gap-2">
227 <button
228 class="btn btn-dark"
229 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kSupercharged});"
230 >
231 SUPERCHARGED
232 </button>
233 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800234 <!-- 'Balancing' during auto. -->
Filip Kujawa0b4b1e52023-04-15 14:05:40 -0700235 <div *ngIf="autoPhase" class="d-grid gap-1">
Filip Kujawa375aaac2023-02-28 21:43:47 -0800236 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700237 <input #docked type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700238 Docked (on the charging station)
Filip Kujawa375aaac2023-02-28 21:43:47 -0800239 </label>
240 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700241 <input #engaged type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700242 Engaged (level &amp; station lights on)
Filip Kujawa375aaac2023-02-28 21:43:47 -0800243 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700244 <label>
245 <input #attempted type="checkbox" />
246 Attempted to dock and engage but failed
247 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800248 </div>
249 <button
250 *ngIf="autoPhase"
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700251 class="btn btn-dark"
Filip Kujawae4402712023-04-19 09:45:10 -0700252 (click)="autoPhase = false; addAction({type: 'endAutoPhase'}); addAction({type: 'autoBalanceAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800253 >
254 Start Teleop
255 </button>
256 <button
257 *ngIf="!autoPhase"
258 class="btn btn-info"
259 (click)="changeSectionTo('Endgame')"
260 >
261 Endgame
262 </button>
263 </div>
264 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800265 <div *ngSwitchCase="'Endgame'" id="Endgame" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800266 <h6 class="text-muted">
267 Last Action: {{actionList[actionList.length - 1].type}}
268 </h6>
Filip Kujawa36f56082023-03-03 10:58:53 -0800269 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800270 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
271 <button
272 class="btn btn-danger"
273 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
274 >
275 DEAD
276 </button>
Filip Kujawa4413a592023-03-01 10:54:34 -0800277 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700278 <input #docked type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700279 Docked (on the charging station)
Filip Kujawa4413a592023-03-01 10:54:34 -0800280 </label>
281 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700282 <input #engaged type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700283 Engaged (level &amp; station lights on)
Filip Kujawa4413a592023-03-01 10:54:34 -0800284 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700285 <label>
286 <input #attempted type="checkbox" />
287 Attempted to dock and engage but failed
288 </label>
Filip Kujawa4413a592023-03-01 10:54:34 -0800289 <button
Filip Kujawa375aaac2023-02-28 21:43:47 -0800290 *ngIf="!autoPhase"
Filip Kujawa4413a592023-03-01 10:54:34 -0800291 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700292 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa4413a592023-03-01 10:54:34 -0800293 >
Filip Kujawa375aaac2023-02-28 21:43:47 -0800294 End Match
Filip Kujawa4413a592023-03-01 10:54:34 -0800295 </button>
296 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800297 </div>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800298 <div *ngSwitchCase="'Dead'" id="Dead" class="container-fluid">
299 <h2>Robot is dead</h2>
300 <div class="d-grid gap-2">
301 <button
302 class="btn btn-success"
303 (click)="changeSectionTo('Pickup'); addAction({type: 'robotDeathAction', robotOn: true}); "
304 >
305 Revive
306 </button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800307 <button
308 class="btn btn-info"
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700309 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked});"
Filip Kujawa32d13b62023-03-11 17:41:53 -0800310 >
311 End Match
312 </button>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800313 </div>
314 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800315 <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid">
Filip Kujawa36f56082023-03-03 10:58:53 -0800316 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800317 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800318 <button class="btn btn-warning" (click)="submitActions();">Submit</button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800319 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800320 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800321 <div *ngSwitchCase="'Success'" id="Success" class="container-fluid">
322 <h2>Successfully submitted data.</h2>
Philipp Schrader817cce32022-03-26 15:00:00 -0700323 </div>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700324
Philipp Schrader8702b782023-04-15 17:33:37 -0700325 <span class="progress_message" role="alert">{{ progressMessage }}</span>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700326 <span class="error_message" role="alert">{{ errorMessage }}</span>
Philipp Schrader80587432022-03-05 15:41:22 -0800327</ng-container>