blob: 9f4c8eb074ccafa4a50bd9f90f2131df423b2bee [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>
118 <input type="checkbox" (change)="dockedValue = $event.target.value" />
119 Docked
120 </label>
121 <label>
122 <input
123 type="checkbox"
124 (change)="engagedValue = $event.target.value"
125 />
126 Engaged
127 </label>
128 <br />
129 <button
130 class="btn btn-info"
131 (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue});"
132 >
133 Submit Balancing
134 </button>
135 </div>
136 <button
137 *ngIf="autoPhase"
138 class="btn btn-info"
139 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
140 >
141 Start Teleop
142 </button>
143 <button
144 *ngIf="!autoPhase"
145 class="btn btn-info"
146 (click)="changeSectionTo('Endgame')"
147 >
148 Endgame
149 </button>
150 </div>
151 </div>
152
153 <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>
186 <input type="checkbox" (change)="dockedValue = $event.target.value" />
187 Docked
188 </label>
189 <label>
190 <input
191 type="checkbox"
192 (change)="engagedValue = $event.target.value"
193 />
194 Engaged
195 </label>
196 <br />
197 <button
198 class="btn btn-info"
199 (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue});"
200 >
201 Submit Balancing
202 </button>
203 </div>
204 <button
205 *ngIf="autoPhase"
206 class="btn btn-info"
207 (click)="autoPhase = false; addAction({type: 'endAutoPhase'});"
208 >
209 Start Teleop
210 </button>
211 <button
212 *ngIf="!autoPhase"
213 class="btn btn-info"
214 (click)="changeSectionTo('Endgame')"
215 >
216 Endgame
217 </button>
218 </div>
219 </div>
220
221 <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>
234 <input type="checkbox" (change)="dockedValue = $event.target.value" />
235 Docked
236 </label>
237 <label>
238 <input type="checkbox" (change)="engagedValue = $event.target.value" />
239 Engaged
240 </label>
Filip Kujawa4413a592023-03-01 10:54:34 -0800241 <button
Filip Kujawa375aaac2023-02-28 21:43:47 -0800242 *ngIf="!autoPhase"
Filip Kujawa4413a592023-03-01 10:54:34 -0800243 class="btn btn-info"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800244 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: dockedValue, engaged: engagedValue});"
Filip Kujawa4413a592023-03-01 10:54:34 -0800245 >
Filip Kujawa375aaac2023-02-28 21:43:47 -0800246 End Match
Filip Kujawa4413a592023-03-01 10:54:34 -0800247 </button>
248 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800249 </div>
250
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"
262 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: dockedValue, engaged: engagedValue});"
263 >
264 End Match
265 </button>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800266 </div>
267 </div>
268
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800269 <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid">
Filip Kujawa36f56082023-03-03 10:58:53 -0800270 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800271 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800272 <button class="btn btn-warning" (click)="submitActions();">Submit</button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800273 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800274 </div>
275
276 <div *ngSwitchCase="'Success'" id="Success" class="container-fluid">
277 <h2>Successfully submitted data.</h2>
Philipp Schrader817cce32022-03-26 15:00:00 -0700278 </div>
Philipp Schrader80587432022-03-05 15:41:22 -0800279</ng-container>