scouting: Fix types for action timestamps and cycle times
Since we measure in nanoseconds (to be in line with what the robot
code does) we need a bigger type than `int32`. This patch changes
these fields to be `int64` instead.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: Ibffc37e74b333ae12330ab1c4fedd34879113a9d
diff --git a/scouting/www/entry/entry.component.ts b/scouting/www/entry/entry.component.ts
index 44fc958..aef97f7 100644
--- a/scouting/www/entry/entry.component.ts
+++ b/scouting/www/entry/entry.component.ts
@@ -118,7 +118,6 @@
matchStartTimestamp: number = 0;
addAction(action: ActionT): void {
- action.timestamp = Math.floor(Date.now() / 1000);
if (action.type == 'startMatchAction') {
// Unix nanosecond timestamp.
this.matchStartTimestamp = Date.now() * 1e6;
@@ -193,7 +192,7 @@
StartMatchAction.createStartMatchAction(builder, action.position);
actionOffset = Action.createAction(
builder,
- action.timestamp || 0,
+ BigInt(action.timestamp || 0),
ActionType.StartMatchAction,
startMatchActionOffset
);
@@ -208,7 +207,7 @@
);
actionOffset = Action.createAction(
builder,
- action.timestamp || 0,
+ BigInt(action.timestamp || 0),
ActionType.PickupObjectAction,
pickupObjectActionOffset
);
@@ -223,7 +222,7 @@
);
actionOffset = Action.createAction(
builder,
- action.timestamp || 0,
+ BigInt(action.timestamp || 0),
ActionType.AutoBalanceAction,
autoBalanceActionOffset
);
@@ -239,7 +238,7 @@
);
actionOffset = Action.createAction(
builder,
- action.timestamp || 0,
+ BigInt(action.timestamp || 0),
ActionType.PlaceObjectAction,
placeObjectActionOffset
);
@@ -250,7 +249,7 @@
RobotDeathAction.createRobotDeathAction(builder, action.robotOn);
actionOffset = Action.createAction(
builder,
- action.timestamp || 0,
+ BigInt(action.timestamp || 0),
ActionType.RobotDeathAction,
robotDeathActionOffset
);
@@ -264,7 +263,7 @@
);
actionOffset = Action.createAction(
builder,
- action.timestamp || 0,
+ BigInt(action.timestamp || 0),
ActionType.EndMatchAction,
endMatchActionOffset
);