Skip to content

Commit b35f777

Browse files
committed
Updated flight path vector to follow horizon, made it a config option, updated language files
1 parent ab185e6 commit b35f777

File tree

12 files changed

+143
-143
lines changed

12 files changed

+143
-143
lines changed

Diff for: dist/SCRIPTS/TELEMETRY/iNav/config.luac

-4 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/horus.luac

171 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/lang_de.luac

191 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/lang_es.luac

170 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/lang_fr.luac

152 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/menu.luac

-46 Bytes
Binary file not shown.

Diff for: src/iNav/config.lua

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ local config = {
1616
{ o = 10, c = 1, v = 1 }, -- Altitude Alert - 12
1717
{ o = 12, c = 1, v = 1, x = 3 }, -- Timer - 13
1818
{ o = 14, c = 1, v = 1 }, -- Rx Voltage - 14
19-
{ o = 33, c = 1, v = 0, x = 0 }, -- GPS - 15
20-
{ o = 32, c = 1, v = 0 }, -- GPS Coordinates - 16
19+
{ o = 28, c = 1, v = 0 }, -- Flight Path Vector - 15
20+
{ o = 33, c = 1, v = 0 }, -- GPS - 16
2121
{ o = 9, c = 2, v = 20, x = 40 }, -- Fuel Critical - 17
2222
{ o = 8, c = 2, v = 30, x = 50 }, -- Fuel Low - 18
2323
{ o = 13, c = 1, v = SMLCD and 1 or 2, x = SMLCD and 1 or 2 }, -- Tx Voltage - 19
2424
{ o = 24, c = 1, v = 0 }, -- Speed Sensor - 20
25-
{ o = 31, c = 2, v = 3.5, d = true, x = 5.0 }, -- GPS Warning - 21
26-
{ o = 30, c = 1, v = 0 }, -- GPS HDOP View - 22
25+
{ o = 32, c = 2, v = 3.5, d = true, x = 5.0 }, -- GPS Warning - 21
26+
{ o = 31, c = 1, v = 0 }, -- GPS HDOP View - 22
2727
{ o = 6, c = 1, v = 0, x = 2 }, -- Fuel Unit - 23
2828
{ o = 16, c = 1, v = 3, x = 9 }, -- Vario Steps - 24
2929
{ o = 25, c = 1, v = 0, x = 3 }, -- View Mode - 25
@@ -32,8 +32,8 @@ local config = {
3232
{ o = 17, c = 1, v = 0, x = 6 }, -- Altitude Graph - 28
3333
{ o = 5, c = 2, v = 4.3, d = true, x = 4.5 }, -- Cell Calculation - 29
3434
{ o = 27, c = 1, v = 0, x = 5 }, -- Aircraft Symbol - 30
35-
{ o = 28, c = 1, v = 0 }, -- Center Map Home - 31
36-
{ o = 29, c = 1, v = 0 }, -- Orientation - 32
35+
{ o = 29, c = 1, v = 0 }, -- Center Map Home - 31
36+
{ o = 30, c = 1, v = 0 }, -- Orientation - 32
3737
{ o = 26, c = 1, v = 0 }, -- Roll Scale - 33
3838
}
3939

Diff for: src/iNav/horus.lua

+11-8
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ local function view(data, config, modes, units, labels, gpsDegMin, hdopGraph, ic
6060
local xd = sin(roll1) * r
6161
local yd = cos(roll1) * r
6262
local x1, y1, x2, y2 = x - xd, y + yd, x + xd, y - yd
63-
if (y1 > top2 or y2 > top2) and (y1 < bot2 or y2 < bot2) and y1 >= 0 and y2 >= 0 then
63+
if (y1 > top2 or y2 > top2) and (y1 < bot2 or y2 < bot2) and x1 >= 0 and x2 >= 0 then
6464
color(CUSTOM_COLOR, r == 20 and WHITE or LIGHTGREY)
6565
line(x1, y1, x2, y2, SOLID, CUSTOM_COLOR)
6666
if r == 20 and y1 > top2 and y1 < bot2 then
@@ -244,10 +244,6 @@ local function view(data, config, modes, units, labels, gpsDegMin, hdopGraph, ic
244244
end
245245
end
246246
if not data.showMax then
247-
--[[ Adds a shadow to the pitch
248-
color(CUSTOM_COLOR, BLACK)
249-
text(X_CNTR - 64, Y_CNTR - 8, fmt("%.0f", upsideDown and -tmp or tmp) .. "\64", SMLSIZE + RIGHT + CUSTOM_COLOR)
250-
]]
251247
text(X_CNTR - 65, Y_CNTR - 9, fmt("%.0f", upsideDown and -tmp or tmp) .. "\64", SMLSIZE + RIGHT)
252248
end
253249
end
@@ -318,11 +314,18 @@ local function view(data, config, modes, units, labels, gpsDegMin, hdopGraph, ic
318314
end
319315
end
320316
-- Flight path vector
321-
if data.crsf and data.fpv_id > -1 and data.speed >= 8 then
317+
if data.crsf and data.fpv_id > -1 and config[15].v == 1 and data.speed >= 8 then
322318
tmp = (data.fpv - data.heading + 360) % 360
323319
if tmp >= 302 or tmp <= 57 then
324-
local fpv = floor(((data.fpv - data.heading + (361 + HEADING_DEG / 2)) % 360) * PIXEL_DEG - 10.5)
325-
bmap(icons.fpv, fpv, Y_CNTR - 16)
320+
local fpv = floor(((data.fpv - data.heading + (361 + HEADING_DEG / 2)) % 360) * PIXEL_DEG - 0.5)
321+
local r = fpv - X_CNTR -- Adjust from center
322+
local adj = pitch - 90 -- Pitch degrees, change to climb/descend vector
323+
local p = sin(rad(adj)) * 170
324+
local x = (X_CNTR - cos(roll1) * p) + (sin(roll1) * r) - 9
325+
local y = ((Y_CNTR - cos(rad(pitch)) * 170) - sin(roll1) * p) - (cos(roll1) * r) - 6
326+
if y > top2 and y < bot2 and x >= 0 then
327+
bmap(icons.fpv, x, y)
328+
end
326329
end
327330
end
328331
end

Diff for: src/iNav/lang_de.lua

+45-45
Original file line numberDiff line numberDiff line change
@@ -16,71 +16,71 @@ modes[12].t = " ! GAS ! " -- ! THROT !
1616
--modes[13].t = " CRUISE" -- CRUISE
1717

1818
-- Max 10 characters
19-
labels[1] = "Kapazitaet"-- Fuel
20-
labels[2] = "Batterie" -- Battery
19+
labels[1] = "Kapazitaet" -- Fuel
20+
labels[2] = "Batterie" -- Battery
2121
labels[3] = "Strom" -- Current
2222
labels[4] = "Hoehe" -- Altitude
23-
labels[5] = "Entfernung"-- Distance
23+
labels[5] = "Entfernung" -- Distance
2424

2525
local function lang(config2)
2626
-- Max 16 characters
27-
config2[1].t = "Batterie" -- Battery View
27+
config2[1].t = "Batterie" -- Battery View
2828
config2[2].t = "Zelle Niedrig" -- Cell Low
29-
config2[3].t = "Zelle Kritisch" -- Cell Critical
29+
config2[3].t = "Zelle Kritisch" -- Cell Critical
3030
config2[4].t = "Sprach Alarme" -- Voice Alerts
31-
config2[5].t = "Meldungen" -- Feedback
32-
config2[6].t = "Max Hoehe" -- Max Altitude
31+
config2[5].t = "Meldungen" -- Feedback
32+
config2[6].t = "Max Hoehe" -- Max Altitude
3333
--config2[7].t = "Variometer" -- Variometer
3434
config2[8].t = "RTH Meldung" -- RTH Feedback
35-
config2[9].t = "HeadFree Meld." -- HeadFree Feedback
35+
config2[9].t = "HeadFree Meld." -- HeadFree Feedback
3636
config2[10].t = "RSSI Meldung" -- RSSI Feedback
3737
config2[11].t = "Bat. Warnung" -- Battery Alert
38-
config2[12].t = "Hoehen Warnung" -- Altitude Alert
39-
--config2[13].t = "Timer" -- Timer
40-
config2[14].t = "Rx Spng." -- Rx Voltage
41-
--config2[15].t = "GPS" -- GPS
42-
config2[16].t = "GPS Koordi." -- GPS Coordinates
38+
config2[12].t = "Hoehen Warnung" -- Altitude Alert
39+
--config2[13].t = "Timer" -- Timer
40+
config2[14].t = "Rx Spng." -- Rx Voltage
41+
config2[15].t = "Flugpfad-Vektor" -- Flight Path Vector
42+
--config2[16].t = "GPS" -- GPS
4343
config2[17].t = "Kapaz. Kritisch" -- Fuel Critical
44-
config2[18].t = "Kapaz. Niedrig" -- Fuel Low
45-
config2[19].t = "Tx Spng." -- Tx Voltage
46-
config2[20].t = "Geschw. Sensor" -- Speed Sensor
44+
config2[18].t = "Kapaz. Niedrig" -- Fuel Low
45+
config2[19].t = "Tx Spng." -- Tx Voltage
46+
config2[20].t = "Geschw. Sensor" -- Speed Sensor
4747
config2[21].t = "GPS Warnung" -- GPS Warning
48-
config2[22].t = "GPS HDOP" -- GPS HDOP View
49-
config2[23].t = "Kapazitaet" -- Fuel Unit
50-
config2[24].t = "Vario Schritte" -- Vario Steps
48+
config2[22].t = "GPS HDOP" -- GPS HDOP View
49+
config2[23].t = "Kapazitaet" -- Fuel Unit
50+
config2[24].t = "Vario Schritte" -- Vario Steps
5151
config2[25].t = "Ansichtsmodus" -- View Mode
52-
config2[26].t = "AlH Cntr Meld." -- AltHold Center FB
52+
config2[26].t = "AlH Cntr Meld." -- AltHold Center FB
5353
config2[27].t = "Bat. Kapazitaet" -- Battery Capacity
5454
config2[28].t = "Hoehenkurve" -- Altitude Graph
5555
config2[29].t = "Zellenberechnung" -- Cell Calculation
56-
--config2[30].t = "Aircraft Symbol" -- Aircraft Symbol
57-
--config2[31].t = "Center Map" -- Center Map Home
58-
--config2[32].t = "Orientation" -- Orientation
59-
--config2[33].t = "Roll Scale" -- Roll Scale
56+
config2[30].t = "Flugzeug-Symbol" -- Aircraft Symbol
57+
config2[31].t = "Karte Zentrieren" -- Center Map Home
58+
config2[32].t = "Orientierung" -- Orientation
59+
config2[33].t = "Rollenwaage" -- Roll Scale
6060

6161
-- Max 8 characters
62-
config2[1].l = {[0] = "Zelle", "Total"} -- "Cell", "Total"
63-
config2[4].l = {[0] = "Aus", "Kritisch", "Alle"} -- "Off", "Critical", "All"
64-
config2[5].l = {[0] = "Aus", "Haptisch", "Pieper", "Alle"} -- "Off", "Haptic", "Beeper", "All"
65-
config2[7].l = {[0] = "Aus", "Graph", "Stimme", "Beides"} -- "Off", "Graph", "Voice", "Both"
66-
config2[8].l = {[0] = "Aus", "An"} -- "Off", "On"
67-
config2[9].l = {[0] = "Aus", "An"} -- "Off", "On"
68-
config2[10].l = {[0] = "Aus", "An"} -- "Off", "On"
69-
config2[11].l = {[0] = "Aus", "Kritisch", "Alle"} -- "Off", "Critical", "All"
70-
config2[12].l = {[0] = "Aus", "An"} -- "Off", "On"
71-
config2[13].l = {[0] = "Aus", "Auto", "Timer1", "Timer2"} -- "Off", "Auto", "Timer1", "Timer2"
72-
config2[14].l = {[0] = "Aus", "An"} -- "Off", "On"
73-
config2[16].l = {[0] = "Dezimal", "Grad"} -- "Decimal", "Deg/Min"
74-
config2[19].l = {[0] = "Nummer", "Graph", "Beide"} -- "Number", "Graph", "Both"
75-
--config2[20].l = {[0] = "GPS", "Pitot"} -- "GPS", "Pitot"
76-
config2[22].l = {[0] = "Graph", "Dezimal"} -- "Graph", "Decimal"
77-
--config2[23].l = {[0] = "Percent", "mAh", "mWh"} -- "Percent", "mAh", "mWh"
62+
config2[1].l = {[0] = "Zelle", "Total"} -- "Cell", "Total"
63+
config2[4].l = {[0] = "Aus", "Kritisch", "Alle"} -- "Off", "Critical", "All"
64+
config2[5].l = {[0] = "Aus", "Haptisch", "Pieper", "Alle"} -- "Off", "Haptic", "Beeper", "All"
65+
config2[7].l = {[0] = "Aus", "Graph", "Stimme", "Beides"} -- "Off", "Graph", "Voice", "Both"
66+
config2[8].l = {[0] = "Aus", "An"} -- "Off", "On"
67+
config2[9].l = {[0] = "Aus", "An"} -- "Off", "On"
68+
config2[10].l = {[0] = "Aus", "An"} -- "Off", "On"
69+
config2[11].l = {[0] = "Aus", "Kritisch", "Alle"} -- "Off", "Critical", "All"
70+
config2[12].l = {[0] = "Aus", "An"} -- "Off", "On"
71+
config2[13].l = {[0] = "Aus", "Auto", "Timer1", "Timer2"} -- "Off", "Auto", "Timer1", "Timer2"
72+
config2[14].l = {[0] = "Aus", "An"} -- "Off", "On"
73+
config2[16].l = {[0] = "Dezimal", "Grad"} -- "Decimal", "Deg/Min"
74+
config2[19].l = {[0] = "Nummer", "Graph", "Beide"} -- "Number", "Graph", "Both"
75+
--config2[20].l = {[0] = "GPS", "Pitot"} -- "GPS", "Pitot"
76+
config2[22].l = {[0] = "Graph", "Dezimal"} -- "Graph", "Decimal"
77+
--config2[23].l = {[0] = "Percent", "mAh", "mWh"} -- "Percent", "mAh", "mWh"
7878
config2[25].l = {[0] = "Original", "Pilot", "Radar", "Hoehe"} -- "Classic", "Pilot", "Radar", "Altitude"
79-
config2[26].l = {[0] = "Aus", "An"} -- "Off", "On"
80-
config2[28].l[0] = "Aus" -- "Off"
81-
config2[31].l = {[0] = "Aus", "An"} -- "Off", "On"
82-
--config2[32].l = {[0] = "Launch", "Compass"} -- "Launch", "Compass"
83-
config2[33].l = {[0] = "Aus", "An"} -- "Off", "On"
79+
config2[26].l = {[0] = "Aus", "An"} -- "Off", "On"
80+
config2[28].l[0] = "Aus" -- "Off"
81+
config2[31].l = {[0] = "Aus", "An"} -- "Off", "On"
82+
config2[32].l = {[0] = "Starten", "Kompass"} -- "Launch", "Compass"
83+
config2[33].l = {[0] = "Aus", "An"} -- "Off", "On"
8484
end
8585

8686
return lang

Diff for: src/iNav/lang_es.lua

+47-47
Original file line numberDiff line numberDiff line change
@@ -16,71 +16,71 @@ modes[12].t = " ! GAS ! " -- ! THROT !
1616
--modes[13].t = " CRUISE" -- CRUISE
1717

1818
-- Max 10 characters
19-
labels[1] = "Bateria" -- Fuel
20-
labels[2] = "Tension" -- Battery
21-
labels[3] = "Consumo" -- Current
22-
labels[4] = "Altitud" -- Altitude
23-
labels[5] = "Distancia" -- Distance
19+
labels[1] = "Bateria" -- Fuel
20+
labels[2] = "Tension" -- Battery
21+
labels[3] = "Consumo" -- Current
22+
labels[4] = "Altitud" -- Altitude
23+
labels[5] = "Distancia" -- Distance
2424

2525
local function lang(config2)
2626
-- Max 16 characters
27-
config2[1].t = "Bateria" -- Battery View
28-
config2[2].t = "Celda baja" -- Cell Low
27+
config2[1].t = "Bateria" -- Battery View
28+
config2[2].t = "Celda baja" -- Cell Low
2929
config2[3].t = "Celda Critica" -- Cell Critical
3030
config2[4].t = "Alerta Voces" -- Voice Alerts
31-
--config2[5].t = "Feedback" -- Feedback
32-
config2[6].t = "Max Altura" -- Max Altitude
33-
config2[7].t = "Variometro" -- Variometer
34-
--config2[8].t = "RTH Feedback" -- RTH Feedback
35-
--config2[9].t = "HeadFree Feedback"-- HeadFree Feedback
31+
--config2[5].t = "Feedback" -- Feedback
32+
config2[6].t = "Max Altura" -- Max Altitude
33+
config2[7].t = "Variometro" -- Variometer
34+
--config2[8].t = "RTH Feedback" -- RTH Feedback
35+
--config2[9].t = "HeadFree Feedback" -- HeadFree Feedback
3636
--config2[10].t = "RSSI Feedback" -- RSSI Feedback
37-
config2[11].t = "Bateria Alerta" -- Battery Alert
38-
config2[12].t = "Altitud Alerta" -- Altitude Alert
39-
--config2[13].t = "Timer" -- Timer
40-
config2[14].t = "Rx Voltaje" -- Rx Voltage
41-
--config2[15].t = "GPS" -- GPS
42-
config2[16].t = "Coordenadas GPS" -- GPS Coordinates
37+
config2[11].t = "Bateria Alerta" -- Battery Alert
38+
config2[12].t = "Altitud Alerta" -- Altitude Alert
39+
--config2[13].t = "Timer" -- Timer
40+
config2[14].t = "Rx Voltaje" -- Rx Voltage
41+
config2[15].t = "Vuelo Ruta Vector" -- Flight Path Vector
42+
--config2[16].t = "GPS" -- GPS
4343
config2[17].t = "Bateria Critica" -- Fuel Critical
4444
config2[18].t = "Bateria Baja" -- Fuel Low
45-
config2[19].t = "Tx Voltaje" -- Tx Voltage
45+
config2[19].t = "Tx Voltaje" -- Tx Voltage
4646
config2[20].t = "Sensor Velocidad" -- Speed Sensor
47-
config2[21].t = "GPS Aviso" -- GPS Warning
48-
config2[22].t = "GPS HDOP" -- GPS HDOP View
49-
config2[23].t = "Capacidad" -- Fuel Unit
47+
config2[21].t = "GPS Aviso" -- GPS Warning
48+
config2[22].t = "GPS HDOP" -- GPS HDOP View
49+
config2[23].t = "Capacidad" -- Fuel Unit
5050
config2[24].t = "Vario Pasos" -- Vario Steps
51-
config2[25].t = "Vista" -- View Mode
51+
config2[25].t = "Vista" -- View Mode
5252
config2[26].t = "AlH Centrado FB." -- AltHold Center FB
5353
config2[27].t = "Capacidad Bateria" -- Battery Capacity
54-
config2[28].t = "Grafico Altura" -- Altitude Graph
54+
config2[28].t = "Grafico Altura" -- Altitude Graph
5555
config2[29].t = "Calculo Celda" -- Cell Calculation
56-
--config2[30].t = "Aircraft Symbol" -- Aircraft Symbol
57-
--config2[31].t = "Center Map" -- Center Map Home
58-
--config2[32].t = "Orientation" -- Orientation
56+
config2[30].t = "Simbolo Aeronave" -- Aircraft Symbol
57+
config2[31].t = "Mapa del Centro" -- Center Map Home
58+
config2[32].t = "Orientacion" -- Orientation
5959
--config2[33].t = "Roll Scale" -- Roll Scale
6060

6161
-- Max 8 characters
62-
--config2[1].l = {[0] = "Cell", "Total"} -- "Cell", "Total"
63-
config2[4].l = {[0] = "Off", "Critico", "Todo"} -- "Off", "Critical", "All"
64-
config2[5].l = {[0] = "Off", "Haptic", "Beeper", "Todo"} -- "Off", "Haptic", "Beeper", "All"
65-
config2[7].l = {[0] = "Off", "Grafico", "Voz", "Ambos"} -- "Off", "Graph", "Voice", "Both"
66-
--config2[8].l = {[0] = "Off", "On"} -- "Off", "On"
67-
--config2[9].l = {[0] = "Off", "On"} -- "Off", "On"
68-
--config2[10].l = {[0] = "Off", "On"} -- "Off", "On"
69-
config2[11].l = {[0] = "Off", "Critico", "Todo"} -- "Off", "Critical", "All"
70-
--config2[12].l = {[0] = "Off", "On"} -- "Off", "On"
62+
--config2[1].l = {[0] = "Cell", "Total"} -- "Cell", "Total"
63+
config2[4].l = {[0] = "Off", "Critico", "Todo"} -- "Off", "Critical", "All"
64+
config2[5].l = {[0] = "Off", "Haptic", "Beeper", "Todo"} -- "Off", "Haptic", "Beeper", "All"
65+
config2[7].l = {[0] = "Off", "Grafico", "Voz", "Ambos"} -- "Off", "Graph", "Voice", "Both"
66+
--config2[8].l = {[0] = "Off", "On"} -- "Off", "On"
67+
--config2[9].l = {[0] = "Off", "On"} -- "Off", "On"
68+
--config2[10].l = {[0] = "Off", "On"} -- "Off", "On"
69+
config2[11].l = {[0] = "Off", "Critico", "Todo"} -- "Off", "Critical", "All"
70+
--config2[12].l = {[0] = "Off", "On"} -- "Off", "On"
7171
--config2[13].l = {[0] = "Off", "Auto", "Timer1", "Timer2"} -- "Off", "Auto", "Timer1", "Timer2"
72-
--config2[14].l = {[0] = "Off", "On"} -- "Off", "On"
73-
config2[16].l = {[0] = "Decimal", "Grados"} -- "Decimal", "Deg/Min"
74-
config2[19].l = {[0] = "Numero", "Grafico", "Ambos"} -- "Number", "Graph", "Both"
75-
--config2[20].l = {[0] = "GPS", "Pitot"} -- "GPS", "Pitot"
76-
config2[22].l = {[0] = "Grafico", "Decimal"} -- "Graph", "Decimal"
77-
--config2[23].l = {[0] = "Percent", "mAh", "mWh"} -- "Percent", "mAh", "mWh"
72+
--config2[14].l = {[0] = "Off", "On"} -- "Off", "On"
73+
config2[16].l = {[0] = "Decimal", "Grados"} -- "Decimal", "Deg/Min"
74+
config2[19].l = {[0] = "Numero", "Grafico", "Ambos"} -- "Number", "Graph", "Both"
75+
--config2[20].l = {[0] = "GPS", "Pitot"} -- "GPS", "Pitot"
76+
config2[22].l = {[0] = "Grafico", "Decimal"} -- "Graph", "Decimal"
77+
--config2[23].l = {[0] = "Percent", "mAh", "mWh"} -- "Percent", "mAh", "mWh"
7878
config2[25].l = {[0] = "Clasica", "Pilot", "Radar", "Altitud"} -- "Classic", "Pilot", "Radar", "Altitude"
79-
--config2[26].l = {[0] = "Off", "On"} -- "Off", "On"
80-
--config2[28].l[0] = "Off" -- "Off"
81-
--config2[31].l = {[0] = "Off", "On"} -- "Off", "On"
82-
--config2[32].l = {[0] = "Launch", "Compass"} -- "Launch", "Compass"
83-
--config2[33].l = {[0] = "Off", "On"} -- "Off", "On"
79+
--config2[26].l = {[0] = "Off", "On"} -- "Off", "On"
80+
--config2[28].l[0] = "Off" -- "Off"
81+
--config2[31].l = {[0] = "Off", "On"} -- "Off", "On"
82+
config2[32].l = {[0] = "Brazo", "Brujula"} -- "Launch", "Compass"
83+
--config2[33].l = {[0] = "Off", "On"} -- "Off", "On"
8484
end
8585

8686
return lang

0 commit comments

Comments
 (0)