blob: 28a93aacc0fa29b1d2e79ea0cff5e3766cadbade [file] [log] [blame]
Philipp Schrader6b2e9502022-03-15 23:42:56 -07001<div class="header" #header>
Philipp Schrader817cce32022-03-26 15:00:00 -07002 <h2>{{section}}</h2>
Philipp Schrader80587432022-03-05 15:41:22 -08003</div>
Philipp Schrader80587432022-03-05 15:41:22 -08004<ng-container [ngSwitch]="section">
Philipp Schrader817cce32022-03-26 15:00:00 -07005 <div
6 *ngSwitchCase="'Team Selection'"
7 id="team_selection"
8 class="container-fluid"
9 >
10 <div class="row">
11 <label for="match_number">Match Number</label>
12 <input
13 [(ngModel)]="matchNumber"
14 type="number"
15 id="match_number"
16 min="1"
17 max="999"
18 />
19 </div>
20 <div class="row">
21 <label for="team_number">Team Number</label>
22 <input
23 [(ngModel)]="teamNumber"
24 type="number"
25 id="team_number"
26 min="1"
27 max="9999"
28 />
29 </div>
Philipp Schrader8aeb14f2022-04-08 21:23:18 -070030 <div class="row">
Philipp Schrader30b4a682022-04-16 14:36:17 -070031 <label for="set_number">Set Number</label>
32 <input
33 [(ngModel)]="setNumber"
34 type="number"
35 id="set_number"
36 min="1"
37 max="10"
38 />
Philipp Schrader8aeb14f2022-04-08 21:23:18 -070039 </div>
40 <div class="row">
Philipp Schrader30b4a682022-04-16 14:36:17 -070041 <label for="comp_level">Comp Level</label>
Philipp Schrader8aeb14f2022-04-08 21:23:18 -070042 <select [(ngModel)]="compLevel" type="number" id="comp_level">
43 <option *ngFor="let level of COMP_LEVELS" [ngValue]="level">
44 {{COMP_LEVEL_LABELS[level]}}
45 </option>
46 </select>
47 </div>
Philipp Schrader817cce32022-03-26 15:00:00 -070048 <div class="buttons">
49 <!-- hack to right align the next button -->
50 <div></div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -080051 <button class="btn btn-primary" (click)="changeSectionTo('Init');">
52 Next
53 </button>
Philipp Schrader817cce32022-03-26 15:00:00 -070054 </div>
55 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -080056 <div *ngSwitchCase="'Init'" id="init" class="container-fluid">
57 <h2>Select Starting Position</h2>
Filip Kujawa1d9add92023-03-03 13:14:40 -080058 <img
59 id="field_starting_positions_image"
60 src="/sha256/b71def525fb78486617a8b350c0ba6907e8ea25f78d4084a932cba8ae922528c/pictures/field/field.jpg"
61 alt="Starting Positions Image"
62 class="img-fluid"
63 />
Filip Kujawa0ef334c2023-02-20 19:42:45 -080064 <div *ngFor="let i of [1, 2, 3, 4]">
65 <label>
Philipp Schrader817cce32022-03-26 15:00:00 -070066 <input
67 type="radio"
Filip Kujawa0ef334c2023-02-20 19:42:45 -080068 name="radio-group"
69 [value]="i"
70 (change)="selectedValue = $event.target.value"
Philipp Schrader817cce32022-03-26 15:00:00 -070071 />
Filip Kujawa0ef334c2023-02-20 19:42:45 -080072 {{ i }}
Philipp Schrader817cce32022-03-26 15:00:00 -070073 </label>
Filip Kujawa0ef334c2023-02-20 19:42:45 -080074 </div>
Philipp Schrader817cce32022-03-26 15:00:00 -070075 <div class="buttons">
Filip Kujawa375aaac2023-02-28 21:43:47 -080076 <!-- Creates a responsive stack of full-width, "block buttons". -->
Filip Kujawa36f56082023-03-03 10:58:53 -080077 <div class="d-grid gap-5">
Filip Kujawa375aaac2023-02-28 21:43:47 -080078 <button
79 class="btn btn-primary"
80 [disabled]="!selectedValue"
81 (click)="changeSectionTo('Pickup'); addAction({type: 'startMatchAction', position: selectedValue});"
82 >
83 Start Match
84 </button>
85 </div>
Philipp Schrader817cce32022-03-26 15:00:00 -070086 </div>
87 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -080088 <div *ngSwitchCase="'Pickup'" id="PickUp" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -080089 <h6 class="text-muted">
90 Last Action: {{actionList[actionList.length - 1].type}}
91 </h6>
Filip Kujawaaa7d11f2023-04-13 09:12:32 -070092 <!--
93 Decrease distance between buttons during auto to make space for auto balancing
94 selection and keep all buttons visible without scrolling on most devices.
95 -->
96 <div
97 [ngClass]="{'d-grid': true, 'gap-3': autoPhase === true, 'gap-5': autoPhase === false}"
98 >
Filip Kujawa9f56d0e2023-03-03 19:44:43 -080099 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
100 <button
101 class="btn btn-danger"
102 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
103 >
104 DEAD
105 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800106 <button
107 class="btn btn-warning"
108 (click)="changeSectionTo('Place'); addAction({type: 'pickupObjectAction', objectType: ObjectType.kCone});"
109 >
110 CONE
111 </button>
112 <button
113 class="btn btn-primary"
114 (click)="changeSectionTo('Place'); addAction({type: 'pickupObjectAction', objectType: ObjectType.kCube});"
115 >
116 CUBE
117 </button>
118 <!-- 'Balancing' during auto. -->
119 <div *ngIf="autoPhase" class="d-grid gap-2">
120 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700121 <input #docked type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800122 Docked
123 </label>
124 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700125 <input #engaged type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800126 Engaged
127 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700128 <label>
129 <input #attempted type="checkbox" />
130 Attempted to dock and engage but failed
131 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800132 <br />
133 <button
134 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700135 (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800136 >
137 Submit Balancing
138 </button>
139 </div>
140 <button
141 *ngIf="autoPhase"
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700142 class="btn btn-dark"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800143 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
144 >
145 Start Teleop
146 </button>
147 <button
148 *ngIf="!autoPhase"
149 class="btn btn-info"
150 (click)="changeSectionTo('Endgame')"
151 >
152 Endgame
153 </button>
154 </div>
155 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800156 <div *ngSwitchCase="'Place'" id="Place" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800157 <h6 class="text-muted">
158 Last Action: {{actionList[actionList.length - 1].type}}
159 </h6>
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700160 <!--
161 Decrease distance between buttons during auto to make space for auto balancing
162 selection and keep all buttons visible without scrolling on most devices.
163 -->
164 <div
165 [ngClass]="{'d-grid': true, 'gap-3': autoPhase === true, 'gap-5': autoPhase === false}"
166 >
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800167 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
168 <button
169 class="btn btn-danger"
170 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
171 >
172 DEAD
173 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800174 <button
175 class="btn btn-success"
176 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kHigh});"
177 >
178 HIGH
179 </button>
180 <button
181 class="btn btn-warning"
182 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kMiddle});"
183 >
184 MID
185 </button>
186 <button
187 class="btn btn-danger"
188 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kLow});"
189 >
190 LOW
191 </button>
Filip Kujawa7a045e72023-04-13 08:41:09 -0700192 <!-- Impossible to place supercharged pieces in auto. -->
193 <div *ngIf="autoPhase == false" class="d-grid gap-2">
194 <button
195 class="btn btn-dark"
196 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kSupercharged});"
197 >
198 SUPERCHARGED
199 </button>
200 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800201 <!-- 'Balancing' during auto. -->
202 <div *ngIf="autoPhase" class="d-grid gap-2">
203 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700204 <input #docked type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800205 Docked
206 </label>
207 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700208 <input #engaged type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800209 Engaged
210 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700211 <label>
212 <input #attempted type="checkbox" />
213 Attempted to dock and engage but failed
214 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800215 <br />
216 <button
217 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700218 (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800219 >
220 Submit Balancing
221 </button>
222 </div>
223 <button
224 *ngIf="autoPhase"
Filip Kujawaaa7d11f2023-04-13 09:12:32 -0700225 class="btn btn-dark"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800226 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
227 >
228 Start Teleop
229 </button>
230 <button
231 *ngIf="!autoPhase"
232 class="btn btn-info"
233 (click)="changeSectionTo('Endgame')"
234 >
235 Endgame
236 </button>
237 </div>
238 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800239 <div *ngSwitchCase="'Endgame'" id="Endgame" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800240 <h6 class="text-muted">
241 Last Action: {{actionList[actionList.length - 1].type}}
242 </h6>
Filip Kujawa36f56082023-03-03 10:58:53 -0800243 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800244 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
245 <button
246 class="btn btn-danger"
247 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
248 >
249 DEAD
250 </button>
Filip Kujawa4413a592023-03-01 10:54:34 -0800251 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700252 <input #docked type="checkbox" />
Filip Kujawa4413a592023-03-01 10:54:34 -0800253 Docked
254 </label>
255 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700256 <input #engaged type="checkbox" />
Filip Kujawa4413a592023-03-01 10:54:34 -0800257 Engaged
258 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700259 <label>
260 <input #attempted type="checkbox" />
261 Attempted to dock and engage but failed
262 </label>
Filip Kujawa4413a592023-03-01 10:54:34 -0800263 <button
Filip Kujawa375aaac2023-02-28 21:43:47 -0800264 *ngIf="!autoPhase"
Filip Kujawa4413a592023-03-01 10:54:34 -0800265 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700266 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa4413a592023-03-01 10:54:34 -0800267 >
Filip Kujawa375aaac2023-02-28 21:43:47 -0800268 End Match
Filip Kujawa4413a592023-03-01 10:54:34 -0800269 </button>
270 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800271 </div>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800272 <div *ngSwitchCase="'Dead'" id="Dead" class="container-fluid">
273 <h2>Robot is dead</h2>
274 <div class="d-grid gap-2">
275 <button
276 class="btn btn-success"
277 (click)="changeSectionTo('Pickup'); addAction({type: 'robotDeathAction', robotOn: true}); "
278 >
279 Revive
280 </button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800281 <button
282 class="btn btn-info"
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700283 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked});"
Filip Kujawa32d13b62023-03-11 17:41:53 -0800284 >
285 End Match
286 </button>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800287 </div>
288 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800289 <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid">
Filip Kujawa36f56082023-03-03 10:58:53 -0800290 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800291 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800292 <button class="btn btn-warning" (click)="submitActions();">Submit</button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800293 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800294 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800295 <div *ngSwitchCase="'Success'" id="Success" class="container-fluid">
296 <h2>Successfully submitted data.</h2>
Philipp Schrader817cce32022-03-26 15:00:00 -0700297 </div>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700298
299 <span class="error_message" role="alert">{{ errorMessage }}</span>
Philipp Schrader80587432022-03-05 15:41:22 -0800300</ng-container>