From b2eb84c08e70dae5ce1b945a278a82bd5cd8073d Mon Sep 17 00:00:00 2001 From: jiayulong Date: Tue, 12 May 2026 14:39:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BA=E4=BA=95=E7=BB=93=E8=AE=BA=EF=BC=8C?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=BA=95=E6=9B=B2=E7=BA=BF=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E5=AD=97=E6=AE=B5=E5=92=8C=E8=A1=A8=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=88=A4=E6=96=AD=EF=BC=8C=E9=81=BF=E5=85=8D=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E9=94=99=E8=AF=AF=E8=A1=A8=E5=8D=95=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logPlus/qmycustomplot.cpp | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) 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; }