diff --git a/src/SCRIPTS/BF/HORUS/filters.lua b/src/SCRIPTS/BF/HORUS/filters.lua deleted file mode 100644 index 71fc95fb..00000000 --- a/src/SCRIPTS/BF/HORUS/filters.lua +++ /dev/null @@ -1,95 +0,0 @@ -return { - read = 92, -- MSP_FILTER_CONFIG - write = 93, -- MSP_SET_FILTER_CONFIG - eepromWrite = true, - reboot = false, - title = "Filters", - minBytes = 37, - outputBytes = 37, - yMinLimit = 35, - yMaxLimit = 215, - text= { - { t = "Gyro Lowpass 1 Dynamic", x = 5, y = 35 }, - { t = "Min Cutoff", x = 35, y = 55, to = SMLSIZE }, - { t = "Max Cutoff", x = 35, y = 75, to = SMLSIZE }, - { t = "Filter Type", x = 35, y = 95, to = SMLSIZE }, - - { t = "Gyro Lowpass 1", x = 5, y = 115 }, - { t = "Cutoff", x = 35, y = 135, to = SMLSIZE }, - { t = "Filter Type", x = 35, y = 155, to = SMLSIZE }, - - { t = "Gyro Lowpass 2", x = 5, y = 175 }, - { t = "Cutoff", x = 35, y = 195, to = SMLSIZE }, - { t = "Filter Type", x = 35, y = 215, to = SMLSIZE }, - - { t = "Gyro Notch 1", x = 5, y = 235 }, - { t = "Center", x = 35, y = 255, to = SMLSIZE }, - { t = "Cutoff", x = 35, y = 275, to = SMLSIZE }, - - { t = "Gyro Notch 2", x = 5, y = 295 }, - { t = "Center", x = 35, y = 315, to = SMLSIZE }, - { t = "Cutoff", x = 35, y = 335, to = SMLSIZE }, - - { t = "D Term Lowpass 1 Dynamic", x = 5, y = 355 }, - { t = "Min Cutoff", x = 35, y = 375, to = SMLSIZE }, - { t = "Max Cutoff", x = 35, y = 395, to = SMLSIZE }, - { t = "Filter Type", x = 35, y = 415, to = SMLSIZE }, - - { t = "D Term Lowpass 1", x = 5, y = 435 }, - { t = "Cutoff", x = 35, y = 455, to = SMLSIZE }, - { t = "Filter Type", x = 35, y = 475, to = SMLSIZE }, - - { t = "D Term Lowpass 2", x = 5, y = 495 }, - { t = "Cutoff", x = 35, y = 515, to = SMLSIZE }, - { t = "Filter Type", x = 35, y = 535, to = SMLSIZE }, - - { t = "D Term Notch", x = 5, y = 555 }, - { t = "Center", x = 35, y = 575, to = SMLSIZE }, - { t = "Cutoff", x = 35, y = 595, to = SMLSIZE }, - - { t = "Yaw Lowpass", x = 5, y = 615 }, - { t = "Cutoff", x = 35, y = 635, to = SMLSIZE }, - }, - fields = { - -- Gyro Lowpass 1 Dynamic - { x = 200, y = 55, min = 0, max = 1000, vals = { 30, 31 } }, - { x = 200, y = 75, min = 0, max = 1000, vals = { 32, 33 } }, - { x = 200, y = 95, min = 0, max = 1, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- Gyro Lowpass 1 - { x = 200, y = 135, min = 0, max = 16000, vals = { 21, 22 } }, - { x = 200, y = 155, min = 0, max = 1, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- Gyro Lowpass 2 - { x = 200, y = 195, min = 0, max = 16000, vals = { 23, 24 } }, - { x = 200, y = 215, min = 0, max = 1, vals = { 26 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- Gyro Notch 1 - { x = 200, y = 255, min = 0, max = 16000, vals = { 6, 7 } }, - { x = 200, y = 275, min = 0, max = 16000, vals = { 8, 9 } }, - - -- Gyro Notch 2 - { x = 200, y = 315, min = 0, max = 16000, vals = { 14, 15 } }, - { x = 200, y = 335, min = 0, max = 16000, vals = { 16, 17 } }, - - -- D Term Lowpass 1 Dynamic - { x = 200, y = 375, min = 0, max = 1000, vals = { 34, 35 } }, - { x = 200, y = 395, min = 0, max = 1000, vals = { 36, 37 } }, - { x = 200, y = 415, min = 0, max = 1, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- D Term Lowpass 1 - { x = 200, y = 455, min = 0, max = 16000, vals = { 2, 3 } }, - { x = 200, y = 475, min = 0, max = 1, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- D Term Lowpass 2 - { x = 200, y = 515, min = 0, max = 16000, vals = { 27, 28 } }, - { x = 200, y = 535, min = 0, max = 1, vals = { 29 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- D Term Notch - { x = 200, y = 575, min = 0, max = 16000, vals = { 10, 11 } }, - { x = 200, y = 595, min = 0, max = 16000, vals = { 12, 13 } }, - - -- Yaw Lowpass - { x = 200, y = 635, min = 0, max = 500, vals = { 4, 5 } }, - } -} diff --git a/src/SCRIPTS/BF/HORUS/gpspids.lua b/src/SCRIPTS/BF/HORUS/gpspids.lua deleted file mode 100644 index 4678143a..00000000 --- a/src/SCRIPTS/BF/HORUS/gpspids.lua +++ /dev/null @@ -1,29 +0,0 @@ -return { - read = 136, -- MSP_GPS_RESCUE_PIDS - write = 226, -- MSP_SET_GPS_RESCUE_PIDS - title = "GPS Rescue / PIDs", - reboot = false, - eepromWrite = true, - minBytes = 14, - requiredVersion = 1.041, - text = { - { t = "P", x = 142, y = 48, to = MIDSIZE }, - { t = "I", x = 244, y = 48, to = MIDSIZE }, - { t = "D", x = 342, y = 48, to = MIDSIZE }, - { t = "Throttle", x = 28, y = 100 }, - { t = "Velocity", x = 28, y = 150 }, - { t = "Yaw" , x = 28, y = 200 }, - }, - fields = { - -- P - { x = 140, y = 100, min = 0, max = 200, vals = { 1, 3 }, to = MIDSIZE }, - { x = 140, y = 150, min = 0, max = 200, vals = { 7, 8 }, to = MIDSIZE }, - { x = 140, y = 200, min = 0, max = 500, vals = {13,14 }, to = MIDSIZE }, - -- I - { x = 240, y = 100, min = 0, max = 200, vals = { 3, 4 }, to = MIDSIZE }, - { x = 240, y = 150, min = 0, max = 200, vals = { 9,10 }, to = MIDSIZE }, - -- D - { x = 340, y = 100, min = 0, max = 200, vals = { 5, 6 }, to = MIDSIZE }, - { x = 340, y = 150, min = 0, max = 200, vals = { 11,12 }, to = MIDSIZE }, - }, -} diff --git a/src/SCRIPTS/BF/HORUS/horuspre.lua b/src/SCRIPTS/BF/HORUS/horuspre.lua deleted file mode 100644 index 1102279d..00000000 --- a/src/SCRIPTS/BF/HORUS/horuspre.lua +++ /dev/null @@ -1,17 +0,0 @@ -PageFiles = -{ - { title = "PIDs 1", script = "pids1.lua"}, - { title = "PIDs 2", script = "pids2.lua"}, - { title = "Rates", script = "rates.lua"}, - { title = "Advanced PIDs", script = "pid_advanced.lua"}, - { title = "Filters", script = "filters.lua"}, - { title = "vTX Settings", script = "vtx.lua"}, - { title = "Gyro / Motor", script = "pwm.lua"}, - { title = "Rx", script = "rx.lua"}, - { title = "GPS Rescue", script = "rescue.lua", requiredVersion = 1.041}, - { title = "GPS PIDs", script = "gpspids.lua", requiredVersion = 1.041}, -} - -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 + INVERS + BLINK } diff --git a/src/SCRIPTS/BF/HORUS/pid_advanced.lua b/src/SCRIPTS/BF/HORUS/pid_advanced.lua deleted file mode 100644 index 1421dfb4..00000000 --- a/src/SCRIPTS/BF/HORUS/pid_advanced.lua +++ /dev/null @@ -1,48 +0,0 @@ -return { - read = 94, -- MSP_PID_ADVANCED - write = 95, -- MSP_SET_PID_ADVANCED - title = "PID Advanced", - reboot = false, - eepromWrite = true, - minBytes = 46, - outputBytes = 46, - yMinLimit = 35, - yMaxLimit = 215, - text = { - { t = "Acro Trainer", x = 5, y = 35 }, - { t = "Angle Limit", x = 15, y = 55, to = SMLSIZE }, - - { t = "Throttle Boost", x = 5, y = 75 }, - { t = "Absolute Control", x = 5, y = 95 }, - { t = "I Term Rotation", x = 5, y = 115 }, - { t = "VBAT Compensation", x = 5, y = 135 }, - - { t = "I Term Relax", x = 5, y = 155 }, - { t = "Axes", x = 15, y = 175, to = SMLSIZE }, - { t = "Type", x = 15, y = 195, to = SMLSIZE }, - - { t = "Integrated Yaw", x = 5, y = 215 }, - - { t = "Anti Gravity", x = 5, y = 235 }, - { t = "Mode", x = 15, y = 255, to = SMLSIZE }, - { t = "Gain", x = 15, y = 275, to = SMLSIZE }, - { t = "Threshold", x = 15, y = 295, to = SMLSIZE }, - }, - fields = { - { x = 200, y = 55, min = 20, max = 80, vals = { 32 } }, - - { x = 200, y = 75, min = 0, max = 100, vals = { 31 } }, - { x = 200, y = 95, min = 0, max = 20, vals = { 30 } }, - { x = 200, y = 115, min = 0, max = 1, vals = { 26 }, table = { [0]="OFF", "ON" } }, - { x = 200, y = 135, min = 0, max = 1, vals = { 8 }, table = { [0]="OFF", "ON" } }, - - { x = 200, y = 175, min = 0, max = 4, vals = { 28 }, table = { [0]="NONE", "RP", "RPY", "RP (increment only)", "RPY (increment only)" } }, - { x = 200, y = 195, min = 0, max = 1, vals = { 29 }, table = { [0]="Gyro", "Setpoint" } }, - - { x = 200, y = 215, min = 0, max = 1, vals = { 45 }, table = { [0]="OFF", "ON" } }, - - { x = 200, y = 255, min = 0, max = 1, vals = { 39 }, table = { [0]="Smooth", "Step" } }, - { x = 200, y = 275, min = 1000, max = 30000, vals = { 22, 23 }, scale = 1000, mult = 100 }, - { x = 200, y = 295, min = 20, max = 1000, vals = { 20, 21 } }, - } -} diff --git a/src/SCRIPTS/BF/HORUS/pids1.lua b/src/SCRIPTS/BF/HORUS/pids1.lua deleted file mode 100644 index 263c2615..00000000 --- a/src/SCRIPTS/BF/HORUS/pids1.lua +++ /dev/null @@ -1,31 +0,0 @@ - -return { - read = 112, -- MSP_PID - write = 202, -- MSP_SET_PID - title = "PIDs (1/2)", - reboot = false, - eepromWrite = true, - minBytes = 9, - text = { - { t = "P", x = 142, y = 48, to = MIDSIZE }, - { t = "I", x = 244, y = 48, to = MIDSIZE }, - { t = "D", x = 342, y = 48, to = MIDSIZE }, - { t = "ROLL", x = 28, y = 100 }, - { t = "PITCH", x = 28, y = 150 }, - { t = "YAW", x = 28, y = 200 }, - }, - fields = { - -- P - { x = 140, y = 100, min = 0, max = 200, vals = { 1 }, to = MIDSIZE }, - { x = 140, y = 150, min = 0, max = 200, vals = { 4 }, to = MIDSIZE }, - { x = 140, y = 200, min = 0, max = 200, vals = { 7 }, to = MIDSIZE }, - -- I - { x = 240, y = 100, min = 0, max = 200, vals = { 2 }, to = MIDSIZE }, - { x = 240, y = 150, min = 0, max = 200, vals = { 5 }, to = MIDSIZE }, - { x = 240, y = 200, min = 0, max = 200, vals = { 8 }, to = MIDSIZE }, - -- D - { x = 340, y = 100, min = 0, max = 200, vals = { 3 }, to = MIDSIZE }, - { x = 340, y = 150, min = 0, max = 200, vals = { 6 }, to = MIDSIZE }, - { x = 340, y = 200, min = 0, max = 200, vals = { 9 }, to = MIDSIZE }, - }, -} diff --git a/src/SCRIPTS/BF/HORUS/pids2.lua b/src/SCRIPTS/BF/HORUS/pids2.lua deleted file mode 100644 index 8d3aaa19..00000000 --- a/src/SCRIPTS/BF/HORUS/pids2.lua +++ /dev/null @@ -1,44 +0,0 @@ - -return { - read = 94, -- MSP_PID_ADVANCED - write = 95, -- MSP_SET_PID_ADVANCED - title = "PIDs (2/2)", - reboot = false, - eepromWrite = true, - minBytes = 44, - text = { - { t = "Feed", x = 97, y = 52 }, - { t = "forward", x = 82, y = 70 }, - { t = "D", x = 207, y = 52 }, - { t = "Min", x = 202, y = 70 }, - { t = "ROLL", x = 28, y = 100 }, - { t = "PITCH", x = 28, y = 150 }, - { t = "YAW", x = 28, y = 200 }, - - { t = "Feedforward", x = 290, y = 100 }, - { t = "Transition", x = 300, y = 120, to = SMLSIZE }, - { t = "D Min", x = 290, y = 140 }, - { t = "Gain", x = 300, y = 160, to = SMLSIZE }, - { t = "Advance", x = 300, y = 180, to = SMLSIZE }, - }, - fields = { - -- ROLL FF - { x = 102, y = 100, min = 0, max = 2000, vals = { 33, 34 }, to = MIDSIZE }, - -- PITCH FF - { x = 102, y = 150, min = 0, max = 2000, vals = { 35, 36 }, to = MIDSIZE }, - -- YAW FF - { x = 102, y = 200, min = 0, max = 2000, vals = { 37, 38 }, to = MIDSIZE }, - -- ROLL D MIN - { x = 202, y = 100, min = 0, max = 100, vals = { 40 }, to = MIDSIZE }, - -- PITCH D MIN - { x = 202, y = 150, min = 0, max = 100, vals = { 41 }, to = MIDSIZE }, - -- YAW D MIN - { x = 202, y = 200, min = 0, max = 100, vals = { 42 }, to = MIDSIZE }, - -- FF TRANSITION - { x = 390, y = 120, min = 0, max = 100, vals = { 9 }, scale = 100 }, - -- D MIN GAIN - { x = 390, y = 160, min = 0, max = 100, vals = { 43 } }, - -- D MIN ADVANCE - { x = 390, y = 180, min = 0, max = 200, vals = { 44 } }, - }, -} diff --git a/src/SCRIPTS/BF/HORUS/pwm.lua b/src/SCRIPTS/BF/HORUS/pwm.lua deleted file mode 100644 index 0b225e56..00000000 --- a/src/SCRIPTS/BF/HORUS/pwm.lua +++ /dev/null @@ -1,66 +0,0 @@ -return { - read = 90, -- MSP_ADVANCED_CONFIG - write = 91, -- MSP_SET_ADVANCED_CONFIG - reboot = true, - eepromWrite = true, - title = "PWM", - minBytes = 9, - text= { - { t = "Protocol", x = 36, y = 68 }, - { t = "32K", x = 36, y = 110 }, - { t = "Gyro Rt", x = 36, y = 155 }, - { t = "PID Rt", x = 36, y = 200 }, - { t = "Unsynced", x = 232, y = 110 }, - { t = "PWM Rate", x = 232, y = 155 }, - { t = "Idle Offset", x = 232, y = 200 } - }, - fields = { - { x = 130, y = 68, vals = { 4 }, min = 0, max = 9, to = MIDSIZE, - table = { [0] = "OFF", "ONESHOT125", "ONESHOT42", - "MULTISHOT","BRUSHED", - "DSHOT150", "DSHOT300", "DSHOT600","DSHOT1200", - "PROSHOT1000" } - }, - { x = 130, y = 110, vals = { 9 }, min = 0, max = 1, to = MIDSIZE, - table = { [0] = "OFF", "ON" }, - upd = function(self) self.updateRateTables(self) end - }, - { x = 130, y = 155, vals = { 1 }, min = 1, max = 32, to = MIDSIZE, - upd = function(self) self.updatePidRateTable(self) end - }, - { x = 130, y = 200, vals = { 2 }, min = 1, max = 16, to = MIDSIZE }, - { x = 350, y = 110, vals = { 3 }, min = 0, max = 1, to = MIDSIZE, - table = { [0] = "OFF", "ON" } }, - { x = 350, y = 155, vals = { 5, 6 }, min = 200, max = 32000, to = MIDSIZE }, - { x = 350, y = 200, vals = { 7, 8 }, min = 0, max = 2000, scale = 100, to = MIDSIZE }, - }, - calculateGyroRates = function(self, baseRate) - self.gyroRates = {} - self.fields[2].table = {} - for i=1, 32 do - self.gyroRates[i] = baseRate/i - local fmt = nil - self.fields[2].table[i] = string.format("%.2f",baseRate/i) - end - end, - calculatePidRates = function(self, baseRate) - self.fields[3].table = {} - for i=1, 16 do - self.fields[3].table[i] = string.format("%.2f",baseRate/i) - end - end, - updateRateTables = function(self) - if self.values[9] == 0 then - self.calculateGyroRates(self, 8) - self.calculatePidRates(self, 8) - elseif self.values[9] == 1 then - self.calculateGyroRates(self, 32) - self.calculatePidRates(self, 32) - end - end, - updatePidRateTable = function(self) - local newRateIdx = self.values[1] - local newRate = self.gyroRates[newRateIdx] - self.calculatePidRates(self, newRate) - end -} diff --git a/src/SCRIPTS/BF/HORUS/rates.lua b/src/SCRIPTS/BF/HORUS/rates.lua deleted file mode 100644 index 0cb196b6..00000000 --- a/src/SCRIPTS/BF/HORUS/rates.lua +++ /dev/null @@ -1,50 +0,0 @@ -return { - read = 111, -- MSP_RC_TUNING - write = 204, -- MSP_SET_RC_TUNING - title = "Rates", - reboot = false, - eepromWrite = true, - minBytes = 16, - text = { - { t = "RC", x = 100, y = 52 }, - { t = "Rate", x = 94, y = 70 }, - { t = "Super", x = 148, y = 52 }, - { t = "Rate", x = 152, y = 70 }, - { t = "RC", x = 214, y = 52 }, - { t = "Expo", x = 207, y = 70 }, - { t = "ROLL", x = 28, y = 100 }, - { t = "PITCH", x = 28, y = 150 }, - { t = "YAW", x = 28, y = 200 }, - - { t = "Throttle", x = 290, y = 60 }, - { t = "Mid", x = 300, y = 80, to = SMLSIZE }, - { t = "Expo", x = 300, y = 100, to = SMLSIZE }, - { t = "Limit Type", x = 300, y = 120, to = SMLSIZE }, - { t = "Limit %", x = 300, y = 140, to = SMLSIZE }, - { t = "TPA", x = 290, y = 160 }, - { t = "Rate", x = 300, y = 180, to = SMLSIZE }, - { t = "Breakpoint", x = 300, y = 200, to = SMLSIZE }, - }, - fields = { - -- RC Rates - { x = 102, y = 100, vals = { 1 }, min = 0, max = 255, scale = 100, to = MIDSIZE }, - { x = 102, y = 150, vals = { 13 }, min = 0, max = 255, scale = 100, to = MIDSIZE }, - { x = 102, y = 200, vals = { 12 }, min = 0, max = 255, scale = 100, to = MIDSIZE }, - -- Super Rates - { x = 158, y = 100, vals = { 3 }, min = 0, max = 100, scale = 100, to = MIDSIZE }, - { x = 158, y = 150, vals = { 4 }, min = 0, max = 100, scale = 100, to = MIDSIZE }, - { x = 158, y = 200, vals = { 5 }, min = 0, max = 255, scale = 100, to = MIDSIZE }, - -- RC Expo - { x = 216, y = 100, vals = { 2 }, min = 0, max = 100, scale = 100, to = MIDSIZE }, - { x = 216, y = 150, vals = { 14 }, min = 0, max = 100, scale = 100, to = MIDSIZE }, - { x = 216, y = 200, vals = { 11 }, min = 0, max = 100, scale = 100, to = MIDSIZE }, - -- Throttle - { x = 390, y = 80, vals = { 7 }, min = 0, max = 100, scale = 100 }, - { x = 390, y = 100, vals = { 8 }, min = 0, max = 100, scale = 100 }, - { x = 390, y = 120, vals = { 15 }, min = 0, max = 2, table = { [0] = "OFF", "SCALE", "CLIP" } }, - { x = 390, y = 140, vals = { 16 }, min = 25, max = 100 }, - -- TPA - { x = 390, y = 180, vals = { 6 }, min = 0, max = 100, scale = 100 }, - { x = 390, y = 200, vals = { 9, 10 }, min = 1000, max = 2000 }, - }, -} diff --git a/src/SCRIPTS/BF/HORUS/rescue.lua b/src/SCRIPTS/BF/HORUS/rescue.lua deleted file mode 100644 index 48595a0f..00000000 --- a/src/SCRIPTS/BF/HORUS/rescue.lua +++ /dev/null @@ -1,36 +0,0 @@ -return { - read = 135, -- MSP_GPS_RESCUE - write = 225, -- MSP_SET_GPS_RESCUE - title = "GPS Rescue", - reboot = false, - eepromWrite = true, - minBytes = 16, - requiredVersion = 1.041, - text = { - { t = "Min Sats.", x =130, y = 40, to = MIDSIZE }, - { t = "Angle", x =150, y = 80, to = MIDSIZE }, - { t = "Initial Altitude", x = 60, y = 120, to = MIDSIZE }, - { t = "Descent Distance", x = 10, y = 160, to = MIDSIZE }, - { t = "Ground Speed", x = 50, y = 200, to = MIDSIZE }, - - { t = "Snty.", x = 310, y = 40, to = MIDSIZE }, - { t = "Throttle", x = 350, y = 80, to = MIDSIZE }, - { t = "Min", x = 330, y = 120, to = MIDSIZE }, - { t = "Hover", x = 310, y = 160, to = MIDSIZE }, - { t = "Max", x = 330, y = 200, to = MIDSIZE }, - }, - fields = { - { x = 260, y = 40, min = 0, max = 50, vals = { 16 }, to = MIDSIZE }, - { x = 260, y = 80, min = 0, max = 200, vals = { 1,2 }, to = MIDSIZE }, - { x = 260, y = 120, min = 20, max = 100, vals = { 3,4 }, to = MIDSIZE }, - { x = 260, y = 160, min = 30, max = 500, vals = { 5,6 }, to = MIDSIZE }, - { x = 260, y = 200, min = 30, max =3000, vals = { 7,8 }, to = MIDSIZE }, - - - { x = 400, y = 40, min = 0, max = 2 , vals = { 15 }, to = MIDSIZE,table = { [0]="OFF","ON","FS_ONLY"}}, - { x = 400, y = 120, min = 1000, max = 2000, vals = { 9,10 }, to = MIDSIZE }, - { x = 400, y = 160, min = 1000, max = 2000, vals = { 13,14 }, to = MIDSIZE }, - { x = 400, y = 200, min = 1000, max = 2000, vals = { 11,12 }, to = MIDSIZE }, - - }, -} diff --git a/src/SCRIPTS/BF/HORUS/rx.lua b/src/SCRIPTS/BF/HORUS/rx.lua deleted file mode 100644 index d245d514..00000000 --- a/src/SCRIPTS/BF/HORUS/rx.lua +++ /dev/null @@ -1,25 +0,0 @@ -return { - read = 44, -- MSP_RX_CONFIG - write = 45, -- MSP_SET_RX_CONFIG - title = "RX", - reboot = false, - eepromWrite = true, - minBytes = 23, - text= { - { t = "Stick Min", x = 36, y = 68 }, - { t = "Stick Mid", x = 36, y = 110 }, - { t = "Stick Max", x = 36, y = 155 }, - { t = "Cam Angle", x = 232, y = 68 }, - { t = "Interp", x = 232, y = 110 }, - { t = "Interp Int", x = 232, y = 155 } - }, - fields = { - { x = 130, y = 68, min = 1000, max = 2000, vals = { 6, 7 }, to = MIDSIZE }, - { x = 130, y = 110, min = 1000, max = 2000, vals = { 4, 5 }, to = MIDSIZE }, - { x = 130, y = 155, min = 1000, max = 2000, vals = { 2, 3 }, to = MIDSIZE }, - { x = 350, y = 68, min = 0, max = 90, vals = { 23 }, to = MIDSIZE }, - { x = 350, y = 110, min = 0, max = 3, vals = { 13 }, to = MIDSIZE, - table={ [0]="Off", "Preset", "Auto", "Manual"} }, - { x = 350, y = 155, min = 1, max = 50, vals = { 14 }, to = MIDSIZE } - }, -} diff --git a/src/SCRIPTS/BF/HORUS/vtx.lua b/src/SCRIPTS/BF/HORUS/vtx.lua deleted file mode 100644 index 73878548..00000000 --- a/src/SCRIPTS/BF/HORUS/vtx.lua +++ /dev/null @@ -1,269 +0,0 @@ - -return { - read = 88, -- MSP_VTX_CONFIG - write = 89, -- MSP_VTX_SET_CONFIG - eepromWrite = true, - reboot = false, - title = "VTX", - minBytes = 5, - prevBandVal = 0, - prevChanVal = 0, - prevFreqVal = 0, - lastFreqUpdTS = 0, - freqModCounter = 0, - text= { - { t = "Band", x = 36, y = 110 }, - { t = "Channel", x = 36, y = 155 }, - { t = "Power", x = 232, y = 110 }, - { t = "Pit", x = 232, y = 155 }, - { t = "Proto", x = 36, y = 68 }, - { t = "Freq", x = 232, y = 68 }, - }, - fields = { - -- Band - { x = 130, y = 110, min=0, max=5, vals = { 2 }, to = MIDSIZE, - table = { [0]="U", "A", "B", "E", "F", "R" }, - upd = function(self) self.handleBandChanUpdate(self) end }, - -- Channel - { x = 130, y = 155, min=1, max=8, vals = { 3 }, to = MIDSIZE, - upd = function(self) self.handleBandChanUpdate(self) end }, - -- Power - { x = 350, y = 110, min=1, vals = { 4 }, to = MIDSIZE, - upd = function(self) self.updatePowerTable(self) end }, - -- Pit mode - { x = 350, y = 155, min=0, max=1, vals = { 5 }, to = MIDSIZE, - table = { [0]="OFF", "ON" } }, - -- Proto - { x = 130, y = 68, vals = { 1 }, to = MIDSIZE, - write = false, ro = true, - table = { [1]="RTC6705",[3]="SmartAudio",[4]="Tramp",[255]="None"} }, - -- Freq - { x = 350, y = 68, min = 5000, max = 5999, vals = { 6 }, to = MIDSIZE, - upd = function(self) self.handleFreqValUpdate(self) end }, - }, - freqLookup = { - { 5865, 5845, 5825, 5805, 5785, 5765, 5745, 5725 }, -- Boscam A - { 5733, 5752, 5771, 5790, 5809, 5828, 5847, 5866 }, -- Boscam B - { 5705, 5685, 5665, 5645, 5885, 5905, 5925, 5945 }, -- Boscam E - { 5740, 5760, 5780, 5800, 5820, 5840, 5860, 5880 }, -- FatShark - { 5658, 5695, 5732, 5769, 5806, 5843, 5880, 5917 }, -- RaceBand - }, - postLoad = function (self) - if (self.values[2] or 0) < 0 or (self.values[3] or 0) == 0 or (self.values[4] or 0) == 0 then - self.values = {} - else - self.prevBandVal = 0 -- reset value trackers - self.prevChanVal = 0 - self.prevFreqVal = 0 - local rFreq - if (self.values[7] or 0) > 0 then - rFreq = math.floor(self.values[6] + (self.values[7] * 256)) - else - rFreq = 0 - end - if (self.values[2] or 0) > 0 then -- band != 0 - if rFreq > 0 then - self.prevFreqVal = rFreq - self.prevBandVal = self.values[2] - self.prevChanVal = self.values[3] - self.fields[1].min = 0 -- make sure 'U' band allowed - self.eepromWrite = true - self.fields[6].value = rFreq - self.values[6] = rFreq - else -- if user freq not supported then - self.fields[1].min = 1 -- don't allow 'U' band - self.eepromWrite = false -- don't write EEPROM on older Betaflight versions - end - else -- band == 0 - if rFreq > 0 then - self.prevFreqVal = rFreq - self.fields[1].min = 0 -- make sure 'U' band allowed - self.eepromWrite = true - self.fields[6].value = rFreq - self.values[6] = rFreq - -- set chan via freq / 100 - self.prevChanVal = clipValue(math.floor((rFreq - 5100) / 100), - self.fields[2].min, self.fields[2].max) - self.fields[2].value = self.prevChanVal - self.values[3] = self.prevChanVal - else - self.values = {} - end - end - end - end, - preSave = function(self) - local valsTemp = {} - if self.values then - local channel - if self.values[2] > 0 then -- band != 0 - channel = (self.values[2]-1)*8 + self.values[3]-1 - elseif self.fields[6].value then -- band == 0 - channel = self.fields[6].value - else - channel = 24 - end - valsTemp[1] = bit32.band(channel,0xFF) - valsTemp[2] = bit32.rshift(channel,8) - valsTemp[3] = self.values[4] - valsTemp[4] = self.values[5] - end - return valsTemp - end, - -- find closest value in freq table that is above/below given freq - findNextInFreqTable = function(self, newFreq) - local startBand - local endBand - local incFlag -- freq increasing or decreasing - if newFreq > self.prevFreqVal then - incFlag = 1 - startBand = 1 - endBand = self.fields[1].max - else - incFlag = -1 - startBand = self.fields[1].max - endBand = 1 - end - local curBand = self.values[2] - local curChan = self.values[3] - local selBand = 0 - local selChan = 0 - local selFreq = 0 - local diffVal = 9999 - local fVal - local minChan = self.fields[2].min - local maxChan = self.fields[2].max - -- need to scan bands in same "direction" as 'incFlag' - -- so same-freq selections will be handled properly (F8 & R7) - for band=startBand,endBand,incFlag do - for chan=minChan,maxChan do - if band ~= curBand or chan ~= curChan then -- don't reselect same band/chan - fVal = self.freqLookup[band][chan] - if incFlag > 0 then - if fVal >= self.prevFreqVal and fVal - self.prevFreqVal < diffVal then - -- if same freq then only select if "next" band: - if fVal ~= self.prevFreqVal or band > curBand then - selBand = band - selChan = chan - selFreq = fVal - diffVal = fVal - self.prevFreqVal - end - end - else - if fVal <= self.prevFreqVal and self.prevFreqVal - fVal < diffVal then - -- if same freq then only select if "previous" band: - if fVal ~= self.prevFreqVal or band < curBand then - selBand = band - selChan = chan - selFreq = fVal - diffVal = self.prevFreqVal - fVal - end - end - end - end - end - end - return selFreq, selBand, selChan - end, - -- returns the next user-frequency value in MHz; implements an - -- "exponential" modification rate so dialing in values is faster - getNextUserFreqValue = function(self, newFreq) - local now = getTime() -- track rate of change for possible mod speedup - if now < self.lastFreqUpdTS + 15 then - self.freqModCounter = self.freqModCounter + (15-(self.lastFreqUpdTS-now)) -- increase counter for mod speedup - else - self.freqModCounter = 0 -- no mod speedup - end - local uFreq - if self.freqModCounter > 65 then -- rate is fast enough; do mod speedup - if newFreq > self.prevFreqVal then - uFreq = clipValue(newFreq + math.floor(self.freqModCounter / 65), - self.fields[6].min, self.fields[6].max) - else - uFreq = clipValue(newFreq - math.floor(self.freqModCounter / 65), - self.fields[6].min, self.fields[6].max) - end - else - uFreq = newFreq - end - self.lastFreqUpdTS = now - return uFreq - end, - updatePowerTable = function(self) - if self.values and not self.fields[3].table then - if self.values[1] == 1 then -- RTC6705 - self.fields[3].table = { 25, 200 } - self.fields[3].max = 2 - self.fields[4].t = nil -- don't display Pit field - self.fields[4].table = { [0]="", "" } - elseif self.values[1] == 3 then -- SmartAudio - self.fields[3].table = { 25, 200, 500, 800 } - self.fields[3].max = 4 - elseif self.values[1] == 4 then -- Tramp - self.fields[3].table = { 25, 100, 200, 400, 600 } - self.fields[3].max = 5 - elseif self.values[1] == 255 then -- None/Unknown - self.fields[3].t = nil -- don't display Power field - self.fields[3].max = 1 - self.fields[3].table = { [1]="" } - self.fields[4].t = nil -- don't display Pit field - self.fields[4].table = { [0]="", "" } - end - end - end, - handleBandChanUpdate = function(self) - if (#(self.values) or 0) >= self.minBytes then - if (self.values[3] or 0) > 0 then - if self.values[2] ~= self.prevBandVal or self.values[3] ~= self.prevChanVal then - if self.values[2] > 0 then -- band != 0 - self.prevFreqVal = self.freqLookup[self.values[2]][self.values[3]] - else -- band == 0; set freq via channel*100 - self.prevFreqVal = math.floor(5100 + (self.values[3] * 100)) - end - self.fields[6].value = self.prevFreqVal - self.values[6] = self.prevFreqVal - self.prevBandVal = self.values[2] - self.prevChanVal = self.values[3] - end - end - end - end, - handleFreqValUpdate = function(self) - if (#(self.values) or 0) >= self.minBytes and (self.fields[6].value or 0) > 0 then - local newFreq = self.fields[6].value - if newFreq ~= self.prevFreqVal then - if self.values[2] == 0 then - -- band == 0 - local uFreq = self.getNextUserFreqValue(self, newFreq) - self.prevFreqVal = uFreq - if uFreq ~= newFreq then - self.fields[6].value = uFreq - self.values[6] = uFreq - end - -- set channel value via freq/100 - self.prevChanVal = clipValue(math.floor((self.prevFreqVal - 5100) / 100), - self.fields[2].min, self.fields[2].max) - self.fields[2].value = self.prevChanVal - self.values[3] = self.prevChanVal - else - -- band != 0; find closest freq in table that is above/below dialed freq - local selFreq, selBand, selChan = self.findNextInFreqTable(self, newFreq) - if selFreq > 0 then - self.prevFreqVal = selFreq - self.prevBandVal = selBand - self.prevChanVal = selChan - self.fields[6].value = selFreq -- using new freq from table - self.values[6] = selFreq - self.fields[1].value = self.prevBandVal -- set band value for freq - self.values[2] = self.prevBandVal - self.fields[2].value = self.prevChanVal -- set channel value for freq - self.values[3] = self.prevChanVal - else - self.fields[6].value = self.prevFreqVal -- if no match then revert freq - self.values[6] = self.prevFreqVal - end - end - end - end - end -} \ No newline at end of file diff --git a/src/SCRIPTS/BF/LAYOUT/128x64/filters.lua b/src/SCRIPTS/BF/LAYOUT/128x64/filters.lua new file mode 100644 index 00000000..b76da948 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/128x64/filters.lua @@ -0,0 +1,58 @@ +return { + labels = { + { t = "Gyro Lowpass 1 Dynamic", x = 2, y = 12, }, + { t = "Min Cutoff", x = 12, y = 20, }, + { t = "Max Cutoff", x = 12, y = 28, }, + { t = "Filter Type", x = 12, y = 36, }, + { t = "Gyro Lowpass 1", x = 2, y = 44, }, + { t = "Cutoff", x = 12, y = 52, }, + { t = "Filter Type", x = 12, y = 60, }, + { t = "Gyro Lowpass 2", x = 2, y = 68, }, + { t = "Cutoff", x = 12, y = 76, }, + { t = "Filter Type", x = 12, y = 84, }, + { t = "Gyro Notch 1", x = 2, y = 92, }, + { t = "Center", x = 12, y = 100, }, + { t = "Cutoff", x = 12, y = 108, }, + { t = "Gyro Notch 2", x = 2, y = 116, }, + { t = "Center", x = 12, y = 124, }, + { t = "Cutoff", x = 12, y = 132, }, + { t = "D Term Lowpass 1 Dynamic", x = 2, y = 140, }, + { t = "Min Cutoff", x = 12, y = 148, }, + { t = "Max Cutoff", x = 12, y = 156, }, + { t = "Filter Type", x = 12, y = 164, }, + { t = "D Term Lowpass 1", x = 2, y = 172, }, + { t = "Cutoff", x = 12, y = 180, }, + { t = "Filter Type", x = 12, y = 188, }, + { t = "D Term Lowpass 2", x = 2, y = 196, }, + { t = "Cutoff", x = 12, y = 204, }, + { t = "Filter Type", x = 12, y = 212, }, + { t = "D Term Notch", x = 2, y = 220, }, + { t = "Center", x = 12, y = 228, }, + { t = "Cutoff", x = 12, y = 236, }, + { t = "Yaw Lowpass", x = 2, y = 244, }, + { t = "Cutoff", x = 12, y = 252, }, + }, + fieldLayout = { + { x = 87, y = 20, }, + { x = 87, y = 28, }, + { x = 87, y = 36, }, + { x = 87, y = 52, }, + { x = 87, y = 60, }, + { x = 87, y = 76, }, + { x = 87, y = 84, }, + { x = 87, y = 100, }, + { x = 87, y = 108, }, + { x = 87, y = 124, }, + { x = 87, y = 132, }, + { x = 87, y = 148, }, + { x = 87, y = 156, }, + { x = 87, y = 164, }, + { x = 87, y = 180, }, + { x = 87, y = 188, }, + { x = 87, y = 204, }, + { x = 87, y = 212, }, + { x = 87, y = 228, }, + { x = 87, y = 236, }, + { x = 87, y = 252, }, + } +} diff --git a/src/SCRIPTS/BF/LAYOUT/128x64/gpspids.lua b/src/SCRIPTS/BF/LAYOUT/128x64/gpspids.lua new file mode 100644 index 00000000..06abe9e5 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/128x64/gpspids.lua @@ -0,0 +1,19 @@ +return { + labels = { + { t = "P", x = 55, y = 14, }, + { t = "I", x = 83, y = 14, }, + { t = "D", x = 111, y = 14, }, + { t = "Throttle", x = 5, y = 26, }, + { t = "Velocity", x = 5, y = 36, }, + { t = "Yaw" , x = 5, y = 46, }, + }, + fieldLayout = { + { x = 51, y = 26, }, + { x = 51, y = 36, }, + { x = 51, y = 46, }, + { x = 79, y = 26, }, + { x = 79, y = 36, }, + { x = 107, y = 26, }, + { x = 107, y = 36, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/128x64/pid_advanced.lua b/src/SCRIPTS/BF/LAYOUT/128x64/pid_advanced.lua new file mode 100644 index 00000000..37b6fdb3 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/128x64/pid_advanced.lua @@ -0,0 +1,31 @@ +return { + labels = { + { t = "Acro Trainer", x = 2, y = 12, }, + { t = "Angle Limit", x = 12, y = 20, }, + { t = "Throttle Boost", x = 2, y = 28, }, + { t = "Absolute Control", x = 2, y = 36, }, + { t = "I Term Rotation", x = 2, y = 44, }, + { t = "VBAT Compensation", x = 2, y = 52, }, + { t = "I Term Relax", x = 2, y = 60, }, + { t = "Axes", x = 12, y = 68, }, + { t = "Type", x = 12, y = 76, }, + { t = "Integrated Yaw", x = 2, y = 84, }, + { t = "Anti Gravity", x = 2, y = 92, }, + { t = "Mode", x = 12, y = 100, }, + { t = "Gain", x = 12, y = 108, }, + { t = "Threshold", x = 12, y = 116, }, + }, + fieldLayout = { + { x = 87, y = 20, }, + { x = 87, y = 28, }, + { x = 87, y = 36, }, + { x = 87, y = 44, }, + { x = 87, y = 52, }, + { x = 87, y = 68, }, + { x = 87, y = 76, }, + { x = 87, y = 84, }, + { x = 87, y = 100, }, + { x = 87, y = 108, }, + { x = 87, y = 116, }, + } +} diff --git a/src/SCRIPTS/BF/LAYOUT/128x64/pids1.lua b/src/SCRIPTS/BF/LAYOUT/128x64/pids1.lua new file mode 100644 index 00000000..1efeb2e7 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/128x64/pids1.lua @@ -0,0 +1,21 @@ +return { + labels = { + { t = "P", x = 45, y = 14, }, + { t = "I", x = 73, y = 14, }, + { t = "D", x = 101, y = 14, }, + { t = "ROLL", x = 10, y = 26, }, + { t = "PITCH", x = 10, y = 36, }, + { t = "YAW", x = 10, y = 46, }, + }, + fieldLayout = { + { x = 41, y = 26, }, + { x = 41, y = 36, }, + { x = 41, y = 46, }, + { x = 69, y = 26, }, + { x = 69, y = 36, }, + { x = 69, y = 46, }, + { x = 97, y = 26, }, + { x = 97, y = 36, }, + { x = 97, y = 46, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/128x64/pids2.lua b/src/SCRIPTS/BF/LAYOUT/128x64/pids2.lua new file mode 100644 index 00000000..2d01f0fe --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/128x64/pids2.lua @@ -0,0 +1,27 @@ +return { + labels = { + { t = "Feed", x = 45, y = 11, }, + { t = "forward", x = 37, y = 18, }, + { t = "D", x = 85, y = 11, }, + { t = "Min", x = 80, y = 18, }, + { t = "ROLL", x = 10, y = 26, }, + { t = "PITCH", x = 10, y = 36, }, + { t = "YAW", x = 10, y = 46, }, + { t = "Feedforward", x = 10, y = 60, }, + { t = "Transition", x = 20, y = 68, }, + { t = "D Min", x = 10, y = 76, }, + { t = "Gain", x = 20, y = 84, }, + { t = "Advance", x = 20, y = 92, }, + }, + fieldLayout = { + { x = 48, y = 26, }, + { x = 48, y = 36, }, + { x = 48, y = 46, }, + { x = 80, y = 26, }, + { x = 80, y = 36, }, + { x = 80, y = 46, }, + { x = 80, y = 68, }, + { x = 80, y = 84, }, + { x = 80, y = 92, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/128x64/pwm.lua b/src/SCRIPTS/BF/LAYOUT/128x64/pwm.lua new file mode 100644 index 00000000..e5b098a9 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/128x64/pwm.lua @@ -0,0 +1,20 @@ +return { + labels = { + { t = "32K", x = 10, y = 14, }, + { t = "Gyro", x = 10, y = 24, }, + { t = "PID", x = 10, y = 34, }, + { t = "Prot", x = 58, y = 14, }, + { t = "Unsync", x = 58, y = 24, }, + { t = "PWM", x = 58, y = 34, }, + { t = "Idle", x = 58, y = 44, } + }, + fieldLayout = { + { x = 32, y = 14, }, + { x = 32, y = 24, }, + { x = 32, y = 34, }, + { x = 90, y = 14, }, + { x = 90, y = 24, }, + { x = 90, y = 34, }, + { x = 90, y = 44, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/128x64/rates.lua b/src/SCRIPTS/BF/LAYOUT/128x64/rates.lua new file mode 100644 index 00000000..067f3320 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/128x64/rates.lua @@ -0,0 +1,38 @@ +return { + labels = { + { t = "RC", x = 43, y = 11, }, + { t = "Rate", x = 38, y = 18, }, + { t = "Super", x = 63, y = 11, }, + { t = "Rate", x = 66, y = 18, }, + { t = "RC", x = 99, y = 11, }, + { t = "Expo", x = 94, y = 18, }, + { t = "ROLL", x = 10, y = 26, }, + { t = "PITCH", x = 10, y = 36, }, + { t = "YAW", x = 10, y = 46, }, + { t = "Throttle", x = 10, y = 60, }, + { t = "Mid", x = 20, y = 68, }, + { t = "Expo", x = 20, y = 76, }, + { t = "Limit Type", x = 20, y = 84, }, + { t = "Limit %", x = 20, y = 92, }, + { t = "TPA", x = 10, y = 100, }, + { t = "Rate", x = 20, y = 108, }, + { t = "Breakpoint", x = 20, y = 116, }, + }, + fieldLayout = { + { x = 39, y = 26, }, + { x = 39, y = 36, }, + { x = 39, y = 46, }, + { x = 66, y = 26, }, + { x = 66, y = 36, }, + { x = 66, y = 46, }, + { x = 94, y = 26, }, + { x = 94, y = 36, }, + { x = 94, y = 46, }, + { x = 70, y = 68, }, + { x = 70, y = 76, }, + { x = 70, y = 84, }, + { x = 70, y = 92, }, + { x = 70, y = 108, }, + { x = 70, y = 116, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/128x64/rescue.lua b/src/SCRIPTS/BF/LAYOUT/128x64/rescue.lua new file mode 100644 index 00000000..6f410660 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/128x64/rescue.lua @@ -0,0 +1,25 @@ +return { + labels = { + { t = "Min Sats.", x = 3, y = 10, }, + { t = "Angle", x = 3, y = 20, }, + { t = "Initial Alt", x = 3, y = 30, }, + { t = "Descent Dst", x = 3, y = 40, }, + { t = "Ground Spd", x = 3, y = 50, }, + { t = "Snty.", x = 80, y = 10, }, + { t = "Throttle", x = 80, y = 20, }, + { t = "Min", x = 85, y = 30, }, + { t = "Hover", x = 80, y = 40, }, + { t = "Max", x = 85, y = 50, }, + }, + fieldLayout = { + { x = 58, y = 10, }, + { x = 58, y = 20, }, + { x = 58, y = 30, }, + { x = 58, y = 40, }, + { x = 58, y = 50, }, + { x = 105, y = 10, }, + { x = 105, y = 30, }, + { x = 105, y = 40, }, + { x = 105, y = 50, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/128x64/rx.lua b/src/SCRIPTS/BF/LAYOUT/128x64/rx.lua new file mode 100644 index 00000000..2f267174 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/128x64/rx.lua @@ -0,0 +1,18 @@ +return { + labels = { + { t = "Stick Min", x = 10, y = 20 }, + { t = "Stick Mid", x = 10, y = 30 }, + { t = "Stick Max", x = 10, y = 40 }, + { t = "Cam Angle", x = 10, y = 50 }, + { t = "Interp", x = 10, y = 60 }, + { t = "Interp Int", x = 10, y = 70 }, + }, + fieldLayout = { + { x = 70, y = 20, }, + { x = 70, y = 30, }, + { x = 70, y = 40, }, + { x = 70, y = 50, }, + { x = 70, y = 60, }, + { x = 70, y = 70, } + }, + } \ No newline at end of file diff --git a/src/SCRIPTS/BF/LAYOUT/128x64/vtx.lua b/src/SCRIPTS/BF/LAYOUT/128x64/vtx.lua new file mode 100644 index 00000000..abecf4c0 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/128x64/vtx.lua @@ -0,0 +1,18 @@ +return { + labels = { + { t = "Band", x = 10, y = 14 }, + { t = "Channel", x = 10, y = 24 }, + { t = "Power", x = 10, y = 34 }, + { t = "Pit", x = 10, y = 44 }, + { t = "Proto", x = 70, y = 14 }, + { t = "Freq", x = 70, y = 24 }, + }, + fieldLayout = { + { x = 40, y = 14, }, + { x = 40, y = 24, }, + { x = 40, y = 34, }, + { x = 40, y = 44, }, + { x = 100, y = 14, }, + { x = 100, y = 24, }, + }, +} \ No newline at end of file diff --git a/src/SCRIPTS/BF/LAYOUT/212x64/filters.lua b/src/SCRIPTS/BF/LAYOUT/212x64/filters.lua new file mode 100644 index 00000000..f5edfbb8 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/212x64/filters.lua @@ -0,0 +1,58 @@ +return { + labels = { + { t = "Gyro Lowpass 1 Dynamic", x = 2, y = 12, }, + { t = "Min Cutoff", x = 12, y = 20, }, + { t = "Max Cutoff", x = 12, y = 28, }, + { t = "Filter Type", x = 12, y = 36, }, + { t = "Gyro Lowpass 1", x = 2, y = 44, }, + { t = "Cutoff", x = 12, y = 52, }, + { t = "Filter Type", x = 12, y = 60, }, + { t = "Gyro Lowpass 2", x = 2, y = 68, }, + { t = "Cutoff", x = 12, y = 76, }, + { t = "Filter Type", x = 12, y = 84, }, + { t = "Gyro Notch 1", x = 2, y = 92, }, + { t = "Center", x = 12, y = 100, }, + { t = "Cutoff", x = 12, y = 108, }, + { t = "Gyro Notch 2", x = 2, y = 116, }, + { t = "Center", x = 12, y = 124, }, + { t = "Cutoff", x = 12, y = 132, }, + { t = "D Term Lowpass 1 Dynamic", x = 2, y = 140, }, + { t = "Min Cutoff", x = 12, y = 148, }, + { t = "Max Cutoff", x = 12, y = 156, }, + { t = "Filter Type", x = 12, y = 164, }, + { t = "D Term Lowpass 1", x = 2, y = 172, }, + { t = "Cutoff", x = 12, y = 180, }, + { t = "Filter Type", x = 12, y = 188, }, + { t = "D Term Lowpass 2", x = 2, y = 196, }, + { t = "Cutoff", x = 12, y = 204, }, + { t = "Filter Type", x = 12, y = 212, }, + { t = "D Term Notch", x = 2, y = 220, }, + { t = "Center", x = 12, y = 228, }, + { t = "Cutoff", x = 12, y = 236, }, + { t = "Yaw Lowpass", x = 2, y = 244, }, + { t = "Cutoff", x = 12, y = 252, }, + }, + fieldLayout = { + { x = 87, y = 20, }, + { x = 87, y = 28, }, + { x = 87, y = 36, }, + { x = 87, y = 52, }, + { x = 87, y = 60, }, + { x = 87, y = 76, }, + { x = 87, y = 84, }, + { x = 87, y = 100, }, + { x = 87, y = 108, }, + { x = 87, y = 124, }, + { x = 87, y = 132, }, + { x = 87, y = 148, }, + { x = 87, y = 156, }, + { x = 87, y = 164, }, + { x = 87, y = 180, }, + { x = 87, y = 188, }, + { x = 87, y = 204, }, + { x = 87, y = 212, }, + { x = 87, y = 228, }, + { x = 87, y = 236, }, + { x = 87, y = 252, }, + } +} diff --git a/src/SCRIPTS/BF/LAYOUT/212x64/gpspids.lua b/src/SCRIPTS/BF/LAYOUT/212x64/gpspids.lua new file mode 100644 index 00000000..178b5232 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/212x64/gpspids.lua @@ -0,0 +1,19 @@ +return { + labels = { + { t = "P", x = 70, y = 14, }, + { t = "I", x = 98, y = 14, }, + { t = "D", x = 126, y = 14, }, + { t = "Throttle", x = 25, y = 26, }, + { t = "Velocity", x = 25, y = 36, }, + { t = "Yaw", x = 25, y = 46, }, + }, + fieldLayout = { + { x = 66, y = 26, }, + { x = 66, y = 36, }, + { x = 66, y = 46, }, + { x = 94, y = 26, }, + { x = 94, y = 36, }, + { x = 122, y = 26, }, + { x = 122, y = 36, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/212x64/pid_advanced.lua b/src/SCRIPTS/BF/LAYOUT/212x64/pid_advanced.lua new file mode 100644 index 00000000..37b6fdb3 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/212x64/pid_advanced.lua @@ -0,0 +1,31 @@ +return { + labels = { + { t = "Acro Trainer", x = 2, y = 12, }, + { t = "Angle Limit", x = 12, y = 20, }, + { t = "Throttle Boost", x = 2, y = 28, }, + { t = "Absolute Control", x = 2, y = 36, }, + { t = "I Term Rotation", x = 2, y = 44, }, + { t = "VBAT Compensation", x = 2, y = 52, }, + { t = "I Term Relax", x = 2, y = 60, }, + { t = "Axes", x = 12, y = 68, }, + { t = "Type", x = 12, y = 76, }, + { t = "Integrated Yaw", x = 2, y = 84, }, + { t = "Anti Gravity", x = 2, y = 92, }, + { t = "Mode", x = 12, y = 100, }, + { t = "Gain", x = 12, y = 108, }, + { t = "Threshold", x = 12, y = 116, }, + }, + fieldLayout = { + { x = 87, y = 20, }, + { x = 87, y = 28, }, + { x = 87, y = 36, }, + { x = 87, y = 44, }, + { x = 87, y = 52, }, + { x = 87, y = 68, }, + { x = 87, y = 76, }, + { x = 87, y = 84, }, + { x = 87, y = 100, }, + { x = 87, y = 108, }, + { x = 87, y = 116, }, + } +} diff --git a/src/SCRIPTS/BF/LAYOUT/212x64/pids1.lua b/src/SCRIPTS/BF/LAYOUT/212x64/pids1.lua new file mode 100644 index 00000000..66ccafb5 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/212x64/pids1.lua @@ -0,0 +1,21 @@ +return { + labels = { + { t = "P", x = 70, y = 14, }, + { t = "I", x = 98, y = 14, }, + { t = "D", x = 126, y = 14, }, + { t = "ROLL", x = 25, y = 26, }, + { t = "PITCH", x = 25, y = 36, }, + { t = "YAW", x = 25, y = 46, }, + }, + fieldLayout = { + { x = 66, y = 26, }, + { x = 66, y = 36, }, + { x = 66, y = 46, }, + { x = 94, y = 26, }, + { x = 94, y = 36, }, + { x = 94, y = 46, }, + { x = 122, y = 26, }, + { x = 122, y = 36, }, + { x = 122, y = 46, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/212x64/pids2.lua b/src/SCRIPTS/BF/LAYOUT/212x64/pids2.lua new file mode 100644 index 00000000..345e7362 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/212x64/pids2.lua @@ -0,0 +1,27 @@ +return { + labels = { + { t = "Feed", x = 46, y = 11, }, + { t = "forward", x = 38, y = 18, }, + { t = "D", x = 86, y = 11, }, + { t = "Min", x = 81, y = 18, }, + { t = "ROLL", x = 8, y = 26, }, + { t = "PITCH", x = 8, y = 36, }, + { t = "YAW", x = 8, y = 46, }, + { t = "Feedforward", x = 110, y = 14, }, + { t = "Transition", x = 120, y = 22, }, + { t = "D Min", x = 110, y = 30, }, + { t = "Gain", x = 120, y = 38, }, + { t = "Advance", x = 120, y = 46, }, + }, + fieldLayout = { + { x = 49, y = 26, }, + { x = 49, y = 36, }, + { x = 49, y = 46, }, + { x = 81, y = 26, }, + { x = 81, y = 36, }, + { x = 81, y = 46, }, + { x = 180, y = 22, }, + { x = 180, y = 38, }, + { x = 180, y = 46, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/212x64/pwm.lua b/src/SCRIPTS/BF/LAYOUT/212x64/pwm.lua new file mode 100644 index 00000000..17254082 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/212x64/pwm.lua @@ -0,0 +1,20 @@ +return { + labels = { + { t = "32K", x = 48, y = 14, }, + { t = "Gyro Rt", x = 29, y = 24, }, + { t = "PID Rt", x = 35, y = 34, }, + { t = "Protocol", x = 107, y = 14, }, + { t = "Unsynced", x = 106, y = 24, }, + { t = "PWM Rate", x = 105, y = 34, }, + { t = "Idle Offset", x = 94, y = 44, } + }, + fieldLayout = { + { x = 65, y = 14, }, + { x = 65, y = 24, }, + { x = 65, y = 34, }, + { x = 148, y = 14, }, + { x = 148, y = 24, }, + { x = 148, y = 34, }, + { x = 148, y = 44, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/212x64/rates.lua b/src/SCRIPTS/BF/LAYOUT/212x64/rates.lua new file mode 100644 index 00000000..e4198473 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/212x64/rates.lua @@ -0,0 +1,38 @@ +return { + labels = { + { t = "RC", x = 43, y = 11, }, + { t = "Rate", x = 38, y = 18, }, + { t = "Super", x = 63, y = 11, }, + { t = "Rate", x = 66, y = 18, }, + { t = "RC", x = 99, y = 11, }, + { t = "Expo", x = 94, y = 18, }, + { t = "ROLL", x = 8, y = 26, }, + { t = "PITCH", x = 8, y = 36, }, + { t = "YAW", x = 8, y = 46, }, + { t = "Throttle", x = 120, y = 12, }, + { t = "Mid", x = 130, y = 20, }, + { t = "Expo", x = 130, y = 28, }, + { t = "Limit Type", x = 130, y = 36, }, + { t = "Limit %", x = 130, y = 44, }, + { t = "TPA", x = 120, y = 52, }, + { t = "Rate", x = 130, y = 60, }, + { t = "Breakpoint", x = 130, y = 68, }, + }, + fieldLayout = { + { x = 39, y = 26, }, + { x = 39, y = 36, }, + { x = 39, y = 46, }, + { x = 66, y = 26, }, + { x = 66, y = 36, }, + { x = 66, y = 46, }, + { x = 94, y = 26, }, + { x = 94, y = 36, }, + { x = 94, y = 46, }, + { x = 180, y = 20, }, + { x = 180, y = 28, }, + { x = 180, y = 36, }, + { x = 180, y = 44, }, + { x = 180, y = 60, }, + { x = 180, y = 68, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/212x64/rescue.lua b/src/SCRIPTS/BF/LAYOUT/212x64/rescue.lua new file mode 100644 index 00000000..5b61bde7 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/212x64/rescue.lua @@ -0,0 +1,25 @@ +return { + labels = { + { t = "Min Sats.", x = 30, y = 16, }, + { t = "Angle", x = 45, y = 26, }, + { t = "Initial Alt.", x = 18, y = 36, }, + { t = "Descent Dist.", x = 10, y = 46, }, + { t = "Ground Speed", x = 10, y = 56, }, + { t = "Sanity Ch.", x = 125, y = 16, }, + { t = "Throttle", x = 125, y = 26, }, + { t = "Min", x = 128, y = 36, }, + { t = "Hover", x = 120, y = 46, }, + { t = "Max", x = 128, y = 56, }, + }, + fieldLayout = { + { x = 75, y = 16, }, + { x = 75, y = 26, }, + { x = 75, y = 36, }, + { x = 75, y = 46, }, + { x = 75, y = 56, }, + { x = 180, y = 16, }, + { x = 150, y = 36, }, + { x = 150, y = 46, }, + { x = 150, y = 56, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/212x64/rx.lua b/src/SCRIPTS/BF/LAYOUT/212x64/rx.lua new file mode 100644 index 00000000..f539f9de --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/212x64/rx.lua @@ -0,0 +1,18 @@ +return { + labels = { + { t = "Stick Min", x = 30, y = 20 }, + { t = "Stick Mid", x = 30, y = 30 }, + { t = "Stick Max", x = 30, y = 40 }, + { t = "Cam Angle", x = 110, y = 20 }, + { t = "Interp", x = 110, y = 30 }, + { t = "Interp Int", x = 110, y = 40 }, + }, + fieldLayout = { + { x = 80, y = 20, }, + { x = 80, y = 30, }, + { x = 80, y = 40, }, + { x = 160, y = 20, }, + { x = 160, y = 30, }, + { x = 160, y = 40, } + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/212x64/vtx.lua b/src/SCRIPTS/BF/LAYOUT/212x64/vtx.lua new file mode 100644 index 00000000..3b770256 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/212x64/vtx.lua @@ -0,0 +1,18 @@ +return { + labels = { + { t = "Band", x = 25, y = 14 }, + { t = "Channel", x = 25, y = 24 }, + { t = "Power", x = 25, y = 34 }, + { t = "Pit", x = 25, y = 44 }, + { t = "Proto", x = 100, y = 14 }, + { t = "Freq", x = 100, y = 24 }, + }, + fieldLayout = { + { x = 75, y = 155, }, + { x = 75, y = 200, }, + { x = 75, y = 242, }, + { x = 75, y = 284, }, + { x = 150, y = 68, }, + { x = 150, y = 110, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/320x480/filters.lua b/src/SCRIPTS/BF/LAYOUT/320x480/filters.lua new file mode 100644 index 00000000..b75db021 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/320x480/filters.lua @@ -0,0 +1,58 @@ +return { + labels = { + { t = "Gyro Lowpass 1 Dynamic", x = 5, y = 35, }, + { t = "Min Cutoff", x = 35, y = 55, }, + { t = "Max Cutoff", x = 35, y = 75, }, + { t = "Filter Type", x = 35, y = 95, }, + { t = "Gyro Lowpass 1", x = 5, y = 115, }, + { t = "Cutoff", x = 35, y = 135, }, + { t = "Filter Type", x = 35, y = 155, }, + { t = "Gyro Lowpass 2", x = 5, y = 175, }, + { t = "Cutoff", x = 35, y = 195, }, + { t = "Filter Type", x = 35, y = 215, }, + { t = "Gyro Notch 1", x = 5, y = 235, }, + { t = "Center", x = 35, y = 255, }, + { t = "Cutoff", x = 35, y = 275, }, + { t = "Gyro Notch 2", x = 5, y = 295, }, + { t = "Center", x = 35, y = 315, }, + { t = "Cutoff", x = 35, y = 335, }, + { t = "D Term Lowpass 1 Dynamic", x = 5, y = 355, }, + { t = "Min Cutoff", x = 35, y = 375, }, + { t = "Max Cutoff", x = 35, y = 395, }, + { t = "Filter Type", x = 35, y = 415, }, + { t = "D Term Lowpass 1", x = 5, y = 435, }, + { t = "Cutoff", x = 35, y = 455, }, + { t = "Filter Type", x = 35, y = 475, }, + { t = "D Term Lowpass 2", x = 5, y = 495, }, + { t = "Cutoff", x = 35, y = 515, }, + { t = "Filter Type", x = 35, y = 535, }, + { t = "D Term Notch", x = 5, y = 555, }, + { t = "Center", x = 35, y = 575, }, + { t = "Cutoff", x = 35, y = 595, }, + { t = "Yaw Lowpass", x = 5, y = 615, }, + { t = "Cutoff", x = 35, y = 635, }, + }, + fieldLayout = { + { x = 200, y = 55, }, + { x = 200, y = 75, }, + { x = 200, y = 95, }, + { x = 200, y = 135, }, + { x = 200, y = 155, }, + { x = 200, y = 195, }, + { x = 200, y = 215, }, + { x = 200, y = 255, }, + { x = 200, y = 275, }, + { x = 200, y = 315, }, + { x = 200, y = 335, }, + { x = 200, y = 375, }, + { x = 200, y = 395, }, + { x = 200, y = 415, }, + { x = 200, y = 455, }, + { x = 200, y = 475, }, + { x = 200, y = 515, }, + { x = 200, y = 535, }, + { x = 200, y = 575, }, + { x = 200, y = 595, }, + { x = 200, y = 635, }, + } +} diff --git a/src/SCRIPTS/BF/LAYOUT/320x480/gpspids.lua b/src/SCRIPTS/BF/LAYOUT/320x480/gpspids.lua new file mode 100644 index 00000000..c7dd58c8 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/320x480/gpspids.lua @@ -0,0 +1,19 @@ +return { + labels = { + { t = "P", x = 100, y = 48, }, + { t = "I", x = 180, y = 48, }, + { t = "D", x = 260, y = 48, }, + { t = "Throttle", x = 10, y = 100, }, + { t = "Velocity", x = 10, y = 150, }, + { t = "Yaw" , x = 10, y = 200, }, + }, + fieldLayout = { + { x = 100, y = 100, }, + { x = 100, y = 150, }, + { x = 100, y = 200, }, + { x = 180, y = 100, }, + { x = 180, y = 150, }, + { x = 260, y = 100, }, + { x = 260, y = 150, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/320x480/pid_advanced.lua b/src/SCRIPTS/BF/LAYOUT/320x480/pid_advanced.lua new file mode 100644 index 00000000..a35a9904 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/320x480/pid_advanced.lua @@ -0,0 +1,31 @@ +return { + labels = { + { t = "Acro Trainer", x = 5, y = 35, }, + { t = "Angle Limit", x = 15, y = 55, }, + { t = "Throttle Boost", x = 5, y = 75, }, + { t = "Absolute Control", x = 5, y = 95, }, + { t = "I Term Rotation", x = 5, y = 115, }, + { t = "VBAT Compensation", x = 5, y = 135, }, + { t = "I Term Relax", x = 5, y = 155, }, + { t = "Axes", x = 15, y = 175, }, + { t = "Type", x = 15, y = 195, }, + { t = "Integrated Yaw", x = 5, y = 215, }, + { t = "Anti Gravity", x = 5, y = 235, }, + { t = "Mode", x = 15, y = 255, }, + { t = "Gain", x = 15, y = 275, }, + { t = "Threshold", x = 15, y = 295, }, + }, + fieldLayout = { + { x = 200, y = 55, }, + { x = 200, y = 75, }, + { x = 200, y = 95, }, + { x = 200, y = 115, }, + { x = 200, y = 135, }, + { x = 200, y = 175, }, + { x = 200, y = 195, }, + { x = 200, y = 215, }, + { x = 200, y = 255, }, + { x = 200, y = 275, }, + { x = 200, y = 295, }, + } +} diff --git a/src/SCRIPTS/BF/LAYOUT/320x480/pids1.lua b/src/SCRIPTS/BF/LAYOUT/320x480/pids1.lua new file mode 100644 index 00000000..5ace790b --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/320x480/pids1.lua @@ -0,0 +1,21 @@ +return { + labels = { + { t = "P", x = 100, y = 48, }, + { t = "I", x = 180, y = 48, }, + { t = "D", x = 260, y = 48, }, + { t = "ROLL", x = 10, y = 100, }, + { t = "PITCH", x = 10, y = 150, }, + { t = "YAW", x = 10, y = 200, }, + }, + fieldLayout = { + { x = 100, y = 100, }, + { x = 100, y = 150, }, + { x = 100, y = 200, }, + { x = 180, y = 100, }, + { x = 180, y = 150, }, + { x = 180, y = 200, }, + { x = 260, y = 100, }, + { x = 260, y = 150, }, + { x = 260, y = 200, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/320x480/pids2.lua b/src/SCRIPTS/BF/LAYOUT/320x480/pids2.lua new file mode 100644 index 00000000..730c81ac --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/320x480/pids2.lua @@ -0,0 +1,27 @@ +return { + labels = { + { t = "Feed", x = 97, y = 52, }, + { t = "forward", x = 82, y = 70, }, + { t = "D", x = 207, y = 52, }, + { t = "Min", x = 202, y = 70, }, + { t = "ROLL", x = 28, y = 100, }, + { t = "PITCH", x = 28, y = 150, }, + { t = "YAW", x = 28, y = 200, }, + { t = "Feedforward", x = 28, y = 250, }, + { t = "Transition", x = 40, y = 270, }, + { t = "D Min", x = 28, y = 300, }, + { t = "Gain", x = 40, y = 320, }, + { t = "Advance", x = 40, y = 350, }, + }, + fieldLayout = { + { x = 102, y = 100, }, + { x = 102, y = 150, }, + { x = 102, y = 200, }, + { x = 202, y = 100, }, + { x = 202, y = 150, }, + { x = 202, y = 200, }, + { x = 150, y = 270, }, + { x = 150, y = 320, }, + { x = 150, y = 350, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/320x480/pwm.lua b/src/SCRIPTS/BF/LAYOUT/320x480/pwm.lua new file mode 100644 index 00000000..a05535ca --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/320x480/pwm.lua @@ -0,0 +1,20 @@ +return { + labels = { + { t = "Protocol", x = 36, y = 68 }, + { t = "32K", x = 36, y = 110 }, + { t = "Gyro Rt", x = 36, y = 155 }, + { t = "PID Rt", x = 36, y = 200 }, + { t = "Unsynced", x = 36, y = 242 }, + { t = "PWM Rate", x = 36, y = 284 }, + { t = "Idle Offset", x = 36, y = 326 } + }, + fieldLayout = { + { x = 150, y = 68, }, + { x = 150, y = 110, }, + { x = 150, y = 155, }, + { x = 150, y = 200, }, + { x = 150, y = 242, }, + { x = 150, y = 284, }, + { x = 150, y = 326, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/320x480/rates.lua b/src/SCRIPTS/BF/LAYOUT/320x480/rates.lua new file mode 100644 index 00000000..95f3d156 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/320x480/rates.lua @@ -0,0 +1,38 @@ +return { + labels = { + { t = "RC", x = 100, y = 52 }, + { t = "Rate", x = 94, y = 70 }, + { t = "Super", x = 148, y = 52 }, + { t = "Rate", x = 152, y = 70 }, + { t = "RC", x = 214, y = 52 }, + { t = "Expo", x = 207, y = 70 }, + { t = "ROLL", x = 28, y = 100 }, + { t = "PITCH", x = 28, y = 150 }, + { t = "YAW", x = 28, y = 200 }, + { t = "Throttle", x = 28, y = 250 }, + { t = "Mid", x = 40, y = 270, }, + { t = "Expo", x = 40, y = 290, }, + { t = "Limit Type", x = 40, y = 310, }, + { t = "Limit %", x = 40, y = 330, }, + { t = "TPA", x = 28, y = 350, }, + { t = "Rate", x = 40, y = 370, }, + { t = "Breakpoint", x = 40, y = 390, }, + }, + fieldLayout = { + { x = 102, y = 100, }, + { x = 102, y = 150, }, + { x = 102, y = 200, }, + { x = 158, y = 100, }, + { x = 158, y = 150, }, + { x = 158, y = 200, }, + { x = 216, y = 100, }, + { x = 216, y = 150, }, + { x = 216, y = 200, }, + { x = 150, y = 270, }, + { x = 150, y = 290, }, + { x = 150, y = 310, }, + { x = 150, y = 330, }, + { x = 150, y = 370, }, + { x = 150, y = 390, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/320x480/rescue.lua b/src/SCRIPTS/BF/LAYOUT/320x480/rescue.lua new file mode 100644 index 00000000..f020b756 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/320x480/rescue.lua @@ -0,0 +1,25 @@ +return { + labels = { + { t = "Min Sats.", x = 10, y = 40 }, + { t = "Angle", x = 10, y = 80 }, + { t = "Initial Altitude", x = 10, y = 120 }, + { t = "Descent Distance", x = 10, y = 160 }, + { t = "Ground Speed", x = 10, y = 200 }, + { t = "Snty.", x = 10, y = 240 }, + { t = "Throttle", x = 10, y = 280 }, + { t = "Min", x = 10, y = 320 }, + { t = "Hover", x = 10, y = 360 }, + { t = "Max", x = 10, y = 400 }, + }, + fieldLayout = { + { x = 260, y = 40, }, + { x = 260, y = 80, }, + { x = 260, y = 120, }, + { x = 260, y = 160, }, + { x = 260, y = 200, }, + { x = 260, y = 240, }, + { x = 260, y = 320, }, + { x = 260, y = 360, }, + { x = 260, y = 400, }, + }, +} \ No newline at end of file diff --git a/src/SCRIPTS/BF/LAYOUT/320x480/rx.lua b/src/SCRIPTS/BF/LAYOUT/320x480/rx.lua new file mode 100644 index 00000000..d9c5ae83 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/320x480/rx.lua @@ -0,0 +1,18 @@ +return { + labels = { + { t = "Stick Min", x = 36, y = 68 }, + { t = "Stick Mid", x = 36, y = 110 }, + { t = "Stick Max", x = 36, y = 155 }, + { t = "Cam Angle", x = 36, y = 200 }, + { t = "Interp", x = 36, y = 242 }, + { t = "Interp Int", x = 36, y = 284 } + }, + fieldLayout = { + { x = 150, y = 68, }, + { x = 150, y = 110, }, + { x = 150, y = 155, }, + { x = 150, y = 200, }, + { x = 150, y = 242, }, + { x = 150, y = 284, } + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/320x480/vtx.lua b/src/SCRIPTS/BF/LAYOUT/320x480/vtx.lua new file mode 100644 index 00000000..fedff593 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/320x480/vtx.lua @@ -0,0 +1,18 @@ +return { + labels = { + { t = "Band", x = 36, y = 155 }, + { t = "Channel", x = 36, y = 200 }, + { t = "Power", x = 36, y = 242 }, + { t = "Pit", x = 36, y = 284 }, + { t = "Proto", x = 36, y = 68 }, + { t = "Freq", x = 36, y = 110 }, + }, + fieldLayout = { + { x = 150, y = 155, }, + { x = 150, y = 200, }, + { x = 150, y = 242, }, + { x = 150, y = 284, }, + { x = 150, y = 68, }, + { x = 150, y = 110, }, + }, +} \ No newline at end of file diff --git a/src/SCRIPTS/BF/LAYOUT/480x272/filters.lua b/src/SCRIPTS/BF/LAYOUT/480x272/filters.lua new file mode 100644 index 00000000..39267df6 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/480x272/filters.lua @@ -0,0 +1,58 @@ +return { + labels = { + { t = "Gyro Lowpass 1 Dynamic", x = 5, y = 35 }, + { t = "Min Cutoff", x = 35, y = 55, }, + { t = "Max Cutoff", x = 35, y = 75, }, + { t = "Filter Type", x = 35, y = 95, }, + { t = "Gyro Lowpass 1", x = 5, y = 115, }, + { t = "Cutoff", x = 35, y = 135, }, + { t = "Filter Type", x = 35, y = 155, }, + { t = "Gyro Lowpass 2", x = 5, y = 175, }, + { t = "Cutoff", x = 35, y = 195, }, + { t = "Filter Type", x = 35, y = 215, }, + { t = "Gyro Notch 1", x = 5, y = 235, }, + { t = "Center", x = 35, y = 255, }, + { t = "Cutoff", x = 35, y = 275, }, + { t = "Gyro Notch 2", x = 5, y = 295, }, + { t = "Center", x = 35, y = 315, }, + { t = "Cutoff", x = 35, y = 335, }, + { t = "D Term Lowpass 1 Dynamic", x = 5, y = 355, }, + { t = "Min Cutoff", x = 35, y = 375, }, + { t = "Max Cutoff", x = 35, y = 395, }, + { t = "Filter Type", x = 35, y = 415, }, + { t = "D Term Lowpass 1", x = 5, y = 435, }, + { t = "Cutoff", x = 35, y = 455, }, + { t = "Filter Type", x = 35, y = 475, }, + { t = "D Term Lowpass 2", x = 5, y = 495, }, + { t = "Cutoff", x = 35, y = 515, }, + { t = "Filter Type", x = 35, y = 535, }, + { t = "D Term Notch", x = 5, y = 555, }, + { t = "Center", x = 35, y = 575, }, + { t = "Cutoff", x = 35, y = 595, }, + { t = "Yaw Lowpass", x = 5, y = 615, }, + { t = "Cutoff", x = 35, y = 635, }, + }, + fieldLayout = { + { x = 200, y = 55, }, + { x = 200, y = 75, }, + { x = 200, y = 95, }, + { x = 200, y = 135, }, + { x = 200, y = 155, }, + { x = 200, y = 195, }, + { x = 200, y = 215, }, + { x = 200, y = 255, }, + { x = 200, y = 275, }, + { x = 200, y = 315, }, + { x = 200, y = 335, }, + { x = 200, y = 375, }, + { x = 200, y = 395, }, + { x = 200, y = 415, }, + { x = 200, y = 455, }, + { x = 200, y = 475, }, + { x = 200, y = 515, }, + { x = 200, y = 535, }, + { x = 200, y = 575, }, + { x = 200, y = 595, }, + { x = 200, y = 635, }, + } +} diff --git a/src/SCRIPTS/BF/LAYOUT/480x272/gpspids.lua b/src/SCRIPTS/BF/LAYOUT/480x272/gpspids.lua new file mode 100644 index 00000000..42c82a6a --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/480x272/gpspids.lua @@ -0,0 +1,19 @@ +return { + labels = { + { t = "P", x = 142, y = 48, }, + { t = "I", x = 244, y = 48, }, + { t = "D", x = 342, y = 48, }, + { t = "Throttle", x = 28, y = 100, }, + { t = "Velocity", x = 28, y = 150, }, + { t = "Yaw" , x = 28, y = 200, }, + }, + fieldLayout = { + { x = 140, y = 100, }, + { x = 140, y = 150, }, + { x = 140, y = 200, }, + { x = 240, y = 100, }, + { x = 240, y = 150, }, + { x = 340, y = 100, }, + { x = 340, y = 150, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/480x272/pid_advanced.lua b/src/SCRIPTS/BF/LAYOUT/480x272/pid_advanced.lua new file mode 100644 index 00000000..a35a9904 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/480x272/pid_advanced.lua @@ -0,0 +1,31 @@ +return { + labels = { + { t = "Acro Trainer", x = 5, y = 35, }, + { t = "Angle Limit", x = 15, y = 55, }, + { t = "Throttle Boost", x = 5, y = 75, }, + { t = "Absolute Control", x = 5, y = 95, }, + { t = "I Term Rotation", x = 5, y = 115, }, + { t = "VBAT Compensation", x = 5, y = 135, }, + { t = "I Term Relax", x = 5, y = 155, }, + { t = "Axes", x = 15, y = 175, }, + { t = "Type", x = 15, y = 195, }, + { t = "Integrated Yaw", x = 5, y = 215, }, + { t = "Anti Gravity", x = 5, y = 235, }, + { t = "Mode", x = 15, y = 255, }, + { t = "Gain", x = 15, y = 275, }, + { t = "Threshold", x = 15, y = 295, }, + }, + fieldLayout = { + { x = 200, y = 55, }, + { x = 200, y = 75, }, + { x = 200, y = 95, }, + { x = 200, y = 115, }, + { x = 200, y = 135, }, + { x = 200, y = 175, }, + { x = 200, y = 195, }, + { x = 200, y = 215, }, + { x = 200, y = 255, }, + { x = 200, y = 275, }, + { x = 200, y = 295, }, + } +} diff --git a/src/SCRIPTS/BF/LAYOUT/480x272/pids1.lua b/src/SCRIPTS/BF/LAYOUT/480x272/pids1.lua new file mode 100644 index 00000000..2896075d --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/480x272/pids1.lua @@ -0,0 +1,22 @@ + +return { + labels = { + { t = "P", x = 142, y = 48, }, + { t = "I", x = 244, y = 48, }, + { t = "D", x = 342, y = 48, }, + { t = "ROLL", x = 28, y = 100, }, + { t = "PITCH", x = 28, y = 150, }, + { t = "YAW", x = 28, y = 200, }, + }, + fieldLayout = { + { x = 140, y = 100, }, + { x = 140, y = 150, }, + { x = 140, y = 200, }, + { x = 240, y = 100, }, + { x = 240, y = 150, }, + { x = 240, y = 200, }, + { x = 340, y = 100, }, + { x = 340, y = 150, }, + { x = 340, y = 200, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/480x272/pids2.lua b/src/SCRIPTS/BF/LAYOUT/480x272/pids2.lua new file mode 100644 index 00000000..8f4bc5da --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/480x272/pids2.lua @@ -0,0 +1,27 @@ +return { + labels = { + { t = "Feed", x = 97, y = 52, }, + { t = "forward", x = 82, y = 70, }, + { t = "D", x = 207, y = 52, }, + { t = "Min", x = 202, y = 70, }, + { t = "ROLL", x = 28, y = 100, }, + { t = "PITCH", x = 28, y = 150, }, + { t = "YAW", x = 28, y = 200, }, + { t = "Feedforward", x = 290, y = 100, }, + { t = "Transition", x = 300, y = 120, }, + { t = "D Min", x = 290, y = 140, }, + { t = "Gain", x = 300, y = 160, }, + { t = "Advance", x = 300, y = 180, }, + }, + fieldLayout = { + { x = 102, y = 100, }, + { x = 102, y = 150, }, + { x = 102, y = 200, }, + { x = 202, y = 100, }, + { x = 202, y = 150, }, + { x = 202, y = 200, }, + { x = 390, y = 120, }, + { x = 390, y = 160, }, + { x = 390, y = 180, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/480x272/pwm.lua b/src/SCRIPTS/BF/LAYOUT/480x272/pwm.lua new file mode 100644 index 00000000..31dad642 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/480x272/pwm.lua @@ -0,0 +1,20 @@ +return { + labels = { + { t = "Protocol", x = 36, y = 68 }, + { t = "32K", x = 36, y = 110 }, + { t = "Gyro Rt", x = 36, y = 155 }, + { t = "PID Rt", x = 36, y = 200 }, + { t = "Unsynced", x = 232, y = 110 }, + { t = "PWM Rate", x = 232, y = 155 }, + { t = "Idle Offset", x = 232, y = 200 }, + }, + fieldLayout = { + { x = 130, y = 68, }, + { x = 130, y = 110, }, + { x = 130, y = 155, }, + { x = 130, y = 200, }, + { x = 350, y = 110, }, + { x = 350, y = 155, }, + { x = 350, y = 200, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/480x272/rates.lua b/src/SCRIPTS/BF/LAYOUT/480x272/rates.lua new file mode 100644 index 00000000..85425eb2 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/480x272/rates.lua @@ -0,0 +1,38 @@ +return { + labels = { + { t = "RC", x = 100, y = 52, }, + { t = "Rate", x = 94, y = 70, }, + { t = "Super", x = 148, y = 52, }, + { t = "Rate", x = 152, y = 70, }, + { t = "RC", x = 214, y = 52, }, + { t = "Expo", x = 207, y = 70, }, + { t = "ROLL", x = 28, y = 100, }, + { t = "PITCH", x = 28, y = 150, }, + { t = "YAW", x = 28, y = 200, }, + { t = "Throttle", x = 290, y = 60, }, + { t = "Mid", x = 300, y = 80, }, + { t = "Expo", x = 300, y = 100, }, + { t = "Limit Type", x = 300, y = 120, }, + { t = "Limit %", x = 300, y = 140, }, + { t = "TPA", x = 290, y = 160, }, + { t = "Rate", x = 300, y = 180, }, + { t = "Breakpoint", x = 300, y = 200, }, + }, + fieldLayout = { + { x = 102, y = 100, }, + { x = 102, y = 150, }, + { x = 102, y = 200, }, + { x = 158, y = 100, }, + { x = 158, y = 150, }, + { x = 158, y = 200, }, + { x = 216, y = 100, }, + { x = 216, y = 150, }, + { x = 216, y = 200, }, + { x = 390, y = 80, }, + { x = 390, y = 100, }, + { x = 390, y = 120, }, + { x = 390, y = 140, }, + { x = 390, y = 180, }, + { x = 390, y = 200, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/480x272/rescue.lua b/src/SCRIPTS/BF/LAYOUT/480x272/rescue.lua new file mode 100644 index 00000000..140d2bbd --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/480x272/rescue.lua @@ -0,0 +1,25 @@ +return { + labels = { + { t = "Min Sats.", x =130, y = 40, }, + { t = "Angle", x =150, y = 80, }, + { t = "Initial Altitude", x = 60, y = 120, }, + { t = "Descent Distance", x = 10, y = 160, }, + { t = "Ground Speed", x = 50, y = 200, }, + { t = "Snty.", x = 310, y = 40, }, + { t = "Throttle", x = 350, y = 80, }, + { t = "Min", x = 330, y = 120, }, + { t = "Hover", x = 310, y = 160, }, + { t = "Max", x = 330, y = 200, }, + }, + fieldLayout = { + { x = 260, y = 40, }, + { x = 260, y = 80, }, + { x = 260, y = 120, }, + { x = 260, y = 160, }, + { x = 260, y = 200, }, + { x = 400, y = 40, }, + { x = 400, y = 120, }, + { x = 400, y = 160, }, + { x = 400, y = 200, }, + }, +} \ No newline at end of file diff --git a/src/SCRIPTS/BF/LAYOUT/480x272/rx.lua b/src/SCRIPTS/BF/LAYOUT/480x272/rx.lua new file mode 100644 index 00000000..175e8bf2 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/480x272/rx.lua @@ -0,0 +1,18 @@ +return { + labels = { + { t = "Stick Min", x = 36, y = 68 }, + { t = "Stick Mid", x = 36, y = 110 }, + { t = "Stick Max", x = 36, y = 155 }, + { t = "Cam Angle", x = 232, y = 68 }, + { t = "Interp", x = 232, y = 110 }, + { t = "Interp Int", x = 232, y = 155 }, + }, + fieldLayout = { + { x = 130, y = 68, }, + { x = 130, y = 110, }, + { x = 130, y = 155, }, + { x = 350, y = 68, }, + { x = 350, y = 110, }, + { x = 350, y = 155, }, + }, +} diff --git a/src/SCRIPTS/BF/LAYOUT/480x272/vtx.lua b/src/SCRIPTS/BF/LAYOUT/480x272/vtx.lua new file mode 100644 index 00000000..b844b488 --- /dev/null +++ b/src/SCRIPTS/BF/LAYOUT/480x272/vtx.lua @@ -0,0 +1,18 @@ +return { + labels = { + { t = "Band", x = 36, y = 110 }, + { t = "Channel", x = 36, y = 155 }, + { t = "Power", x = 232, y = 110 }, + { t = "Pit", x = 232, y = 155 }, + { t = "Proto", x = 36, y = 68 }, + { t = "Freq", x = 232, y = 68 }, + }, + fieldLayout = { + { x = 130, y = 110, }, + { x = 130, y = 155, }, + { x = 350, y = 110, }, + { x = 350, y = 155, }, + { x = 130, y = 68, }, + { x = 350, y = 68, }, + }, +} \ No newline at end of file diff --git a/src/SCRIPTS/BF/NV14/filters.lua b/src/SCRIPTS/BF/NV14/filters.lua deleted file mode 100644 index 71fc95fb..00000000 --- a/src/SCRIPTS/BF/NV14/filters.lua +++ /dev/null @@ -1,95 +0,0 @@ -return { - read = 92, -- MSP_FILTER_CONFIG - write = 93, -- MSP_SET_FILTER_CONFIG - eepromWrite = true, - reboot = false, - title = "Filters", - minBytes = 37, - outputBytes = 37, - yMinLimit = 35, - yMaxLimit = 215, - text= { - { t = "Gyro Lowpass 1 Dynamic", x = 5, y = 35 }, - { t = "Min Cutoff", x = 35, y = 55, to = SMLSIZE }, - { t = "Max Cutoff", x = 35, y = 75, to = SMLSIZE }, - { t = "Filter Type", x = 35, y = 95, to = SMLSIZE }, - - { t = "Gyro Lowpass 1", x = 5, y = 115 }, - { t = "Cutoff", x = 35, y = 135, to = SMLSIZE }, - { t = "Filter Type", x = 35, y = 155, to = SMLSIZE }, - - { t = "Gyro Lowpass 2", x = 5, y = 175 }, - { t = "Cutoff", x = 35, y = 195, to = SMLSIZE }, - { t = "Filter Type", x = 35, y = 215, to = SMLSIZE }, - - { t = "Gyro Notch 1", x = 5, y = 235 }, - { t = "Center", x = 35, y = 255, to = SMLSIZE }, - { t = "Cutoff", x = 35, y = 275, to = SMLSIZE }, - - { t = "Gyro Notch 2", x = 5, y = 295 }, - { t = "Center", x = 35, y = 315, to = SMLSIZE }, - { t = "Cutoff", x = 35, y = 335, to = SMLSIZE }, - - { t = "D Term Lowpass 1 Dynamic", x = 5, y = 355 }, - { t = "Min Cutoff", x = 35, y = 375, to = SMLSIZE }, - { t = "Max Cutoff", x = 35, y = 395, to = SMLSIZE }, - { t = "Filter Type", x = 35, y = 415, to = SMLSIZE }, - - { t = "D Term Lowpass 1", x = 5, y = 435 }, - { t = "Cutoff", x = 35, y = 455, to = SMLSIZE }, - { t = "Filter Type", x = 35, y = 475, to = SMLSIZE }, - - { t = "D Term Lowpass 2", x = 5, y = 495 }, - { t = "Cutoff", x = 35, y = 515, to = SMLSIZE }, - { t = "Filter Type", x = 35, y = 535, to = SMLSIZE }, - - { t = "D Term Notch", x = 5, y = 555 }, - { t = "Center", x = 35, y = 575, to = SMLSIZE }, - { t = "Cutoff", x = 35, y = 595, to = SMLSIZE }, - - { t = "Yaw Lowpass", x = 5, y = 615 }, - { t = "Cutoff", x = 35, y = 635, to = SMLSIZE }, - }, - fields = { - -- Gyro Lowpass 1 Dynamic - { x = 200, y = 55, min = 0, max = 1000, vals = { 30, 31 } }, - { x = 200, y = 75, min = 0, max = 1000, vals = { 32, 33 } }, - { x = 200, y = 95, min = 0, max = 1, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- Gyro Lowpass 1 - { x = 200, y = 135, min = 0, max = 16000, vals = { 21, 22 } }, - { x = 200, y = 155, min = 0, max = 1, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- Gyro Lowpass 2 - { x = 200, y = 195, min = 0, max = 16000, vals = { 23, 24 } }, - { x = 200, y = 215, min = 0, max = 1, vals = { 26 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- Gyro Notch 1 - { x = 200, y = 255, min = 0, max = 16000, vals = { 6, 7 } }, - { x = 200, y = 275, min = 0, max = 16000, vals = { 8, 9 } }, - - -- Gyro Notch 2 - { x = 200, y = 315, min = 0, max = 16000, vals = { 14, 15 } }, - { x = 200, y = 335, min = 0, max = 16000, vals = { 16, 17 } }, - - -- D Term Lowpass 1 Dynamic - { x = 200, y = 375, min = 0, max = 1000, vals = { 34, 35 } }, - { x = 200, y = 395, min = 0, max = 1000, vals = { 36, 37 } }, - { x = 200, y = 415, min = 0, max = 1, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- D Term Lowpass 1 - { x = 200, y = 455, min = 0, max = 16000, vals = { 2, 3 } }, - { x = 200, y = 475, min = 0, max = 1, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- D Term Lowpass 2 - { x = 200, y = 515, min = 0, max = 16000, vals = { 27, 28 } }, - { x = 200, y = 535, min = 0, max = 1, vals = { 29 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- D Term Notch - { x = 200, y = 575, min = 0, max = 16000, vals = { 10, 11 } }, - { x = 200, y = 595, min = 0, max = 16000, vals = { 12, 13 } }, - - -- Yaw Lowpass - { x = 200, y = 635, min = 0, max = 500, vals = { 4, 5 } }, - } -} diff --git a/src/SCRIPTS/BF/NV14/gpspids.lua b/src/SCRIPTS/BF/NV14/gpspids.lua deleted file mode 100644 index fb870204..00000000 --- a/src/SCRIPTS/BF/NV14/gpspids.lua +++ /dev/null @@ -1,29 +0,0 @@ -return { - read = 136, -- MSP_GPS_RESCUE_PIDS - write = 226, -- MSP_SET_GPS_RESCUE_PIDS - title = "GPS Rescue / PIDs", - reboot = false, - eepromWrite = true, - minBytes = 14, - requiredVersion = 1.041, - text = { - { t = "P", x = 100, y = 48, to = MIDSIZE }, - { t = "I", x = 180, y = 48, to = MIDSIZE }, - { t = "D", x = 260, y = 48, to = MIDSIZE }, - { t = "Throttle", x = 10, y = 100 }, - { t = "Velocity", x = 10, y = 150 }, - { t = "Yaw" , x = 10, y = 200 }, - }, - fields = { - -- P - { x = 100, y = 100, min = 0, max = 200, vals = { 1, 3 }, to = MIDSIZE }, - { x = 100, y = 150, min = 0, max = 200, vals = { 7, 8 }, to = MIDSIZE }, - { x = 100, y = 200, min = 0, max = 500, vals = {13,14 }, to = MIDSIZE }, - -- I - { x = 180, y = 100, min = 0, max = 200, vals = { 3, 4 }, to = MIDSIZE }, - { x = 180, y = 150, min = 0, max = 200, vals = { 9,10 }, to = MIDSIZE }, - -- D - { x = 260, y = 100, min = 0, max = 200, vals = { 5, 6 }, to = MIDSIZE }, - { x = 260, y = 150, min = 0, max = 200, vals = { 11,12 }, to = MIDSIZE }, - }, -} diff --git a/src/SCRIPTS/BF/NV14/nv14pre.lua b/src/SCRIPTS/BF/NV14/nv14pre.lua deleted file mode 100644 index d1071cbe..00000000 --- a/src/SCRIPTS/BF/NV14/nv14pre.lua +++ /dev/null @@ -1,17 +0,0 @@ -PageFiles = -{ - { title = "PIDs 1", script = "pids1.lua"}, - { title = "PIDs 2", script = "pids2.lua"}, - { title = "Rates", script = "rates.lua"}, - { title = "Advanced PIDs", script = "pid_advanced.lua"}, - { title = "Filters", script = "filters.lua"}, - { title = "vTX Settings", script = "vtx.lua"}, - { title = "Gyro / Motor", script = "pwm.lua"}, - { title = "Rx", script = "rx.lua"}, - { title = "GPS Rescue", script = "rescue.lua", requiredVersion = 1.041}, - { title = "GPS PIDs", script = "gpspids.lua", requiredVersion = 1.041}, -} - -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 + INVERS + BLINK } diff --git a/src/SCRIPTS/BF/NV14/pid_advanced.lua b/src/SCRIPTS/BF/NV14/pid_advanced.lua deleted file mode 100644 index 1421dfb4..00000000 --- a/src/SCRIPTS/BF/NV14/pid_advanced.lua +++ /dev/null @@ -1,48 +0,0 @@ -return { - read = 94, -- MSP_PID_ADVANCED - write = 95, -- MSP_SET_PID_ADVANCED - title = "PID Advanced", - reboot = false, - eepromWrite = true, - minBytes = 46, - outputBytes = 46, - yMinLimit = 35, - yMaxLimit = 215, - text = { - { t = "Acro Trainer", x = 5, y = 35 }, - { t = "Angle Limit", x = 15, y = 55, to = SMLSIZE }, - - { t = "Throttle Boost", x = 5, y = 75 }, - { t = "Absolute Control", x = 5, y = 95 }, - { t = "I Term Rotation", x = 5, y = 115 }, - { t = "VBAT Compensation", x = 5, y = 135 }, - - { t = "I Term Relax", x = 5, y = 155 }, - { t = "Axes", x = 15, y = 175, to = SMLSIZE }, - { t = "Type", x = 15, y = 195, to = SMLSIZE }, - - { t = "Integrated Yaw", x = 5, y = 215 }, - - { t = "Anti Gravity", x = 5, y = 235 }, - { t = "Mode", x = 15, y = 255, to = SMLSIZE }, - { t = "Gain", x = 15, y = 275, to = SMLSIZE }, - { t = "Threshold", x = 15, y = 295, to = SMLSIZE }, - }, - fields = { - { x = 200, y = 55, min = 20, max = 80, vals = { 32 } }, - - { x = 200, y = 75, min = 0, max = 100, vals = { 31 } }, - { x = 200, y = 95, min = 0, max = 20, vals = { 30 } }, - { x = 200, y = 115, min = 0, max = 1, vals = { 26 }, table = { [0]="OFF", "ON" } }, - { x = 200, y = 135, min = 0, max = 1, vals = { 8 }, table = { [0]="OFF", "ON" } }, - - { x = 200, y = 175, min = 0, max = 4, vals = { 28 }, table = { [0]="NONE", "RP", "RPY", "RP (increment only)", "RPY (increment only)" } }, - { x = 200, y = 195, min = 0, max = 1, vals = { 29 }, table = { [0]="Gyro", "Setpoint" } }, - - { x = 200, y = 215, min = 0, max = 1, vals = { 45 }, table = { [0]="OFF", "ON" } }, - - { x = 200, y = 255, min = 0, max = 1, vals = { 39 }, table = { [0]="Smooth", "Step" } }, - { x = 200, y = 275, min = 1000, max = 30000, vals = { 22, 23 }, scale = 1000, mult = 100 }, - { x = 200, y = 295, min = 20, max = 1000, vals = { 20, 21 } }, - } -} diff --git a/src/SCRIPTS/BF/NV14/pids1.lua b/src/SCRIPTS/BF/NV14/pids1.lua deleted file mode 100644 index c48518bb..00000000 --- a/src/SCRIPTS/BF/NV14/pids1.lua +++ /dev/null @@ -1,31 +0,0 @@ - -return { - read = 112, -- MSP_PID - write = 202, -- MSP_SET_PID - title = "PIDs (1/2)", - reboot = false, - eepromWrite = true, - minBytes = 9, - text = { - { t = "P", x = 100, y = 48, to = MIDSIZE }, - { t = "I", x = 180, y = 48, to = MIDSIZE }, - { t = "D", x = 260, y = 48, to = MIDSIZE }, - { t = "ROLL", x = 10, y = 100 }, - { t = "PITCH", x = 10, y = 150 }, - { t = "YAW", x = 10, y = 200 }, - }, - fields = { - -- P - { x = 100, y = 100, min = 0, max = 200, vals = { 1 }, to = MIDSIZE }, - { x = 100, y = 150, min = 0, max = 200, vals = { 4 }, to = MIDSIZE }, - { x = 100, y = 200, min = 0, max = 200, vals = { 7 }, to = MIDSIZE }, - -- I - { x = 180, y = 100, min = 0, max = 200, vals = { 2 }, to = MIDSIZE }, - { x = 180, y = 150, min = 0, max = 200, vals = { 5 }, to = MIDSIZE }, - { x = 180, y = 200, min = 0, max = 200, vals = { 8 }, to = MIDSIZE }, - -- D - { x = 260, y = 100, min = 0, max = 200, vals = { 3 }, to = MIDSIZE }, - { x = 260, y = 150, min = 0, max = 200, vals = { 6 }, to = MIDSIZE }, - { x = 260, y = 200, min = 0, max = 200, vals = { 9 }, to = MIDSIZE }, - }, -} diff --git a/src/SCRIPTS/BF/NV14/pids2.lua b/src/SCRIPTS/BF/NV14/pids2.lua deleted file mode 100644 index 3080e49a..00000000 --- a/src/SCRIPTS/BF/NV14/pids2.lua +++ /dev/null @@ -1,44 +0,0 @@ - -return { - read = 94, -- MSP_PID_ADVANCED - write = 95, -- MSP_SET_PID_ADVANCED - title = "PIDs (2/2)", - reboot = false, - eepromWrite = true, - minBytes = 44, - text = { - { t = "Feed", x = 97, y = 52 }, - { t = "forward", x = 82, y = 70 }, - { t = "D", x = 207, y = 52 }, - { t = "Min", x = 202, y = 70 }, - { t = "ROLL", x = 28, y = 100 }, - { t = "PITCH", x = 28, y = 150 }, - { t = "YAW", x = 28, y = 200 }, - - { t = "Feedforward", x = 28, y = 250 }, - { t = "Transition", x = 40, y = 270, to = SMLSIZE }, - { t = "D Min", x = 28, y = 300 }, - { t = "Gain", x = 40, y = 320, to = SMLSIZE }, - { t = "Advance", x = 40, y = 350, to = SMLSIZE }, - }, - fields = { - -- ROLL FF - { x = 102, y = 100, min = 0, max = 2000, vals = { 33, 34 }, to = MIDSIZE }, - -- PITCH FF - { x = 102, y = 150, min = 0, max = 2000, vals = { 35, 36 }, to = MIDSIZE }, - -- YAW FF - { x = 102, y = 200, min = 0, max = 2000, vals = { 37, 38 }, to = MIDSIZE }, - -- ROLL D MIN - { x = 202, y = 100, min = 0, max = 100, vals = { 40 }, to = MIDSIZE }, - -- PITCH D MIN - { x = 202, y = 150, min = 0, max = 100, vals = { 41 }, to = MIDSIZE }, - -- YAW D MIN - { x = 202, y = 200, min = 0, max = 100, vals = { 42 }, to = MIDSIZE }, - -- FF TRANSITION - { x = 150, y = 270, min = 0, max = 100, vals = { 9 }, scale = 100 }, - -- D MIN GAIN - { x = 150, y = 320, min = 0, max = 100, vals = { 43 } }, - -- D MIN ADVANCE - { x = 150, y = 350, min = 0, max = 200, vals = { 44 } }, - }, -} diff --git a/src/SCRIPTS/BF/NV14/pwm.lua b/src/SCRIPTS/BF/NV14/pwm.lua deleted file mode 100644 index 9186df15..00000000 --- a/src/SCRIPTS/BF/NV14/pwm.lua +++ /dev/null @@ -1,66 +0,0 @@ -return { - read = 90, -- MSP_ADVANCED_CONFIG - write = 91, -- MSP_SET_ADVANCED_CONFIG - reboot = true, - eepromWrite = true, - title = "PWM", - minBytes = 9, - text= { - { t = "Protocol", x = 36, y = 68 }, - { t = "32K", x = 36, y = 110 }, - { t = "Gyro Rt", x = 36, y = 155 }, - { t = "PID Rt", x = 36, y = 200 }, - { t = "Unsynced", x = 36, y = 242 }, - { t = "PWM Rate", x = 36, y = 284 }, - { t = "Idle Offset", x = 36, y = 326 } - }, - fields = { - { x = 150, y = 68, vals = { 4 }, min = 0, max = 9, to = MIDSIZE, - table = { [0] = "OFF", "ONESHOT125", "ONESHOT42", - "MULTISHOT","BRUSHED", - "DSHOT150", "DSHOT300", "DSHOT600","DSHOT1200", - "PROSHOT1000" } - }, - { x = 150, y = 110, vals = { 9 }, min = 0, max = 1, to = MIDSIZE, - table = { [0] = "OFF", "ON" }, - upd = function(self) self.updateRateTables(self) end - }, - { x = 150, y = 155, vals = { 1 }, min = 1, max = 32, to = MIDSIZE, - upd = function(self) self.updatePidRateTable(self) end - }, - { x = 150, y = 200, vals = { 2 }, min = 1, max = 16, to = MIDSIZE }, - { x = 150, y = 242, vals = { 3 }, min = 0, max = 1, to = MIDSIZE, - table = { [0] = "OFF", "ON" } }, - { x = 150, y = 284, vals = { 5, 6 }, min = 200, max = 32000, to = MIDSIZE }, - { x = 150, y = 326, vals = { 7, 8 }, min = 0, max = 2000, scale = 100, to = MIDSIZE }, - }, - calculateGyroRates = function(self, baseRate) - self.gyroRates = {} - self.fields[2].table = {} - for i=1, 32 do - self.gyroRates[i] = baseRate/i - local fmt = nil - self.fields[2].table[i] = string.format("%.2f",baseRate/i) - end - end, - calculatePidRates = function(self, baseRate) - self.fields[3].table = {} - for i=1, 16 do - self.fields[3].table[i] = string.format("%.2f",baseRate/i) - end - end, - updateRateTables = function(self) - if self.values[9] == 0 then - self.calculateGyroRates(self, 8) - self.calculatePidRates(self, 8) - elseif self.values[9] == 1 then - self.calculateGyroRates(self, 32) - self.calculatePidRates(self, 32) - end - end, - updatePidRateTable = function(self) - local newRateIdx = self.values[1] - local newRate = self.gyroRates[newRateIdx] - self.calculatePidRates(self, newRate) - end -} diff --git a/src/SCRIPTS/BF/NV14/rates.lua b/src/SCRIPTS/BF/NV14/rates.lua deleted file mode 100644 index b2539650..00000000 --- a/src/SCRIPTS/BF/NV14/rates.lua +++ /dev/null @@ -1,50 +0,0 @@ -return { - read = 111, -- MSP_RC_TUNING - write = 204, -- MSP_SET_RC_TUNING - title = "Rates", - reboot = false, - eepromWrite = true, - minBytes = 16, - text = { - { t = "RC", x = 100, y = 52 }, - { t = "Rate", x = 94, y = 70 }, - { t = "Super", x = 148, y = 52 }, - { t = "Rate", x = 152, y = 70 }, - { t = "RC", x = 214, y = 52 }, - { t = "Expo", x = 207, y = 70 }, - { t = "ROLL", x = 28, y = 100 }, - { t = "PITCH", x = 28, y = 150 }, - { t = "YAW", x = 28, y = 200 }, - - { t = "Throttle", x = 28, y = 250 }, - { t = "Mid", x = 40, y = 270, to = SMLSIZE }, - { t = "Expo", x = 40, y = 290, to = SMLSIZE }, - { t = "Limit Type", x = 40, y = 310, to = SMLSIZE }, - { t = "Limit %", x = 40, y = 330, to = SMLSIZE }, - { t = "TPA", x = 28, y = 350 }, - { t = "Rate", x = 40, y = 370, to = SMLSIZE }, - { t = "Breakpoint", x = 40, y = 390, to = SMLSIZE }, - }, - fields = { - -- RC Rates - { x = 102, y = 100, vals = { 1 }, min = 0, max = 255, scale = 100, to = MIDSIZE }, - { x = 102, y = 150, vals = { 13 }, min = 0, max = 255, scale = 100, to = MIDSIZE }, - { x = 102, y = 200, vals = { 12 }, min = 0, max = 255, scale = 100, to = MIDSIZE }, - -- Super Rates - { x = 158, y = 100, vals = { 3 }, min = 0, max = 100, scale = 100, to = MIDSIZE }, - { x = 158, y = 150, vals = { 4 }, min = 0, max = 100, scale = 100, to = MIDSIZE }, - { x = 158, y = 200, vals = { 5 }, min = 0, max = 255, scale = 100, to = MIDSIZE }, - -- RC Expo - { x = 216, y = 100, vals = { 2 }, min = 0, max = 100, scale = 100, to = MIDSIZE }, - { x = 216, y = 150, vals = { 14 }, min = 0, max = 100, scale = 100, to = MIDSIZE }, - { x = 216, y = 200, vals = { 11 }, min = 0, max = 100, scale = 100, to = MIDSIZE }, - -- Throttle - { x = 150, y = 270, vals = { 7 }, min = 0, max = 100, scale = 100 }, - { x = 150, y = 290, vals = { 8 }, min = 0, max = 100, scale = 100 }, - { x = 150, y = 310, vals = { 15 }, min = 0, max = 2, table = { [0] = "OFF", "SCALE", "CLIP" } }, - { x = 150, y = 330, vals = { 16 }, min = 25, max = 100 }, - -- TPA - { x = 150, y = 370, vals = { 6 }, min = 0, max = 100, scale = 100 }, - { x = 150, y = 390, vals = { 9, 10 }, min = 1000, max = 2000 }, - }, -} diff --git a/src/SCRIPTS/BF/NV14/rescue.lua b/src/SCRIPTS/BF/NV14/rescue.lua deleted file mode 100644 index ec85cd86..00000000 --- a/src/SCRIPTS/BF/NV14/rescue.lua +++ /dev/null @@ -1,36 +0,0 @@ -return { - read = 135, -- MSP_GPS_RESCUE - write = 225, -- MSP_SET_GPS_RESCUE - title = "GPS Rescue", - reboot = false, - eepromWrite = true, - minBytes = 16, - requiredVersion = 1.041, - text = { - { t = "Min Sats.", x = 10, y = 40 }, - { t = "Angle", x = 10, y = 80 }, - { t = "Initial Altitude", x = 10, y = 120 }, - { t = "Descent Distance", x = 10, y = 160 }, - { t = "Ground Speed", x = 10, y = 200 }, - - { t = "Snty.", x = 10, y = 240 }, - { t = "Throttle", x = 10, y = 280 }, - { t = "Min", x = 10, y = 320 }, - { t = "Hover", x = 10, y = 360 }, - { t = "Max", x = 10, y = 400 }, - }, - fields = { - { x = 260, y = 40, min = 0, max = 50, vals = { 16 } }, - { x = 260, y = 80, min = 0, max = 200, vals = { 1,2 } }, - { x = 260, y = 120, min = 20, max = 100, vals = { 3,4 } }, - { x = 260, y = 160, min = 30, max = 500, vals = { 5,6 } }, - { x = 260, y = 200, min = 30, max =3000, vals = { 7,8 } }, - - - { x = 260, y = 240, min = 0, max = 2 , vals = { 15 } ,table = { [0]="OFF","ON","FS_ONLY"}}, - { x = 260, y = 320, min = 1000, max = 2000, vals = { 9,10 } }, - { x = 260, y = 360, min = 1000, max = 2000, vals = { 13,14 } }, - { x = 260, y = 400, min = 1000, max = 2000, vals = { 11,12 } }, - - }, -} diff --git a/src/SCRIPTS/BF/NV14/rx.lua b/src/SCRIPTS/BF/NV14/rx.lua deleted file mode 100644 index 3fb30b09..00000000 --- a/src/SCRIPTS/BF/NV14/rx.lua +++ /dev/null @@ -1,24 +0,0 @@ -return { - read = 44, -- MSP_RX_CONFIG - write = 45, -- MSP_SET_RX_CONFIG - title = "RX", - reboot = false, - eepromWrite = true, - minBytes = 23, - text= { - { t = "Stick Min", x = 36, y = 68 }, - { t = "Stick Mid", x = 36, y = 110 }, - { t = "Stick Max", x = 36, y = 155 }, - { t = "Cam Angle", x = 36, y = 200 }, - { t = "Interp", x = 36, y = 242 }, - { t = "Interp Int", x = 36, y = 284 } - }, - fields = { - { x = 150, y = 68, min = 1000, max = 2000, vals = { 6, 7 }, to = MIDSIZE }, - { x = 150, y = 110, min = 1000, max = 2000, vals = { 4, 5 }, to = MIDSIZE }, - { x = 150, y = 155, min = 1000, max = 2000, vals = { 2, 3 }, to = MIDSIZE }, - { x = 150, y = 200, min = 0, max = 90, vals = { 23 }, to = MIDSIZE }, - { x = 150, y = 242, min = 0, max = 3, vals = { 13 }, to = MIDSIZE, table={ [0]="Off", "Preset", "Auto", "Manual"} }, - { x = 150, y = 284, min = 1, max = 50, vals = { 14 }, to = MIDSIZE } - }, -} diff --git a/src/SCRIPTS/BF/NV14/vtx.lua b/src/SCRIPTS/BF/NV14/vtx.lua deleted file mode 100644 index 1aae0762..00000000 --- a/src/SCRIPTS/BF/NV14/vtx.lua +++ /dev/null @@ -1,269 +0,0 @@ - -return { - read = 88, -- MSP_VTX_CONFIG - write = 89, -- MSP_VTX_SET_CONFIG - eepromWrite = true, - reboot = false, - title = "VTX", - minBytes = 5, - prevBandVal = 0, - prevChanVal = 0, - prevFreqVal = 0, - lastFreqUpdTS = 0, - freqModCounter = 0, - text= { - { t = "Band", x = 36, y = 155 }, - { t = "Channel", x = 36, y = 200 }, - { t = "Power", x = 36, y = 242 }, - { t = "Pit", x = 36, y = 284 }, - { t = "Proto", x = 36, y = 68 }, - { t = "Freq", x = 36, y = 110 }, - }, - fields = { - -- Band - { x = 150, y = 155, min=0, max=5, vals = { 2 }, to = MIDSIZE, - table = { [0]="U", "A", "B", "E", "F", "R" }, - upd = function(self) self.handleBandChanUpdate(self) end }, - -- Channel - { x = 150, y = 200, min=1, max=8, vals = { 3 }, to = MIDSIZE, - upd = function(self) self.handleBandChanUpdate(self) end }, - -- Power - { x = 150, y = 242, min=1, vals = { 4 }, to = MIDSIZE, - upd = function(self) self.updatePowerTable(self) end }, - -- Pit mode - { x = 150, y = 284, min=0, max=1, vals = { 5 }, to = MIDSIZE, - table = { [0]="OFF", "ON" } }, - -- Proto - { x = 150, y = 68, vals = { 1 }, to = MIDSIZE, - write = false, ro = true, - table = { [1]="RTC6705",[3]="SmartAudio",[4]="Tramp",[255]="None"} }, - -- Freq - { x = 150, y = 110, min = 5000, max = 5999, vals = { 6 }, to = MIDSIZE, - upd = function(self) self.handleFreqValUpdate(self) end }, - }, - freqLookup = { - { 5865, 5845, 5825, 5805, 5785, 5765, 5745, 5725 }, -- Boscam A - { 5733, 5752, 5771, 5790, 5809, 5828, 5847, 5866 }, -- Boscam B - { 5705, 5685, 5665, 5645, 5885, 5905, 5925, 5945 }, -- Boscam E - { 5740, 5760, 5780, 5800, 5820, 5840, 5860, 5880 }, -- FatShark - { 5658, 5695, 5732, 5769, 5806, 5843, 5880, 5917 }, -- RaceBand - }, - postLoad = function (self) - if (self.values[2] or 0) < 0 or (self.values[3] or 0) == 0 or (self.values[4] or 0) == 0 then - self.values = {} - else - self.prevBandVal = 0 -- reset value trackers - self.prevChanVal = 0 - self.prevFreqVal = 0 - local rFreq - if (self.values[7] or 0) > 0 then - rFreq = math.floor(self.values[6] + (self.values[7] * 256)) - else - rFreq = 0 - end - if (self.values[2] or 0) > 0 then -- band != 0 - if rFreq > 0 then - self.prevFreqVal = rFreq - self.prevBandVal = self.values[2] - self.prevChanVal = self.values[3] - self.fields[1].min = 0 -- make sure 'U' band allowed - self.eepromWrite = true - self.fields[6].value = rFreq - self.values[6] = rFreq - else -- if user freq not supported then - self.fields[1].min = 1 -- don't allow 'U' band - self.eepromWrite = false -- don't write EEPROM on older Betaflight versions - end - else -- band == 0 - if rFreq > 0 then - self.prevFreqVal = rFreq - self.fields[1].min = 0 -- make sure 'U' band allowed - self.eepromWrite = true - self.fields[6].value = rFreq - self.values[6] = rFreq - -- set chan via freq / 100 - self.prevChanVal = clipValue(math.floor((rFreq - 5100) / 100), - self.fields[2].min, self.fields[2].max) - self.fields[2].value = self.prevChanVal - self.values[3] = self.prevChanVal - else - self.values = {} - end - end - end - end, - preSave = function(self) - local valsTemp = {} - if self.values then - local channel - if self.values[2] > 0 then -- band != 0 - channel = (self.values[2]-1)*8 + self.values[3]-1 - elseif self.fields[6].value then -- band == 0 - channel = self.fields[6].value - else - channel = 24 - end - valsTemp[1] = bit32.band(channel,0xFF) - valsTemp[2] = bit32.rshift(channel,8) - valsTemp[3] = self.values[4] - valsTemp[4] = self.values[5] - end - return valsTemp - end, - -- find closest value in freq table that is above/below given freq - findNextInFreqTable = function(self, newFreq) - local startBand - local endBand - local incFlag -- freq increasing or decreasing - if newFreq > self.prevFreqVal then - incFlag = 1 - startBand = 1 - endBand = self.fields[1].max - else - incFlag = -1 - startBand = self.fields[1].max - endBand = 1 - end - local curBand = self.values[2] - local curChan = self.values[3] - local selBand = 0 - local selChan = 0 - local selFreq = 0 - local diffVal = 9999 - local fVal - local minChan = self.fields[2].min - local maxChan = self.fields[2].max - -- need to scan bands in same "direction" as 'incFlag' - -- so same-freq selections will be handled properly (F8 & R7) - for band=startBand,endBand,incFlag do - for chan=minChan,maxChan do - if band ~= curBand or chan ~= curChan then -- don't reselect same band/chan - fVal = self.freqLookup[band][chan] - if incFlag > 0 then - if fVal >= self.prevFreqVal and fVal - self.prevFreqVal < diffVal then - -- if same freq then only select if "next" band: - if fVal ~= self.prevFreqVal or band > curBand then - selBand = band - selChan = chan - selFreq = fVal - diffVal = fVal - self.prevFreqVal - end - end - else - if fVal <= self.prevFreqVal and self.prevFreqVal - fVal < diffVal then - -- if same freq then only select if "previous" band: - if fVal ~= self.prevFreqVal or band < curBand then - selBand = band - selChan = chan - selFreq = fVal - diffVal = self.prevFreqVal - fVal - end - end - end - end - end - end - return selFreq, selBand, selChan - end, - -- returns the next user-frequency value in MHz; implements an - -- "exponential" modification rate so dialing in values is faster - getNextUserFreqValue = function(self, newFreq) - local now = getTime() -- track rate of change for possible mod speedup - if now < self.lastFreqUpdTS + 15 then - self.freqModCounter = self.freqModCounter + (15-(self.lastFreqUpdTS-now)) -- increase counter for mod speedup - else - self.freqModCounter = 0 -- no mod speedup - end - local uFreq - if self.freqModCounter > 65 then -- rate is fast enough; do mod speedup - if newFreq > self.prevFreqVal then - uFreq = clipValue(newFreq + math.floor(self.freqModCounter / 65), - self.fields[6].min, self.fields[6].max) - else - uFreq = clipValue(newFreq - math.floor(self.freqModCounter / 65), - self.fields[6].min, self.fields[6].max) - end - else - uFreq = newFreq - end - self.lastFreqUpdTS = now - return uFreq - end, - updatePowerTable = function(self) - if self.values and not self.fields[3].table then - if self.values[1] == 1 then -- RTC6705 - self.fields[3].table = { 25, 200 } - self.fields[3].max = 2 - self.fields[4].t = nil -- don't display Pit field - self.fields[4].table = { [0]="", "" } - elseif self.values[1] == 3 then -- SmartAudio - self.fields[3].table = { 25, 200, 500, 800 } - self.fields[3].max = 4 - elseif self.values[1] == 4 then -- Tramp - self.fields[3].table = { 25, 100, 200, 400, 600 } - self.fields[3].max = 5 - elseif self.values[1] == 255 then -- None/Unknown - self.fields[3].t = nil -- don't display Power field - self.fields[3].max = 1 - self.fields[3].table = { [1]="" } - self.fields[4].t = nil -- don't display Pit field - self.fields[4].table = { [0]="", "" } - end - end - end, - handleBandChanUpdate = function(self) - if (#(self.values) or 0) >= self.minBytes then - if (self.values[3] or 0) > 0 then - if self.values[2] ~= self.prevBandVal or self.values[3] ~= self.prevChanVal then - if self.values[2] > 0 then -- band != 0 - self.prevFreqVal = self.freqLookup[self.values[2]][self.values[3]] - else -- band == 0; set freq via channel*100 - self.prevFreqVal = math.floor(5100 + (self.values[3] * 100)) - end - self.fields[6].value = self.prevFreqVal - self.values[6] = self.prevFreqVal - self.prevBandVal = self.values[2] - self.prevChanVal = self.values[3] - end - end - end - end, - handleFreqValUpdate = function(self) - if (#(self.values) or 0) >= self.minBytes and (self.fields[6].value or 0) > 0 then - local newFreq = self.fields[6].value - if newFreq ~= self.prevFreqVal then - if self.values[2] == 0 then - -- band == 0 - local uFreq = self.getNextUserFreqValue(self, newFreq) - self.prevFreqVal = uFreq - if uFreq ~= newFreq then - self.fields[6].value = uFreq - self.values[6] = uFreq - end - -- set channel value via freq/100 - self.prevChanVal = clipValue(math.floor((self.prevFreqVal - 5100) / 100), - self.fields[2].min, self.fields[2].max) - self.fields[2].value = self.prevChanVal - self.values[3] = self.prevChanVal - else - -- band != 0; find closest freq in table that is above/below dialed freq - local selFreq, selBand, selChan = self.findNextInFreqTable(self, newFreq) - if selFreq > 0 then - self.prevFreqVal = selFreq - self.prevBandVal = selBand - self.prevChanVal = selChan - self.fields[6].value = selFreq -- using new freq from table - self.values[6] = selFreq - self.fields[1].value = self.prevBandVal -- set band value for freq - self.values[2] = self.prevBandVal - self.fields[2].value = self.prevChanVal -- set channel value for freq - self.values[3] = self.prevChanVal - else - self.fields[6].value = self.prevFreqVal -- if no match then revert freq - self.values[6] = self.prevFreqVal - end - end - end - end - end -} \ No newline at end of file diff --git a/src/SCRIPTS/BF/PAGES/filters.lua b/src/SCRIPTS/BF/PAGES/filters.lua new file mode 100644 index 00000000..8b4d53fe --- /dev/null +++ b/src/SCRIPTS/BF/PAGES/filters.lua @@ -0,0 +1,35 @@ +local display = assert(loadScript(radio.templateHome.."filters.lua"))() +return { + read = 92, -- MSP_FILTER_CONFIG + write = 93, -- MSP_SET_FILTER_CONFIG + eepromWrite = true, + reboot = false, + title = "Filters", + minBytes = 37, + outputBytes = 37, + labels = display.labels, + fieldLayout = display.fieldLayout, + fields = { + { min = 0, max = 1000, vals = { 30, 31 } }, + { min = 0, max = 1000, vals = { 32, 33 } }, + { min = 0, max = 1, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, + { min = 0, max = 16000, vals = { 21, 22 } }, + { min = 0, max = 1, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, + { min = 0, max = 16000, vals = { 23, 24 } }, + { min = 0, max = 1, vals = { 26 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, + { min = 0, max = 16000, vals = { 6, 7 } }, + { min = 0, max = 16000, vals = { 8, 9 } }, + { min = 0, max = 16000, vals = { 14, 15 } }, + { min = 0, max = 16000, vals = { 16, 17 } }, + { min = 0, max = 1000, vals = { 34, 35 } }, + { min = 0, max = 1000, vals = { 36, 37 } }, + { min = 0, max = 1, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, + { min = 0, max = 16000, vals = { 2, 3 } }, + { min = 0, max = 1, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, + { min = 0, max = 16000, vals = { 27, 28 } }, + { min = 0, max = 1, vals = { 29 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, + { min = 0, max = 16000, vals = { 10, 11 } }, + { min = 0, max = 16000, vals = { 12, 13 } }, + { min = 0, max = 500, vals = { 4, 5 } }, + }, +} \ No newline at end of file diff --git a/src/SCRIPTS/BF/PAGES/gpspids.lua b/src/SCRIPTS/BF/PAGES/gpspids.lua new file mode 100644 index 00000000..0fbfabe4 --- /dev/null +++ b/src/SCRIPTS/BF/PAGES/gpspids.lua @@ -0,0 +1,21 @@ +local display = assert(loadScript(radio.templateHome.."gpspids.lua"))() +return { + read = 136, -- MSP_GPS_RESCUE_PIDS + write = 226, -- MSP_SET_GPS_RESCUE_PIDS + title = "GPS Rescue / PIDs", + reboot = false, + eepromWrite = true, + minBytes = 14, + requiredVersion = 1.041, + labels = display.labels, + fieldLayout = display.fieldLayout, + fields = { + { min = 0, max = 200, vals = { 1,2 }, }, + { min = 0, max = 200, vals = { 7,8 }, }, + { min = 0, max = 500, vals = { 13,14 }, }, + { min = 0, max = 200, vals = { 3,4 }, }, + { min = 0, max = 200, vals = { 9,10 }, }, + { min = 0, max = 200, vals = { 5,6 }, }, + { min = 0, max = 200, vals = { 11,12 }, }, + }, +} \ No newline at end of file diff --git a/src/SCRIPTS/BF/PAGES/pid_advanced.lua b/src/SCRIPTS/BF/PAGES/pid_advanced.lua new file mode 100644 index 00000000..fb23a25a --- /dev/null +++ b/src/SCRIPTS/BF/PAGES/pid_advanced.lua @@ -0,0 +1,25 @@ +local display = assert(loadScript(radio.templateHome.."pid_advanced.lua"))() +return { + read = 94, -- MSP_PID_ADVANCED + write = 95, -- MSP_SET_PID_ADVANCED + title = "PID Advanced", + reboot = false, + eepromWrite = true, + minBytes = 46, + outputBytes = 46, + labels = display.labels, + fieldLayout = display.fieldLayout, + fields = { + { min = 20, max = 80, vals = { 32 } }, + { min = 0, max = 100, vals = { 31 } }, + { min = 0, max = 20, vals = { 30 } }, + { min = 0, max = 1, vals = { 26 }, table = { [0]="OFF", "ON" } }, + { min = 0, max = 1, vals = { 8 }, table = { [0]="OFF", "ON" } }, + { min = 0, max = 4, vals = { 28 }, table = { [0]="NONE", "RP", "RPY", "RP (inc)", "RPY (inc)" } }, + { min = 0, max = 1, vals = { 29 }, table = { [0]="Gyro", "Setpoint" } }, + { min = 0, max = 1, vals = { 45 }, table = { [0]="OFF", "ON" } }, + { min = 0, max = 1, vals = { 39 }, table = { [0]="Smooth", "Step" } }, + { min = 1000, max = 30000, vals = { 22, 23 }, scale = 1000, mult = 100 }, + { min = 20, max = 1000, vals = { 20, 21 } }, + } +} \ No newline at end of file diff --git a/src/SCRIPTS/BF/PAGES/pids1.lua b/src/SCRIPTS/BF/PAGES/pids1.lua new file mode 100644 index 00000000..6a5fd4ba --- /dev/null +++ b/src/SCRIPTS/BF/PAGES/pids1.lua @@ -0,0 +1,22 @@ +local display = assert(loadScript(radio.templateHome.."pids1.lua"))() +return { + read = 112, -- MSP_PID + write = 202, -- MSP_SET_PID + title = "PIDs (1/2)", + reboot = false, + eepromWrite = true, + minBytes = 9, + labels = display.labels, + fieldLayout = display.fieldLayout, + fields = { + { min = 0, max = 200, vals = { 1 }, }, + { min = 0, max = 200, vals = { 4 }, }, + { min = 0, max = 200, vals = { 7 }, }, + { min = 0, max = 200, vals = { 2 }, }, + { min = 0, max = 200, vals = { 5 }, }, + { min = 0, max = 200, vals = { 8 }, }, + { min = 0, max = 200, vals = { 3 }, }, + { min = 0, max = 200, vals = { 6 }, }, + { min = 0, max = 200, vals = { 9 }, }, + }, +} diff --git a/src/SCRIPTS/BF/PAGES/pids2.lua b/src/SCRIPTS/BF/PAGES/pids2.lua new file mode 100644 index 00000000..248dfd09 --- /dev/null +++ b/src/SCRIPTS/BF/PAGES/pids2.lua @@ -0,0 +1,22 @@ +local display = assert(loadScript(radio.templateHome.."pids2.lua"))() +return { + read = 94, -- MSP_PID_ADVANCED + write = 95, -- MSP_SET_PID_ADVANCED + title = "PIDs (2/2)", + reboot = false, + eepromWrite = true, + minBytes = 44, + labels = display.labels, + fieldLayout = display.fieldLayout, + fields = { + { min = 0, max = 2000, vals = { 33, 34 }, }, + { min = 0, max = 2000, vals = { 35, 36 }, }, + { min = 0, max = 2000, vals = { 37, 38 }, }, + { min = 0, max = 100, vals = { 40 }, }, + { min = 0, max = 100, vals = { 41 }, }, + { min = 0, max = 100, vals = { 42 }, }, + { min = 0, max = 100, vals = { 9 }, scale = 100 }, + { min = 0, max = 100, vals = { 43 }, }, + { min = 0, max = 200, vals = { 44 }, }, + }, +} diff --git a/src/SCRIPTS/BF/PAGES/pwm.lua b/src/SCRIPTS/BF/PAGES/pwm.lua new file mode 100644 index 00000000..72dfd2b9 --- /dev/null +++ b/src/SCRIPTS/BF/PAGES/pwm.lua @@ -0,0 +1,49 @@ +local display = assert(loadScript(radio.templateHome.."pwm.lua"))() +return { + read = 90, -- MSP_ADVANCED_CONFIG + write = 91, -- MSP_SET_ADVANCED_CONFIG + reboot = true, + eepromWrite = true, + title = "PWM", + minBytes = 9, + labels = display.labels, + fieldLayout = display.fieldLayout, + fields = { + { vals = { 9 }, min = 0, max = 1, table = { [0] = "OFF", "ON" }, upd = function(self) self.updateRateTables(self) end }, + { vals = { 1 }, min = 1, max = 32, upd = function(self) self.updatePidRateTable(self) end }, + { vals = { 2 }, min = 1, max = 16, }, + { vals = { 4 }, min = 0, max = 9, table = { [0] = "OFF", "OS125", "OS42", "MSHOT","BRSH", "DS150", "DS300", "DS600","DS1200", "PS1000" } }, + { vals = { 3 }, min = 0, max = 1, table = { [0] = "OFF", "ON" } }, + { vals = { 5, 6 }, min = 200, max = 32000, }, + { vals = { 7, 8 }, min = 0, max = 2000, scale = 100 }, + }, + calculateGyroRates = function(self, baseRate) + self.gyroRates = {} + self.fields[2].table = {} + for i=1, 32 do + self.gyroRates[i] = baseRate/i + local fmt = nil + self.fields[2].table[i] = string.format("%.2f",baseRate/i) + end + end, + calculatePidRates = function(self, baseRate) + self.fields[3].table = {} + for i=1, 16 do + self.fields[3].table[i] = string.format("%.2f",baseRate/i) + end + end, + updateRateTables = function(self) + if self.values[9] == 0 then + self.calculateGyroRates(self, 8) + self.calculatePidRates(self, 8) + elseif self.values[9] == 1 then + self.calculateGyroRates(self, 32) + self.calculatePidRates(self, 32) + end + end, + updatePidRateTable = function(self) + local newRateIdx = self.values[1] + local newRate = self.gyroRates[newRateIdx] + self.calculatePidRates(self, newRate) + end +} diff --git a/src/SCRIPTS/BF/PAGES/rates.lua b/src/SCRIPTS/BF/PAGES/rates.lua new file mode 100644 index 00000000..96fa2b4d --- /dev/null +++ b/src/SCRIPTS/BF/PAGES/rates.lua @@ -0,0 +1,28 @@ +local display = assert(loadScript(radio.templateHome.."rates.lua"))() +return { + read = 111, -- MSP_RC_TUNING + write = 204, -- MSP_SET_RC_TUNING + title = "Rates", + reboot = false, + eepromWrite = true, + minBytes = 16, + labels = display.labels, + fieldLayout = display.fieldLayout, + fields = { + { vals = { 1 }, min = 0, max = 255, scale = 100, }, + { vals = { 13 }, min = 0, max = 255, scale = 100, }, + { vals = { 12 }, min = 0, max = 255, scale = 100, }, + { vals = { 3 }, min = 0, max = 100, scale = 100, }, + { vals = { 4 }, min = 0, max = 100, scale = 100, }, + { vals = { 5 }, min = 0, max = 255, scale = 100, }, + { vals = { 2 }, min = 0, max = 100, scale = 100, }, + { vals = { 14 }, min = 0, max = 100, scale = 100, }, + { vals = { 11 }, min = 0, max = 100, scale = 100, }, + { vals = { 7 }, min = 0, max = 100, scale = 100, }, + { vals = { 8 }, min = 0, max = 100, scale = 100, }, + { vals = { 15 }, min = 0, max = 2, table = { [0] = "OFF", "SCALE", "CLIP" } }, + { vals = { 16 }, min = 25, max = 100, }, + { vals = { 6 } , min = 0, max = 100, scale = 100, }, + { vals = { 9, 10 }, min = 1000, max = 2000, }, + }, +} diff --git a/src/SCRIPTS/BF/PAGES/rescue.lua b/src/SCRIPTS/BF/PAGES/rescue.lua new file mode 100644 index 00000000..7ea57cc7 --- /dev/null +++ b/src/SCRIPTS/BF/PAGES/rescue.lua @@ -0,0 +1,23 @@ +local display = assert(loadScript(radio.templateHome.."rescue.lua"))() +return { + read = 135, -- MSP_GPS_RESCUE + write = 225, -- MSP_SET_GPS_RESCUE + title = "GPS Rescue", + reboot = false, + eepromWrite = true, + minBytes = 16, + requiredVersion = 1.041, + labels = display.labels, + fieldLayout = display.fieldLayout, + fields = { + { min = 0, max = 50, vals = { 16 }, }, + { min = 0, max = 200, vals = { 1,2 }, }, + { min = 20, max = 100, vals = { 3,4 }, }, + { min = 30, max = 500, vals = { 5,6 }, }, + { min = 30, max = 3000, vals = { 7,8 }, }, + { min = 0, max = 2, vals = { 15 }, table = { [0]="OFF","ON","FS_ONLY"}, }, + { min = 1000, max = 2000, vals = { 9,10 }, }, + { min = 1000, max = 2000, vals = { 13,14 }, }, + { min = 1000, max = 2000, vals = { 11,12 }, }, + }, +} diff --git a/src/SCRIPTS/BF/PAGES/rx.lua b/src/SCRIPTS/BF/PAGES/rx.lua new file mode 100644 index 00000000..6323f104 --- /dev/null +++ b/src/SCRIPTS/BF/PAGES/rx.lua @@ -0,0 +1,19 @@ +local display = assert(loadScript(radio.templateHome.."rx.lua"))() +return { + read = 44, -- MSP_RX_CONFIG + write = 45, -- MSP_SET_RX_CONFIG + title = "RX", + reboot = false, + eepromWrite = true, + minBytes = 23, + labels = display.labels, + fieldLayout = display.fieldLayout, + fields = { + { min = 1000, max = 2000, vals = { 6, 7 }, }, + { min = 1000, max = 2000, vals = { 4, 5 }, }, + { min = 1000, max = 2000, vals = { 2, 3 }, }, + { min = 0, max = 90, vals = { 23 }, }, + { min = 0, max = 3, vals = { 13 }, table={ [0]="Off", "Preset", "Auto", "Manual"} }, + { min = 1, max = 50, vals = { 14 }, } + }, +} diff --git a/src/SCRIPTS/BF/X7/vtx.lua b/src/SCRIPTS/BF/PAGES/vtx.lua similarity index 91% rename from src/SCRIPTS/BF/X7/vtx.lua rename to src/SCRIPTS/BF/PAGES/vtx.lua index fe051ed9..35d4346d 100644 --- a/src/SCRIPTS/BF/X7/vtx.lua +++ b/src/SCRIPTS/BF/PAGES/vtx.lua @@ -1,4 +1,4 @@ - +local display = assert(loadScript(radio.templateHome.."vtx.lua"))() return { read = 88, -- MSP_VTX_CONFIG write = 89, -- MSP_VTX_SET_CONFIG @@ -11,14 +11,15 @@ return { prevFreqVal = 0, lastFreqUpdTS = 0, freqModCounter = 0, - text = {}, + labels = display.labels, + fieldLayout = display.fieldLayout, fields = { - { t = "Band", x = 10, y = 14, sp = 30, min=0, max=5, vals = { 2 }, to = SMLSIZE, table = { [0]="U", "A", "B", "E", "F", "R" }, upd = function(self) self.handleBandChanUpdate(self) end }, - { t = "Chan", x = 10, y = 24, sp = 30, min=1, max=8, vals = { 3 }, to = SMLSIZE, upd = function(self) self.handleBandChanUpdate(self) end }, - { t = "Power", x = 10, y = 34, sp = 30, min=1, vals = { 4 }, to = SMLSIZE, upd = function(self) self.updatePowerTable(self) end }, - { t = "Pit", x = 10, y = 44, sp = 30, min=0, max=1, vals = { 5 }, to = SMLSIZE, table = { [0]="OFF", "ON" } }, - { t = "Dev", x = 70, y = 14, sp = 25, write = false, ro = true, vals = { 1 }, to = SMLSIZE , table = { [1]="6705",[3]="SA",[4]="Tramp",[255]="None"} }, - { t = "Freq", x = 70, y = 24, sp = 25, min = 5000, max = 5999, vals = { 6 }, to = SMLSIZE, upd = function(self) self.handleFreqValUpdate(self) end }, + { min=0, max=5, vals = { 2 }, table = { [0]="U", "A", "B", "E", "F", "R" }, upd = function(self) self.handleBandChanUpdate(self) end }, + { min=1, max=8, vals = { 3 }, upd = function(self) self.handleBandChanUpdate(self) end }, + { min=1, vals = { 4 }, upd = function(self) self.updatePowerTable(self) end }, + { min=0, max=1, vals = { 5 }, table = { [0]="OFF", "ON" } }, + { vals = { 1 }, write = false, ro = true, table = { [1]="RTC6705",[3]="SmartAudio",[4]="Tramp",[255]="None"} }, + { min = 5000, max = 5999, vals = { 6 }, upd = function(self) self.handleFreqValUpdate(self) end }, }, freqLookup = { { 5865, 5845, 5825, 5805, 5785, 5765, 5745, 5725 }, -- Boscam A diff --git a/src/SCRIPTS/BF/X7/filters.lua b/src/SCRIPTS/BF/X7/filters.lua deleted file mode 100644 index a5dde7d6..00000000 --- a/src/SCRIPTS/BF/X7/filters.lua +++ /dev/null @@ -1,95 +0,0 @@ -return { - read = 92, -- MSP_FILTER_CONFIG - write = 93, -- MSP_SET_FILTER_CONFIG - eepromWrite = true, - reboot = false, - title = "Filters", - minBytes = 37, - outputBytes = 37, - yMinLimit = 12, - yMaxLimit = 52, - text= { - { t = "Gyro Lowpass 1 Dynamic", x = 2, y = 12, to = SMLSIZE }, - { t = "Min Cutoff", x = 12, y = 20, to = SMLSIZE }, - { t = "Max Cutoff", x = 12, y = 28, to = SMLSIZE }, - { t = "Filter Type", x = 12, y = 36, to = SMLSIZE }, - - { t = "Gyro Lowpass 1", x = 2, y = 44, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 52, to = SMLSIZE }, - { t = "Filter Type", x = 12, y = 60, to = SMLSIZE }, - - { t = "Gyro Lowpass 2", x = 2, y = 68, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 76, to = SMLSIZE }, - { t = "Filter Type", x = 12, y = 84, to = SMLSIZE }, - - { t = "Gyro Notch 1", x = 2, y = 92, to = SMLSIZE }, - { t = "Center", x = 12, y = 100, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 108, to = SMLSIZE }, - - { t = "Gyro Notch 2", x = 2, y = 116, to = SMLSIZE }, - { t = "Center", x = 12, y = 124, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 132, to = SMLSIZE }, - - { t = "D Term Lowpass 1 Dynamic", x = 2, y = 140, to = SMLSIZE }, - { t = "Min Cutoff", x = 12, y = 148, to = SMLSIZE }, - { t = "Max Cutoff", x = 12, y = 156, to = SMLSIZE }, - { t = "Filter Type", x = 12, y = 164, to = SMLSIZE }, - - { t = "D Term Lowpass 1", x = 2, y = 172, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 180, to = SMLSIZE }, - { t = "Filter Type", x = 12, y = 188, to = SMLSIZE }, - - { t = "D Term Lowpass 2", x = 2, y = 196, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 204, to = SMLSIZE }, - { t = "Filter Type", x = 12, y = 212, to = SMLSIZE }, - - { t = "D Term Notch", x = 2, y = 220, to = SMLSIZE }, - { t = "Center", x = 12, y = 228, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 236, to = SMLSIZE }, - - { t = "Yaw Lowpass", x = 2, y = 244, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 252, to = SMLSIZE }, - }, - fields = { - -- Gyro Lowpass 1 Dynamic - { x = 87, y = 20, min = 0, max = 1000, to = SMLSIZE, vals = { 30, 31 } }, - { x = 87, y = 28, min = 0, max = 1000, to = SMLSIZE, vals = { 32, 33 } }, - { x = 87, y = 36, min = 0, max = 1, to = SMLSIZE, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- Gyro Lowpass 1 - { x = 87, y = 52, min = 0, max = 16000, to = SMLSIZE, vals = { 21, 22 } }, - { x = 87, y = 60, min = 0, max = 1, to = SMLSIZE, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- Gyro Lowpass 2 - { x = 87, y = 76, min = 0, max = 16000, to = SMLSIZE, vals = { 23, 24 } }, - { x = 87, y = 84, min = 0, max = 1, to = SMLSIZE, vals = { 26 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- Gyro Notch 1 - { x = 87, y = 100, min = 0, max = 16000, to = SMLSIZE, vals = { 6, 7 } }, - { x = 87, y = 108, min = 0, max = 16000, to = SMLSIZE, vals = { 8, 9 } }, - - -- Gyro Notch 2 - { x = 87, y = 124, min = 0, max = 16000, to = SMLSIZE, vals = { 14, 15 } }, - { x = 87, y = 132, min = 0, max = 16000, to = SMLSIZE, vals = { 16, 17 } }, - - -- D Term Lowpass 1 Dynamic - { x = 87, y = 148, min = 0, max = 1000, to = SMLSIZE, vals = { 34, 35 } }, - { x = 87, y = 156, min = 0, max = 1000, to = SMLSIZE, vals = { 36, 37 } }, - { x = 87, y = 164, min = 0, max = 1, to = SMLSIZE, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- D Term Lowpass 1 - { x = 87, y = 180, min = 0, max = 16000, to = SMLSIZE, vals = { 2, 3 } }, - { x = 87, y = 188, min = 0, max = 1, to = SMLSIZE, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- D Term Lowpass 2 - { x = 87, y = 204, min = 0, max = 16000, to = SMLSIZE, vals = { 27, 28 } }, - { x = 87, y = 212, min = 0, max = 1, to = SMLSIZE, vals = { 29 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- D Term Notch - { x = 87, y = 228, min = 0, max = 16000, to = SMLSIZE, vals = { 10, 11 } }, - { x = 87, y = 236, min = 0, max = 16000, to = SMLSIZE, vals = { 12, 13 } }, - - -- Yaw Lowpass - { x = 87, y = 252, min = 0, max = 500, to = SMLSIZE, vals = { 4, 5 } }, - } -} diff --git a/src/SCRIPTS/BF/X7/gpspids.lua b/src/SCRIPTS/BF/X7/gpspids.lua deleted file mode 100644 index bbbeecab..00000000 --- a/src/SCRIPTS/BF/X7/gpspids.lua +++ /dev/null @@ -1,30 +0,0 @@ - -return { - read = 136, -- MSP_GPS_RESCUE_PIDS - write = 226, -- MSP_SET_GPS_RESCUE_PIDS - title = "GPS / PIDs", - reboot = false, - eepromWrite = true, - minBytes = 14, - requiredVersion = 1.041, - text = { - { t = "P", x = 55, y = 14, to=SMLSIZE }, - { t = "I", x = 83, y = 14, to=SMLSIZE }, - { t = "D", x = 111, y = 14, to=SMLSIZE }, - { t = "Throttle", x = 5, y = 26, to=SMLSIZE }, - { t = "Velocity", x = 5, y = 36, to=SMLSIZE }, - { t = "Yaw" , x = 5, y = 46, to=SMLSIZE }, - }, - fields = { - -- P - { x = 51, y = 26, min = 0, max = 200, vals = { 1,2 }, to=SMLSIZE }, - { x = 51, y = 36, min = 0, max = 200, vals = { 7,8 }, to=SMLSIZE }, - { x = 51, y = 46, min = 0, max = 500, vals = {13,14}, to = SMLSIZE }, - -- I - { x = 79, y = 26, min = 0, max = 200, vals = { 3,4 }, to=SMLSIZE }, - { x = 79, y = 36, min = 0, max = 200, vals = { 9,10 }, to=SMLSIZE }, - -- D - { x = 107, y = 26, min = 0, max = 200, vals = { 5,6 }, to=SMLSIZE }, - { x = 107, y = 36, min = 0, max = 200, vals = { 11,12 }, to=SMLSIZE }, - }, -} diff --git a/src/SCRIPTS/BF/X7/pid_advanced.lua b/src/SCRIPTS/BF/X7/pid_advanced.lua deleted file mode 100644 index 6d51a97c..00000000 --- a/src/SCRIPTS/BF/X7/pid_advanced.lua +++ /dev/null @@ -1,48 +0,0 @@ -return { - read = 94, -- MSP_PID_ADVANCED - write = 95, -- MSP_SET_PID_ADVANCED - title = "PID Adv.", - reboot = false, - eepromWrite = true, - minBytes = 46, - outputBytes = 46, - yMinLimit = 12, - yMaxLimit = 52, - text = { - { t = "Acro Trainer", x = 2, y = 12, to = SMLSIZE }, - { t = "Angle Limit", x = 12, y = 20, to = SMLSIZE }, - - { t = "Throttle Boost", x = 2, y = 28, to = SMLSIZE }, - { t = "Absolute Control", x = 2, y = 36, to = SMLSIZE }, - { t = "I Term Rotation", x = 2, y = 44, to = SMLSIZE }, - { t = "VBAT Compensation", x = 2, y = 52, to = SMLSIZE }, - - { t = "I Term Relax", x = 2, y = 60, to = SMLSIZE }, - { t = "Axes", x = 12, y = 68, to = SMLSIZE }, - { t = "Type", x = 12, y = 76, to = SMLSIZE }, - - { t = "Integrated Yaw", x = 2, y = 84, to = SMLSIZE }, - - { t = "Anti Gravity", x = 2, y = 92, to = SMLSIZE }, - { t = "Mode", x = 12, y = 100, to = SMLSIZE }, - { t = "Gain", x = 12, y = 108, to = SMLSIZE }, - { t = "Threshold", x = 12, y = 116, to = SMLSIZE }, - }, - fields = { - { x = 87, y = 20, to=SMLSIZE, min = 20, max = 80, vals = { 32 } }, - - { x = 87, y = 28, to=SMLSIZE, min = 0, max = 100, vals = { 31 } }, - { x = 87, y = 36, to=SMLSIZE, min = 0, max = 20, vals = { 30 } }, - { x = 87, y = 44, to=SMLSIZE, min = 0, max = 1, vals = { 26 }, table = { [0]="OFF", "ON" } }, - { x = 87, y = 52, to=SMLSIZE, min = 0, max = 1, vals = { 8 }, table = { [0]="OFF", "ON" } }, - - { x = 87, y = 68, to=SMLSIZE, min = 0, max = 4, vals = { 28 }, table = { [0]="NONE", "RP", "RPY", "RP (inc)", "RPY (inc)" } }, - { x = 87, y = 76, to=SMLSIZE, min = 0, max = 1, vals = { 29 }, table = { [0]="Gyro", "Setpoint" } }, - - { x = 87, y = 84, to=SMLSIZE, min = 0, max = 1, vals = { 45 }, table = { [0]="OFF", "ON" } }, - - { x = 87, y = 100, to=SMLSIZE, min = 0, max = 1, vals = { 39 }, table = { [0]="Smooth", "Step" } }, - { x = 87, y = 108, to=SMLSIZE, min = 1000, max = 30000, vals = { 22, 23 }, scale = 1000, mult = 100 }, - { x = 87, y = 116, to=SMLSIZE, min = 20, max = 1000, vals = { 20, 21 } }, - } -} diff --git a/src/SCRIPTS/BF/X7/pids1.lua b/src/SCRIPTS/BF/X7/pids1.lua deleted file mode 100644 index e4519a55..00000000 --- a/src/SCRIPTS/BF/X7/pids1.lua +++ /dev/null @@ -1,31 +0,0 @@ - -return { - read = 112, -- MSP_PID - write = 202, -- MSP_SET_PID - title = "PIDs (1/2)", - reboot = false, - eepromWrite = true, - minBytes = 9, - text = { - { t = "P", x = 45, y = 14, to = SMLSIZE }, - { t = "I", x = 73, y = 14, to = SMLSIZE }, - { t = "D", x = 101, y = 14, to = SMLSIZE }, - { t = "ROLL", x = 10, y = 26, to = SMLSIZE }, - { t = "PITCH", x = 10, y = 36, to = SMLSIZE }, - { t = "YAW", x = 10, y = 46, to = SMLSIZE }, - }, - fields = { - -- P - { x = 41, y = 26, min = 0, max = 200, vals = { 1 }, to = SMLSIZE }, - { x = 41, y = 36, min = 0, max = 200, vals = { 4 }, to = SMLSIZE }, - { x = 41, y = 46, min = 0, max = 200, vals = { 7 }, to = SMLSIZE }, - -- I - { x = 69, y = 26, min = 0, max = 200, vals = { 2 }, to = SMLSIZE }, - { x = 69, y = 36, min = 0, max = 200, vals = { 5 }, to = SMLSIZE }, - { x = 69, y = 46, min = 0, max = 200, vals = { 8 }, to = SMLSIZE }, - -- D - { x = 97, y = 26, min = 0, max = 200, vals = { 3 }, to = SMLSIZE }, - { x = 97, y = 36, min = 0, max = 200, vals = { 6 }, to = SMLSIZE }, - { x = 97, y = 46, min = 0, max = 200, vals = { 9 }, to = SMLSIZE }, - }, -} diff --git a/src/SCRIPTS/BF/X7/pids2.lua b/src/SCRIPTS/BF/X7/pids2.lua deleted file mode 100644 index ee563529..00000000 --- a/src/SCRIPTS/BF/X7/pids2.lua +++ /dev/null @@ -1,46 +0,0 @@ - -return { - read = 94, -- MSP_PID_ADVANCED - write = 95, -- MSP_SET_PID_ADVANCED - title = "PIDs (2/2)", - reboot = false, - eepromWrite = true, - minBytes = 44, - yMinLimit = 11, - yMaxLimit = 52, - text = { - { t = "Feed", x = 45, y = 11, to = SMLSIZE }, - { t = "forward", x = 37, y = 18, to = SMLSIZE }, - { t = "D", x = 85, y = 11, to = SMLSIZE }, - { t = "Min", x = 80, y = 18, to = SMLSIZE }, - { t = "ROLL", x = 10, y = 26, to = SMLSIZE }, - { t = "PITCH", x = 10, y = 36, to = SMLSIZE }, - { t = "YAW", x = 10, y = 46, to = SMLSIZE }, - - { t = "Feedforward", x = 10, y = 60, to = SMLSIZE }, - { t = "Transition", x = 20, y = 68, to = SMLSIZE }, - { t = "D Min", x = 10, y = 76, to = SMLSIZE }, - { t = "Gain", x = 20, y = 84, to = SMLSIZE }, - { t = "Advance", x = 20, y = 92, to = SMLSIZE }, - }, - fields = { - -- ROLL FF - { x = 48, y = 26, min = 0, max = 2000, vals = { 33, 34 }, to = SMLSIZE }, - -- PITCH FF - { x = 48, y = 36, min = 0, max = 2000, vals = { 35, 36 }, to = SMLSIZE }, - -- YAW FF - { x = 48, y = 46, min = 0, max = 2000, vals = { 37, 38 }, to = SMLSIZE }, - -- ROLL D MIN - { x = 80, y = 26, min = 0, max = 100, vals = { 40 }, to = SMLSIZE }, - -- PITCH D MIN - { x = 80, y = 36, min = 0, max = 100, vals = { 41 }, to = SMLSIZE }, - -- YAW D MIN - { x = 80, y = 46, min = 0, max = 100, vals = { 42 }, to = SMLSIZE }, - -- FF TRANSITION - { x = 80, y = 68, min = 0, max = 100, vals = { 9 }, to = SMLSIZE, scale = 100 }, - -- D MIN GAIN - { x = 80, y = 84, min = 0, max = 100, vals = { 43 }, to = SMLSIZE }, - -- D MIN ADVANCE - { x = 80, y = 92, min = 0, max = 200, vals = { 44 }, to = SMLSIZE }, - }, -} diff --git a/src/SCRIPTS/BF/X7/pwm.lua b/src/SCRIPTS/BF/X7/pwm.lua deleted file mode 100644 index ad40fed9..00000000 --- a/src/SCRIPTS/BF/X7/pwm.lua +++ /dev/null @@ -1,55 +0,0 @@ -return { - read = 90, -- MSP_ADVANCED_CONFIG - write = 91, -- MSP_SET_ADVANCED_CONFIG - reboot = true, - eepromWrite = true, - title = "PWM", - minBytes = 9, - text= { - { t = "32K", x = 10, y = 14, to = SMLSIZE }, - { t = "Gyro", x = 10, y = 24, to = SMLSIZE }, - { t = "PID", x = 10, y = 34, to = SMLSIZE }, - { t = "Prot", x = 58, y = 14, to = SMLSIZE }, - { t = "Unsync", x = 58, y = 24, to = SMLSIZE }, - { t = "PWM", x = 58, y = 34, to = SMLSIZE }, - { t = "Idle", x = 58, y = 44, to = SMLSIZE } - }, - fields = { - { x = 32, y = 14, vals = { 9 }, min = 0, max = 1, to = SMLSIZE, table = { [0] = "OFF", "ON" }, upd = function(self) self.updateRateTables(self) end }, - { x = 32, y = 24, vals = { 1 }, min = 1, max = 32, to = SMLSIZE, upd = function(self) self.updatePidRateTable(self) end }, - { x = 32, y = 34, vals = { 2 }, min = 1, max = 16, to = SMLSIZE, }, - { x = 90, y = 14, vals = { 4 }, min = 0, max = 9, to = SMLSIZE, table = { [0] = "OFF", "OS125", "OS42", "MSHOT","BRSH", "DS150", "DS300", "DS600","DS1200", "PS1000" } }, - { x = 90, y = 24, vals = { 3 }, min = 0, max = 1, to = SMLSIZE, table = { [0] = "OFF", "ON" } }, - { x = 90, y = 34, vals = { 5, 6 }, min = 200, max = 32000, to = SMLSIZE }, - { x = 90, y = 44, vals = { 7, 8 }, min = 0, max = 2000, to = SMLSIZE, scale = 100 }, - }, - calculateGyroRates = function(self, baseRate) - self.gyroRates = {} - self.fields[2].table = {} - for i=1, 32 do - self.gyroRates[i] = baseRate/i - local fmt = nil - self.fields[2].table[i] = string.format("%.2f",baseRate/i) - end - end, - calculatePidRates = function(self, baseRate) - self.fields[3].table = {} - for i=1, 16 do - self.fields[3].table[i] = string.format("%.2f",baseRate/i) - end - end, - updateRateTables = function(self) - if self.values[9] == 0 then - self.calculateGyroRates(self, 8) - self.calculatePidRates(self, 8) - elseif self.values[9] == 1 then - self.calculateGyroRates(self, 32) - self.calculatePidRates(self, 32) - end - end, - updatePidRateTable = function(self) - local newRateIdx = self.values[1] - local newRate = self.gyroRates[newRateIdx] - self.calculatePidRates(self, newRate) - end -} diff --git a/src/SCRIPTS/BF/X7/rates.lua b/src/SCRIPTS/BF/X7/rates.lua deleted file mode 100644 index 1724509c..00000000 --- a/src/SCRIPTS/BF/X7/rates.lua +++ /dev/null @@ -1,52 +0,0 @@ -return { - read = 111, -- MSP_RC_TUNING - write = 204, -- MSP_SET_RC_TUNING - title = "Rates", - reboot = false, - eepromWrite = true, - minBytes = 16, - yMinLimit = 11, - yMaxLimit = 52, - text = { - { t = "RC", x = 43, y = 11, to = SMLSIZE }, - { t = "Rate", x = 38, y = 18, to = SMLSIZE }, - { t = "Super", x = 63, y = 11, to = SMLSIZE }, - { t = "Rate", x = 66, y = 18, to = SMLSIZE }, - { t = "RC", x = 99, y = 11, to = SMLSIZE }, - { t = "Expo", x = 94, y = 18, to = SMLSIZE }, - { t = "ROLL", x = 10, y = 26, to = SMLSIZE }, - { t = "PITCH", x = 10, y = 36, to = SMLSIZE }, - { t = "YAW", x = 10, y = 46, to = SMLSIZE }, - - { t = "Throttle", x = 10, y = 60, to = SMLSIZE }, - { t = "Mid", x = 20, y = 68, to = SMLSIZE }, - { t = "Expo", x = 20, y = 76, to = SMLSIZE }, - { t = "Limit Type", x = 20, y = 84, to = SMLSIZE }, - { t = "Limit %", x = 20, y = 92, to = SMLSIZE }, - { t = "TPA", x = 10, y = 100, to = SMLSIZE }, - { t = "Rate", x = 20, y = 108, to = SMLSIZE }, - { t = "Breakpoint", x = 20, y = 116, to = SMLSIZE }, - }, - fields = { - -- RC Rates - { x = 39, y = 26, vals = { 1 }, min = 0, max = 255, scale = 100, to = SMLSIZE }, - { x = 39, y = 36, vals = { 13 }, min = 0, max = 255, scale = 100, to = SMLSIZE }, - { x = 39, y = 46, vals = { 12 }, min = 0, max = 255, scale = 100, to = SMLSIZE }, - -- Super Rates - { x = 66, y = 26, vals = { 3 }, min = 0, max = 100, scale = 100, to = SMLSIZE }, - { x = 66, y = 36, vals = { 4 }, min = 0, max = 100, scale = 100, to = SMLSIZE }, - { x = 66, y = 46, vals = { 5 }, min = 0, max = 255, scale = 100, to = SMLSIZE }, - -- RC Expo - { x = 94, y = 26, vals = { 2 }, min = 0, max = 100, scale = 100, to = SMLSIZE }, - { x = 94, y = 36, vals = { 14 }, min = 0, max = 100, scale = 100, to = SMLSIZE }, - { x = 94, y = 46, vals = { 11 }, min = 0, max = 100, scale = 100, to = SMLSIZE }, - -- Throttle - { x = 70, y = 68, vals = { 7 }, min = 0, max = 100, scale = 100, to = SMLSIZE }, - { x = 70, y = 76, vals = { 8 }, min = 0, max = 100, scale = 100, to = SMLSIZE }, - { x = 70, y = 84, vals = { 15 }, min = 0, max = 2, to = SMLSIZE, table = { [0] = "OFF", "SCALE", "CLIP" } }, - { x = 70, y = 92, vals = { 16 }, min = 25, max = 100, to = SMLSIZE }, - -- TPA - { x = 70, y = 108, vals = { 6 } , min = 0, max = 100, scale = 100, to = SMLSIZE }, - { x = 70, y = 116, vals = { 9, 10 }, min = 1000, max = 2000, to = SMLSIZE }, - }, -} diff --git a/src/SCRIPTS/BF/X7/rescue.lua b/src/SCRIPTS/BF/X7/rescue.lua deleted file mode 100644 index ca5623a0..00000000 --- a/src/SCRIPTS/BF/X7/rescue.lua +++ /dev/null @@ -1,36 +0,0 @@ - -return { - read = 135, -- MSP_GPS_RESCUE - write = 225, -- MSP_SET_GPS_RESCUE - title = "GPS / Rescue", - reboot = false, - eepromWrite = true, - minBytes = 16, - requiredVersion = 1.041, - text = { - - { t = "Min Sats.", x = 3, y = 10, to=SMLSIZE }, - { t = "Angle", x = 3, y = 20, to=SMLSIZE }, - { t = "Initial Alt", x = 3, y = 30, to=SMLSIZE }, - { t = "Descent Dst", x = 3, y = 40, to=SMLSIZE }, - { t = "Ground Spd", x = 3, y = 50, to=SMLSIZE }, - - { t = "Snty.", x = 80, y = 10, to = SMLSIZE }, - { t = "Throttle", x = 80, y = 20, to = SMLSIZE }, - { t = "Min", x = 85, y = 30, to = SMLSIZE }, - { t = "Hover", x = 80, y = 40, to = SMLSIZE }, - { t = "Max", x = 85, y = 50, to = SMLSIZE }, - }, - fields = { - { 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 = 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/src/SCRIPTS/BF/X7/x7pre.lua b/src/SCRIPTS/BF/X7/x7pre.lua deleted file mode 100644 index 3d80a97c..00000000 --- a/src/SCRIPTS/BF/X7/x7pre.lua +++ /dev/null @@ -1,17 +0,0 @@ -PageFiles = -{ - { title = "vTX Settings", script = "vtx.lua"}, - { title = "Gyro / Motor", script = "pwm.lua"}, - { title = "PIDs 1", script = "pids1.lua"}, - { title = "PIDs 2", script = "pids2.lua"}, - { title = "Rates", script = "rates.lua"}, - { title = "Advanced PIDs", script = "pid_advanced.lua"}, - { title = "Filters", script = "filters.lua"}, - { title = "Rx", script = "rx.lua"}, - { title = "GPS Rescue", script = "rescue.lua", requiredVersion = 1.041}, - { title = "GPS PIDs", script = "gpspids.lua", requiredVersion = 1.041}, -} - -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 } diff --git a/src/SCRIPTS/BF/X9/filters.lua b/src/SCRIPTS/BF/X9/filters.lua deleted file mode 100644 index a5dde7d6..00000000 --- a/src/SCRIPTS/BF/X9/filters.lua +++ /dev/null @@ -1,95 +0,0 @@ -return { - read = 92, -- MSP_FILTER_CONFIG - write = 93, -- MSP_SET_FILTER_CONFIG - eepromWrite = true, - reboot = false, - title = "Filters", - minBytes = 37, - outputBytes = 37, - yMinLimit = 12, - yMaxLimit = 52, - text= { - { t = "Gyro Lowpass 1 Dynamic", x = 2, y = 12, to = SMLSIZE }, - { t = "Min Cutoff", x = 12, y = 20, to = SMLSIZE }, - { t = "Max Cutoff", x = 12, y = 28, to = SMLSIZE }, - { t = "Filter Type", x = 12, y = 36, to = SMLSIZE }, - - { t = "Gyro Lowpass 1", x = 2, y = 44, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 52, to = SMLSIZE }, - { t = "Filter Type", x = 12, y = 60, to = SMLSIZE }, - - { t = "Gyro Lowpass 2", x = 2, y = 68, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 76, to = SMLSIZE }, - { t = "Filter Type", x = 12, y = 84, to = SMLSIZE }, - - { t = "Gyro Notch 1", x = 2, y = 92, to = SMLSIZE }, - { t = "Center", x = 12, y = 100, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 108, to = SMLSIZE }, - - { t = "Gyro Notch 2", x = 2, y = 116, to = SMLSIZE }, - { t = "Center", x = 12, y = 124, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 132, to = SMLSIZE }, - - { t = "D Term Lowpass 1 Dynamic", x = 2, y = 140, to = SMLSIZE }, - { t = "Min Cutoff", x = 12, y = 148, to = SMLSIZE }, - { t = "Max Cutoff", x = 12, y = 156, to = SMLSIZE }, - { t = "Filter Type", x = 12, y = 164, to = SMLSIZE }, - - { t = "D Term Lowpass 1", x = 2, y = 172, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 180, to = SMLSIZE }, - { t = "Filter Type", x = 12, y = 188, to = SMLSIZE }, - - { t = "D Term Lowpass 2", x = 2, y = 196, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 204, to = SMLSIZE }, - { t = "Filter Type", x = 12, y = 212, to = SMLSIZE }, - - { t = "D Term Notch", x = 2, y = 220, to = SMLSIZE }, - { t = "Center", x = 12, y = 228, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 236, to = SMLSIZE }, - - { t = "Yaw Lowpass", x = 2, y = 244, to = SMLSIZE }, - { t = "Cutoff", x = 12, y = 252, to = SMLSIZE }, - }, - fields = { - -- Gyro Lowpass 1 Dynamic - { x = 87, y = 20, min = 0, max = 1000, to = SMLSIZE, vals = { 30, 31 } }, - { x = 87, y = 28, min = 0, max = 1000, to = SMLSIZE, vals = { 32, 33 } }, - { x = 87, y = 36, min = 0, max = 1, to = SMLSIZE, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- Gyro Lowpass 1 - { x = 87, y = 52, min = 0, max = 16000, to = SMLSIZE, vals = { 21, 22 } }, - { x = 87, y = 60, min = 0, max = 1, to = SMLSIZE, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- Gyro Lowpass 2 - { x = 87, y = 76, min = 0, max = 16000, to = SMLSIZE, vals = { 23, 24 } }, - { x = 87, y = 84, min = 0, max = 1, to = SMLSIZE, vals = { 26 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- Gyro Notch 1 - { x = 87, y = 100, min = 0, max = 16000, to = SMLSIZE, vals = { 6, 7 } }, - { x = 87, y = 108, min = 0, max = 16000, to = SMLSIZE, vals = { 8, 9 } }, - - -- Gyro Notch 2 - { x = 87, y = 124, min = 0, max = 16000, to = SMLSIZE, vals = { 14, 15 } }, - { x = 87, y = 132, min = 0, max = 16000, to = SMLSIZE, vals = { 16, 17 } }, - - -- D Term Lowpass 1 Dynamic - { x = 87, y = 148, min = 0, max = 1000, to = SMLSIZE, vals = { 34, 35 } }, - { x = 87, y = 156, min = 0, max = 1000, to = SMLSIZE, vals = { 36, 37 } }, - { x = 87, y = 164, min = 0, max = 1, to = SMLSIZE, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- D Term Lowpass 1 - { x = 87, y = 180, min = 0, max = 16000, to = SMLSIZE, vals = { 2, 3 } }, - { x = 87, y = 188, min = 0, max = 1, to = SMLSIZE, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- D Term Lowpass 2 - { x = 87, y = 204, min = 0, max = 16000, to = SMLSIZE, vals = { 27, 28 } }, - { x = 87, y = 212, min = 0, max = 1, to = SMLSIZE, vals = { 29 }, table = { [0] = "PT1", [1] = "BIQUAD" } }, - - -- D Term Notch - { x = 87, y = 228, min = 0, max = 16000, to = SMLSIZE, vals = { 10, 11 } }, - { x = 87, y = 236, min = 0, max = 16000, to = SMLSIZE, vals = { 12, 13 } }, - - -- Yaw Lowpass - { x = 87, y = 252, min = 0, max = 500, to = SMLSIZE, vals = { 4, 5 } }, - } -} diff --git a/src/SCRIPTS/BF/X9/gpspids.lua b/src/SCRIPTS/BF/X9/gpspids.lua deleted file mode 100644 index fa721ca1..00000000 --- a/src/SCRIPTS/BF/X9/gpspids.lua +++ /dev/null @@ -1,30 +0,0 @@ -return { - read = 136, -- MSP_GPS_RESCUE_PIDS - write = 226, -- MSP_SET_GPS_RESCUE_PIDS - title = "GPS Rescue / PIDs", - reboot = false, - eepromWrite = true, - minBytes = 14, - requiredVersion = 1.041, - text = { - { t = "P", x = 70, y = 14, to = SMLSIZE }, - { t = "I", x = 98, y = 14, to = SMLSIZE }, - { t = "D", x = 126, y = 14, to = SMLSIZE }, - { t = "Throttle", x = 25, y = 26, to = SMLSIZE }, - { t = "Velocity", x = 25, y = 36, to = SMLSIZE }, - { t = "Yaw", x = 25, y = 46, to = SMLSIZE }, - }, - fields = { - -- P - { x = 66, y = 26, min = 0, max = 500, vals = { 1,2 }, to = SMLSIZE }, - { x = 66, y = 36, min = 0, max = 500, vals = { 7,8 }, to = SMLSIZE }, - { x = 66, y = 46, min = 0, max = 500, vals = {13,14}, to = SMLSIZE }, - -- I - { x = 94, y = 26, min = 0, max = 500, vals = { 3,4 }, to = SMLSIZE }, - { x = 94, y = 36, min = 0, max = 500, vals = { 9,10 }, to = SMLSIZE }, - -- D - { x = 122, y = 26, min = 0, max = 500, vals = { 5,6 }, to = SMLSIZE }, - { x = 122, y = 36, min = 0, max = 500, vals = { 11,12 }, to = SMLSIZE }, - - }, -} diff --git a/src/SCRIPTS/BF/X9/pid_advanced.lua b/src/SCRIPTS/BF/X9/pid_advanced.lua deleted file mode 100644 index 83fbb05c..00000000 --- a/src/SCRIPTS/BF/X9/pid_advanced.lua +++ /dev/null @@ -1,48 +0,0 @@ -return { - read = 94, -- MSP_PID_ADVANCED - write = 95, -- MSP_SET_PID_ADVANCED - title = "PID Advanced", - reboot = false, - eepromWrite = true, - minBytes = 46, - outputBytes = 46, - yMinLimit = 12, - yMaxLimit = 52, - text = { - { t = "Acro Trainer", x = 2, y = 12, to = SMLSIZE }, - { t = "Angle Limit", x = 12, y = 20, to = SMLSIZE }, - - { t = "Throttle Boost", x = 2, y = 28, to = SMLSIZE }, - { t = "Absolute Control", x = 2, y = 36, to = SMLSIZE }, - { t = "I Term Rotation", x = 2, y = 44, to = SMLSIZE }, - { t = "VBAT Compensation", x = 2, y = 52, to = SMLSIZE }, - - { t = "I Term Relax", x = 2, y = 60, to = SMLSIZE }, - { t = "Axes", x = 12, y = 68, to = SMLSIZE }, - { t = "Type", x = 12, y = 76, to = SMLSIZE }, - - { t = "Integrated Yaw", x = 2, y = 84, to = SMLSIZE }, - - { t = "Anti Gravity", x = 2, y = 92, to = SMLSIZE }, - { t = "Mode", x = 12, y = 100, to = SMLSIZE }, - { t = "Gain", x = 12, y = 108, to = SMLSIZE }, - { t = "Threshold", x = 12, y = 116, to = SMLSIZE }, - }, - fields = { - { x = 87, y = 20, to=SMLSIZE, min = 20, max = 80, vals = { 32 } }, - - { x = 87, y = 28, to=SMLSIZE, min = 0, max = 100, vals = { 31 } }, - { x = 87, y = 36, to=SMLSIZE, min = 0, max = 20, vals = { 30 } }, - { x = 87, y = 44, to=SMLSIZE, min = 0, max = 1, vals = { 26 }, table = { [0]="OFF", "ON" } }, - { x = 87, y = 52, to=SMLSIZE, min = 0, max = 1, vals = { 8 }, table = { [0]="OFF", "ON" } }, - - { x = 87, y = 68, to=SMLSIZE, min = 0, max = 4, vals = { 28 }, table = { [0]="NONE", "RP", "RPY", "RP (increment only)", "RPY (increment only)" } }, - { x = 87, y = 76, to=SMLSIZE, min = 0, max = 1, vals = { 29 }, table = { [0]="Gyro", "Setpoint" } }, - - { x = 87, y = 84, to=SMLSIZE, min = 0, max = 1, vals = { 45 }, table = { [0]="OFF", "ON" } }, - - { x = 87, y = 100, to=SMLSIZE, min = 0, max = 1, vals = { 39 }, table = { [0]="Smooth", "Step" } }, - { x = 87, y = 108, to=SMLSIZE, min = 1000, max = 30000, vals = { 22, 23 }, scale = 1000, mult = 100 }, - { x = 87, y = 116, to=SMLSIZE, min = 20, max = 1000, vals = { 20, 21 } }, - } -} diff --git a/src/SCRIPTS/BF/X9/pids1.lua b/src/SCRIPTS/BF/X9/pids1.lua deleted file mode 100644 index 15843ead..00000000 --- a/src/SCRIPTS/BF/X9/pids1.lua +++ /dev/null @@ -1,31 +0,0 @@ - -return { - read = 112, -- MSP_PID - write = 202, -- MSP_SET_PID - title = "PIDs (1/2)", - reboot = false, - eepromWrite = true, - minBytes = 9, - text = { - { t = "P", x = 70, y = 14, to = SMLSIZE }, - { t = "I", x = 98, y = 14, to = SMLSIZE }, - { t = "D", x = 126, y = 14, to = SMLSIZE }, - { t = "ROLL", x = 25, y = 26, to = SMLSIZE }, - { t = "PITCH", x = 25, y = 36, to = SMLSIZE }, - { t = "YAW", x = 25, y = 46, to = SMLSIZE }, - }, - fields = { - -- P - { x = 66, y = 26, min = 0, max = 200, vals = { 1 }, to = SMLSIZE }, - { x = 66, y = 36, min = 0, max = 200, vals = { 4 }, to = SMLSIZE }, - { x = 66, y = 46, min = 0, max = 200, vals = { 7 }, to = SMLSIZE }, - -- I - { x = 94, y = 26, min = 0, max = 200, vals = { 2 }, to = SMLSIZE }, - { x = 94, y = 36, min = 0, max = 200, vals = { 5 }, to = SMLSIZE }, - { x = 94, y = 46, min = 0, max = 200, vals = { 8 }, to = SMLSIZE }, - -- D - { x = 122, y = 26, min = 0, max = 200, vals = { 3 }, to = SMLSIZE }, - { x = 122, y = 36, min = 0, max = 200, vals = { 6 }, to = SMLSIZE }, - { x = 122, y = 46, min = 0, max = 200, vals = { 9 }, to = SMLSIZE }, - }, -} diff --git a/src/SCRIPTS/BF/X9/pids2.lua b/src/SCRIPTS/BF/X9/pids2.lua deleted file mode 100644 index 5617532e..00000000 --- a/src/SCRIPTS/BF/X9/pids2.lua +++ /dev/null @@ -1,44 +0,0 @@ - -return { - read = 94, -- MSP_PID_ADVANCED - write = 95, -- MSP_SET_PID_ADVANCED - title = "PIDs (2/2)", - reboot = false, - eepromWrite = true, - minBytes = 44, - text = { - { t = "Feed", x = 46, y = 11, to = SMLSIZE }, - { t = "forward", x = 38, y = 18, to = SMLSIZE }, - { t = "D", x = 86, y = 11, to = SMLSIZE }, - { t = "Min", x = 81, y = 18, to = SMLSIZE }, - { t = "ROLL", x = 8, y = 26, to = SMLSIZE }, - { t = "PITCH", x = 8, y = 36, to = SMLSIZE }, - { t = "YAW", x = 8, y = 46, to = SMLSIZE }, - - { t = "Feedforward", x = 110, y = 14, to = SMLSIZE }, - { t = "Transition", x = 120, y = 22, to = SMLSIZE }, - { t = "D Min", x = 110, y = 30, to = SMLSIZE }, - { t = "Gain", x = 120, y = 38, to = SMLSIZE }, - { t = "Advance", x = 120, y = 46, to = SMLSIZE }, - }, - fields = { - -- ROLL FF - { x = 49, y = 26, min = 0, max = 2000, vals = { 33, 34 }, to = SMLSIZE }, - -- PITCH FF - { x = 49, y = 36, min = 0, max = 2000, vals = { 35, 36 }, to = SMLSIZE }, - -- YAW FF - { x = 49, y = 46, min = 0, max = 2000, vals = { 37, 38 }, to = SMLSIZE }, - -- ROLL D MIN - { x = 81, y = 26, min = 0, max = 100, vals = { 40 }, to = SMLSIZE }, - -- PITCH D MIN - { x = 81, y = 36, min = 0, max = 100, vals = { 41 }, to = SMLSIZE }, - -- YAW D MIN - { x = 81, y = 46, min = 0, max = 100, vals = { 42 }, to = SMLSIZE }, - -- FF TRANSITION - { x = 180, y = 22, min = 0, max = 100, vals = { 9 }, to = SMLSIZE, scale = 100 }, - -- D MIN GAIN - { x = 180, y = 38, min = 0, max = 100, vals = { 43 }, to = SMLSIZE }, - -- D MIN ADVANCE - { x = 180, y = 46, min = 0, max = 200, vals = { 44 }, to = SMLSIZE }, - }, -} diff --git a/src/SCRIPTS/BF/X9/pwm.lua b/src/SCRIPTS/BF/X9/pwm.lua deleted file mode 100644 index 8ba7ce9a..00000000 --- a/src/SCRIPTS/BF/X9/pwm.lua +++ /dev/null @@ -1,55 +0,0 @@ -return { - read = 90, -- MSP_ADVANCED_CONFIG - write = 91, -- MSP_SET_ADVANCED_CONFIG - reboot = true, - eepromWrite = true, - title = "PWM", - minBytes = 9, - text= { - { t = "32K", x = 48, y = 14, to = SMLSIZE }, - { t = "Gyro Rt", x = 29, y = 24, to = SMLSIZE }, - { t = "PID Rt", x = 35, y = 34, to = SMLSIZE }, - { t = "Protocol", x = 107, y = 14, to = SMLSIZE }, - { t = "Unsynced", x = 106, y = 24, to = SMLSIZE }, - { t = "PWM Rate", x = 105, y = 34, to = SMLSIZE }, - { t = "Idle Offset", x =94, y = 44, to = SMLSIZE } - }, - fields = { - { x = 65, y = 14, vals = { 9 }, min = 0, max = 1, to = SMLSIZE, table = { [0] = "OFF", "ON" }, upd = function(self) self.updateRateTables(self) end }, - { x = 65, y = 24, vals = { 1 }, min = 1, max = 32, to = SMLSIZE, upd = function(self) self.updatePidRateTable(self) end }, - { x = 65, y = 34, vals = { 2 }, min = 1, max = 16, to = SMLSIZE, }, - { x = 148, y = 14, vals = { 4 }, min = 0, max = 9, to = SMLSIZE, table = { [0] = "OFF", "ONESHOT125", "ONESHOT42", "MULTISHOT","BRUSHED", "DSHOT150", "DSHOT300", "DSHOT600","DSHOT1200", "PROSHOT1000" } }, - { x = 148, y = 24, vals = { 3 }, min = 0, max = 1, to = SMLSIZE, table = { [0] = "OFF", "ON" } }, - { x = 148, y = 34, vals = { 5, 6 }, min = 200, max = 32000, to = SMLSIZE }, - { x = 148, y = 44, vals = { 7, 8 }, min = 0, max = 2000, to = SMLSIZE, scale = 100 }, - }, - calculateGyroRates = function(self, baseRate) - self.gyroRates = {} - self.fields[2].table = {} - for i=1, 32 do - self.gyroRates[i] = baseRate/i - local fmt = nil - self.fields[2].table[i] = string.format("%.2f",baseRate/i) - end - end, - calculatePidRates = function(self, baseRate) - self.fields[3].table = {} - for i=1, 16 do - self.fields[3].table[i] = string.format("%.2f",baseRate/i) - end - end, - updateRateTables = function(self) - if self.values[9] == 0 then - self.calculateGyroRates(self, 8) - self.calculatePidRates(self, 8) - elseif self.values[9] == 1 then - self.calculateGyroRates(self, 32) - self.calculatePidRates(self, 32) - end - end, - updatePidRateTable = function(self) - local newRateIdx = self.values[1] - local newRate = self.gyroRates[newRateIdx] - self.calculatePidRates(self, newRate) - end -} diff --git a/src/SCRIPTS/BF/X9/rates.lua b/src/SCRIPTS/BF/X9/rates.lua deleted file mode 100644 index 707529c9..00000000 --- a/src/SCRIPTS/BF/X9/rates.lua +++ /dev/null @@ -1,52 +0,0 @@ -return { - read = 111, -- MSP_RC_TUNING - write = 204, -- MSP_SET_RC_TUNING - title = "Rates", - reboot = false, - eepromWrite = true, - minBytes = 16, - yMinLimit = 11, - yMaxLimit = 52, - text = { - { t = "RC", x = 43, y = 11, to = SMLSIZE }, - { t = "Rate", x = 38, y = 18, to = SMLSIZE }, - { t = "Super", x = 63, y = 11, to = SMLSIZE }, - { t = "Rate", x = 66, y = 18, to = SMLSIZE }, - { t = "RC", x = 99, y = 11, to = SMLSIZE }, - { t = "Expo", x = 94, y = 18, to = SMLSIZE }, - { t = "ROLL", x = 8, y = 26, to = SMLSIZE }, - { t = "PITCH", x = 8, y = 36, to = SMLSIZE }, - { t = "YAW", x = 8, y = 46, to = SMLSIZE }, - - { t = "Throttle", x = 120, y = 12, to = SMLSIZE }, - { t = "Mid", x = 130, y = 20, to = SMLSIZE }, - { t = "Expo", x = 130, y = 28, to = SMLSIZE }, - { t = "Limit Type", x = 130, y = 36, to = SMLSIZE }, - { t = "Limit %", x = 130, y = 44, to = SMLSIZE }, - { t = "TPA", x = 120, y = 52, to = SMLSIZE }, - { t = "Rate", x = 130, y = 60, to = SMLSIZE }, - { t = "Breakpoint", x = 130, y = 68, to = SMLSIZE }, - }, - fields = { - -- RC Rates - { x = 39, y = 26, vals = { 1 }, min = 0, max = 255, scale = 100, to = SMLSIZE }, - { x = 39, y = 36, vals = { 13 }, min = 0, max = 255, scale = 100, to = SMLSIZE }, - { x = 39, y = 46, vals = { 12 }, min = 0, max = 255, scale = 100, to = SMLSIZE }, - -- Super Rates - { x = 66, y = 26, vals = { 3 }, min = 0, max = 100, scale = 100, to = SMLSIZE }, - { x = 66, y = 36, vals = { 4 }, min = 0, max = 100, scale = 100, to = SMLSIZE }, - { x = 66, y = 46, vals = { 5 }, min = 0, max = 255, scale = 100, to = SMLSIZE }, - -- RC Expo - { x = 94, y = 26, vals = { 2 }, min = 0, max = 100, scale = 100, to = SMLSIZE }, - { x = 94, y = 36, vals = { 14 }, min = 0, max = 100, scale = 100, to = SMLSIZE }, - { x = 94, y = 46, vals = { 11 }, min = 0, max = 100, scale = 100, to = SMLSIZE }, - -- Throttle - { x = 180, y = 20, vals = { 7 }, min = 0, max = 100, scale = 100, to = SMLSIZE }, - { x = 180, y = 28, vals = { 8 }, min = 0, max = 100, scale = 100, to = SMLSIZE }, - { x = 180, y = 36, vals = { 15 }, min = 0, max = 2, to = SMLSIZE, table = { [0] = "OFF", "SCALE", "CLIP" } }, - { x = 180, y = 44, vals = { 16 }, min = 25, max = 100, to = SMLSIZE }, - -- TPA - { x = 180, y = 60, vals = { 6 } , min = 0, max = 100, scale = 100, to = SMLSIZE }, - { x = 180, y = 68, vals = { 9, 10 }, min = 1000, max = 2000, to = SMLSIZE }, - }, -} diff --git a/src/SCRIPTS/BF/X9/rescue.lua b/src/SCRIPTS/BF/X9/rescue.lua deleted file mode 100644 index a79fe51e..00000000 --- a/src/SCRIPTS/BF/X9/rescue.lua +++ /dev/null @@ -1,36 +0,0 @@ -return { - read = 135, -- MSP_GPS_RESCUE - write = 225, -- MSP_SET_GPS_RESCUE - title = "GPS Rescue", - reboot = false, - eepromWrite = true, - minBytes = 16, - requiredVersion = 1.041, - text = { - { t = "Min Sats.", x = 30, y = 16, to = SMLSIZE }, - { t = "Angle", x = 45, y = 26, to = SMLSIZE }, - { t = "Initial Alt.", x = 18, y = 36, to = SMLSIZE }, - { t = "Descent Dist.", x = 10, y = 46, to = SMLSIZE }, - { t = "Ground Speed", x = 10, y = 56, to = SMLSIZE }, - - { t = "Sanity Ch.", x = 125, y = 16, to = SMLSIZE }, - { t = "Throttle", x = 125, y = 26, to = SMLSIZE }, - { t = "Min", x = 128, y = 36, to = SMLSIZE }, - { t = "Hover", x = 120, y = 46, to = SMLSIZE }, - { t = "Max", x = 128, y = 56, to = SMLSIZE }, - }, - fields = { - - { x = 75, y = 16, min = 0, max = 50, vals = { 16 }, to = SMLSIZE }, - { x = 75, y = 26, min = 0, max = 200, vals = { 1 , 2 }, to = SMLSIZE }, - { x = 75, y = 36, min = 20, max = 100, vals = { 3 , 4 }, to = SMLSIZE }, - { x = 75, y = 46, min = 30, max = 500, vals = { 5 , 6 }, to = SMLSIZE }, - { x = 75, y = 56, min = 30, max = 3000, vals = { 7, 8 }, to = SMLSIZE }, - - { x = 180, y = 16, min = 0, max = 2 , vals = { 15 }, to = SMLSIZE,table = { [0]="OFF","ON","FS_ONLY"}}, - { x = 150, y = 36, min = 1000, max = 2000, vals = { 9, 10 }, to = SMLSIZE }, - { x = 150, y = 46, min = 1000, max = 2000, vals = { 13, 14 },to = SMLSIZE }, - { x = 150, y = 56, min = 1000, max = 2000, vals = { 11,12 }, to = SMLSIZE }, - - }, -} diff --git a/src/SCRIPTS/BF/X9/rx.lua b/src/SCRIPTS/BF/X9/rx.lua deleted file mode 100644 index 8824a5fe..00000000 --- a/src/SCRIPTS/BF/X9/rx.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - read = 44, -- MSP_RX_CONFIG - write = 45, -- MSP_SET_RX_CONFIG - title = "RX", - reboot = false, - eepromWrite = true, - minBytes = 23, - text = {}, - fields = { - { t = "Stick Min", x = 30, y = 20, sp = 45, min = 1000, max = 2000, vals = { 6, 7 }, to = SMLSIZE }, - { t = "Stick Mid", x = 30, y = 30, sp = 45, min = 1000, max = 2000, vals = { 4, 5 }, to = SMLSIZE }, - { t = "Stick Max", x = 30, y = 40, sp = 45, min = 1000, max = 2000, vals = { 2, 3 }, to = SMLSIZE }, - { t = "Cam Angle", x = 110, y = 20, sp = 50, min = 0, max = 90, vals = { 23 }, to = SMLSIZE }, - { t = "Interp", x = 110, y = 30, sp = 50, min = 0, max = 3, vals = { 13 }, to = SMLSIZE, table={ [0]="Off", "Preset", "Auto", "Manual"} }, - { t = "Interp Int", x = 110, y = 40, sp = 50, min = 1, max = 50, vals = { 14 }, to = SMLSIZE }, - }, -} diff --git a/src/SCRIPTS/BF/X9/vtx.lua b/src/SCRIPTS/BF/X9/vtx.lua deleted file mode 100644 index 23f99f48..00000000 --- a/src/SCRIPTS/BF/X9/vtx.lua +++ /dev/null @@ -1,248 +0,0 @@ - -return { - read = 88, -- MSP_VTX_CONFIG - write = 89, -- MSP_VTX_SET_CONFIG - eepromWrite = true, - reboot = false, - title = "VTX", - minBytes = 5, - prevBandVal = 0, - prevChanVal = 0, - prevFreqVal = 0, - lastFreqUpdTS = 0, - freqModCounter = 0, - text = {}, - fields = { - { 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 }, - { t = "Channel", x = 25, y = 24, sp = 50, min=1, max=8, vals = { 3 }, to = SMLSIZE, upd = function(self) self.handleBandChanUpdate(self) end }, - { t = "Power", x = 25, y = 34, sp = 50, min=1, vals = { 4 }, to = SMLSIZE, upd = function(self) self.updatePowerTable(self) end }, - { t = "Pit", x = 25, y = 44, sp = 50, min=0, max=1, vals = { 5 }, to = SMLSIZE, table = { [0]="OFF", "ON" } }, - { 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"} }, - { t = "Freq", x = 100, y = 24, sp = 32, min = 5000, max = 5999, vals = { 6 }, to = SMLSIZE, upd = function(self) self.handleFreqValUpdate(self) end }, - }, - freqLookup = { - { 5865, 5845, 5825, 5805, 5785, 5765, 5745, 5725 }, -- Boscam A - { 5733, 5752, 5771, 5790, 5809, 5828, 5847, 5866 }, -- Boscam B - { 5705, 5685, 5665, 5645, 5885, 5905, 5925, 5945 }, -- Boscam E - { 5740, 5760, 5780, 5800, 5820, 5840, 5860, 5880 }, -- FatShark - { 5658, 5695, 5732, 5769, 5806, 5843, 5880, 5917 }, -- RaceBand - }, - postLoad = function (self) - if (self.values[2] or 0) < 0 or (self.values[3] or 0) == 0 or (self.values[4] or 0) == 0 then - self.values = {} - else - self.prevBandVal = 0 -- reset value trackers - self.prevChanVal = 0 - self.prevFreqVal = 0 - local rFreq - if (self.values[7] or 0) > 0 then - rFreq = math.floor(self.values[6] + (self.values[7] * 256)) - else - rFreq = 0 - end - if (self.values[2] or 0) > 0 then -- band != 0 - if rFreq > 0 then - self.prevFreqVal = rFreq - self.prevBandVal = self.values[2] - self.prevChanVal = self.values[3] - self.fields[1].min = 0 -- make sure 'U' band allowed - self.eepromWrite = true - self.fields[6].value = rFreq - self.values[6] = rFreq - else -- if user freq not supported then - self.fields[1].min = 1 -- don't allow 'U' band - self.eepromWrite = false -- don't write EEPROM on older Betaflight versions - end - else -- band == 0 - if rFreq > 0 then - self.prevFreqVal = rFreq - self.fields[1].min = 0 -- make sure 'U' band allowed - self.eepromWrite = true - self.fields[6].value = rFreq - self.values[6] = rFreq - -- set chan via freq / 100 - self.prevChanVal = clipValue(math.floor((rFreq - 5100) / 100), - self.fields[2].min, self.fields[2].max) - self.fields[2].value = self.prevChanVal - self.values[3] = self.prevChanVal - else - self.values = {} - end - end - end - end, - preSave = function(self) - local valsTemp = {} - if self.values then - local channel - if self.values[2] > 0 then -- band != 0 - channel = (self.values[2]-1)*8 + self.values[3]-1 - elseif self.fields[6].value then -- band == 0 - channel = self.fields[6].value - else - channel = 24 - end - valsTemp[1] = bit32.band(channel,0xFF) - valsTemp[2] = bit32.rshift(channel,8) - valsTemp[3] = self.values[4] - valsTemp[4] = self.values[5] - end - return valsTemp - end, - -- find closest value in freq table that is above/below given freq - findNextInFreqTable = function(self, newFreq) - local startBand - local endBand - local incFlag -- freq increasing or decreasing - if newFreq > self.prevFreqVal then - incFlag = 1 - startBand = 1 - endBand = self.fields[1].max - else - incFlag = -1 - startBand = self.fields[1].max - endBand = 1 - end - local curBand = self.values[2] - local curChan = self.values[3] - local selBand = 0 - local selChan = 0 - local selFreq = 0 - local diffVal = 9999 - local fVal - local minChan = self.fields[2].min - local maxChan = self.fields[2].max - -- need to scan bands in same "direction" as 'incFlag' - -- so same-freq selections will be handled properly (F8 & R7) - for band=startBand,endBand,incFlag do - for chan=minChan,maxChan do - if band ~= curBand or chan ~= curChan then -- don't reselect same band/chan - fVal = self.freqLookup[band][chan] - if incFlag > 0 then - if fVal >= self.prevFreqVal and fVal - self.prevFreqVal < diffVal then - -- if same freq then only select if "next" band: - if fVal ~= self.prevFreqVal or band > curBand then - selBand = band - selChan = chan - selFreq = fVal - diffVal = fVal - self.prevFreqVal - end - end - else - if fVal <= self.prevFreqVal and self.prevFreqVal - fVal < diffVal then - -- if same freq then only select if "previous" band: - if fVal ~= self.prevFreqVal or band < curBand then - selBand = band - selChan = chan - selFreq = fVal - diffVal = self.prevFreqVal - fVal - end - end - end - end - end - end - return selFreq, selBand, selChan - end, - -- returns the next user-frequency value in MHz; implements an - -- "exponential" modification rate so dialing in values is faster - getNextUserFreqValue = function(self, newFreq) - local now = getTime() -- track rate of change for possible mod speedup - if now < self.lastFreqUpdTS + 15 then - self.freqModCounter = self.freqModCounter + (15-(self.lastFreqUpdTS-now)) -- increase counter for mod speedup - else - self.freqModCounter = 0 -- no mod speedup - end - local uFreq - if self.freqModCounter > 65 then -- rate is fast enough; do mod speedup - if newFreq > self.prevFreqVal then - uFreq = clipValue(newFreq + math.floor(self.freqModCounter / 65), - self.fields[6].min, self.fields[6].max) - else - uFreq = clipValue(newFreq - math.floor(self.freqModCounter / 65), - self.fields[6].min, self.fields[6].max) - end - else - uFreq = newFreq - end - self.lastFreqUpdTS = now - return uFreq - end, - updatePowerTable = function(self) - if self.values and not self.fields[3].table then - if self.values[1] == 1 then -- RTC6705 - self.fields[3].table = { 25, 200 } - self.fields[3].max = 2 - self.fields[4].t = nil -- don't display Pit field - self.fields[4].table = { [0]="", "" } - elseif self.values[1] == 3 then -- SmartAudio - self.fields[3].table = { 25, 200, 500, 800 } - self.fields[3].max = 4 - elseif self.values[1] == 4 then -- Tramp - self.fields[3].table = { 25, 100, 200, 400, 600 } - self.fields[3].max = 5 - elseif self.values[1] == 255 then -- None/Unknown - self.fields[3].t = nil -- don't display Power field - self.fields[3].max = 1 - self.fields[3].table = { [1]="" } - self.fields[4].t = nil -- don't display Pit field - self.fields[4].table = { [0]="", "" } - end - end - end, - handleBandChanUpdate = function(self) - if (#(self.values) or 0) >= self.minBytes then - if (self.values[3] or 0) > 0 then - if self.values[2] ~= self.prevBandVal or self.values[3] ~= self.prevChanVal then - if self.values[2] > 0 then -- band != 0 - self.prevFreqVal = self.freqLookup[self.values[2]][self.values[3]] - else -- band == 0; set freq via channel*100 - self.prevFreqVal = math.floor(5100 + (self.values[3] * 100)) - end - self.fields[6].value = self.prevFreqVal - self.values[6] = self.prevFreqVal - self.prevBandVal = self.values[2] - self.prevChanVal = self.values[3] - end - end - end - end, - handleFreqValUpdate = function(self) - if (#(self.values) or 0) >= self.minBytes and (self.fields[6].value or 0) > 0 then - local newFreq = self.fields[6].value - if newFreq ~= self.prevFreqVal then - if self.values[2] == 0 then - -- band == 0 - local uFreq = self.getNextUserFreqValue(self, newFreq) - self.prevFreqVal = uFreq - if uFreq ~= newFreq then - self.fields[6].value = uFreq - self.values[6] = uFreq - end - -- set channel value via freq/100 - self.prevChanVal = clipValue(math.floor((self.prevFreqVal - 5100) / 100), - self.fields[2].min, self.fields[2].max) - self.fields[2].value = self.prevChanVal - self.values[3] = self.prevChanVal - else - -- band != 0; find closest freq in table that is above/below dialed freq - local selFreq, selBand, selChan = self.findNextInFreqTable(self, newFreq) - if selFreq > 0 then - self.prevFreqVal = selFreq - self.prevBandVal = selBand - self.prevChanVal = selChan - self.fields[6].value = selFreq -- using new freq from table - self.values[6] = selFreq - self.fields[1].value = self.prevBandVal -- set band value for freq - self.values[2] = self.prevBandVal - self.fields[2].value = self.prevChanVal -- set channel value for freq - self.values[3] = self.prevChanVal - else - self.fields[6].value = self.prevFreqVal -- if no match then revert freq - self.values[6] = self.prevFreqVal - end - end - end - end - end -} diff --git a/src/SCRIPTS/BF/X9/x9pre.lua b/src/SCRIPTS/BF/X9/x9pre.lua deleted file mode 100644 index c7505682..00000000 --- a/src/SCRIPTS/BF/X9/x9pre.lua +++ /dev/null @@ -1,17 +0,0 @@ -PageFiles = -{ - { title = "PIDs 1", script = "pids1.lua"}, - { title = "PIDs 2", script = "pids2.lua"}, - { title = "Rates", script = "rates.lua"}, - { title = "Advanced PIDs", script = "pid_advanced.lua"}, - { title = "Filters", script = "filters.lua"}, - { title = "vTX Settings", script = "vtx.lua"}, - { title = "Gyro / Motor", script = "pwm.lua"}, - { title = "Rx", script = "rx.lua"}, - { title = "GPS Rescue", script = "rescue.lua", requiredVersion = 1.041}, - { title = "GPS PIDs", script = "gpspids.lua", requiredVersion = 1.041}, -} - -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 } diff --git a/src/SCRIPTS/BF/pages.lua b/src/SCRIPTS/BF/pages.lua new file mode 100644 index 00000000..ef003801 --- /dev/null +++ b/src/SCRIPTS/BF/pages.lua @@ -0,0 +1,13 @@ +PageFiles = +{ + { title = "VTX Settings", script = "vtx.lua" }, + { title = "PIDs 1", script = "pids1.lua" }, + { title = "PIDs 2", script = "pids2.lua" }, + { title = "Rates", script = "rates.lua" }, + { title = "Advanced PIDs", script = "pid_advanced.lua" }, + { title = "Filters", script = "filters.lua" }, + { title = "Gyro / Motor", script = "pwm.lua" }, + { title = "Receiver", script = "rx.lua" }, + { title = "GPS Rescue", script = "rescue.lua", requiredVersion = 1.041 }, + { title = "GPS PIDs", script = "gpspids.lua", requiredVersion = 1.041 }, +} \ No newline at end of file diff --git a/src/SCRIPTS/BF/radios.lua b/src/SCRIPTS/BF/radios.lua index 84cb77c3..651180f5 100644 --- a/src/SCRIPTS/BF/radios.lua +++ b/src/SCRIPTS/BF/radios.lua @@ -4,41 +4,54 @@ lcdResolution = high = 1 } -local supportedPlatforms = { - x7 = +local supportedRadios = +{ + ["128x64"] = { - templateHome = SCRIPT_HOME.."/X7/", - preLoad = SCRIPT_HOME.."/X7/x7pre.lua", - resolution = lcdResolution.low + templateHome = SCRIPT_HOME.."/LAYOUT/128x64/", + resolution = lcdResolution.low, + 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 = 11, + yMaxLimit = 52, }, - x9 = + ["212x64"] = { - templateHome = SCRIPT_HOME.."/X9/", - preLoad = SCRIPT_HOME.."/X9/x9pre.lua", - resolution = lcdResolution.low + templateHome = SCRIPT_HOME.."/LAYOUT/212x64/", + resolution = lcdResolution.low, + 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, }, - horus = + ["480x272"] = { - templateHome = SCRIPT_HOME.."/HORUS/", - preLoad = SCRIPT_HOME.."/HORUS/horuspre.lua", - resolution = lcdResolution.high + templateHome = SCRIPT_HOME.."/LAYOUT/480x272/", + resolution = lcdResolution.high, + 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", BLINK }, + textSize = MIDSIZE, + yMinLimit = 35, + yMaxLimit = 215, }, - nv14 = + ["320x480"] = { - templateHome = SCRIPT_HOME.."/NV14/", - preLoad = SCRIPT_HOME.."/NV14/nv14pre.lua", - resolution = lcdResolution.high + templateHome = SCRIPT_HOME.."/LAYOUT/320x480/", + resolution = lcdResolution.high, + 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", BLINK }, + textSize = MIDSIZE, + yMinLimit = 35, + yMaxLimit = 215, }, } -local supportedRadios = -{ - ["128x64"] = supportedPlatforms.x7, - ["212x64"] = supportedPlatforms.x9, - ["480x272"] = supportedPlatforms.horus, - ["320x480"] = supportedPlatforms.nv14, -} - local ver, rad, maj, min, rev = getVersion() local radio = supportedRadios[tostring(LCD_W) .. "x" .. tostring(LCD_H)] diff --git a/src/SCRIPTS/BF/ui.lua b/src/SCRIPTS/BF/ui.lua index 7b93a884..f765d83f 100644 --- a/src/SCRIPTS/BF/ui.lua +++ b/src/SCRIPTS/BF/ui.lua @@ -180,21 +180,21 @@ function drawScreenTitle(screen_title) end local function drawScreen() - local yMinLim = Page.yMinLimit or 0 - local yMaxLim = Page.yMaxLimit or LCD_H - local currentLineY = Page.fields[currentLine].y + local yMinLim = radio.yMinLimit or 0 + local yMaxLim = radio.yMaxLimit or LCD_H + local currentLineY = Page.fieldLayout[currentLine].y local screen_title = Page.title drawScreenTitle("Betaflight / "..screen_title) - if currentLineY <= Page.fields[1].y then + if currentLineY <= Page.fieldLayout[1].y then scrollPixelsY = 0 elseif currentLineY - scrollPixelsY <= yMinLim then scrollPixelsY = currentLineY - yMinLim elseif currentLineY - scrollPixelsY >= yMaxLim then scrollPixelsY = currentLineY - yMaxLim end - for i=1,#(Page.text) do - local f = Page.text[i] - local textOptions = (f.to or 0) + globalTextOptions + for i=1,#(Page.labels) do + local f = Page.labels[i] + local textOptions = radio.textSize + globalTextOptions if (f.y - scrollPixelsY) >= yMinLim and (f.y - scrollPixelsY) <= yMaxLim then lcd.drawText(f.x, f.y - scrollPixelsY, f.t, textOptions) end @@ -202,7 +202,8 @@ local function drawScreen() local val = "---" for i=1,#(Page.fields) do local f = Page.fields[i] - local text_options = (f.to or 0) + globalTextOptions + local pos = Page.fieldLayout[i] + local text_options = radio.textSize + globalTextOptions local heading_options = text_options local value_options = text_options if i == currentLine then @@ -210,18 +211,7 @@ local function drawScreen() if currentState == pageStatus.editing then value_options = value_options + BLINK end - end - local spacing = 20 - if f.t ~= nil then - if (f.y - scrollPixelsY) >= yMinLim and (f.y - scrollPixelsY) <= yMaxLim then - lcd.drawText(f.x, f.y - scrollPixelsY, f.t, heading_options) - end - if f.sp ~= nil then - spacing = f.sp - end - else - spacing = 0 - end + end if f.value then if f.upd and Page.values then f.upd(Page) @@ -231,8 +221,8 @@ local function drawScreen() val = f.table[f.value] end end - if (f.y - scrollPixelsY) >= yMinLim and (f.y - scrollPixelsY) <= yMaxLim then - lcd.drawText(f.x + spacing, f.y - scrollPixelsY, val, value_options) + if (pos.y - scrollPixelsY) >= yMinLim and (pos.y - scrollPixelsY) <= yMaxLim then + lcd.drawText(pos.x, pos.y - scrollPixelsY, val, value_options) end end end @@ -266,11 +256,11 @@ local function incValue(inc) end local function drawPopupMenu() - local x = MenuBox.x - local y = MenuBox.y - local w = MenuBox.w - local h_line = MenuBox.h_line - local h_offset = MenuBox.h_offset + local x = radio.MenuBox.x + local y = radio.MenuBox.y + local w = radio.MenuBox.w + local h_line = radio.MenuBox.h_line + local h_offset = radio.MenuBox.h_offset local h = #(popupMenuList) * h_line + h_offset*2 lcd.drawFilledRectangle(x,y,w,h,backgroundFill) @@ -282,7 +272,7 @@ local function drawPopupMenu() if popupMenuActive == i then text_options = text_options + INVERS end - lcd.drawText(x+MenuBox.x_offset,y+(i-1)*h_line+h_offset,e.t,text_options) + lcd.drawText(x+radio.MenuBox.x_offset,y+(i-1)*h_line+h_offset,e.t,text_options) end end @@ -372,14 +362,12 @@ function run_ui(event) end local nextPage = currentPage while Page == nil do - Page = assert(loadScript(radio.templateHome .. PageFiles[currentPage].script))() + Page = assert(loadScript(SCRIPT_HOME.."/Pages/"..PageFiles[currentPage].script))() if Page.requiredVersion and apiVersion > 0 and Page.requiredVersion > apiVersion then incPage(1) - if currentPage == nextPage then lcd.clear() - lcd.drawText(NoTelem[1], NoTelem[2], "No Pages! API: " .. apiVersion, NoTelem[4]) - + lcd.drawText(radio.NoTelem[1], radio.NoTelem[2], "No Pages! API: " .. apiVersion, radio.NoTelem[4]) return 1 end end @@ -393,17 +381,17 @@ function run_ui(event) end drawScreen() if protocol.rssi() == 0 then - lcd.drawText(NoTelem[1],NoTelem[2],NoTelem[3],NoTelem[4]) + lcd.drawText(radio.NoTelem[1],radio.NoTelem[2],radio.NoTelem[3],radio.NoTelem[4]) end if currentState == pageStatus.popupMenu then drawPopupMenu() elseif currentState == pageStatus.saving then - lcd.drawFilledRectangle(SaveBox.x,SaveBox.y,SaveBox.w,SaveBox.h,backgroundFill) - lcd.drawRectangle(SaveBox.x,SaveBox.y,SaveBox.w,SaveBox.h,SOLID) + lcd.drawFilledRectangle(radio.SaveBox.x,radio.SaveBox.y,radio.SaveBox.w,radio.SaveBox.h,backgroundFill) + lcd.drawRectangle(radio.SaveBox.x,radio.SaveBox.y,radio.SaveBox.w,radio.SaveBox.h,SOLID) if saveRetries <= 0 then - lcd.drawText(SaveBox.x+SaveBox.x_offset,SaveBox.y+SaveBox.h_offset,"Saving...",DBLSIZE + BLINK + (globalTextOptions)) + lcd.drawText(radio.SaveBox.x+radio.SaveBox.x_offset,radio.SaveBox.y+radio.SaveBox.h_offset,"Saving...",DBLSIZE + BLINK + (globalTextOptions)) else - lcd.drawText(SaveBox.x+SaveBox.x_offset,SaveBox.y+SaveBox.h_offset,"Retrying",DBLSIZE + (globalTextOptions)) + lcd.drawText(radio.SaveBox.x+radio.SaveBox.x_offset,radio.SaveBox.y+radio.SaveBox.h_offset,"Retrying",DBLSIZE + (globalTextOptions)) end end if currentState == pageStatus.mainMenu and (not isTelemetryScript) then @@ -415,26 +403,32 @@ function run_ui(event) incMainMenu(-1) end lcd.clear() - lcd.drawScreenTitle("Betaflight Config", 0, 0) + drawScreenTitle("Betaflight Config", 0, 0) + local yMinLim = radio.yMinLimit + local yMaxLim = radio.yMaxLimit + local lineSpacing = 10 + if radio.resolution == lcdResolution.high then + lineSpacing = 25 + end for i=1, #PageFiles do - local yMinLim = 10 - local yMaxLim = LCD_H - 8 - local currentLineY = (menuLine-1)*8 + yMinLim - if currentLineY <= yMaxLim then - scrollPixelsY = 0 - elseif currentLineY - scrollPixelsY <= yMinLim then - scrollPixelsY = currentLineY - yMinLim*2 - elseif currentLineY - scrollPixelsY >= yMaxLim then - scrollPixelsY = currentLineY - yMaxLim + 6 - end - local attr = (menuLine == i and INVERS or 0) - if event == EVT_VIRTUAL_ENTER and attr == INVERS then - Page = assert(loadScript(radio.templateHome .. PageFiles[i].script))() - currentPage = i - currentState = pageStatus.display - end - if ((i-1)*8 + yMinLim - scrollPixelsY) >= yMinLim and ((i-1)*8 + yMinLim - scrollPixelsY) <= yMaxLim then - lcd.drawText(6, (i-1)*8 + yMinLim - scrollPixelsY, PageFiles[i].title, attr) + if not Page.requiredVersion or (apiVersion > 0 and Page.requiredVersion < apiVersion) then + local currentLineY = (menuLine-1)*lineSpacing + yMinLim + if currentLineY <= yMaxLim then + scrollPixelsY = 0 + elseif currentLineY - scrollPixelsY <= yMinLim then + scrollPixelsY = currentLineY - yMinLim + elseif currentLineY - scrollPixelsY >= yMaxLim then + scrollPixelsY = currentLineY - yMaxLim + end + local attr = (menuLine == i and INVERS or 0) + if event == EVT_VIRTUAL_ENTER and attr == INVERS then + Page = assert(loadScript(SCRIPT_HOME.."/Pages/"..PageFiles[i].script))() + currentPage = i + currentState = pageStatus.display + end + if ((i-1)*lineSpacing + yMinLim - scrollPixelsY) >= yMinLim and ((i-1)*lineSpacing + yMinLim - scrollPixelsY) <= yMaxLim then + lcd.drawText(6, (i-1)*lineSpacing + yMinLim - scrollPixelsY, PageFiles[i].title, attr) + end end end end diff --git a/src/SCRIPTS/TELEMETRY/bf.lua b/src/SCRIPTS/TELEMETRY/bf.lua index b6f47f95..92434f5a 100644 --- a/src/SCRIPTS/TELEMETRY/bf.lua +++ b/src/SCRIPTS/TELEMETRY/bf.lua @@ -1,16 +1,15 @@ SCRIPT_HOME = "/SCRIPTS/BF" apiVersion = 0 +isTelemetryScript = true protocol = assert(loadScript(SCRIPT_HOME.."/protocols.lua"))() radio = assert(loadScript(SCRIPT_HOME.."/radios.lua"))() -assert(loadScript(radio.preLoad))() +assert(loadScript(SCRIPT_HOME.."/pages.lua"))() assert(loadScript(protocol.transport))() assert(loadScript(SCRIPT_HOME.."/MSP/common.lua"))() -isTelemetryScript = true - local run_ui = assert(loadScript(SCRIPT_HOME.."/ui.lua"))() local background = assert(loadScript(SCRIPT_HOME.."/background.lua"))() diff --git a/src/SCRIPTS/TOOLS/bf.lua b/src/SCRIPTS/TOOLS/bf.lua index 444652d7..fdbdd054 100644 --- a/src/SCRIPTS/TOOLS/bf.lua +++ b/src/SCRIPTS/TOOLS/bf.lua @@ -7,7 +7,7 @@ isTelemetryScript = false protocol = assert(loadScript(SCRIPT_HOME.."/protocols.lua"))() radio = assert(loadScript(SCRIPT_HOME.."/radios.lua"))() -assert(loadScript(radio.preLoad))() +assert(loadScript(SCRIPT_HOME.."/pages.lua"))() assert(loadScript(protocol.transport))() assert(loadScript(SCRIPT_HOME.."/MSP/common.lua"))()