Skip to content

Remove custom page template support #403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/SCRIPTS/BF/CONFIRM/acc_cal.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
local template = loadScript(radio.templateHome.."acc_cal.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand Down
7 changes: 1 addition & 6 deletions src/SCRIPTS/BF/CONFIRM/vtx_tables.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
local template = loadScript(radio.templateHome.."vtx_tables.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand Down
7 changes: 1 addition & 6 deletions src/SCRIPTS/BF/PAGES/failsafe.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
local template = loadScript(radio.templateHome.."failsafe.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand Down
7 changes: 1 addition & 6 deletions src/SCRIPTS/BF/PAGES/filters1.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
local template = loadScript(radio.templateHome.."filters1.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand Down
7 changes: 1 addition & 6 deletions src/SCRIPTS/BF/PAGES/filters2.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
local template = loadScript(radio.templateHome.."filters2.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand Down
7 changes: 1 addition & 6 deletions src/SCRIPTS/BF/PAGES/gpspids.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
local template = loadScript(radio.templateHome.."gpspids.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand Down
7 changes: 1 addition & 6 deletions src/SCRIPTS/BF/PAGES/pid_advanced.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
local template = loadScript(radio.templateHome.."pid_advanced.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand Down
7 changes: 1 addition & 6 deletions src/SCRIPTS/BF/PAGES/pids1.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
local template = loadScript(radio.templateHome.."pids1.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand Down
7 changes: 1 addition & 6 deletions src/SCRIPTS/BF/PAGES/pids2.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
local template = loadScript(radio.templateHome.."pids2.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand Down
7 changes: 1 addition & 6 deletions src/SCRIPTS/BF/PAGES/pwm.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
local template = loadScript(radio.templateHome.."pwm.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand Down
7 changes: 1 addition & 6 deletions src/SCRIPTS/BF/PAGES/rates.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
local template = loadScript(radio.templateHome.."rates.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand Down
7 changes: 1 addition & 6 deletions src/SCRIPTS/BF/PAGES/rescue.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
local template = loadScript(radio.templateHome.."rescue.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand Down
7 changes: 1 addition & 6 deletions src/SCRIPTS/BF/PAGES/rx.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
local template = loadScript(radio.templateHome.."rx.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand Down
7 changes: 1 addition & 6 deletions src/SCRIPTS/BF/PAGES/simplified_tuning.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
local template = loadScript(radio.templateHome.."simplified_pids.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand Down
24 changes: 10 additions & 14 deletions src/SCRIPTS/BF/PAGES/vtx.lua
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
local vtx_tables
if apiVersion >= 1.042 then
vtx_tables = assert(loadScript("/BF/VTX/"..mcuId..".lua"))()
else
vtx_tables = assert(loadScript("/BF/VTX/vtx_defaults.lua"))()
end
local deviceTable = { [1]="6705", [3]="SA", [4]="Tramp", [255]="None" }
local pitModeTable = { [0]="OFF", "ON" }
local template = loadScript(radio.templateHome.."vtx.lua")
if template then
template = template()
else
template = assert(loadScript(radio.templateHome.."default_template.lua"))()
end
local template = assert(loadScript(radio.template))()
local margin = template.margin
local indent = template.indent
local lineSpacing = template.lineSpacing
Expand All @@ -24,6 +11,15 @@ local inc = { x = function(val) x = x + val return x end, y = function(val) y =
local labels = {}
local fields = {}

local vtx_tables
if apiVersion >= 1.042 then
vtx_tables = assert(loadScript("/BF/VTX/"..mcuId..".lua"))()
else
vtx_tables = assert(loadScript("/BF/VTX/vtx_defaults.lua"))()
end
Comment on lines +15 to +19

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be

if apiVersion >= 1.042 then
    vtx_tables = assert(loadScript("/SCRIPTS/BF/VTX_TABLES/"..mcuId..".lua"))()
else
    vtx_tables = assert(loadScript("/SCRIPTS/BF/VTX_TABLES/vtx_defaults.lua"))()
end

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as #401 isn't merged, the vtx tables will still be in /BF/VTX

local deviceTable = { [1]="6705", [3]="SA", [4]="Tramp", [255]="None" }
local pitModeTable = { [0]="OFF", "ON" }

if apiVersion >= 1.036 then
fields[#fields + 1] = { t = "Band", x = x, y = inc.y(lineSpacing), sp = x + sp, min=0, max=#(vtx_tables.bandTable), vals = { 2 }, table = vtx_tables.bandTable, upd = function(self) self.handleBandChanUpdate(self) end }
fields[#fields + 1] = { t = "Channel", x = x, y = inc.y(lineSpacing), sp = x + sp, min=1, max=vtx_tables.frequenciesPerBand, vals = { 3 }, upd = function(self) self.handleBandChanUpdate(self) end }
Expand Down
74 changes: 37 additions & 37 deletions src/SCRIPTS/BF/radios.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ local supportedRadios =
["128x64"] =
{
msp = {
templateHome = "TEMPLATES/128x64/",
MenuBox = { x=15, y=12, w=100, x_offset=36, h_line=8, h_offset=3 },
SaveBox = { x=15, y=12, w=100, x_offset=4, h=30, h_offset=5 },
NoTelem = { 30, 55, "No Telemetry", BLINK },
textSize = SMLSIZE,
yMinLimit = 12,
yMaxLimit = 52,
template = "TEMPLATES/128x64.lua",
MenuBox = { x=15, y=12, w=100, x_offset=36, h_line=8, h_offset=3 },
SaveBox = { x=15, y=12, w=100, x_offset=4, h=30, h_offset=5 },
NoTelem = { 30, 55, "No Telemetry", BLINK },
textSize = SMLSIZE,
yMinLimit = 12,
yMaxLimit = 52,
},
cms = {
rows = 8,
Expand All @@ -30,13 +30,13 @@ local supportedRadios =
["128x96"] =
{
msp = {
templateHome = "TEMPLATES/128x96/",
MenuBox = { x=15, y=12, w=100, x_offset=36, h_line=8, h_offset=3 },
SaveBox = { x=15, y=12, w=100, x_offset=4, h=30, h_offset=5 },
NoTelem = { 30, 87, "No Telemetry", BLINK },
textSize = SMLSIZE,
yMinLimit = 12,
yMaxLimit = 84,
template = "TEMPLATES/128x96.lua",
MenuBox = { x=15, y=12, w=100, x_offset=36, h_line=8, h_offset=3 },
SaveBox = { x=15, y=12, w=100, x_offset=4, h=30, h_offset=5 },
NoTelem = { 30, 87, "No Telemetry", BLINK },
textSize = SMLSIZE,
yMinLimit = 12,
yMaxLimit = 84,
},
cms = {
rows = 12,
Expand All @@ -57,13 +57,13 @@ local supportedRadios =
["212x64"] =
{
msp = {
templateHome = "TEMPLATES/212x64/",
MenuBox = { x=40, y=12, w=120, x_offset=36, h_line=8, h_offset=3 },
SaveBox = { x=40, y=12, w=120, x_offset=4, h=30, h_offset=5 },
NoTelem = { 70, 55, "No Telemetry", BLINK },
textSize = SMLSIZE,
yMinLimit = 12,
yMaxLimit = 52,
template = "TEMPLATES/212x64.lua",
MenuBox = { x=40, y=12, w=120, x_offset=36, h_line=8, h_offset=3 },
SaveBox = { x=40, y=12, w=120, x_offset=4, h=30, h_offset=5 },
NoTelem = { 70, 55, "No Telemetry", BLINK },
textSize = SMLSIZE,
yMinLimit = 12,
yMaxLimit = 52,
},
cms = {
rows = 8,
Expand All @@ -84,14 +84,14 @@ local supportedRadios =
["480x272"] =
{
msp = {
templateHome = "TEMPLATES/480x272/",
highRes = true,
MenuBox = { x=120, y=100, w=200, x_offset=68, h_line=20, h_offset=6 },
SaveBox = { x=120, y=100, w=180, x_offset=12, h=60, h_offset=12 },
NoTelem = { 192, LCD_H - 28, "No Telemetry", (TEXT_COLOR or 0) + INVERS + BLINK },
textSize = 0,
yMinLimit = 35,
yMaxLimit = 235,
template = "TEMPLATES/480x272.lua",
highRes = true,
MenuBox = { x=120, y=100, w=200, x_offset=68, h_line=20, h_offset=6 },
SaveBox = { x=120, y=100, w=180, x_offset=12, h=60, h_offset=12 },
NoTelem = { 192, LCD_H - 28, "No Telemetry", (TEXT_COLOR or 0) + INVERS + BLINK },
textSize = 0,
yMinLimit = 35,
yMaxLimit = 235,
},
cms = {
rows = 9,
Expand All @@ -112,14 +112,14 @@ local supportedRadios =
["320x480"] =
{
msp = {
templateHome = "TEMPLATES/320x480/",
highRes = true,
MenuBox = { x= (LCD_W -200)/2, y=LCD_H/2, w=200, x_offset=68, h_line=20, h_offset=6 },
SaveBox = { x= (LCD_W -200)/2, y=LCD_H/2, w=180, x_offset=12, h=60, h_offset=12 },
NoTelem = { LCD_W/2 - 50, LCD_H - 28, "No Telemetry", (TEXT_COLOR or 0) + INVERS + BLINK },
textSize = 0,
yMinLimit = 35,
yMaxLimit = 435,
template = "TEMPLATES/320x480.lua",
highRes = true,
MenuBox = { x= (LCD_W -200)/2, y=LCD_H/2, w=200, x_offset=68, h_line=20, h_offset=6 },
SaveBox = { x= (LCD_W -200)/2, y=LCD_H/2, w=180, x_offset=12, h=60, h_offset=12 },
NoTelem = { LCD_W/2 - 50, LCD_H - 28, "No Telemetry", (TEXT_COLOR or 0) + INVERS + BLINK },
textSize = 0,
yMinLimit = 35,
yMaxLimit = 435,
},
cms = nil,
},
Expand Down