Skip to content

Commit 29c29e0

Browse files
committed
update other vtx.lua files.
1 parent 4d86d0e commit 29c29e0

File tree

4 files changed

+74
-66
lines changed

4 files changed

+74
-66
lines changed

src/BF/VTX/vtx_defaults.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ frequencyTable = {
77
}
88
frequenciesPerBand = 8
99
bandTable = { [0]="U", "A", "B", "E", "F", "R" }
10-
deviceTable = { [1]="6705",[3]="SA",[4]="Tramp",[255]="None"}
10+
deviceTable = { [1]="6705", [3]="SA", [4]="Tramp", [255]="None" }
1111
pitModeTable = { [0]="OFF", "ON" }

src/SCRIPTS/BF/HORUS/vtx.lua

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
assert(loadScript("/BF/VTX/vtx_defaults.lua"))()
2+
local md = model.getInfo();
3+
vtx_tables = loadScript("/BF/VTX/"..md.name..".lua")
4+
if (vtx_tables ~= nil) then
5+
vtx_tables()
6+
end
7+
-- Vals Fields
8+
-- 1 Device Type Band
9+
-- 2 Band Channel
10+
-- 3 Channel Power
11+
-- 4 Power Pit
12+
-- 5 Pit Device Type
13+
-- 6 Freq Frequency
114

