Skip to content

Commit

Permalink
Removed Matrix filter
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreySemjonov committed Jun 11, 2020
1 parent 4918437 commit c347d7d
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 22 deletions.
1 change: 1 addition & 0 deletions SCRIPTS/EMU/COMPILE/scripts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local scripts = {
"/SCRIPTS/EMU/pwm.lua",
"/SCRIPTS/EMU/rates.lua",
"/SCRIPTS/EMU/rescue.lua",
"/SCRIPTS/EMU/gpslimit.lua",
"/SCRIPTS/EMU/vtx.lua",
"/SCRIPTS/EMU/x9pre.lua",
"/SCRIPTS/EMU/TELEMETRY/emu.lua",
Expand Down
10 changes: 5 additions & 5 deletions SCRIPTS/EMU/filters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ return {
yMinLimit = 11,
yMaxLimit = 52,
text= {
{ t = "Matrix Filter", x = 2, y = 12, to = SMLSIZE },
{ t = "Notch Q", x = 12, y = 20, to = SMLSIZE },
{ t = "Notch Min", x = 12, y = 28, to = SMLSIZE },
-- { t = "Matrix Filter", x = 2, y = 12, to = SMLSIZE },
-- { t = "Notch Q", x = 12, y = 20, to = SMLSIZE },
-- { t = "Notch Min", x = 12, y = 28, to = SMLSIZE },
{ t = "Gyro Lowpass ", x = 2, y = 36, to = SMLSIZE },
{ t = "Gyro Lowpass 1", x = 12, y = 44, to = SMLSIZE },
{ t = "Filter Type", x = 12, y = 52, to = SMLSIZE },
Expand Down Expand Up @@ -53,8 +53,8 @@ return {
},
fields = {
-- Matrix Filter
{ x = 87, y = 20, min = 0, max = 1000, to = SMLSIZE, vals = { 44, 45 } },
{ x = 87, y = 28, min = 0, max = 1000, to = SMLSIZE, vals = { 46, 47 } },
-- { x = 87, y = 20, min = 0, max = 1000, to = SMLSIZE, vals = { 44, 45 } },
-- { x = 87, y = 28, min = 0, max = 1000, to = SMLSIZE, vals = { 46, 47 } },
-- Gyro Lowpass 1
{ x = 87, y = 52, min = 0, max = 1, to = SMLSIZE, vals = { 30 }, table = { [0] = "PT1", [1] = "BIQUAD" } },
{ x = 87, y = 60, min = 0, max = 16000, to = SMLSIZE, vals = { 18, 19 } },
Expand Down
23 changes: 23 additions & 0 deletions SCRIPTS/EMU/gpslimit.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

return {
read = 256, -- MSP_ALTI_LIMIT
write = 257, -- MSP_SET_ALTI_LIMIT
reboot = true,
eepromWrite = true,
title = "ALT Limit",
minBytes = 9,
text= {
{ t = "Act Alt Limit", x = 2, y = 14, to = SMLSIZE },
{ t = "Alt Limit", x = 10, y = 24, to = SMLSIZE },
{ t = "m", x = 62, y = 24, to = SMLSIZE },

{ t = "Alt Cut Off", x = 10, y = 34, to = SMLSIZE },
{ t = "m", x = 62, y = 34, to = SMLSIZE },

},
fields = {
{ x = 42, y = 14, vals = { 1 }, min = 0, max = 1, to = SMLSIZE, table = { [0] = "OFF", "ON" }, },
{ x = 42, y = 24, vals = { 2, 3 }, min = 1, max = 4000, to = SMLSIZE, },
{ x = 42, y = 34, vals = { 4, 5 }, min = 1, max = 4000, to = SMLSIZE, },
},
}
1 change: 1 addition & 0 deletions SCRIPTS/EMU/horuspre.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ PageFiles =
"IMUF.lua",
"filters.lua",
"vtx.lua",
"gpslimit.lua",
"rescue.lua",
"gpspids.lua",
"pwm.lua",
Expand Down
1 change: 1 addition & 0 deletions SCRIPTS/EMU/nv14pre.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ PageFiles =
"IMUF.lua",
"filters.lua",
"vtx.lua",
"gpslimit.lua",
"rescue.lua",
"gpspids.lua",
"pwm.lua",
Expand Down
9 changes: 4 additions & 5 deletions SCRIPTS/EMU/rescue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
return {
read = 135, -- MSP_GPS_RESCUE
write = 225, -- MSP_SET_GPS_RESCUE
title = "GPS / Rescue",
reboot = false,
eepromWrite = true,
minBytes = 16,
requiredVersion = 1.041,
title = "GPS / Rescue",
minBytes = 16,
text = {

{ t = "Min Sats.", x = 3, y = 10, to=SMLSIZE },
Expand All @@ -22,13 +21,13 @@ return {
{ t = "Max", x = 85, y = 50, to = SMLSIZE },
},
fields = {
{ x = 58, y = 10, min = 0, max = 50, vals = { 16 }, to = SMLSIZE },
{ x = 58, y = 10, min = 0, max = 50, vals = { 16 }, to = SMLSIZE },
{ x = 58, y = 20, min = 0, max = 200, vals = { 1,2 }, to = SMLSIZE },
{ x = 58, y = 30, min = 20, max = 100, vals = { 3,4 }, to = SMLSIZE },
{ x = 58, y = 40, min = 30, max = 500, vals = { 5,6 }, to = SMLSIZE },
{ x = 58, y = 50, min = 30, max =3000, vals = { 7,8 }, to = SMLSIZE },

{ x = 105, y = 10, min = 0, max = 2 , vals = { 15 }, to = SMLSIZE,table = { [0]="OFF","ON","FS_ONLY"}},
{ x = 105, y = 10, min = 0, max = 2 , vals = { 15 }, to = SMLSIZE,table = { [0]="OFF","ON","FS_ONLY"}},
{ x = 105, y = 30, min = 1000, max = 2000, vals = { 9,10 }, to = SMLSIZE },
{ x = 105, y = 40, min = 1000, max = 2000, vals = { 13,14 }, to = SMLSIZE },
{ x = 105, y = 50, min = 1000, max = 2000, vals = { 11,12 }, to = SMLSIZE },
Expand Down
1 change: 1 addition & 0 deletions SCRIPTS/EMU/tangopre.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ PageFiles =
"IMUF.lua",
"filters.lua",
"vtx.lua",
"gpslimit.lua",
"rescue.lua",
"gpspids.lua",
"pwm.lua",
Expand Down
18 changes: 6 additions & 12 deletions SCRIPTS/EMU/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ local requestTimeout = 80 -- 800ms request timeout
local currentPage = 1
local currentLine = 1
local saveTS = 0
local saveTimeout = 0
local saveTimeout = protocol.saveTimeout
local saveRetries = 0
local saveMaxRetries = 0
local saveMaxRetries = protocol.saveMaxRetries
local pageRequested = false
local telemetryScreenActive = false
local menuActive = false
Expand All @@ -34,25 +34,19 @@ local foregroundColor = LINE_COLOR or SOLID

local globalTextOptions = TEXT_COLOR or 0

local function saveSettings(new)
local function saveSettings()
if Page.values then
local payload = Page.values
if Page.preSave then
payload = Page.preSave(Page)
else
payload = {}
for i=1,(Page.outputBytes or #Page.values) do
payload[i] = Page.values[i]
end
end
protocol.mspWrite(Page.write, payload)
saveTS = getTime()
if currentState == pageStatus.saving then
if pageState == pageStatus.saving then
saveRetries = saveRetries + 1
else
currentState = pageStatus.saving
pageState = pageStatus.saving
saveRetries = 0
saveMaxRetries = protocol.saveMaxRetries or 2 -- default 2
saveTimeout = protocol.saveTimeout or 150 -- default 1.5s
end
end
end
Expand Down
1 change: 1 addition & 0 deletions SCRIPTS/EMU/x7pre.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ PageFiles =
"IMUF.lua",
"filters.lua",
"vtx.lua",
"gpslimit.lua",
"rescue.lua",
"gpspids.lua",
"pwm.lua",
Expand Down
1 change: 1 addition & 0 deletions SCRIPTS/EMU/x9pre.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ PageFiles =
"IMUF.lua",
"filters.lua",
"vtx.lua",
"gpslimit.lua",
"rescue.lua",
"gpspids.lua",
"pwm.lua",
Expand Down

0 comments on commit c347d7d

Please sign in to comment.