zhunk 6 месяцев назад
Родитель
Сommit
e2adcc2169

+ 7 - 0
app_bzy_armhf_7/docs/Readme.md

@@ -1,3 +1,10 @@
+## 20260425
+    #define APP_VERSION "1.9.3"
+    1、qml界面优化
+    2、修复启动花屏问题,启动前删除缓存
+    3、调整APP升级路径:ftp://8.136.98.49/_UPDATE_FILE/Android/BZYV2/armv7a/app.apk
+    4、调整MCU升级路径:ftp://8.136.98.49/_UPDATE_FILE/Android/BZYV2/armv7a/Application_BZYV2.rbl
+    
 ## 20260417
     #define APP_VERSION "1.8.26"
     更新说明:

+ 1 - 1
app_bzy_armhf_7/header/main.h

@@ -37,7 +37,7 @@
 #include <opencv2/features2d/features2d.hpp>
 #include <opencv2/xfeatures2d/nonfree.hpp>
 
-#define APP_VERSION "1.7.24"
+#define APP_VERSION "1.10.3"
 
 using namespace std;
 

+ 2 - 1
app_bzy_armhf_7/header/mserial.h

@@ -138,7 +138,7 @@ public slots:
             m_ymodem->start_ymodem(path);
         }
     }
-
+    void recoverMcuParam();
 private slots:
     //void readBoardData();
     QString selectSerialPortName();
@@ -172,6 +172,7 @@ private slots:
 private:
     bool m_upgrading = false;
     void processJsonData(const QByteArray &jsonData);
+    void saveMcuParam(const QJsonObject &params);
     QTimer m_dat_f;
     QTimer* timeout_mov = nullptr;
     QSerialPort m_serialPort;

+ 13 - 4
app_bzy_armhf_7/main.cpp

@@ -167,7 +167,6 @@ private slots://槽函数中实现了GPS部分信息的读取
 };
 
 void sendBroadcastFromQt(QString btn_type) {
-    //QJniObject activity = QJniObject::callStaticObjectMethod("com/yfkj/cb/Q6iot/MyQtActivity","getCurrentActivity","()Landroid/app/Activity;");
     auto qtContext = QJniObject(QNativeInterface::QAndroidApplication::context());    //activity
     //QJniObject qtContext = activity.callObjectMethod("getApplicationContext","()Landroid/content/Context;");
     if (qtContext.isValid()) {
@@ -559,15 +558,15 @@ int main(int argc, char *argv[])
                      &uploader_ftp,&CurlFtpUploader::uploadFileAsync);
 
     QObject::connect(&mqttHandler,&MqttHandler::updateStm32,[&](){
-        curlHandler.seturl("ftp://8.136.98.49/_UPDATE_FILE/A7/STM32/Application_BZYV2.rbl");
-        curlHandler.setfilepath(appDataPath+"/rtthread.rbl");
+        curlHandler.seturl("ftp://8.136.98.49/_UPDATE_FILE/Android/BZYV2/armv7a/Application_BZYV2.rbl");
+        curlHandler.setfilepath("/sdcard/rtthread.rbl");
         curlHandler.settype("主板升级文件更新");
         curlHandler.start();
         //sendBroadcastFromQt("install");
     });
 
     QObject::connect(&mqttHandler,&MqttHandler::appdownload,[&](){
-        curlHandler.seturl("ftp://8.136.98.49/_UPDATE_FILE/Android/BZYV2/app.apk");
+        curlHandler.seturl("ftp://8.136.98.49/_UPDATE_FILE/Android/BZYV2/armv7a/app.apk");
         //curlHandler.setfilepath(appDataPath+"/app.apk");
         curlHandler.setfilepath("/sdcard/app.apk");
         curlHandler.settype("App升级文件更新");
@@ -606,6 +605,14 @@ int main(int argc, char *argv[])
             //            mqttHandler.publish_m(download_success);
             emit mqttHandler.appInstall();
         }
+        if(result&&mtype.contains("主板升级文件更新")){
+            QString appDataPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
+            // 在内部存储空间路径下创建子目录
+            QString subDirName = "/rtthread.rbl";
+            QString subDirPath = appDataPath + subDirName;
+            LOG("升级文件路径:{}",subDirPath.toStdString());
+            emit serialThread.updatestart(subDirPath);
+        }
     });
 
     QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
@@ -734,6 +741,8 @@ int main(int argc, char *argv[])
     QObject::connect(gps_start,&GPSInfo::position_success,[&](){
         emit serialThread.gpsSuccess();
     });
+
+    serialThread.recoverMcuParam();
     return app.exec();
 }
 #include "main.moc"

+ 20 - 8
app_bzy_armhf_7/qml/Main.qml

