add IntegratRMS
This commit is contained in:
parent
6263b93ee9
commit
edc5e4d793
@ -76,7 +76,7 @@ void CAddChannel::on_comboBox_channel_currentTextChanged(const QString &arg1)
|
|||||||
ui->comboBox_charac->addItem("推导峰值");
|
ui->comboBox_charac->addItem("推导峰值");
|
||||||
ui->comboBox_charac->addItem("峰值");
|
ui->comboBox_charac->addItem("峰值");
|
||||||
ui->comboBox_charac->addItem("速度峰值");
|
ui->comboBox_charac->addItem("速度峰值");
|
||||||
ui->comboBox_charac->addItem("速度有效值");
|
ui->comboBox_charac->addItem("积分有效值");
|
||||||
ui->comboBox_charac->addItem("峰值因子");
|
ui->comboBox_charac->addItem("峰值因子");
|
||||||
}else if(g_ChannelBaseInfo[i].channelType == "VELOCITY"){
|
}else if(g_ChannelBaseInfo[i].channelType == "VELOCITY"){
|
||||||
|
|
||||||
|
|||||||
@ -63,7 +63,7 @@ CChannelSetting::CChannelSetting(QWidget *parent) :
|
|||||||
ui->channelTypeCombox->addItems(ChannelTypeList);
|
ui->channelTypeCombox->addItems(ChannelTypeList);
|
||||||
m_itemList << "是" << "否" ;
|
m_itemList << "是" << "否" ;
|
||||||
|
|
||||||
m_DisPlayerList << "峰峰值" << "有效值" << "峰值" <<"平均值";
|
m_DisPlayerList << "峰峰值" << "有效值" << "峰值" <<"平均值" << "诊断峰峰值" << "积分有效值";
|
||||||
ui->comboBox_sensorICP->addItems(m_itemList);
|
ui->comboBox_sensorICP->addItems(m_itemList);
|
||||||
ui->comboBox_defaultDisplay->clear();
|
ui->comboBox_defaultDisplay->clear();
|
||||||
ui->comboBox_defaultDisplay->addItems(m_DisPlayerList);
|
ui->comboBox_defaultDisplay->addItems(m_DisPlayerList);
|
||||||
|
|||||||
@ -89,6 +89,10 @@ void CCharacteristicList::DisPlayCharacteristic()
|
|||||||
}
|
}
|
||||||
}else if(g_ChannelBaseInfo[i].defaultDisplay == "转速"){
|
}else if(g_ChannelBaseInfo[i].defaultDisplay == "转速"){
|
||||||
model->setData(model->index(j,2,QModelIndex()),QString::number(g_Charateristic[j].speedRPM,'f',g_Charateristic[j].ChUnitDot));
|
model->setData(model->index(j,2,QModelIndex()),QString::number(g_Charateristic[j].speedRPM,'f',g_Charateristic[j].ChUnitDot));
|
||||||
|
}else if(g_ChannelBaseInfo[i].defaultDisplay == "诊断峰峰值"){
|
||||||
|
model->setData(model->index(j,2,QModelIndex()),QString::number(g_Charateristic[j].DiagnosisPk2Pk,'f',g_Charateristic[j].ChUnitDot));
|
||||||
|
}else if(g_ChannelBaseInfo[i].defaultDisplay == "积分有效值"){
|
||||||
|
model->setData(model->index(j,2,QModelIndex()),QString::number(g_Charateristic[j].IntegratRMS,'f',g_Charateristic[j].ChUnitDot));
|
||||||
}
|
}
|
||||||
if(g_ChannelBaseInfo[i].boardType == "5"){
|
if(g_ChannelBaseInfo[i].boardType == "5"){
|
||||||
model->setData(model->index(j,2,QModelIndex()),QString::number(g_Charateristic[j].DCValues,'f',g_Charateristic[j].ChUnitDot));
|
model->setData(model->index(j,2,QModelIndex()),QString::number(g_Charateristic[j].DCValues,'f',g_Charateristic[j].ChUnitDot));
|
||||||
|
|||||||
60
CustomGraphicsItemGroup.h
Normal file
60
CustomGraphicsItemGroup.h
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
#ifndef CUSTOMGRAPHICSITEMGROUP_H
|
||||||
|
#define CUSTOMGRAPHICSITEMGROUP_H
|
||||||
|
#include <QGraphicsItemGroup>
|
||||||
|
#include <QPainter>
|
||||||
|
|
||||||
|
class RoundedGraphicsItemGroup : public QGraphicsItemGroup {
|
||||||
|
public:
|
||||||
|
RoundedGraphicsItemGroup(QGraphicsItem *parent = nullptr)
|
||||||
|
: QGraphicsItemGroup(parent), selected(false) {
|
||||||
|
//setFlag(QGraphicsItem::ItemIsSelectable, true); // 使该项可选中
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置圆角半径
|
||||||
|
void setCornerRadius(qreal radius) {
|
||||||
|
cornerRadius = radius;
|
||||||
|
prepareGeometryChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
QRectF boundingRect() const override {
|
||||||
|
return QGraphicsItemGroup::boundingRect();
|
||||||
|
}
|
||||||
|
|
||||||
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override {
|
||||||
|
Q_UNUSED(option)
|
||||||
|
Q_UNUSED(widget)
|
||||||
|
|
||||||
|
// 启用抗锯齿
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing, true);
|
||||||
|
|
||||||
|
// 绘制圆角矩形背景
|
||||||
|
painter->setBrush(QBrush(QColor(255, 255, 255)));
|
||||||
|
painter->setPen(Qt::NoPen);
|
||||||
|
painter->drawRoundedRect(boundingRect(), cornerRadius, cornerRadius);
|
||||||
|
|
||||||
|
// 绘制选中效果
|
||||||
|
if (isSelected()) {
|
||||||
|
QPen pen(QColor(36,93,155), 3); // 蓝色边框
|
||||||
|
painter->setPen(pen);
|
||||||
|
painter->setBrush(Qt::NoBrush);
|
||||||
|
painter->drawRoundedRect(boundingRect().adjusted(1.5, 1.5, -1.5, -1.5), cornerRadius, cornerRadius);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void mousePressEvent(QGraphicsSceneMouseEvent *event) override {
|
||||||
|
QGraphicsItemGroup::mousePressEvent(event);
|
||||||
|
update(); // 更新选中效果
|
||||||
|
}
|
||||||
|
|
||||||
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override {
|
||||||
|
QGraphicsItemGroup::mouseReleaseEvent(event);
|
||||||
|
update(); // 更新选中效果
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
qreal cornerRadius = 10.0; // 默认圆角半径
|
||||||
|
bool selected; // 是否被选中
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CUSTOMGRAPHICSITEMGROUP_H
|
||||||
@ -336,9 +336,9 @@ void CRealTimeForm::on_addchannel(channelBaseInfo channelbaseInfo, QString str)
|
|||||||
} else if (str == "最大正向峰值" || str == "最大负向峰值" ||
|
} else if (str == "最大正向峰值" || str == "最大负向峰值" ||
|
||||||
str == "诊断峰峰值" || str == "平均值") {
|
str == "诊断峰峰值" || str == "平均值") {
|
||||||
pTextUnits = new QGraphicsTextItem(channelbaseInfo.sensorEngineeringUnit);
|
pTextUnits = new QGraphicsTextItem(channelbaseInfo.sensorEngineeringUnit);
|
||||||
} else if (str == "速度峰值" || str == "速度有效值") {
|
} else if (str == "速度峰值" || str == "速度有效值" || str == "积分有效值") {
|
||||||
pTextUnits = new QGraphicsTextItem("mm/s");
|
pTextUnits = new QGraphicsTextItem("mm/s");
|
||||||
} else {
|
}else {
|
||||||
pTextUnits = new QGraphicsTextItem(channelbaseInfo.sensorEngineeringUnit);
|
pTextUnits = new QGraphicsTextItem(channelbaseInfo.sensorEngineeringUnit);
|
||||||
}
|
}
|
||||||
} else if (channelbaseInfo.channelType == "PROXIMETER") {
|
} else if (channelbaseInfo.channelType == "PROXIMETER") {
|
||||||
@ -1112,7 +1112,7 @@ void CRealTimeForm::UpdateCharacteristic(QVector<_Charateristic> &m_vecCharateri
|
|||||||
str = QString("%1").arg(QString::number(m_vecCharateristic[i].MonitorPk2Pk, 'f', m_vecCharateristic[i].ChUnitDot));
|
str = QString("%1").arg(QString::number(m_vecCharateristic[i].MonitorPk2Pk, 'f', m_vecCharateristic[i].ChUnitDot));
|
||||||
} else if (itemData2 == "诊断峰峰值") {
|
} else if (itemData2 == "诊断峰峰值") {
|
||||||
str = QString("%1").arg(QString::number(m_vecCharateristic[i].DiagnosisPk2Pk, 'f', m_vecCharateristic[i].ChUnitDot));
|
str = QString("%1").arg(QString::number(m_vecCharateristic[i].DiagnosisPk2Pk, 'f', m_vecCharateristic[i].ChUnitDot));
|
||||||
} else if (itemData2 == "速度有效值" || itemData2 == "位移有效值") {
|
} else if (itemData2 == "积分有效值" || itemData2 == "位移有效值") {
|
||||||
str = QString("%1").arg(QString::number(m_vecCharateristic[i].IntegratRMS, 'f', m_vecCharateristic[i].ChUnitDot));
|
str = QString("%1").arg(QString::number(m_vecCharateristic[i].IntegratRMS, 'f', m_vecCharateristic[i].ChUnitDot));
|
||||||
} else if (itemData2 == "速度峰值" || itemData2 == "位移峰值") {
|
} else if (itemData2 == "速度峰值" || itemData2 == "位移峰值") {
|
||||||
str = QString("%1").arg(QString::number(m_vecCharateristic[i].IntegratPk2Pk2, 'f', m_vecCharateristic[i].ChUnitDot));
|
str = QString("%1").arg(QString::number(m_vecCharateristic[i].IntegratPk2Pk2, 'f', m_vecCharateristic[i].ChUnitDot));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user