Philipp Schrader | 6b2e950 | 2022-03-15 23:42:56 -0700 | [diff] [blame] | 1 | <div class="header" #header> |
Philipp Schrader | 2b33427 | 2023-04-11 21:27:36 -0700 | [diff] [blame^] | 2 | <h2> |
| 3 | <span *ngIf="section != 'Team Selection'">{{teamNumber}}</span> |
| 4 | {{section}} |
| 5 | </h2> |
Philipp Schrader | 8058743 | 2022-03-05 15:41:22 -0800 | [diff] [blame] | 6 | </div> |
Philipp Schrader | 8058743 | 2022-03-05 15:41:22 -0800 | [diff] [blame] | 7 | <ng-container [ngSwitch]="section"> |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 8 | <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 Schrader | 8aeb14f | 2022-04-08 21:23:18 -0700 | [diff] [blame] | 33 | <div class="row"> |
Philipp Schrader | 30b4a68 | 2022-04-16 14:36:17 -0700 | [diff] [blame] | 34 | <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 Schrader | 8aeb14f | 2022-04-08 21:23:18 -0700 | [diff] [blame] | 42 | </div> |
| 43 | <div class="row"> |
Philipp Schrader | 30b4a68 | 2022-04-16 14:36:17 -0700 | [diff] [blame] | 44 | <label for="comp_level">Comp Level</label> |
Philipp Schrader | 8aeb14f | 2022-04-08 21:23:18 -0700 | [diff] [blame] | 45 | <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 Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 51 | <div class="buttons"> |
| 52 | <!-- hack to right align the next button --> |
| 53 | <div></div> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 54 | <button class="btn btn-primary" (click)="changeSectionTo('Init');"> |
| 55 | Next |
| 56 | </button> |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 57 | </div> |
| 58 | </div> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 59 | <div *ngSwitchCase="'Init'" id="init" class="container-fluid"> |
| 60 | <h2>Select Starting Position</h2> |
Filip Kujawa | 1d9add9 | 2023-03-03 13:14:40 -0800 | [diff] [blame] | 61 | <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 Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 67 | <div *ngFor="let i of [1, 2, 3, 4]"> |
| 68 | <label> |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 69 | <input |
| 70 | type="radio" |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 71 | name="radio-group" |
| 72 | [value]="i" |
| 73 | (change)="selectedValue = $event.target.value" |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 74 | /> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 75 | {{ i }} |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 76 | </label> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 77 | </div> |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 78 | <div class="buttons"> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 79 | <!-- Creates a responsive stack of full-width, "block buttons". --> |
Filip Kujawa | 36f5608 | 2023-03-03 10:58:53 -0800 | [diff] [blame] | 80 | <div class="d-grid gap-5"> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 81 | <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 Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 89 | </div> |
| 90 | </div> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 91 | <div *ngSwitchCase="'Pickup'" id="PickUp" class="container-fluid"> |
Filip Kujawa | 493b59f | 2023-03-11 17:58:59 -0800 | [diff] [blame] | 92 | <h6 class="text-muted"> |
| 93 | Last Action: {{actionList[actionList.length - 1].type}} |
| 94 | </h6> |
Filip Kujawa | 36f5608 | 2023-03-03 10:58:53 -0800 | [diff] [blame] | 95 | <div class="d-grid gap-5"> |
Filip Kujawa | 9f56d0e | 2023-03-03 19:44:43 -0800 | [diff] [blame] | 96 | <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 Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 103 | <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 Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 118 | <input #docked type="checkbox" /> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 119 | Docked |
| 120 | </label> |
| 121 | <label> |
Philipp Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 122 | <input #engaged type="checkbox" /> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 123 | Engaged |
| 124 | </label> |
Emily Markova | 63c63f6 | 2023-03-29 20:57:35 -0700 | [diff] [blame] | 125 | <label> |
| 126 | <input #attempted type="checkbox" /> |
| 127 | Attempted to dock and engage but failed |
| 128 | </label> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 129 | <br /> |
| 130 | <button |
| 131 | class="btn btn-info" |
Emily Markova | 63c63f6 | 2023-03-29 20:57:35 -0700 | [diff] [blame] | 132 | (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue, balanceAttempt: attempted.checked});" |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 133 | > |
| 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 Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 153 | <div *ngSwitchCase="'Place'" id="Place" class="container-fluid"> |
Filip Kujawa | 493b59f | 2023-03-11 17:58:59 -0800 | [diff] [blame] | 154 | <h6 class="text-muted"> |
| 155 | Last Action: {{actionList[actionList.length - 1].type}} |
| 156 | </h6> |
Filip Kujawa | 36f5608 | 2023-03-03 10:58:53 -0800 | [diff] [blame] | 157 | <div class="d-grid gap-5"> |
Filip Kujawa | 9f56d0e | 2023-03-03 19:44:43 -0800 | [diff] [blame] | 158 | <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 Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 165 | <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 Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 186 | <input #docked type="checkbox" /> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 187 | Docked |
| 188 | </label> |
| 189 | <label> |
Philipp Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 190 | <input #engaged type="checkbox" /> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 191 | Engaged |
| 192 | </label> |
Emily Markova | 63c63f6 | 2023-03-29 20:57:35 -0700 | [diff] [blame] | 193 | <label> |
| 194 | <input #attempted type="checkbox" /> |
| 195 | Attempted to dock and engage but failed |
| 196 | </label> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 197 | <br /> |
| 198 | <button |
| 199 | class="btn btn-info" |
Emily Markova | 63c63f6 | 2023-03-29 20:57:35 -0700 | [diff] [blame] | 200 | (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue, balanceAttempt: attempted.checked});" |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 201 | > |
| 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 Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 221 | <div *ngSwitchCase="'Endgame'" id="Endgame" class="container-fluid"> |
Filip Kujawa | 493b59f | 2023-03-11 17:58:59 -0800 | [diff] [blame] | 222 | <h6 class="text-muted"> |
| 223 | Last Action: {{actionList[actionList.length - 1].type}} |
| 224 | </h6> |
Filip Kujawa | 36f5608 | 2023-03-03 10:58:53 -0800 | [diff] [blame] | 225 | <div class="d-grid gap-5"> |
Filip Kujawa | 9f56d0e | 2023-03-03 19:44:43 -0800 | [diff] [blame] | 226 | <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 Kujawa | 4413a59 | 2023-03-01 10:54:34 -0800 | [diff] [blame] | 233 | <label> |
Philipp Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 234 | <input #docked type="checkbox" /> |
Filip Kujawa | 4413a59 | 2023-03-01 10:54:34 -0800 | [diff] [blame] | 235 | Docked |
| 236 | </label> |
| 237 | <label> |
Philipp Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 238 | <input #engaged type="checkbox" /> |
Filip Kujawa | 4413a59 | 2023-03-01 10:54:34 -0800 | [diff] [blame] | 239 | Engaged |
| 240 | </label> |
Emily Markova | 63c63f6 | 2023-03-29 20:57:35 -0700 | [diff] [blame] | 241 | <label> |
| 242 | <input #attempted type="checkbox" /> |
| 243 | Attempted to dock and engage but failed |
| 244 | </label> |
Filip Kujawa | 4413a59 | 2023-03-01 10:54:34 -0800 | [diff] [blame] | 245 | <button |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 246 | *ngIf="!autoPhase" |
Filip Kujawa | 4413a59 | 2023-03-01 10:54:34 -0800 | [diff] [blame] | 247 | class="btn btn-info" |
Emily Markova | 63c63f6 | 2023-03-29 20:57:35 -0700 | [diff] [blame] | 248 | (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked, balanceAttempt: attempted.checked});" |
Filip Kujawa | 4413a59 | 2023-03-01 10:54:34 -0800 | [diff] [blame] | 249 | > |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 250 | End Match |
Filip Kujawa | 4413a59 | 2023-03-01 10:54:34 -0800 | [diff] [blame] | 251 | </button> |
| 252 | </div> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 253 | </div> |
Filip Kujawa | 9f56d0e | 2023-03-03 19:44:43 -0800 | [diff] [blame] | 254 | <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 Kujawa | 32d13b6 | 2023-03-11 17:41:53 -0800 | [diff] [blame] | 263 | <button |
| 264 | class="btn btn-info" |
Philipp Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 265 | (click)="changeSectionTo('Review and Submit'); addAction({type: 'endMatchAction', docked: docked.checked, engaged: engaged.checked});" |
Filip Kujawa | 32d13b6 | 2023-03-11 17:41:53 -0800 | [diff] [blame] | 266 | > |
| 267 | End Match |
| 268 | </button> |
Filip Kujawa | 9f56d0e | 2023-03-03 19:44:43 -0800 | [diff] [blame] | 269 | </div> |
| 270 | </div> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 271 | <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid"> |
Filip Kujawa | 36f5608 | 2023-03-03 10:58:53 -0800 | [diff] [blame] | 272 | <div class="d-grid gap-5"> |
Filip Kujawa | 9f56d0e | 2023-03-03 19:44:43 -0800 | [diff] [blame] | 273 | <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button> |
Filip Kujawa | 32d13b6 | 2023-03-11 17:41:53 -0800 | [diff] [blame] | 274 | <button class="btn btn-warning" (click)="submitActions();">Submit</button> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 275 | </div> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 276 | </div> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 277 | <div *ngSwitchCase="'Success'" id="Success" class="container-fluid"> |
| 278 | <h2>Successfully submitted data.</h2> |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 279 | </div> |
Philipp Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 280 | |
| 281 | <span class="error_message" role="alert">{{ errorMessage }}</span> |
Philipp Schrader | 8058743 | 2022-03-05 15:41:22 -0800 | [diff] [blame] | 282 | </ng-container> |