|
|
@@ -152,7 +152,7 @@ AppPage {
|
|
|
if(jsonData.ext.boxtem){
|
|
|
text_tempture0.text = "箱内温度:" + jsonData.ext.boxtem + "℃"
|
|
|
}
|
|
|
- text_tempture.text = "温度:" + jsonData.ext.at + "℃"
|
|
|
+ text_tempture.text = "环境温度:" + jsonData.ext.at + "℃"
|
|
|
text_humidity.text = "湿度:" + jsonData.ext.ah + "%RH"
|
|
|
text_vbat.text = "电压:" + jsonData.ext.vbat + "V"
|
|
|
text_current.text = "电流:" + jsonData.ext.current + "mA"
|
|
|
@@ -173,7 +173,12 @@ AppPage {
|
|
|
text_tempture_sta.text = "正常:" + "["+ jsonData.ext.tpl +"]"
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if(jsonData.ext.tph&&temp_setting.visible===false){
|
|
|
+ highTempSlider.value = jsonData.ext.tph
|
|
|
+ }
|
|
|
+ if(jsonData.ext.tpl&&temp_setting.visible===false){
|
|
|
+ lowTempSlider.value = jsonData.ext.tpl
|
|
|
+ }
|
|
|
var dvs = jsonData.ext.dver
|
|
|
dvs = dvs.split("-")
|
|
|
app.bvReceived(dvs[0])
|
|
|
@@ -508,7 +513,7 @@ AppPage {
|
|
|
net_sta.text = qsTr("<b>联网状态:</b> %1").arg(isonline? "已联网" : "未联网")
|
|
|
net_sta.color = qsTr("%1").arg(isonline? "green" : "red")
|
|
|
ipv4.text = qsTr("<b>[IPV4] </b> %1").arg(net_list[4])
|
|
|
- mac.text = qsTr("<b>[MAC] </b> %1").arg(net_list[3])
|
|
|
+ //mac.text = qsTr("<b>[MAC] </b> %1").arg(net_list[3])
|
|
|
datt_text.text = "数据上传间隔:" + net_list[6] + "分钟"
|
|
|
netxd_text.text = "下一次数据上传:" + net_list[7] + "秒"
|
|
|
iccid_text.text = "SIM卡号:" + iccidString
|
|
|
@@ -557,13 +562,6 @@ AppPage {
|
|
|
color: "gray"
|
|
|
}
|
|
|
AppText{
|
|
|
- id: mac
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
- text:"MAC:"
|
|
|
- fontSize: 10
|
|
|
- color: "gray"
|
|
|
- }
|
|
|
- AppText{
|
|
|
id: mqtt_text
|
|
|
anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
text:"MQTT断开连接:"
|
|
|
@@ -657,103 +655,255 @@ AppPage {
|
|
|
id: rec_seting
|
|
|
anchors.fill: parent
|
|
|
visible: false
|
|
|
- AppText {
|
|
|
- //anchors.top: parent
|
|
|
- //anchors.topMargin:10
|
|
|
- text:"采集时间设置"
|
|
|
- anchors.horizontalCenter: parent.horizontalCenter
|
|
|
- font.bold: true
|
|
|
- }
|
|
|
-
|
|
|
- Grid {
|
|
|
- anchors.centerIn: parent
|
|
|
- //anchors.horizontalCenter: parent.horizontalCenter
|
|
|
- columns: 2
|
|
|
- rows: 3
|
|
|
- rowSpacing: 5
|
|
|
- columnSpacing: 20
|
|
|
- AppTextField {
|
|
|
- id: sh1_textfield
|
|
|
- width: 60
|
|
|
- height: 30
|
|
|
- borderWidth: dp(1)
|
|
|
- radius: 5
|
|
|
- // Displays a number only keyboard on mobiles
|
|
|
- inputMethodHints: Qt.ImhDigitsOnly
|
|
|
- validator: IntValidator {
|
|
|
- bottom: 0
|
|
|
- top: 23
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
+ Column {
|
|
|
+ anchors.fill: parent
|
|
|
+ anchors.margins: 5
|
|
|
+ spacing: 8
|
|
|
+
|
|
|
+ AppText {
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
+ text:"采集时间设置"
|
|
|
+ color: app.fontColor
|
|
|
+ font.bold: true
|
|
|
}
|
|
|
-
|
|
|
- AppTextField {
|
|
|
- id: sh2_textfield
|
|
|
- width: 60
|
|
|
- height: 30
|
|
|
- borderWidth: dp(1)
|
|
|
- radius: 5
|
|
|
- // Displays a number only keyboard on mobiles
|
|
|
- inputMethodHints: Qt.ImhDigitsOnly
|
|
|
- validator: IntValidator {
|
|
|
- bottom: 0
|
|
|
- top: 23
|
|
|
+
|
|
|
+ // 第一时间段
|
|
|
+ Row {
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
+ spacing: 2
|
|
|
+ AppTextField {
|
|
|
+ id: sh1_hour
|
|
|
+ width: 35
|
|
|
+ height: 28
|
|
|
+ borderWidth: dp(1)
|
|
|
+ radius: 3
|
|
|
+ placeholderText: "时"
|
|
|
+ inputMethodHints: Qt.ImhDigitsOnly
|
|
|
+ validator: IntValidator {
|
|
|
+ bottom: 0
|
|
|
+ top: 23
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- AppTextField {
|
|
|
- id: sh3_textfield
|
|
|
- width: 60
|
|
|
- height: 30
|
|
|
- borderWidth: dp(1)
|
|
|
- radius: 5
|
|
|
- // Displays a number only keyboard on mobiles
|
|
|
- inputMethodHints: Qt.ImhDigitsOnly
|
|
|
- validator: IntValidator {
|
|
|
- bottom: 0
|
|
|
- top: 23
|
|
|
+ AppText {
|
|
|
+ anchors.verticalCenter: parent.verticalCenter
|
|
|
+ text: ":"
|
|
|
+ color: app.fontColor
|
|
|
+ fontSize: 14
|
|
|
+ font.bold: true
|
|
|
}
|
|
|
- }
|
|
|
- AppTextField {
|
|
|
- id: sh4_textfield
|
|
|
- width: 60
|
|
|
- height: 30
|
|
|
- borderWidth: dp(1)
|
|
|
- radius: 5
|
|
|
- // Displays a number only keyboard on mobiles
|
|
|
- inputMethodHints: Qt.ImhDigitsOnly
|
|
|
- validator: IntValidator {
|
|
|
- bottom: 0
|
|
|
- top: 23
|
|
|
+ AppTextField {
|
|
|
+ id: sh1_min
|
|
|
+ width: 35
|
|
|
+ height: 28
|
|
|
+ borderWidth: dp(1)
|
|
|
+ radius: 3
|
|
|
+ placeholderText: "分"
|
|
|
+ inputMethodHints: Qt.ImhDigitsOnly
|
|
|
+ validator: IntValidator {
|
|
|
+ bottom: 0
|
|
|
+ top: 59
|
|
|
+ }
|
|
|
+ }
|
|
|
+ AppText {
|
|
|
+ anchors.verticalCenter: parent.verticalCenter
|
|
|
+ text: "-"
|
|
|
+ color: app.fontColor
|
|
|
+ fontSize: 14
|
|
|
+ font.bold: true
|
|
|
+ }
|
|
|
+ AppTextField {
|
|
|
+ id: sh2_hour
|
|
|
+ width: 35
|
|
|
+ height: 28
|
|
|
+ borderWidth: dp(1)
|
|
|
+ radius: 3
|
|
|
+ placeholderText: "时"
|
|
|
+ inputMethodHints: Qt.ImhDigitsOnly
|
|
|
+ validator: IntValidator {
|
|
|
+ bottom: 0
|
|
|
+ top: 23
|
|
|
+ }
|
|
|
+ }
|
|
|
+ AppText {
|
|
|
+ anchors.verticalCenter: parent.verticalCenter
|
|
|
+ text: ":"
|
|
|
+ color: app.fontColor
|
|
|
+ fontSize: 14
|
|
|
+ font.bold: true
|
|
|
+ }
|
|
|
+ AppTextField {
|
|
|
+ id: sh2_min
|
|
|
+ width: 35
|
|
|
+ height: 28
|
|
|
+ borderWidth: dp(1)
|
|
|
+ radius: 3
|
|
|
+ placeholderText: "分"
|
|
|
+ inputMethodHints: Qt.ImhDigitsOnly
|
|
|
+ validator: IntValidator {
|
|
|
+ bottom: 0
|
|
|
+ top: 59
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- AppTextField {
|
|
|
- id: sh5_textfield
|
|
|
- width: 60
|
|
|
- height: 30
|
|
|
- borderWidth: dp(1)
|
|
|
- radius: 5
|
|
|
- // Displays a number only keyboard on mobiles
|
|
|
- inputMethodHints: Qt.ImhDigitsOnly
|
|
|
- validator: IntValidator {
|
|
|
- bottom: 0
|
|
|
- top: 23
|
|
|
+
|
|
|
+ // 第二时间段
|
|
|
+ Row {
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
+ spacing: 2
|
|
|
+ AppTextField {
|
|
|
+ id: sh3_hour
|
|
|
+ width: 35
|
|
|
+ height: 28
|
|
|
+ borderWidth: dp(1)
|
|
|
+ radius: 3
|
|
|
+ placeholderText: "时"
|
|
|
+ inputMethodHints: Qt.ImhDigitsOnly
|
|
|
+ validator: IntValidator {
|
|
|
+ bottom: 0
|
|
|
+ top: 23
|
|
|
+ }
|
|
|
+ }
|
|
|
+ AppText {
|
|
|
+ anchors.verticalCenter: parent.verticalCenter
|
|
|
+ text: ":"
|
|
|
+ color: app.fontColor
|
|
|
+ fontSize: 14
|
|
|
+ font.bold: true
|
|
|
+ }
|
|
|
+ AppTextField {
|
|
|
+ id: sh3_min
|
|
|
+ width: 35
|
|
|
+ height: 28
|
|
|
+ borderWidth: dp(1)
|
|
|
+ radius: 3
|
|
|
+ placeholderText: "分"
|
|
|
+ inputMethodHints: Qt.ImhDigitsOnly
|
|
|
+ validator: IntValidator {
|
|
|
+ bottom: 0
|
|
|
+ top: 59
|
|
|
+ }
|
|
|
+ }
|
|
|
+ AppText {
|
|
|
+ anchors.verticalCenter: parent.verticalCenter
|
|
|
+ text: "-"
|
|
|
+ color: app.fontColor
|
|
|
+ fontSize: 14
|
|
|
+ font.bold: true
|
|
|
+ }
|
|
|
+ AppTextField {
|
|
|
+ id: sh4_hour
|
|
|
+ width: 35
|
|
|
+ height: 28
|
|
|
+ borderWidth: dp(1)
|
|
|
+ radius: 3
|
|
|
+ placeholderText: "时"
|
|
|
+ inputMethodHints: Qt.ImhDigitsOnly
|
|
|
+ validator: IntValidator {
|
|
|
+ bottom: 0
|
|
|
+ top: 23
|
|
|
+ }
|
|
|
+ }
|
|
|
+ AppText {
|
|
|
+ anchors.verticalCenter: parent.verticalCenter
|
|
|
+ text: ":"
|
|
|
+ color: app.fontColor
|
|
|
+ fontSize: 14
|
|
|
+ font.bold: true
|
|
|
+ }
|
|
|
+ AppTextField {
|
|
|
+ id: sh4_min
|
|
|
+ width: 35
|
|
|
+ height: 28
|
|
|
+ borderWidth: dp(1)
|
|
|
+ radius: 3
|
|
|
+ placeholderText: "分"
|
|
|
+ inputMethodHints: Qt.ImhDigitsOnly
|
|
|
+ validator: IntValidator {
|
|
|
+ bottom: 0
|
|
|
+ top: 59
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- AppTextField {
|
|
|
- id: sh6_textfield
|
|
|
- width: 60
|
|
|
- height: 30
|
|
|
- borderWidth: dp(1)
|
|
|
- radius: 5
|
|
|
- // Displays a number only keyboard on mobiles
|
|
|
- inputMethodHints: Qt.ImhDigitsOnly
|
|
|
- validator: IntValidator {
|
|
|
- bottom: 0
|
|
|
- top: 23
|
|
|
+
|
|
|
+ // 第三时间段
|
|
|
+ Row {
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
+ spacing: 2
|
|
|
+ AppTextField {
|
|
|
+ id: sh5_hour
|
|
|
+ width: 35
|
|
|
+ height: 28
|
|
|
+ borderWidth: dp(1)
|
|
|
+ radius: 3
|
|
|
+ placeholderText: "时"
|
|
|
+ inputMethodHints: Qt.ImhDigitsOnly
|
|
|
+ validator: IntValidator {
|
|
|
+ bottom: 0
|
|
|
+ top: 23
|
|
|
+ }
|
|
|
+ }
|
|
|
+ AppText {
|
|
|
+ anchors.verticalCenter: parent.verticalCenter
|
|
|
+ text: ":"
|
|
|
+ color: app.fontColor
|
|
|
+ fontSize: 14
|
|
|
+ font.bold: true
|
|
|
+ }
|
|
|
+ AppTextField {
|
|
|
+ id: sh5_min
|
|
|
+ width: 35
|
|
|
+ height: 28
|
|
|
+ borderWidth: dp(1)
|
|
|
+ radius: 3
|
|
|
+ placeholderText: "分"
|
|
|
+ inputMethodHints: Qt.ImhDigitsOnly
|
|
|
+ validator: IntValidator {
|
|
|
+ bottom: 0
|
|
|
+ top: 59
|
|
|
+ }
|
|
|
+ }
|
|
|
+ AppText {
|
|
|
+ anchors.verticalCenter: parent.verticalCenter
|
|
|
+ text: "-"
|
|
|
+ color: app.fontColor
|
|
|
+ fontSize: 14
|
|
|
+ font.bold: true
|
|
|
+ }
|
|
|
+ AppTextField {
|
|
|
+ id: sh6_hour
|
|
|
+ width: 35
|
|
|
+ height: 28
|
|
|
+ borderWidth: dp(1)
|
|
|
+ radius: 3
|
|
|
+ placeholderText: "时"
|
|
|
+ inputMethodHints: Qt.ImhDigitsOnly
|
|
|
+ validator: IntValidator {
|
|
|
+ bottom: 0
|
|
|
+ top: 23
|
|
|
+ }
|
|
|
+ }
|
|
|
+ AppText {
|
|
|
+ anchors.verticalCenter: parent.verticalCenter
|
|
|
+ text: ":"
|
|
|
+ color: app.fontColor
|
|
|
+ fontSize: 14
|
|
|
+ font.bold: true
|
|
|
+ }
|
|
|
+ AppTextField {
|
|
|
+ id: sh6_min
|
|
|
+ width: 35
|
|
|
+ height: 28
|
|
|
+ borderWidth: dp(1)
|
|
|
+ radius: 3
|
|
|
+ placeholderText: "分"
|
|
|
+ inputMethodHints: Qt.ImhDigitsOnly
|
|
|
+ validator: IntValidator {
|
|
|
+ bottom: 0
|
|
|
+ top: 59
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -762,13 +912,12 @@ AppPage {
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
anchors.bottom: parent.bottom
|
|
|
anchors.bottomMargin: 5
|
|
|
- //spacing: -15
|
|
|
+ spacing: 10
|
|
|
AppButton {
|
|
|
- minimumWidth: 30
|
|
|
- minimumHeight: 15
|
|
|
- textSize: 15
|
|
|
+ minimumWidth: 45
|
|
|
+ minimumHeight: 20
|
|
|
+ textSize: 12
|
|
|
fontBold: false
|
|
|
- iconSize: 10
|
|
|
text: "取消"
|
|
|
textColor: "black"
|
|
|
flat: false
|
|
|
@@ -783,23 +932,44 @@ AppPage {
|
|
|
}
|
|
|
|
|
|
AppButton {
|
|
|
- minimumWidth: 30
|
|
|
- minimumHeight: 15
|
|
|
- textSize: 15
|
|
|
+ minimumWidth: 45
|
|
|
+ minimumHeight: 20
|
|
|
+ textSize: 12
|
|
|
text: "保存"
|
|
|
textColor: "white"
|
|
|
flat: false
|
|
|
backgroundColor: "#0aa26b"
|
|
|
borderColor: "white"
|
|
|
onClicked: {
|
|
|
- var int_sh1 = parseInt(sh1_textfield.text)
|
|
|
- var int_eh1 = parseInt(sh2_textfield.text)
|
|
|
- var int_sh2 = parseInt(sh3_textfield.text)
|
|
|
- var int_eh2 = parseInt(sh4_textfield.text)
|
|
|
- var int_sh3 = parseInt(sh5_textfield.text)
|
|
|
- var int_eh3 = parseInt(sh6_textfield.text)
|
|
|
-
|
|
|
- serial.setCollt(int_sh1,int_eh1,int_sh2,int_eh2,int_sh3,int_eh3)
|
|
|
+ var int_sh1 = parseInt(sh1_hour.text) || 0
|
|
|
+ var int_sh1_min = parseInt(sh1_min.text) || 0
|
|
|
+ var int_eh1 = parseInt(sh2_hour.text) || 0
|
|
|
+ var int_eh1_min = parseInt(sh2_min.text) || 0
|
|
|
+ var int_sh2 = parseInt(sh3_hour.text) || 0
|
|
|
+ var int_sh2_min = parseInt(sh3_min.text) || 0
|
|
|
+ var int_eh2 = parseInt(sh4_hour.text) || 0
|
|
|
+ var int_eh2_min = parseInt(sh4_min.text) || 0
|
|
|
+ var int_sh3 = parseInt(sh5_hour.text) || 0
|
|
|
+ var int_sh3_min = parseInt(sh5_min.text) || 0
|
|
|
+ var int_eh3 = parseInt(sh6_hour.text) || 0
|
|
|
+ var int_eh3_min = parseInt(sh6_min.text) || 0
|
|
|
+
|
|
|
+ // 格式化时间字符串
|
|
|
+ var time1 = (int_sh1 < 10 ? "0" + int_sh1 : int_sh1) + ":" + (int_sh1_min < 10 ? "0" + int_sh1_min : int_sh1_min) + "-" +
|
|
|
+ (int_eh1 < 10 ? "0" + int_eh1 : int_eh1) + ":" + (int_eh1_min < 10 ? "0" + int_eh1_min : int_eh1_min)
|
|
|
+ var time2 = (int_sh2 < 10 ? "0" + int_sh2 : int_sh2) + ":" + (int_sh2_min < 10 ? "0" + int_sh2_min : int_sh2_min) + "-" +
|
|
|
+ (int_eh2 < 10 ? "0" + int_eh2 : int_eh2) + ":" + (int_eh2_min < 10 ? "0" + int_eh2_min : int_eh2_min)
|
|
|
+ var time3 = (int_sh3 < 10 ? "0" + int_sh3 : int_sh3) + ":" + (int_sh3_min < 10 ? "0" + int_sh3_min : int_sh3_min) + "-" +
|
|
|
+ (int_eh3 < 10 ? "0" + int_eh3 : int_eh3) + ":" + (int_eh3_min < 10 ? "0" + int_eh3_min : int_eh3_min)
|
|
|
+
|
|
|
+ // 更新显示
|
|
|
+ sh1.text = time1
|
|
|
+ sh2.text = time2
|
|
|
+ sh3.text = time3
|
|
|
+
|
|
|
+ // 调用serial接口(注意:这里可能需要根据实际接口调整参数)
|
|
|
+ serial.setCollt(int_sh1, int_eh1, int_sh2, int_eh2, int_sh3, int_eh3)
|
|
|
+ serial.setCollt_min(int_sh1_min, int_eh1_min, int_sh2_min, int_eh2_min, int_sh3_min, int_eh3_min)
|
|
|
rec_seting.visible = false
|
|
|
column_colt.visible = true
|
|
|
appimage_set.visible = true
|
|
|
@@ -814,10 +984,12 @@ AppPage {
|
|
|
id: column_colt
|
|
|
anchors.centerIn: parent
|
|
|
spacing: 5
|
|
|
+ visible: true
|
|
|
AppImage {
|
|
|
id: image_timesvg
|
|
|
anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
anchors.topMargin: 30
|
|
|
+ visible: true
|
|
|
fillMode: Image.PreserveAspectFit // 保持纵横比适应
|
|
|
source: "../../assets/time.svg"
|
|
|
}
|
|
|
@@ -856,6 +1028,7 @@ AppPage {
|
|
|
AppImage {
|
|
|
id: appimage_set
|
|
|
anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
+ visible: true
|
|
|
fillMode: Image.PreserveAspectFit // 保持纵横比适应
|
|
|
source: "../../assets/set.svg"
|
|
|
AppButton{
|
|
|
@@ -869,14 +1042,30 @@ AppPage {
|
|
|
var sh1Arry = sh1.text.split('-')
|
|
|
var sh2Arry = sh2.text.split('-')
|
|
|
var sh3Arry = sh3.text.split('-')
|
|
|
- sh1_textfield.text = parseInt(sh1Arry[0]);
|
|
|
- sh2_textfield.text= parseInt(sh1Arry[1]);
|
|
|
-
|
|
|
- sh3_textfield.text = parseInt(sh2Arry[0]);
|
|
|
- sh4_textfield.text = parseInt(sh2Arry[1]);
|
|
|
-
|
|
|
- sh5_textfield.text = parseInt(sh3Arry[0]);
|
|
|
- sh6_textfield.text = parseInt(sh3Arry[1]);
|
|
|
+
|
|
|
+ // 解析第一时间段
|
|
|
+ var time1_start = sh1Arry[0].split(':')
|
|
|
+ var time1_end = sh1Arry[1].split(':')
|
|
|
+ sh1_hour.text = parseInt(time1_start[0]) || 0
|
|
|
+ sh1_min.text = parseInt(time1_start[1]) || 0
|
|
|
+ sh2_hour.text = parseInt(time1_end[0]) || 0
|
|
|
+ sh2_min.text = parseInt(time1_end[1]) || 0
|
|
|
+
|
|
|
+ // 解析第二时间段
|
|
|
+ var time2_start = sh2Arry[0].split(':')
|
|
|
+ var time2_end = sh2Arry[1].split(':')
|
|
|
+ sh3_hour.text = parseInt(time2_start[0]) || 0
|
|
|
+ sh3_min.text = parseInt(time2_start[1]) || 0
|
|
|
+ sh4_hour.text = parseInt(time2_end[0]) || 0
|
|
|
+ sh4_min.text = parseInt(time2_end[1]) || 0
|
|
|
+
|
|
|
+ // 解析第三时间段
|
|
|
+ var time3_start = sh3Arry[0].split(':')
|
|
|
+ var time3_end = sh3Arry[1].split(':')
|
|
|
+ sh5_hour.text = parseInt(time3_start[0]) || 0
|
|
|
+ sh5_min.text = parseInt(time3_start[1]) || 0
|
|
|
+ sh6_hour.text = parseInt(time3_end[0]) || 0
|
|
|
+ sh6_min.text = parseInt(time3_end[1]) || 0
|
|
|
|
|
|
column_colt.visible = false
|
|
|
appimage_set.visible = false
|
|
|
@@ -897,11 +1086,126 @@ AppPage {
|
|
|
height: parent.height*0.38
|
|
|
spacing: 5
|
|
|
Rectangle {
|
|
|
+ id: temp_card
|
|
|
radius: 5
|
|
|
width: parent.width*0.245
|
|
|
height: parent.height
|
|
|
color: app.cardColor
|
|
|
+
|
|
|
+ Rectangle {
|
|
|
+ id: temp_setting
|
|
|
+ anchors.fill: parent
|
|
|
+ visible: false
|
|
|
+ radius: 5
|
|
|
+ color: app.cardColor
|
|
|
+
|
|
|
+ Column {
|
|
|
+ anchors.fill: parent
|
|
|
+ anchors.margins: 8
|
|
|
+ spacing: 8
|
|
|
+
|
|
|
+ AppText {
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
+ text: "温度保护设置"
|
|
|
+ color: app.fontColor
|
|
|
+ font.bold: true
|
|
|
+ fontSize: 14
|
|
|
+ }
|
|
|
+
|
|
|
+ // 高温保护阈值
|
|
|
+ Item {
|
|
|
+ width: parent.width
|
|
|
+ height: 50
|
|
|
+ Column {
|
|
|
+ anchors.fill: parent
|
|
|
+ spacing: 3
|
|
|
+ AppText {
|
|
|
+ text: "高温保护: " + highTempSlider.value + "℃"
|
|
|
+ color: app.fontColor
|
|
|
+ fontSize: 11
|
|
|
+ }
|
|
|
+ Slider {
|
|
|
+ id: highTempSlider
|
|
|
+ width: parent.width - 20
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
+ from: 30
|
|
|
+ to: 70
|
|
|
+ value: 50
|
|
|
+ snapMode: Slider.SnapOnRelease
|
|
|
+ stepSize: 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 低温保护阈值
|
|
|
+ Item {
|
|
|
+ width: parent.width
|
|
|
+ height: 50
|
|
|
+ Column {
|
|
|
+ anchors.fill: parent
|
|
|
+ spacing: 3
|
|
|
+ AppText {
|
|
|
+ text: "低温保护: " + lowTempSlider.value + "℃"
|
|
|
+ color: app.fontColor
|
|
|
+ fontSize: 11
|
|
|
+ }
|
|
|
+ Slider {
|
|
|
+ id: lowTempSlider
|
|
|
+ width: parent.width - 20
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter
|
|
|
+ from: -40
|
|
|
+ to: 10
|
|
|
+ value: 20
|
|
|
+ snapMode: Slider.SnapOnRelease
|
|
|
+ stepSize: 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Item {
|
|
|
+ width: parent.width
|
|
|
+ height: 40
|
|
|
+ Row {
|
|
|
+ anchors.centerIn: parent
|
|
|
+ spacing: 10
|
|
|
+
|
|
|
+ AppButton {
|
|
|
+ minimumWidth: 50
|
|
|
+ minimumHeight: 25
|
|
|
+ textSize: 10
|
|
|
+ text: "取消"
|
|
|
+ textColor: "black"
|
|
|
+ flat: false
|
|
|
+ backgroundColor: "#e9e9e9"
|
|
|
+ onClicked: {
|
|
|
+ temp_setting.visible = false
|
|
|
+ temp_display.visible = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ AppButton {
|
|
|
+ minimumWidth: 50
|
|
|
+ minimumHeight: 25
|
|
|
+ textSize: 10
|
|
|
+ text: "保存"
|
|
|
+ textColor: "white"
|
|
|
+ flat: false
|
|
|
+ backgroundColor: "#0aa26b"
|
|
|
+ onClicked: {
|
|
|
+ console.log("保存温度设置 - 高温:", highTempSlider.value, "低温:", lowTempSlider.value)
|
|
|
+ serial.setTempconf(lowTempSlider.value,highTempSlider.value);
|
|
|
+ // 这里可以添加保存设置的逻辑
|
|
|
+ temp_setting.visible = false
|
|
|
+ temp_display.visible = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Column {
|
|
|
+ id: temp_display
|
|
|
anchors.centerIn: parent
|
|
|
spacing: 5
|
|
|
AppImage {
|
|
|
@@ -931,8 +1235,22 @@ AppPage {
|
|
|
fontSize: 10
|
|
|
color: "gray"
|
|
|
}
|
|
|
+ AppImage {
|
|
|
+ anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
|
|
|
+ fillMode: Image.PreserveAspectFit // 保持纵横比适应
|
|
|
+ source: "../../assets/set.svg"
|
|
|
+ AppButton{
|
|
|
+ anchors.fill: parent
|
|
|
+ textColor: "GRAY"
|
|
|
+ textSize: 10
|
|
|
+ flat: true
|
|
|
+ onClicked: {
|
|
|
+ temp_display.visible = false
|
|
|
+ temp_setting.visible = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
Rectangle {
|