zhunk vor 1 Jahr
Ursprung
Commit
5043aae442

+ 2 - 2
q6_felgo_iot/CMakeLists.txt.user

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 14.0.1, 2025-07-10T14:31:33. -->
+<!-- Written by QtCreator 14.0.1, 2025-07-21T10:20:19. -->
 <qtcreator>
  <data>
   <variable>EnvironmentId</variable>
@@ -196,7 +196,7 @@
      <value type="QString">armeabi-v7a</value>
      <value type="QString">armeabi</value>
     </valuelist>
-    <value type="QString" key="AndroidDeviceSerialNumber">a444f6d3cae8dc9f</value>
+    <value type="QString" key="AndroidDeviceSerialNumber">3a206370cae8dc9f</value>
     <value type="int" key="AndroidVersion.ApiLevel">30</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">

+ 1 - 0
q6_felgo_iot/header/m_json.h

@@ -28,6 +28,7 @@ public:
     QByteArray CmdUpdate();
     QByteArray CmdReboot();
     QByteArray CmdParamconf(int sh1,int eh1,int sh2,int eh2,int sh3,int eh3);
+    QByteArray CmdParamconf_xy_dis(int x_dis,int y_dis);
     QByteArray CmdFocus();
     QByteArray WarnPhoto(QString err);
 signals:

+ 1 - 1
q6_felgo_iot/header/main.h

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

+ 4 - 0
q6_felgo_iot/header/mserial.h

@@ -60,6 +60,10 @@ public:
         sendData(m_json.CmdParamconf(sh1,eh1,sh2,eh2,sh3,eh3));
     }
 
