Пример #1
0
void WBSDErrorWindow::gotErrorCountMsg(ErrorMessage aMsg){
	myTimer->stop();
	err_query_number=0;
    if (aMsg.getType()==Message::REPLY_ERR_COUNT_ACT){
        err_act=aMsg.getDataInt(0,false,2);
        err_messages_act.clear();
		if (err_act==0){
			clearActiveErrors();
			myTimer->start();
			this->setCursor(Qt::ArrowCursor);
		} else {
			qDebug() << "Get Active Error 0 total "<< err_act;
			itsBaseWindow->addMessageToQue(ErrorMessage(Message::ERR_ACTIVE,0));
		}
        //itsBaseWindow->addMessageToQue(ErrorMessage(Message::ERR_TOTAL_ERRORS_IN_LOG,0));
        return;
    }
    if (aMsg.getType()==Message::REPLY_ERR_COUNT_HIST){
        err_total=aMsg.getDataInt(0,false,2);
        ui->progressBar->setMaximum(err_total);
        if(err_total>0){
            err_messages_hist.clear();
			qDebug() << "Get Historocal Error 0 total " << err_total;
            itsBaseWindow->addMessageToQue(ErrorMessage(Message::ERR_HISTORIC,0));
            return;
		} else {
			myTimer->start();
			this->setCursor(Qt::ArrowCursor);
		}
	}
}
Пример #2
0
void WBSDErrorWindow::gotErrorMsg(ErrorMessage aMsg){
    if (aMsg.getType()==Message::REPLY_ERR_ACT){
        err_messages_act.append(aMsg);
        if (err_messages_act.count()<err_act){
			qDebug() << "Get Active Error " << err_query_number+1;
            itsBaseWindow->addMessageToQue(ErrorMessage(Message::ERR_ACTIVE,++err_query_number));
            return;
        } else {
            clearActiveErrors();
            for (int i=0;i<err_messages_act.count();i++){
                ErrorMessage e=err_messages_act.at(i);
                updateActiveErrors(e.toString());
            }
			myTimer->start();
			this->setCursor(Qt::ArrowCursor);
           // ui->btnSaveErrors->setEnabled(true);
        }
        return;
    }
    if (aMsg.getType()==Message::REPLY_ERR_HIST){
        err_messages_hist.append(aMsg);
        ui->progressBar->setValue(err_messages_hist.count());
        if (err_messages_hist.count()<err_total){
			qDebug() << "Get historic Error " << err_query_number+1;
            itsBaseWindow->addMessageToQue(ErrorMessage(Message::ERR_HISTORIC,++err_query_number));
            return;
        }
        else
        {
            clearHistoryErrors();
            QString aStr="";
            for (int i=0;i<err_messages_hist.count();i++){
                ErrorMessage e=err_messages_hist.at(err_messages_hist.count()-i-1);
                if(e.toString().endsWith("[200:ALM_RESTART]"))
                {
                    continue;
                }
                if (aStr!=e.toString()) {
                    updateHistoryErrors(e.toString());
                    aStr=e.toString();
                }
            }
			err_total=0;
			myTimer->start();
			this->setCursor(Qt::ArrowCursor);
			ui->btnSaveErrors->setEnabled(true);
        }
    }
}