@@ -16,8 +16,10 @@ App {
     property string theme_md: "day"
     property string theme_select: "day"
     property color theme_backgroundColor: theme_select === "day" ? "#d8d8d8" : "#1a1a1a"
-    property color cardColor: theme_select === "day" ? "#f5f5f5" : "#2b2b2b"
-    property color fontColor: theme_select === "day" ? "#333333" : "#e0e0e0"
+    property color cardColor: theme_select == "day" ? "#f5f5f5" :(theme_select == "night" ? "#2b2b2b":"#f5f5f5")           //背景色        //前景色
+    property color fontColor: theme_select == "day" ? "black" :(theme_select == "night" ? "white":"black")
+
+
 
     // 初始为纯黑色,强制设置为不透明,防止花屏
     color: "#000000"
@@ -27,9 +29,7 @@ App {
 
     property int logoutcnt
 
-
     signal logoutClicked
-    signal tmChange(string md)
 
     // ========== 主题初始化(最早执行) ==========
     onInitTheme: {
@@ -184,13 +184,21 @@ App {
         NavigationStack {
           initialPage: ProfilePage {
               id: page_sys
-            function onThemChange(mode) {
+              onThemChange: {
+                console.log("配置主题模式:",mode)
+                app.theme_md = mode
+                if (mode !== "auto") {
+                    app.theme_select = mode
+                } else {
+                    var h = new Date().getHours()
+                    app.theme_select = (h >= 6 && h <= 18) ? "day" : "night"
+                }
                 app.theme_select = mode
                 app.theme_md = mode
                 Theme.navigationTabBar.backgroundColor= app.cardColor
                 Theme.navigationTabBar.titleColor = app.fontColor
                 Theme.navigationTabBar.dividerColor = "green"
-                console.log("配置主题模式:",app.theme_select)
+                console.log("主题已更新:",app.theme_select)
             }
 
             // handle logout
@@ -231,8 +239,8 @@ App {
     Connections{
         target: curl
         function onDownloadFinished(result) {
-            if(result && navigationLoader.item){
-                navigationLoader.item.setCurrentTab(1)
+            if(result){
+                navigation.setCurrentTab(1)
             }
         }
     }
@@ -241,6 +249,10 @@ App {
         console.log("App Component.onCompleted, starting phased loading...")
     }
     
+    LocalNotificationPage {
+        id: notificationPage
+        visible:false
+    }
 
     // ========== 登录页(Phase2: 导航加载完成后才加载) ==========
     LoginPage {

+ 7 - 1
app_bzy_armhf_7/qml/pages/HomePage.qml

@@ -249,14 +249,16 @@ AppPage {
               radius: 2
               // 使用Item作为容器,设置固定位置和大小
               Item {
-                  // 修复:移除Row中的anchors.fill,使用Item的尺寸
+                  anchors.fill: parent
                   Row {
+                      anchors.verticalCenter: parent.verticalCenter
                       width: parent.width
                       height: parent.height
                       spacing: dp(20)
                       AppText{
                           id: text_stamp
                           verticalAlignment: Text.AlignVCenter
+                          height: parent.height
                           text: ""
                           fontSize: 20
                           color: app.fontColor
@@ -265,6 +267,7 @@ AppPage {
                       AppText{
                           id: text_imei
                           verticalAlignment: Text.AlignVCenter
+                          height: parent.height
                           text:"设备ID:" + originalString.toLowerCase()
                           fontSize: 20
                           color: app.fontColor
@@ -273,6 +276,7 @@ AppPage {
                       AppText{
                           id: net_sta
                           verticalAlignment: Text.AlignVCenter
+                          height: parent.height
                           color: app.fontColor
                           text: "联网状态:"
                           fontSize: 20
@@ -281,6 +285,7 @@ AppPage {
                       AppText{
                           id: net_type
                           verticalAlignment: Text.AlignVCenter
+                          height: parent.height
                           color: app.fontColor
                           text: "联网类型:"
                           fontSize: 20
@@ -289,6 +294,7 @@ AppPage {
                       AppText{
                           id: text_gps
                           verticalAlignment: Text.AlignVCenter
+                          height: parent.height
                           text: "GPS状态:" + gps_state
                           color: app.fontColor
                           //font.bold: true

+ 0 - 1
app_bzy_armhf_7/qml/pages/PhotostitcherPage.qml

@@ -143,7 +143,6 @@ AppPage {
     function showFullscreen(path) {
         image.source = "file://" + path
         fullscreenPopup.open()
-        resetTransform()
     }
 
 

+ 151 - 333
app_bzy_armhf_7/qml/pages/ProfilePage.qml

@@ -47,15 +47,11 @@ AppPage {
               }
             }
 
-            //行表头-竖向的
             property int verHeaderHeight: 30
             property int verHeaderWidth: 150
-            //列表头-横向的
             property int horHeaderHeight: 30
-            //滚动条
             property color scrollBarColor: "cyan"
             property int scrollBarWidth: 6
-            //列宽
             property variant columnWidthArr: [30,100,100,100,100,100,200,100,100,100,100,100,100]
 
             property variant table_mqtt_Value: ["id","dtype","ip","port","imei","uid","pwd","clientid","qos","keepalive","sub","pub","offline"]
@@ -65,7 +61,6 @@ AppPage {
             property variant table_json_Value: ["id","datetime","json_data","json_data"]
             property int datacount: 1
 
-
             DatabaseInterface
             {
                 id: db_cfg
@@ -74,10 +69,8 @@ AppPage {
             EasyTableModel{
                 id: table_model
                 horHeader: table_mqtt_Value
-                //initData:  []//myClass.getdata_JsonArray()
-                //initData: []
             }
-            //表格内容(不包含表头)
+
             TableView{
                 id: table_view
                 height: sqlite_page.implicitHeight
@@ -93,29 +86,17 @@ AppPage {
                 boundsBehavior: Flickable.StopAtBounds
                 columnSpacing: 1
                 rowSpacing: 1
-                //视图的高度
-                //contentHeight: rowHeightProvider(0) * rows + rowHeightProvider(rows-1)
-                //视图的宽度
-                //contentWidth:
-                //content内容区域边距,但是不影响滚动条的位置
-                //leftMargin:
-                //topMargin:
-                //此属性可以包含一个函数,该函数返回模型中每行的行高
                 rowHeightProvider: function (row) {
                     return sqlite_page.verHeaderHeight;
                 }
-                //此属性可以保存一个函数,该函数返回模型中每个列的列宽
                 columnWidthProvider: function (column) {
                     return sqlite_page.columnWidthArr[column];
-                    //return Math.max(1, (table_view.width - leftMargin) / table_view.columns)
                 }
 
                 ScrollBar.vertical: ScrollBar {
                     id: scroll_vertical
                     anchors.right: parent.right
                     anchors.rightMargin: 2
-                    //active: table_view.ScrollBar.vertical.active
-                    //policy: ScrollBar.AsNeeded
                     contentItem: Rectangle{
                         visible: (scroll_vertical.size<1.0)
                         implicitWidth: sqlite_page.scrollBarWidth
@@ -127,30 +108,21 @@ AppPage {
                     id: scroll_horizontal
                     anchors.bottom: parent.bottom
                     anchors.bottomMargin: 2
-                    //active: table_view.ScrollBar.vertical.active
-                    //policy: ScrollBar.AsNeeded
                     contentItem: Rectangle{
                         visible: (scroll_horizontal.size<1.0)
                         implicitHeight: sqlite_page.scrollBarWidth
                         color: sqlite_page.scrollBarColor
                     }
                 }
-                //model是在C++中定义的,和QtC++是类似的
+
                 model: table_model
                 delegate: Rectangle {
-                    color: (model.row%2)?"orange":Qt.darker("orange")   //根据行数设置背景颜色
+                    color: (model.row%2)?"orange":Qt.darker("orange")
                     AppText{
                         id : value_text
                         anchors.centerIn: parent
                         verticalAlignment: Text.AlignVCenter
-                        // 水平居中对齐
                         horizontalAlignment: Text.AlignHCenter
-                        //elide: Text.ElideRight
-        //                selectByMouse: true
-        //                selectedTextColor: "black"
-        //                selectionColor: "white"
-
-                        //获取单元格对应的值
                         text: model.value
                         AppButton {
                             onClicked: {
@@ -161,7 +133,6 @@ AppPage {
                                         if(ok){
                                             value_text.text = text
                                             model.edit=text;
-                                            //将改变写入到数据库中
                                             console.log("edit",model.value)
                                             if(sqlite_switch.checked)
                                             {
@@ -184,50 +155,23 @@ AppPage {
                                             }
                                         }
                                     })
-                                 // Disable the negative action
                                 dialog.negativeAction = false
-                                // Dismiss when touched outside
                                 dialog.outsideTouchable = true
                             }
                         }
-
-
-
-        //                onEditingFinished: {
-        //                    model.edit=text;
-        //                    //将改变写入到数据库中
-        //                    console.log("edit",model.value)
-        //                    if(sqlite_switch.checked)
-        //                    {
-        //                        if(table_combox.displayText===table_combox.model[0]||table_combox.displayText===table_combox.model[1])
-        //                        {
-        //                            db_cfg.updateData(table_combox.displayText,table_mqtt_Value[index],model.value)
-        //                        }
-        //                        if(table_combox.displayText===table_combox.model[2]||table_combox.displayText===table_combox.model[3])
-        //                        {
-        //                            db_cfg.updateData(table_combox.displayText,table_ftp_Value[index],model.value)
-        //                        }
-        //                        if(table_combox.displayText===table_combox.model[4])
-        //                        {
-        //                            db_cfg.updateData(table_combox.displayText,table_location_Value[index],model.value)
-        //                        }
-        //                    }
-
-        //                }
                     }
                 }
             }
-            //横项表头
+
             Item{
                 id: header_horizontal
                 anchors{
                     left: parent.left
                     right: parent.right
-                    leftMargin: 30//control.verHeaderWidth
+                    leftMargin: 30
                 }
                 height: sqlite_page.horHeaderHeight
                 z: 2
-                //暂存鼠标拖动的位置
                 property int posXTemp: 0
                 MouseArea{
                     anchors.fill: parent
@@ -285,7 +229,6 @@ AppPage {
                                     }
                                     header_horizontal.posXTemp=mouseX;
                                     sqlite_page.columnWidthArr[index]=(header_horizontal_item.width-table_view.columnSpacing);
-                                    //刷新布局,这样宽度才会改变
                                     table_view.forceLayout();
                                 }
                             }
@@ -293,14 +236,13 @@ AppPage {
                     }
                 }
             }
-            //竖向表头
+
             Column {
                 id: header_verical
                 height: sqlite_page.implicitHeight
                 anchors{
                     left: parent.left
                     top: parent.top
-                    //bottom: parent.bottom
                     topMargin: sqlite_page.horHeaderHeight
                 }
                 topPadding: -table_view.contentY
@@ -320,35 +262,6 @@ AppPage {
                     }
                 }
             }
-        //    JsonListModel {
-        //        id: jsonModel
-        //        source: table_model.initData
-        //        keyField: "id"
-        //    }
-
-        //    AppListView {
-        //        anchors.fill: parent
-        //        bottomMargin: nativeUtils.safeAreaInsets.bottom
-        //        model: jsonModel
-
-        //        delegate: SimpleRow {
-        //          text: model.sub
-        //        }
-
-        //        // Transition animation for adding items
-        //        add: Transition {
-        //          NumberAnimation {
-        //            property: "opacity"
-        //            from: 0
-        //            to: 1
-        //            duration: 1000
-        //            easing.type: Easing.OutQuad
-        //          }
-        //        }
-        //    }
-
-
-
 
             AppModal {
                 id: sqliteModal
@@ -437,8 +350,6 @@ AppPage {
                                             }
                                             table_model.table_name = table_combox.displayText
                                             table_model.initData=db_cfg.queryData(table_combox.displayText,datacount)
-                                            //text_row_count.text = db_cfg.getTable_row(table_combox.displayText)
-                                            //rowindex_text.text = datacount
                                         }else{
                                             sqlite_switch.checked = false
                                             sqlite_combox.enabled = true;
@@ -463,12 +374,12 @@ AppPage {
         anchors.fill: parent
         anchors.leftMargin: 5
         anchors.topMargin:5
-        //anchors.horizontalCenter: parent.horizontalCenter
         columns: 1
         rows: 3
         columnSpacing: 10
         rowSpacing: 5
         horizontalItemAlignment: Grid.AlignHCenter
+
             Rectangle {
                 radius: 5
                 width: parent.width * 0.995
@@ -488,15 +399,15 @@ AppPage {
 
                 AppImage {
                     anchors.verticalCenter: parent.verticalCenter
-                    anchors.left: parent.left   //
-                    fillMode: Image.PreserveAspectFit  // 保持纵横比适应
+                    anchors.left: parent.left
+                    fillMode: Image.PreserveAspectFit
                     source: "../../assets/floder.svg"
                 }
 
                 Column{
                     id: column_info
-                    anchors.verticalCenter: parent.verticalCenter  // 在垂直方向上居中
-                    anchors.left: parent.left   //
+                    anchors.verticalCenter: parent.verticalCenter
+                    anchors.left: parent.left
                     anchors.leftMargin: 100
                     AppText{
                         id: text_info
@@ -515,7 +426,7 @@ AppPage {
 
                 AppButton {
                     id:btn_fresh
-                    anchors.verticalCenter: parent.verticalCenter  // 在垂直方向上居中
+                    anchors.verticalCenter: parent.verticalCenter
                     anchors.left: column_info.right
                     anchors.leftMargin: dp(50)
                     text: "刷新"
@@ -530,7 +441,7 @@ AppPage {
 
                 AppButton {
                     id:btn_clear
-                    anchors.verticalCenter: parent.verticalCenter  // 在垂直方向上居中
+                    anchors.verticalCenter: parent.verticalCenter
                     anchors.left: btn_fresh.right
                     text: "清理"
                     flat: false
@@ -542,11 +453,12 @@ AppPage {
                     }
                 }
             }
+
           Row{
-              //anchors.fill: parent
               width: parent.width
               height: parent.height*0.39
               spacing:5
+
               Rectangle {
                   width: parent.width*0.245
                   height: parent.height
@@ -556,20 +468,19 @@ AppPage {
                       anchors.fill: parent
                       spacing: 5
                       AppImage {
-                          anchors.horizontalCenter: parent.horizontalCenter   //垂直居中显示
-                           // 将元素的顶部锚定到父元素的顶部
-                          fillMode: Image.PreserveAspectFit  // 保持纵横比适应
+                          anchors.horizontalCenter: parent.horizontalCenter
+                          fillMode: Image.PreserveAspectFit
                           source: "../../assets/ztl.svg"
                       }
 
                       AppText{
-                          anchors.horizontalCenter: parent.horizontalCenter   //垂直居中显示
+                          anchors.horizontalCenter: parent.horizontalCenter
                           text: "状态栏开关"
                           color: app.fontColor
                           font.bold: true
                       }
                       Switch{
-                          anchors.horizontalCenter: parent.horizontalCenter   //垂直居中显示
+                          anchors.horizontalCenter: parent.horizontalCenter
                           objectName: "openbar_btn"
                           id: openbar_btn
                           signal opernBar
@@ -596,12 +507,12 @@ AppPage {
                       anchors.fill: parent
                       spacing: 5
                       AppImage {
-                          anchors.horizontalCenter: parent.horizontalCenter   //垂直居中显示
-                          fillMode: Image.PreserveAspectFit  // 保持纵横比适应
+                          anchors.horizontalCenter: parent.horizontalCenter
+                          fillMode: Image.PreserveAspectFit
                           source: "../../assets/dhl.svg"
                       }
                       AppText{
-                          anchors.horizontalCenter: parent.horizontalCenter   //垂直居中显示
+                          anchors.horizontalCenter: parent.horizontalCenter
                           id: net_sta
                           text: "导航栏开关"
                           color: app.fontColor
@@ -612,7 +523,7 @@ AppPage {
                           objectName: "opennav_btn"
                           signal opernNav
                           signal closeNav
-                          anchors.horizontalCenter: parent.horizontalCenter   //垂直居中显示
+                          anchors.horizontalCenter: parent.horizontalCenter
                           onClicked: {
                             if(opennav_btn.checked==true){
                                 console.log("打开导航栏")
@@ -667,7 +578,7 @@ AppPage {
 
                     AppText{
                         id: apptext_title_mode
-                        anchors.horizontalCenter: parent.horizontalCenter   //垂直居中显示
+                        anchors.horizontalCenter: parent.horizontalCenter
                         text: "设置模式"
                         font.bold: true
                     }
@@ -772,7 +683,7 @@ AppPage {
                       AppImage {
                           id: appimage_theme
                           anchors.horizontalCenter: parent.horizontalCenter
-                          fillMode: Image.PreserveAspectFit  // 保持纵横比适应
+                          fillMode: Image.PreserveAspectFit
                           source: "../../assets/themset.svg"
                       }
 
@@ -801,13 +712,12 @@ AppPage {
                   width: parent.width*0.245
                   height: parent.height
                   color: app.cardColor
-
                   Column {
                       anchors.fill: parent
-                      spacing: 10
+                      spacing: 5
                       topPadding: 10
                       AppButton {
-                          width: parent.width
+                          anchors.fill: parent
                           onClicked: {
                             logoutClicked()
                           }
@@ -834,6 +744,7 @@ AppPage {
               width: parent.width
               height: parent.height*0.39
               spacing: 5
+
               Rectangle {
                   radius: 5
                   width: parent.width*0.245
@@ -841,57 +752,49 @@ AppPage {
                   color: app.cardColor
 
                   Column {
-                      id: column_bi
                       anchors.fill: parent
-                      spacing: 10
+                      spacing: 5
                       topPadding: 10
-                      MouseArea {
-                        width: parent.width
-                        height: parent.height
-                        onClicked: {
-                            column_bi.visible = false
-                            column_bi.enabled = false
-                            column_bu.visible = true
-                            column_bu.enabled = true
-                        }
+
+                      AppImage {
+                          anchors.horizontalCenter: parent.horizontalCenter
+                          fillMode: Image.PreserveAspectFit
+                          source: "../../assets/updateboard.svg"
                       }
-                      AppText{
+
+                      AppText {
                           anchors.horizontalCenter: parent.horizontalCenter
-                          text: "控制系统版本:" + app.boardversionText
-                          fontSize: 20
-                          font.bold: true
+                          text: "升级主板"
                           color: app.fontColor
+                          font.bold: true
                       }
 
-                  }
+                      AppText {
+                          anchors.horizontalCenter: parent.horizontalCenter
+                          text: "当前:" + app.boardversionText
+                          fontSize: 10
+                          color: "gray"
+                      }
 
-                  Column {
-                      id: column_bu
-                      visible: false
-                      anchors.fill: parent
-                      spacing: 10
-                      AppButton {
-                          width: parent.width
+                      MouseArea {
+                          anchors.horizontalCenter: parent.horizontalCenter
+                          width: parent.width * 0.7
+                          height: dp(30)
+                          AppText {
+                              anchors.centerIn: parent
+                              text: "点击升级"
+                              color: "#0aa26b"
+                              font.pixelSize: sp(12)
+                          }
                           onClicked: {
-                              column_bi.visible = true
-                              column_bi.enabled = true
-                              column_bu.visible = false
-                              column_bu.enabled = false
                               var dialog = InputDialog.inputTextSingleLine(page_sys,
                                    "请输入密钥!",
                                    "Input here",
-                                    function(ok,text){
+                                    function(ok, text){
                                      if(ok){
                                          if(text==="2024"){
                                              mqtt.sendUpdatesBoard()
                                          }else{
-                                             /*
-                                             0:普通消息框,只有一个“确定”按钮。
-                                             1:警告消息框,通常用于提醒用户注意。
-                                             2:确认消息框,包含“是”和“否”两个按钮。
-                                             3:询问消息框,包含“是”、“否”和“取消”三个按钮。
-                                             4:错误消息框,用于显示错误或异常情况。
-                                             */
                                             nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
                                          }
                                      }
@@ -899,22 +802,7 @@ AppPage {
                                    )
                           }
                       }
-
-                      AppImage {
-                          anchors.horizontalCenter: parent.horizontalCenter   //垂直居中显示
-                          fillMode: Image.PreserveAspectFit  // 保持纵横比适应
-                          source: "../../assets/updateboard.svg"
-                      }
-
-                      AppText{
-                          anchors.horizontalCenter: parent.horizontalCenter   //垂直居中显示
-                          text: "升级主板"
-                          color: app.fontColor
-                          font.bold: true
-                      }
                   }
-
-
               }
 
               Rectangle {
@@ -924,47 +812,45 @@ AppPage {
                   color: app.cardColor
 
                   Column {
-                    id: column_ai
-                    spacing: 10
-                    anchors.fill: parent
-                    topPadding: 10
-                    MouseArea {
-                        width: parent.width
-                        height: parent.height
-                        onClicked: {
-                            column_ai.visible = false
-                            column_ai.enabled = false
-                            column_au.visible = true
-                            column_au.enabled = true
-                        }
-                    }
-
-                    AppText{
-                        anchors.horizontalCenter: parent.horizontalCenter
-                        text: "App版本:" + app.appversionText
-                        fontSize: 20
-                        font.bold: true
-                        color: app.fontColor
-                    }
-                  }
-
-                  Column {
-                      id: column_au
-                      visible: false
-                      spacing: 10
                       anchors.fill: parent
+                      spacing: 5
                       topPadding: 10
-                      AppButton {
-                          width: parent.width
+
+                      AppImage {
+                          anchors.horizontalCenter: parent.horizontalCenter
+                          fillMode: Image.PreserveAspectFit
+                          source: "../../assets/updateapp.svg"
+                      }
+
+                      AppText {
+                          anchors.horizontalCenter: parent.horizontalCenter
+                          text: "升级App"
+                          color: app.fontColor
+                          font.bold: true
+                      }
+
+                      AppText {
+                          anchors.horizontalCenter: parent.horizontalCenter
+                          text: "当前:" + app.appversionText
+                          fontSize: 10
+                          color: "gray"
+                      }
+
+                      MouseArea {
+                          anchors.horizontalCenter: parent.horizontalCenter
+                          width: parent.width * 0.7
+                          height: dp(30)
+                          AppText {
+                              anchors.centerIn: parent
+                              text: "点击升级"
+                              color: "#0aa26b"
+                              font.pixelSize: sp(12)
+                          }
                           onClicked: {
-                              column_ai.visible = true
-                              column_ai.enabled = true
-                              column_au.visible = false
-                              column_au.enabled = false
                               var dialog = InputDialog.inputTextSingleLine(page_sys,
                                    "请输入密钥!",
                                    "Input here",
-                                    function(ok,text){
+                                    function(ok, text){
                                      if(ok){
                                          if(text==="2024"){
                                              mqtt.sendUpdateApp()
@@ -976,17 +862,6 @@ AppPage {
                                    )
                           }
                       }
-                      AppImage {
-                          anchors.horizontalCenter: parent.horizontalCenter
-                          fillMode: Image.PreserveAspectFit
-                          source: "../../assets/updateapp.svg"
-                      }
-                      AppText{
-                          anchors.horizontalCenter: parent.horizontalCenter
-                          text: "升级App"
-                          color: app.fontColor
-                          font.bold: true
-                      }
                   }
               }
 
@@ -999,16 +874,8 @@ AppPage {
 
                   Column {
                       anchors.fill: parent
+                      anchors.topMargin: parent.height * 0.15
                       spacing: 10
-                      topPadding: 10
-
-                      AppButton {
-                          id: button_reboot
-                          width: parent.width
-                          onClicked:{
-                                serial.reboot()
-                          }
-                      }
 
                       AppImage {
                           id: image_reboot
@@ -1024,6 +891,33 @@ AppPage {
                           color: app.fontColor
                           font.bold: true
                       }
+
+                      MouseArea {
+                          anchors.horizontalCenter: parent.horizontalCenter
+                          width: parent.width * 0.7
+                          height: dp(30)
+                          AppText {
+                              anchors.centerIn: parent
+                              text: "点击重启"
+                              color: "#0aa26b"
+                              font.pixelSize: sp(12)
+                          }
+                          onClicked: {
+                              var dialog = InputDialog.inputTextSingleLine(page_sys,
+                                   "请输入密钥!",
+                                   "Input here",
+                                    function(ok, text){
+                                     if(ok){
+                                         if(text==="2024"){
+                                             serial.reboot()
+                                         }else{
+                                            nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
+                                         }
+                                     }
+                                    }
+                                   )
+                          }
+                      }
                   }
               }
 
@@ -1033,123 +927,47 @@ AppPage {
                   height: parent.height
                   color: app.cardColor
 
-                  MouseArea {
-                      anchors.fill: parent
-                      onClicked: {
-                          if(column_di.visible === false){
-                              column_di.visible = true
-                              column_di.enabled = true
-                              column_debug.visible = false
-                              column_debug.enabled = false
-                          }
-                      }
-                  }
-
                   Column {
-                    id: column_di
-                    spacing: 10
-                    anchors.fill: parent
-                    topPadding: 10
-                    AppButton {
-                       width: parent.width
-                       text: "高级功能"
-                       textColor: app.fontColor
-                       flat: false
-                       borderColor: "green"
-                       fontBold: true
-                       onClicked: {
-                           var dialog = InputDialog.inputTextSingleLine(page_sys,
-                                "请输入密钥!",
-                                "Input here",
-                                 function(ok,text){
-                                  if(ok){
-                                      if(text==="2024"){
-                                          column_di.visible = false
-                                          column_di.enabled = false
-                                          column_debug.visible = true
-                                          column_debug.enabled = true
-                                      }else{
-                                         nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
-                                      }
-                                  }
-                                 }
-                                )
-                       }
-                    }
-                  }
-
-                  Column {
-                    id: column_debug
-                    spacing: 10
-                    visible: false
-                    enabled: false
-                    anchors.fill: parent
+                      anchors.centerIn: parent
+                      anchors.horizontalCenter: parent.horizontalCenter
+                      spacing: 5
 
-                    AppCheckBox {
-                        id: acb_log
-                        text: "日志"
-                        anchors.horizontalCenter: parent.horizontalCenter
-                        onCheckedChanged: {
-                            if(acb_log.checked){
-                                app.log_enable = true
-                                console.log("日志开")
-                            }else{
-                                app.log_enable = false
-                                console.log("日志关")
-                            }
-                        }
-                    }
+                      AppText {
+                          anchors.horizontalCenter: parent.horizontalCenter
+                          text: "参数调试"
+                          color: app.fontColor
+                          font.bold: true
+                      }
 
-                    AppCheckBox {
-                        id: acb_stitch
-                        text: "拼接"
-                        anchors.horizontalCenter: parent.horizontalCenter
-                        onCheckedChanged: {
-                            if(acb_stitch.checked){
-                                app.stitch_enable = true
-                                console.log("拼接参数开")
-                            }else{
-                                app.stitch_enable = false
-                                console.log("拼接参数关")
-                            }
-                        }
-                    }
-                    AppCheckBox {
-                        id: acb_pqt
-                        text: "清晰度"
-                        anchors.horizontalCenter: parent.horizontalCenter
-                        onCheckedChanged: {
-                            if(acb_pqt.checked){
-                                app.photoclarity = true
-                                console.log("拼接参数开")
-                            }else{
-                                app.photoclarity = false
-                                console.log("拼接参数关")
-                            }
-                        }
-                    }
-                    AppButton {
-                        anchors.horizontalCenter: parent.horizontalCenter
-                        text: "SQLITE"
-                        implicitHeight: 25
-                        implicitWidth: 40
-                        flat: false
-                        onClicked: {
-                            //打开SQLIT界面
-                            page_sys.navigationStack.push(sqlite_component)
-//                            var component  = Qt.createComponent("SqlScreen.qml")
-//                            if(component.status === Component.Ready){
-//                                var SqlScreen = component.createObject(parent)
-//                                if(SqlScreen!==null){
-//                                    SqlScreen.show()
-//                                }
-//                            }
-                        }
-                    }
+                      MouseArea {
+                          anchors.horizontalCenter: parent.horizontalCenter
+                          width: parent.width * 0.7
+                          height: dp(30)
+                          AppText {
+                              anchors.centerIn: parent
+                              text: "点击进入"
+                              color: "#0aa26b"
+                              font.pixelSize: sp(12)
+                          }
+                          onClicked: {
+                              var dialog = InputDialog.inputTextSingleLine(page_sys,
+                                   "请输入密钥!",
+                                   "Input here",
+                                    function(ok, text){
+                                     if(ok){
+                                         if(text==="2024"){
+                                             page_sys.navigationStack.push(sqlite_component)
+                                         }else{
+                                            nativeUtils.displayMessageBox("密钥校验错误!", "", 1)
+                                         }
+                                     }
+                                    }
+                                   )
+                          }
+                      }
                   }
               }
           }
     }
 }
 
-

+ 344 - 282
app_bzy_armhf_7/qml/pages/TestPage.qml

@@ -21,6 +21,7 @@ AppPage {
     property var axisPositions: [0, 0, 0]  // 各轴当前位置
     property int speed: 50  // 当前速度 (0-100)
     property int stepDistance: 20  // 步进脉冲数量
+    property string fExposureTime: "0"
 
     function autotake(sw){
         if(sw)
@@ -88,6 +89,10 @@ AppPage {
             console.log("坐标改变",step)
             step_apptextfield.text = step
         }
+
+        onExposureTimeChanged: {
+            fExposureTime = frames.cam_ExposureTime
+        }
     }
 
 
@@ -140,15 +145,14 @@ AppPage {
         }
     }
 
-    Row{
+    SplitView{
         anchors.fill: parent
-        spacing: 5
+        orientation: Qt.Horizontal
         Rectangle {
-            width: parent.width*0.7
+            SplitView.preferredWidth: parent.width * 0.7
             height: parent.height
             color: app.cardColor
             radius: 5
-
             AppButton {
               id: normButton
               //anchors.horizontalCenter: parent.horizontalCenter
@@ -180,16 +184,7 @@ AppPage {
               }
             }
 
-//            AppImage {
-//                id: uvc_camera
-//                visible: false
-//                anchors.fill: parent
-//                cache: false
-//                source: "image://UCamera"
-//            }
-
-            VideoOutput
-            {
+            VideoOutput{
                 id: output
                 anchors.fill: parent
                 visible: false
@@ -218,337 +213,404 @@ AppPage {
                 }
             }
         }
-        Rectangle {
-            width: parent.width*0.29
-            height: parent.height
-            color: app.cardColor
-            radius: 5
-
+        ScrollView
+        {
+            SplitView.preferredWidth: parent.width*0.29
+            SplitView.minimumWidth: 200
+            clip: true
             Column {
-                id: testContent
-                anchors.top: parent.top
-                anchors.topMargin: dp(10)
-                anchors.left: parent.left
-                anchors.leftMargin: dp(10)
-                anchors.right: parent.right
-                spacing: dp(10)
+                width: parent.width
+                spacing: dp(15)
+                Row {
+                    spacing: 80
+                    AppText {
+                        id: text_title
+                        text: "测试调试"
+                        font.bold: true
+                        color: "#28a779"
+                        fontSize: 20
+                    }
 
-                AppText {
-                    id: text_title
-                    text: "测试调试"
-                    font.bold: true
-                    color: "#28a779"
-                    fontSize: 20
+                    AppText {
+                        id: apptext_res
+                        text: "[测试结果]"
+                        fontSize:15
+                        color: "grey"
+                        anchors.verticalCenter: text_title.verticalCenter
+                    }
                 }
 
-                AppText {
-                    id: apptext_res
-                    text: "[测试结果]"
-                    fontSize: 15
-                    color: "grey"
-                }
+                Row {
+                    spacing: 100
+
+                    AppText{
+                        text: "一键测试"
+                        fontSize:  15
+                        color: app.fontColor
+                        //font.bold: true
+                        anchors.verticalCenter: autotest_switch.verticalCenter
+                    }
 
-                    Row {
-                        spacing: 100
+                    AppSwitch {
+                        id: autotest_switch
+                        onToggled: {
+                            if(autotest_switch.checked==true){
+                                autotest_switch.enabled = false
+                                serial.sendCmd("autotest",true,"","");
+                                t_autotest.start()
+                            }else{
+                                console.log("t_autotest 计数:",t_autotest.interval)
+                            }
 
-                        AppText{
-                            text: "一键测试"
-                            fontSize:  15
-                            color: app.fontColor
-                            //font.bold: true
-                            anchors.verticalCenter: autotest_switch.verticalCenter
                         }
+                    }
 
-                        AppSwitch {
-                            id: autotest_switch
-                            onToggled: {
-                                if(autotest_switch.checked==true){
-                                    autotest_switch.enabled = false
-                                    serial.sendCmd("autotest",true,"","");
-                                }
-                            }
+                    Timer {
+                        id: t_autotest
+                        interval: 1000*60
+                        running: false
+                        repeat: false
+                        onTriggered: {
+                            autotest_switch.enabled = true
+                            autotest_switch.checked = false
                         }
                     }
+                }
 
 
-                    Row {
-                        spacing: 100
+                Row {
+                    spacing: 100
 
-                        AppText{
-                            text: "风机测试"
-                            color: app.fontColor
-                            fontSize:  15
-                        }
+                    AppText{
+                        text: "风机测试"
+                        color: app.fontColor
+                        fontSize:  15
+                        //font.bold: true
+                        anchors.verticalCenter: fantest_switch.verticalCenter
+                    }
 
-                        AppSwitch {
-                            id: fantest_switch
-                            onToggled: {
-                                if(fantest_switch.checked==true){
-                                    serial.sendCmd("fan",true,"","");
-                                    apptext_res.text = "打开风机"
-                                }else{
-                                    serial.sendCmd("fan",false,"","");
-                                    apptext_res.text = "关闭风机"
-                                }
+                    AppSwitch {
+                        id: fantest_switch
+                        onToggled: {
+                            if(fantest_switch.checked==true){
+                                serial.sendCmd("fan",true,"","");
+                                apptext_res.text = "打开风机"
+                            }else{
+                                serial.sendCmd("fan",false,"","");
+                                apptext_res.text = "关闭风机"
                             }
                         }
                     }
+                }
 
-                    Row {
-                        spacing: 100
+                Row {
+                    spacing: 100
 
-                        AppText{
-                            text: "胶带测试"
-                            fontSize:  15
-                            color: app.fontColor
-                        }
+                    AppText{
+                        text: "胶带测试"
+                        fontSize:  15
+                        color: app.fontColor
+                        //font.bold: true
+                        anchors.verticalCenter: jiaodai_switch.verticalCenter
+                    }
 
-                        AppSwitch {
-                            id: jiaodai_switch
-                            onToggled: {
-                                if(jiaodai_switch.checked==true){
-                                    //jiaodai_switch.enabled = false
-                                    apptext_res.text = "胶带测试开始"
-                                    serial.sendCmd("jiaodai",true,"","");
-                                }
+                    AppSwitch {
+                        id: jiaodai_switch
+                        onToggled: {
+                            if(jiaodai_switch.checked==true){
+                                //jiaodai_switch.enabled = false
+                                apptext_res.text = "胶带测试开始"
+                                serial.sendCmd("jiaodai",true,"","");
                             }
                         }
                     }
+                }
 
-                    Row {
-                        spacing: 100
+                Row {
+                    spacing: 100
 
-                        AppText{
-                            text: "补光测试"
-                            color: app.fontColor
-                            fontSize:  15
-                        }
+                    AppText{
+                        text: "补光测试"
+                        color: app.fontColor
+                        fontSize:  15
+                        //font.bold: true
+                        anchors.verticalCenter: led_switch.verticalCenter
+                    }
 
-                        AppSwitch {
-                            id: led_switch
-                            onToggled: {
-                                if(led_switch.checked==true){
-                                    serial.sendCmd("led",true,"","");
-                                    apptext_res.text = "补光灯已打开"
-                                }else{
-                                    serial.sendCmd("led",false,"","");
-                                    apptext_res.text = "补光灯已关闭"
-                                }
+                    AppSwitch {
+                        id: led_switch
+                        onToggled: {
+                            if(led_switch.checked==true){
+                                serial.sendCmd("led",true,"","");
+                                apptext_res.text = "补光灯已打开"
+                            }else{
+                                serial.sendCmd("led",false,"","");
+                                apptext_res.text = "补光灯已关闭"
                             }
                         }
                     }
+                }
 
 
-                    Row {
-                        spacing: 100
+                Row {
+                    spacing: 100
 
-                        AppText{
-                            text: "立即拍照"
-                            color: app.fontColor
-                            fontSize:  15
-                        }
+                    AppText{
+                        text: "立即拍照"
+                        color: app.fontColor
+                        fontSize:  15
+                        //font.bold: true
+                        anchors.verticalCenter: takephoto_switch.verticalCenter
+                    }
 
-                        AppSwitch {
-                            id: takephoto_switch
-                            onToggled: {
-                                if(takephoto_switch.checked==true){
-                                    apptext_res.text = "立即拍照"
-                                    frames.captureImage()
-                                }
+                    AppSwitch {
+                        id: takephoto_switch
+                        onToggled: {
+                            if(takephoto_switch.checked==true){
+                                apptext_res.text = "立即拍照"
+                                frames.captureImage()
                             }
                         }
                     }
+                }
 
-                    Row {
-                        spacing: 100
+                Row {
+                    spacing: 100
 
-                        AppText{
-                            text: "对焦拍照"
-                            color: app.fontColor
-                            fontSize:  15
-                        }
+                    AppText{
+                        text: "对焦拍照"
+                        color: app.fontColor
+                        fontSize:  15
+                        //font.bold: true
+                        anchors.verticalCenter: focus_switch.verticalCenter
+                    }
 
-                        AppSwitch {
-                            id: focus_switch
-                            onToggled: {
-                                if(focus_switch.checked==true){
-                                    apptext_res.text = "开始对焦"
-                                    focus_switch.enabled = false
-                                    serial.auto_takephoto(true)
-                                }
+                    AppSwitch {
+                        id: focus_switch
+                        onToggled: {
+                            if(focus_switch.checked==true){
+                                apptext_res.text = "开始对焦"
+                                focus_switch.enabled = false
+                                serial.auto_takephoto(true)
                             }
                         }
-
                     }
+                }
 
+                AppText {
+                    id: text_title2
+                    text: "步进电机控制"
+                    font.bold: true
+                    color: "#28a779"
+                    fontSize: 20
+                }
+                // 轴选择
+                Row {
+                    spacing: dp(1)
+                    width: parent.width
                     AppText {
-                        id: text_title2
-                        text: "步进电机控制"
-                        font.bold: true
-                        color: "#28a779"
-                        fontSize: 20
+                        text: "选择轴:"
+                        width: dp(60)  // 固定文本宽度
+                        anchors.verticalCenter: parent.verticalCenter
                     }
-                    // 轴选择
-                    Row {
-                        spacing: dp(1)
-                        width: parent.width
-                        AppText {
-                            text: "选择轴:"
-                            width: dp(60)  // 固定文本宽度
-                            anchors.verticalCenter: parent.verticalCenter
-                        }
-                        ComboBox {
-                            width: parent.width - dp(60)  // 剩余宽度
-                            model: ["Y轴"]
-                            onCurrentIndexChanged: currentAxis = currentIndex
-                        }
-                        AppButton{
-                            text: "校准"
-                            textColor: "black"
-                            flat: false
-                            borderColor: "black"
-                            borderWidth: dp(1)
-                            backgroundColor: "white"
-                            minimumHeight: dp(30)
-                            minimumWidth: dp(50)
-                            onClicked:
+                    ComboBox {
+                        width: parent.width - dp(60)  // 剩余宽度
+                        height: dp(40)
+                        model: ["Y轴"]
+                        onCurrentIndexChanged: currentAxis = currentIndex
+                    }
+                    AppButton{
+                        text: "校准"
+                        textColor: "black"
+                        flat: false
+                        borderColor: "black"
+                        borderWidth: dp(1)
+                        backgroundColor: "white"
+                        minimumHeight: dp(30)
+                        minimumWidth: dp(50)
+                        onClicked:
+                        {
+                            autotake(false)
+                            if(currentAxis==0)
                             {
-                                autotake(false)
-                                if(currentAxis==0)
-                                {
-                                    console.log("校准Y")
-                                    serial.sendCmd("calibrate",false,"y",speed.toString())
-                                }else if(currentAxis==1)
-                                {
-                                    console.log("校准Y")
-                                    serial.sendCmd("calibrate",false,"y",speed.toString())
-                                }else if(currentAxis==2)
-                                {
-                                    console.log("校准Z")
-                                    serial.sendCmd("calibrate",false,"z",speed.toString())
-                                }
+                                console.log("校准Y")
+                                serial.sendCmd("calibrate",false,"y",speed.toString())
                             }
                         }
                     }
-                    // 速度调节
-                    Row {
-                        spacing: dp(2)
-                        width: parent.width
-                        AppText {
-                            text: "速度:"
-                            width: dp(40)  // 固定文本宽度
-                            anchors.verticalCenter: parent.verticalCenter
+                }
+                // 速度调节
+                Row {
+                    spacing: dp(2)
+                    width: parent.width
+                    AppText {
+                        text: "速度:"
+                        width: dp(40)  // 固定文本宽度
+                        anchors.verticalCenter: parent.verticalCenter
 
-                        }
-                        AppSlider {
-                            width: parent.width - dp(60)  // 剩余宽度
-                            from: 0
-                            to: 100
-                            value: speed
-                            stepSize: 1
-                            onValueChanged: speed = value
-                            anchors.verticalCenter: parent.verticalCenter
-                        }
-                        AppText {
-                            text: speed
-                            width: dp(40)  // 固定文本宽度
-                            anchors.verticalCenter: parent.verticalCenter
-                        }
                     }
-                    // 步进距离设置
-                    Row {
-                        spacing: dp(10)
-                        width: parent.width
-                        AppText {
-                            text: "步进脉冲次数:"
-                            width: dp(120)  // 固定文本宽度
-                            anchors.verticalCenter: parent.verticalCenter
-                        }
-                        AppTextField {
-                            id: step_apptextfield
-                            width: parent.width - dp(120)  // 剩余宽度
-                            text: stepDistance
-                            validator: IntValidator { bottom: 0; top: 2000 }
-                            onTextChanged: stepDistance = parseInt(text)
-                        }
+                    AppSlider {
+                        width: parent.width - dp(60)  // 剩余宽度
+                        from: 0
+                        to: 100
+                        value: speed
+                        stepSize: 1
+                        onValueChanged: speed = value
+                        anchors.verticalCenter: parent.verticalCenter
+                    }
+                    AppText {
+                        text: speed
+                        width: dp(40)  // 固定文本宽度
+                        anchors.verticalCenter: parent.verticalCenter
+                    }
+                }
+                // 步进距离设置
+                Row {
+                    spacing: dp(10)
+                    width: parent.width
+                    AppText {
+                        text: "步进脉冲次数:"
+                        width: dp(120)  // 固定文本宽度
+                        anchors.verticalCenter: parent.verticalCenter
+                    }
+                    AppTextField {
+                        id: step_apptextfield
+                        width: parent.width - dp(120)  // 剩余宽度
+                        text: stepDistance
+                        validator: IntValidator { bottom: 0; top: 2000 }
+                        onTextChanged: stepDistance = parseInt(text)
                     }
-                    // 运动控制按钮
-                    Row {
-                        spacing: dp(10)
-                        width: parent.width
-                        AppButton {
-                            text: " 正转 "
-                            textColor: "black"
-                            flat: false
-                            borderColor: "black"
-                            borderWidth: dp(1)
-                            backgroundColor: "grey"
-                            minimumHeight: dp(30)
-                            minimumWidth: dp(50)
-                            width: (parent.width - dp(30))/3  // 平均分配宽度
-                            onClicked:
+                }
+                // 运动控制按钮
+                Row {
+                    spacing: dp(10)
+                    width: parent.width
+                    AppButton {
+                        text: " 正转 "
+                        textColor: "black"
+                        flat: false
+                        borderColor: "black"
+                        borderWidth: dp(1)
+                        backgroundColor: "grey"
+                        minimumHeight: dp(30)
+                        minimumWidth: dp(50)
+                        width: (parent.width - dp(30))/3  // 平均分配宽度
+                        onClicked:
+                        {
+                            if(currentAxis==0)
                             {
-                                if(currentAxis==0)
-                                {
-                                    console.log("Y轴正转:",stepDistance)
-                                    serial.sendCmd("movy",false,"f"+stepDistance,speed.toString())
-                                }
+                                console.log("Y轴正转:",stepDistance)
+                                serial.sendCmd("movy",false,"f"+stepDistance,speed.toString())
                             }
                         }
-                        AppButton {
-                            text: " 停止 "
-                            textColor: "black"
-                            flat: false
-                            borderColor: "black"
-                            borderWidth: dp(1)
-                            backgroundColor: "red"
-                            minimumHeight: dp(30)
-                            minimumWidth: dp(50)
-                            width: (parent.width - dp(30))/3  // 平均分配宽度
-                            onClicked:
+                    }
+
+                    AppButton {
+                        text: " 停止 "
+                        textColor: "black"
+                        flat: false
+                        borderColor: "black"
+                        borderWidth: dp(1)
+                        backgroundColor: "red"
+                        minimumHeight: dp(30)
+                        minimumWidth: dp(50)
+                        width: (parent.width - dp(30))/3  // 平均分配宽度
+                        onClicked:
+                        {
+                            console.log("停止")
+                            serial.sendCmd("movy",false,"f0","")
+                        }
+                    }
+
+                    AppButton {
+                        text: " 反转 "
+                        textColor: "black"
+                        flat: false
+                        borderColor: "black"
+                        borderWidth: dp(1)
+                        backgroundColor: "grey"
+                        minimumHeight: dp(30)
+                        minimumWidth: dp(50)
+                        width: (parent.width - dp(30))/3  // 平均分配宽度
+
+                        onClicked:
+                        {
+                            if(currentAxis==0)
                             {
-                                console.log("停止")
-                                serial.sendCmd("movy",false,"f0","")
+                                console.log("Y轴反转:",stepDistance)
+                                serial.sendCmd("movy",false,"b"+stepDistance,speed.toString())
                             }
                         }
-                        AppButton {
-                            text: " 反转 "
-                            textColor: "black"
-                            flat: false
-                            borderColor: "black"
-                            borderWidth: dp(1)
-                            backgroundColor: "grey"
-                            minimumHeight: dp(30)
-                            minimumWidth: dp(50)
-                            width: (parent.width - dp(30))/3  // 平均分配宽度
-                            onClicked:
+                    }
+                    AppButton {
+                        text: " 复位 "
+                        textColor: "black"
+                        flat: false
+                        borderColor: "black"
+                        borderWidth: dp(1)
+                        backgroundColor: "grey"
+                        minimumHeight: dp(30)
+                        minimumWidth: dp(50)
+                        width: (parent.width - dp(30))/3  // 平均分配宽度
+                        onClicked: {
+                            if(currentAxis==0)
                             {
-                                if(currentAxis==0)
-                                {
-                                    console.log("Y轴反转:",stepDistance)
-                                    serial.sendCmd("movy",false,"b"+stepDistance,speed.toString())
-                                }
+                                console.log("Y轴复位!")
+                                serial.sendCmd("movy",true,"",speed.toString())
                             }
                         }
-                        AppButton {
-                            text: " 复位 "
-                            textColor: "black"
-                            flat: false
-                            borderColor: "black"
-                            borderWidth: dp(1)
-                            backgroundColor: "grey"
-                            minimumHeight: dp(30)
-                            minimumWidth: dp(50)
-                            width: (parent.width - dp(30))/3  // 平均分配宽度
-                            onClicked: {
-                                if(currentAxis==0)
-                                {
-                                    console.log("Y轴复位!")
-                                    serial.sendCmd("movy",true,"",speed.toString())
-                                }
-                            }
+                    }
+                }
+
+                AppText {
+                    id: text_camera
+                    text: "相机参数"
+                    font.bold: true
+                    color: "#28a779"
+                    fontSize: 20
+                }
+
+                Row {
+                    spacing: dp(10)
+                    width: parent.width
+                    AppText {
+                        id: txt_fExposureTime
+                        text: "曝光值:"
+                    }
+
+                    AppTextField {
+                        anchors.verticalCenter: txt_fExposureTime.verticalCenter
+                        placeholderText: fExposureTime
+                        text: fExposureTime
+
+                        width: parent.width - dp(10)  // 剩余宽度
+                        EnterKey.type: Qt.EnterKeyDone
+                        wrapMode: Text.NoWrap
+                        inputMethodHints: Qt.ImhFormattedNumbersOnly |
+                                          Qt.ImhPreferDone |
+                                          Qt.ImhNoPredictiveText
+
+                        validator: DoubleValidator {
+                            bottom: 100.00        // 最小值
+                            top: 500000.00        // 最大值
+                            decimals: 0
+                        }
+
+
+                        // 🔥 关键 3:兜底(IME 再作妖也不怕)
+                        Keys.onReturnPressed: {
+                            frames.cam_ExposureTime = text
+                            console.log("设置曝光时间:",text)
+                            Qt.inputMethod.hide()
+                        }
+
+                        onAccepted: {
+                            frames.cam_ExposureTime = text
+                            console.log("设置曝光时间",text)
                         }
+
                     }
+                }
             }
         }
     }

+ 3 - 2
app_bzy_armhf_7/src/cameramanager.cpp

@@ -250,7 +250,7 @@ Frames::setCameraSw(bool stat_cam)
     param::camera_tc = 0;
     stitch_des = 0;
     camera_sta = stat_cam;
-    if(m_streaming_active&&camera_sta) return;  //如果已经是打开状态,退出
+    if(camera_sta && m_streaming_active) return;  //如果已经是打开状态,退出
     MVCC_FLOATVALUE stExposureTime = {0};
     static int fd = 0;
     if(camera_sta){
@@ -487,7 +487,7 @@ Frames::setCameraSw(bool stat_cam)
                 createFolder(picture_path_floader);
                 m_fps_timer->setRunning(true);
                 m_1s->start();
-
+                m_streaming_active = true;
                 emit startGrabbing(true);
             }
 #endif
@@ -534,6 +534,7 @@ Frames::setCameraSw(bool stat_cam)
         }
         m_fps_timer->setRunning(false);
         m_1s->stop();                       //视频信息发送定时器停止
+        m_streaming_active = false;
     }
 
     LOG("设置相机状态:{}",camera_sta);

+ 26 - 13
app_bzy_armhf_7/src/m_json.cpp

@@ -88,27 +88,40 @@ JsonFunc::BoardMessage()
 
     // 遍历网络接口并判断连接状态
     bool isConnected = false;
+    QString temp_net_name;
+    QString temp_net_description;
+    QString temp_net_mac;
+    QString temp_net_ipv4;
+    
     for (const QNetworkInterface& interface : interfaces) {
         if (interface.flags() & QNetworkInterface::IsUp && !(interface.flags() & QNetworkInterface::IsLoopBack)) {
 
-            param::net_name = interface.name();
-            param::net_description = interface.humanReadableName();
-            param::net_mac = interface.hardwareAddress();
-            param::net_ipv4 = interface.addressEntries().first().ip().toString();
-            qDebug() << "接口名称:" << param::net_name;
-            qDebug() << "接口描述:" << param::net_description;
-            qDebug() << "MAC地址:" << param::net_mac;
-            qDebug() << "IPv4地址:" << param::net_ipv4;
+            temp_net_name = interface.name();
+            temp_net_description = interface.humanReadableName();
+            temp_net_mac = interface.hardwareAddress();
+            // 安全获取IP地址
+            QList<QNetworkAddressEntry> entries = interface.addressEntries();
+            if (!entries.isEmpty()) {
+                temp_net_ipv4 = entries.first().ip().toString();
+                param::net_ipv4 = temp_net_ipv4;
+                param::net_name = temp_net_name;
+                param::net_description = temp_net_description;
+                param::net_mac = interface.hardwareAddress();
+            } else {
+                temp_net_ipv4 = "";
+            }
+            
+            qDebug() << "接口名称:" << temp_net_name;
+            qDebug() << "接口描述:" << temp_net_description;
+            qDebug() << "MAC地址:" << temp_net_mac;
+            qDebug() << "IPv4地址:" << temp_net_ipv4;
             isConnected = true;
             break;
         }
     }
 
-    if (param::net_alive) {
-        net_value="0";
-    } else {
-        net_value="1";
-    }
+    // 安全处理网络状态
+    net_value = param::net_alive ? "0" : "1";
 
     QByteArray transmitDataTemp;
     // 定义 { } 对象

+ 1 - 1
app_bzy_armhf_7/src/mqtthandler.cpp

@@ -419,7 +419,7 @@ void MqttHandler::install_app(){
     QTimer::singleShot(5000, [](){
         auto qtContext = QJniObject(QNativeInterface::QAndroidApplication::context());    //activity
         if(qtContext.isValid()){
-            QJniObject jClass("com/yfkj/cb/Q6iot/StatusBarCtr");
+            QJniObject jClass("com/yfkj/bzyv1/StatusBarCtr");
             jClass.callMethod<void>("installApp","(Landroid/content/Context;)V",qtContext.object());
         }
     });

+ 83 - 7
app_bzy_armhf_7/src/mserial.cpp

@@ -165,6 +165,25 @@ SerialThread::processJsonData(const QByteArray &jsonData)
         if(!uartValue.isNull()){
             sendData(m_json.BoardMessage());
         }
+
+        // 处理 jsonrpc 2.0 格式
+        QJsonValue methodValue = jsonObject.value(QStringLiteral("method"));
+        if (!methodValue.isNull() && methodValue.isString()) {
+            QString methodName = methodValue.toString();
+            if (methodName == QStringLiteral("sync_param")) {
+                QJsonValue paramsValue = jsonObject.value(QStringLiteral("params"));
+                if (paramsValue.isObject()) {
+                    LOG("收到 sync_param, 保存 MCU 参数到数据库");
+                    saveMcuParam(paramsValue.toObject());
+                }
+                return;
+            } else if (methodName == QStringLiteral("recover_param")) {
+                LOG("收到 recover_param, 从数据库恢复 MCU 参数");
+                recoverMcuParam();
+                return;
+            }
+        }
+
         if(!cmdValue.isNull())
         {
             QString value_cmd = cmdValue.toString();
@@ -181,13 +200,8 @@ SerialThread::processJsonData(const QByteArray &jsonData)
                             emit dataUpload(jsonData);
                             emit autotestdone();
                         }else if(statusValue.toString().contains("update")){
-                            QString appDataPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
-                            // 在内部存储空间路径下创建子目录
-                            QString subDirName = "/rtthread.rbl";
-                            QString subDirPath = appDataPath + subDirName;
-                            qDebug() << "FilePath is:"<< subDirPath;
                             emit dataUpload(jsonData);
-                            emit updatestart(subDirPath);
+                            //emit updatestart(subDirPath);
                             //this->stop();
                         }else if(statusValue.toString().contains("auto_takephoto")){
                             param::ptlist_res.clear();
@@ -245,7 +259,7 @@ void
 SerialThread::readBoardData()
 {
     param::datupload_remain = m_dat_f.remainingTime();
-    sendData(m_json.ReadBoardData());
+    sendData(m_json.BoardMessage());
     connect_board++;
     if(connect_board>=3){   //初始化主板连接状态为未连接
         dataBuf.clear();
@@ -344,3 +358,65 @@ void SerialThread::startYmodem(QString path)
         Q_ARG(QString, path)
         );
 }
+
+void SerialThread::saveMcuParam(const QJsonObject &params)
+{
+    if (!sqlConfig->OpenDb()) {
+        ERROR("saveMcuParam: OpenDb failed");
+        return;
+    }
+
+    QString tableName = QStringLiteral("mcu_param");
+    if (!sqlConfig->isTableExist(tableName)) {
+        QString createSql = QStringLiteral(
+            "CREATE TABLE mcu_param (id INTEGER PRIMARY KEY CHECK (id = 1), json_data TEXT)"
+            );
+        QSqlQuery query;
+        if (!query.exec(createSql)) {
+            ERROR("saveMcuParam: CreateTable failed: {}", query.lastError().text().toStdString());
+            sqlConfig->CloseDb();
+            return;
+        }
+        LOG("saveMcuParam: mcu_param table created");
+    }
+
+    QString jsonStr = QString::fromUtf8(QJsonDocument(params).toJson(QJsonDocument::Compact));
+    QSqlQuery query;
+    query.prepare(QStringLiteral("INSERT OR REPLACE INTO mcu_param (id, json_data) VALUES (1, ?)"));
+    query.addBindValue(jsonStr);
+    if (!query.exec()) {
+        ERROR("saveMcuParam failed: {}", query.lastError().text().toStdString());
+    } else {
+        LOG("saveMcuParam: saved {}", jsonStr.toStdString());
+    }
+
+    sqlConfig->CloseDb();
+}
+
+void SerialThread::recoverMcuParam()
+{
+    if (!sqlConfig->OpenDb()) {
+        ERROR("recoverMcuParam: OpenDb failed");
+        return;
+    }
+
+    QString tableName = QStringLiteral("mcu_param");
+    if (!sqlConfig->isTableExist(tableName)) {
+        WARN("recoverMcuParam: mcu_param table not exist");
+        sqlConfig->CloseDb();
+        return;
+    }
+
+    QSqlQuery query;
+    if (!query.exec(QStringLiteral("SELECT json_data FROM mcu_param WHERE id = 1")) || !query.next()) {
+        WARN("recoverMcuParam: no data found");
+        sqlConfig->CloseDb();
+        return;
+    }
+
+    QString jsonStr = query.value(QStringLiteral("json_data")).toString();
+    LOG("recoverMcuParam: sending {}", jsonStr.toStdString());
+    sendData(jsonStr.toUtf8());
+
+    sqlConfig->CloseDb();
+}

+ 7 - 3
app_bzy_armhf_7/src/ymodem.cpp

@@ -182,8 +182,6 @@ void YMODEM::configureForProtocolMode(bool enable)
 int YMODEM::yTransmit()
 {
     LOG("Starting YMODEM transmission...");
-
-
     // 进入协议专用模式
     m_serialPort->setDataTerminalReady(false);
     m_serialPort->clear(QSerialPort::AllDirections);
@@ -191,7 +189,6 @@ int YMODEM::yTransmit()
     // 配置特殊串口模式(忽略非协议字符)
     configureForProtocolMode(true);
 
-
     if (!isConnected()) {
         ERROR("串口未打开!");
         return -1;
@@ -199,10 +196,17 @@ int YMODEM::yTransmit()
 
     QFile file(m_fp);
     if (!file.exists())
+    {
+        ERROR("MODEM_FILE_NOT_FOUND_ERROR!");
         return MODEM_FILE_NOT_FOUND_ERROR;
+    }
     QFileInfo fileInfo(m_fp);
     if (!file.open(QIODevice::ReadOnly))
+    {
+        ERROR("MODEM_FILE_NOT_OPEN_ERROR!");
         return MODEM_FILE_NOT_OPEN_ERROR;
+    }
+
 
 
     // 预计算文件大小和块数