blob: 187263675fd067a435b8baa102131c5d68c1ce4a [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 Kujawa36f56082023-03-03 10:58:53 -080095 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -080096 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
97 <button
98 class="btn btn-danger"
99 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
100 >
101 DEAD
102 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800103 <button
104 class="btn btn-warning"
105 (click)="changeSectionTo('Place'); addAction({type: 'pickupObjectAction', objectType: ObjectType.kCone});"
106 >
107 CONE
108 </button>
109 <button
110 class="btn btn-primary"
111 (click)="changeSectionTo('Place'); addAction({type: 'pickupObjectAction', objectType: ObjectType.kCube});"
112 >
113 CUBE
114 </button>
115 <!-- 'Balancing' during auto. -->
116 <div *ngIf="autoPhase" class="d-grid gap-2">
117 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700118 <input #docked type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800119 Docked
120 </label>
121 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700122 <input #engaged type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800123 Engaged
124 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700125 <label>
126 <input #attempted type="checkbox" />
127 Attempted to dock and engage but failed
128 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800129 <br />
130 <button
131 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700132 (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800133 >
134 Submit Balancing
135 </button>
136 </div>
137 <button
138 *ngIf="autoPhase"
139 class="btn btn-info"
140 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
141 >
142 Start Teleop
143 </button>
144 <button
145 *ngIf="!autoPhase"
146 class="btn btn-info"
147 (click)="changeSectionTo('Endgame')"
148 >
149 Endgame
150 </button>
151 </div>
152 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800153 <div *ngSwitchCase="'Place'" id="Place" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800154 <h6 class="text-muted">
155 Last Action: {{actionList[actionList.length - 1].type}}
156 </h6>
Filip Kujawa36f56082023-03-03 10:58:53 -0800157 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800158 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
159 <button
160 class="btn btn-danger"
161 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
162 >
163 DEAD
164 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800165 <button
166 class="btn btn-success"
167 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kHigh});"
168 >
169 HIGH
170 </button>
171 <button
172 class="btn btn-warning"
173 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kMiddle});"
174 >
175 MID
176 </button>
177 <button
178 class="btn btn-danger"
179 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kLow});"
180 >
181 LOW
182 </button>
183 <!-- 'Balancing' during auto. -->
184 <div *ngIf="autoPhase" class="d-grid gap-2">
185 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700186 <input #docked type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800187 Docked
188 </label>
189 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700190 <input #engaged type="checkbox" />
Filip Kujawa375aaac2023-02-28 21:43:47 -0800191 Engaged
192 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700193 <label>
194 <input #attempted type="checkbox" />
195 Attempted to dock and engage but failed
196 </label>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800197 <br />
198 <button
199 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700200 (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue, balanceAttempt: attempted.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800201 >
202 Submit Balancing
203 </button>
204 </div>
205 <button
206 *ngIf="autoPhase"
207 class="btn btn-info"
208 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
209 >
210 Start Teleop
211 </button>
212 <button
213 *ngIf="!autoPhase"
214 class="btn btn-info"
215 (click)="changeSectionTo('Endgame')"
216 >
217 Endgame
218 </button>
219 </div>
220 </div>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800221 <div *ngSwitchCase="'Endgame'" id="Endgame" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800222 <h6 class="text-muted">
223 Last Action: {{actionList[actionList.length - 1].type}}
224 </h6>
Filip Kujawa36f56082023-03-03 10:58:53 -0800225 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800226 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
227 <button
228 class="btn btn-danger"
229 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
230 >
231 DEAD
232 </button>
Filip Kujawa4413a592023-03-01 10:54:34 -0800233 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700234 <input #docked type="checkbox" />
Filip Kujawa4413a592023-03-01 10:54:34 -0800235 Docked
236 </label>
237 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700238 <input #engaged type="checkbox" />
Filip Kujawa4413a592023-03-01 10:54:34 -0800239 Engaged
240 </label>
Emily Markova63c63f62023-03-29 20:57:35 -0700241 <label>
242 <input #attempted type="checkbox" />
243 Attempted to dock and engage but failed
244 </label>
Filip Kujawa4413a592023-03-01 10:54:34 -0800245 <button
Filip Kujawa375aaac2023-02-28 21:43:47 -0800246 *ngIf="!autoPhase"
Filip Kujawa4413a592023-03-01 10:54:34 -0800247 class="btn btn-info"
Emily Markova63c63f62023-03-29 20:57:35 -0700248 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});"
Filip Kujawa4413a592023-03-01 10:54:34 -0800249 >
Filip Kujawa375aaac2023-02-28 21:43:47 -0800250 End Match
Filip Kujawa4413a592023-03-01 10:54:34 -0800251 </button>
252 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800253 </div>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800254 <div *ngSwitchCase="'Dead'" id="Dead" class="container-fluid">
255 <h2>Robot is dead</h2>
256 <div class="d-grid gap-2">
257 <button
258 class="btn btn-success"
259 (click)="changeSectionTo('Pickup'); addAction({type: 'robotDeathAction', robotOn: true}); "
260 >
261 Revive
262 </button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800263 <button
264 class="btn btn-info"
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700265 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked});"
Filip Kujawa32d13b62023-03-11 17:41:53 -0800266 >
267 End Match
268 </button>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800269 </div>
270 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800271 <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid">
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>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800274 <button class="btn btn-warning" (click)="submitActions();">Submit</button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800275 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800276 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800277 <div *ngSwitchCase="'Success'" id="Success" class="container-fluid">
278 <h2>Successfully submitted data.</h2>
Philipp Schrader817cce32022-03-26 15:00:00 -0700279 </div>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700280
281 <span class="error_message" role="alert">{{ errorMessage }}</span>
Philipp Schrader80587432022-03-05 15:41:22 -0800282</ng-container>