215
return {
316
read = 88, -- MSP_VTX_CONFIG
@@ -20,34 +33,14 @@ return {
2033
{ t = "Freq", x = 232, y = 68 },
2134
},
2235
fields = {
23-
-- Band
24-
{ x = 130, y = 110, min=0, max=5, vals = { 2 }, to = MIDSIZE,
25-
table = { [0]="U", "A", "B", "E", "F", "R" },
26-
upd = function(self) self.handleBandChanUpdate(self) end },
27-
-- Channel
28-
{ x = 130, y = 155, min=1, max=8, vals = { 3 }, to = MIDSIZE,
29-
upd = function(self) self.handleBandChanUpdate(self) end },
30-
-- Power
31-
{ x = 350, y = 110, min=1, vals = { 4 }, to = MIDSIZE,
32-
upd = function(self) self.updatePowerTable(self) end },
33-
-- Pit mode
34-
{ x = 350, y = 155, min=0, max=1, vals = { 5 }, to = MIDSIZE,
35-
table = { [0]="OFF", "ON" } },
36-
-- Proto
37-
{ x = 130, y = 68, vals = { 1 }, to = MIDSIZE,
38-
write = false, ro = true,
39-
table = { [1]="RTC6705",[3]="SmartAudio",[4]="Tramp",[255]="None"} },
40-
-- Freq
41-
{ x = 350, y = 68, min = 5000, max = 5999, vals = { 6 }, to = MIDSIZE,
42-
upd = function(self) self.handleFreqValUpdate(self) end },
43-
},
44-
freqLookup = {
45-
{ 5865, 5845, 5825, 5805, 5785, 5765, 5745, 5725 }, -- Boscam A
46-
{ 5733, 5752, 5771, 5790, 5809, 5828, 5847, 5866 }, -- Boscam B
47-
{ 5705, 5685, 5665, 5645, 5885, 5905, 5925, 5945 }, -- Boscam E
48-
{ 5740, 5760, 5780, 5800, 5820, 5840, 5860, 5880 }, -- FatShark
49-
{ 5658, 5695, 5732, 5769, 5806, 5843, 5880, 5917 }, -- RaceBand
36+
{ x = 130, y = 110, min=0, max=#(bandTable), vals = { 2 }, to = MIDSIZE, table = bandTable, upd = function(self) self.handleBandChanUpdate(self) end },
37+
{ x = 130, y = 155, min=1, max=frequenciesPerBand, vals = { 3 }, to = MIDSIZE, upd = function(self) self.handleBandChanUpdate(self) end },
38+
{ x = 350, y = 110, min=1, vals = { 4 }, to = MIDSIZE, upd = function(self) self.updatePowerTable(self) end },
39+
{ x = 350, y = 155, min=0, max=#(pitModeTable), vals = { 5 }, to = MIDSIZE, table = pitModeTable },
40+
{ x = 130, y = 68, vals = { 1 }, to = MIDSIZE, write = false, ro = true, table = deviceTable },
41+
{ x = 350, y = 68, min = 5000, max = 5999, vals = { 6 }, to = MIDSIZE, upd = function(self) self.handleFreqValUpdate(self) end },
5042
},
43+
freqLookup = frequencyTable,
5144
postLoad = function (self)
5245
if (self.values[2] or 0) < 0 or (self.values[3] or 0) == 0 or (self.values[4] or 0) == 0 then
5346
self.values = {}
@@ -191,6 +184,10 @@ return {
191184
end,
192185
updatePowerTable = function(self)
193186
if self.values and not self.fields[3].table then
187+
if powerTable then
188+
self.fields[3].table = powerTable
189+
self.fields[3].max = #(powerTable)
190+
else
194191
if self.values[1] == 1 then -- RTC6705
195192
self.fields[3].table = { 25, 200 }
196193
self.fields[3].max = 2
@@ -208,6 +205,7 @@ return {
208205
self.fields[3].table = { [1]="" }
209206
self.fields[4].t = nil -- don't display Pit field
210207
self.fields[4].table = { [0]="", "" }
208+
end
211209
end
212210
end
213211
end,

src/SCRIPTS/BF/NV14/vtx.lua

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
assert(loadScript("/BF/VTX/vtx_defaults.lua"))()
2+
local md = model.getInfo();
3+
vtx_tables = loadScript("/BF/VTX/"..md.name..".lua")
4+
if (vtx_tables ~= nil) then
5+
vtx_tables()
6+
end
7+
-- Vals Fields
8+
-- 1 Device Type Band
9+
-- 2 Band Channel
10+
-- 3 Channel Power
11+
-- 4 Power Pit
12+
-- 5 Pit Device Type
13+
-- 6 Freq Frequency
114

215
return {
316
read = 88, -- MSP_VTX_CONFIG
@@ -20,34 +33,14 @@ return {
2033
{ t = "Freq", x = 36, y = 110 },
2134
},
2235
fields = {
23-
-- Band
24-
{ x = 150, y = 155, min=0, max=5, vals = { 2 }, to = MIDSIZE,
25-
table = { [0]="U", "A", "B", "E", "F", "R" },
26-
upd = function(self) self.handleBandChanUpdate(self) end },
27-
-- Channel
28-
{ x = 150, y = 200, min=1, max=8, vals = { 3 }, to = MIDSIZE,
29-
upd = function(self) self.handleBandChanUpdate(self) end },
30-
-- Power
31-
{ x = 150, y = 242, min=1, vals = { 4 }, to = MIDSIZE,
32-
upd = function(self) self.updatePowerTable(self) end },
33-
-- Pit mode
34-
{ x = 150, y = 284, min=0, max=1, vals = { 5 }, to = MIDSIZE,
35-
table = { [0]="OFF", "ON" } },
36-
-- Proto
37-
{ x = 150, y = 68, vals = { 1 }, to = MIDSIZE,
38-
write = false, ro = true,
39-
table = { [1]="RTC6705",[3]="SmartAudio",[4]="Tramp",[255]="None"} },
40-
-- Freq
41-
{ x = 150, y = 110, min = 5000, max = 5999, vals = { 6 }, to = MIDSIZE,
42-
upd = function(self) self.handleFreqValUpdate(self) end },
43-
},
44-
freqLookup = {
45-
{ 5865, 5845, 5825, 5805, 5785, 5765, 5745, 5725 }, -- Boscam A
46-
{ 5733, 5752, 5771, 5790, 5809, 5828, 5847, 5866 }, -- Boscam B
47-
{ 5705, 5685, 5665, 5645, 5885, 5905, 5925, 5945 }, -- Boscam E
48-
{ 5740, 5760, 5780, 5800, 5820, 5840, 5860, 5880 }, -- FatShark
49-
{ 5658, 5695, 5732, 5769, 5806, 5843, 5880, 5917 }, -- RaceBand
36+
{ x = 150, y = 155, min=0, max=#(bandTable), vals = { 2 }, to = MIDSIZE, table = bandTable, upd = function(self) self.handleBandChanUpdate(self) end },
37+
{ x = 150, y = 200, min=1, max=frequenciesPerBand, vals = { 3 }, to = MIDSIZE, upd = function(self) self.handleBandChanUpdate(self) end },
38+
{ x = 150, y = 242, min=1, vals = { 4 }, to = MIDSIZE, upd = function(self) self.updatePowerTable(self) end },
39+
{ x = 150, y = 284, min=0, max=#(pitModeTable), vals = { 5 }, to = MIDSIZE, table = pitModeTable },
40+
{ x = 150, y = 68, vals = { 1 }, to = MIDSIZE, write = false, ro = true, table = deviceTable},
41+
{ x = 150, y = 110, min = 5000, max = 5999, vals = { 6 }, to = MIDSIZE, upd = function(self) self.handleFreqValUpdate(self) end },
5042
},
43+
freqLookup = frequencyTable,
5144
postLoad = function (self)
5245
if (self.values[2] or 0) < 0 or (self.values[3] or 0) == 0 or (self.values[4] or 0) == 0 then
5346
self.values = {}
@@ -191,6 +184,10 @@ return {
191184
end,
192185
updatePowerTable = function(self)
193186
if self.values and not self.fields[3].table then
187+
if powerTable then
188+
self.fields[3].table = powerTable
189+
self.fields[3].max = #(powerTable)
190+
else
194191
if self.values[1] == 1 then -- RTC6705
195192
self.fields[3].table = { 25, 200 }
196193
self.fields[3].max = 2
@@ -208,6 +205,7 @@ return {
208205
self.fields[3].table = { [1]="" }
209206
self.fields[4].t = nil -- don't display Pit field
210207
self.fields[4].table = { [0]="", "" }
208+
end
211209
end
212210
end
213211
end,

src/SCRIPTS/BF/X9/vtx.lua

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
assert(loadScript("/BF/VTX/vtx_defaults.lua"))()
2+
local md = model.getInfo();
3+
vtx_tables = loadScript("/BF/VTX/"..md.name..".lua")
4+
if (vtx_tables ~= nil) then
5+
vtx_tables()
6+
end
7+
-- Vals Fields
8+
-- 1 Device Type Band
9+
-- 2 Band Channel
10+
-- 3 Channel Power
11+
-- 4 Power Pit
12+
-- 5 Pit Device Type
13+
-- 6 Freq Frequency
114

215
return {
316
read = 88, -- MSP_VTX_CONFIG
@@ -13,20 +26,14 @@ return {
1326
freqModCounter = 0,
1427
text = {},
1528
fields = {
16-
{ t = "Band", x = 25, y = 14, sp = 50, min=0, max=5, vals = { 2 }, to = SMLSIZE, table = { [0]="U", "A", "B", "E", "F", "R" }, upd = function(self) self.handleBandChanUpdate(self) end },
17-
{ t = "Channel", x = 25, y = 24, sp = 50, min=1, max=8, vals = { 3 }, to = SMLSIZE, upd = function(self) self.handleBandChanUpdate(self) end },
29+
{ t = "Band", x = 25, y = 14, sp = 50, min=0, max=#(bandTable), vals = { 2 }, to = SMLSIZE, table = bandTable, upd = function(self) self.handleBandChanUpdate(self) end },
30+
{ t = "Channel", x = 25, y = 24, sp = 50, min=1, max=frequenciesPerBand, vals = { 3 }, to = SMLSIZE, upd = function(self) self.handleBandChanUpdate(self) end },
1831
{ t = "Power", x = 25, y = 34, sp = 50, min=1, vals = { 4 }, to = SMLSIZE, upd = function(self) self.updatePowerTable(self) end },
19-
{ t = "Pit", x = 25, y = 44, sp = 50, min=0, max=1, vals = { 5 }, to = SMLSIZE, table = { [0]="OFF", "ON" } },
20-
{ t = "Dev", x = 100, y = 14, sp = 32, write = false, ro = true, vals = { 1 }, to = SMLSIZE, table = { [1]="RTC6705",[3]="SmartAudio",[4]="Tramp",[255]="None"} },
32+
{ t = "Pit", x = 25, y = 44, sp = 50, min=0, max=#(pitModeTable), vals = { 5 }, to = SMLSIZE, table = pitModeTable },
33+
{ t = "Dev", x = 100, y = 14, sp = 32, write = false, ro = true, vals = { 1 }, to = SMLSIZE, table = deviceTable },
2134
{ t = "Freq", x = 100, y = 24, sp = 32, min = 5000, max = 5999, vals = { 6 }, to = SMLSIZE, upd = function(self) self.handleFreqValUpdate(self) end },
2235
},
23-
freqLookup = {
24-
{ 5865, 5845, 5825, 5805, 5785, 5765, 5745, 5725 }, -- Boscam A
25-
{ 5733, 5752, 5771, 5790, 5809, 5828, 5847, 5866 }, -- Boscam B
26-
{ 5705, 5685, 5665, 5645, 5885, 5905, 5925, 5945 }, -- Boscam E
27-
{ 5740, 5760, 5780, 5800, 5820, 5840, 5860, 5880 }, -- FatShark
28-
{ 5658, 5695, 5732, 5769, 5806, 5843, 5880, 5917 }, -- RaceBand
29-
},
36+
freqLookup = frequencyTable,
3037
postLoad = function (self)
3138
if (self.values[2] or 0) < 0 or (self.values[3] or 0) == 0 or (self.values[4] or 0) == 0 then
3239
self.values = {}
@@ -170,6 +177,10 @@ return {
170177
end,
171178
updatePowerTable = function(self)
172179
if self.values and not self.fields[3].table then
180+
if powerTable then
181+
self.fields[3].table = powerTable
182+
self.fields[3].max = #(powerTable)
183+
else
173184
if self.values[1] == 1 then -- RTC6705
174185
self.fields[3].table = { 25, 200 }
175186
self.fields[3].max = 2
@@ -187,6 +198,7 @@ return {
187198
self.fields[3].table = { [1]="" }
188199
self.fields[4].t = nil -- don't display Pit field
189200
self.fields[4].table = { [0]="", "" }
201+
end
190202
end
191203
end
192204
end,

0 commit comments

Comments
 (0)