From 50fcdb170a1538f39ceae9cd415f3f438f38bac5 Mon Sep 17 00:00:00 2001 From: Filippo Date: Wed, 2 Oct 2024 17:11:20 +0200 Subject: [PATCH] feat: add mongodb adaptors --- proto/mongodb/lapcounter_lap_records.proto | 38 ++++++++++++++++++++++ proto/mongodb/lapcounter_lap_times.proto | 21 ++++++++++++ proto/mongodb/lapcounter_layout.proto | 25 ++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 proto/mongodb/lapcounter_lap_records.proto create mode 100644 proto/mongodb/lapcounter_lap_times.proto create mode 100644 proto/mongodb/lapcounter_layout.proto diff --git a/proto/mongodb/lapcounter_lap_records.proto b/proto/mongodb/lapcounter_lap_records.proto new file mode 100644 index 0000000..9a55b32 --- /dev/null +++ b/proto/mongodb/lapcounter_lap_records.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +package MongoDb; + +message LapRecord +{ + string driver = 1; + uint64 start = 2; + uint64 end = 3; + repeated uint64 sectors = 4; +} + +message SectorsRecord +{ + string driver = 1; + uint64 start_time_sector = 2; + uint64 end_time_sector = 3; +} + +message DriverRecord +{ + string driver = 1; + LapRecord best_lap = 2; + repeated SectorsRecord best_sectors = 3; +} + +message LapRecords +{ + int32 version = 2; + int32 baseline_version = 3; + string vehicle_id = 4; + string device_id = 5; + string location = 6; + string layout = 7; + LapRecord best_lap = 8; + repeated SectorsRecord best_sectors = 9; + repeated DriverRecord drivers_records = 10; +} diff --git a/proto/mongodb/lapcounter_lap_times.proto b/proto/mongodb/lapcounter_lap_times.proto new file mode 100644 index 0000000..8b8fa49 --- /dev/null +++ b/proto/mongodb/lapcounter_lap_times.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package MongoDb; + +message LapTime { + uint64 number = 1; + uint64 start_timestamp = 2; + uint64 end_timestamp = 3; + repeated uint64 sectors = 4; +} + +message LapTimes { + int32 version = 2; + int32 baseline_version = 3; + string vehicle_id = 4; + string device_id = 5; + string location = 6; + string layout = 7; + string driver = 8; + repeated LapTime times = 9; +} diff --git a/proto/mongodb/lapcounter_layout.proto b/proto/mongodb/lapcounter_layout.proto new file mode 100644 index 0000000..beed933 --- /dev/null +++ b/proto/mongodb/lapcounter_layout.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package MongoDb; + +message Vec2 { + int32 x = 1; + int32 y = 2; +} + +message PositionAndDirection { + Vec2 position = 1; + Vec2 direction = 2; +} + +message Layout { + int32 version = 2; + int32 baseline_version = 3; + string vehicle_id = 4; + string device_id = 5; + string location = 6; + string layout = 7; + PositionAndDirection start_line = 8; + PositionAndDirection finish_line = 9; + repeated PositionAndDirection sectors = 10; +}