固井结论,选择井曲线后,追加字段和表信息判断,避免使用错误表单数据。
This commit is contained in:
parent
6de866fbee
commit
b2eb84c08e
|
|
@ -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;i<count;i++) {
|
||||
memset(m_Result,0,len);
|
||||
logio->ReadTable(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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user