blob: e06ab18750ff7343c5dcbfd5bc9a5a52e5f59825 [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>
4
5<ng-container [ngSwitch]="section">
Philipp Schrader817cce32022-03-26 15:00:00 -07006 <div
7 *ngSwitchCase="'Team Selection'"
8 id="team_selection"
9 class="container-fluid"
10 >
11 <div class="row">
12 <label for="match_number">Match Number</label>
13 <input
14 [(ngModel)]="matchNumber"
15 type="number"
16 id="match_number"
17 min="1"
18 max="999"
19 />
20 </div>
21 <div class="row">
22 <label for="team_number">Team Number</label>
23 <input
24 [(ngModel)]="teamNumber"
25 type="number"
26 id="team_number"
27 min="1"
28 max="9999"
29 />
30 </div>
Philipp Schrader8aeb14f2022-04-08 21:23:18 -070031 <div class="row">
Philipp Schrader30b4a682022-04-16 14:36:17 -070032 <label for="set_number">Set Number</label>
33 <input
34 [(ngModel)]="setNumber"
35 type="number"
36 id="set_number"
37 min="1"
38 max="10"
39 />
Philipp Schrader8aeb14f2022-04-08 21:23:18 -070040 </div>
41 <div class="row">
Philipp Schrader30b4a682022-04-16 14:36:17 -070042 <label for="comp_level">Comp Level</label>
Philipp Schrader8aeb14f2022-04-08 21:23:18 -070043 <select [(ngModel)]="compLevel" type="number" id="comp_level">
44 <option *ngFor="let level of COMP_LEVELS" [ngValue]="level">
45 {{COMP_LEVEL_LABELS[level]}}
46 </option>
47 </select>
48 </div>
Philipp Schrader817cce32022-03-26 15:00:00 -070049 <div class="buttons">
50 <!-- hack to right align the next button -->
51 <div></div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -080052 <button class="btn btn-primary" (click)="changeSectionTo('Init');">
53 Next
54 </button>
Philipp Schrader817cce32022-03-26 15:00:00 -070055 </div>
56 </div>
57
Filip Kujawa0ef334c2023-02-20 19:42:45 -080058 <div *ngSwitchCase="'Init'" id="init" class="container-fluid">
59 <h2>Select Starting Position</h2>
Filip Kujawa1d9add92023-03-03 13:14:40 -080060 <img
61 id="field_starting_positions_image"
62 src="/sha256/b71def525fb78486617a8b350c0ba6907e8ea25f78d4084a932cba8ae922528c/pictures/field/field.jpg"
63 alt="Starting Positions Image"
64 class="img-fluid"
65 />
Filip Kujawa0ef334c2023-02-20 19:42:45 -080066 <div *ngFor="let i of [1, 2, 3, 4]">
67 <label>
Philipp Schrader817cce32022-03-26 15:00:00 -070068 <input
69 type="radio"
Filip Kujawa0ef334c2023-02-20 19:42:45 -080070 name="radio-group"
71 [value]="i"
72 (change)="selectedValue = $event.target.value"
Philipp Schrader817cce32022-03-26 15:00:00 -070073 />
Filip Kujawa0ef334c2023-02-20 19:42:45 -080074 {{ i }}
Philipp Schrader817cce32022-03-26 15:00:00 -070075 </label>
Filip Kujawa0ef334c2023-02-20 19:42:45 -080076 </div>
Philipp Schrader817cce32022-03-26 15:00:00 -070077 <div class="buttons">
Filip Kujawa375aaac2023-02-28 21:43:47 -080078 <!-- Creates a responsive stack of full-width, "block buttons". -->
Filip Kujawa36f56082023-03-03 10:58:53 -080079 <div class="d-grid gap-5">
Filip Kujawa375aaac2023-02-28 21:43:47 -080080 <button
81 class="btn btn-primary"
82 [disabled]="!selectedValue"
83 (click)="changeSectionTo('Pickup'); addAction({type: 'startMatchAction', position: selectedValue});"
84 >
85 Start Match
86 </button>
87 </div>
Philipp Schrader817cce32022-03-26 15:00:00 -070088 </div>
89 </div>
90
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>
125 <br />
126 <button
127 class="btn btn-info"
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700128 (click)="addAction({type: 'autoBalanceAction', docked: docked.checked, engaged: engaged.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800129 >
130 Submit Balancing
131 </button>
132 </div>
133 <button
134 *ngIf="autoPhase"
135 class="btn btn-info"
136 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
137 >
138 Start Teleop
139 </button>
140 <button
141 *ngIf="!autoPhase"
142 class="btn btn-info"
143 (click)="changeSectionTo('Endgame')"
144 >
145 Endgame
146 </button>
147 </div>
148 </div>
149
150 <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>
190 <br />
191 <button
192 class="btn btn-info"
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700193 (click)="addAction({type: 'autoBalanceAction', docked: docked.checked, engaged: engaged.checked});"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800194 >
195 Submit Balancing
196 </button>
197 </div>
198 <button
199 *ngIf="autoPhase"
200 class="btn btn-info"
201 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
202 >
203 Start Teleop
204 </button>
205 <button
206 *ngIf="!autoPhase"
207 class="btn btn-info"
208 (click)="changeSectionTo('Endgame')"
209 >
210 Endgame
211 </button>
212 </div>
213 </div>
214
215 <div *ngSwitchCase="'Endgame'" id="Endgame" class="container-fluid">
Filip Kujawa493b59f2023-03-11 17:58:59 -0800216 <h6 class="text-muted">
217 Last Action: {{actionList[actionList.length - 1].type}}
218 </h6>
Filip Kujawa36f56082023-03-03 10:58:53 -0800219 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800220 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
221 <button
222 class="btn btn-danger"
223 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
224 >
225 DEAD
226 </button>
Filip Kujawa4413a592023-03-01 10:54:34 -0800227 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700228 <input #docked type="checkbox" />
Filip Kujawa4413a592023-03-01 10:54:34 -0800229 Docked
230 </label>
231 <label>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700232 <input #engaged type="checkbox" />
Filip Kujawa4413a592023-03-01 10:54:34 -0800233 Engaged
234 </label>
Filip Kujawa4413a592023-03-01 10:54:34 -0800235 <button
Filip Kujawa375aaac2023-02-28 21:43:47 -0800236 *ngIf="!autoPhase"
Filip Kujawa4413a592023-03-01 10:54:34 -0800237 class="btn btn-info"
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700238 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked});"
Filip Kujawa4413a592023-03-01 10:54:34 -0800239 >
Filip Kujawa375aaac2023-02-28 21:43:47 -0800240 End Match
Filip Kujawa4413a592023-03-01 10:54:34 -0800241 </button>
242 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800243 </div>
244
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800245 <div *ngSwitchCase="'Dead'" id="Dead" class="container-fluid">
246 <h2>Robot is dead</h2>
247 <div class="d-grid gap-2">
248 <button
249 class="btn btn-success"
250 (click)="changeSectionTo('Pickup'); addAction({type: 'robotDeathAction', robotOn: true}); "
251 >
252 Revive
253 </button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800254 <button
255 class="btn btn-info"
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700256 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked});"
Filip Kujawa32d13b62023-03-11 17:41:53 -0800257 >
258 End Match
259 </button>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800260 </div>
261 </div>
262
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800263 <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid">
Filip Kujawa36f56082023-03-03 10:58:53 -0800264 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800265 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800266 <button class="btn btn-warning" (click)="submitActions();">Submit</button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800267 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800268 </div>
269
270 <div *ngSwitchCase="'Success'" id="Success" class="container-fluid">
271 <h2>Successfully submitted data.</h2>
Philipp Schrader817cce32022-03-26 15:00:00 -0700272 </div>
Philipp Schrader8686bbb2023-03-22 20:15:21 -0700273
274 <span class="error_message" role="alert">{{ errorMessage }}</span>
Philipp Schrader80587432022-03-05 15:41:22 -0800275</ng-container>