Report MPC horizon and drop any cycles at the beginning which are 0
This lets us start firing faster.
Change-Id: Idda068e3b0ca78da6ec5ab422d217d10d9c65e1c
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/y2022/www/field.html b/y2022/www/field.html
index e2a1cf6..f39c1a4 100644
--- a/y2022/www/field.html
+++ b/y2022/www/field.html
@@ -53,7 +53,7 @@
</tr>
<tr>
<td>MPC Active</td>
- <td id="mpc_active"> NA </td>
+ <td id="mpc_horizon"> NA </td>
</tr>
<tr>
<td>Shot Count</td>
diff --git a/y2022/www/field_handler.ts b/y2022/www/field_handler.ts
index 584b65e..0c0bf2c 100644
--- a/y2022/www/field_handler.ts
+++ b/y2022/www/field_handler.ts
@@ -49,8 +49,8 @@
(document.getElementById('fire') as HTMLElement);
private mpcSolveTime: HTMLElement =
(document.getElementById('mpc_solve_time') as HTMLElement);
- private mpcActive: HTMLElement =
- (document.getElementById('mpc_active') as HTMLElement);
+ private mpcHorizon: HTMLElement =
+ (document.getElementById('mpc_horizon') as HTMLElement);
private shotCount: HTMLElement =
(document.getElementById('shot_count') as HTMLElement);
private catapult: HTMLElement =
@@ -326,8 +326,8 @@
this.fire.innerHTML = this.superstructureStatus.fire() ? 'true' : 'false';
- this.mpcActive.innerHTML =
- this.superstructureStatus.mpcActive() ? 'true' : 'false';
+ this.mpcHorizon.innerHTML =
+ this.superstructureStatus.mpcHorizon().toFixed(2);
this.setValue(this.mpcSolveTime, this.superstructureStatus.solveTime());