Commit 9070bf031de7758cd66c6b76a65839e102927fa8

Authored by yanxiaolong
1 parent 2b781d99

zcx

arm_show-build-Desktop-Debug/arm_show
No preview for this file type
arm_show-build-Desktop-Debug/mainwindow.o
No preview for this file type
arm_show/mainwindow.cpp
... ... @@ -28,7 +28,7 @@ MainWindow::MainWindow(QWidget *parent) :
28 28 configList << "gateWidth" << "gatewayId" <<"limitType" << "motorType" << "wingWall";
29 29 QTimer *timeStatus = new QTimer;
30 30 connect(timeStatus, SIGNAL(timeout()), this, SLOT(timeStatus()));
31   -// timeStatus->start(1000);
  31 + timeStatus->start(1000);
32 32  
33 33 // ui->lineEdit_2->setStyleSheet("border-image: url(:/new/image/battery.svg)");
34 34 }
... ... @@ -154,7 +154,7 @@ void MainWindow::analysisStatusMsg(QString recvDate) //解析socket server的
154 154 bool err_rpt; //声明一个json数据错误标识
155 155 QJson::Parser parser;
156 156 QVariantMap clientRecvDocDate = parser.parse(recvDate.toLocal8Bit().data(), &err_rpt).toMap();
157   - qDebug()<<clientRecvDocDate["data"];
  157 + // qDebug()<<clientRecvDocDate["data"];
158 158 QVariantMap list = clientRecvDocDate["data"].toMap();
159 159  
160 160 QJson::Serializer serializer;
... ... @@ -857,36 +857,39 @@ void MainWindow::setRssiIcon()
857 857  
858 858 if(0 < rssi <= 20)
859 859 {
860   -// ui->OnlineIcon->setStyleSheet("border-image: url(:/new/image/break.svg)");
  860 + // ui->OnlineIcon->setStyleSheet("border-image: url(:/new/image/break.svg)");
861 861 }
862 862 }
863 863  
864 864 void MainWindow::setBatteryIcon()
865 865 {
866   - /* batEnergy 0-20;
  866 + /* batEnergy 0-20;
867 867 * 20-40
868 868 * 40-60
869 869 * 60-80
870 870 *80-100
871 871 */
  872 + int bat = batEnergy;
  873 + qDebug()<<batEnergy;
  874 + qDebug()<<bat;
872 875  
873   - if(0 < batEnergy <= 20)
  876 + if(0 < bat & bat<= 20)
874 877 {
875 878 ui->BatteryIcon->setStyleSheet("border-image: url(:/new/image/battery1.svg);");
876 879 }
877   - else if(20 < batEnergy <= 40)
  880 + else if(20 < bat& bat <= 40)
878 881 {
879 882 ui->BatteryIcon->setStyleSheet("border-image: url(:/new/image/battery2.svg);");
880 883 }
881   - else if(40 < batEnergy <= 60)
  884 + else if(40 < bat & bat<= 60)
882 885 {
883 886 ui->BatteryIcon->setStyleSheet("border-image: url(:/new/image/battery3.svg);");
884 887 }
885   - else if(60 < batEnergy <= 80)
  888 + else if(60 < bat & bat<= 80)
886 889 {
887 890 ui->BatteryIcon->setStyleSheet("border-image: url(:/new/image/battery4.svg);");
888 891 }
889   - else if(80 < batEnergy <= 100)
  892 + else if(80 < bat & bat<= 100)
890 893 {
891 894 ui->BatteryIcon->setStyleSheet("border-image: url(:/new/image/battery5.svg);");
892 895 }
... ... @@ -942,8 +945,8 @@ void MainWindow::on_parmConfigBtn_index_clicked()
942 945 {
943 946 if(original_Password == fd)
944 947 {
945   - ui->stackedWidget->setCurrentWidget(ui->parm_index);
946   - setConfigDataEnable == FALSE;
  948 + ui->stackedWidget->setCurrentWidget(ui->parm_index);
  949 + setConfigDataEnable == FALSE;
947 950 }
948 951 else
949 952 {
... ... @@ -1787,7 +1790,7 @@ void MainWindow::on_saveBtn_clicked()
1787 1790 controlData.insert("data",contolDoc);
1788 1791 bool ok;
1789 1792 QByteArray json = serializer.serialize(controlData,&ok);
1790   - qDebug()<<json;
  1793 + // qDebug()<<json;
1791 1794 sendInfo(json);
1792 1795  
1793 1796 }
... ...