From fb9fe2c2373e9f2b2a3a5ec630375c40a261d6a5 Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Sat, 29 Jul 2023 23:34:06 -0300 Subject: [PATCH 1/4] fix: :bug: fixes bad request error when getting hudmsg and gamechat data Signed-off-by: Lucas Vieira --- model/gamechat/gamechat.go | 2 +- model/hudmsg/hudmsg.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model/gamechat/gamechat.go b/model/gamechat/gamechat.go index dc49833..d3a103b 100644 --- a/model/gamechat/gamechat.go +++ b/model/gamechat/gamechat.go @@ -26,7 +26,7 @@ func GetURL() string { url = utils.GetBaseURL() url = strings.ReplaceAll(url, "$hostname$", utils.GetHostname()) url = strings.ReplaceAll(url, "$path$", path) - //url += "?lastId=0" + url += "?lastId=0" } return url diff --git a/model/hudmsg/hudmsg.go b/model/hudmsg/hudmsg.go index c4eb304..ec0ca54 100644 --- a/model/hudmsg/hudmsg.go +++ b/model/hudmsg/hudmsg.go @@ -28,7 +28,7 @@ func GetURL() string { url = utils.GetBaseURL() url = strings.ReplaceAll(url, "$hostname$", utils.GetHostname()) url = strings.ReplaceAll(url, "$path$", path) - //url += "?lastEvt=0&lastDmg=0" + url += "?lastEvt=0&lastDmg=0" } return url From f3a5e70a54a867f2fdda72dccc3d18877a4bdefb Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Sun, 30 Jul 2023 00:10:00 -0300 Subject: [PATCH 2/4] chore: updates state model Signed-off-by: Lucas Vieira --- model/state/state.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/model/state/state.go b/model/state/state.go index 68fefca..b05b826 100644 --- a/model/state/state.go +++ b/model/state/state.go @@ -36,6 +36,7 @@ type AircraftState struct { Pitch1 float32 `json:"pitch1"` Thrust1 float32 `json:"thrust1"` Efficiency1 float32 `json:"efficiency1"` + CompressorStage1 float32 `json:"compressorstage1"` // Engine 2 ThrottleEngine2 float32 `json:"throttle2"` @@ -48,6 +49,7 @@ type AircraftState struct { Pitch2 float32 `json:"pitch2"` Thrust2 float32 `json:"thrust2"` Efficiency2 float32 `json:"efficiency2"` + CompressorStage2 float32 `json:"compressorstage2"` // Engine 3 ThrottleEngine3 float32 `json:"throttle3"` @@ -60,6 +62,7 @@ type AircraftState struct { Pitch3 float32 `json:"pitch3"` Thrust3 float32 `json:"thrust3"` Efficiency3 float32 `json:"efficiency3"` + CompressorStage3 float32 `json:"compressorstage3"` // Engine 4 ThrottleEngine4 float32 `json:"throttle4"` @@ -72,6 +75,7 @@ type AircraftState struct { Pitch4 float32 `json:"pitch4"` Thrust4 float32 `json:"thrust4"` Efficiency4 float32 `json:"efficiency4"` + CompressorStage4 float32 `json:"compressorstage4"` } var path string = "state" From fa61789e66e3f242c5cfb8aa86c717f01184097c Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Sun, 30 Jul 2023 00:10:16 -0300 Subject: [PATCH 3/4] chore: :zap: logs time elapsed Signed-off-by: Lucas Vieira --- telemetry/telemetry.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/telemetry/telemetry.go b/telemetry/telemetry.go index 147d3a5..d43c10a 100644 --- a/telemetry/telemetry.go +++ b/telemetry/telemetry.go @@ -3,6 +3,7 @@ package telemetry import ( "fmt" "sync" + "time" "github.com/lucasvmx/WarTelemetry/controller" "github.com/lucasvmx/WarTelemetry/logger" @@ -38,6 +39,8 @@ func Initialize(hostname string) { func getTelemetryData() { + start := time.Now() + for name, callback := range collectors { logger.LogInfo("running task go get %v data", name) wg.Add(1) @@ -45,6 +48,8 @@ func getTelemetryData() { } wg.Wait() + + logger.LogInfo("fetched data in %v", time.Since(start)) } // GetTelemetryData function retrieves all telemetry data From 35fa914ec80ec6093e1f5a7b14efd3ea80b69c6c Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Sat, 29 Jul 2023 22:12:09 -0300 Subject: [PATCH 4/4] chore: :zap: add g acceleration and prop pitch data fix: fixes field name 'AngleOfAttackl' Signed-off-by: Lucas Vieira --- model/indicators/indicators.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/model/indicators/indicators.go b/model/indicators/indicators.go index ac29553..9133a26 100644 --- a/model/indicators/indicators.go +++ b/model/indicators/indicators.go @@ -34,8 +34,10 @@ type Indicators struct { ClockSec float32 `json:"clock_sec"` RpmMin float32 `json:"rpm_min"` RpmMin1 float32 `json:"rpm1_min"` - AngleOfAttacl float32 `json:"aoa"` + GAcceleration float32 `json:"g_meter"` + AngleOfAttack float32 `json:"aoa"` SuperCharger float32 `json:"supercharger"` + PropellerPitch float32 `json:"prop_pitch"` } var path string = "indicators"