#include "parametersettingswidget.h"

ParameterSettingsWidget::ParameterSettingsWidget(QWidget *parent )
{

    m_PerHighFreqWidget.m_labImage.setStyleSheet("border-image:url(:/image/icon_HighFreq.png);}");
    m_PerHighFreqWidget.m_labImage.setFixedSize(QSize(30,30));
     m_PerHighFreqWidget.m_labTxt.setText("高频滤波");
    m_PerHighFreqWidget.setTextList(QStringList()<<"0.05Hz"<<"0.1Hz"<<"1Hz"<<"2Hz"<<"5Hz",
                            QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter setting" << "hospital-information");

    m_PerLowerFreqWidget.setTextList(QStringList()<<"10Hz"<<"30Hz"<<"50Hz"<<"70Hz"<<"100Hz",
                            QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter setting" << "hospital-information");
    m_PerLowerFreqWidget.m_labImage.setStyleSheet("border-image:url(:/image/icon_LowerFreq.png);}");
    m_PerLowerFreqWidget.m_labImage.setFixedSize(QSize(30,30));
    m_PerLowerFreqWidget.m_labTxt.setText("低频滤波");

    m_PerTimeConst.setTextList(QStringList()<<"0.03Hz"<<"0.1Hz"<<"0.3Hz",
                            QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" );
    m_PerTimeConst.m_labImage.setStyleSheet("border-image:url(:/image/icon_TimeConst.png);}");
    m_PerTimeConst.m_labImage.setFixedSize(QSize(30,30));
    m_PerTimeConst.m_labTxt.setText("时间常数");


    m_PerPowerFreNotch.setTextList(QStringList()<<"0.05Hz"<<"0.1Hz"<<"1Hz"<<"2Hz"<<"5Hz",
                            QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter setting" << "hospital-information");
    m_PerPowerFreNotch.m_labImage.setStyleSheet("border-image:url(:/image/icon_PowerFreNotch.png);}");
    m_PerPowerFreNotch.m_labImage.setFixedSize(QSize(30,30));
    m_PerPowerFreNotch.m_labTxt.setText("工作馅波");

    m_PerAmplitude.setTextList(QStringList()<<"1"<<"2"<<"4"<<"8"<<"16"<<"32"<<"64",
                            QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme"
                               << "Parameter setting" << "hospital-information"<<"s"<<"h");
    m_PerAmplitude.m_labImage.setStyleSheet("border-image:url(:/image/icon_Amplitude.png);}");
    m_PerAmplitude.m_labImage.setFixedSize(QSize(30,30));
    m_PerAmplitude.m_labTxt.setText("波幅");

    m_PerWavevelocity.setTextList(QStringList()<<"100"<<"500"<<"1000"<<"2500"<<"5000"<<"10000"<<"15000",
                            QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter setting" << "hospital-information"<<"ss"<<"kk");
    m_PerWavevelocity.m_labImage.setStyleSheet("border-image:url(:/image/icon_Wavevelocity.png);}");
    m_PerWavevelocity.m_labImage.setFixedSize(QSize(30,30));
    m_PerWavevelocity.m_labTxt.setText("波速");


    QHBoxLayout * hlay  = new QHBoxLayout;

   hlay->setSpacing(0);
   hlay->addWidget(&m_PerHighFreqWidget);
   hlay->addWidget(&m_PerLowerFreqWidget);
   hlay->addWidget(&m_PerTimeConst);
   hlay->addWidget(&m_PerPowerFreNotch);
   hlay->addWidget(&m_PerAmplitude);
   hlay->addWidget(&m_PerWavevelocity);


   //setContentsMargins(0,0,0,0);
   m_labSettingTxt.setStyleSheet("QLabel { font-size: 14px;\
                                    color: rgb(13,157,219); }\
");
   m_labSettingTxt.setText("参数设置");
   m_btnOK.setText("保存");
   m_btncanCel.setText("取消");
   QHBoxLayout * hlay2  = new QHBoxLayout;
    hlay2->setSpacing(0);
   hlay2->addWidget(&m_labSettingTxt);
   hlay2->addStretch();

   QHBoxLayout * hlay3 = new QHBoxLayout;
   hlay3->addStretch();
   hlay3->addWidget(&m_btncanCel);
    hlay3->addWidget(&m_btnOK);
   hlay3->addStretch();

   QVBoxLayout * vlay = new QVBoxLayout;
   vlay->addLayout(hlay2);
   vlay->addLayout(hlay);




   QWidget * w = new QWidget;



  setStyleSheet("QWidget \
    {\
        background-color:white;\
         border-radius:10px;\
     }");
   w->setLayout(vlay);
   QVBoxLayout * hlayall = new QVBoxLayout;
   hlayall->addWidget(w);
   hlayall->addLayout(hlay3);
   setLayout(hlayall);

   m_btnOK.setStyleSheet("QPushButton{\
                                   background: white;\
                                   border-radius:10px;padding:7px 10px;\
                           }\
                           QPushButton:hover{\
                                     background: #0d9ddb;\
                   border-radius:10px;padding:7px 10px;\
                           }\
                           QPushButton:pressed{\
                                     background: #0d9ddb;\
                  border-radius:10px;padding:7px 10px;\
                           }\
                           QPushButton:checked{\
                                   background: #0d9ddb;\
                    border-radius:10px;padding:7px 10px;\
                           }");
            m_btncanCel.setStyleSheet("QPushButton{\
                                       background: white;\
                                       border-radius:10px;padding:7px 10px;\
                               }\
                               QPushButton:hover{\
                                         background: #0d9ddb;\
                       border-radius:10px;padding:7px 10px;\
                               }\
                               QPushButton:pressed{\
                                         background: #0d9ddb;\
                      border-radius:10px;padding:7px 10px;\
                               }\
                               QPushButton:checked{\
                                       background: #0d9ddb;\
                        border-radius:10px;padding:7px 10px;\
                               }");

            m_btncanCel.setMinimumWidth(100);
            m_btnOK.setMinimumWidth(100);
}
ParameterSettingsWidget::~ParameterSettingsWidget()
{

}
void  ParameterSettingsWidget::init()
{

}
void  ParameterSettingsWidget::initLay()
{

}
bool  ParameterSettingsWidget::initConnect()
{

}
PerWidget::PerWidget(QWidget * parent):QWidget (parent)
{
    init();
    initLay();
}
PerWidget::~PerWidget()
{



}
void PerWidget::init()
{

}
void PerWidget::initLay()
{

    //m_NavListWidget.setList(QStringList()<<"0.05Hz"<<"0.1Hz"<<"1Hz"<<"2Hz"<<"5Hz",
    //                        QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter setting" << "hospital-information");

    m_NavListWidget.setObjectName("NavList1");
/*
                  font-size: 16px;\
                  font-weight: bold;\
*/

    m_NavListWidget.setCustomSize(QSize(30,20));

    m_NavListWidget.setStyleSheet("QPushButton{\
                  background: rgba(255, 255, 255);\
                  color: black;\
                  border-radius: 8px;\
                  border:0px ; \
          }\
          QPushButton:hover{\
                  color: black;\
                  background: rgb(255, 255, 255);\
                  border-radius: 8px;\
          }\
          QPushButton:pressed{\
                  color: black;\
                  background: rgb(255, 255, 255);\
                  border-radius: 8px;\
          }\
          QPushButton:checked{\
                  color: white;\
                  background: rgb(51, 144, 76);\
                  border-radius: 8px;\
          }"\
         "QWidget#NavList1{background-color:rgb(255, 255, 255);}"\
    );
   // m_NavListWidget.show();

//setAttribute(Qt::WA_TranslucentBackground); // 背景透明
    QHBoxLayout * hlay  = new QHBoxLayout;
    QFrame *line = new QFrame();
        line->setFrameShape(QFrame::VLine);
        //line->setFrameShadow(QFrame::Plain);

   hlay->setSpacing(0);
   hlay->addWidget(&m_NavListWidget);
   hlay->addWidget(line);



   QHBoxLayout * hlay2 = new QHBoxLayout;
   hlay2->addStretch();
   hlay2->addWidget(&m_labImage, 1,Qt::AlignRight);
   hlay2->addWidget(&m_labTxt, 1,Qt::AlignLeft);
   hlay2->addStretch();
   hlay2->setSpacing(0);


   QVBoxLayout * vlay = new QVBoxLayout;
   vlay->addLayout(hlay2);
   vlay->addLayout(hlay);
   vlay->setContentsMargins(0,0,0,0);
   setContentsMargins(0,0,0,0);
   setLayout( vlay);
}
void PerWidget::initConnect()
{

}
 void   PerWidget::setTextList(QStringList str,QStringList objNames)
 {
     m_NavListWidget.setList(str, objNames);
 }
