#include "ObjTextResult.h" #include "MemRdWt.h" #include "geometryutils.h" //气测/FMT/射孔/文本 CObjTextResult::CObjTextResult() { } CObjTextResult::~CObjTextResult() { }; bool CObjTextResult::LoadFromSLF(QMyCustomPlot *widget, QString strSlfName, QString csCurve) { Slf_TxtPOS *m_pResult=NULL; CMemRdWt *logio=new CMemRdWt(); if(strSlfName==""||!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead)) { delete logio; // QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes); return false; } int iIndex=logio->OpenTable(csCurve.toStdString().c_str()); if(iIndex>-1) { int count = logio->GetTableRecordCount(iIndex); int fieldnum = logio->GetTableFieldCount(iIndex); int len = logio->GetTableRecordLength(iIndex); Slf_TABLE_FIELD *pField=new Slf_TABLE_FIELD[fieldnum+1]; logio->GetTableFieldInfo(iIndex,pField); m_FieldNameList.clear(); m_FieldUnitList.clear(); m_FieldHZNameList.clear(); m_FieldHZUnitList.clear(); // for(int i=0;iGetTableFieldData(iIndex,0,buf,i+1); m_pResult->Order=atof(buf); logio->GetTableFieldData(iIndex,1,buf,i+1); m_pResult->Depth=atof(buf); logio->GetTableFieldData(iIndex,2,buf,i+1); m_pResult->CorrDepth=atof(buf); double top=m_pResult->Depth; double bottom=m_pResult->Depth; if(m_FieldNameList.size()>2&& (m_FieldNameList[2].indexOf("EDEP")>-1 || m_FieldNameList[2].indexOf("ENDEP")>-1) ) { bottom=m_pResult->CorrDepth; } CoreValues.clear(); ValueTypes.clear(); for(int j=0;jGetTableFieldData(iIndex,j,buf,i+1); ValueTypes.append(iType); float val=0; val=atof(buf); CoreValues.append(QString::number(val)); } // widget->addJiegutextToPlot(-bottom, -top, CoreValues, iMaxNum); } logio->CloseTable(iIndex); delete m_pResult; } delete logio; return true; }