#include "mainpage_quality.h" mainpage_Quality::mainpage_Quality(QWidget *parent) : QWidget(parent) { label_out_of_balance_current=new QLabel(this); label_out_of_balance_voltage=new QLabel(this); label_A_Voltage_top=new QLabel(this); label_B_Voltage_top=new QLabel(this); label_C_Voltage_top=new QLabel(this); label_A_Voltage_phase=new QLabel(this); label_B_Voltage_phase=new QLabel(this); label_C_Voltage_phase=new QLabel(this); label_A_Current_phase=new QLabel(this); label_B_Current_phase=new QLabel(this); label_C_Current_phase=new QLabel(this); label_frequency=new QLabel(this); label_xiebo_top_voltage_titel=new QLabel(this); label_xiebo_top_current_titel=new QLabel(this); label_xiebo_jibian_voltage_titel=new QLabel(this); label_xiebo_jibian_current_titel=new QLabel(this); label_xiebo_K_voltage_titel=new QLabel(this); label_xiebo_K_current_titel=new QLabel(this); line_quality_1_1=new QFrame(this); line_quality_1_2=new QFrame(this); line_quality_1_3=new QFrame(this); line_quality_1_4=new QFrame(this); line_quality_1_5=new QFrame(this); line_quality_2_1=new QFrame(this); line_quality_2_2=new QFrame(this); line_quality_2_3=new QFrame(this); line_quality_2_4=new QFrame(this); line_quality_2_5=new QFrame(this); button_quality_1=new QPushButton("上一页",this); button_quality_2=new QPushButton("下一页",this); label_A_out_of_xiebo_jibian_voltage=new QLabel(this); label_B_out_of_xiebo_jibian_voltage=new QLabel(this); label_C_out_of_xiebo_jibian_voltage=new QLabel(this); label_A_out_of_xiebo_jibian_current=new QLabel(this); label_B_out_of_xiebo_jibian_current=new QLabel(this); label_C_out_of_xiebo_jibian_current=new QLabel(this); label_A_out_of_xiebo_K_voltage=new QLabel(this); label_B_out_of_xiebo_K_voltage=new QLabel(this); label_C_out_of_xiebo_K_voltage=new QLabel(this); label_A_out_of_xiebo_K_current=new QLabel(this); label_B_out_of_xiebo_K_current=new QLabel(this); label_C_out_of_xiebo_K_current=new QLabel(this); label_A_out_of_xiebo_top_voltage=new QLabel(this); label_B_out_of_xiebo_top_voltage=new QLabel(this); label_C_out_of_xiebo_top_voltage=new QLabel(this); label_A_out_of_xiebo_top_current=new QLabel(this); label_B_out_of_xiebo_top_current=new QLabel(this); label_C_out_of_xiebo_top_current=new QLabel(this); label_out_of_balance_voltage->setGeometry(20,10,120,40); label_out_of_balance_voltage->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_out_of_balance_current->setGeometry(150,10,120,40); label_out_of_balance_current->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_A_Voltage_top->setGeometry(280,10,120,40); label_A_Voltage_top->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_B_Voltage_top->setGeometry(280,50,120,40); label_B_Voltage_top->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_C_Voltage_top->setGeometry(280,90,120,40); label_C_Voltage_top->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_A_Voltage_phase->setGeometry(405,10,120,40); label_A_Voltage_phase->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_B_Voltage_phase->setGeometry(405,50,120,40); label_B_Voltage_phase->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_C_Voltage_phase->setGeometry(405,90,120,40); label_C_Voltage_phase->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_A_Current_phase->setGeometry(535,10,120,40); label_A_Current_phase->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_B_Current_phase->setGeometry(535,50,120,40); label_B_Current_phase->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_C_Current_phase->setGeometry(535,90,120,40); label_C_Current_phase->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_frequency->setGeometry(665,10,120,40); label_frequency->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); /*页面2*/ label_xiebo_jibian_voltage_titel->setGeometry(11,10,120,15); label_xiebo_jibian_voltage_titel->setStyleSheet("background: rgb(145, 145, 145);font: 11pt 黑体 bold;color: rgb(0, 0, 0)"); label_xiebo_jibian_voltage_titel->setText("电压谐波畸变"); label_A_out_of_xiebo_jibian_voltage->setGeometry(11,25,120,40); label_A_out_of_xiebo_jibian_voltage->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_B_out_of_xiebo_jibian_voltage->setGeometry(11,65,120,40); label_B_out_of_xiebo_jibian_voltage->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_C_out_of_xiebo_jibian_voltage->setGeometry(11,105,120,40); label_C_out_of_xiebo_jibian_voltage->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_xiebo_jibian_current_titel->setGeometry(140,10,120,15); label_xiebo_jibian_current_titel->setStyleSheet("background: rgb(145, 145, 145);font: 11pt 黑体 bold;color: rgb(0, 0, 0)"); label_xiebo_jibian_current_titel->setText("电流谐波畸变"); label_A_out_of_xiebo_jibian_current->setGeometry(140,25,120,40); label_A_out_of_xiebo_jibian_current->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_B_out_of_xiebo_jibian_current->setGeometry(140,65,120,40); label_B_out_of_xiebo_jibian_current->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_C_out_of_xiebo_jibian_current->setGeometry(140,105,120,40); label_C_out_of_xiebo_jibian_current->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_xiebo_K_voltage_titel->setGeometry(270,10,125,15); label_xiebo_K_voltage_titel->setStyleSheet("background: rgb(145, 145, 145);font: 11pt 黑体 bold;color: rgb(0, 0, 0)"); label_xiebo_K_voltage_titel->setText("电压谐波K因子"); label_A_out_of_xiebo_K_voltage->setGeometry(270,24,125,40); label_A_out_of_xiebo_K_voltage->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_B_out_of_xiebo_K_voltage->setGeometry(270,65,125,40); label_B_out_of_xiebo_K_voltage->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_C_out_of_xiebo_K_voltage->setGeometry(270,105,125,40); label_C_out_of_xiebo_K_voltage->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_xiebo_K_current_titel->setGeometry(405,10,120,15); label_xiebo_K_current_titel->setStyleSheet("background: rgb(145, 145, 145);font: 11pt 黑体 bold;color: rgb(0, 0, 0)"); label_xiebo_K_current_titel->setText("电流谐波K因子"); label_A_out_of_xiebo_K_current->setGeometry(405,25,120,40); label_A_out_of_xiebo_K_current->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_B_out_of_xiebo_K_current->setGeometry(405,65,120,40); label_B_out_of_xiebo_K_current->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_C_out_of_xiebo_K_current->setGeometry(405,105,120,40); label_C_out_of_xiebo_K_current->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_xiebo_top_voltage_titel->setGeometry(527,10,120,15); label_xiebo_top_voltage_titel->setStyleSheet("background: rgb(145, 145, 145);font: 11pt 黑体 bold;color: rgb(0, 0, 0)"); label_xiebo_top_voltage_titel->setText("电压谐波峰值因子"); label_A_out_of_xiebo_top_voltage->setGeometry(527,25,120,40); label_A_out_of_xiebo_top_voltage->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_B_out_of_xiebo_top_voltage->setGeometry(527,65,120,40); label_B_out_of_xiebo_top_voltage->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_C_out_of_xiebo_top_voltage->setGeometry(527,105,120,40); label_C_out_of_xiebo_top_voltage->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_xiebo_top_current_titel->setGeometry(658,10,120,15); label_xiebo_top_current_titel->setStyleSheet("background: rgb(145, 145, 145);font: 11pt 黑体 bold;color: rgb(0, 0, 0)"); label_xiebo_top_current_titel->setText("电流谐波峰值因子"); label_A_out_of_xiebo_top_current->setGeometry(658,25,120,40); label_A_out_of_xiebo_top_current->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_B_out_of_xiebo_top_current->setGeometry(658,65,120,40); label_B_out_of_xiebo_top_current->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); label_C_out_of_xiebo_top_current->setGeometry(658,105,120,40); label_C_out_of_xiebo_top_current->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(0, 0, 0)"); line_quality_1_1->setGeometry(145,10,1,150); line_quality_1_1->setFrameShape(QFrame::VLine); line_quality_1_2->setGeometry(275,10,1,150); line_quality_1_2->setFrameShape(QFrame::VLine); line_quality_1_3->setGeometry(400,10,1,150); line_quality_1_3->setFrameShape(QFrame::VLine); line_quality_1_4->setGeometry(530,10,1,150); line_quality_1_4->setFrameShape(QFrame::VLine); line_quality_1_5->setGeometry(660,10,1,150); line_quality_1_5->setFrameShape(QFrame::VLine); line_quality_2_1->setGeometry(135,10,1,150); line_quality_2_1->setFrameShape(QFrame::VLine); line_quality_2_2->setGeometry(265,10,1,150); line_quality_2_2->setFrameShape(QFrame::VLine); line_quality_2_3->setGeometry(400,10,1,150); line_quality_2_3->setFrameShape(QFrame::VLine); line_quality_2_4->setGeometry(526,10,1,150); line_quality_2_4->setFrameShape(QFrame::VLine); line_quality_2_5->setGeometry(653,10,1,150); line_quality_2_5->setFrameShape(QFrame::VLine); button_quality_1->setGeometry(20,143,75,30); button_quality_1->setStyleSheet("background: rgb(0, 171, 171);font: 12pt 黑体 bold;color: rgb(255, 255, 255)"); button_quality_2->setGeometry(705,143,75,30); button_quality_2->setStyleSheet("background: rgb(0, 171, 171);font: 12pt 黑体 bold;color: rgb(255, 255, 255)"); connect(button_quality_1,SIGNAL(clicked()),this,SLOT(button_quality_1_clicked())); connect(button_quality_2,SIGNAL(clicked()),this,SLOT(button_quality_2_clicked())); label_A_out_of_xiebo_jibian_voltage->hide(); label_B_out_of_xiebo_jibian_voltage->hide(); label_C_out_of_xiebo_jibian_voltage->hide(); label_A_out_of_xiebo_jibian_current->hide(); label_B_out_of_xiebo_jibian_current->hide(); label_C_out_of_xiebo_jibian_current->hide(); label_A_out_of_xiebo_K_voltage->hide(); label_B_out_of_xiebo_K_voltage->hide(); label_C_out_of_xiebo_K_voltage->hide(); label_A_out_of_xiebo_K_current->hide(); label_B_out_of_xiebo_K_current->hide(); label_C_out_of_xiebo_K_current->hide(); label_A_out_of_xiebo_top_voltage->hide(); label_B_out_of_xiebo_top_voltage->hide(); label_C_out_of_xiebo_top_voltage->hide(); label_A_out_of_xiebo_top_current->hide(); label_B_out_of_xiebo_top_current->hide(); label_C_out_of_xiebo_top_current->hide(); label_xiebo_top_current_titel->hide(); label_xiebo_top_voltage_titel->hide(); label_xiebo_jibian_voltage_titel->hide(); label_xiebo_jibian_current_titel->hide(); label_xiebo_K_voltage_titel->hide(); label_xiebo_K_current_titel->hide(); label_out_of_balance_current->show(); label_out_of_balance_voltage->show(); label_A_Voltage_top->show(); label_B_Voltage_top->show(); label_C_Voltage_top->show(); label_A_Voltage_phase->show(); label_B_Voltage_phase->show(); label_C_Voltage_phase->show(); label_A_Current_phase->show(); label_B_Current_phase->show(); label_C_Current_phase->show(); label_frequency->show(); line_quality_2_1->hide(); line_quality_2_2->hide(); line_quality_2_3->hide(); line_quality_2_4->hide(); line_quality_2_5->hide(); line_quality_1_1->show(); line_quality_1_2->show(); line_quality_1_3->show(); line_quality_1_4->show(); line_quality_1_5->show(); button_quality_1->show(); button_quality_2->show(); } void mainpage_Quality::button_quality_1_clicked()//电能质量上一页按钮槽函数 { emit sigPageThreeSend(); label_A_out_of_xiebo_jibian_voltage->hide(); label_B_out_of_xiebo_jibian_voltage->hide(); label_C_out_of_xiebo_jibian_voltage->hide(); label_A_out_of_xiebo_jibian_current->hide(); label_B_out_of_xiebo_jibian_current->hide(); label_C_out_of_xiebo_jibian_current->hide(); label_A_out_of_xiebo_K_voltage->hide(); label_B_out_of_xiebo_K_voltage->hide(); label_C_out_of_xiebo_K_voltage->hide(); label_A_out_of_xiebo_K_current->hide(); label_B_out_of_xiebo_K_current->hide(); label_C_out_of_xiebo_K_current->hide(); label_A_out_of_xiebo_top_voltage->hide(); label_B_out_of_xiebo_top_voltage->hide(); label_C_out_of_xiebo_top_voltage->hide(); label_A_out_of_xiebo_top_current->hide(); label_B_out_of_xiebo_top_current->hide(); label_C_out_of_xiebo_top_current->hide(); label_xiebo_top_current_titel->hide(); label_xiebo_top_voltage_titel->hide(); label_xiebo_jibian_voltage_titel->hide(); label_xiebo_jibian_current_titel->hide(); label_xiebo_K_voltage_titel->hide(); label_xiebo_K_current_titel->hide(); label_out_of_balance_current->show(); label_out_of_balance_voltage->show(); label_A_Voltage_top->show(); label_B_Voltage_top->show(); label_C_Voltage_top->show(); label_A_Voltage_phase->show(); label_B_Voltage_phase->show(); label_C_Voltage_phase->show(); label_A_Current_phase->show(); label_B_Current_phase->show(); label_C_Current_phase->show(); label_frequency->show(); line_quality_2_1->hide(); line_quality_2_2->hide(); line_quality_2_3->hide(); line_quality_2_4->hide(); line_quality_2_5->hide(); line_quality_1_1->show(); line_quality_1_2->show(); line_quality_1_3->show(); line_quality_1_4->show(); line_quality_1_5->show(); button_quality_1->show(); button_quality_2->show(); } void mainpage_Quality::button_quality_2_clicked()//电能质量下一页按钮槽函数 { emit sigPageThreeSend(); label_A_out_of_xiebo_jibian_voltage->show(); label_B_out_of_xiebo_jibian_voltage->show(); label_C_out_of_xiebo_jibian_voltage->show(); label_A_out_of_xiebo_jibian_current->show(); label_B_out_of_xiebo_jibian_current->show(); label_C_out_of_xiebo_jibian_current->show(); label_A_out_of_xiebo_K_voltage->show(); label_B_out_of_xiebo_K_voltage->show(); label_C_out_of_xiebo_K_voltage->show(); label_A_out_of_xiebo_K_current->show(); label_B_out_of_xiebo_K_current->show(); label_C_out_of_xiebo_K_current->show(); label_A_out_of_xiebo_top_voltage->show(); label_B_out_of_xiebo_top_voltage->show(); label_C_out_of_xiebo_top_voltage->show(); label_A_out_of_xiebo_top_current->show(); label_B_out_of_xiebo_top_current->show(); label_C_out_of_xiebo_top_current->show(); label_xiebo_top_current_titel->show(); label_xiebo_top_voltage_titel->show(); label_xiebo_jibian_voltage_titel->show(); label_xiebo_jibian_current_titel->show(); label_xiebo_K_voltage_titel->show(); label_xiebo_K_current_titel->show(); label_out_of_balance_current->hide(); label_out_of_balance_voltage->hide(); label_A_Voltage_top->hide(); label_B_Voltage_top->hide(); label_C_Voltage_top->hide(); label_A_Voltage_phase->hide(); label_B_Voltage_phase->hide(); label_C_Voltage_phase->hide(); label_A_Current_phase->hide(); label_B_Current_phase->hide(); label_C_Current_phase->hide(); label_frequency->hide(); line_quality_2_1->show(); line_quality_2_2->show(); line_quality_2_3->show(); line_quality_2_4->show(); line_quality_2_5->show(); line_quality_1_1->hide(); line_quality_1_2->hide(); line_quality_1_3->hide(); line_quality_1_4->hide(); line_quality_1_5->hide(); button_quality_1->show(); button_quality_2->show(); } void mainpage_Quality::onPageThreeDataUpdate() { bool ok; auto get_right_minus = [&](QByteArray &array,int q = 10)->float{ QString transition1 = array.toHex(); int transition2 = transition1.toUInt(&ok,16); return (float)transition2*1.0/q; }; auto get_right_minus_SH = [&](QByteArray &array,int q = 10)->float{ QString transition1 = array.toHex(); short transition2 = transition1.toUShort(&ok,16); return (float)transition2*1.0/q; }; /*三相不平衡电压电流显示*/ float IUnstableV3 = get_right_minus(SEC.UnstableVandIV,100); ANA.UnstableV = IUnstableV3; label_out_of_balance_voltage->setText("不平衡电压\n"+QString::number(IUnstableV3,'f',2)+"%"); qDebug()<<"IUnstableV3:"<setText("不平衡电流\n"+QString::number(UnstableI3,'f',2)+"%"); qDebug()<<"UnstableI3:"<setText("A相电压幅值\n"+QString::number(A_Vol_top3)+"V"); qDebug()<<"A_Vol_top3:"<setText("B相电压幅值\n"+QString::number(B_Vol_top3)+"V"); qDebug()<<"B_Vol_top3:"<setText("C相电压幅值\n"+QString::number(C_Vol_top3)+"V"); qDebug()<<"C_Vol_top3:"<setText("A相电压相角\n"+QString::number(A_vol_phase3)+"°"); qDebug()<<"A_vol_phase3:"<setText("B相电压相角\n"+QString::number(B_vol_phase3)+"°"); qDebug()<<"B_vol_phase3:"<setText("C相电压相角\n"+QString::number(C_vol_phase3)+"°"); qDebug()<<"C_vol_phase3:"<setText("A相电流相角\n"+QString::number(A_current_phase3)+"°"); qDebug()<<"A_current_phase3:"<setText("B相电流相角\n"+QString::number(B_current_phase3)+"°"); qDebug()<<"B_current_phase3:"<setText("C相电流相角\n"+QString::number(C_current_phase3)+"°"); qDebug()<<"C_current_phase3:"<setText("变压器频率\n"+QString::number(Frequency1,'f',2)+"Hz");//10进制转字符串 qDebug()<<"Frequency1:"<setText("A相:\n"+QString::number(A_vol_xiebo_jibian3)+"%"); qDebug()<<"A_vol_xiebo_jibian3:"<setText("B相:\n"+QString::number(B_vol_xiebo_jibian3)+"%"); qDebug()<<"B_vol_xiebo_jibian3:"<setText("C相:\n"+QString::number(C_vol_xiebo_jibian3)+"%"); qDebug()<<"C_vol_xiebo_jibian3:"<setText("A相:\n"+QString::number(A_current_xiebo_jibian3)+"%"); qDebug()<<"A_current_xiebo_jibian3:"<setText("B相:\n"+QString::number(B_current_xiebo_jibian3)+"%"); qDebug()<<"B_current_xiebo_jibian3:"<setText("C相:\n"+QString::number(C_current_xiebo_jibian3)+"%"); qDebug()<<"C_current_xiebo_jibian3:"<setText("A相:\n"+QString::number(A_vol_K3)+"%"); qDebug()<<"A_vol_K3:"<setText("B相:\n"+QString::number(B_vol_K3)+"%"); qDebug()<<"B_vol_K3 :"<setText("C相:\n"+QString::number(C_vol_K3)+"%"); qDebug()<<"C_vol_K3:"<setText("A相:\n"+QString::number(A_current_K3)+"%"); qDebug()<<"A_current_K3:"<setText("B相:\n"+QString::number(B_current_K3)+"%"); qDebug()<<"B_current_K3:"<setText("C相:\n"+QString::number(C_current_K3)+"%"); qDebug()<<"C_current_K3:"<setText("A相:\n"+QString::number(A_vol_top3)+"%"); qDebug()<<"A_vol_top3:"<setText("B相:\n"+QString::number(B_vol_top3)+"%"); qDebug()<<"B_vol_top3:"<setText("C相:\n"+QString::number(C_vol_top3)+"%"); qDebug()<<"C_vol_top3:"<setText("A相:\n"+QString::number(A_current_top3)+"%"); qDebug()<<"A_current_top3:"<setText("B相:\n"+QString::number(B_current_top3)+"%"); qDebug()<<"B_current_top3:"<setText("C相:\n"+QString::number(C_current_top3)+"%"); qDebug()<<"C_current_top3:"<