+    Q_INVOKABLE void setHt_xy_dis(int xdis ,int ydis){
+        sendData(m_json.CmdParamconf_xy_dis(xdis,ydis));
+    }
+
     Q_INVOKABLE void setLightness(int val){
         auto qtContext = QJniObject(QNativeInterface::QAndroidApplication::context());    //activity
         if (qtContext.isValid()) {

+ 118 - 12
q6_felgo_iot/qml/pages/HomePage.qml

@@ -108,6 +108,14 @@ AppPage {
           text_current.text = "电流:" + jsonData.ext.current + "mA"
           text_lat.text = "lat:" + jsonData.ext.lat
           text_lng.text = "lng:" + jsonData.ext.lng
+          var x_init_dis = jsonData.ext.x_init_dis
+          var y_init_dis = jsonData.ext.y_init_dis
+          if(!textInput_x.focus){
+              textInput_x.text = x_init_dis.toString();
+          }
+          if(!textInput_y.focus){
+              textInput_y.text = y_init_dis.toString();
+          }
           var dvs = jsonData.ext.dver
           dvs = dvs.split("-")
           app.bvReceived(dvs[0])
@@ -217,36 +225,134 @@ AppPage {
             width: parent.width
             height: parent.height*0.5
             spacing:5
+
             Rectangle {
-                width: parent.width*0.245
+                width: parent.width * 0.245
                 height: parent.height
                 color: app.cardColor
                 radius: 5
-
-                Column{
-                    anchors.fill: parent
-                    spacing: 5
-                    //anchors.leftMargin: 10
+                Column {
+                    anchors {
+                        top: parent.top
+                        left: parent.left
+                        right: parent.right
+                        margins: 10
+                    }
+                    spacing: 10
                     AppImage {
                         id: image_01
-                         // 将元素的顶部锚定到父元素的顶部
-                        anchors.horizontalCenter: parent.horizontalCenter   //垂直居中显示
+                        anchors.horizontalCenter: parent.horizontalCenter
                         anchors.topMargin:  30
-                        fillMode: Image.PreserveAspectFit  // 保持纵横比适应
                         source: "../../assets/a.svg"
+                        fillMode: Image.PreserveAspectFit
                     }
-
-                    AppText{
+                    AppText {
                         id: text_devicesta
-                        anchors.horizontalCenter: parent.horizontalCenter   //垂直居中显示
+                        anchors.horizontalCenter: parent.horizontalCenter
                         text: "工作状态:"
                         color: app.fontColor
                         font.bold: true
+                        font.pixelSize: 16
+                    }
+                    // X坐标输入框
+                    Row {
+                        width: parent.width*0.6
+                        spacing: 5
+
+                        AppText {
+                            text: "X坐标:"
+                            color: app.fontColor
+                            font.pixelSize: 20
+                        }
+                        // 使用边框包裹
+                        ItemDelegate {
+                            width: parent.width
+                            height: 42
+                            padding: 0
+                            contentItem: AppTextInput {
+                                id: textInput_x
+                                width: parent.width
+                                height: parent.height
+                                placeholderText: "x_init_dis"
+                                text: "0"
+                                font.family: "Arial"
+                                font.pixelSize: 20
+
+                                // 使用验证器替代inputMask
+                                validator: DoubleValidator {
+                                    decimals: 2
+                                }
+
+                                property real numericValue_x: Number(text) || 0
+
+                                onAccepted: {
+                                    console.log("X坐标:", numericValue_x)
+                                    serial.setHt_xy_dis(numericValue_x, textInput_y.numericValue_y)
+                                }
+                            }
+
+                            // 边框样式
+                            Rectangle {
+                                anchors.fill: parent
+                                color: "transparent"
+                                border.color: textInput_x.activeFocus ? "blue" : "gray"
+                                border.width: 1
+                                radius: 4
+                            }
+                        }
+                    }
+                    // Y坐标输入框
+                    Row {
+                        width: parent.width*0.6
+                        spacing: 5
+
+                        AppText {
+                            text: "Y坐标:"
+                            color: app.fontColor
+                            font.pixelSize: 20
+                        }
+                        // 使用边框包裹
+                        ItemDelegate {
+                            width: parent.width
+                            height: 42
+                            padding: 0
+                            contentItem: AppTextInput {
+                                id: textInput_y
+                                width: parent.width
+                                height: parent.height
+                                placeholderText: "y_init_dis"
+                                text: "0"
+                                font.family: "Arial"
+                                font.pixelSize: 20
+
+                                // 使用验证器替代inputMask
+                                validator: DoubleValidator {
+                                    decimals: 2
+                                }
+
+                                property real numericValue_y: Number(text) || 0
+
+                                onAccepted: {
+                                    console.log("Y坐标:", numericValue_y)
+                                    serial.setHt_xy_dis(textInput_x.numericValue_x, numericValue_y)
+                                }
+                            }
+
+                            // 边框样式
+                            Rectangle {
+                                anchors.fill: parent
+                                color: "transparent"
+                                border.color: textInput_x.activeFocus ? "blue" : "gray"
+                                border.width: 1
+                                radius: 4
+                            }
+                        }
                     }
 
                 }
             }
 
+
             Rectangle {
                 radius: 5
 

+ 3 - 3
q6_felgo_iot/qml/pages/TestPage.qml

@@ -34,7 +34,7 @@ AppPage {
             //frames.auto_clicked = true  //开始对焦
             auto_timer.start()  //启动对焦定时器
             console.log("相机已打开")
-            photoTimer.interval=600*1000
+            photoTimer.interval=60*1000
             photoTimer.start()
 
         }else{
@@ -55,7 +55,7 @@ AppPage {
 
         onQulityStringChanged: {
             loginpage.logintimeout = 600;   //拍照刷新熄屏计时
-            photoTimer.interval = 600*1000
+            photoTimer.interval = 60*1000
             photoTimer.restart()
         }
 
@@ -65,7 +65,7 @@ AppPage {
                 //camera.start()
                 loginpage.logintimeout = 600;   //拍照刷新熄屏计时
                 output.visible = sta_cam
-                photoTimer.interval = 600*1000
+                photoTimer.interval = 60*1000
                 photoTimer.start()
                 //uvc_camera.visible  = false
 

+ 15 - 17
q6_felgo_iot/src/cameramanager.cpp

@@ -786,8 +786,6 @@ Frames::handleGrab(bool sta_cam){
                                 {
                                     param::ptlist.append(pic_name);
 
-
-
                                     /*z3x7*/
                                     if(z_step==3&&x_step==7){
                                         emit stopGrabbing(false);
@@ -795,7 +793,7 @@ Frames::handleGrab(bool sta_cam){
 
                                     if(z_step<=2&&x_step==7){
                                         z_step++;
-                                        emit serial_data(m_json.MotorMove("movz","f55","50"));
+                                        emit serial_data(m_json.MotorMove("movz","b80","50"));
                                     }
 
 
@@ -805,11 +803,11 @@ Frames::handleGrab(bool sta_cam){
                                         //emit stopGrabbing(false);
                                         x_step++;
                                         z_step = 0;
-                                        emit serial_data(m_json.MotorMove("movx","f55","50"));
+                                        emit serial_data(m_json.MotorMove("movx","f80","50"));
                                     }
                                     if(z_step<=2&&x_step==6){
                                         z_step++;
-                                        emit serial_data(m_json.MotorMove("movz","b55","50"));
+                                        emit serial_data(m_json.MotorMove("movz","f80","50"));
                                     }
 
                                     /*z3x5*/
@@ -818,11 +816,11 @@ Frames::handleGrab(bool sta_cam){
                                         //emit stopGrabbing(false);
                                         x_step++;
                                         z_step = 0;
-                                        emit serial_data(m_json.MotorMove("movx","b55","50"));
+                                        emit serial_data(m_json.MotorMove("movx","f80","50"));
                                     }
                                     if(z_step<=2&&x_step==5){
                                         z_step++;
-                                        emit serial_data(m_json.MotorMove("movz","f55","50"));
+                                        emit serial_data(m_json.MotorMove("movz","b80","50"));
                                     }
 
                                     /*z3x4*/
@@ -830,11 +828,11 @@ Frames::handleGrab(bool sta_cam){
                                     {
                                         x_step++;
                                         z_step = 0;
-                                        emit serial_data(m_json.MotorMove("movx","f55","50"));
+                                        emit serial_data(m_json.MotorMove("movx","f80","50"));
                                     }
                                     if(z_step<=2&&x_step==4){
                                         z_step++;
-                                        emit serial_data(m_json.MotorMove("movz","b55","50"));
+                                        emit serial_data(m_json.MotorMove("movz","f80","50"));
                                     }
 
                                     /*z3x3*/
@@ -842,11 +840,11 @@ Frames::handleGrab(bool sta_cam){
                                     {
                                         x_step++;
                                         z_step = 0;
-                                        emit serial_data(m_json.MotorMove("movx","f55","50"));
+                                        emit serial_data(m_json.MotorMove("movx","f80","50"));
                                     }
                                     if(z_step<=2&&x_step==3){
                                         z_step++;
-                                        emit serial_data(m_json.MotorMove("movz","f55","50"));
+                                        emit serial_data(m_json.MotorMove("movz","b80","50"));
                                     }
                                     /**/
 
@@ -855,11 +853,11 @@ Frames::handleGrab(bool sta_cam){
                                     {
                                         x_step++;
                                         z_step = 0;
-                                        emit serial_data(m_json.MotorMove("movx","f55","50"));
+                                        emit serial_data(m_json.MotorMove("movx","f80","50"));
                                     }
                                     if(z_step<=2&&x_step==2){
                                         z_step++;
-                                        emit serial_data(m_json.MotorMove("movz","b55","50"));
+                                        emit serial_data(m_json.MotorMove("movz","f80","50"));
                                     }
                                     /**/
 
@@ -868,12 +866,12 @@ Frames::handleGrab(bool sta_cam){
                                     {
                                         x_step++;
                                         z_step = 0;
-                                        emit serial_data(m_json.MotorMove("movx","f55","50"));
+                                        emit serial_data(m_json.MotorMove("movx","f80","50"));
                                     }
 
                                     if(z_step<=2&&x_step==1){
                                         z_step++;
-                                        emit serial_data(m_json.MotorMove("movz","f55","50"));
+                                        emit serial_data(m_json.MotorMove("movz","b80","50"));
                                     }
 
                                     /*z3x0*/
@@ -881,12 +879,12 @@ Frames::handleGrab(bool sta_cam){
                                     {
                                         x_step++;
                                         z_step = 0;
-                                        emit serial_data(m_json.MotorMove("movx","f55","50"));
+                                        emit serial_data(m_json.MotorMove("movx","f80","50"));
                                     }
                                     if(z_step<=2&&x_step==0)
                                     {
                                         z_step++;
-                                        emit serial_data(m_json.MotorMove("movz","b55","50"));
+                                        emit serial_data(m_json.MotorMove("movz","f80","50"));
                                     }
                                 }
                             }

+ 16 - 0
q6_felgo_iot/src/m_json.cpp

@@ -296,6 +296,22 @@ JsonFunc::CmdParamconf(int sh1,int eh1,int sh2,int eh2,int sh3,int eh3){
 }
 
 QByteArray
+JsonFunc::CmdParamconf_xy_dis(int x_dis,int y_dis){
+    QByteArray transmitDataTemp;
+    QJsonObject mesageObj;
+    QJsonObject mesageObjext;
+    mesageObj.insert("cmd","paramconf");
+    mesageObjext.insert("x_init_dis",x_dis);
+    mesageObjext.insert("y_init_dis",y_dis);
+    mesageObj.insert("ext",mesageObjext);
+
+    QJsonDocument document=QJsonDocument(mesageObj);
+    transmitDataTemp = document.toJson();
+    transmitDataTemp = transmitDataTemp.trimmed();  //去除字符串两端的空格和换行符
+    return transmitDataTemp;
+}
+
+QByteArray
 JsonFunc::CmdFocus(){
     QByteArray transmitDataTemp;
     QJsonObject mesageObj;