|
1 |
| -package indicators |
2 |
| - |
3 |
| -import ( |
4 |
| - "strings" |
5 |
| - |
6 |
| - "github.com/lucasvmx/WarTelemetry/utils" |
7 |
| -) |
8 |
| - |
9 |
| -// Indicators struct contains data about aircraft indicators |
10 |
| -type Indicators struct { |
11 |
| - Valid bool `json:"valid"` |
12 |
| - AircraftName string `json:"type"` |
13 |
| - Speed float32 `json:"speed"` |
14 |
| - Pedals float32 `json:"pedals"` |
15 |
| - Pedals1 float32 `json:"pedals1"` |
16 |
| - Pedals2 float32 `json:"pedals2"` |
17 |
| - Pedals3 float32 `json:"pedals3"` |
18 |
| - StickElevator float32 `json:"stick_elevator"` |
19 |
| - StickElevator1 float32 `json:"stick_elevator1"` |
20 |
| - StickAilerons float32 `json:"stick_ailerons"` |
21 |
| - Vario float32 `json:"vario"` |
22 |
| - AltitudeHour float32 `json:"altitude_hour"` |
23 |
| - AltitudeMin float32 `json:"altitude_min"` |
24 |
| - Altitude10k float32 `json:"altitude_10k"` |
25 |
| - AviaHorizonRoll float32 `json:"aviahorizon_roll"` |
26 |
| - AviaHorizonPitch float32 `json:"aviahorizon_pitch"` |
27 |
| - Bank float32 `json:"bank"` |
28 |
| - Turn float32 `json:"turn"` |
29 |
| - Compass float32 `json:"compass"` |
30 |
| - Compass1 float32 `json:"compass1"` |
31 |
| - Compass2 float32 `json:"compass2"` |
32 |
| - ClockHour float32 `json:"clock_hour"` |
33 |
| - ClockMin float32 `json:"clock_min"` |
34 |
| - ClockSec float32 `json:"clock_sec"` |
35 |
| - RpmMin float32 `json:"rpm_min"` |
36 |
| - RpmMin1 float32 `json:"rpm1_min"` |
37 |
| - GAcceleration float32 `json:"g_meter"` |
38 |
| - AngleOfAttack float32 `json:"aoa"` |
39 |
| - SuperCharger float32 `json:"supercharger"` |
40 |
| - PropellerPitch float32 `json:"prop_pitch"` |
41 |
| -} |
42 |
| - |
43 |
| -var path string = "indicators" |
44 |
| -var url string = "" |
45 |
| - |
46 |
| -func GetURL() string { |
47 |
| - if len(url) == 0 { |
48 |
| - url = utils.GetBaseURL() |
49 |
| - url = strings.ReplaceAll(url, "$hostname$", utils.GetHostname()) |
50 |
| - url = strings.ReplaceAll(url, "$path$", path) |
51 |
| - } |
52 |
| - |
53 |
| - return url |
54 |
| -} |
| 1 | +package indicators |
| 2 | + |
| 3 | +import ( |
| 4 | + "strings" |
| 5 | + |
| 6 | + "github.com/lucasvmx/WarTelemetry/utils" |
| 7 | +) |
| 8 | + |
| 9 | +// Indicators struct contains data about aircraft indicators |
| 10 | +type Indicators struct { |
| 11 | + Valid bool `json:"valid"` |
| 12 | + Army string `json:"army"` |
| 13 | + AircraftName string `json:"type"` |
| 14 | + Speed float32 `json:"speed"` |
| 15 | + Pedals float32 `json:"pedals"` |
| 16 | + Pedals1 float32 `json:"pedals1"` |
| 17 | + Pedals2 float32 `json:"pedals2"` |
| 18 | + Pedals3 float32 `json:"pedals3"` |
| 19 | + Pedals4 float32 `json:"pedals4"` |
| 20 | + StickElevator float32 `json:"stick_elevator"` |
| 21 | + StickElevator1 float32 `json:"stick_elevator1"` |
| 22 | + StickAilerons float32 `json:"stick_ailerons"` |
| 23 | + Vario float32 `json:"vario"` |
| 24 | + AltitudeHour float32 `json:"altitude_hour"` |
| 25 | + AltitudeMin float32 `json:"altitude_min"` |
| 26 | + Altitude10k float32 `json:"altitude_10k"` |
| 27 | + AviaHorizonRoll float32 `json:"aviahorizon_roll"` |
| 28 | + AviaHorizonPitch float32 `json:"aviahorizon_pitch"` |
| 29 | + Bank float32 `json:"bank"` |
| 30 | + Turn float32 `json:"turn"` |
| 31 | + Compass float32 `json:"compass"` |
| 32 | + Compass1 float32 `json:"compass1"` |
| 33 | + Compass2 float32 `json:"compass2"` |
| 34 | + ClockHour float32 `json:"clock_hour"` |
| 35 | + ClockMin float32 `json:"clock_min"` |
| 36 | + ClockSec float32 `json:"clock_sec"` |
| 37 | + RpmMin float32 `json:"rpm_min"` |
| 38 | + RpmMin1 float32 `json:"rpm1_min"` |
| 39 | + GAcceleration float32 `json:"g_meter"` |
| 40 | + AngleOfAttack float32 `json:"aoa"` |
| 41 | + SuperCharger float32 `json:"supercharger"` |
| 42 | + PropellerPitch float32 `json:"prop_pitch"` |
| 43 | + Vne float32 `json:"vne"` |
| 44 | + Weapon1 float32 `json:"weapon1"` |
| 45 | + Weapon2 float32 `json:"weapon2"` |
| 46 | + Weapon3 float32 `json:"weapon3"` |
| 47 | + Weapon4 float32 `json:"weapon4"` |
| 48 | + Gears float32 `json:"gears"` |
| 49 | + GearLampDown float32 `json:"gear_lamp_down"` |
| 50 | + GearLampUp float32 `json:"gear_lamp_up"` |
| 51 | + GearLampOff float32 `json:"gear_lamp_off"` |
| 52 | + CarbTemperature float32 `json:"carb_temperature"` |
| 53 | + AirbrakeLever float64 `json:"airbrake_lever"` |
| 54 | + AirbrakeIndicator float64 `json:"airbrake_indicator"` |
| 55 | + Trimmer float64 `json:"trimmer"` |
| 56 | +} |
| 57 | + |
| 58 | +var path string = "indicators" |
| 59 | +var url string = "" |
| 60 | + |
| 61 | +func GetURL() string { |
| 62 | + if len(url) == 0 { |
| 63 | + url = utils.GetBaseURL() |
| 64 | + url = strings.ReplaceAll(url, "$hostname$", utils.GetHostname()) |
| 65 | + url = strings.ReplaceAll(url, "$path$", path) |
| 66 | + } |
| 67 | + |
| 68 | + return url |
| 69 | +} |
0 commit comments