34 lines
1.1 KiB
C++
34 lines
1.1 KiB
C++
#include "XyzRpyItem.h"
|
|
#include "ui_XyzRpyItem.h"
|
|
|
|
XyzRpyItem::XyzRpyItem(QWidget *parent)
|
|
: QWidget(parent)
|
|
, ui(new Ui::XyzRpyItem)
|
|
{
|
|
ui->setupUi(this);
|
|
|
|
// 寮哄埗搴旂敤鏍峰紡琛?
|
|
this->setAttribute(Qt::WA_StyledBackground, true);
|
|
}
|
|
|
|
XyzRpyItem::~XyzRpyItem()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void XyzRpyItem::setResultData(int index, const QString& titlePrefix, const PositionData<double>& position, int precision)
|
|
{
|
|
// 璁剧疆鏍囬锛氬墠缂€ + 缂栧彿
|
|
ui->result_id->setText(QString("%1 %2").arg(titlePrefix).arg(index));
|
|
|
|
// 鍧愭爣锛氭瘡琛屼竴涓酱
|
|
ui->result_x->setText(QString("X: %1").arg(position.x, 0, 'f', precision));
|
|
ui->result_y->setText(QString("Y: %1").arg(position.y, 0, 'f', precision));
|
|
ui->result_z->setText(QString("Z: %1").arg(position.z, 0, 'f', precision));
|
|
|
|
// 濮挎€佽锛氭瘡琛屼竴涓?
|
|
ui->result_r->setText(QString("A: %1").arg(position.roll, 0, 'f', precision));
|
|
ui->result_p->setText(QString("B: %1").arg(position.pitch, 0, 'f', precision));
|
|
ui->result_yaw->setText(QString("C: %1").arg(position.yaw, 0, 'f', precision));
|
|
}
|