blob: 13cbe7fc3fb937348a4dc3feea294ede310da18b [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 Schrader817cce32022-03-26 15:00:00 -070059 <div class="buttons">
60 <!-- hack to right align the next button -->
61 <div></div>
Philipp Schrader8702b782023-04-15 17:33:37 -070062 <button
63 class="btn btn-primary"
64 (click)="changeSectionTo('Init');"
65 [disabled]="!teamSelectionIsValid"
66 >
Filip Kujawa0ef334c2023-02-20 19:42:45 -080067 Next
68 </button>
Philipp Schrader817cce32022-03-26 15:00:00 -070069 </div>
70 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -080071 <div *ngSwitchCase="'Init'" id="init" class="container-fluid">
72 <h2>Select Starting Position</h2>
Filip Kujawa1d9add92023-03-03 13:14:40 -080073 <img
74 id="field_starting_positions_image"
75 src="/sha256/b71def525fb78486617a8b350c0ba6907e8ea25f78d4084a932cba8ae922528c/pictures/field/field.jpg"
76 alt="Starting Positions Image"
77 class="img-fluid"
78 />
Filip Kujawa0ef334c2023-02-20 19:42:45 -080079 <div *ngFor="let i of [1, 2, 3, 4]">
80 <label>
Philipp Schrader817cce32022-03-26 15:00:00 -070081 <input
82 type="radio"
Filip Kujawa0ef334c2023-02-20 19:42:45 -080083 name="radio-group"
84 [value]="i"
85 (change)="selectedValue = $event.target.value"
Philipp Schrader817cce32022-03-26 15:00:00 -070086 />
Filip Kujawa0ef334c2023-02-20 19:42:45 -080087 {{ i }}
Philipp Schrader817cce32022-03-26 15:00:00 -070088 </label>
Filip Kujawa0ef334c2023-02-20 19:42:45 -080089 </div>
Philipp Schrader817cce32022-03-26 15:00:00 -070090 <div class="buttons">
Filip Kujawa375aaac2023-02-28 21:43:47 -080091 <!-- Creates a responsive stack of full-width, "block buttons". -->
Filip Kujawa36f56082023-03-03 10:58:53 -080092 <div class="d-grid gap-5">
Filip Kujawa375aaac2023-02-28 21:43:47 -080093 <button
94 class="btn btn-primary"
95 [disabled]="!selectedValue"
96 (click)="changeSectionTo('Pickup'); addAction({type: 'startMatchAction', position: selectedValue});"
97 >
98 Start Match
99 </button>
100 </div>
Philipp Schrader817cce32022-03-26 15:00:00 -0700101 </div>
102 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800103 <div *ngSwitchCase="'Pickup'" id="PickUp" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800104 <h6 class="text-muted">
105 Last Action: {{actionList[actionList.length - 1].type}}
106 </h6>
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700107 <!--
108 Decrease distance between buttons during auto to make space for auto balancing
109 selection and keep all buttons visible without scrolling on most devices.
110 -->
111 <div
112 [ngClass]="{'d-grid': true, 'gap-3': autoPhase === true, 'gap-5': autoPhase === false}"
113 >
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800114 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
115 <button
116 class="btn btn-danger"
117 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
118 >
119 DEAD
120 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800121 <button
122 class="btn btn-warning"
123 (click)="changeSectionTo('Place'); addAction({type: 'pickupObjectAction', objectType: ObjectType.kCone});"
124 >
125 CONE
126 </button>
127 <button
128 class="btn btn-primary"
129 (click)="changeSectionTo('Place'); addAction({type: 'pickupObjectAction', objectType: ObjectType.kCube});"
130 >
131 CUBE
132 </button>
Filip Kujawa0b4b1e52023-04-15 14:05:40 -0700133 <button
134 *ngIf="autoPhase"
135 class="btn btn-light"
136 (click)="addAction({type: 'mobilityAction', mobility: true});"
137 >
138 Mobility
139 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800140 <!-- 'Balancing' during auto. -->
141 <div *ngIf="autoPhase" class="d-grid gap-2">
142 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700143 <input #docked type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700144 Docked (on the charging station)
Filip Kujawa375aaac2023-02-28 21:43:47 -0800145 </label>
146 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700147 <input #engaged type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700148 Engaged (level &amp; station lights on)
Filip Kujawa375aaac2023-02-28 21:43:47 -0800149 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700150 <label>
151 <input #attempted type="checkbox" />
152 Attempted to dock and engage but failed
153 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800154 <br />
155 <button
156 class="btn btn-info"
Philipp Schradercae289f2023-04-14 22:28:49 -0700157 (click)="addAction({type: 'autoBalanceAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800158 >
159 Submit Balancing
160 </button>
161 </div>
162 <button
163 *ngIf="autoPhase"
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700164 class="btn btn-dark"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800165 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
166 >
167 Start Teleop
168 </button>
169 <button
170 *ngIf="!autoPhase"
171 class="btn btn-info"
172 (click)="changeSectionTo('Endgame')"
173 >
174 Endgame
175 </button>
176 </div>
177 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800178 <div *ngSwitchCase="'Place'" id="Place" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800179 <h6 class="text-muted">
180 Last Action: {{actionList[actionList.length - 1].type}}
181 </h6>
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700182 <!--
183 Decrease distance between buttons during auto to make space for auto balancing
184 selection and keep all buttons visible without scrolling on most devices.
185 -->
186 <div
187 [ngClass]="{'d-grid': true, 'gap-3': autoPhase === true, 'gap-5': autoPhase === false}"
188 >
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800189 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
190 <button
191 class="btn btn-danger"
192 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
193 >
194 DEAD
195 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800196 <button
197 class="btn btn-success"
198 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kHigh});"
199 >
200 HIGH
201 </button>
202 <button
203 class="btn btn-warning"
204 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kMiddle});"
205 >
206 MID
207 </button>
208 <button
209 class="btn btn-danger"
210 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kLow});"
211 >
212 LOW
213 </button>
Filip Kujawa0b4b1e52023-04-15 14:05:40 -0700214 <button
215 *ngIf="autoPhase"
216 class="btn btn-light"
217 (click)="addAction({type: 'mobilityAction', mobility: true});"
218 >
219 Mobility
220 </button>
Filip Kujawa7a045e72023-04-13 08:41:09 -0700221 <!-- Impossible to place supercharged pieces in auto. -->
222 <div *ngIf="autoPhase == false" class="d-grid gap-2">
223 <button
224 class="btn btn-dark"
225 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kSupercharged});"
226 >
227 SUPERCHARGED
228 </button>
229 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800230 <!-- 'Balancing' during auto. -->
Filip Kujawa0b4b1e52023-04-15 14:05:40 -0700231 <div *ngIf="autoPhase" class="d-grid gap-1">
Filip Kujawa375aaac2023-02-28 21:43:47 -0800232 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700233 <input #docked type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700234 Docked (on the charging station)
Filip Kujawa375aaac2023-02-28 21:43:47 -0800235 </label>
236 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700237 <input #engaged type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700238 Engaged (level &amp; station lights on)
Filip Kujawa375aaac2023-02-28 21:43:47 -0800239 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700240 <label>
241 <input #attempted type="checkbox" />
242 Attempted to dock and engage but failed
243 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800244 <br />
245 <button
246 class="btn btn-info"
Philipp Schradercae289f2023-04-14 22:28:49 -0700247 (click)="addAction({type: 'autoBalanceAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800248 >
249 Submit Balancing
250 </button>
251 </div>
252 <button
253 *ngIf="autoPhase"
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700254 class="btn btn-dark"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800255 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
256 >
257 Start Teleop
258 </button>
259 <button
260 *ngIf="!autoPhase"
261 class="btn btn-info"
262 (click)="changeSectionTo('Endgame')"
263 >
264 Endgame
265 </button>
266 </div>
267 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800268 <div *ngSwitchCase="'Endgame'" id="Endgame" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800269 <h6 class="text-muted">
270 Last Action: {{actionList[actionList.length - 1].type}}
271 </h6>
Filip Kujawa36f56082023-03-03 10:58:53 -0800272 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800273 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
274 <button
275 class="btn btn-danger"
276 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
277 >
278 DEAD
279 </button>
Filip Kujawa4413a592023-03-01 10:54:34 -0800280 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700281 <input #docked type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700282 Docked (on the charging station)
Filip Kujawa4413a592023-03-01 10:54:34 -0800283 </label>
284 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700285 <input #engaged type="checkbox" />
Philipp Schrader87fe98a2023-04-15 17:26:34 -0700286 Engaged (level &amp; station lights on)
Filip Kujawa4413a592023-03-01 10:54:34 -0800287 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700288 <label>
289 <input #attempted type="checkbox" />
290 Attempted to dock and engage but failed
291 </label>
Filip Kujawa4413a592023-03-01 10:54:34 -0800292 <button
Filip Kujawa375aaac2023-02-28 21:43:47 -0800293 *ngIf="!autoPhase"
Filip Kujawa4413a592023-03-01 10:54:34 -0800294 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700295 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa4413a592023-03-01 10:54:34 -0800296 >
Filip Kujawa375aaac2023-02-28 21:43:47 -0800297 End Match
Filip Kujawa4413a592023-03-01 10:54:34 -0800298 </button>
299 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800300 </div>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800301 <div *ngSwitchCase="'Dead'" id="Dead" class="container-fluid">
302 <h2>Robot is dead</h2>
303 <div class="d-grid gap-2">
304 <button
305 class="btn btn-success"
306 (click)="changeSectionTo('Pickup'); addAction({type: 'robotDeathAction', robotOn: true}); "
307 >
308 Revive
309 </button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800310 <button
311 class="btn btn-info"
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700312 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked});"
Filip Kujawa32d13b62023-03-11 17:41:53 -0800313 >
314 End Match
315 </button>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800316 </div>
317 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800318 <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid">
Filip Kujawa36f56082023-03-03 10:58:53 -0800319 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800320 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800321 <button class="btn btn-warning" (click)="submitActions();">Submit</button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800322 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800323 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800324 <div *ngSwitchCase="'Success'" id="Success" class="container-fluid">
325 <h2>Successfully submitted data.</h2>
Philipp Schrader817cce32022-03-26 15:00:00 -0700326 </div>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700327
Philipp Schrader8702b782023-04-15 17:33:37 -0700328 <span class="progress_message" role="alert">{{ progressMessage }}</span>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700329 <span class="error_message" role="alert">{{ errorMessage }}</span>
Philipp Schrader80587432022-03-05 15:41:22 -0800330</ng-container>