| | |
| | | |
| | | #include <QMessageBox> |
| | | |
| | | PmsClientSocket::PmsClientSocket(QObject * parent):QObject(parent) |
| | | PmsClientSocket::PmsClientSocket(QWidget * parent):QWidget(parent) |
| | | { |
| | | client = new QTcpSocket(this); |
| | | |
| | |
| | | res = (QueryPmsResponse *)buf.data(); |
| | | if(res->success){ |
| | | vector<PmsQueryResult> vecs; |
| | | |
| | | for(int i =0;i<100;i++){ |
| | | if(*(int *)&res->pmsList[i]){ |
| | | PmsRes structRes = res->pmsList[i]; |
| | | int pmsLen = res->head.len-sizeof(QueryPmsResponse); |
| | | for(int i =0;i<pmsLen;i+=sizeof(PmsRes)){ |
| | | PmsRes structRes = *(PmsRes*)(res + sizeof(QueryPmsResponse) + i*sizeof(PmsRes)); |
| | | PmsQueryResult res; |
| | | res.setName(string(structRes.name)); |
| | | res.setUserNo(string(structRes.userNo)); |
| | |
| | | res.setDevManage(structRes.devManage); |
| | | res.setProductPlan(structRes.productPlan); |
| | | res.setQueryHistory(structRes.queryHistory); |
| | | |
| | | res.setPermissonType(string(structRes.permissonType)); |
| | | |
| | | vecs.push_back(res); |
| | | |
| | | }else break; |
| | | } |
| | | if(!vecs.empty()){ |
| | | emit notifyDateChange(vecs); |
| | |
| | | if(res->success){ |
| | | QString dlgTitle = "鏇存柊缁撴灉"; |
| | | QString strInfo = "鏉冮檺淇℃伅鏇存柊鎴愬姛"; |
| | | // QMessageBox::information(this,dlgTitle,strInfo, |
| | | // QMessageBox::Ok, QMessageBox::NoButton); |
| | | QMessageBox::information(this,dlgTitle,strInfo, |
| | | QMessageBox::Ok, QMessageBox::NoButton); |
| | | }else{ |
| | | // QMessageBox::warning(this, "鏇存柊缁撴灉", "鏉冮檺淇℃伅鏇存柊澶辫触"); |
| | | QMessageBox::warning(this, "鏇存柊缁撴灉", "鏉冮檺淇℃伅鏇存柊澶辫触"); |
| | | } |
| | | } |
| | | } |