blob: 95387ad92bdcd8dc6844da5f0d4f4484d98040c8 [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 Kujawa36f56082023-03-03 10:58:53 -080092 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -080093 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
94 <button
95 class="btn btn-danger"
96 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
97 >
98 DEAD
99 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800100 <button
101 class="btn btn-warning"
102 (click)="changeSectionTo('Place'); addAction({type: 'pickupObjectAction', objectType: ObjectType.kCone});"
103 >
104 CONE
105 </button>
106 <button
107 class="btn btn-primary"
108 (click)="changeSectionTo('Place'); addAction({type: 'pickupObjectAction', objectType: ObjectType.kCube});"
109 >
110 CUBE
111 </button>
112 <!-- 'Balancing' during auto. -->
113 <div *ngIf="autoPhase" class="d-grid gap-2">
114 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700115 <input #docked type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800116 Docked
117 </label>
118 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700119 <input #engaged type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800120 Engaged
121 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700122 <label>
123 <input #attempted type="checkbox" />
124 Attempted to dock and engage but failed
125 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800126 <br />
127 <button
128 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700129 (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800130 >
131 Submit Balancing
132 </button>
133 </div>
134 <button
135 *ngIf="autoPhase"
136 class="btn btn-info"
137 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
138 >
139 Start Teleop
140 </button>
141 <button
142 *ngIf="!autoPhase"
143 class="btn btn-info"
144 (click)="changeSectionTo('Endgame')"
145 >
146 Endgame
147 </button>
148 </div>
149 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800150 <div *ngSwitchCase="'Place'" id="Place" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800151 <h6 class="text-muted">
152 Last Action: {{actionList[actionList.length - 1].type}}
153 </h6>
Filip Kujawa36f56082023-03-03 10:58:53 -0800154 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800155 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
156 <button
157 class="btn btn-danger"
158 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
159 >
160 DEAD
161 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800162 <button
163 class="btn btn-success"
164 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kHigh});"
165 >
166 HIGH
167 </button>
168 <button
169 class="btn btn-warning"
170 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kMiddle});"
171 >
172 MID
173 </button>
174 <button
175 class="btn btn-danger"
176 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kLow});"
177 >
178 LOW
179 </button>
Filip Kujawa7a045e72023-04-13 08:41:09 -0700180 <!-- Impossible to place supercharged pieces in auto. -->
181 <div *ngIf="autoPhase == false" class="d-grid gap-2">
182 <button
183 class="btn btn-dark"
184 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kSupercharged});"
185 >
186 SUPERCHARGED
187 </button>
188 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800189 <!-- 'Balancing' during auto. -->
190 <div *ngIf="autoPhase" class="d-grid gap-2">
191 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700192 <input #docked type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800193 Docked
194 </label>
195 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700196 <input #engaged type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800197 Engaged
198 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700199 <label>
200 <input #attempted type="checkbox" />
201 Attempted to dock and engage but failed
202 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800203 <br />
204 <button
205 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700206 (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800207 >
208 Submit Balancing
209 </button>
210 </div>
211 <button
212 *ngIf="autoPhase"
213 class="btn btn-info"
214 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
215 >
216 Start Teleop
217 </button>
218 <button
219 *ngIf="!autoPhase"
220 class="btn btn-info"
221 (click)="changeSectionTo('Endgame')"
222 >
223 Endgame
224 </button>
225 </div>
226 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800227 <div *ngSwitchCase="'Endgame'" id="Endgame" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800228 <h6 class="text-muted">
229 Last Action: {{actionList[actionList.length - 1].type}}
230 </h6>
Filip Kujawa36f56082023-03-03 10:58:53 -0800231 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800232 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
233 <button
234 class="btn btn-danger"
235 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
236 >
237 DEAD
238 </button>
Filip Kujawa4413a592023-03-01 10:54:34 -0800239 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700240 <input #docked type="checkbox" />
Filip Kujawa4413a592023-03-01 10:54:34 -0800241 Docked
242 </label>
243 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700244 <input #engaged type="checkbox" />
Filip Kujawa4413a592023-03-01 10:54:34 -0800245 Engaged
246 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700247 <label>
248 <input #attempted type="checkbox" />
249 Attempted to dock and engage but failed
250 </label>
Filip Kujawa4413a592023-03-01 10:54:34 -0800251 <button
Filip Kujawa375aaac2023-02-28 21:43:47 -0800252 *ngIf="!autoPhase"
Filip Kujawa4413a592023-03-01 10:54:34 -0800253 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700254 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa4413a592023-03-01 10:54:34 -0800255 >
Filip Kujawa375aaac2023-02-28 21:43:47 -0800256 End Match
Filip Kujawa4413a592023-03-01 10:54:34 -0800257 </button>
258 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800259 </div>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800260 <div *ngSwitchCase="'Dead'" id="Dead" class="container-fluid">
261 <h2>Robot is dead</h2>
262 <div class="d-grid gap-2">
263 <button
264 class="btn btn-success"
265 (click)="changeSectionTo('Pickup'); addAction({type: 'robotDeathAction', robotOn: true}); "
266 >
267 Revive
268 </button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800269 <button
270 class="btn btn-info"
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700271 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked});"
Filip Kujawa32d13b62023-03-11 17:41:53 -0800272 >
273 End Match
274 </button>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800275 </div>
276 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800277 <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid">
Filip Kujawa36f56082023-03-03 10:58:53 -0800278 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800279 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800280 <button class="btn btn-warning" (click)="submitActions();">Submit</button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800281 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800282 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800283 <div *ngSwitchCase="'Success'" id="Success" class="container-fluid">
284 <h2>Successfully submitted data.</h2>
Philipp Schrader817cce32022-03-26 15:00:00 -0700285 </div>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700286
287 <span class="error_message" role="alert">{{ errorMessage }}</span>
Philipp Schrader80587432022-03-05 15:41:22 -0800288</ng-container>