blob: e304f2ae1113c5f045aadf4c1ce97247ce815363 [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>
180 <!-- 'Balancing' during auto. -->
181 <div *ngIf="autoPhase" class="d-grid gap-2">
182 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700183 <input #docked type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800184 Docked
185 </label>
186 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700187 <input #engaged type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800188 Engaged
189 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700190 <label>
191 <input #attempted type="checkbox" />
192 Attempted to dock and engage but failed
193 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800194 <br />
195 <button
196 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700197 (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800198 >
199 Submit Balancing
200 </button>
201 </div>
202 <button
203 *ngIf="autoPhase"
204 class="btn btn-info"
205 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
206 >
207 Start Teleop
208 </button>
209 <button
210 *ngIf="!autoPhase"
211 class="btn btn-info"
212 (click)="changeSectionTo('Endgame')"
213 >
214 Endgame
215 </button>
216 </div>
217 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800218 <div *ngSwitchCase="'Endgame'" id="Endgame" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800219 <h6 class="text-muted">
220 Last Action: {{actionList[actionList.length - 1].type}}
221 </h6>
Filip Kujawa36f56082023-03-03 10:58:53 -0800222 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800223 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
224 <button
225 class="btn btn-danger"
226 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
227 >
228 DEAD
229 </button>
Filip Kujawa4413a592023-03-01 10:54:34 -0800230 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700231 <input #docked type="checkbox" />
Filip Kujawa4413a592023-03-01 10:54:34 -0800232 Docked
233 </label>
234 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700235 <input #engaged type="checkbox" />
Filip Kujawa4413a592023-03-01 10:54:34 -0800236 Engaged
237 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700238 <label>
239 <input #attempted type="checkbox" />
240 Attempted to dock and engage but failed
241 </label>
Filip Kujawa4413a592023-03-01 10:54:34 -0800242 <button
Filip Kujawa375aaac2023-02-28 21:43:47 -0800243 *ngIf="!autoPhase"
Filip Kujawa4413a592023-03-01 10:54:34 -0800244 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700245 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa4413a592023-03-01 10:54:34 -0800246 >
Filip Kujawa375aaac2023-02-28 21:43:47 -0800247 End Match
Filip Kujawa4413a592023-03-01 10:54:34 -0800248 </button>
249 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800250 </div>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800251 <div *ngSwitchCase="'Dead'" id="Dead" class="container-fluid">
252 <h2>Robot is dead</h2>
253 <div class="d-grid gap-2">
254 <button
255 class="btn btn-success"
256 (click)="changeSectionTo('Pickup'); addAction({type: 'robotDeathAction', robotOn: true}); "
257 >
258 Revive
259 </button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800260 <button
261 class="btn btn-info"
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700262 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked});"
Filip Kujawa32d13b62023-03-11 17:41:53 -0800263 >
264 End Match
265 </button>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800266 </div>
267 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800268 <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid">
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>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800271 <button class="btn btn-warning" (click)="submitActions();">Submit</button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800272 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800273 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800274 <div *ngSwitchCase="'Success'" id="Success" class="container-fluid">
275 <h2>Successfully submitted data.</h2>
Philipp Schrader817cce32022-03-26 15:00:00 -0700276 </div>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700277
278 <span class="error_message" role="alert">{{ errorMessage }}</span>
Philipp Schrader80587432022-03-05 15:41:22 -0800279</ng-container>