TG-PlatformPlus/qml/debug/testfixture/Calibrate.qml

127 lines
3.2 KiB
QML
Raw Permalink Normal View History

2026-03-02 14:29:58 +08:00
import QtQuick
import QtQuick
import QtQuick.Controls
import QtCharts
import QtQuick.Layouts
import "./common"
Item {
id: self
signal ckChanged
property var linesMap: ({})
Component.onCompleted: {
initTask()
}
Item
{
id: btnBar
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.topMargin: 20
height: 152
z:2
Rectangle
{
id: rectBtn
width: 253
height: 152
radius: 9
QxToolButton{
width: 195
height: 107
text: isFinish ? "开始标定" : "结束标定"
textColor: text == "开始标定" ? "#FFFFFF" : "#007EFF"
iconSource: text == "开始标定" ? "../resource/start.png" : "../resource/stop.png"
bgmSource: text == "开始标定" ? "../resource/startbutton.png" : "../resource/stopbutton.png"
anchors.centerIn: parent
onClicked: {
if(isFinish)
{
executeVirtualTask("初始化连接温箱", ["断开保温箱", "连接保温箱"])
isFinish = false
startTime = new Date().getTime()
clearTasks()
runNextStep()
skLayout.currentIndex = curTaskIndex
}
else
{
isFinish = true
stopBd()
clearTasks()
}
}
}
}
TaskList{
id: taskList
anchors.leftMargin: 22
anchors.left: rectBtn.right
anchors.right: parent.right
progress1: steps1.progress
progress2: steps2.progress
progress3: steps3.progress
progress4: steps4.progress
progress5: steps5.progress
progress6: steps6.progress
}
}
Item{
anchors.top: btnBar.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.topMargin: 19
z:1
StackLayout{
id: skLayout
anchors.fill: parent
currentIndex: 0
Steps1{id: steps1}
Steps2{id: steps2}
Steps3{id: steps3}
Steps4{id: steps4}
Steps5{id: steps5}
Steps6{id: steps6}
}
}
function updateFormula()
{
steps1.exportFormula()
}
function initTask()
{
for(var i = 0; i < taskModel.count; ++i)
{
if(taskModel.get(i).active == "1" )
{
skLayout.currentIndex = i
return
}
}
}
function clearTasks()
{
task1State = "0"
task2State = "0"
task3State = "0"
task4State = "0"
task5State = "0"
task6State = "0"
for(var i = 0; i < taskModel.count; ++i)
{
taskModel.get(i).state = "0"
}
curTaskIndex = -1
}
}