TG-PlatformPlus/qml/debug/hsvp/Formula.qml

148 lines
3.6 KiB
QML
Raw Permalink Normal View History

2026-03-02 14:29:58 +08:00
import QtQuick
import QtQuick.Controls
import "./common"
Rectangle{
id: self
border.width: 1
border.color: "lightgray"
width: 699
height: 478
radius: 19
visible: false
ListModel
{
id: afModel
ListElement{name:"零偏";v1:"";v2:"";v3:"";}
ListElement{name:"标度因数";v1:"";v2:"";v3:"";}
}
ListModel
{
id: mfModel
ListElement{name:"零偏";v1:"";v2:"";v3:"";}
ListElement{name:"标度因数";v1:"";v2:"";v3:"";}
}
onVisibleChanged:
{
if(visible)
{
for(var i = 0; i< a_seri.length; ++i)
{
afModel.setProperty(i, "v1", a_seri[i][0].toString())
afModel.setProperty(i, "v2", a_seri[i][1].toString())
afModel.setProperty(i, "v3", a_seri[i][2].toString())
}
for(var i = 0; i< m_seri.length; ++i)
{
mfModel.setProperty(i, "v1", m_seri[i][0].toString())
mfModel.setProperty(i, "v2", m_seri[i][1].toString())
mfModel.setProperty(i, "v3", m_seri[i][2].toString())
}
}
}
Button
{
icon.source: "./resource/close.png"
anchors.right: parent.right
anchors.top: parent.top
anchors.rightMargin: 25
anchors.topMargin: 17
onClicked: {self.visible=false;}
}
Column{
anchors.centerIn: parent
spacing: 26
Column
{
spacing: 18
QxText{
text: "加速度计模型系数"
font.pixelSize: 16
font.bold: true
}
ListView{
model: afModel
header: table_af_header
interactive: false
width: 656
height: 156
delegate: table_af_delegate
}
}
Column{
spacing: 18
QxText{
text: "磁通门模型系数"
font.pixelSize: 16
font.bold: true
}
ListView{
model: mfModel
header: table_af_header
interactive: false
width: 656
height: 156
delegate: table_af_delegate
}
}
}
Component {
id: table_af_header
Rectangle {
width: parent ? parent.width : 0
height: 40
color: "#f0f0f0"
z:2
Row {
width: parent.width
height: parent.height
property var childcount: 4
QxHLabel {
text: "模型系数"
}
QxHLabel {
text: "X轴"
}
QxHLabel {
text: "Y轴"
}
QxHLabel {
text: "Z轴"
}
}
}
}
Component {
id: table_af_delegate
Rectangle {
width: parent ? parent.width : 0
height: 58
z:2
Row {
width: parent.width
height: parent.height
property var childcount: 4
QxLabel {
text: name
}
QxLabel {
text: v1
}
QxLabel {
text: v2
}
QxLabel {
text: v3
}
}
}
}
}