Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasvmx committed Jul 30, 2023
2 parents dcd8c66 + 35fa914 commit 2db79f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion model/indicators/indicators.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions model/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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"`
Expand All @@ -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"`
Expand All @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package telemetry
import (
"fmt"
"sync"
"time"

"github.com/lucasvmx/WarTelemetry/controller"
"github.com/lucasvmx/WarTelemetry/logger"
Expand Down Expand Up @@ -38,13 +39,17 @@ 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)
go callback(wg)
}

wg.Wait()

logger.LogInfo("fetched data in %v", time.Since(start))
}

// GetTelemetryData function retrieves all telemetry data
Expand Down

0 comments on commit 2db79f4

Please sign in to comment.