blob: 9822c922400479587a073004e49167ff592b117d [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 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>
115 <input type="checkbox" (change)="dockedValue = $event.target.value" />
116 Docked
117 </label>
118 <label>
119 <input
120 type="checkbox"
121 (change)="engagedValue = $event.target.value"
122 />
123 Engaged
124 </label>
125 <br />
126 <button
127 class="btn btn-info"
128 (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue});"
129 >
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 Kujawa36f56082023-03-03 10:58:53 -0800151 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800152 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
153 <button
154 class="btn btn-danger"
155 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
156 >
157 DEAD
158 </button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800159 <button
160 class="btn btn-success"
161 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kHigh});"
162 >
163 HIGH
164 </button>
165 <button
166 class="btn btn-warning"
167 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kMiddle});"
168 >
169 MID
170 </button>
171 <button
172 class="btn btn-danger"
173 (click)="changeSectionTo('Pickup'); addAction({type: 'placeObjectAction', scoreLevel: ScoreLevel.kLow});"
174 >
175 LOW
176 </button>
177 <!-- 'Balancing' during auto. -->
178 <div *ngIf="autoPhase" class="d-grid gap-2">
179 <label>
180 <input type="checkbox" (change)="dockedValue = $event.target.value" />
181 Docked
182 </label>
183 <label>
184 <input
185 type="checkbox"
186 (change)="engagedValue = $event.target.value"
187 />
188 Engaged
189 </label>
190 <br />
191 <button
192 class="btn btn-info"
193 (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue});"
194 >
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 Kujawa36f56082023-03-03 10:58:53 -0800216 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800217 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
218 <button
219 class="btn btn-danger"
220 (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});"
221 >
222 DEAD
223 </button>
Filip Kujawa4413a592023-03-01 10:54:34 -0800224 <label>
225 <input type="checkbox" (change)="dockedValue = $event.target.value" />
226 Docked
227 </label>
228 <label>
229 <input type="checkbox" (change)="engagedValue = $event.target.value" />
230 Engaged
231 </label>
Filip Kujawa4413a592023-03-01 10:54:34 -0800232 <button
Filip Kujawa375aaac2023-02-28 21:43:47 -0800233 *ngIf="!autoPhase"
Filip Kujawa4413a592023-03-01 10:54:34 -0800234 class="btn btn-info"
Filip Kujawa375aaac2023-02-28 21:43:47 -0800235 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: dockedValue, engaged: engagedValue});"
Filip Kujawa4413a592023-03-01 10:54:34 -0800236 >
Filip Kujawa375aaac2023-02-28 21:43:47 -0800237 End Match
Filip Kujawa4413a592023-03-01 10:54:34 -0800238 </button>
239 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800240 </div>
241
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800242 <div *ngSwitchCase="'Dead'" id="Dead" class="container-fluid">
243 <h2>Robot is dead</h2>
244 <div class="d-grid gap-2">
245 <button
246 class="btn btn-success"
247 (click)="changeSectionTo('Pickup'); addAction({type: 'robotDeathAction', robotOn: true}); "
248 >
249 Revive
250 </button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800251 <button
252 class="btn btn-info"
253 (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: dockedValue, engaged: engagedValue});"
254 >
255 End Match
256 </button>
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800257 </div>
258 </div>
259
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800260 <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid">
Filip Kujawa36f56082023-03-03 10:58:53 -0800261 <div class="d-grid gap-5">
Filip Kujawa9f56d0e2023-03-03 19:44:43 -0800262 <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button>
Filip Kujawa32d13b62023-03-11 17:41:53 -0800263 <button class="btn btn-warning" (click)="submitActions();">Submit</button>
Filip Kujawa375aaac2023-02-28 21:43:47 -0800264 </div>
Filip Kujawa0ef334c2023-02-20 19:42:45 -0800265 </div>
266
267 <div *ngSwitchCase="'Success'" id="Success" class="container-fluid">
268 <h2>Successfully submitted data.</h2>
Philipp Schrader817cce32022-03-26 15:00:00 -0700269 </div>
Philipp Schrader80587432022-03-05 15:41:22 -0800270</ng-container>