2 Star 0 Fork 0

顾金龙/LPMSQtUi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
datawidget.cpp 12.76 KB
一键复制 编辑 原始数据 按行查看 历史
顾金龙 提交于 2024-03-25 21:44 . 添加数据显示
#include "datawidget.h"
#include "SensorDataType.h"
DataWidget::DataWidget(QWidget *parent)
: QWidget{parent}
{
timeLabel = new QLabel(); //时间戳
timeLabel->setText(QString::fromUtf8("时间"));
temputerLabel = new QLabel();//温度
temputerLabel->setText(QString::fromUtf8("温度"));
initialAccelerationXLabel = new QLabel();//原始加速度计X
initialAccelerationXLabel->setText(QString::fromUtf8("原始加速度计X"));
initialAccelerationYLabel = new QLabel();//原始加速度计Y
initialAccelerationYLabel->setText(QString::fromUtf8("原始加速度计Y"));
initialAccelerationZLabel = new QLabel();//原始加速度计Z
initialAccelerationZLabel->setText(QString::fromUtf8("原始加速度计Z"));
cAccelerationXLabel = new QLabel();//校准加速度X
cAccelerationXLabel->setText(QString::fromUtf8("校准加速度X"));
cAccelerationYLabel = new QLabel();//校准加速度Y
cAccelerationYLabel->setText(QString::fromUtf8("校准加速度Y"));
cAccelerationZLabel = new QLabel();//校准加速度Z
cAccelerationZLabel->setText(QString::fromUtf8("校准加速度Z"));
oGyroscopeIXLabel = new QLabel();//原始陀螺仪IX
oGyroscopeIXLabel->setText(QString::fromUtf8("原始陀螺仪IX"));
oGyroscopeIYLabel = new QLabel();//原始陀螺仪IY
oGyroscopeIYLabel->setText(QString::fromUtf8("原始陀螺仪IY"));
oGyroscopeIZLabel = new QLabel();//原始陀螺仪IZ
oGyroscopeIZLabel->setText(QString::fromUtf8("原始陀螺仪IZ"));
oGyroscopeIIXLabel = new QLabel();//原始陀螺仪IIX
oGyroscopeIIXLabel->setText(QString::fromUtf8("原始陀螺仪IIX"));
oGyroscopeIIYLabel = new QLabel();//原始陀螺仪IIY
oGyroscopeIIYLabel->setText(QString::fromUtf8("原始陀螺仪IIY"));
oGyroscopeIIZLabel = new QLabel();//原始陀螺仪IIZ
oGyroscopeIIZLabel->setText(QString::fromUtf8("原始陀螺仪IIZ"));
sSCGyroscopeIXLabel = new QLabel();//静止偏差校准陀螺仪IX
sSCGyroscopeIXLabel->setText(QString::fromUtf8("静止偏差校准陀螺仪IX"));
sSCGyroscopeIYLabel = new QLabel();//静止偏差校准陀螺仪IY
sSCGyroscopeIYLabel->setText(QString::fromUtf8("静止偏差校准陀螺仪IY"));
sSCGyroscopeIZLabel = new QLabel();//静止偏差校准陀螺仪IZ
sSCGyroscopeIZLabel->setText(QString::fromUtf8("静止偏差校准陀螺仪IZ"));
sSCGyroscopeIIXLabel = new QLabel();//静止偏差校准陀螺仪IIX
sSCGyroscopeIIXLabel->setText(QString::fromUtf8("静止偏差校准陀螺仪IIX"));
sSCGyroscopeIIYLabel = new QLabel();//静止偏差校准陀螺仪IIY
sSCGyroscopeIIYLabel->setText(QString::fromUtf8("静止偏差校准陀螺仪IIY"));
sSCGyroscopeIIZLabel = new QLabel();//静止偏差校准陀螺仪IIZ
sSCGyroscopeIIZLabel->setText(QString::fromUtf8("静止偏差校准陀螺仪IIZ"));
cACGyroscopeIXLabel = new QLabel();//坐标轴校准陀螺仪IX
cACGyroscopeIXLabel->setText(QString::fromUtf8("坐标轴校准陀螺仪IX"));
cACGyroscopeIYLabel = new QLabel();//坐标轴校准陀螺仪IY
cACGyroscopeIYLabel->setText(QString::fromUtf8("坐标轴校准陀螺仪IY"));
cACGyroscopeIZLabel = new QLabel();//坐标轴校准陀螺仪IZ
cACGyroscopeIZLabel->setText(QString::fromUtf8("坐标轴校准陀螺仪IZ"));
cACGyroscopeIIXLabel = new QLabel();//坐标轴校准陀螺仪IIX
cACGyroscopeIIXLabel->setText(QString::fromUtf8("坐标轴校准陀螺仪IIX"));
cACGyroscopeIIYLabel = new QLabel();//坐标轴校准陀螺仪IIY
cACGyroscopeIIYLabel->setText(QString::fromUtf8("坐标轴校准陀螺仪IIY"));
cACGyroscopeIIZLabel = new QLabel();//坐标轴校准陀螺仪IIZ
cACGyroscopeIIZLabel->setText(QString::fromUtf8("坐标轴校准陀螺仪IIZ"));
oMagnetometerXLabel = new QLabel();//原始磁力计X
oMagnetometerXLabel->setText(QString::fromUtf8("原始磁力计X"));
oMagnetometerYLabel = new QLabel();//原始磁力计Y
oMagnetometerYLabel->setText(QString::fromUtf8("原始磁力计Y"));
oMagnetometerZLabel = new QLabel();//原始磁力计Z
oMagnetometerZLabel->setText(QString::fromUtf8("原始磁力计Z"));
cMagnetometerXLabel = new QLabel();//校准磁力计X
cMagnetometerXLabel->setText(QString::fromUtf8("校准磁力计X"));
cMagnetometerYLabel = new QLabel();//校准磁力计Y
cMagnetometerYLabel->setText(QString::fromUtf8("校准磁力计Y"));
cMagnetometerZLabel = new QLabel();//校准磁力计Z
cMagnetometerZLabel->setText(QString::fromUtf8("校准磁力计Z"));
eulerianAnglesXLabel = new QLabel();//欧拉角
eulerianAnglesXLabel->setText(QString::fromUtf8("欧拉角X"));
eulerianAnglesYLabel = new QLabel();//欧拉角
eulerianAnglesYLabel->setText(QString::fromUtf8("欧拉角Y"));
eulerianAnglesZLabel = new QLabel();//欧拉角
eulerianAnglesZLabel->setText(QString::fromUtf8("欧拉角Z"));
timeEdit = new QLineEdit();
temputerEdit = new QLineEdit();
initialAccelerationXEdit = new QLineEdit();
initialAccelerationYEdit = new QLineEdit();
initialAccelerationZEdit = new QLineEdit();
cAccelerationXEdit = new QLineEdit();
cAccelerationYEdit = new QLineEdit();
cAccelerationZEdit = new QLineEdit();
oGyroscopeIXEdit = new QLineEdit();
oGyroscopeIYEdit = new QLineEdit();
oGyroscopeIZEdit = new QLineEdit();
oGyroscopeIIXEdit = new QLineEdit();
oGyroscopeIIYEdit = new QLineEdit();
oGyroscopeIIZEdit = new QLineEdit();
sSCGyroscopeIXEdit = new QLineEdit();
sSCGyroscopeIYEdit = new QLineEdit();
sSCGyroscopeIZEdit = new QLineEdit();
sSCGyroscopeIIXEdit = new QLineEdit();
sSCGyroscopeIIYEdit = new QLineEdit();
sSCGyroscopeIIZEdit = new QLineEdit();
cACGyroscopeIXEdit = new QLineEdit();
cACGyroscopeIYEdit = new QLineEdit();
cACGyroscopeIZEdit = new QLineEdit();
cACGyroscopeIIXEdit = new QLineEdit();
cACGyroscopeIIYEdit = new QLineEdit();
cACGyroscopeIIZEdit = new QLineEdit();
oMagnetometerXEdit = new QLineEdit();
oMagnetometerYEdit = new QLineEdit();
oMagnetometerZEdit = new QLineEdit();
cMagnetometerXEdit = new QLineEdit();
cMagnetometerYEdit = new QLineEdit();
cMagnetometerZEdit = new QLineEdit();
eulerianAnglesXEdit = new QLineEdit();
eulerianAnglesYEdit = new QLineEdit();
eulerianAnglesZEdit = new QLineEdit();
mainLayout = new QGridLayout();
mainLayout->addWidget(timeLabel,0,0);
mainLayout->addWidget(timeEdit,0,1);
mainLayout->addWidget(temputerLabel,1,0);
mainLayout->addWidget(temputerEdit,1,1);
mainLayout->addWidget(initialAccelerationXLabel,2,0);
mainLayout->addWidget(initialAccelerationXEdit,2,1);
mainLayout->addWidget(initialAccelerationYLabel,3,0);
mainLayout->addWidget(initialAccelerationYEdit,3,1);
mainLayout->addWidget(initialAccelerationZLabel,4,0);
mainLayout->addWidget(initialAccelerationZEdit,4,1);
mainLayout->addWidget(cAccelerationXLabel,5,0);
mainLayout->addWidget(cAccelerationXEdit,5,1);
mainLayout->addWidget(cAccelerationYLabel,6,0);
mainLayout->addWidget(cAccelerationYEdit,6,1);
mainLayout->addWidget(cAccelerationZLabel,7,0);
mainLayout->addWidget(cAccelerationZEdit,7,1);
mainLayout->addWidget(oGyroscopeIXLabel,8,0);
mainLayout->addWidget(oGyroscopeIXEdit,8,1);
mainLayout->addWidget(oGyroscopeIYLabel,9,0);
mainLayout->addWidget(oGyroscopeIYEdit,9,1);
mainLayout->addWidget(oGyroscopeIZLabel,10,0);
mainLayout->addWidget(oGyroscopeIZEdit,10,1);
mainLayout->addWidget(oGyroscopeIIXLabel,11,0);
mainLayout->addWidget(oGyroscopeIIXEdit,11,1);
mainLayout->addWidget(oGyroscopeIIYLabel,12,0);
mainLayout->addWidget(oGyroscopeIIYEdit,12,1);
mainLayout->addWidget(oGyroscopeIIZLabel,13,0);
mainLayout->addWidget(oGyroscopeIIZEdit,13,1);
mainLayout->addWidget(sSCGyroscopeIXLabel,14,0);
mainLayout->addWidget(sSCGyroscopeIXEdit,14,1);
mainLayout->addWidget(sSCGyroscopeIYLabel,15,0);
mainLayout->addWidget(sSCGyroscopeIYEdit,15,1);
mainLayout->addWidget(sSCGyroscopeIZLabel,16,0);
mainLayout->addWidget(sSCGyroscopeIZEdit,16,1);
mainLayout->addWidget(sSCGyroscopeIIXLabel,17,0);
mainLayout->addWidget(sSCGyroscopeIIXEdit,17,1);
mainLayout->addWidget(sSCGyroscopeIIYLabel,0,2);
mainLayout->addWidget(sSCGyroscopeIIYEdit,0,3);
mainLayout->addWidget(sSCGyroscopeIIZLabel,1,2);
mainLayout->addWidget(sSCGyroscopeIIZEdit,1,3);
mainLayout->addWidget(cACGyroscopeIXLabel,2,2);
mainLayout->addWidget(cACGyroscopeIXEdit,2,3);
mainLayout->addWidget(cACGyroscopeIYLabel,3,2);
mainLayout->addWidget(cACGyroscopeIYEdit,3,3);
mainLayout->addWidget(cACGyroscopeIZLabel,4,2);
mainLayout->addWidget(cACGyroscopeIZEdit,4,3);
mainLayout->addWidget(cACGyroscopeIIXLabel,5,2);
mainLayout->addWidget(cACGyroscopeIIXEdit,5,3);
mainLayout->addWidget(cACGyroscopeIIYLabel,6,2);
mainLayout->addWidget(cACGyroscopeIIYEdit,6,3);
mainLayout->addWidget(cACGyroscopeIIZLabel,7,2);
mainLayout->addWidget(cACGyroscopeIIZEdit,7,3);
mainLayout->addWidget(oMagnetometerXLabel,8,2);
mainLayout->addWidget(oMagnetometerXEdit,8,3);
mainLayout->addWidget(oMagnetometerYLabel,9,2);
mainLayout->addWidget(oMagnetometerYEdit,9,3);
mainLayout->addWidget(oMagnetometerZLabel,10,2);
mainLayout->addWidget(oMagnetometerZEdit,10,3);
mainLayout->addWidget(cMagnetometerXLabel,11,2);
mainLayout->addWidget(cMagnetometerXEdit,11,3);
mainLayout->addWidget(cMagnetometerYLabel,12,2);
mainLayout->addWidget(cMagnetometerYEdit,12,3);
mainLayout->addWidget(cMagnetometerZLabel,13,2);
mainLayout->addWidget(cMagnetometerZEdit,13,3);
mainLayout->addWidget(eulerianAnglesXLabel,14,2);
mainLayout->addWidget(eulerianAnglesXEdit,14,3);
mainLayout->addWidget(eulerianAnglesYLabel,15,2);
mainLayout->addWidget(eulerianAnglesYEdit,15,3);
mainLayout->addWidget(eulerianAnglesZLabel,16,2);
mainLayout->addWidget(eulerianAnglesZEdit,16,3);
this->setLayout(mainLayout);
}
void DataWidget::getHttpDatas(const QVariant var)
{
SensorData myData =var.value<SensorData>();
this->timeEdit->setText(QString::number(myData.time));
this->temputerEdit->setText(QString::number(myData.temputer));
this->initialAccelerationXEdit->setText(QString::number(myData.initialAccelerationX));
this->initialAccelerationYEdit->setText(QString::number(myData.initialAccelerationY));
this->initialAccelerationZEdit->setText(QString::number(myData.initialAccelerationZ));
this->cAccelerationXEdit->setText(QString::number(myData.cAccelerationX));
this->cAccelerationYEdit->setText(QString::number(myData.cAccelerationY));
this->cAccelerationZEdit->setText(QString::number(myData.cAccelerationZ));
this->oGyroscopeIXEdit->setText(QString::number(myData.oGyroscopeIX));
this->oGyroscopeIYEdit->setText(QString::number(myData.oGyroscopeIY));
this->oGyroscopeIZEdit->setText(QString::number(myData.oGyroscopeIZ));
this->oGyroscopeIIXEdit->setText(QString::number(myData.oGyroscopeIIX));
this->oGyroscopeIIYEdit->setText(QString::number(myData.oGyroscopeIIY));
this->oGyroscopeIIZEdit->setText(QString::number(myData.oGyroscopeIIZ));
this->sSCGyroscopeIXEdit->setText(QString::number(myData.sSCGyroscopeIX));
this->sSCGyroscopeIYEdit->setText(QString::number(myData.sSCGyroscopeIY));
this->sSCGyroscopeIZEdit->setText(QString::number(myData.sSCGyroscopeIZ));
this->sSCGyroscopeIIXEdit->setText(QString::number(myData.sSCGyroscopeIIX));
this->sSCGyroscopeIIYEdit->setText(QString::number(myData.sSCGyroscopeIIY));
this->sSCGyroscopeIIZEdit->setText(QString::number(myData.sSCGyroscopeIIZ));
this->cACGyroscopeIXEdit->setText(QString::number(myData.cACGyroscopeIX));
this->cACGyroscopeIYEdit->setText(QString::number(myData.cACGyroscopeIY));
this->cACGyroscopeIZEdit->setText(QString::number(myData.cACGyroscopeIZ));
this->cACGyroscopeIIXEdit->setText(QString::number(myData.cACGyroscopeIIX));
this->cACGyroscopeIIYEdit->setText(QString::number(myData.cACGyroscopeIIY));
this->cACGyroscopeIIZEdit->setText(QString::number(myData.cACGyroscopeIIZ));
this->oMagnetometerXEdit->setText(QString::number(myData.oMagnetometerX));
this->oMagnetometerYEdit->setText(QString::number(myData.oMagnetometerY));
this->oMagnetometerZEdit->setText(QString::number(myData.oMagnetometerZ));
this->cMagnetometerXEdit->setText(QString::number(myData.cMagnetometerX));
this->cMagnetometerYEdit->setText(QString::number(myData.cMagnetometerY));
this->cMagnetometerZEdit->setText(QString::number(myData.cMagnetometerZ));
this->eulerianAnglesXEdit->setText(QString::number(myData.eulerianAnglesX));
this->eulerianAnglesYEdit->setText(QString::number(myData.eulerianAnglesY));
this->eulerianAnglesZEdit->setText(QString::number(myData.eulerianAnglesZ));
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gu_jin_long/lpmsqt-ui.git
git@gitee.com:gu_jin_long/lpmsqt-ui.git
gu_jin_long
lpmsqt-ui
LPMSQtUi
master

搜索帮助