• 4957阅读
  • 2回复

[提问]我這樣學的是不是很慢? [复制链接]

上一主题 下一主题
离线harold00124
 

只看楼主 倒序阅读 楼主  发表于: 2016-12-05
— 本帖被 XChinux 从 休闲娱乐 移动到本区(2016-12-23) —
小弟之前其实从事的是业务销售

学生的时候因为是读工科所以有接触过编程,也对编程有些兴趣

只是后来一直没继续坚持发展下去

直到实在没办法习惯业务销售的生态决定转业

现在刚到一家公司从业,老板要培训我学习QT为公司设计UI
对我来说实在压力山大,因为我同时要学会QT又要学会C++
而且重点是整个公司只有我会QT 老板也不会 所以我每天都是抱著书本在公司边做边想边查资料 无人可问
编程对于已经脱离学生时代有5年的我来说基本上就是从0开始学习

然后老板之前都会出个题目让我1个星期交作业给他 我都勉强交卷成功
而这次出的作业虽然时间有2个星期但是做到让我整个人对自己都没啥信心了 已經做超過2个星期了....
因为几乎都是每步必卡 步步维艰...

老板说我这样做的速度实在太慢(顺便酸我还自称在学还是资优生) 要我多加油点 但我已经尽力了 我对自己的编程状况也很不满意

进入公司已经有1个多月了 但是还是觉得自己学的速度有夠渣
顺便附上我现在做的作业给大家观赏我做的有多烂

