diff --git a/src/SCRIPTS/BF/LAYOUT/128x64/filters.lua b/src/SCRIPTS/BF/LAYOUT/128x64/filters.lua deleted file mode 100644 index b76da948..00000000 --- a/src/SCRIPTS/BF/LAYOUT/128x64/filters.lua +++ /dev/null @@ -1,58 +0,0 @@ -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 deleted file mode 100644 index 64911d96..00000000 --- a/src/SCRIPTS/BF/LAYOUT/128x64/gpspids.lua +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index 37b6fdb3..00000000 --- a/src/SCRIPTS/BF/LAYOUT/128x64/pid_advanced.lua +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100644 index 1efeb2e7..00000000 --- a/src/SCRIPTS/BF/LAYOUT/128x64/pids1.lua +++ /dev/null @@ -1,21 +0,0 @@ -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 deleted file mode 100644 index 82b5957c..00000000 --- a/src/SCRIPTS/BF/LAYOUT/128x64/pids2.lua +++ /dev/null @@ -1,27 +0,0 @@ -return { - labels = { - { t = "Feed", x = 45, y = 12, }, - { t = "forward", x = 37, y = 20, }, - { t = "D", x = 85, y = 12, }, - { t = "Min", x = 80, y = 20, }, - { t = "ROLL", x = 10, y = 28, }, - { t = "PITCH", x = 10, y = 38, }, - { t = "YAW", x = 10, y = 48, }, - { 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 = 28, }, - { x = 48, y = 38, }, - { x = 48, y = 48, }, - { x = 80, y = 28, }, - { x = 80, y = 38, }, - { x = 80, y = 48, }, - { x = 80, y = 68, }, - { x = 80, y = 84, }, - { x = 80, y = 92, }, - }, -} \ No newline at end of file diff --git a/src/SCRIPTS/BF/LAYOUT/128x64/pwm.lua b/src/SCRIPTS/BF/LAYOUT/128x64/pwm.lua deleted file mode 100644 index d2cc1cc7..00000000 --- a/src/SCRIPTS/BF/LAYOUT/128x64/pwm.lua +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index 1872ec9e..00000000 --- a/src/SCRIPTS/BF/LAYOUT/128x64/rates.lua +++ /dev/null @@ -1,38 +0,0 @@ -return { - labels = { - { t = "RC", x = 43, y = 12, }, - { t = "Rate", x = 38, y = 20, }, - { t = "Super", x = 63, y = 12, }, - { t = "Rate", x = 66, y = 20, }, - { t = "RC", x = 99, y = 12, }, - { t = "Expo", x = 94, y = 20, }, - { t = "ROLL", x = 10, y = 28, }, - { t = "PITCH", x = 10, y = 38, }, - { t = "YAW", x = 10, y = 48, }, - { 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 = 28, }, - { x = 39, y = 38, }, - { x = 39, y = 48, }, - { x = 66, y = 28, }, - { x = 66, y = 38, }, - { x = 66, y = 48, }, - { x = 94, y = 28, }, - { x = 94, y = 38, }, - { x = 94, y = 48, }, - { 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 deleted file mode 100644 index 5d6f6eaf..00000000 --- a/src/SCRIPTS/BF/LAYOUT/128x64/rescue.lua +++ /dev/null @@ -1,29 +0,0 @@ -return { - labels = { - { t = "Min Sats.", x = 3, y = 12, }, - { t = "Angle", x = 3, y = 22, }, - { t = "Initial Alt", x = 3, y = 32, }, - { t = "Descent Dst", x = 3, y = 42, }, - { t = "Ground Spd", x = 3, y = 52, }, - { t = "Arm w/o fix", x = 3, y = 62, }, - { t = "Snty.", x = 80, y = 12, }, - { t = "Throttle", x = 80, y = 22, }, - { t = "Min", x = 85, y = 32, }, - { t = "Hover", x = 80, y = 42, }, - { t = "Max", x = 85, y = 52, }, - }, - fieldLayout = { - { x = 58, y = 12, }, - { x = 58, y = 22, }, - { x = 58, y = 32, }, - { x = 58, y = 42, }, - { x = 58, y = 52, }, - { x = 58, y = 62, }, - { x = 105, y = 12, }, - { x = 105, y = 32, }, - { x = 105, y = 42, }, - { x = 105, y = 52, }, - { x = 105, y = 52, }, - - }, -} diff --git a/src/SCRIPTS/BF/LAYOUT/128x64/rx.lua b/src/SCRIPTS/BF/LAYOUT/128x64/rx.lua deleted file mode 100644 index de0baf03..00000000 --- a/src/SCRIPTS/BF/LAYOUT/128x64/rx.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - labels = { - { t = "Stick Min", x = 10, y = 12 }, - { t = "Stick Mid", x = 10, y = 22 }, - { t = "Stick Max", x = 10, y = 32 }, - { t = "Cam Angle", x = 10, y = 42 }, - { t = "Interp", x = 10, y = 52 }, - { t = "Interp Int", x = 10, y = 62 }, - }, - fieldLayout = { - { x = 70, y = 12, }, - { x = 70, y = 22, }, - { x = 70, y = 32, }, - { x = 70, y = 42, }, - { x = 70, y = 52, }, - { x = 70, y = 62, } - }, - } \ No newline at end of file diff --git a/src/SCRIPTS/BF/LAYOUT/128x64/vtx.lua b/src/SCRIPTS/BF/LAYOUT/128x64/vtx.lua deleted file mode 100644 index 355b9e4d..00000000 --- a/src/SCRIPTS/BF/LAYOUT/128x64/vtx.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - labels = { - { t = "Band", x = 10, y = 14 }, - { t = "Chan", 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 deleted file mode 100644 index f5edfbb8..00000000 --- a/src/SCRIPTS/BF/LAYOUT/212x64/filters.lua +++ /dev/null @@ -1,58 +0,0 @@ -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 deleted file mode 100644 index 178b5232..00000000 --- a/src/SCRIPTS/BF/LAYOUT/212x64/gpspids.lua +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index 37b6fdb3..00000000 --- a/src/SCRIPTS/BF/LAYOUT/212x64/pid_advanced.lua +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100644 index 66ccafb5..00000000 --- a/src/SCRIPTS/BF/LAYOUT/212x64/pids1.lua +++ /dev/null @@ -1,21 +0,0 @@ -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 deleted file mode 100644 index d97819d8..00000000 --- a/src/SCRIPTS/BF/LAYOUT/212x64/pids2.lua +++ /dev/null @@ -1,27 +0,0 @@ -return { - labels = { - { t = "Feed", x = 46, y = 12, }, - { t = "forward", x = 38, y = 20, }, - { t = "D", x = 86, y = 12, }, - { t = "Min", x = 81, y = 20, }, - { t = "ROLL", x = 8, y = 28, }, - { t = "PITCH", x = 8, y = 38, }, - { t = "YAW", x = 8, y = 48, }, - { 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 = 48, }, - }, - fieldLayout = { - { x = 49, y = 28, }, - { x = 49, y = 38, }, - { x = 49, y = 48, }, - { x = 81, y = 28, }, - { x = 81, y = 38, }, - { x = 81, y = 48, }, - { x = 180, y = 22, }, - { x = 180, y = 38, }, - { x = 180, y = 48, }, - }, -} diff --git a/src/SCRIPTS/BF/LAYOUT/212x64/pwm.lua b/src/SCRIPTS/BF/LAYOUT/212x64/pwm.lua deleted file mode 100644 index 098d3835..00000000 --- a/src/SCRIPTS/BF/LAYOUT/212x64/pwm.lua +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index 15ab72b3..00000000 --- a/src/SCRIPTS/BF/LAYOUT/212x64/rates.lua +++ /dev/null @@ -1,38 +0,0 @@ -return { - labels = { - { t = "RC", x = 43, y = 12, }, - { t = "Rate", x = 38, y = 20, }, - { t = "Super", x = 63, y = 12, }, - { t = "Rate", x = 66, y = 20, }, - { t = "RC", x = 99, y = 12, }, - { t = "Expo", x = 94, y = 20, }, - { t = "ROLL", x = 8, y = 28, }, - { t = "PITCH", x = 8, y = 38, }, - { t = "YAW", x = 8, y = 48, }, - { 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 = 28, }, - { x = 39, y = 38, }, - { x = 39, y = 48, }, - { x = 66, y = 28, }, - { x = 66, y = 38, }, - { x = 66, y = 48, }, - { x = 94, y = 28, }, - { x = 94, y = 38, }, - { x = 94, y = 48, }, - { 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 deleted file mode 100644 index 40ff9232..00000000 --- a/src/SCRIPTS/BF/LAYOUT/212x64/rescue.lua +++ /dev/null @@ -1,27 +0,0 @@ -return { - labels = { - { t = "Min Sats.", x = 30, y = 12, }, - { t = "Angle", x = 45, y = 22, }, - { t = "Initial Alt.", x = 18, y = 32, }, - { t = "Descent Dist.", x = 10, y = 42, }, - { t = "Ground Speed", x = 10, y = 52, }, - { t = "Arm w/o fix", x = 15, y = 62, }, - { t = "Sanity Ch.", x = 125, y = 12, }, - { t = "Throttle", x = 125, y = 22, }, - { t = "Min", x = 128, y = 32, }, - { t = "Hover", x = 120, y = 42, }, - { t = "Max", x = 128, y = 52, }, - }, - fieldLayout = { - { x = 75, y = 12, }, - { x = 75, y = 22, }, - { x = 75, y = 32, }, - { x = 75, y = 42, }, - { x = 75, y = 52, }, - { x = 75, y = 62, }, - { x = 180, y = 12, }, - { x = 150, y = 32, }, - { x = 150, y = 42, }, - { x = 150, y = 52, }, - }, -} diff --git a/src/SCRIPTS/BF/LAYOUT/212x64/rx.lua b/src/SCRIPTS/BF/LAYOUT/212x64/rx.lua deleted file mode 100644 index 24c48664..00000000 --- a/src/SCRIPTS/BF/LAYOUT/212x64/rx.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - labels = { - { t = "Stick Min", x = 30, y = 12 }, - { t = "Stick Mid", x = 30, y = 22 }, - { t = "Stick Max", x = 30, y = 32 }, - { t = "Cam Angle", x = 110, y = 12 }, - { t = "Interp", x = 110, y = 22 }, - { t = "Interp Int", x = 110, y = 32 }, - }, - fieldLayout = { - { x = 80, y = 12, }, - { x = 80, y = 22, }, - { x = 80, y = 32, }, - { x = 160, y = 12, }, - { x = 160, y = 22, }, - { x = 160, y = 32, } - }, -} diff --git a/src/SCRIPTS/BF/LAYOUT/212x64/vtx.lua b/src/SCRIPTS/BF/LAYOUT/212x64/vtx.lua deleted file mode 100644 index 170aa41c..00000000 --- a/src/SCRIPTS/BF/LAYOUT/212x64/vtx.lua +++ /dev/null @@ -1,18 +0,0 @@ -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 = 14, }, - { x = 75, y = 24, }, - { x = 75, y = 34, }, - { x = 75, y = 44, }, - { x = 150, y = 14, }, - { x = 150, y = 24, }, - }, -} diff --git a/src/SCRIPTS/BF/LAYOUT/320x480/filters.lua b/src/SCRIPTS/BF/LAYOUT/320x480/filters.lua deleted file mode 100644 index b75db021..00000000 --- a/src/SCRIPTS/BF/LAYOUT/320x480/filters.lua +++ /dev/null @@ -1,58 +0,0 @@ -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 deleted file mode 100644 index c7dd58c8..00000000 --- a/src/SCRIPTS/BF/LAYOUT/320x480/gpspids.lua +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index a35a9904..00000000 --- a/src/SCRIPTS/BF/LAYOUT/320x480/pid_advanced.lua +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100644 index 5ace790b..00000000 --- a/src/SCRIPTS/BF/LAYOUT/320x480/pids1.lua +++ /dev/null @@ -1,21 +0,0 @@ -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 deleted file mode 100644 index 730c81ac..00000000 --- a/src/SCRIPTS/BF/LAYOUT/320x480/pids2.lua +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index a05535ca..00000000 --- a/src/SCRIPTS/BF/LAYOUT/320x480/pwm.lua +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index 95f3d156..00000000 --- a/src/SCRIPTS/BF/LAYOUT/320x480/rates.lua +++ /dev/null @@ -1,38 +0,0 @@ -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 deleted file mode 100644 index d09658d7..00000000 --- a/src/SCRIPTS/BF/LAYOUT/320x480/rescue.lua +++ /dev/null @@ -1,27 +0,0 @@ -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 = "Arm w/o fix", x = 10, y = 240, }, - { t = "Snty.", x = 10, y = 260 }, - { t = "Throttle", x = 10, y = 320 }, - { t = "Min", x = 10, y = 360 }, - { t = "Hover", x = 10, y = 400 }, - { t = "Max", x = 10, y = 440 }, - }, - 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, }, - { x = 260, y = 440, }, - }, -} \ No newline at end of file diff --git a/src/SCRIPTS/BF/LAYOUT/320x480/rx.lua b/src/SCRIPTS/BF/LAYOUT/320x480/rx.lua deleted file mode 100644 index d9c5ae83..00000000 --- a/src/SCRIPTS/BF/LAYOUT/320x480/rx.lua +++ /dev/null @@ -1,18 +0,0 @@ -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 deleted file mode 100644 index fedff593..00000000 --- a/src/SCRIPTS/BF/LAYOUT/320x480/vtx.lua +++ /dev/null @@ -1,18 +0,0 @@ -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 deleted file mode 100644 index 39267df6..00000000 --- a/src/SCRIPTS/BF/LAYOUT/480x272/filters.lua +++ /dev/null @@ -1,58 +0,0 @@ -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 deleted file mode 100644 index 42c82a6a..00000000 --- a/src/SCRIPTS/BF/LAYOUT/480x272/gpspids.lua +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index a35a9904..00000000 --- a/src/SCRIPTS/BF/LAYOUT/480x272/pid_advanced.lua +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100644 index 2896075d..00000000 --- a/src/SCRIPTS/BF/LAYOUT/480x272/pids1.lua +++ /dev/null @@ -1,22 +0,0 @@ - -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 deleted file mode 100644 index 8f4bc5da..00000000 --- a/src/SCRIPTS/BF/LAYOUT/480x272/pids2.lua +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 31dad642..00000000 --- a/src/SCRIPTS/BF/LAYOUT/480x272/pwm.lua +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index 85425eb2..00000000 --- a/src/SCRIPTS/BF/LAYOUT/480x272/rates.lua +++ /dev/null @@ -1,38 +0,0 @@ -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 deleted file mode 100644 index e79db748..00000000 --- a/src/SCRIPTS/BF/LAYOUT/480x272/rescue.lua +++ /dev/null @@ -1,27 +0,0 @@ -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 = "Arm w/o fix", x = 10, y = 240, }, - { 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 = 260, y = 240, }, - { 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 deleted file mode 100644 index 175e8bf2..00000000 --- a/src/SCRIPTS/BF/LAYOUT/480x272/rx.lua +++ /dev/null @@ -1,18 +0,0 @@ -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 deleted file mode 100644 index b844b488..00000000 --- a/src/SCRIPTS/BF/LAYOUT/480x272/vtx.lua +++ /dev/null @@ -1,18 +0,0 @@ -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/PAGES/filters.lua b/src/SCRIPTS/BF/PAGES/filters.lua deleted file mode 100644 index 8b4d53fe..00000000 --- a/src/SCRIPTS/BF/PAGES/filters.lua +++ /dev/null @@ -1,35 +0,0 @@ -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/filters1.lua b/src/SCRIPTS/BF/PAGES/filters1.lua new file mode 100644 index 00000000..8b8a9adc --- /dev/null +++ b/src/SCRIPTS/BF/PAGES/filters1.lua @@ -0,0 +1,122 @@ +local template = loadScript(radio.templateHome.."filters1.lua") +if template then + template = template() +else + template = assert(loadScript(radio.templateHome.."default_template.lua"))() +end +local margin = template.margin +local indent = template.indent +local lineSpacing = template.lineSpacing +local tableSpacing = template.tableSpacing +local sp = template.listSpacing.field +local yMinLim = radio.yMinLimit +local x = margin +local y = yMinLim - lineSpacing +local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end } +local labels = {} +local fields = {} + +if apiVersion >= 1.041 then + labels[#labels + 1] = { t = "Gyro Lowpass 1 Dynamic", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Min Cutoff", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1000, vals = { 30, 31 } } + labels[#labels + 1] = { t = "Max Cutoff", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1000, vals = { 32, 33 } } + labels[#labels + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } } +end + +if apiVersion >= 1.016 then + labels[#labels + 1] = { t = "Gyro Lowpass 1", x = x, y = inc.y(lineSpacing) } + if apiVersion >= 1.039 then + labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 21, 22 } } + labels[#labels + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 25 }, table = { [0] = "PT1", [1] = "BIQUAD" } } + else + labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 255, vals = { 1 } } + end +end + +if apiVersion >= 1.039 then + labels[#labels + 1] = { t = "Gyro Lowpass 2", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 23, 24 } } + labels[#labels + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 26 }, table = { [0] = "PT1", [1] = "BIQUAD" } } +end + +if apiVersion >= 1.020 then + labels[#labels + 1] = { t = "Gyro Notch 1", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Center", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 6, 7 } } + labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 8, 9 } } +end + +if apiVersion >= 1.021 then + labels[#labels + 1] = { t = "Gyro Notch 2", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Center", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 14, 15 } } + labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 16, 17 } } +end + +if apiVersion >= 1.041 then + labels[#labels + 1] = { t = "D Term Lowpass 1 Dynamic", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Min Cutoff", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1000, vals = { 34, 35 } } + labels[#labels + 1] = { t = "Max Cutoff", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1000, vals = { 36, 37 } } + labels[#labels + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } } +end + +if apiVersion >= 1.016 then + labels[#labels + 1] = { t = "D Term Lowpass 1", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 2, 3 } } + if apiVersion >= 1.036 and apiVersion <= 1.038 then + labels[#labels + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 2, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD", [2] = "FIR" } } + elseif apiVersion >= 1.039 then + labels[#labels + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 18 }, table = { [0] = "PT1", [1] = "BIQUAD" } } + end +end + +if apiVersion >= 1.039 then + labels[#labels + 1] = { t = "D Term Lowpass 2", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 27, 28 } } + if apiVersion >= 1.041 then + labels[#labels + 1] = { t = "Filter Type", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 29 }, table = { [0] = "PT1", [1] = "BIQUAD" } } + end +end + +if apiVersion >= 1.020 then + labels[#labels + 1] = { t = "D Term Notch", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Center", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 10, 11 } } + labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 16000, vals = { 12, 13 } } +end + +if apiVersion >= 1.016 then + labels[#labels + 1] = { t = "Yaw Lowpass", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 500, vals = { 4, 5 } } +end + +return { + read = 92, -- MSP_FILTER_CONFIG + write = 93, -- MSP_SET_FILTER_CONFIG + eepromWrite = true, + reboot = false, + title = "Filters (1/2)", + minBytes = 5, + labels = labels, + fields = fields, +} diff --git a/src/SCRIPTS/BF/PAGES/filters2.lua b/src/SCRIPTS/BF/PAGES/filters2.lua new file mode 100644 index 00000000..bc67b75a --- /dev/null +++ b/src/SCRIPTS/BF/PAGES/filters2.lua @@ -0,0 +1,45 @@ +local template = loadScript(radio.templateHome.."filters2.lua") +if template then + template = template() +else + template = assert(loadScript(radio.templateHome.."default_template.lua"))() +end +local margin = template.margin +local indent = template.indent +local lineSpacing = template.lineSpacing +local tableSpacing = template.tableSpacing +local sp = template.listSpacing.field +local yMinLim = radio.yMinLimit +local x = margin +local y = yMinLim - lineSpacing +local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end } +local labels = {} +local fields = {} + +if apiVersion >= 1.042 then + labels[#labels + 1] = { t = "Gyro RPM Filter", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Harmonics", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 3, vals = { 44 } } + labels[#labels + 1] = { t = "Min Frequency", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 50, max = 200, vals = { 45 } } + labels[#labels + 1] = { t = "Dynamic Notch Filter", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Range", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 3, vals = { 38 }, table = { [0]="HIGH", "MEDIUM", "LOW", "AUTO" } } + labels[#labels + 1] = { t = "Width %", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 20, vals = { 39 } } + labels[#labels + 1] = { t = "Q", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 1, max = 1000, vals = { 40, 41 } } + labels[#labels + 1] = { t = "Min Frequency", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 60, max = 1000, vals = { 42, 43 } } +end + +return { + read = 92, -- MSP_FILTER_CONFIG + write = 93, -- MSP_SET_FILTER_CONFIG + eepromWrite = true, + reboot = false, + title = "Filters (2/2)", + minBytes = 5, + labels = labels, + fields = fields, +} diff --git a/src/SCRIPTS/BF/PAGES/gpspids.lua b/src/SCRIPTS/BF/PAGES/gpspids.lua index 0fbfabe4..dd6af065 100644 --- a/src/SCRIPTS/BF/PAGES/gpspids.lua +++ b/src/SCRIPTS/BF/PAGES/gpspids.lua @@ -1,21 +1,59 @@ -local display = assert(loadScript(radio.templateHome.."gpspids.lua"))() +local template = loadScript(radio.templateHome.."gpspids.lua") +if template then + template = template() +else + template = assert(loadScript(radio.templateHome.."default_template.lua"))() +end +local margin = template.margin +local indent = template.indent +local lineSpacing = template.lineSpacing +local tableSpacing = template.tableSpacing +local sp = template.listSpacing.field +local yMinLim = radio.yMinLimit +local x = margin +local y = yMinLim - lineSpacing +local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end } +local labels = {} +local fields = {} + +if apiVersion >= 1.041 then + x = margin + y = yMinLim - tableSpacing.header + labels[#labels + 1] = { t = "", x = x, y = inc.y(tableSpacing.header) } + labels[#labels + 1] = { t = "Throttle", x = x, y = inc.y(tableSpacing.row) } + labels[#labels + 1] = { t = "Velocity", x = x, y = inc.y(tableSpacing.row) } + labels[#labels + 1] = { t = "Yaw", x = x, y = inc.y(tableSpacing.row) } + + x = x + tableSpacing.col*1.3 + y = yMinLim - tableSpacing.header + + labels[#labels + 1] = { t = "P", x = x, y = inc.y(tableSpacing.header) } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 1, 2 } } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 7, 8 } } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 500, vals = { 13, 14 } } + + x = x + tableSpacing.col + y = yMinLim - tableSpacing.header + + labels[#labels + 1] = { t = "I", x = x, y = inc.y(tableSpacing.header) } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 3, 4 } } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 9, 10 } } + + x = x + tableSpacing.col + y = yMinLim - tableSpacing.header + + labels[#labels + 1] = { t = "D", x = x, y = inc.y(tableSpacing.header) } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 5, 6 } } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 11, 12 } } +end + 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 + read = 136, -- MSP_GPS_RESCUE_PIDS + write = 226, -- MSP_SET_GPS_RESCUE_PIDS + title = "GPS Rescue / PIDs", + reboot = false, + eepromWrite = true, + minBytes = 14, + labels = labels, + fields = fields, +} diff --git a/src/SCRIPTS/BF/PAGES/pid_advanced.lua b/src/SCRIPTS/BF/PAGES/pid_advanced.lua index fb23a25a..471062ba 100644 --- a/src/SCRIPTS/BF/PAGES/pid_advanced.lua +++ b/src/SCRIPTS/BF/PAGES/pid_advanced.lua @@ -1,25 +1,79 @@ -local display = assert(loadScript(radio.templateHome.."pid_advanced.lua"))() +local template = loadScript(radio.templateHome.."pid_advanced.lua") +if template then + template = template() +else + template = assert(loadScript(radio.templateHome.."default_template.lua"))() +end +local margin = template.margin +local indent = template.indent +local lineSpacing = template.lineSpacing +local tableSpacing = template.tableSpacing +local sp = template.listSpacing.field +local yMinLim = radio.yMinLimit +local x = margin +local y = yMinLim - lineSpacing +local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end } +local labels = {} +local fields = {} + +if apiVersion >= 1.040 then + labels[#labels + 1] = { t = "Acro Trainer", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Angle Limit", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 20, max = 80, vals = { 32 } } + labels[#labels + 1] = { t = "Throttle Boost", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 100, vals = { 31 } } + labels[#labels + 1] = { t = "Absolute Control", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 20, vals = { 30 } } + labels[#labels + 1] = { t = "I Term Rotation", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 26 }, table = { [0]="OFF", "ON" } } +end + +if apiVersion >= 1.016 then + labels[#labels + 1] = { t = "VBAT Compensation", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 8 }, table = { [0]="OFF", "ON" } } +end + +if apiVersion >= 1.040 and apiVersion <= 1.041 then + labels[#labels + 1] = { t = "Smart Feedforward", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 27 }, table = { [0] = "OFF", "ON" } } +end + +if apiVersion >= 1.040 then + labels[#labels + 1] = { t = "I Term Relax", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Axes", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 4, vals = { 28 }, table = { [0]="NONE", "RP", "RPY", "RP (inc)", "RPY (inc)" } } + labels[#labels + 1] = { t = "Type", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 29 }, table = { [0]="Gyro", "Setpoint" } } + if apiVersion >= 1.042 then + labels[#labels + 1] = { t = "Cutoff", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 1, max = 100, vals = { 47 } } + end +end + +if apiVersion >= 1.041 then + labels[#labels + 1] = { t = "Integrated Yaw", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 45 }, table = { [0]="OFF", "ON" } } +end + +if apiVersion >= 1.036 then + labels[#labels + 1] = { t = "Anti Gravity", x = x, y = inc.y(lineSpacing) } + if apiVersion >= 1.040 then + labels[#labels + 1] = { t = "Mode", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 39 }, table = { [0]="Smooth", "Step" } } + end + labels[#labels + 1] = { t = "Gain", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 1000, max = 30000, vals = { 22, 23 }, scale = 1000, mult = 100 } + labels[#labels + 1] = { t = "Threshold", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 20,max = 1000, vals = { 20, 21 } } +end + 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 + read = 94, -- MSP_PID_ADVANCED + write = 95, -- MSP_SET_PID_ADVANCED + title = "PID Advanced", + reboot = false, + eepromWrite = true, + minBytes = 8, + labels = labels, + fields = fields, +} diff --git a/src/SCRIPTS/BF/PAGES/pids1.lua b/src/SCRIPTS/BF/PAGES/pids1.lua index 6a5fd4ba..b3e9830f 100644 --- a/src/SCRIPTS/BF/PAGES/pids1.lua +++ b/src/SCRIPTS/BF/PAGES/pids1.lua @@ -1,22 +1,64 @@ -local display = assert(loadScript(radio.templateHome.."pids1.lua"))() +local template = loadScript(radio.templateHome.."pids1.lua") +if template then + template = template() +else + template = assert(loadScript(radio.templateHome.."default_template.lua"))() +end +local margin = template.margin +local indent = template.indent +local lineSpacing = template.lineSpacing +local tableSpacing = template.tableSpacing +local sp = template.listSpacing.field +local yMinLim = radio.yMinLimit +local x = margin +local y = yMinLim - lineSpacing +local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end } +local labels = {} +local fields = {} + +if apiVersion >= 1.016 then + x = margin + y = yMinLim - tableSpacing.header + + labels[#labels + 1] = { t = "", x = x, y = inc.y(tableSpacing.header) } + labels[#labels + 1] = { t = "ROLL", x = x, y = inc.y(tableSpacing.row) } + labels[#labels + 1] = { t = "PITCH", x = x, y = inc.y(tableSpacing.row) } + labels[#labels + 1] = { t = "YAW", x = x, y = inc.y(tableSpacing.row) } + + x = x + tableSpacing.col + y = yMinLim - tableSpacing.header + + labels[#labels + 1] = { t = "P", x = x, y = inc.y(tableSpacing.header) } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 1 } } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 4 } } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 7 } } + + x = x + tableSpacing.col + y = yMinLim - tableSpacing.header + + labels[#labels + 1] = { t = "I", x = x, y = inc.y(tableSpacing.header) } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 2 } } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 5 } } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 8 } } + + x = x + tableSpacing.col + y = yMinLim - tableSpacing.header + + labels[#labels + 1] = { t = "D", x = x, y = inc.y(tableSpacing.header) } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 3 } } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 6 } } + if apiVersion >= 1.041 then + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 200, vals = { 9 } } + end +end + 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 }, }, - }, + read = 112, -- MSP_PID + write = 202, -- MSP_SET_PID + title = "PIDs (1/2)", + reboot = false, + eepromWrite = true, + minBytes = 9, + labels = labels, + fields = fields, } diff --git a/src/SCRIPTS/BF/PAGES/pids2.lua b/src/SCRIPTS/BF/PAGES/pids2.lua index 248dfd09..46cf7e2b 100644 --- a/src/SCRIPTS/BF/PAGES/pids2.lua +++ b/src/SCRIPTS/BF/PAGES/pids2.lua @@ -1,22 +1,87 @@ -local display = assert(loadScript(radio.templateHome.."pids2.lua"))() +local template = loadScript(radio.templateHome.."pids2.lua") +if template then + template = template() +else + template = assert(loadScript(radio.templateHome.."default_template.lua"))() +end +local margin = template.margin +local indent = template.indent +local lineSpacing = template.lineSpacing +local tableSpacing = template.tableSpacing +local sp = template.listSpacing.field +local yMinLim = radio.yMinLimit +local x = margin +local y = yMinLim - lineSpacing +local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end } +local labels = {} +local fields = {} + +if apiVersion >= 1.040 then + x = margin + y = yMinLim - tableSpacing.header + + labels[#labels + 1] = { t = "", x = x, y = inc.y(tableSpacing.header) } + labels[#labels + 1] = { t = "ROLL", x = x, y = inc.y(tableSpacing.row) } + labels[#labels + 1] = { t = "PITCH", x = x, y = inc.y(tableSpacing.row) } + labels[#labels + 1] = { t = "YAW", x = x, y = inc.y(tableSpacing.row) } + + x = x + tableSpacing.col + y = yMinLim - tableSpacing.header + + labels[#labels + 1] = { t = "FF", x = x, y = inc.y(tableSpacing.header) } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 2000, vals = { 33, 34 } } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 2000, vals = { 35, 36 } } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 2000, vals = { 37, 38 } } + + if apiVersion >= 1.041 then + x = x + tableSpacing.col + y = yMinLim - tableSpacing.header + + labels[#labels + 1] = { t = "D Min", x = x, y = inc.y(tableSpacing.header) } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 100, vals = { 40 } } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 100, vals = { 41 } } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 100, vals = { 42 } } + end + + x = margin + y = inc.y(lineSpacing*0.4) +end + + + +if apiVersion >= 1.040 then + labels[#labels + 1] = { t = "Feedforward", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Transition", x = indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 100, vals = { 9 }, scale = 100 } +end + +if apiVersion >= 1.041 then + labels[#labels + 1] = { t = "D Min", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Gain", x = indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 100, vals = { 43 } } + labels[#labels + 1] = { t = "Advance", x = indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 200, vals = { 44 } } +end + +if apiVersion >= 1.021 and apiVersion <= 1.039 then + labels[#labels + 1] = { t = "Dterm Setpoint", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Weight", x = indent, y = inc.y(lineSpacing) } + if apiVersion >= 1.021 and apiVersion <= 1.038 then + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 254, vals = { 10 }, scale = 100 } + else + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 254, vals = { 25 }, scale = 100 } + end + labels[#labels + 1] = { t = "Transition", x = indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 100, vals = { 9 }, scale = 100 } +end + 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 }, }, - }, + read = 94, -- MSP_PID_ADVANCED + write = 95, -- MSP_SET_PID_ADVANCED + title = "PIDs (2/2)", + reboot = false, + eepromWrite = true, + minBytes = 17, + labels = labels, + fields = fields, } diff --git a/src/SCRIPTS/BF/PAGES/pwm.lua b/src/SCRIPTS/BF/PAGES/pwm.lua index 72dfd2b9..3a025fb0 100644 --- a/src/SCRIPTS/BF/PAGES/pwm.lua +++ b/src/SCRIPTS/BF/PAGES/pwm.lua @@ -1,35 +1,79 @@ -local display = assert(loadScript(radio.templateHome.."pwm.lua"))() +local template = loadScript(radio.templateHome.."pwm.lua") +if template then + template = template() +else + template = assert(loadScript(radio.templateHome.."default_template.lua"))() +end +local margin = template.margin +local indent = template.indent +local lineSpacing = template.lineSpacing +local tableSpacing = template.tableSpacing +local sp = template.listSpacing.field +local yMinLim = radio.yMinLimit +local x = margin +local y = yMinLim - lineSpacing +local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end } +local labels = {} +local fields = {} + +if apiVersion >= 1.031 and apiVersion <= 1.040 then + labels[#labels + 1] = { t = "32kHz Sampling", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 9 }, table = { [0] = "OFF", "ON" }, upd = function(self) self.updateRateTables(self) end } +end + +if apiVersion >= 1.016 then + labels[#labels + 1] = { t = "Gyro Update", x = x, y = inc.y(lineSpacing)} + fields[#fields + 1] = { x = x + sp, y = y, min = 1, max = 32, vals = { 1 }, table = {}, upd = function(self) self.updatePidRateTable(self) end } + labels[#labels + 1] = { t = "PID Loop", x = x, y = inc.y(lineSpacing)} + fields[#fields + 1] = { x = x + sp, y = y, min = 1, max = 16, vals = { 2 }, table = {} } + labels[#labels + 1] = { t = "Protocol", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 9, vals = { 4 }, table = { [0] = "OFF", "OS125", "OS42", "MSHOT","BRSH", "DS150", "DS300", "DS600","DS1200", "PS1000" } } + labels[#labels + 1] = { t = "Unsynced PWM", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 3 }, table = { [0] = "OFF", "ON" } } + labels[#labels + 1] = { t = "PWM Frequency", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 200, max = 32000, vals = { 5, 6 }, } +end + +if apiVersion >= 1.031 then + labels[#labels + 1] = { t = "Idle Throttle %", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 2000, vals = { 7, 8 }, scale = 100 } +end + 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 }, - }, + read = 90, -- MSP_ADVANCED_CONFIG + write = 91, -- MSP_SET_ADVANCED_CONFIG + reboot = true, + eepromWrite = true, + title = "PWM", + minBytes = 6, + labels = labels, + fields = fields, + gyroRates = {}, + getGyroDenomFieldIndex = function(self) + for i=1,#self.fields do + if self.fields[i].vals[1] == 1 then + return i + end + end + end, + getPidDenomFieldIndex = function(self) + for i=1,#self.fields do + if self.fields[i].vals[1] == 2 then + return i + end + end + end, calculateGyroRates = function(self, baseRate) - self.gyroRates = {} - self.fields[2].table = {} + local idx = self.getGyroDenomFieldIndex(self) for i=1, 32 do self.gyroRates[i] = baseRate/i - local fmt = nil - self.fields[2].table[i] = string.format("%.2f",baseRate/i) + self.fields[idx].table[i] = string.format("%.2f",baseRate/i) end end, calculatePidRates = function(self, baseRate) - self.fields[3].table = {} + local idx = self.getPidDenomFieldIndex(self) for i=1, 16 do - self.fields[3].table[i] = string.format("%.2f",baseRate/i) + self.fields[idx].table[i] = string.format("%.2f",baseRate/i) end end, updateRateTables = function(self) @@ -42,6 +86,7 @@ return { end end, updatePidRateTable = function(self) + self.updateRateTables(self) local newRateIdx = self.values[1] local newRate = self.gyroRates[newRateIdx] self.calculatePidRates(self, newRate) diff --git a/src/SCRIPTS/BF/PAGES/rates.lua b/src/SCRIPTS/BF/PAGES/rates.lua index 96fa2b4d..8d0f600d 100644 --- a/src/SCRIPTS/BF/PAGES/rates.lua +++ b/src/SCRIPTS/BF/PAGES/rates.lua @@ -1,28 +1,100 @@ -local display = assert(loadScript(radio.templateHome.."rates.lua"))() +local template = loadScript(radio.templateHome.."rates.lua") +if template then + template = template() +else + template = assert(loadScript(radio.templateHome.."default_template.lua"))() +end +local margin = template.margin +local indent = template.indent +local lineSpacing = template.lineSpacing +local tableSpacing = template.tableSpacing +local sp = template.listSpacing.field +local yMinLim = radio.yMinLimit +local x = margin +local y = yMinLim - lineSpacing +local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end } +local labels = {} +local fields = {} + +if apiVersion >= 1.016 then + y = yMinLim - tableSpacing.header + + labels[#labels + 1] = { t = "", x = x, y = inc.y(tableSpacing.header) } + labels[#labels + 1] = { t = "", x = x, y = inc.y(tableSpacing.header) } + labels[#labels + 1] = { t = "ROLL", x = x, y = inc.y(tableSpacing.row) } + labels[#labels + 1] = { t = "PITCH", x = x, y = inc.y(tableSpacing.row) } + labels[#labels + 1] = { t = "YAW", x = x, y = inc.y(tableSpacing.row) } + + x = x + tableSpacing.col + y = yMinLim - tableSpacing.header + + labels[#labels + 1] = { t = "RC", x = x, y = inc.y(tableSpacing.header) } + labels[#labels + 1] = { t = "Rate", x = x, y = inc.y(tableSpacing.header) } + if apiVersion >= 1.037 then + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 255, vals = { 1 }, scale = 100 } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 255, vals = { 13 }, scale = 100 } + else + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row*1.5), min = 0, max = 255, vals = { 1 }, scale = 100 } + inc.y(tableSpacing.row*0.5) + end + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 255, vals = { 12 }, scale = 100 } + + x = x + tableSpacing.col + y = yMinLim - tableSpacing.header + + labels[#labels + 1] = { t = "Super", x = x, y = inc.y(tableSpacing.header) } + labels[#labels + 1] = { t = "Rate", x = x, y = inc.y(tableSpacing.header) } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 100, vals = { 3 }, scale = 100 } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 100, vals = { 4 }, scale = 100 } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 255, vals = { 5 }, scale = 100 } + + x = x + tableSpacing.col + y = yMinLim - tableSpacing.header + + labels[#labels + 1] = { t = "RC", x = x, y = inc.y(tableSpacing.header) } + labels[#labels + 1] = { t = "Expo", x = x, y = inc.y(tableSpacing.header) } + if apiVersion >= 1.037 then + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 100, vals = { 2 }, scale = 100 } + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 100, vals = { 14 }, scale = 100 } + else + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row*1.5), min = 0, max = 100, vals = { 2 }, scale = 100 } + inc.y(tableSpacing.row*0.5) + end + fields[#fields + 1] = { x = x, y = inc.y(tableSpacing.row), min = 0, max = 100, vals = { 11 }, scale = 100 } + + x = margin + inc.y(lineSpacing*0.4) +end + +if apiVersion >= 1.016 then + labels[#labels + 1] = { t = "Throttle", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Mid", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 100, vals = { 7 }, scale = 100 } + labels[#labels + 1] = { t = "Expo", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 100, vals = { 8 }, scale = 100 } + if apiVersion >= 1.041 then + labels[#labels + 1] = { t = "Limit Type", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 2, vals = { 15 }, table = { [0] = "OFF", "SCALE", "CLIP" } } + labels[#labels + 1] = { t = "Limit %", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 25, max = 100, vals = { 16 } } + end +end + +if apiVersion >= 1.016 then + labels[#labels + 1] = { t = "TPA", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Rate", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 100, vals = { 6 } , scale = 100 } + labels[#labels + 1] = { t = "Breakpoint", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 1000, max = 2000, vals = { 9, 10 } } +end + 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, }, - }, + read = 111, -- MSP_RC_TUNING + write = 204, -- MSP_SET_RC_TUNING + title = "Rates", + reboot = false, + eepromWrite = true, + minBytes = 12, + labels = labels, + fields = fields, } diff --git a/src/SCRIPTS/BF/PAGES/rescue.lua b/src/SCRIPTS/BF/PAGES/rescue.lua index 809693a7..718c83ac 100644 --- a/src/SCRIPTS/BF/PAGES/rescue.lua +++ b/src/SCRIPTS/BF/PAGES/rescue.lua @@ -1,24 +1,56 @@ -local display = assert(loadScript(radio.templateHome.."rescue.lua"))() +local template = loadScript(radio.templateHome.."rescue.lua") +if template then + template = template() +else + template = assert(loadScript(radio.templateHome.."default_template.lua"))() +end +local margin = template.margin +local indent = template.indent +local lineSpacing = template.lineSpacing +local tableSpacing = template.tableSpacing +local sp = template.listSpacing.field +local yMinLim = radio.yMinLimit +local x = margin +local y = yMinLim - lineSpacing +local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end } +local labels = {} +local fields = {} + +if apiVersion >= 1.041 then + labels[#labels + 1] = { t = "Min Sats.", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 50, vals = { 16 } } + labels[#labels + 1] = { t = "Angle", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 200, vals = { 1, 2 } } + labels[#labels + 1] = { t = "Initial Altitude", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 20, max = 100, vals = { 3, 4 } } + labels[#labels + 1] = { t = "Descent Distance", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 30, max = 500, vals = { 5, 6 } } + labels[#labels + 1] = { t = "Ground Speed", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 30, max = 3000, vals = { 7, 8 } } + + if apiVersion >= 1.043 then + labels[#labels + 1] = { t = "Arm w/o fix", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 1, vals = { 21 }, table = { [0]="OFF","ON"} } + end + + labels[#labels + 1] = { t = "Sanity Check", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 2, vals = { 15 }, table = { [0]="OFF","ON","FS_ONLY"} } + labels[#labels + 1] = { t = "Throttle", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Min", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 1000, max = 2000, vals = { 9, 10 } } + labels[#labels + 1] = { t = "Hover", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 1000, max = 2000, vals = { 13, 14 } } + labels[#labels + 1] = { t = "Max", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 1000, max = 2000, vals = { 11, 12 } } +end + 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 = 1, vals = { 21 }, table = { [0]="OFF","ON"}, }, - { 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 }, }, - }, + read = 135, -- MSP_GPS_RESCUE + write = 225, -- MSP_SET_GPS_RESCUE + title = "GPS Rescue", + reboot = false, + eepromWrite = true, + minBytes = 16, + labels = labels, + fields = fields, } diff --git a/src/SCRIPTS/BF/PAGES/rx.lua b/src/SCRIPTS/BF/PAGES/rx.lua index 6323f104..75286661 100644 --- a/src/SCRIPTS/BF/PAGES/rx.lua +++ b/src/SCRIPTS/BF/PAGES/rx.lua @@ -1,19 +1,50 @@ -local display = assert(loadScript(radio.templateHome.."rx.lua"))() +local template = loadScript(radio.templateHome.."rx.lua") +if template then + template = template() +else + template = assert(loadScript(radio.templateHome.."default_template.lua"))() +end +local margin = template.margin +local indent = template.indent +local lineSpacing = template.lineSpacing +local tableSpacing = template.tableSpacing +local sp = template.listSpacing.field +local yMinLim = radio.yMinLimit +local x = margin +local y = yMinLim - lineSpacing +local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end } +local labels = {} +local fields = {} + +if apiVersion >= 1.016 then + labels[#labels + 1] = { t = "Stick", x = x, y = inc.y(lineSpacing) } + labels[#labels + 1] = { t = "Low", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 1000, max = 2000, vals = { 6, 7 } } + labels[#labels + 1] = { t = "Center", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 1000, max = 2000, vals = { 4, 5 } } + labels[#labels + 1] = { t = "High", x = x + indent, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 1000, max = 2000, vals = { 2, 3 } } +end + +if apiVersion >= 1.020 then + labels[#labels + 1] = { t = "Interp", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 3, vals = { 13 }, table={ [0]="Off", "Preset", "Auto", "Manual"} } + labels[#labels + 1] = { t = "Interp Int", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 1, max = 50, vals = { 14 } } +end + +if apiVersion >= 1.031 then + labels[#labels + 1] = { t = "Cam Angle", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 0, max = 90, vals = { 23 } } +end + 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 }, } - }, + read = 44, -- MSP_RX_CONFIG + write = 45, -- MSP_SET_RX_CONFIG + title = "RX", + reboot = false, + eepromWrite = true, + minBytes = 12, + labels = labels, + fields = fields, } diff --git a/src/SCRIPTS/BF/PAGES/vtx.lua b/src/SCRIPTS/BF/PAGES/vtx.lua index afa8c8a7..1f2d8da0 100644 --- a/src/SCRIPTS/BF/PAGES/vtx.lua +++ b/src/SCRIPTS/BF/PAGES/vtx.lua @@ -1,4 +1,3 @@ -local display = assert(loadScript(radio.templateHome.."vtx.lua"))() local md = model.getInfo(); local vtx_tables = loadScript("/BF/VTX/"..md.name..".lua") if vtx_tables then @@ -8,6 +7,41 @@ else end local deviceTable = { [1]="6705", [3]="SA", [4]="Tramp", [255]="None" } local pitModeTable = { [0]="OFF", "ON" } +local template = loadScript(radio.templateHome.."vtx.lua") +if template then + template = template() +else + template = assert(loadScript(radio.templateHome.."default_template.lua"))() +end +local margin = template.margin +local indent = template.indent +local lineSpacing = template.lineSpacing +local tableSpacing = template.tableSpacing +local sp = template.listSpacing.field +local yMinLim = radio.yMinLimit +local x = margin +local y = yMinLim - lineSpacing +local inc = { x = function(val) x = x + val return x end, y = function(val) y = y + val return y end } +local labels = {} +local fields = {} + +if apiVersion >= 1.036 then + labels[#labels + 1] = { t = "Band", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min=0, max=#(vtx_tables.bandTable), vals = { 2 }, table = vtx_tables.bandTable, upd = function(self) self.handleBandChanUpdate(self) end } + labels[#labels + 1] = { t = "Channel", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min=1, max=vtx_tables.frequenciesPerBand, vals = { 3 }, upd = function(self) self.handleBandChanUpdate(self) end } + labels[#labels + 1] = { t = "Power", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min=1, vals = { 4 }, upd = function(self) self.updatePowerTable(self) end } + labels[#labels + 1] = { t = "Pit Mode", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min=0, max=#(pitModeTable), vals = { 5 }, table = pitModeTable } + labels[#labels + 1] = { t = "Protocol", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, vals = { 1 }, write = false, ro = true, table = deviceTable } +end + +if apiVersion >= 1.037 then + labels[#labels + 1] = { t = "Frequency", x = x, y = inc.y(lineSpacing) } + fields[#fields + 1] = { x = x + sp, y = y, min = 5000, max = 5999, vals = { 6 }, upd = function(self) self.handleFreqValUpdate(self) end } +end -- Vals Fields -- 1 Device Type Band @@ -29,16 +63,8 @@ return { prevFreqVal = 0, lastFreqUpdTS = 0, freqModCounter = 0, - labels = display.labels, - fieldLayout = display.fieldLayout, - fields = { - { min=0, max=#(vtx_tables.bandTable), vals = { 2 }, table = vtx_tables.bandTable, upd = function(self) self.handleBandChanUpdate(self) end }, - { min=1, max=vtx_tables.frequenciesPerBand, vals = { 3 }, upd = function(self) self.handleBandChanUpdate(self) end }, - { min=1, vals = { 4 }, upd = function(self) self.updatePowerTable(self) end }, - { min=0, max=#(pitModeTable), vals = { 5 }, table = pitModeTable }, - { vals = { 1 }, write = false, ro = true, table = deviceTable }, - { min = 5000, max = 5999, vals = { 6 }, upd = function(self) self.handleFreqValUpdate(self) end }, - }, + labels = labels, + fields = fields, freqLookup = vtx_tables.frequencyTable, 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 diff --git a/src/SCRIPTS/BF/TEMPLATES/128x64/default_template.lua b/src/SCRIPTS/BF/TEMPLATES/128x64/default_template.lua new file mode 100644 index 00000000..76e110f0 --- /dev/null +++ b/src/SCRIPTS/BF/TEMPLATES/128x64/default_template.lua @@ -0,0 +1,7 @@ +return { + margin = 2, + indent = 6, + lineSpacing = 8, + listSpacing = { line = 8, field = 88 }, + tableSpacing = { row = 10, col = 30, header = 8 }, +} diff --git a/src/SCRIPTS/BF/TEMPLATES/212x64/default_template.lua b/src/SCRIPTS/BF/TEMPLATES/212x64/default_template.lua new file mode 100644 index 00000000..76e110f0 --- /dev/null +++ b/src/SCRIPTS/BF/TEMPLATES/212x64/default_template.lua @@ -0,0 +1,7 @@ +return { + margin = 2, + indent = 6, + lineSpacing = 8, + listSpacing = { line = 8, field = 88 }, + tableSpacing = { row = 10, col = 30, header = 8 }, +} diff --git a/src/SCRIPTS/BF/TEMPLATES/320x480/default_template.lua b/src/SCRIPTS/BF/TEMPLATES/320x480/default_template.lua new file mode 100644 index 00000000..74213779 --- /dev/null +++ b/src/SCRIPTS/BF/TEMPLATES/320x480/default_template.lua @@ -0,0 +1,7 @@ +return { + margin = 5, + indent = 15, + lineSpacing = 20, + listSpacing = { line = 20, field = 170 }, + tableSpacing = { row = 25, col = 60, header = 20 }, +} diff --git a/src/SCRIPTS/BF/TEMPLATES/480x272/default_template.lua b/src/SCRIPTS/BF/TEMPLATES/480x272/default_template.lua new file mode 100644 index 00000000..74213779 --- /dev/null +++ b/src/SCRIPTS/BF/TEMPLATES/480x272/default_template.lua @@ -0,0 +1,7 @@ +return { + margin = 5, + indent = 15, + lineSpacing = 20, + listSpacing = { line = 20, field = 170 }, + tableSpacing = { row = 25, col = 60, header = 20 }, +} diff --git a/src/SCRIPTS/BF/pages.lua b/src/SCRIPTS/BF/pages.lua index ef003801..2fcdf6f8 100644 --- a/src/SCRIPTS/BF/pages.lua +++ b/src/SCRIPTS/BF/pages.lua @@ -1,13 +1,47 @@ -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 +local PageFiles = {} + +if apiVersion >= 1.036 then + PageFiles[#PageFiles + 1] = { title = "VTX Settings", script = "vtx.lua" } +end + +if apiVersion >= 1.016 then + PageFiles[#PageFiles + 1] = { title = "PIDs 1", script = "pids1.lua" } +end + +if apiVersion >= 1.021 then + PageFiles[#PageFiles + 1] = { title = "PIDs 2", script = "pids2.lua" } +end + +if apiVersion >= 1.016 then + PageFiles[#PageFiles + 1] = { title = "Rates", script = "rates.lua" } +end + +if apiVersion >= 1.016 then + PageFiles[#PageFiles + 1] = { title = "Advanced PIDs", script = "pid_advanced.lua" } +end + +if apiVersion >= 1.016 then + PageFiles[#PageFiles + 1] = { title = "Filters 1", script = "filters1.lua" } +end + +if apiVersion >= 1.042 then + PageFiles[#PageFiles + 1] = { title = "Filters 2", script = "filters2.lua" } +end + +if apiVersion >= 1.016 then + PageFiles[#PageFiles + 1] = { title = "Gyro / Motor", script = "pwm.lua" } +end + +if apiVersion >= 1.016 then + PageFiles[#PageFiles + 1] = { title = "Receiver", script = "rx.lua" } +end + +if apiVersion >= 1.041 then + PageFiles[#PageFiles + 1] = { title = "GPS Rescue", script = "rescue.lua" } +end + +if apiVersion >= 1.041 then + PageFiles[#PageFiles + 1] = { title = "GPS PIDs", script = "gpspids.lua" } +end + +return PageFiles diff --git a/src/SCRIPTS/BF/radios.lua b/src/SCRIPTS/BF/radios.lua index dc272436..e571a853 100644 --- a/src/SCRIPTS/BF/radios.lua +++ b/src/SCRIPTS/BF/radios.lua @@ -8,7 +8,7 @@ local supportedRadios = { ["128x64"] = { - templateHome = SCRIPT_HOME.."/LAYOUT/128x64/", + templateHome = SCRIPT_HOME.."/TEMPLATES/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 }, @@ -19,7 +19,7 @@ local supportedRadios = }, ["212x64"] = { - templateHome = SCRIPT_HOME.."/LAYOUT/212x64/", + templateHome = SCRIPT_HOME.."/TEMPLATES/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 }, @@ -30,25 +30,25 @@ local supportedRadios = }, ["480x272"] = { - templateHome = SCRIPT_HOME.."/LAYOUT/480x272/", + templateHome = SCRIPT_HOME.."/TEMPLATES/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 = 0, yMinLimit = 35, - yMaxLimit = 215, + yMaxLimit = 235, }, ["320x480"] = { - templateHome = SCRIPT_HOME.."/LAYOUT/320x480/", + templateHome = SCRIPT_HOME.."/TEMPLATES/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 = 0, yMinLimit = 35, - yMaxLimit = 215, + yMaxLimit = 235, }, } diff --git a/src/SCRIPTS/BF/ui.lua b/src/SCRIPTS/BF/ui.lua index 8a6fd7e3..0567af01 100644 --- a/src/SCRIPTS/BF/ui.lua +++ b/src/SCRIPTS/BF/ui.lua @@ -19,8 +19,6 @@ local uiMsp = eepromWrite = 250 } -local menuLine = 1 -local pageCount = 1 local uiState = uiStatus.init local pageState = pageStatus.display local requestTimeout = 80 -- 800ms request timeout @@ -36,7 +34,7 @@ local killEnterBreak = 0 local stopDisplay = false local pageScrollY = 0 local mainMenuScrollY = 0 - +local PageFiles = nil local Page = nil local background = nil @@ -45,15 +43,6 @@ local foregroundColor = LINE_COLOR or SOLID local globalTextOptions = TEXT_COLOR or 0 -local function getPageCount() - pageCount = 0 - for i=1,#(PageFiles) do - if (not PageFiles[i].requiredVersion) or (apiVersion == 0) or (apiVersion > 0 and PageFiles[i].requiredVersion <= apiVersion) then - pageCount = pageCount + 1 - end - end -end - local function saveSettings(new) if Page.values then local payload = {} @@ -167,7 +156,6 @@ local function incPage(inc) currentPage = incMax(currentPage, inc, #(PageFiles)) Page = nil currentField = 1 - menuLine = currentPage collectgarbage() end @@ -176,7 +164,7 @@ local function incLine(inc) end local function incMainMenu(inc) - menuLine = clipValue(menuLine + inc, 1, pageCount) + currentPage = clipValue(currentPage + inc, 1, #PageFiles) end local function incPopupMenu(inc) @@ -203,10 +191,11 @@ end local function drawScreen() local yMinLim = radio.yMinLimit or 0 local yMaxLim = radio.yMaxLimit or LCD_H - local currentFieldY = Page.fieldLayout[currentField].y - local screen_title = Page.title - drawScreenTitle("Betaflight / "..screen_title) - if currentFieldY <= Page.fieldLayout[1].y then + local currentFieldY = Page.fields[currentField].y + local screenTitle = Page.title + local textOptions = radio.textSize + globalTextOptions + drawScreenTitle("Betaflight / "..screenTitle) + if currentFieldY <= Page.fields[1].y then pageScrollY = 0 elseif currentFieldY - pageScrollY <= yMinLim then pageScrollY = currentFieldY - yMinLim @@ -215,7 +204,6 @@ local function drawScreen() end for i=1,#(Page.labels) do local f = Page.labels[i] - local textOptions = radio.textSize + globalTextOptions if (f.y - pageScrollY) >= yMinLim and (f.y - pageScrollY) <= yMaxLim then lcd.drawText(f.x, f.y - pageScrollY, f.t, textOptions) end @@ -223,13 +211,11 @@ local function drawScreen() local val = "---" for i=1,#(Page.fields) do local f = Page.fields[i] - local pos = Page.fieldLayout[i] - local text_options = radio.textSize + globalTextOptions - local value_options = text_options + local valueOptions = textOptions if i == currentField then - value_options = text_options + INVERS + valueOptions = valueOptions + INVERS if pageState == pageStatus.editing then - value_options = value_options + BLINK + valueOptions = valueOptions + BLINK end end if f.value then @@ -241,8 +227,8 @@ local function drawScreen() val = f.table[f.value] end end - if (pos.y - pageScrollY) >= yMinLim and (pos.y - pageScrollY) <= yMaxLim then - lcd.drawText(pos.x, pos.y - pageScrollY, val, value_options) + if (f.y - pageScrollY) >= yMinLim and (f.y - pageScrollY) <= yMaxLim then + lcd.drawText(f.x, f.y - pageScrollY, val, valueOptions) end end end @@ -315,6 +301,7 @@ function run_ui(event) return 0 else background = nil + PageFiles = assert(loadScript("/SCRIPTS/BF/pages.lua"))() invalidatePages() if isTelemetryScript then uiState = uiStatus.pages @@ -323,7 +310,6 @@ function run_ui(event) end end elseif uiState == uiStatus.mainMenu then - getPageCount() if event == EVT_VIRTUAL_EXIT then return 2 elseif event == EVT_VIRTUAL_NEXT then @@ -340,25 +326,23 @@ function run_ui(event) lineSpacing = 25 end for i=1, #PageFiles do - if (not PageFiles[i].requiredVersion) or (apiVersion == 0) or (apiVersion > 0 and PageFiles[i].requiredVersion <= apiVersion) then - local currentFieldY = (menuLine-1)*lineSpacing + yMinLim - if currentFieldY <= yMinLim then - mainMenuScrollY = 0 - elseif currentFieldY - mainMenuScrollY <= yMinLim then - mainMenuScrollY = currentFieldY - yMinLim - elseif currentFieldY - mainMenuScrollY >= yMaxLim then - mainMenuScrollY = currentFieldY - yMaxLim - end - local attr = (menuLine == i and INVERS or 0) - if event == EVT_VIRTUAL_ENTER and attr == INVERS then - invalidatePages() - currentPage = i - pageState = pageStatus.display - uiState = uiStatus.pages - end - if ((i-1)*lineSpacing + yMinLim - mainMenuScrollY) >= yMinLim and ((i-1)*lineSpacing + yMinLim - mainMenuScrollY) <= yMaxLim then - lcd.drawText(6, (i-1)*lineSpacing + yMinLim - mainMenuScrollY, PageFiles[i].title, attr) - end + local currentFieldY = (currentPage-1)*lineSpacing + yMinLim + if currentFieldY <= yMinLim then + mainMenuScrollY = 0 + elseif currentFieldY - mainMenuScrollY <= yMinLim then + mainMenuScrollY = currentFieldY - yMinLim + elseif currentFieldY - mainMenuScrollY >= yMaxLim then + mainMenuScrollY = currentFieldY - yMaxLim + end + local attr = (currentPage == i and INVERS or 0) + if event == EVT_VIRTUAL_ENTER and attr == INVERS then + invalidatePages() + currentPage = i + pageState = pageStatus.display + uiState = uiStatus.pages + end + if ((i-1)*lineSpacing + yMinLim - mainMenuScrollY) >= yMinLim and ((i-1)*lineSpacing + yMinLim - mainMenuScrollY) <= yMaxLim then + lcd.drawText(6, (i-1)*lineSpacing + yMinLim - mainMenuScrollY, PageFiles[i].title, attr) end end elseif uiState == uiStatus.pages then @@ -433,17 +417,14 @@ function run_ui(event) incValue(-1) end end - local nextPage = currentPage - while Page == nil do - 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(radio.NoTelem[1], radio.NoTelem[2], "No Pages! API: " .. apiVersion, radio.NoTelem[4]) - return 1 - end + if Page == nil then + if #PageFiles == 0 then + lcd.clear() + lcd.drawText(radio.NoTelem[1], radio.NoTelem[2], "No Pages! API: " .. apiVersion, radio.NoTelem[4]) + return 1 end + Page = assert(loadScript(SCRIPT_HOME.."/Pages/"..PageFiles[currentPage].script))() + collectgarbage() end if not Page.values and pageState == pageStatus.display then requestPage()