浏览代码

调整按钮外观,手动操作页面,去掉4个电磁阀的控制

guoqiang 2 年之前
父节点
当前提交
7c8807caea
共有 3 个文件被更改,包括 30 次插入122 次删除
  1. 7 7
      PageSetting.qml
  2. 22 114
      PageTest.qml
  3. 1 1
      UserButton.qml

+ 7 - 7
PageSetting.qml

@@ -252,7 +252,7 @@ Item{
                             height: 160
 
                             Column{
-                                //spacing:5
+                                spacing:10
                                // anchors.centerIn: parent
 
                                 Rectangle{
@@ -293,8 +293,8 @@ Item{
                                        text: "标准管理"
                                        font.pixelSize: 20
 
-                                       implicitHeight: 120
-                                       implicitWidth: 160
+                                       implicitHeight: 45
+                                       implicitWidth: 120
 
                                        //Layout.leftMargin: -30
                                        //Layout.topMargin: 10
@@ -639,8 +639,8 @@ Item{
                     UserButton {
                         id: prev_step
                         text: "返回首页"
-                        height: 80
-                        width: 180
+                        height: 60
+                        width: 160
                         font.pixelSize: 24
                         anchors.left: parent.left;
                         anchors.leftMargin: 40;
@@ -660,8 +660,8 @@ Item{
                         anchors.rightMargin: 60;
                         anchors.bottom: parent.bottom;
                         anchors.bottomMargin: 10;
-                        height: 80
-                        width: 180
+                        height: 60
+                        width: 160
 
                         onClicked: {
                             //log.show(utr.state)

+ 22 - 114
PageTest.qml

@@ -62,25 +62,26 @@ Item{
 
             DynamicGroupBox{
                 id:relays_control
-                title: "继电器控制"
+                title: "电磁阀控制"
 
                 width: 800
-                height: 300
+                height: 100
 
-                GridLayout{
+                Row{
                     anchors.centerIn: parent
-                    columns: 4
-                    rows:3
-                    columnSpacing:  80
-                    rowSpacing: 30
+                    //columns: 4
+                    //rows:1
+                    //columnSpacing:  80
+                    //rowSpacing: 30
+                    spacing: 60
 
 
                     UserSwitch{
                         id:switch1
-                        text: "粗调阀1关"
+                        text: "进气阀关"
                         onCheckedChanged: {
                             //console.log("switch 1 onCheckedChanged")
-                            switch1.text = switch1.checked ? "粗调阀1开":"粗调阀1关"
+                            switch1.text = switch1.checked ? "进气阀开":"进气阀关"
 
 
                         }
@@ -98,9 +99,9 @@ Item{
 
                     UserSwitch{
                         id:switch2
-                        text: "粗调阀2关"
+                        text: "泄气阀关"
                         onCheckedChanged: {
-                            switch2.text = switch2.checked ? "粗调阀2开":"粗调阀2关"
+                            switch2.text = switch2.checked ? "泄气阀开":"泄气阀关"
 
                         }
                         onClicked: {
@@ -113,9 +114,9 @@ Item{
                     }
                     UserSwitch{
                         id:switch3
-                        text: "粗调阀3关"
+                        text: "传感阀关"
                         onCheckedChanged: {
-                            switch3.text = switch3.checked ? "粗调阀3开":"粗调阀3关"
+                            switch3.text = switch3.checked ? "传感阀开":"传感阀关"
 
                         }
 
@@ -129,9 +130,9 @@ Item{
                     }
                     UserSwitch{
                         id:switch4
-                        text: "校准阀 关"
+                        text: "校准阀关"
                         onCheckedChanged: {
-                            switch4.text = switch4.checked ? "校准阀 开":"校准阀 关"
+                            switch4.text = switch4.checked ? "校准阀开":"校准阀关"
 
                         }
 
@@ -143,99 +144,6 @@ Item{
                             }
                         }
                     }
-                    UserSwitch{
-                        id:switch5
-                        text: "传感阀 关"
-                        onCheckedChanged: {
-                            switch5.text = switch5.checked ? "传感阀 开":"传感阀 关"
-
-                        }
-
-                        onClicked: {
-                            if(switch5.checked){
-                                testService.valve_open(TestService.Valve_ID_PRESSURESENSOR)
-                            }else{
-                                testService.valve_close(TestService.Valve_ID_PRESSURESENSOR)
-                            }
-                        }
-                    }
-                    UserSwitch{
-                        id:switch6
-                        text: "真空阀 关"
-                        onCheckedChanged: {
-                            switch6.text = switch6.checked ? "真空阀 开":"真空阀 关"
-
-                        }
-
-                        onClicked: {
-                            if(switch6.checked){
-                                testService.valve_open(TestService.Valve_ID_VACUUM)
-                            }else{
-                                testService.valve_close(TestService.Valve_ID_VACUUM)
-                            }
-                        }
-                    }
-                    UserSwitch{
-                        id:switch7
-                        text: "泄气阀 关"
-                        onCheckedChanged: {
-                            switch7.text = switch7.checked ? "泄气阀 开":"泄气阀 关"
-
-                        }
-
-                        onClicked: {
-                            if(switch7.checked){
-                                testService.valve_open(TestService.Valve_ID_VENT)
-                            }else{
-                                testService.valve_close(TestService.Valve_ID_VENT)
-                            }
-                        }
-                    }
-                    UserSwitch{
-                        id:switch8
-                        text: "进气阀 关"
-                        onCheckedChanged: {
-                            switch8.text = switch8.checked ? "进气阀 开":"进气阀 关"
-
-                        }
-
-                        onClicked: {
-                            if(switch8.checked){
-                                testService.valve_open(TestService.Valve_ID_INTAKE)
-                            }else{
-                                testService.valve_close(TestService.Valve_ID_INTAKE)
-                            }
-                        }
-                    }
-
-                    UserSwitch{
-                        id:switchall
-                        text: "全关"
-                        onCheckedChanged: {
-                            switchall.text = switch8.checked ? "全关":"全开"
-                            if(switchall.checked){
-                                testService.valve_open(TestService.Valve_ID_All)
-                                switch1.checked=true
-                                switch2.checked=true
-                                switch3.checked=true
-                                switch4.checked=true
-                                switch5.checked=true
-                                switch6.checked=true
-                                switch7.checked=true
-                                switch8.checked=true
-                            }else{
-                                testService.valve_close(TestService.Valve_ID_All)
-                                switch1.checked=false
-                                switch2.checked=false
-                                switch3.checked=false
-                                switch4.checked=false
-                                switch5.checked=false
-                                switch6.checked=false
-                                switch7.checked=false
-                                switch8.checked=false
-                            }
-                        }
-                    }
 
                 }
 
@@ -274,8 +182,8 @@ Item{
 
                             anchors.verticalCenter: parent.verticalCenter
 
-                            implicitWidth: 100
-                            implicitHeight: 60
+                            width: 120
+                            height: 45
 
                             onClicked: {
                                 //var str_number = voltage.text
@@ -345,8 +253,8 @@ Item{
                     font.pixelSize: 20
                     anchors.verticalCenter: parent.verticalCenter
 
-                    implicitWidth: 100
-                    implicitHeight: 60
+                    implicitWidth: 120
+                    implicitHeight: 45
 
                     onEnabledChanged: {
                         if(timer.running){
@@ -427,8 +335,8 @@ Item{
 
                         //height: 40
                         //width: 160
-                        implicitWidth: 100
-                        implicitHeight: 60
+                        implicitWidth: 120
+                        implicitHeight: 45
                         onClicked: {
                             //var str_number = voltage.text
                             if(false == bSelfTest_Started){

+ 1 - 1
UserButton.qml

@@ -31,7 +31,7 @@ Button {
         color: "transparent"
             Image {
             anchors.fill:parent
-            fillMode: Image.PreserveAspectFit
+            //fillMode: Image.PreserveAspectFit
             source:"img/blue_button.png"
         }
     }