window.open('http://www.qtcn.org/bbs/attachment/Mon_1612/24_176460_b39bac377437fd4.jpg?392');" style="max-width:700px;max-height:700px;" onload="if(is_ie6&&this.offsetWidth>700)this.width=700;" >




  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include <QMainWindow>
  4. #include <QString>
  5. #include <ctype.h>
  6. #define Gain_Dsp                0x0001
  7. #define Level_Dsp               0x0002
  8. #define Aux_Send_Dsp            0x0003
  9. #define Rev_Send_Dsp            0x0004
  10. #define Pan_Dsp                 0x0005
  11. #define Eq_Hi_Dsp               0x0006
  12. #define Eq_Hi_Freq_Dsp          0x0007
  13. #define Eq_Mid_Dsp              0x0008
  14. #define Eq_Mid_Freq_Dsp         0x0009
  15. #define Eq_Mid_Q_Dsp            0x000A
  16. #define Eq_Lo_Dsp               0x000B
  17. #define Eq_Lo_Freq_Dsp          0x000C
  18. #define Gate_Dsp                0x000D
  19. #define Gate_Threshold_Dsp      0x000E
  20. #define Gate_Release_Dsp        0x000F
  21. #define Comp_Dsp                0x0010
  22. #define Comp_Threshold_Dsp      0x0011
  23. #define Comp_Ratio_Dsp          0x0012
  24. #define Comp_Attack_Dsp         0x0013
  25. #define Comp_Release_Dsp        0x0014
  26. #define Delay_Dsp               0x0015
  27. #define Aux_Delay_Dsp           0x0016
  28. #define Solo_Dsp                0x0017
  29. #define Mute_Dsp                0x0018
  30. namespace Ui {
  31. class MainWindow;
  32. }
  33. class MainWindow : public QMainWindow
  34. {
  35.     Q_OBJECT
  36. public:
  37.     explicit MainWindow(QWidget *parent = 0);
  38.     ~MainWindow();
  39. public slots:
  40.     void TimeDeary();
  41.     void Rxreaddate();//接收解碼
  42.     void RxDatatoWiget(int Value);
  43.     void WidthRead(int DspAddress);//發送讀取請求
  44.     void WriteWidth(int DspAddress,int value);//發送寫入
  45.     
  46. /* double到整数的转换超强的算法,无误差 (利用了IEEE浮点编码格式) ,比使用C语言 int a = (int)(浮点数)快很多*/
  47.     static inline int DoubleToInt_IEEE(double value)
  48.      {
  49.       static const double magic = 6755399441055744.0;  // (1<<51) | (1<<52)
  50.       double tmp = value + magic;
  51.       return *(int*)&tmp;
  52.      }
  53.     //16进制字符串转字节数组
  54.     static QByteArray HexStrToByteArray(QString str)
  55.     {
  56.         QByteArray senddata;
  57.         int hexdata,lowhexdata;
  58.         int hexdatalen = 0;
  59.         int len = str.length();
  60.         senddata.resize(len/2);
  61.         char lstr,hstr;
  62.         for(int i=0; i<len; )
  63.         {
  64.             hstr=str[i].toLatin1();
  65.             if(hstr == ' ')
  66.             {
  67.                 i++;
  68.                 continue;
  69.             }
  70.             i++;
  71.             if(i >= len)
  72.                 break;
  73.             lstr = str[i].toLatin1();
  74.             hexdata = ConvertHexChar(hstr);
  75.             lowhexdata = ConvertHexChar(lstr);
  76.             if((hexdata == 16) || (lowhexdata == 16))
  77.                 break;
  78.             else
  79.                 hexdata = hexdata*16+lowhexdata;
  80.             i++;
  81.             senddata[hexdatalen] = (char)hexdata;
  82.             hexdatalen++;
  83.         }
  84.         senddata.resize(hexdatalen);
  85.         return senddata;
  86.     }
  87.     static char ConvertHexChar(char ch)
  88.     {
  89.         if((ch >= '0') && (ch <= '9'))
  90.             return ch-0x30;
  91.         else if((ch >= 'A') && (ch <= 'F'))
  92.             return ch-'A'+10;
  93.         else if((ch >= 'a') && (ch <= 'f'))
  94.             return ch-'a'+10;
  95.         else return (-1);
  96.     }
  97. private slots:
  98.     void on_Gain_spinBox_valueChanged(int arg1);
  99.     void on_Level_spinBox_valueChanged(int arg1);
  100.     void on_Aux_Send_spinBox_valueChanged(int arg1);
  101.     void on_Rev_Send_spinBox_valueChanged(int arg1);
  102.     void on_Pan_comboBox_currentIndexChanged(int index);
  103.     void on_Eq_Hi_spinBox_valueChanged(int arg1);
  104.     void on_Eq_Mid_spinBox_valueChanged(int arg1);
  105.     void on_Eq_Lo_spinBox_valueChanged(int arg1);
  106.     void on_Gate_comboBox_currentIndexChanged(int index);
  107.     void on_Comp_comboBox_currentIndexChanged(int index);
  108.     void on_Delay_doubleSpinBox_valueChanged(double arg1);
  109.     void on_Aux_Delay_doubleSpinBox_valueChanged(double arg1);
  110.     void on_Eq_Hi_Freq_combBox_currentIndexChanged(int index);
  111.     void on_Eq_Mid_Freq_comboBox_currentIndexChanged(int index);
  112.     void on_Eq_Mid_Q_comboBox_currentIndexChanged(int index);
  113.     void on_Eq_Lo_Freq_comboBox_currentIndexChanged(int index);
  114.     void on_Gate_Threshold_spinBox_valueChanged(int arg1);
  115.     void on_Gate_Reslease_spinBox_valueChanged(int arg1);
  116.     void on_Comp_Threshold_spinBox_valueChanged(int arg1);
  117.     void on_Comp_Ratio_comboBox_currentIndexChanged(int index);
  118.     void on_Comp_Attack_comboBox_currentIndexChanged(int index);
  119.     void on_Comp_Reslease_spinBox_valueChanged(int arg1);
  120.     void on_Delay_dial_valueChanged(int value);
  121.     void on_Aux_Delay_dial_valueChanged(int value);
  122. private:
  123.     Ui::MainWindow *ui;
  124. };
  125. #endif // MAINWINDOW_H

  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3. #include <QtSerialPort/QSerialPort>
  4. #include <QSerialPortInfo>
  5. #include <QDebug>
  6. #include <QString>
  7. #include <QTimer>
  8. QByteArray Rx;
  9. QSerialPort *Txserialport;
  10. QSerialPort *Rxserialport;
  11. QTimer *runTime=new QTimer();
  12. int DspPoint=0;
  13. int DataValue[24]={0};
  14. int DataPoint=0;
  15. int Product = 0x3F;
  16. int Link_No = 0x1F;
  17. int Write_Read =0x1;
  18. int DSP_ID =0xF;
  19. int Length =0xF;
  20. int Pack_ON =0x7F;
  21. int Dsp[]={
  22.     Gain_Dsp,           //00
  23.     Level_Dsp,          //01
  24.     Aux_Send_Dsp,       //02
  25.     Rev_Send_Dsp,       //03
  26.     Pan_Dsp,            //04
  27.     Eq_Hi_Dsp,          //05
  28.     Eq_Hi_Freq_Dsp,     //06
  29.     Eq_Mid_Dsp,         //07
  30.     Eq_Mid_Freq_Dsp,    //08
  31.     Eq_Mid_Q_Dsp,       //09
  32.     Eq_Lo_Dsp,          //10
  33.     Eq_Lo_Freq_Dsp,     //11
  34.     Gate_Dsp,           //12
  35.     Gate_Threshold_Dsp, //13
  36.     Gate_Release_Dsp,   //14
  37.     Comp_Dsp,           //15
  38.     Comp_Threshold_Dsp, //16
  39.     Comp_Ratio_Dsp,     //17
  40.     Comp_Attack_Dsp,    //18
  41.     Comp_Release_Dsp,   //19
  42.     Delay_Dsp,          //20
  43.     Aux_Delay_Dsp,      //21
  44.     Solo_Dsp,           //22
  45.     Mute_Dsp,           //23
  46. };
  47. MainWindow::MainWindow(QWidget *parent) :
  48.     QMainWindow(parent),
  49.     ui(new Ui::MainWindow)
  50. {
  51.     ui->setupUi(this);
  52.     Rxserialport=new QSerialPort(this);//讀取串口設置
  53.     Txserialport=new QSerialPort(this);//傳送串口設置
  54.     Rxserialport->setPortName("COM4");//接收串口名稱
  55.     Txserialport->setPortName("COM5");//讀取串口名稱
  56.     //傳輸環境設置
  57.     Rxserialport->open(QIODevice::ReadOnly);//唯獨
  58.     Txserialport->open(QIODevice::WriteOnly);//唯寫
  59.     Rxserialport->setBaudRate(QSerialPort::Baud115200);
  60.     Txserialport->setBaudRate(QSerialPort::Baud115200);
  61.     Rxserialport->setDataBits(QSerialPort::Data8);
  62.     Txserialport->setDataBits(QSerialPort::Data8);
  63.     Rxserialport->setParity(QSerialPort::SpaceParity);
  64.     Txserialport->setParity(QSerialPort::SpaceParity);
  65.     Rxserialport->setStopBits(QSerialPort::OneStop);
  66.     Txserialport->setStopBits(QSerialPort::OneStop);
  67.     runTime->start(2000);//定時器時脈 ms
  68.     //定時器連結槽
  69.     connect(runTime,SIGNAL(timeout()),this,SLOT(TimeDeary()));
  70.     //RX信號槽 只要RX收到信號就立即跳到RxReaddate副程式
  71.     connect(Rxserialport,SIGNAL(readyRead()),
  72.             this,SLOT(Rxreaddate()));
  73.     //控件發送信號槽 每當控件數值出現變化就發送值到對應的函式
  74.     connect(ui->Gain_spinBox,SIGNAL(valueChanged(int)),
  75.             this,SLOT(Gainwrite()));
  76.     ui->Eq_Hi_frame->setVisible(false);
  77.     ui->Eq_Mid_frame->setVisible(false);
  78.     ui->Eq_Lo_frame->setVisible(false);
  79.     ui->Comp_frame->setVisible(false);
  80.     ui->Gate_frame->setVisible(false);
  81. //setVisible(true)
  82. }
  83. MainWindow::~MainWindow()
  84. {
  85.     delete ui;
  86.     Rxserialport->close();
  87.     Txserialport->close();
  88. }
  89. void MainWindow::TimeDeary()//定時器
  90. {
  91.        WidthRead(Dsp[DspPoint]);
  92.        DspPoint+=1;
  93.        if(DspPoint>23)
  94.        {
  95.            DspPoint=0;
  96.        }
  97. }
  98. void MainWindow::WriteWidth(int DspAddress,int value)//將UI的值編碼後發射寫入硬體
  99. {
  100.     int DsPP[4];
  101.     DsPP[0]=(DspAddress&0xF000)>>12;//Dsp位址位元初始化
  102.     DsPP[1]=(DspAddress&0x0F00)>>8;
  103.     DsPP[2]=(DspAddress&0x00F0)>>4;
  104.     DsPP[3]= DspAddress&0x000F;
  105.     int Val[4];
  106.     Val[0]=(value&0xF000)>>12;//值位元初始化
  107.     Val[1]=(value&0x0F00)>>8;
  108.     Val[2]=(value&0x00F0)>>4;
  109.     Val[3]= value&0x000F;
  110.     int Ex1;
  111.     int Ex2;
  112.     int Ex3;
  113.     QString Strcode[8];
  114.     int WidthCode[8];
  115.     qDebug()<<"DspAddress:"<<DspAddress;
  116.     qDebug()<<"Value:"<<value;
  117.     //編碼程序
  118.     Ex1=Product<<2;
  119.     Ex2=Link_No>>3;
  120.     WidthCode[0]=(Ex1|Ex2)&0xFE;
  121.     qDebug()<<"Byte1:"<<WidthCode[0];
  122.     Ex1=(Link_No&0xF)<<4;
  123.     Ex2=Write_Read<<3;
  124.     Ex3=DSP_ID>>2;
  125.     WidthCode[1]=(Ex1|Ex2|Ex3)&0xFE;
  126.     qDebug()<<"Byte2:"<<WidthCode[1];
  127.     Ex1=(DSP_ID&0x7)<<5;
  128.     Ex2=DsPP[0]<<1;
  129.     WidthCode[2]=(Ex1|Ex2)&0xFE;      //E0
  130.     qDebug()<<"Byte3:"<<WidthCode[2];
  131.     Ex1=DsPP[1]<<4;
  132.     Ex2=DsPP[2];
  133.     WidthCode[3]=(Ex1|Ex2)&0xFE;        //0
  134.     qDebug()<<"Byte4:"<<WidthCode[3];
  135.     Ex1=(DsPP[2]&0x01)<<7;
  136.     Ex2=DsPP[3]<<3;
  137.     Ex3=Val[0]>>1;
  138.     WidthCode[4]=(Ex1|Ex2|Ex3)&0xFE;    //e
  139.     qDebug()<<"Byte5:"<<WidthCode[4];
  140.     Ex1=(Val[0]&0x3)<<6;
  141.     Ex2=Val[1]<<2;
  142.     Ex3=Val[2]>>2;
  143.     WidthCode[5]=(Ex1|Ex2|Ex3)&0xFE;
  144.     qDebug()<<"Byte6:"<<WidthCode[5];
  145.     Ex1=(Val[2]&0x07)<<5;
  146.     Ex2=Val[3]<<1;
  147.     WidthCode[6]=(Ex1|Ex2)&0xFE;
  148.     qDebug()<<"Byte7:"<<WidthCode[6];
  149.     WidthCode[7]=(WidthCode[0]^WidthCode[1]^WidthCode[2]^WidthCode[3]^WidthCode[4]^WidthCode[5]^WidthCode[6]) | 0x01;
  150.     qDebug()<<"Byte8:"<<WidthCode[7];
  151.     for(int i=0;i<8;i++)
  152.     {
  153.         Strcode[i]=QString::number(WidthCode[i],16);
  154.         if((WidthCode[i]&0xF0)==0){
  155.             Strcode[i]="0"+Strcode[i];
  156.         }
  157.         qDebug()<<"Strcode:"<<i<<Strcode[i];
  158.         Txserialport->write(HexStrToByteArray(Strcode[i]));
  159.     }
  160. }
  161. void MainWindow::WidthRead(int DspAddress)//發送讀取請求
  162. {
  163.     int DsPP[4];
  164.     DsPP[0]=(DspAddress&0xF000)>>12;
  165.     DsPP[1]=(DspAddress&0x0F00)>>8;
  166.     DsPP[2]=(DspAddress&0x00F0)>>4;
  167.     DsPP[3]=DspAddress&0x000F;
  168.     int Ex1;
  169.     int Ex2;
  170.     int Ex3;
  171.     QString Strcode[8];
  172.     int WidthCode[8];
  173.     qDebug()<<"DspAddress:"<<DspAddress;
  174.     Ex1=Product<<2;
  175.     Ex2=Link_No>>3;
  176.     WidthCode[0]=(Ex1|Ex2)&0xFE;      //FE
  177.     qDebug()<<"Byte1:"<<WidthCode[0];
  178.     Ex1=(Link_No&0xF)<<4;
  179.     Ex2=Write_Read<<3;
  180.     Ex3=DSP_ID>>2;
  181.     WidthCode[1]=(Ex1|Ex2|Ex3)&0xFE;  //FA
  182.     qDebug()<<"Byte2:"<<WidthCode[1];
  183.     Ex1=(DSP_ID&0x7)<<5;
  184.     Ex2=DsPP[0]<<1;
  185.     WidthCode[2]=(Ex1|Ex2)&0xFE;      //E0
  186.     qDebug()<<"Byte3:"<<WidthCode[2];
  187.     Ex1=DsPP[1]<<4;
  188.     Ex2=DsPP[2];
  189.     WidthCode[3]=(Ex1|Ex2)&0xFE;        //0
  190.     qDebug()<<"Byte4:"<<WidthCode[3];
  191.     Ex1=(DsPP[2]&0x01)<<7;
  192.     Ex2=DsPP[3]<<3;
  193.     Ex3=Length>>1;
  194.     WidthCode[4]=(Ex1|Ex2|Ex3)&0xFE;    //e
  195.     qDebug()<<"Byte5:"<<WidthCode[4];
  196.     Ex1=(Length&0x03)<<6;
  197.     WidthCode[5]=Ex1&0xFE;              //c0
  198.     qDebug()<<"Byte6:"<<WidthCode[5];
  199.     Ex1=Pack_ON<<1;
  200.     WidthCode[6]=Ex1&0xFE;              //Fe
  201.     qDebug()<<"Byte7:"<<WidthCode[6];
  202.     WidthCode[7]=(WidthCode[0]^WidthCode[1]^WidthCode[2]^WidthCode[3]^WidthCode[4]^WidthCode[5]^WidthCode[6]) | 0x01;
  203.     qDebug()<<"Byte8:"<<WidthCode[7];
  204.     for(int i=0;i<8;i++)
  205.     {
  206.         Strcode[i]=QString::number(WidthCode[i],16);
  207.         if((WidthCode[i]&0xF0)==0){
  208.             Strcode[i]="0"+Strcode[i];
  209.         }
  210.         qDebug()<<"Strcode:"<<i<<Strcode[i];
  211.         Txserialport->write(HexStrToByteArray(Strcode[i]));
  212.     }
  213. }
  214. void MainWindow::Rxreaddate()//解码將值與發送編號取出並呼叫副程式
  215. {
  216.     bool ok;
  217.     int Read_Data[4];
  218.     QString Strcode[256];
  219.     int Rxlength=0;
  220.     //if(Rx.isEmpty())
  221.     //{
  222.     Rx=Rxserialport->readAll();
  223.     Rxlength=Rx.length();
  224.    // }
  225.    // else if(Rx.length()<5&&Rx.length()>0){
  226.    //     Rx+=Rxserialport->readAll();
  227.     //    Rxlength=Rx.length();
  228.    // }
  229.   //  else if(Rx.length()>5){
  230.     //    runTime->stop();
  231.    // }
  232.     for(int i=0;i<Rxlength;i++)
  233.     {
  234.         Strcode[i]=Rx.mid(0+i,1).toHex();
  235.         qDebug()<<"Strcode"<<i<<":"<<Strcode[i];
  236.     }
  237.     //int Read_Pack_No=Strcode[0].toInt(&ok,16)>>1;
  238.     int Read_CRC=Strcode[4].toInt(&ok,16);
  239.     qDebug()<<"Read_CRC"<<Read_CRC;
  240.     Read_Data[0]=Strcode[1].toInt(&ok,16)>>4;
  241.     Read_Data[1]=(Strcode[1].toInt(&ok,16)&0xF)|(Strcode[2].toInt(&ok,16)>>7);
  242.     Read_Data[2]=(Strcode[2].toInt(&ok,16)&0x7F)>>3;
  243.     Read_Data[3]=((Strcode[2].toInt(&ok,16)&0x6)<<1)|(Strcode[3].toInt(&ok,16)>>6);
  244.     int tex_CRC=(Strcode[0].toInt(&ok,16)^Strcode[1].toInt(&ok,16)^Strcode[2].toInt(&ok,16)^Strcode[3].toInt(&ok,16))|0x01;
  245.     qDebug()<<"Tex_CRC"<<tex_CRC;
  246.     if(Read_CRC==tex_CRC)//比對CRC 正確才將值解碼
  247.     {
  248.     int Value=(Read_Data[0]<<12)|
  249.               (Read_Data[1]<<8)|
  250.               (Read_Data[2]<<4)|
  251.               (Read_Data[3]);
  252.     qDebug()<<"RX"<<Rx;
  253.     qDebug()<<Value;
  254.     RxDatatoWiget(Value);
  255.     }
  256. }
  257. void MainWindow::RxDatatoWiget(int Value)//獲得的值放入控件內
  258. {
  259.     qDebug()<<"DataValue:"<<DataValue[DataPoint];
  260.     qDebug()<<"DataPoint:"<<DataPoint;
  261.     DataValue[DataPoint]=Value;
  262.     ui->Gain_spinBox->setValue(DataValue[0]);
  263.     ui->Level_spinBox->setValue(DataValue[1]);
  264.     ui->Aux_Send_spinBox->setValue(DataValue[2]);
  265.     ui->Rev_Send_spinBox->setValue(DataValue[3]);
  266.     ui->Pan_comboBox->setCurrentIndex(DataValue[4]);
  267.     ui->Eq_Hi_spinBox->setValue(DataValue[5]);
  268.     ui->Eq_Hi_Freq_combBox->setCurrentIndex(DataValue[6]);
  269.     ui->Eq_Mid_spinBox->setValue(DataValue[7]);
  270.     ui->Eq_Mid_Freq_comboBox->setCurrentIndex(DataValue[8]);
  271.     ui->Eq_Mid_Q_comboBox->setCurrentIndex(DataValue[9]);
  272.     ui->Eq_Lo_spinBox->setValue(DataValue[10]);
  273.     ui->Eq_Lo_Freq_comboBox->setCurrentIndex(DataValue[11]);
  274.     ui->Gate_comboBox->setCurrentIndex(DataValue[12]);
  275.     ui->Gate_Threshold_spinBox->setValue(DataValue[13]);
  276.     ui->Gate_Reslease_spinBox->setValue(DataValue[14]);
  277.     ui->Comp_comboBox->setCurrentIndex(DataValue[15]);
  278.     ui->Comp_Threshold_spinBox->setValue(DataValue[16]);
  279.     ui->Comp_Ratio_comboBox->setCurrentIndex(DataValue[17]);
  280.     ui->Comp_Attack_comboBox->setCurrentIndex(DataValue[18]);
  281.     ui->Comp_Reslease_spinBox->setValue(DataValue[19]);
  282.     ui->Delay_doubleSpinBox->setValue(DataValue[20]);
  283.     ui->Aux_Delay_doubleSpinBox->setValue(DataValue[21]);
  284.     //ui->Solo_pushButton
  285.     //ui->Mute_pushButton
  286.     DataPoint+=1;
  287.     if(DataPoint>23)
  288.     {
  289.         DataPoint=0;
  290.     }
  291. }
  292. //控件區 每當數值出現變化 就立即呼叫程式寫入硬體
  293. void MainWindow::on_Gain_spinBox_valueChanged(int arg1)
  294. {
  295.     WriteWidth(Gain_Dsp,ui->Gain_spinBox->value());
  296. }
  297. void MainWindow::on_Level_spinBox_valueChanged(int arg1)
  298. {
  299.     WriteWidth(Level_Dsp,ui->Level_spinBox->value());
  300. }
  301. void MainWindow::on_Aux_Send_spinBox_valueChanged(int arg1)
  302. {
  303.     WriteWidth(Aux_Send_Dsp,ui->Aux_Send_spinBox->value());
  304. }
  305. void MainWindow::on_Rev_Send_spinBox_valueChanged(int arg1)
  306. {
  307.     WriteWidth(Rev_Send_Dsp,ui->Rev_Send_spinBox->value());
  308. }
  309. void MainWindow::on_Pan_comboBox_currentIndexChanged(int index)
  310. {
  311.     WriteWidth(Pan_Dsp,ui->Pan_comboBox->currentIndex());
  312. }
  313. void MainWindow::on_Eq_Hi_spinBox_valueChanged(int arg1)
  314. {
  315.     WriteWidth(Eq_Hi_Dsp,ui->Eq_Hi_spinBox->value());
  316. }
  317. void MainWindow::on_Eq_Hi_Freq_combBox_currentIndexChanged(int index)
  318. {
  319.     WriteWidth(Eq_Hi_Freq_Dsp,ui->Eq_Hi_Freq_combBox->currentIndex());
  320. }
  321. void MainWindow::on_Eq_Mid_spinBox_valueChanged(int arg1)
  322. {
  323.     WriteWidth(Eq_Mid_Dsp,ui->Eq_Mid_spinBox->value());
  324. }
  325. void MainWindow::on_Eq_Mid_Freq_comboBox_currentIndexChanged(int index)
  326. {
  327.     WriteWidth(Eq_Mid_Freq_Dsp,ui->Eq_Mid_Freq_comboBox->currentIndex());
  328. }
  329. void MainWindow::on_Eq_Mid_Q_comboBox_currentIndexChanged(int index)
  330. {
  331.     WriteWidth(Eq_Mid_Q_Dsp,ui->Eq_Mid_Q_comboBox->currentIndex());
  332. }
  333. void MainWindow::on_Eq_Lo_spinBox_valueChanged(int arg1)
  334. {
  335.     WriteWidth(Eq_Lo_Dsp,ui->Eq_Lo_spinBox->value());
  336. }
  337. void MainWindow::on_Eq_Lo_Freq_comboBox_currentIndexChanged(int index)
  338. {
  339.     WriteWidth(Eq_Lo_Freq_Dsp,ui->Eq_Lo_Freq_comboBox->currentIndex());
  340. }
  341. void MainWindow::on_Gate_comboBox_currentIndexChanged(int index)
  342. {
  343.     WriteWidth(Gate_Dsp,ui->Gate_comboBox->currentIndex());
  344. }
  345. void MainWindow::on_Gate_Threshold_spinBox_valueChanged(int arg1)
  346. {
  347.     WriteWidth(Gate_Threshold_Dsp,ui->Gate_Threshold_spinBox->value());
  348. }
  349. void MainWindow::on_Gate_Reslease_spinBox_valueChanged(int arg1)
  350. {
  351.     WriteWidth(Gate_Release_Dsp,ui->Gate_Reslease_spinBox->value());
  352. }
  353. void MainWindow::on_Comp_comboBox_currentIndexChanged(int index)
  354. {
  355.     WriteWidth(Comp_Dsp,ui->Comp_comboBox->currentIndex());
  356. }
  357. void MainWindow::on_Comp_Threshold_spinBox_valueChanged(int arg1)
  358. {
  359.     WriteWidth(Comp_Threshold_Dsp,ui->Comp_Threshold_spinBox->value());
  360. }
  361. void MainWindow::on_Comp_Ratio_comboBox_currentIndexChanged(int index)
  362. {
  363.     WriteWidth(Comp_Ratio_Dsp,ui->Comp_Ratio_comboBox->currentIndex());
  364. }
  365. void MainWindow::on_Comp_Attack_comboBox_currentIndexChanged(int index)
  366. {
  367.     WriteWidth(Comp_Attack_Dsp,ui->Comp_Attack_comboBox->currentIndex());
  368. }
  369. void MainWindow::on_Comp_Reslease_spinBox_valueChanged(int arg1)
  370. {
  371.     WriteWidth(Comp_Release_Dsp,ui->Comp_Reslease_spinBox->value());
  372. }
  373. void MainWindow::on_Delay_doubleSpinBox_valueChanged(double arg1)
  374. {
  375.     int value=arg1;
  376.     ui->Delay_dial->setValue(value);
  377.     WriteWidth(Delay_Dsp,DoubleToInt_IEEE(arg1));
  378. }
  379. void MainWindow::on_Delay_dial_valueChanged(int value)
  380. {
  381.    double Ex=value;
  382.     ui->Delay_doubleSpinBox->setValue(Ex);
  383. }
  384. void MainWindow::on_Aux_Delay_doubleSpinBox_valueChanged(double arg1)
  385. {
  386.     int value=arg1;
  387.     ui->Aux_Delay_dial->setValue(value);
  388.     WriteWidth(Aux_Delay_Dsp,DoubleToInt_IEEE(arg1));
  389. }
  390. void MainWindow::on_Aux_Delay_dial_valueChanged(int value)
  391. {
  392.      double Ex=value;
  393.      ui->Aux_Delay_doubleSpinBox->setValue(Ex);
  394. }














离线uidab

只看该作者 1楼 发表于: 2016-12-05
有句老话叫不怕慢,就怕站。一切学习都是循序渐进的。
有时候为了工作直接获得答案,而我却失去了思考的乐趣!


飘啊飘,何时能安居!
离线cycloveu

只看该作者 2楼 发表于: 2016-12-05
学习3年后你才能从迷雾中走出来
大道至简 悟在天成
快速回复
限100 字节
 
上一个 下一个