-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: ⚡ updates indicators and state models
Signed-off-by: Lucas Vieira <[email protected]>
- Loading branch information
Showing
2 changed files
with
70 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,69 @@ | ||
package indicators | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/lucasvmx/WarTelemetry/utils" | ||
) | ||
|
||
// Indicators struct contains data about aircraft indicators | ||
type Indicators struct { | ||
Valid bool `json:"valid"` | ||
AircraftName string `json:"type"` | ||
Speed float32 `json:"speed"` | ||
Pedals float32 `json:"pedals"` | ||
Pedals1 float32 `json:"pedals1"` | ||
Pedals2 float32 `json:"pedals2"` | ||
Pedals3 float32 `json:"pedals3"` | ||
StickElevator float32 `json:"stick_elevator"` | ||
StickElevator1 float32 `json:"stick_elevator1"` | ||
StickAilerons float32 `json:"stick_ailerons"` | ||
Vario float32 `json:"vario"` | ||
AltitudeHour float32 `json:"altitude_hour"` | ||
AltitudeMin float32 `json:"altitude_min"` | ||
Altitude10k float32 `json:"altitude_10k"` | ||
AviaHorizonRoll float32 `json:"aviahorizon_roll"` | ||
AviaHorizonPitch float32 `json:"aviahorizon_pitch"` | ||
Bank float32 `json:"bank"` | ||
Turn float32 `json:"turn"` | ||
Compass float32 `json:"compass"` | ||
Compass1 float32 `json:"compass1"` | ||
Compass2 float32 `json:"compass2"` | ||
ClockHour float32 `json:"clock_hour"` | ||
ClockMin float32 `json:"clock_min"` | ||
ClockSec float32 `json:"clock_sec"` | ||
RpmMin float32 `json:"rpm_min"` | ||
RpmMin1 float32 `json:"rpm1_min"` | ||
GAcceleration float32 `json:"g_meter"` | ||
AngleOfAttack float32 `json:"aoa"` | ||
SuperCharger float32 `json:"supercharger"` | ||
PropellerPitch float32 `json:"prop_pitch"` | ||
} | ||
|
||
var path string = "indicators" | ||
var url string = "" | ||
|
||
func GetURL() string { | ||
if len(url) == 0 { | ||
url = utils.GetBaseURL() | ||
url = strings.ReplaceAll(url, "$hostname$", utils.GetHostname()) | ||
url = strings.ReplaceAll(url, "$path$", path) | ||
} | ||
|
||
return url | ||
} | ||
package indicators | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/lucasvmx/WarTelemetry/utils" | ||
) | ||
|
||
// Indicators struct contains data about aircraft indicators | ||
type Indicators struct { | ||
Valid bool `json:"valid"` | ||
Army string `json:"army"` | ||
AircraftName string `json:"type"` | ||
Speed float32 `json:"speed"` | ||
Pedals float32 `json:"pedals"` | ||
Pedals1 float32 `json:"pedals1"` | ||
Pedals2 float32 `json:"pedals2"` | ||
Pedals3 float32 `json:"pedals3"` | ||
Pedals4 float32 `json:"pedals4"` | ||
StickElevator float32 `json:"stick_elevator"` | ||
StickElevator1 float32 `json:"stick_elevator1"` | ||
StickAilerons float32 `json:"stick_ailerons"` | ||
Vario float32 `json:"vario"` | ||
AltitudeHour float32 `json:"altitude_hour"` | ||
AltitudeMin float32 `json:"altitude_min"` | ||
Altitude10k float32 `json:"altitude_10k"` | ||
AviaHorizonRoll float32 `json:"aviahorizon_roll"` | ||
AviaHorizonPitch float32 `json:"aviahorizon_pitch"` | ||
Bank float32 `json:"bank"` | ||
Turn float32 `json:"turn"` | ||
Compass float32 `json:"compass"` | ||
Compass1 float32 `json:"compass1"` | ||
Compass2 float32 `json:"compass2"` | ||
ClockHour float32 `json:"clock_hour"` | ||
ClockMin float32 `json:"clock_min"` | ||
ClockSec float32 `json:"clock_sec"` | ||
RpmMin float32 `json:"rpm_min"` | ||
RpmMin1 float32 `json:"rpm1_min"` | ||
GAcceleration float32 `json:"g_meter"` | ||
AngleOfAttack float32 `json:"aoa"` | ||
SuperCharger float32 `json:"supercharger"` | ||
PropellerPitch float32 `json:"prop_pitch"` | ||
Vne float32 `json:"vne"` | ||
Weapon1 float32 `json:"weapon1"` | ||
Weapon2 float32 `json:"weapon2"` | ||
Weapon3 float32 `json:"weapon3"` | ||
Weapon4 float32 `json:"weapon4"` | ||
Gears float32 `json:"gears"` | ||
GearLampDown float32 `json:"gear_lamp_down"` | ||
GearLampUp float32 `json:"gear_lamp_up"` | ||
GearLampOff float32 `json:"gear_lamp_off"` | ||
CarbTemperature float32 `json:"carb_temperature"` | ||
AirbrakeLever float64 `json:"airbrake_lever"` | ||
AirbrakeIndicator float64 `json:"airbrake_indicator"` | ||
Trimmer float64 `json:"trimmer"` | ||
} | ||
|
||
var path string = "indicators" | ||
var url string = "" | ||
|
||
func GetURL() string { | ||
if len(url) == 0 { | ||
url = utils.GetBaseURL() | ||
url = strings.ReplaceAll(url, "$hostname$", utils.GetHostname()) | ||
url = strings.ReplaceAll(url, "$path$", path) | ||
} | ||
|
||
return url | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters