Retaining checkbox data and sending to flatbuffer
Change-Id: I6fcccd5f15606429b241cd199c445353e8c547cd
Signed-off-by: Milo Lin <100027790@mvla.net>
diff --git a/scouting/webserver/requests/messages/submit_data_scouting.fbs b/scouting/webserver/requests/messages/submit_data_scouting.fbs
index 755e70b..77a4a03 100644
--- a/scouting/webserver/requests/messages/submit_data_scouting.fbs
+++ b/scouting/webserver/requests/messages/submit_data_scouting.fbs
@@ -21,6 +21,11 @@
// The rating that this robot gets for its climbing.
// TODO: Change into an enum to make the different values self-documenting.
climbing:int (id:9);
+ auto_ball_1:bool (id:11);
+ auto_ball_2:bool (id:12);
+ auto_ball_3:bool (id:13);
+ auto_ball_4:bool (id:14);
+ auto_ball_5:bool (id:15);
}
root_type SubmitDataScouting;
diff --git a/scouting/www/entry/entry.component.ts b/scouting/www/entry/entry.component.ts
index aaf23dd..9a4caa6 100644
--- a/scouting/www/entry/entry.component.ts
+++ b/scouting/www/entry/entry.component.ts
@@ -31,6 +31,11 @@
defensePlayedOnScore: number = 0;
defensePlayedScore: number = 0;
level: Level = 'NoAttempt';
+ ball1: boolean = false;
+ ball2: boolean = false;
+ ball3: boolean = false;
+ ball4: boolean = false;
+ ball5: boolean = false;
errorMessage: string = '';
noShow: boolean = false;
neverMoved: boolean = false;
@@ -94,6 +99,12 @@
SubmitDataScouting.addUpperGoalTele(builder, this.teleUpperShotsMade);
SubmitDataScouting.addLowerGoalTele(builder, this.teleLowerShotsMade);
SubmitDataScouting.addDefenseRating(builder, this.defensePlayedScore);
+ SubmitDataScouting.addAutoBall1(builder, this.ball1);
+ SubmitDataScouting.addAutoBall2(builder, this.ball2);
+ SubmitDataScouting.addAutoBall3(builder, this.ball3);
+ SubmitDataScouting.addAutoBall4(builder, this.ball4);
+ SubmitDataScouting.addAutoBall5(builder, this.ball5);
+
// TODO(phil): Add support for defensePlayedOnScore.
// TODO(phil): Fix the Climbing score.
SubmitDataScouting.addClimbing(builder, 1);
diff --git a/scouting/www/entry/entry.ng.html b/scouting/www/entry/entry.ng.html
index a8feaec..f24fea4 100644
--- a/scouting/www/entry/entry.ng.html
+++ b/scouting/www/entry/entry.ng.html
@@ -24,11 +24,11 @@
<img src="/pictures/field/balls.jpeg" alt="Image">
<form>
<!--Choice for each ball location-->
- <input type="checkbox" name="balls" value="1" id="ball-1"><label for="ball-1">Ball 1</label>
- <input type="checkbox" name="balls" value="2" id="ball-2"><label for="ball-2">Ball 2</label><br>
- <input type="checkbox" name="balls" value="3" id="ball-3"><label for="ball-3">Ball 3</label>
- <input type="checkbox" name="balls" value="4" id="ball-4"><label for="ball-4">Ball 4</label><br>
- <input type="checkbox" name="balls" value="5" id="ball-5"><label for="ball-5">Ball 5</label>
+ <input [(ngModel)]=ball1 type="checkbox" name="1ball" value="1" id="ball-1"><label for="ball-1">Ball 1</label>
+ <input [(ngModel)]=ball2 type="checkbox" name="2ball" value="2" id="ball-2"><label for="ball-2">Ball 2</label><br>
+ <input [(ngModel)]=ball3 type="checkbox" name="3ball" value="3" id="ball-3"><label for="ball-3">Ball 3</label>
+ <input [(ngModel)]=ball4 type="checkbox" name="4ball" value="4" id="ball-4"><label for="ball-4">Ball 4</label><br>
+ <input [(ngModel)]=ball5 type="checkbox" name="5ball" value="5" id="ball-5"><label for="ball-5">Ball 5</label>
</form>
</div>
<div class="row">
@@ -157,6 +157,11 @@
<h4>Auto</h4>
<ul>
+ <li>Collected Ball 1: {{ball1}}</li>
+ <li>Collected Ball 2: {{ball2}}</li>
+ <li>Collected Ball 3: {{ball3}}</li>
+ <li>Collected Ball 4: {{ball4}}</li>
+ <li>Collected Ball 5: {{ball5}}</li>
<li>Upper Shots Made: {{autoUpperShotsMade}}</li>
<li>Lower Shots Made: {{autoLowerShotsMade}}</li>
<li>Missed Shots: {{autoShotsMissed}}</li>