#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:"<<IUnstableV3<<endl;

    float UnstableI3 = get_right_minus(SEC.UnstableVandIA,100);
    ANA.UnstableI = UnstableI3;
    label_out_of_balance_current->setText("不平衡电流\n"+QString::number(UnstableI3,'f',2)+"%");
    qDebug()<<"UnstableI3:"<<UnstableI3<<endl;

    /*电压幅值显示*/
    float A_Vol_top3 = get_right_minus(SEC.WheelVamA,100);
    label_A_Voltage_top->setText("A相电压幅值\n"+QString::number(A_Vol_top3)+"V");
    qDebug()<<"A_Vol_top3:"<<A_Vol_top3<<endl;

    float B_Vol_top3 = get_right_minus(SEC.WheelVamB,100);
    label_B_Voltage_top->setText("B相电压幅值\n"+QString::number(B_Vol_top3)+"V");
    qDebug()<<"B_Vol_top3:"<<B_Vol_top3<<endl;

    float C_Vol_top3 = get_right_minus(SEC.WheelVamC,100);
    label_C_Voltage_top->setText("C相电压幅值\n"+QString::number(C_Vol_top3)+"V");
    qDebug()<<"C_Vol_top3:"<<C_Vol_top3<<endl;
    /*电压相角显示*/
    float A_vol_phase3 = get_right_minus_SH(SEC.PhaseAngleVA,100);
    ANA.A_vol_phase = A_vol_phase3;
    label_A_Voltage_phase->setText("A相电压相角\n"+QString::number(A_vol_phase3)+"°");
    qDebug()<<"A_vol_phase3:"<<A_vol_phase3<<endl;

    float B_vol_phase3 = get_right_minus_SH(SEC.PhaseAngleVB,100);
    ANA.B_vol_phase = B_vol_phase3;
    label_B_Voltage_phase->setText("B相电压相角\n"+QString::number(B_vol_phase3)+"°");
    qDebug()<<"B_vol_phase3:"<<B_vol_phase3<<endl;

    float C_vol_phase3 = get_right_minus_SH(SEC.PhaseAngleVC,100);
    ANA.C_vol_phase = C_vol_phase3;
    label_C_Voltage_phase->setText("C相电压相角\n"+QString::number(C_vol_phase3)+"°");
    qDebug()<<"C_vol_phase3:"<<C_vol_phase3<<endl;

    /*电流相角显示*/
    float A_current_phase3 = get_right_minus_SH(SEC.PhaseAngleAA,100);
    ANA.A_current_phase = A_current_phase3;
    label_A_Current_phase->setText("A相电流相角\n"+QString::number(A_current_phase3)+"°");
    qDebug()<<"A_current_phase3:"<<A_current_phase3<<endl;

    float B_current_phase3 = get_right_minus_SH(SEC.PhaseAngleAB,100);
    ANA.B_current_phase = B_current_phase3;
    label_B_Current_phase->setText("B相电流相角\n"+QString::number(B_current_phase3)+"°");
    qDebug()<<"B_current_phase3:"<<B_current_phase3<<endl;

    float C_current_phase3 = get_right_minus_SH(SEC.PhaseAngleAC,100);
    ANA.C_current_phase = C_current_phase3;
    label_C_Current_phase->setText("C相电流相角\n"+QString::number(C_current_phase3)+"°");
    qDebug()<<"C_current_phase3:"<<C_current_phase3<<endl;
    /*变压器频率显示*/
    float Frequency1 = get_right_minus(SEC.SecWheelFrequency,100);
    ANA.Frequency = Frequency1;
    label_frequency->setText("变压器频率\n"+QString::number(Frequency1,'f',2)+"Hz");//10进制转字符串
    qDebug()<<"Frequency1:"<<Frequency1<<endl;

    /*电压谐波畸变显示*/
    float A_vol_xiebo_jibian3 = get_right_minus_SH(SEC.AberrationRateVA,100);
    ANA.A_vol_xiebo_jibian = A_vol_xiebo_jibian3;
    label_A_out_of_xiebo_jibian_voltage->setText("A相:\n"+QString::number(A_vol_xiebo_jibian3)+"%");
    qDebug()<<"A_vol_xiebo_jibian3:"<<A_vol_xiebo_jibian3<<endl;

    float B_vol_xiebo_jibian3 = get_right_minus_SH(SEC.AberrationRateVB,100);
    ANA.B_vol_xiebo_jibian = B_vol_xiebo_jibian3;
    label_B_out_of_xiebo_jibian_voltage->setText("B相:\n"+QString::number(B_vol_xiebo_jibian3)+"%");
    qDebug()<<"B_vol_xiebo_jibian3:"<<B_vol_xiebo_jibian3<<endl;

    float C_vol_xiebo_jibian3 = get_right_minus_SH(SEC.AberrationRateVC,100);
    ANA.C_vol_xiebo_jibian = C_vol_xiebo_jibian3;
    label_C_out_of_xiebo_jibian_voltage->setText("C相:\n"+QString::number(C_vol_xiebo_jibian3)+"%");
    qDebug()<<"C_vol_xiebo_jibian3:"<<C_vol_xiebo_jibian3<<endl;
    /*电流谐波畸变显示*/
    float A_current_xiebo_jibian3 = get_right_minus_SH(SEC.AberrationRateAA,100);
    ANA.A_current_xiebo_jibian = A_current_xiebo_jibian3;
    label_A_out_of_xiebo_jibian_current->setText("A相:\n"+QString::number(A_current_xiebo_jibian3)+"%");
    qDebug()<<"A_current_xiebo_jibian3:"<<A_current_xiebo_jibian3<<endl;

    float B_current_xiebo_jibian3 = get_right_minus_SH(SEC.AberrationRateAB,100);
    ANA.B_current_xiebo_jibian = B_current_xiebo_jibian3;
    label_B_out_of_xiebo_jibian_current->setText("B相:\n"+QString::number(B_current_xiebo_jibian3)+"%");
    qDebug()<<"B_current_xiebo_jibian3:"<<B_current_xiebo_jibian3<<endl;

    float C_current_xiebo_jibian3 = get_right_minus_SH(SEC.AberrationRateAC,100);//16进制转十进制
    ANA.C_current_xiebo_jibian = C_current_xiebo_jibian3;
    label_C_out_of_xiebo_jibian_current->setText("C相:\n"+QString::number(C_current_xiebo_jibian3)+"%");
    qDebug()<<"C_current_xiebo_jibian3:"<<C_current_xiebo_jibian3<<endl;

    /*电压谐波K因子显示*/
    float A_vol_K3 = get_right_minus(SEC.HarmonicKFactorVA,100);
    ANA.A_vol_K = A_vol_K3;
    label_A_out_of_xiebo_K_voltage->setText("A相:\n"+QString::number(A_vol_K3)+"%");
    qDebug()<<"A_vol_K3:"<<A_vol_K3<<endl;

    float B_vol_K3 = get_right_minus(SEC.HarmonicKFactorVB,100);
    ANA.B_vol_K = B_vol_K3;
    label_B_out_of_xiebo_K_voltage->setText("B相:\n"+QString::number(B_vol_K3)+"%");
    qDebug()<<"B_vol_K3 :"<<B_vol_K3<<endl;

    float C_vol_K3 = get_right_minus(SEC.HarmonicKFactorVC,100);
    ANA.C_vol_K = C_vol_K3;
    label_C_out_of_xiebo_K_voltage->setText("C相:\n"+QString::number(C_vol_K3)+"%");
    qDebug()<<"C_vol_K3:"<<C_vol_K3<<endl;

    /*电流谐波K因子显示*/
    float A_current_K3 = get_right_minus(SEC.HarmonicKFactorAA,100);
    ANA.A_current_K = A_current_K3;
    label_A_out_of_xiebo_K_current->setText("A相:\n"+QString::number(A_current_K3)+"%");
    qDebug()<<"A_current_K3:"<<A_current_K3<<endl;

    float B_current_K3 = get_right_minus(SEC.HarmonicKFactorAB,100);
    ANA.B_current_K = B_current_K3;
    label_B_out_of_xiebo_K_current->setText("B相:\n"+QString::number(B_current_K3)+"%");
    qDebug()<<"B_current_K3:"<<B_current_K3<<endl;

    float C_current_K3 = get_right_minus(SEC.HarmonicKFactorAC,100);
    ANA.C_current_K = C_current_K3;
    label_C_out_of_xiebo_K_current->setText("C相:\n"+QString::number(C_current_K3)+"%");
    qDebug()<<"C_current_K3:"<<C_current_K3<<endl;

    /*电压谐波峰值因子显示*/
    float A_vol_top3 = get_right_minus(SEC.HarmonicWavePeakFactorVA,100);
    ANA.A_vol_top = A_vol_top3;
    label_A_out_of_xiebo_top_voltage->setText("A相：\n"+QString::number(A_vol_top3)+"%");
    qDebug()<<"A_vol_top3:"<<A_vol_top3<<endl;

    float B_vol_top3 = get_right_minus(SEC.HarmonicWavePeakFactorVB,100);
    ANA.B_vol_top = B_vol_top3;
    label_B_out_of_xiebo_top_voltage->setText("B相：\n"+QString::number(B_vol_top3)+"%");
    qDebug()<<"B_vol_top3:"<<B_vol_top3<<endl;

    float C_vol_top3 = get_right_minus(SEC.HarmonicWavePeakFactorVC,100);
    ANA.C_vol_top = C_vol_top3;
    label_C_out_of_xiebo_top_voltage->setText("C相：\n"+QString::number(C_vol_top3)+"%");
    qDebug()<<"C_vol_top3:"<<C_vol_top3<<endl;

    /*电流谐波峰值因子显示*/
    float A_current_top3 = get_right_minus(SEC.HarmonicWavePeakFactorAA,100);
    ANA.A_current_top = A_current_top3;
    label_A_out_of_xiebo_top_current->setText("A相：\n"+QString::number(A_current_top3)+"%");
    qDebug()<<"A_current_top3:"<<A_current_top3<<endl;

    float B_current_top3 = get_right_minus(SEC.HarmonicWavePeakFactorAB,100);
    ANA.B_current_top = B_current_top3;
    label_B_out_of_xiebo_top_current->setText("B相：\n"+QString::number(B_current_top3)+"%");
    qDebug()<<"B_current_top3:"<<B_current_top3<<endl;

    float C_current_top3 = get_right_minus(SEC.HarmonicWavePeakFactorAC,100);
    ANA.C_current_top = C_current_top3;
    label_C_out_of_xiebo_top_current->setText("C相：\n"+QString::number(C_current_top3)+"%");
    qDebug()<<"C_current_top3:"<<C_current_top3<<endl;
}
