| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030 |
- import QtQuick 2.5
- import QtQuick.Controls 2.0
- import Qt.labs.settings 1.0 as QtLabs
- import QtQuick.Controls.Material 2.0
- import QtLocation 5.5
- import QtPositioning 5.5
- import QtMultimedia 5.5
- import Qt5Compat.GraphicalEffects
- import Felgo 4.0
- import "../controls"
- import "../common"
- import "../model"
- AppPage {
- id: home_Page
- signal updatebv(string bv)
- property string originalString: ""
- property string iccidString: ""
- property string boxtemptureString: ""
- property string collectString: ""
- property string gps_state: "定位中..."
- property string jsonenable_String: "关闭"
- property string imagenable_String: "关闭"
- property bool connect_board: false
- property var tt
- property bool isonline: false
- property var net_list:[]
- navigationBarHidden: true
- backgroundColor: app.theme_backgroundColor
- Component.onCompleted: {
- var theme_m = settings.getValue("theme_mode")
- if (theme_m === undefined) {
- theme_m = "day"
- app.theme_select = "day"
- settings.setValue("theme_mode","day")
- }else{
- theme_md = theme_m
- if(theme_m!=="auto"){
- app.theme_select = theme_m
- }
- console.log("读取到配置主题模式:",app.theme_select,theme_m)
- Theme.navigationTabBar.titlePressedColor= "green"
- Theme.navigationTabBar.backgroundColor= app.cardColor
- Theme.navigationTabBar.titleColor = app.fontColor
- }
- }
- Connections {
- target: networkMonitor
- // 监听可达性变化(如从断开到连接)
- onReachabilityChanged: {
- let status = ""
- if(networkMonitor.reachability===0)
- {
- status = "未知"
- net_sta.color = "red"
- }else if(networkMonitor.reachability===1){
- status = "离线"
- net_sta.color = "red"
- }else if(networkMonitor.reachability===2){
- status = "本地"
- }else if(networkMonitor.reachability===3){
- status = "局域网"
- }else if(networkMonitor.reachability===4){
- status = "在线"
- net_sta.color = "green"
- }
- console.log("onReachabilityChanged:",networkMonitor.reachability)
- net_sta.text = "网络状态:" + status
- }
- // 监听传输介质变化(如从 Wi-Fi 切换到 4G)
- onTransportMediumChanged: {
- let nettype = "未知"
- console.log("onTransportMediumChanged:",networkMonitor.transportMedium)
- if(networkMonitor.transportMedium===0)
- {
- nettype = "未知"
- }else if(networkMonitor.transportMedium===1){
- nettype = "有线"
- }else if(networkMonitor.transportMedium===2){
- nettype = "移动网络"
- }else if(networkMonitor.transportMedium===3){
- nettype = "WIFI"
- }else if(networkMonitor.transportMedium===4){
- nettype = "蓝牙"
- }
- net_type.text = "网络类型:" + nettype
- }
- // 监听受限网络状态(如公共 Wi-Fi 登录页)
- onIsBehindCaptivePortalChanged: {
- }
- // 监听计量网络状态(如移动数据流量限制)
- onIsMeteredChanged: {
- }
- }
- // 接收并显示日志消息
- Connections {
- target: mqtt
- onConnected: {
- console.log("mqtt connect")
- }
- onDisconnected: {
- console.log("mqtt disconnect")
- //mqtt_text.detailText="MQTT已断开"
- }
- }
- // Connections{
- // target: myClass
- // }
- //串口
- Connections{
- target: serial
- onDataReceived:{
- var jsonData = JSON.parse(data)
- console.log("接收到主板数据:",data.toString())
- if(jsonData.ext.work_sta==="0"){
- text_devicesta.text = qsTr("<b>工作状态:</b> 待机")
- if(jsonData.ext.ds==="0"){
- }else{
- }
- }else if(jsonData.ext.work_sta==="1"){
- text_devicesta.text = qsTr("<b>工作状态:</b> 采集")
- }else if(jsonData.ext.work_sta==="2"){
- text_devicesta.text = qsTr("<b>工作状态:</b> 拍照")
- }else{
- text_devicesta.text = qsTr("<b>工作状态:</b>",jsonData.ext.work_sta)
- }
- if(jsonData.ext.gps==="1"){
- gps_state = "成功"
- }
- if(jsonData.ext.imei){
- originalString = jsonData.ext.imei
- }
- if(jsonData.ext.iccid){
- iccidString= jsonData.ext.iccid
- }
- if(jsonData.ext.coll_time&&jsonData.ext.coll_min){
- var sh1Arry = jsonData.ext.coll_time[0].split('-')
- var sh2Arry = jsonData.ext.coll_time[1].split('-')
- var sh3Arry = jsonData.ext.coll_time[2].split('-')
- var min_arry0 = jsonData.ext.coll_min[0].split('-')
- var min_arry1 = jsonData.ext.coll_min[1].split('-')
- var min_arry2 = jsonData.ext.coll_min[2].split('-')
- sh1.text = parseInt(sh1Arry[0])+ ":" + parseInt(min_arry0[0]) + " - " + parseInt(sh1Arry[1]) + ":" + parseInt(min_arry0[1])
- sh2.text = parseInt(sh2Arry[0])+ ":" + parseInt(min_arry1[0]) + " - " + parseInt(sh2Arry[1]) + ":" + parseInt(min_arry1[1])
- sh3.text = parseInt(sh3Arry[0])+ ":" + parseInt(min_arry2[0]) + " - " + parseInt(sh3Arry[1]) + ":" + parseInt(min_arry2[1])
- }
- if(jsonData.ext.dat_f){
- serial.update_dat_f_main(jsonData.ext.dat_f);
- }
- if(jsonData.ext.boxtem){
- text_tempture0.text = "箱内温度:" + jsonData.ext.boxtem + "℃"
- }
- 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"
- 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();
- }
- if(jsonData.ext.tps){
- if("1"===jsonData.ext.tps){
- text_tempture_sta.text = "保护:" + "["+ jsonData.ext.tpl +"]"
- }else{
- text_tempture_sta.text = "正常:" + "["+ jsonData.ext.tpl +"]"
- }
- }
- var dvs = jsonData.ext.dver
- dvs = dvs.split("-")
- app.bvReceived(dvs[0])
- app.appReceived(dvs[1])
- }
- onDisconnect_485:{
- text_devicesta.text =qsTr("485未连接,读取数据失败");
- originalString =serial.getId()
- iccidString=serial.getIccid()
- app.appReceived(serial.get_app_version())
- }
- onGpsSuccess:{
- gps_state = "成功"
- text_lat.text = serial.getlat()
- text_lng.text = serial.getlng()
- }
- }
- Timer {
- interval: 100
- running: true
- repeat: true
- onTriggered: {
- text_stamp.text = getCurrentTime()
- }
- }
- function handleThemeChange(mode){
- theme_select = mode
- console.log("theme_select",theme_select)
- }
- function getCurrentTime() {
- var currentTime = new Date();
- var years = currentTime.getFullYear()
- var mon = currentTime.getMonth() + 1
- var dates = currentTime.getDate()
- var hours = currentTime.getHours()
- var mins = currentTime.getMinutes()
- var secs = currentTime.getSeconds()
- if(app.theme_md==="auto"){
- if(hours>=6&&hours<=18){
- app.theme_select = "day"
- }else{
- app.theme_select = "night"
- }
- }
- // 关键:将月、日、时、分、秒补到两位(不足补0)
- var formatNum = (num) => String(num).padStart(2, '0')
- return `${years}-${formatNum(mon)}-${formatNum(dates)} ${formatNum(hours)}:${formatNum(mins)}:${formatNum(secs)}`
- }
- Grid {
- anchors.fill: parent
- anchors.leftMargin: 5
- anchors.topMargin: 5
- //anchors.horizontalCenter: parent.horizontalCenter
- columns: 1
- rows: 3
- columnSpacing: 10
- rowSpacing: 5
- horizontalItemAlignment: Grid.AlignHCenter
- Row {
- width: parent.width *0.995
- height: parent.height*0.1
- Rectangle {
- anchors.fill: parent
- color: app.cardColor
- radius: 2
- Row {
- anchors.fill: parent
- spacing: dp(20)
- AppText{
- id: text_stamp
- anchors.verticalCenter: parent.verticalCenter
- text: ""
- fontSize: 20
- color: app.fontColor
- }
- AppText{
- id: text_imei
- anchors.verticalCenter: parent.verticalCenter
- text:"设备ID:" + originalString.toLowerCase()
- fontSize: 20
- color: app.fontColor
- }
- AppText{
- id: net_sta
- anchors.verticalCenter: parent.verticalCenter
- color: app.fontColor
- text: "联网状态:"
- fontSize: 20
- //font.bold: true
- }
- AppText{
- id: net_type
- anchors.verticalCenter: parent.verticalCenter
- color: app.fontColor
- text: "联网类型:"
- fontSize: 20
- //font.bold: true
- }
- AppText{
- id: text_gps
- anchors.verticalCenter: parent.verticalCenter
- text: "GPS状态:" + gps_state
- color: app.fontColor
- //font.bold: true
- fontSize: 20
- }
- }
- }
- }
- Row{
- //anchors.fill: parent
- width: parent.width
- height: parent.height*0.5
- spacing:5
- Rectangle {
- id: container
- width: parent.width * 0.245
- height: parent.height
- color: app.cardColor
- radius: 5
- Rectangle {
- id: focus_setting
- anchors.fill: parent
- visible: false
- radius: 5
- color: app.cardColor
- // X坐标输入行(结构同优化前)
- Column {
- anchors.fill: parent
- spacing: 10
- 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)
- coordinateInputs.visible = false
- }
- }
- // 边框样式
- 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)
- coordinateInputs.visible = false
- }
- }
- // 边框样式
- Rectangle {
- anchors.fill: parent
- color: "transparent"
- border.color: textInput_x.activeFocus ? "blue" : "gray"
- border.width: 1
- radius: 4
- }
- }
- }
- }
- }
- Column {
- anchors.centerIn: parent
- spacing: 12
- visible: true
- AppImage {
- id: image_01
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.topMargin: 30
- source: "../../assets/a.svg"
- fillMode: Image.PreserveAspectFit
- }
- AppText {
- id: text_devicesta
- anchors.horizontalCenter: parent.horizontalCenter
- text: "工作状态:"
- color: app.fontColor
- font.bold: true
- font.pixelSize: 16
- }
- AppImage {
- id: focus_xy_set
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
- source: "../../assets/set.svg"
- AppButton{
- anchors.fill: parent
- //text:" 修改"
- textColor: "GRAY"
- textSize: 10
- flat: true
- onClicked: {
- focus_setting.visible = !focus_setting.visible
- text_devicesta.visible = !text_devicesta.visible
- image_01.visible = !image_01.visible
- }
- }
- }
- }
- }
- Rectangle {
- radius: 5
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- Timer {
- interval: 500
- running: true
- repeat: true
- onTriggered: {
- if(mqtt.checkLink()){
- mqtt_text.text="MQTT已连接:" + net_list[5]
- }else{
- mqtt_text.text="MQTT已断开:" + net_list[5]
- }
- net_list = mqtt.netMessage()
- if(mqtt.cache_Json_enable()===1){
- jsonenable_String = "开启"
- }else{
- jsonenable_String = "关闭"
- }
- if(mqtt.cache_image_enable()===1){
- imagenable_String = "开启"
- }else{
- imagenable_String = "关闭"
- }
- cache_json_text.text= "数据缓存:" + mqtt.cache_json_num() +
- "("+ mqtt.cache_Json_Maxnum()+")" + jsonenable_String
- cache_image_text.text = "图片缓存:" + mqtt.cache_image_num()+
- "("+mqtt.cache_image_Maxnum()+")" + imagenable_String
- if(net_list){
- if(net_list[0]==="1"){isonline = true}else{isonline = false}
- 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])
- datt_text.text = "数据上传间隔:" + net_list[6] + "分钟"
- netxd_text.text = "下一次数据上传:" + net_list[7] + "秒"
- iccid_text.text = "SIM卡号:" + iccidString
- }
- }
- }
- Timer {
- id: longPressTimer
- interval: 1000 // 1秒
- onTriggered: {
- console.log("长按触发")
- serial.uploadData_Mqtt()
- }
- }
- MouseArea {
- anchors.fill: parent
- onPressed:{
- longPressTimer.start()
- }
- onReleased:{
- longPressTimer.stop()
- }
- }
- Column{
- anchors.centerIn: parent
- spacing: 5
- AppImage {
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- anchors.topMargin: 30
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
- source: "../../assets/net.svg"
- }
- AppText{
- id: text_net_title
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text: "网络信息"
- color: app.fontColor
- font.bold: true
- }
- AppText{
- id: ipv4
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text:"IPv4:"
- fontSize: 10
- 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断开连接:"
- fontSize: 10
- color: "gray"
- }
- AppText{
- id: datt_text
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text:"数据上传间隔:"
- fontSize: 10
- color: "gray"
- }
- AppText{
- id: netxd_text
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text:"下一次数据传:"
- fontSize: 10
- color: "gray"
- }
- AppText{
- id: iccid_text
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text:"SIM卡号:"
- fontSize: 10
- color: "gray"
- }
- AppText{
- id: cache_json_text
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text:"数据缓存:"
- fontSize: 10
- color: "gray"
- }
- AppText{
- id: cache_image_text
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text:"图片缓存:"
- fontSize: 10
- color: "gray"
- }
- }
- }
- Rectangle {
- radius: 5
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- Column{
- anchors.centerIn: parent
- spacing: 5
- AppImage {
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- anchors.topMargin: 30
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
- source: "../../assets/gps.svg"
- }
- AppText{
- id: text_gps_title
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text: "定位信息"
- color: app.fontColor
- font.bold: true
- }
- AppText{
- id: text_lat
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text:"lat:"
- fontSize: 10
- color: "gray"
- }
- AppText{
- id: text_lng
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text:"lng:"
- fontSize: 10
- color: "gray"
- }
- }
- }
- Rectangle {
- radius: 5
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- Rectangle{
- 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
- }
- }
- 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
- }
- }
- 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
- }
- }
- 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: 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
- }
- }
- 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
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 5
- //spacing: -15
- AppButton {
- minimumWidth: 30
- minimumHeight: 15
- textSize: 15
- fontBold: false
- iconSize: 10
- text: "取消"
- textColor: "black"
- flat: false
- backgroundColor: "#e9e9e9"
- borderColor: "white"
- onClicked: {
- rec_seting.visible = false
- column_colt.visible = true
- appimage_set.visible = true
- image_timesvg.visible = true
- }
- }
- AppButton {
- minimumWidth: 30
- minimumHeight: 15
- textSize: 15
- 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)
- rec_seting.visible = false
- column_colt.visible = true
- appimage_set.visible = true
- image_timesvg.visible = true
- }
- }
- }
- }
- Column{
- id: column_colt
- anchors.centerIn: parent
- spacing: 5
- AppImage {
- id: image_timesvg
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- anchors.topMargin: 30
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
- source: "../../assets/time.svg"
- }
- AppText{
- id: text_coll
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text: "采集时间"
- color: app.fontColor
- font.bold: true
- }
- AppText{
- id: sh1
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text:"09:00-10:00"
- fontSize: 10
- color: "gray"
- }
- AppText{
- id: sh2
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text:"14:00-16:00"
- fontSize: 10
- color: "gray"
- }
- AppText{
- id: sh3
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text:"17:00-19:00"
- fontSize: 10
- color: "gray"
- }
- AppImage {
- id: appimage_set
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
- source: "../../assets/set.svg"
- AppButton{
- id: settime
- anchors.fill: parent
- //text:" 修改"
- textColor: "GRAY"
- textSize: 10
- flat: true
- onClicked: {
- 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]);
- column_colt.visible = false
- appimage_set.visible = false
- image_timesvg.visible = false
- rec_seting.visible = true
- }
- }
- }
- }
- }
- }
- Row {
- width: parent.width
- height: parent.height*0.38
- spacing: 5
- Rectangle {
- radius: 5
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- Column {
- anchors.centerIn: parent
- spacing: 5
- AppImage {
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- anchors.topMargin: 30
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
- source: "../../assets/tempture.svg"
- }
- AppText{
- id: text_tempture
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text: "环境温度:"
- color: app.fontColor
- font.bold: true
- }
- AppText{
- id: text_tempture0
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text: "箱内温度:"
- color: app.fontColor
- font.bold: true
- }
- AppText{
- id: text_tempture_sta
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text:"正常"
- fontSize: 10
- color: "gray"
- }
- }
- }
- Rectangle {
- radius: 5
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- Column {
- anchors.centerIn: parent
- spacing: 5
- AppImage {
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- anchors.topMargin: 30
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
- source: "../../assets/humidity.svg"
- }
- AppText{
- id: text_humidity
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text: "湿度:"
- color: app.fontColor
- font.bold: true
- }
- }
- }
- Rectangle {
- radius: 5
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- Column {
- anchors.centerIn: parent
- spacing: 5
- AppImage {
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- anchors.topMargin: 30
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
- source: "../../assets/vbat.svg"
- }
- AppText{
- id: text_vbat
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text: "电压:"
- color: app.fontColor
- font.bold: true
- }
- }
- }
- Rectangle {
- radius: 5
- width: parent.width*0.245
- height: parent.height
- color: app.cardColor
- Column {
- anchors.centerIn: parent
- spacing: 5
- AppImage {
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- anchors.topMargin: 30
- fillMode: Image.PreserveAspectFit // 保持纵横比适应
- source: "../../assets/current.svg"
- }
- AppText{
- id: text_current
- anchors.horizontalCenter: parent.horizontalCenter //垂直居中显示
- text: "电流:"
- color: app.fontColor
- font.bold: true
- }
- }
- }
- }
- }
- } // page
|