Philipp Schrader | 6b2e950 | 2022-03-15 23:42:56 -0700 | [diff] [blame] | 1 | <div class="header" #header> |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 2 | <h2>{{section}}</h2> |
Philipp Schrader | 8058743 | 2022-03-05 15:41:22 -0800 | [diff] [blame] | 3 | </div> |
Philipp Schrader | 8058743 | 2022-03-05 15:41:22 -0800 | [diff] [blame] | 4 | <ng-container [ngSwitch]="section"> |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 5 | <div |
| 6 | *ngSwitchCase="'Team Selection'" |
| 7 | id="team_selection" |
| 8 | class="container-fluid" |
| 9 | > |
| 10 | <div class="row"> |
| 11 | <label for="match_number">Match Number</label> |
| 12 | <input |
| 13 | [(ngModel)]="matchNumber" |
| 14 | type="number" |
| 15 | id="match_number" |
| 16 | min="1" |
| 17 | max="999" |
| 18 | /> |
| 19 | </div> |
| 20 | <div class="row"> |
| 21 | <label for="team_number">Team Number</label> |
| 22 | <input |
| 23 | [(ngModel)]="teamNumber" |
| 24 | type="number" |
| 25 | id="team_number" |
| 26 | min="1" |
| 27 | max="9999" |
| 28 | /> |
| 29 | </div> |
Philipp Schrader | 8aeb14f | 2022-04-08 21:23:18 -0700 | [diff] [blame] | 30 | <div class="row"> |
Philipp Schrader | 30b4a68 | 2022-04-16 14:36:17 -0700 | [diff] [blame] | 31 | <label for="set_number">Set Number</label> |
| 32 | <input |
| 33 | [(ngModel)]="setNumber" |
| 34 | type="number" |
| 35 | id="set_number" |
| 36 | min="1" |
| 37 | max="10" |
| 38 | /> |
Philipp Schrader | 8aeb14f | 2022-04-08 21:23:18 -0700 | [diff] [blame] | 39 | </div> |
| 40 | <div class="row"> |
Philipp Schrader | 30b4a68 | 2022-04-16 14:36:17 -0700 | [diff] [blame] | 41 | <label for="comp_level">Comp Level</label> |
Philipp Schrader | 8aeb14f | 2022-04-08 21:23:18 -0700 | [diff] [blame] | 42 | <select [(ngModel)]="compLevel" type="number" id="comp_level"> |
| 43 | <option *ngFor="let level of COMP_LEVELS" [ngValue]="level"> |
| 44 | {{COMP_LEVEL_LABELS[level]}} |
| 45 | </option> |
| 46 | </select> |
| 47 | </div> |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 48 | <div class="buttons"> |
| 49 | <!-- hack to right align the next button --> |
| 50 | <div></div> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 51 | <button class="btn btn-primary" (click)="changeSectionTo('Init');"> |
| 52 | Next |
| 53 | </button> |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 54 | </div> |
| 55 | </div> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 56 | <div *ngSwitchCase="'Init'" id="init" class="container-fluid"> |
| 57 | <h2>Select Starting Position</h2> |
Filip Kujawa | 1d9add9 | 2023-03-03 13:14:40 -0800 | [diff] [blame] | 58 | <img |
| 59 | id="field_starting_positions_image" |
| 60 | src="/sha256/b71def525fb78486617a8b350c0ba6907e8ea25f78d4084a932cba8ae922528c/pictures/field/field.jpg" |
| 61 | alt="Starting Positions Image" |
| 62 | class="img-fluid" |
| 63 | /> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 64 | <div *ngFor="let i of [1, 2, 3, 4]"> |
| 65 | <label> |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 66 | <input |
| 67 | type="radio" |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 68 | name="radio-group" |
| 69 | [value]="i" |
| 70 | (change)="selectedValue = $event.target.value" |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 71 | /> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 72 | {{ i }} |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 73 | </label> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 74 | </div> |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 75 | <div class="buttons"> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 76 | <!-- Creates a responsive stack of full-width, "block buttons". --> |
Filip Kujawa | 36f5608 | 2023-03-03 10:58:53 -0800 | [diff] [blame] | 77 | <div class="d-grid gap-5"> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 78 | <button |
| 79 | class="btn btn-primary" |
| 80 | [disabled]="!selectedValue" |
| 81 | (click)="changeSectionTo('Pickup'); addAction({type: 'startMatchAction', position: selectedValue});" |
| 82 | > |
| 83 | Start Match |
| 84 | </button> |
| 85 | </div> |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 86 | </div> |
| 87 | </div> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 88 | <div *ngSwitchCase="'Pickup'" id="PickUp" class="container-fluid"> |
Filip Kujawa | 493b59f | 2023-03-11 17:58:59 -0800 | [diff] [blame] | 89 | <h6 class="text-muted"> |
| 90 | Last Action: {{actionList[actionList.length - 1].type}} |
| 91 | </h6> |
Filip Kujawa | 36f5608 | 2023-03-03 10:58:53 -0800 | [diff] [blame] | 92 | <div class="d-grid gap-5"> |
Filip Kujawa | 9f56d0e | 2023-03-03 19:44:43 -0800 | [diff] [blame] | 93 | <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 Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 100 | <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> |
Philipp Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 115 | <input #docked type="checkbox" /> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 116 | Docked |
| 117 | </label> |
| 118 | <label> |
Philipp Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 119 | <input #engaged type="checkbox" /> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 120 | Engaged |
| 121 | </label> |
Emily Markova | 63c63f6 | 2023-03-29 20:57:35 -0700 | [diff] [blame^] | 122 | <label> |
| 123 | <input #attempted type="checkbox" /> |
| 124 | Attempted to dock and engage but failed |
| 125 | </label> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 126 | <br /> |
| 127 | <button |
| 128 | class="btn btn-info" |
Emily Markova | 63c63f6 | 2023-03-29 20:57:35 -0700 | [diff] [blame^] | 129 | (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue, balanceAttempt: attempted.checked});" |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 130 | > |
| 131 | Submit Balancing |
| 132 | </button> |
| 133 | </div> |
| 134 | <button |
| 135 | *ngIf="autoPhase" |
| 136 | class="btn btn-info" |
| 137 | (click)="autoPhase = false; addAction({type: 'endAutoPhase'});" |
| 138 | > |
| 139 | Start Teleop |
| 140 | </button> |
| 141 | <button |
| 142 | *ngIf="!autoPhase" |
| 143 | class="btn btn-info" |
| 144 | (click)="changeSectionTo('Endgame')" |
| 145 | > |
| 146 | Endgame |
| 147 | </button> |
| 148 | </div> |
| 149 | </div> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 150 | <div *ngSwitchCase="'Place'" id="Place" class="container-fluid"> |
Filip Kujawa | 493b59f | 2023-03-11 17:58:59 -0800 | [diff] [blame] | 151 | <h6 class="text-muted"> |
| 152 | Last Action: {{actionList[actionList.length - 1].type}} |
| 153 | </h6> |
Filip Kujawa | 36f5608 | 2023-03-03 10:58:53 -0800 | [diff] [blame] | 154 | <div class="d-grid gap-5"> |
Filip Kujawa | 9f56d0e | 2023-03-03 19:44:43 -0800 | [diff] [blame] | 155 | <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 Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 162 | <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 Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 183 | <input #docked type="checkbox" /> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 184 | Docked |
| 185 | </label> |
| 186 | <label> |
Philipp Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 187 | <input #engaged type="checkbox" /> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 188 | Engaged |
| 189 | </label> |
Emily Markova | 63c63f6 | 2023-03-29 20:57:35 -0700 | [diff] [blame^] | 190 | <label> |
| 191 | <input #attempted type="checkbox" /> |
| 192 | Attempted to dock and engage but failed |
| 193 | </label> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 194 | <br /> |
| 195 | <button |
| 196 | class="btn btn-info" |
Emily Markova | 63c63f6 | 2023-03-29 20:57:35 -0700 | [diff] [blame^] | 197 | (click)="addAction({type: 'autoBalanceAction', docked: dockedValue, engaged: engagedValue, balanceAttempt: attempted.checked});" |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 198 | > |
| 199 | Submit Balancing |
| 200 | </button> |
| 201 | </div> |
| 202 | <button |
| 203 | *ngIf="autoPhase" |
| 204 | class="btn btn-info" |
| 205 | (click)="autoPhase = false; addAction({type: 'endAutoPhase'});" |
| 206 | > |
| 207 | Start Teleop |
| 208 | </button> |
| 209 | <button |
| 210 | *ngIf="!autoPhase" |
| 211 | class="btn btn-info" |
| 212 | (click)="changeSectionTo('Endgame')" |
| 213 | > |
| 214 | Endgame |
| 215 | </button> |
| 216 | </div> |
| 217 | </div> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 218 | <div *ngSwitchCase="'Endgame'" id="Endgame" class="container-fluid"> |
Filip Kujawa | 493b59f | 2023-03-11 17:58:59 -0800 | [diff] [blame] | 219 | <h6 class="text-muted"> |
| 220 | Last Action: {{actionList[actionList.length - 1].type}} |
| 221 | </h6> |
Filip Kujawa | 36f5608 | 2023-03-03 10:58:53 -0800 | [diff] [blame] | 222 | <div class="d-grid gap-5"> |
Filip Kujawa | 9f56d0e | 2023-03-03 19:44:43 -0800 | [diff] [blame] | 223 | <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button> |
| 224 | <button |
| 225 | class="btn btn-danger" |
| 226 | (click)="changeSectionTo('Dead'); addAction({type: 'robotDeathAction', robotOn: false});" |
| 227 | > |
| 228 | DEAD |
| 229 | </button> |
Filip Kujawa | 4413a59 | 2023-03-01 10:54:34 -0800 | [diff] [blame] | 230 | <label> |
Philipp Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 231 | <input #docked type="checkbox" /> |
Filip Kujawa | 4413a59 | 2023-03-01 10:54:34 -0800 | [diff] [blame] | 232 | Docked |
| 233 | </label> |
| 234 | <label> |
Philipp Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 235 | <input #engaged type="checkbox" /> |
Filip Kujawa | 4413a59 | 2023-03-01 10:54:34 -0800 | [diff] [blame] | 236 | Engaged |
| 237 | </label> |
Emily Markova | 63c63f6 | 2023-03-29 20:57:35 -0700 | [diff] [blame^] | 238 | <label> |
| 239 | <input #attempted type="checkbox" /> |
| 240 | Attempted to dock and engage but failed |
| 241 | </label> |
Filip Kujawa | 4413a59 | 2023-03-01 10:54:34 -0800 | [diff] [blame] | 242 | <button |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 243 | *ngIf="!autoPhase" |
Filip Kujawa | 4413a59 | 2023-03-01 10:54:34 -0800 | [diff] [blame] | 244 | class="btn btn-info" |
Emily Markova | 63c63f6 | 2023-03-29 20:57:35 -0700 | [diff] [blame^] | 245 | (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] | 246 | > |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 247 | End Match |
Filip Kujawa | 4413a59 | 2023-03-01 10:54:34 -0800 | [diff] [blame] | 248 | </button> |
| 249 | </div> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 250 | </div> |
Filip Kujawa | 9f56d0e | 2023-03-03 19:44:43 -0800 | [diff] [blame] | 251 | <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 Kujawa | 32d13b6 | 2023-03-11 17:41:53 -0800 | [diff] [blame] | 260 | <button |
| 261 | class="btn btn-info" |
Philipp Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 262 | (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] | 263 | > |
| 264 | End Match |
| 265 | </button> |
Filip Kujawa | 9f56d0e | 2023-03-03 19:44:43 -0800 | [diff] [blame] | 266 | </div> |
| 267 | </div> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 268 | <div *ngSwitchCase="'Review and Submit'" id="Review" class="container-fluid"> |
Filip Kujawa | 36f5608 | 2023-03-03 10:58:53 -0800 | [diff] [blame] | 269 | <div class="d-grid gap-5"> |
Filip Kujawa | 9f56d0e | 2023-03-03 19:44:43 -0800 | [diff] [blame] | 270 | <button class="btn btn-secondary" (click)="undoLastAction()">UNDO</button> |
Filip Kujawa | 32d13b6 | 2023-03-11 17:41:53 -0800 | [diff] [blame] | 271 | <button class="btn btn-warning" (click)="submitActions();">Submit</button> |
Filip Kujawa | 375aaac | 2023-02-28 21:43:47 -0800 | [diff] [blame] | 272 | </div> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 273 | </div> |
Filip Kujawa | 0ef334c | 2023-02-20 19:42:45 -0800 | [diff] [blame] | 274 | <div *ngSwitchCase="'Success'" id="Success" class="container-fluid"> |
| 275 | <h2>Successfully submitted data.</h2> |
Philipp Schrader | 817cce3 | 2022-03-26 15:00:00 -0700 | [diff] [blame] | 276 | </div> |
Philipp Schrader | 8686bbb | 2023-03-22 20:15:21 -0700 | [diff] [blame] | 277 | |
| 278 | <span class="error_message" role="alert">{{ errorMessage }}</span> |
Philipp Schrader | 8058743 | 2022-03-05 15:41:22 -0800 | [diff] [blame] | 279 | </ng-container> |