diff --git a/logPlus/qmycustomplot.cpp b/logPlus/qmycustomplot.cpp index 2cbe636..fc7ebfd 100644 --- a/logPlus/qmycustomplot.cpp +++ b/logPlus/qmycustomplot.cpp @@ -4971,6 +4971,7 @@ void QMyCustomPlot::RefreshItems_Gujing() it++; pDraggableRect->deleteRect(); } + //replot(); //只支持以下名称 //if (m_strLineName == "GUJING1_RESULT" || m_strLineName == "GUJING2_RESULT" || m_strLineName == "GUJING3_RESULT") @@ -5069,6 +5070,8 @@ bool QMyCustomPlot::LoadFromSLF_Gujing(QString strSlfName, QString strLineName) if(!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead)) { delete logio; + //刷新 + replot(); // QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes); return false; } @@ -5095,12 +5098,43 @@ bool QMyCustomPlot::LoadFromSLF_Gujing(QString strSlfName, QString strLineName) int iIndex=logio->OpenTable(strLineName.toStdString().c_str()); if(iIndex>-1) { + //------------------------------------// + //判断 + int countField=logio->GetTableFieldCount(iIndex); + if(countField<4) { + //刷新 + replot(); + // + QMessageBox::warning(nullptr, "提示", "字段不匹配或非数据表格式数据!"); + delete logio; + return false; + } + Slf_TABLE_FIELD *pField=new Slf_TABLE_FIELD[countField+1]; + logio->GetTableFieldInfo(iIndex,pField); + if( + pField[1].RepCode!=REPR_FLOAT|| + pField[2].RepCode!=REPR_FLOAT|| + pField[3].RepCode!=REPR_INT) + { + //刷新 + replot(); + // + QMessageBox::warning(nullptr, "提示", "非规定数据表,无法使用!,\r\n请选择具有\"NO(INT),SDEP(FLOAT),EDEP(FLOAT),RESULT(INT)\"格式数据,"); + delete logio; + delete pField; + return false; + } + delete pField; + //------------------------------------// + + // int len=logio->GetTableRecordLength(iIndex); int sl=sizeof(GUJING_DATA); if(sl>len) len=sl; GUJING_DATA *m_Result; m_Result=(GUJING_DATA *)new char[len+1]; int count=logio->GetTableRecordCount(iIndex); + for(int i=0;iReadTable(iIndex,i+1,m_Result); @@ -5142,6 +5176,13 @@ bool QMyCustomPlot::LoadFromSLF_Gujing(QString strSlfName, QString strLineName) logio->CloseTable(iIndex); delete m_Result; } + else + { + //刷新 + replot(); + // + QMessageBox::warning(nullptr, "提示", strLineName+"数据表不存在!"); + } delete logio; return true; }