From c347d7da964d3cce59403c06de0f0566c2dae2de Mon Sep 17 00:00:00 2001 From: AndreySemjonov <50518855+AndreySemjonov@users.noreply.github.com> Date: Thu, 11 Jun 2020 14:01:23 +0300 Subject: [PATCH] Removed Matrix filter --- SCRIPTS/EMU/COMPILE/scripts.lua | 1 + SCRIPTS/EMU/filters.lua | 10 +++++----- SCRIPTS/EMU/gpslimit.lua | 23 +++++++++++++++++++++++ SCRIPTS/EMU/horuspre.lua | 1 + SCRIPTS/EMU/nv14pre.lua | 1 + SCRIPTS/EMU/rescue.lua | 9 ++++----- SCRIPTS/EMU/tangopre.lua | 1 + SCRIPTS/EMU/ui.lua | 18 ++++++------------ SCRIPTS/EMU/x7pre.lua | 1 + SCRIPTS/EMU/x9pre.lua | 1 + 10 files changed, 44 insertions(+), 22 deletions(-) create mode 100644 SCRIPTS/EMU/gpslimit.lua diff --git a/SCRIPTS/EMU/COMPILE/scripts.lua b/SCRIPTS/EMU/COMPILE/scripts.lua index 6fde6c3..9742b53 100644 --- a/SCRIPTS/EMU/COMPILE/scripts.lua +++ b/SCRIPTS/EMU/COMPILE/scripts.lua @@ -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", diff --git a/SCRIPTS/EMU/filters.lua b/SCRIPTS/EMU/filters.lua index 8580b3b..379f9f4 100644 --- a/SCRIPTS/EMU/filters.lua +++ b/SCRIPTS/EMU/filters.lua @@ -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 }, @@ -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 } }, diff --git a/SCRIPTS/EMU/gpslimit.lua b/SCRIPTS/EMU/gpslimit.lua new file mode 100644 index 0000000..193803c --- /dev/null +++ b/SCRIPTS/EMU/gpslimit.lua @@ -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, }, + }, +} \ No newline at end of file diff --git a/SCRIPTS/EMU/horuspre.lua b/SCRIPTS/EMU/horuspre.lua index c71d79b..6608d5c 100644 --- a/SCRIPTS/EMU/horuspre.lua +++ b/SCRIPTS/EMU/horuspre.lua @@ -6,6 +6,7 @@ PageFiles = "IMUF.lua", "filters.lua", "vtx.lua", + "gpslimit.lua", "rescue.lua", "gpspids.lua", "pwm.lua", diff --git a/SCRIPTS/EMU/nv14pre.lua b/SCRIPTS/EMU/nv14pre.lua index 96c9744..a9f55d2 100644 --- a/SCRIPTS/EMU/nv14pre.lua +++ b/SCRIPTS/EMU/nv14pre.lua @@ -6,6 +6,7 @@ PageFiles = "IMUF.lua", "filters.lua", "vtx.lua", + "gpslimit.lua", "rescue.lua", "gpspids.lua", "pwm.lua", diff --git a/SCRIPTS/EMU/rescue.lua b/SCRIPTS/EMU/rescue.lua index ca5623a..c4ec700 100644 --- a/SCRIPTS/EMU/rescue.lua +++ b/SCRIPTS/EMU/rescue.lua @@ -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 }, @@ -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 }, diff --git a/SCRIPTS/EMU/tangopre.lua b/SCRIPTS/EMU/tangopre.lua index 63c7683..2338792 100644 --- a/SCRIPTS/EMU/tangopre.lua +++ b/SCRIPTS/EMU/tangopre.lua @@ -6,6 +6,7 @@ PageFiles = "IMUF.lua", "filters.lua", "vtx.lua", + "gpslimit.lua", "rescue.lua", "gpspids.lua", "pwm.lua", diff --git a/SCRIPTS/EMU/ui.lua b/SCRIPTS/EMU/ui.lua index e5d2e0b..29cc073 100644 --- a/SCRIPTS/EMU/ui.lua +++ b/SCRIPTS/EMU/ui.lua @@ -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 @@ -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 diff --git a/SCRIPTS/EMU/x7pre.lua b/SCRIPTS/EMU/x7pre.lua index 63c7683..2338792 100644 --- a/SCRIPTS/EMU/x7pre.lua +++ b/SCRIPTS/EMU/x7pre.lua @@ -6,6 +6,7 @@ PageFiles = "IMUF.lua", "filters.lua", "vtx.lua", + "gpslimit.lua", "rescue.lua", "gpspids.lua", "pwm.lua", diff --git a/SCRIPTS/EMU/x9pre.lua b/SCRIPTS/EMU/x9pre.lua index 9dfb2d0..132ee57 100644 --- a/SCRIPTS/EMU/x9pre.lua +++ b/SCRIPTS/EMU/x9pre.lua @@ -6,6 +6,7 @@ PageFiles = "IMUF.lua", "filters.lua", "vtx.lua", + "gpslimit.lua", "rescue.lua", "gpspids.lua", "pwm.lua",