From 8c4b53968daf0e1898328b285742da101b25ae02 Mon Sep 17 00:00:00 2001 From: Syler Clayton <2224238+Relys@users.noreply.github.com> Date: Thu, 25 Sep 2025 17:38:11 -0700 Subject: [PATCH] Fix: Add custom config 1 and 2 to mobile view. --- mobile/main.qml | 88 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 85 insertions(+), 3 deletions(-) diff --git a/mobile/main.qml b/mobile/main.qml index a535542e4..aa3144c65 100644 --- a/mobile/main.qml +++ b/mobile/main.qml @@ -508,6 +508,8 @@ ApplicationWindow { (uiHwPage.visible ? 1 : 0) + (uiAppPage.visible ? 1 : 0) + (confCustomButton.visible ? 1 : 0) + + (confCustomButton1.visible ? 1 : 0) + + (confCustomButton2.visible ? 1 : 0) + (confPageMotor.visible ? 1 : 0) + (confPageApp.visible ? 1 : 0))) @@ -576,13 +578,27 @@ ApplicationWindow { width: tabBar.buttonWidth } - TabButton { + TabButton { id: confCustomButton visible: confCustomPage.visible text: "Custom Cfg" width: tabBar.buttonWidth } + TabButton { + id: confCustomButton1 + visible: confCustomPage1.visible + text: "Custom Cfg 1" + width: tabBar.buttonWidth + } + + TabButton { + id: confCustomButton2 + visible: confCustomPage2.visible + text: "Custom Cfg 2" + width: tabBar.buttonWidth + } + Page { id: confPageMotor visible: false @@ -633,6 +649,40 @@ ApplicationWindow { } } + Page { + id: confCustomPage1 + visible: false + + Loader { + id: confCustomLoader1 + anchors.fill: parent + asynchronous: true + sourceComponent: ConfigPageCustom { + anchors.fill: parent + anchors.leftMargin: 10 + anchors.rightMargin: 10 + confInd: 1 + } + } + } + + Page { + id: confCustomPage2 + visible: false + + Loader { + id: confCustomLoader2 + anchors.fill: parent + asynchronous: true + sourceComponent: ConfigPageCustom { + anchors.fill: parent + anchors.leftMargin: 10 + anchors.rightMargin: 10 + confInd: 2 + } + } + } + footer: Rectangle { id: connectedRect clip: true @@ -1028,9 +1078,41 @@ ApplicationWindow { confCustomButton.parent = null } } + + if (confCustomLoader1.status == Loader.Ready) { + stop() + + if (VescIf.isPortConnected() && VescIf.customConfig(1) !== null) { + mainSwipeView.insertItem(4, confCustomPage1) + tabBar.insertItem(4, confCustomButton1) + confCustomPage1.visible = true + confCustomLoader1.item.reloadConfig() + confCustomButton1.text = VescIf.customConfig(1).getLongName("hw_name") + } else { + confCustomPage1.visible = false + confCustomPage1.parent = null + confCustomButton1.parent = null + } + } + + if (confCustomLoader2.status == Loader.Ready) { + stop() + + if (VescIf.isPortConnected() && VescIf.customConfig(2) !== null) { + mainSwipeView.insertItem(4, confCustomPage2) + tabBar.insertItem(4, confCustomButton2) + confCustomPage2.visible = true + confCustomLoader2.item.reloadConfig() + confCustomButton2.text = VescIf.customConfig(2).getLongName("hw_name") + } else { + confCustomPage2.visible = false + confCustomPage2.parent = null + confCustomButton2.parent = null + } + } } } - + function updateConfCustom () { confCustomTimer.start() } @@ -1228,4 +1310,4 @@ ApplicationWindow { VescIf.disconnectPort() } } -} +} \ No newline at end of file