blob: 56056fc418690cba91477bca953ecaa2dcc27ce9 [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>
121 <!-- 'Balancing' during auto. -->
122 <div *ngIf="autoPhase" class="d-grid gap-2">
123 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700124 <input #docked type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800125 Docked
126 </label>
127 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700128 <input #engaged type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800129 Engaged
130 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700131 <label>
132 <input #attempted type="checkbox" />
133 Attempted to dock and engage but failed
134 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800135 <br />
136 <button
137 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700138 (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800139 >
140 Submit Balancing
141 </button>
142 </div>
143 <button
144 *ngIf="autoPhase"
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700145 class="btn btn-dark"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800146 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
147 >
148 Start Teleop
149 </button>
150 <button
151 *ngIf="!autoPhase"
152 class="btn btn-info"
153 (click)="changeSectionTo('Endgame')"
154 >
155 Endgame
156 </button>
157 </div>
158 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800159 <div *ngSwitchCase="'Place'" id="Place" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800160 <h6 class="text-muted">
161 Last Action: {{actionList[actionList.length - 1].type}}
162 </h6>
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700163 <!--
164 Decrease distance between buttons during auto to make space for auto balancing
165 selection and keep all buttons visible without scrolling on most devices.
166 -->
167 <div
168 [ngClass]="{'d-grid': true, 'gap-3': autoPhase === true, 'gap-5': autoPhase === false}"
169 >
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800170 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
171 <button
172 class="btn btn-danger"
173 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
174 >
175 DEAD
176 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800177 <button
178 class="btn btn-success"
179 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kHigh});"
180 >
181 HIGH
182 </button>
183 <button
184 class="btn btn-warning"
185 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kMiddle});"
186 >
187 MID
188 </button>
189 <button
190 class="btn btn-danger"
191 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kLow});"
192 >
193 LOW
194 </button>
Filip Kujawa7a045e72023-04-13 08:41:09 -0700195 <!-- Impossible to place supercharged pieces in auto. -->
196 <div *ngIf="autoPhase == false" class="d-grid gap-2">
197 <button
198 class="btn btn-dark"
199 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kSupercharged});"
200 >
201 SUPERCHARGED
202 </button>
203 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800204 <!-- 'Balancing' during auto. -->
205 <div *ngIf="autoPhase" class="d-grid gap-2">
206 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700207 <input #docked type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800208 Docked
209 </label>
210 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700211 <input #engaged type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800212 Engaged
213 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700214 <label>
215 <input #attempted type="checkbox" />
216 Attempted to dock and engage but failed
217 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800218 <br />
219 <button
220 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700221 (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800222 >
223 Submit Balancing
224 </button>
225 </div>
226 <button
227 *ngIf="autoPhase"
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700228 class="btn btn-dark"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800229 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
230 >
231 Start Teleop
232 </button>
233 <button
234 *ngIf="!autoPhase"
235 class="btn btn-info"
236 (click)="changeSectionTo('Endgame')"
237 >
238 Endgame
239 </button>
240 </div>
241 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800242 <div *ngSwitchCase="'Endgame'" id="Endgame" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800243 <h6 class="text-muted">
244 Last Action: {{actionList[actionList.length - 1].type}}
245 </h6>
Filip Kujawa36f56082023-03-03 10:58:53 -0800246 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800247 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
248 <button
249 class="btn btn-danger"
250 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
251 >
252 DEAD
253 </button>
Filip Kujawa4413a592023-03-01 10:54:34 -0800254 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700255 <input #docked type="checkbox" />
Filip Kujawa4413a592023-03-01 10:54:34 -0800256 Docked
257 </label>
258 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700259 <input #engaged type="checkbox" />
Filip Kujawa4413a592023-03-01 10:54:34 -0800260 Engaged
261 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700262 <label>
263 <input #attempted type="checkbox" />
264 Attempted to dock and engage but failed
265 </label>
Filip Kujawa4413a592023-03-01 10:54:34 -0800266 <button
Filip Kujawa375aaac2023-02-28 21:43:47 -0800267 *ngIf="!autoPhase"
Filip Kujawa4413a592023-03-01 10:54:34 -0800268 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700269 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa4413a592023-03-01 10:54:34 -0800270 >
Filip Kujawa375aaac2023-02-28 21:43:47 -0800271 End Match
Filip Kujawa4413a592023-03-01 10:54:34 -0800272 </button>
273 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800274 </div>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800275 <div *ngSwitchCase="'Dead'" id="Dead" class="container-fluid">
276 <h2>Robot is dead</h2>
277 <div class="d-grid gap-2">
278 <button
279 class="btn btn-success"
280 (click)="changeSectionTo('Pickup'); addAction({type: 'robotDeathAction', robotOn: true}); "
281 >
282 Revive
283 </button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800284 <button
285 class="btn btn-info"
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700286 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked});"
Filip Kujawa32d13b62023-03-11 17:41:53 -0800287 >
288 End Match
289 </button>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800290 </div>
291 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800292 <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid">
Filip Kujawa36f56082023-03-03 10:58:53 -0800293 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800294 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800295 <button class="btn btn-warning" (click)="submitActions();">Submit</button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800296 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800297 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800298 <div *ngSwitchCase="'Success'" id="Success" class="container-fluid">
299 <h2>Successfully submitted data.</h2>
Philipp Schrader817cce32022-03-26 15:00:00 -0700300 </div>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700301
302 <span class="error_message" role="alert">{{ errorMessage }}</span>
Philipp Schrader80587432022-03-05 15:41:22 -0800303</ng-container>