岩心分析 岩心照片 全部清空 刷新
This commit is contained in:
parent
05ae5043e9
commit
e5c0c52a0c
|
|
@ -49,8 +49,8 @@ void TransparentDraggableCorePhysics::setRange(double left_Low, double right_Hig
|
|||
}
|
||||
}
|
||||
m_lY1 = lY1;
|
||||
// lY2除以实际左到右刻度数值
|
||||
// lY2 = lY2 / (getCpRightScale() - getCpLeftScale()) * 100;
|
||||
|
||||
|
||||
|
||||
double minV = getCpLeftScale();
|
||||
double maxV = getCpRightScale();
|
||||
|
|
@ -59,7 +59,7 @@ void TransparentDraggableCorePhysics::setRange(double left_Low, double right_Hig
|
|||
int scaleType = getCpScaleType(); // 0=线性 1=对数 2=倾角
|
||||
if (scaleType == 0)
|
||||
{
|
||||
// 线性(原来的公式)
|
||||
// 线性(原来的公式) // lY2除以实际左到右刻度数值
|
||||
finalValue = (value - minV) / (maxV - minV) * 100.0;
|
||||
}
|
||||
else if (scaleType == 1)
|
||||
|
|
|
|||
|
|
@ -5492,7 +5492,7 @@ void FormDraw::initIMAGE_DATA(QMyCustomPlot *widget, QString strSlfName, QString
|
|||
widget->xAxis2->setTicks(false);
|
||||
widget->yAxis2->setTicks(false);
|
||||
//
|
||||
LoadFromIMAGE_SLF(widget, strSlfName, strLineName);
|
||||
widget->LoadFromIMAGE_SLF(strSlfName, strLineName);
|
||||
//显示文本
|
||||
QString strAliasName = "岩心图片";
|
||||
if(stringList.size() >= 1)
|
||||
|
|
@ -5509,61 +5509,61 @@ void FormDraw::initIMAGE_DATA(QMyCustomPlot *widget, QString strSlfName, QString
|
|||
m_RightVal, m_LeftVal, strScaleType, "tableObject", stringList);//yanxinImageObject
|
||||
}
|
||||
|
||||
bool FormDraw::LoadFromIMAGE_SLF(QMyCustomPlot *widget, QString strSlfName, QString strLineName)
|
||||
{
|
||||
{
|
||||
QString ss=strSlfName;
|
||||
CMemRdWt *logio=new CMemRdWt();
|
||||
if(ss==""||!logio->Open(ss.toStdString().c_str(),CSlfIO::modeRead))
|
||||
{
|
||||
delete logio;
|
||||
// QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes);
|
||||
return false;
|
||||
}
|
||||
int iIndex=logio->OpenTable(strLineName.toStdString().c_str());
|
||||
if(iIndex>-1) {
|
||||
int len=logio->GetTableRecordLength(iIndex);
|
||||
if(len<sizeof(IMAGE_DATA)) len=sizeof(IMAGE_DATA);
|
||||
char*buf=new char[len+1];
|
||||
IMAGE_DATA *m_Result=(IMAGE_DATA *)buf;
|
||||
//bool FormDraw::LoadFromIMAGE_SLF(QMyCustomPlot *widget, QString strSlfName, QString strLineName)
|
||||
//{
|
||||
// {
|
||||
// QString ss=strSlfName;
|
||||
// CMemRdWt *logio=new CMemRdWt();
|
||||
// if(ss==""||!logio->Open(ss.toStdString().c_str(),CSlfIO::modeRead))
|
||||
// {
|
||||
// delete logio;
|
||||
// // QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes);
|
||||
// return false;
|
||||
// }
|
||||
// int iIndex=logio->OpenTable(strLineName.toStdString().c_str());
|
||||
// if(iIndex>-1) {
|
||||
// int len=logio->GetTableRecordLength(iIndex);
|
||||
// if(len<sizeof(IMAGE_DATA)) len=sizeof(IMAGE_DATA);
|
||||
// char*buf=new char[len+1];
|
||||
// IMAGE_DATA *m_Result=(IMAGE_DATA *)buf;
|
||||
|
||||
int count=logio->GetTableRecordCount(iIndex);
|
||||
for(int i=0;i<count;i++) {
|
||||
memset(m_Result,0,sizeof(IMAGE_DATA));
|
||||
logio->ReadTable(iIndex,i+1,m_Result);
|
||||
// WelllogItem* item=AddItem(m_Result->StartDepth,m_Result->EndDepth);
|
||||
// if(!item) continue;
|
||||
// OGWordsResultItem* pResult = dynamic_cast<OGWordsResultItem*>(item);
|
||||
//logio->GetTableFieldData(iIndex,(char*)FieldName.toStdString().c_str(),m_Result->Image,i+1);
|
||||
// int count=logio->GetTableRecordCount(iIndex);
|
||||
// for(int i=0;i<count;i++) {
|
||||
// memset(m_Result,0,sizeof(IMAGE_DATA));
|
||||
// logio->ReadTable(iIndex,i+1,m_Result);
|
||||
// // WelllogItem* item=AddItem(m_Result->StartDepth,m_Result->EndDepth);
|
||||
// // if(!item) continue;
|
||||
// // OGWordsResultItem* pResult = dynamic_cast<OGWordsResultItem*>(item);
|
||||
// //logio->GetTableFieldData(iIndex,(char*)FieldName.toStdString().c_str(),m_Result->Image,i+1);
|
||||
|
||||
|
||||
// SetCharacters(m_Result->Words);
|
||||
// // SetCharacters(m_Result->Words);
|
||||
|
||||
// fontColor=QColor(0,0,0,255);
|
||||
// backgroundColor=QColor(255,255,255,255);
|
||||
// wordfont.setFamily("黑体");
|
||||
// wordfont.setPointSize(10);
|
||||
// // fontColor=QColor(0,0,0,255);
|
||||
// // backgroundColor=QColor(255,255,255,255);
|
||||
// // wordfont.setFamily("黑体");
|
||||
// // wordfont.setPointSize(10);
|
||||
|
||||
//显示图片Image
|
||||
QString filename=QString::fromLocal8Bit(m_Result->Image);
|
||||
int pos=filename.lastIndexOf("\\");
|
||||
int pos1=filename.lastIndexOf("/");
|
||||
if(pos1>pos) pos=pos1;
|
||||
if(filename.lastIndexOf(".")>-1) {
|
||||
int aa=filename.lastIndexOf(".");
|
||||
if(aa<pos) {
|
||||
filename="";
|
||||
}
|
||||
}
|
||||
widget->addImageToPlot(-m_Result->EndDepth, -m_Result->StartDepth, filename, static_cast<double>(m_Result->Left), static_cast<double>(m_Result->Width));
|
||||
}
|
||||
logio->CloseTable(iIndex);
|
||||
delete buf;
|
||||
}
|
||||
delete logio;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// //显示图片Image
|
||||
// QString filename=QString::fromLocal8Bit(m_Result->Image);
|
||||
// int pos=filename.lastIndexOf("\\");
|
||||
// int pos1=filename.lastIndexOf("/");
|
||||
// if(pos1>pos) pos=pos1;
|
||||
// if(filename.lastIndexOf(".")>-1) {
|
||||
// int aa=filename.lastIndexOf(".");
|
||||
// if(aa<pos) {
|
||||
// filename="";
|
||||
// }
|
||||
// }
|
||||
// widget->addImageToPlot(-m_Result->EndDepth, -m_Result->StartDepth, filename, static_cast<double>(m_Result->Left), static_cast<double>(m_Result->Width));
|
||||
// }
|
||||
// logio->CloseTable(iIndex);
|
||||
// delete buf;
|
||||
// }
|
||||
// delete logio;
|
||||
// }
|
||||
// return true;
|
||||
//}
|
||||
|
||||
//解释结论
|
||||
void FormDraw::initResult(QMyCustomPlot *widget, QString strSlfName, QString strLineName)
|
||||
|
|
@ -6961,107 +6961,90 @@ void FormDraw::initCorePhysics(QMyCustomPlot *widget, QString strSlfName, QStrin
|
|||
widget->xAxis2->setTicks(false);
|
||||
widget->yAxis2->setTicks(false);
|
||||
|
||||
// widget->yAxis2->setTickLabels(true);
|
||||
// widget->yAxis2->setTickLabelSide(QCPAxis::lsInside);
|
||||
// widget->yAxis2->setRange(0, 100);
|
||||
// // 设置刻度
|
||||
// // 创建文本刻度 Ticker
|
||||
// QSharedPointer<QCPAxisTickerText> textTicker(new QCPAxisTickerText);
|
||||
// double minVal = widget->yAxis2->range().lower;
|
||||
// double maxVal = widget->yAxis2->range().upper;
|
||||
// int value = 2;
|
||||
// // 计算步长:(最大值 - 最小值) / 等分数
|
||||
// double step = (maxVal - minVal) / value;
|
||||
// // 生成刻度
|
||||
// for (int i = 0; i <= value; ++i) {
|
||||
// double value = minVal + step * i;
|
||||
// // 取整显示(34.0 显示为 "34")
|
||||
// QString label = QString::number(qRound(value));
|
||||
// textTicker->addTick(value, label);
|
||||
// }
|
||||
// // 应用 Ticker
|
||||
// widget->yAxis2->setTicker(textTicker);
|
||||
|
||||
|
||||
// 加载slf文件 开始
|
||||
QVector<double> x, y;
|
||||
|
||||
Slf_CORE_PHYSICS *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;
|
||||
}
|
||||
int iIndex=logio->OpenTable(strLineName.toStdString().c_str());
|
||||
if(iIndex>-1) {
|
||||
int FieldNo=0;
|
||||
int count=logio->GetTableRecordCount(iIndex);
|
||||
|
||||
QString FieldName = "AC";
|
||||
// // 加载slf文件 开始
|
||||
// QVector<double> x, y;
|
||||
// Slf_CORE_PHYSICS *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;
|
||||
// }
|
||||
// int iIndex=logio->OpenTable(strLineName.toStdString().c_str());
|
||||
// if(iIndex>-1) {
|
||||
// int FieldNo=0;
|
||||
// int count=logio->GetTableRecordCount(iIndex);
|
||||
|
||||
if(!FieldName.isEmpty()) {
|
||||
static int err=0;
|
||||
FieldNo=logio->GetTableFieldNo(iIndex,(char *)FieldName.toStdString().c_str());
|
||||
if(FieldNo<0) {
|
||||
if(!err)QMessageBox::information(nullptr, "提示", "岩心试验数据模块初始加载数据不成功,因为隐含"+FieldName+"字段在实际数据表中不存在,稍后请您重新选择有效字段!");
|
||||
err++;
|
||||
delete logio;
|
||||
return;
|
||||
}
|
||||
else err=0;
|
||||
}
|
||||
else {
|
||||
delete logio;
|
||||
return;
|
||||
}
|
||||
int len=logio->GetTableRecordLength(iIndex);
|
||||
m_pResult=(Slf_CORE_PHYSICS *)new char[len+1];
|
||||
char buf[100];
|
||||
for(int i=0;i<count;i++) {
|
||||
logio->GetTableFieldData(iIndex,1,buf,i+1);
|
||||
sscanf(buf,"%f",&m_pResult->Depth);
|
||||
logio->GetTableFieldData(iIndex,2,buf,i+1);
|
||||
sscanf(buf,"%f",&m_pResult->CorrDepth);
|
||||
// logio->ReadTable(iIndex,i+1,m_pResult);
|
||||
// QString FieldName = "AC";
|
||||
|
||||
int Order = m_pResult->Order;
|
||||
float depth = m_pResult->Depth;
|
||||
float CorrDepth = m_pResult->CorrDepth;
|
||||
float CoreValue = m_pResult->CoreValue;
|
||||
logio->GetTableFieldData(iIndex,FieldNo,buf,i+1);
|
||||
// if(!FieldName.isEmpty()) {
|
||||
// static int err=0;
|
||||
// FieldNo=logio->GetTableFieldNo(iIndex,(char *)FieldName.toStdString().c_str());
|
||||
// if(FieldNo<0) {
|
||||
// if(!err)QMessageBox::information(nullptr, "提示", "岩心试验数据模块初始加载数据不成功,因为隐含"+FieldName+"字段在实际数据表中不存在,稍后请您重新选择有效字段!");
|
||||
// err++;
|
||||
// delete logio;
|
||||
// return;
|
||||
// }
|
||||
// else err=0;
|
||||
// }
|
||||
// else {
|
||||
// delete logio;
|
||||
// return;
|
||||
// }
|
||||
// int len=logio->GetTableRecordLength(iIndex);
|
||||
// m_pResult=(Slf_CORE_PHYSICS *)new char[len+1];
|
||||
// char buf[100];
|
||||
// for(int i=0;i<count;i++) {
|
||||
// logio->GetTableFieldData(iIndex,1,buf,i+1);
|
||||
// sscanf(buf,"%f",&m_pResult->Depth);
|
||||
// logio->GetTableFieldData(iIndex,2,buf,i+1);
|
||||
// sscanf(buf,"%f",&m_pResult->CorrDepth);
|
||||
// // logio->ReadTable(iIndex,i+1,m_pResult);
|
||||
|
||||
CoreValue=0;
|
||||
sscanf(buf,"%f",&CoreValue);
|
||||
//
|
||||
// int Order = m_pResult->Order;
|
||||
// float depth = m_pResult->Depth;
|
||||
// float CorrDepth = m_pResult->CorrDepth;
|
||||
// float CoreValue = m_pResult->CoreValue;
|
||||
// logio->GetTableFieldData(iIndex,FieldNo,buf,i+1);
|
||||
|
||||
if(i==0)
|
||||
{
|
||||
//最大值,最小值默认采用第一个有效值
|
||||
//vmax = vmin = CoreValue;
|
||||
// CoreValue=0;
|
||||
// sscanf(buf,"%f",&CoreValue);
|
||||
// //
|
||||
|
||||
//默认采用0-100范围
|
||||
if(vmax<CoreValue)vmax=CoreValue;
|
||||
if(vmin>CoreValue)vmin=CoreValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
if(vmax<CoreValue)vmax=CoreValue;
|
||||
if(vmin>CoreValue)vmin=CoreValue;
|
||||
}
|
||||
//
|
||||
x.append(-CorrDepth);
|
||||
y.append(CoreValue);
|
||||
// 已经加载了slf文件内容 显示界面上
|
||||
widget->addCorePhysicsWithParam(Order, static_cast<double>(-depth), static_cast<double>(-CorrDepth), static_cast<double>(-CoreValue));
|
||||
}
|
||||
logio->CloseTable(iIndex);
|
||||
delete m_pResult;
|
||||
}
|
||||
delete logio;
|
||||
// 加载slf文件结束
|
||||
// if(i==0)
|
||||
// {
|
||||
// //最大值,最小值默认采用第一个有效值
|
||||
// //vmax = vmin = CoreValue;
|
||||
|
||||
// //默认采用0-100范围
|
||||
// if(vmax<CoreValue)vmax=CoreValue;
|
||||
// if(vmin>CoreValue)vmin=CoreValue;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //
|
||||
// if(vmax<CoreValue)vmax=CoreValue;
|
||||
// if(vmin>CoreValue)vmin=CoreValue;
|
||||
// }
|
||||
// //
|
||||
// x.append(-CorrDepth);
|
||||
// y.append(CoreValue);
|
||||
// // 已经加载了slf文件内容 显示界面上
|
||||
// widget->addCorePhysicsWithParam(Order, static_cast<double>(-depth), static_cast<double>(-CorrDepth), static_cast<double>(-CoreValue));
|
||||
// }
|
||||
// logio->CloseTable(iIndex);
|
||||
// delete m_pResult;
|
||||
// }
|
||||
// delete logio;
|
||||
// // 加载slf文件结束
|
||||
|
||||
// 加载slf文件
|
||||
widget->loadFromSLFCorePhysics(strSlfName, strLineName);
|
||||
|
||||
QString strAliasName = "岩心实验数据";
|
||||
QString strUnit = "";
|
||||
|
|
@ -7077,15 +7060,6 @@ void FormDraw::initCorePhysics(QMyCustomPlot *widget, QString strSlfName, QStrin
|
|||
addRandomGraph(widget, x, y, strSlfName, strLineName, strAliasName, strUnit,
|
||||
newLeftScale, newRightScale, strScaleType, lineColor, width, lineStyle, stringList);
|
||||
|
||||
// if(stringList.size() >= 1)
|
||||
// {
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// addRandomGraph(widget, x, y, strSlfName, strLineName, strAliasName, strUnit);
|
||||
// }
|
||||
|
||||
//支持框选------------------
|
||||
// widget->setSelectionRectMode(QCP::SelectionRectMode::srmSelect);
|
||||
widget->graph(0)->setSelectable(QCP::SelectionType::stMultipleDataRanges);// stSingleData
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ public:
|
|||
|
||||
//岩心图片数据
|
||||
void initIMAGE_DATA(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QStringList listOtherProperty={});
|
||||
bool LoadFromIMAGE_SLF(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
|
||||
// bool LoadFromIMAGE_SLF(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
|
||||
|
||||
//深度
|
||||
void initDepth(QMyCustomPlot *widget);
|
||||
|
|
|
|||
|
|
@ -1917,8 +1917,47 @@ void QMyCustomPlot::addItemsImage(){
|
|||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
}
|
||||
void QMyCustomPlot::deleteItemsImage(){}
|
||||
void QMyCustomPlot::refreshItemsImage(){}
|
||||
void QMyCustomPlot::deleteItemsImage()
|
||||
{
|
||||
if(QMessageBox::information(NULL,QObject::tr("提示"),QObject::tr("该功能将清除当前组件展示的全部信息,清除后无法恢复,但会备份到对应的\"_BAK\"中,确定清除吗?"),QMessageBox::Yes|QMessageBox::No)!=QMessageBox::Yes) return;
|
||||
QString obj = m_strLineName + "BAK";
|
||||
CopyToSLFFile(m_strSlfName, false, (char *)obj.toStdString().c_str());
|
||||
AddTableToWellRound();
|
||||
|
||||
//删除对象
|
||||
TransparentDraggableImage *pDraggableRect =NULL;
|
||||
QMap<QString,QObject *>::Iterator it = m_mapDraggable_Image.begin();
|
||||
while( it != m_mapDraggable_Image.end() )
|
||||
{
|
||||
pDraggableRect = (TransparentDraggableImage*)it.value();
|
||||
it++;
|
||||
pDraggableRect->deleteRect();
|
||||
}
|
||||
this->replot();
|
||||
|
||||
//保存
|
||||
SaveToSLFImage();
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
}
|
||||
void QMyCustomPlot::refreshItemsImage()
|
||||
{
|
||||
//删除对象
|
||||
TransparentDraggableImage *pDraggableRect =NULL;
|
||||
QMap<QString,QObject *>::Iterator it = m_mapDraggable_Image.begin();
|
||||
while( it != m_mapDraggable_Image.end() )
|
||||
{
|
||||
pDraggableRect = (TransparentDraggableImage*)it.value();
|
||||
it++;
|
||||
pDraggableRect->deleteRect();
|
||||
}
|
||||
|
||||
//重新加载
|
||||
this->LoadFromIMAGE_SLF(m_strSlfName, m_strLineName);
|
||||
this->replot();
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
}
|
||||
|
||||
// 增加
|
||||
void QMyCustomPlot::addCorePhysics()
|
||||
|
|
@ -1952,10 +1991,46 @@ void QMyCustomPlot::pasteCorePhysics()
|
|||
{}
|
||||
//全部清空
|
||||
void QMyCustomPlot::deleteCorePhysics()
|
||||
{}
|
||||
{
|
||||
if(QMessageBox::information(NULL,QObject::tr("提示"),QObject::tr("该功能将清除当前组件展示的全部信息,清除后无法恢复,但会备份到对应的\"_BAK\"中,确定清除吗?"),QMessageBox::Yes|QMessageBox::No)!=QMessageBox::Yes) return;
|
||||
QString obj = m_strLineName + "BAK";
|
||||
CopyToSLFFile(m_strSlfName, false, (char *)obj.toStdString().c_str());
|
||||
AddTableToWellRound();
|
||||
|
||||
//删除对象
|
||||
TransparentDraggableCorePhysics *pDraggableRect =NULL;
|
||||
QMap<QString,QObject *>::Iterator it = m_mapDraggable_CorePhysics.begin();
|
||||
while( it != m_mapDraggable_CorePhysics.end() )
|
||||
{
|
||||
pDraggableRect = (TransparentDraggableCorePhysics*)it.value();
|
||||
it++;
|
||||
pDraggableRect->deleteRect();
|
||||
}
|
||||
this->replot();
|
||||
|
||||
//保存
|
||||
saveToSLFCorePhysics();
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
}
|
||||
//刷新数据
|
||||
void QMyCustomPlot::refreshCorePhysics()
|
||||
{}
|
||||
{
|
||||
//删除对象
|
||||
TransparentDraggableCorePhysics *pDraggableRect =NULL;
|
||||
QMap<QString,QObject *>::Iterator it = m_mapDraggable_CorePhysics.begin();
|
||||
while( it != m_mapDraggable_CorePhysics.end() )
|
||||
{
|
||||
pDraggableRect = (TransparentDraggableCorePhysics*)it.value();
|
||||
it++;
|
||||
pDraggableRect->deleteRect();
|
||||
}
|
||||
//重新加载
|
||||
this->loadFromSLFCorePhysics(m_strSlfName, m_strLineName);
|
||||
this->replot();
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
}
|
||||
|
||||
//右键--添加录井剖面
|
||||
void QMyCustomPlot::onEditGeoLith()
|
||||
|
|
@ -3600,6 +3675,148 @@ void QMyCustomPlot::RefreshItems_GeoLith()
|
|||
PropertyService()->InitCurrentViewInfo();
|
||||
}
|
||||
|
||||
bool QMyCustomPlot::LoadFromIMAGE_SLF(QString strSlfName, QString strLineName)
|
||||
{
|
||||
{
|
||||
QString ss=strSlfName;
|
||||
CMemRdWt *logio=new CMemRdWt();
|
||||
if(ss==""||!logio->Open(ss.toStdString().c_str(),CSlfIO::modeRead))
|
||||
{
|
||||
delete logio;
|
||||
// QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes);
|
||||
return false;
|
||||
}
|
||||
int iIndex=logio->OpenTable(strLineName.toStdString().c_str());
|
||||
if(iIndex>-1) {
|
||||
int len=logio->GetTableRecordLength(iIndex);
|
||||
if(len<sizeof(IMAGE_DATA)) len=sizeof(IMAGE_DATA);
|
||||
char*buf=new char[len+1];
|
||||
IMAGE_DATA *m_Result=(IMAGE_DATA *)buf;
|
||||
|
||||
int count=logio->GetTableRecordCount(iIndex);
|
||||
for(int i=0;i<count;i++) {
|
||||
memset(m_Result,0,sizeof(IMAGE_DATA));
|
||||
logio->ReadTable(iIndex,i+1,m_Result);
|
||||
// WelllogItem* item=AddItem(m_Result->StartDepth,m_Result->EndDepth);
|
||||
// if(!item) continue;
|
||||
// OGWordsResultItem* pResult = dynamic_cast<OGWordsResultItem*>(item);
|
||||
//logio->GetTableFieldData(iIndex,(char*)FieldName.toStdString().c_str(),m_Result->Image,i+1);
|
||||
|
||||
|
||||
// SetCharacters(m_Result->Words);
|
||||
|
||||
// fontColor=QColor(0,0,0,255);
|
||||
// backgroundColor=QColor(255,255,255,255);
|
||||
// wordfont.setFamily("黑体");
|
||||
// wordfont.setPointSize(10);
|
||||
|
||||
//显示图片Image
|
||||
QString filename=QString::fromLocal8Bit(m_Result->Image);
|
||||
int pos=filename.lastIndexOf("\\");
|
||||
int pos1=filename.lastIndexOf("/");
|
||||
if(pos1>pos) pos=pos1;
|
||||
if(filename.lastIndexOf(".")>-1) {
|
||||
int aa=filename.lastIndexOf(".");
|
||||
if(aa<pos) {
|
||||
filename="";
|
||||
}
|
||||
}
|
||||
this->addImageToPlot(-m_Result->EndDepth, -m_Result->StartDepth, filename, static_cast<double>(m_Result->Left), static_cast<double>(m_Result->Width));
|
||||
}
|
||||
logio->CloseTable(iIndex);
|
||||
delete buf;
|
||||
}
|
||||
delete logio;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool QMyCustomPlot::loadFromSLFCorePhysics(QString strSlfName, QString strLineName)
|
||||
{
|
||||
float vmax = 100;
|
||||
float vmin = 0;
|
||||
// 加载slf文件 开始
|
||||
QVector<double> x, y;
|
||||
Slf_CORE_PHYSICS *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(strLineName.toStdString().c_str());
|
||||
if(iIndex>-1) {
|
||||
int FieldNo=0;
|
||||
int count=logio->GetTableRecordCount(iIndex);
|
||||
|
||||
QString FieldName = "AC";
|
||||
|
||||
if(!FieldName.isEmpty()) {
|
||||
static int err=0;
|
||||
FieldNo=logio->GetTableFieldNo(iIndex,(char *)FieldName.toStdString().c_str());
|
||||
if(FieldNo<0) {
|
||||
if(!err)QMessageBox::information(nullptr, "提示", "岩心试验数据模块初始加载数据不成功,因为隐含"+FieldName+"字段在实际数据表中不存在,稍后请您重新选择有效字段!");
|
||||
err++;
|
||||
delete logio;
|
||||
return false;
|
||||
}
|
||||
else err=0;
|
||||
}
|
||||
else {
|
||||
delete logio;
|
||||
return false;
|
||||
}
|
||||
int len=logio->GetTableRecordLength(iIndex);
|
||||
m_pResult=(Slf_CORE_PHYSICS *)new char[len+1];
|
||||
char buf[100];
|
||||
for(int i=0;i<count;i++) {
|
||||
logio->GetTableFieldData(iIndex,1,buf,i+1);
|
||||
sscanf(buf,"%f",&m_pResult->Depth);
|
||||
logio->GetTableFieldData(iIndex,2,buf,i+1);
|
||||
sscanf(buf,"%f",&m_pResult->CorrDepth);
|
||||
// logio->ReadTable(iIndex,i+1,m_pResult);
|
||||
|
||||
int Order = m_pResult->Order;
|
||||
float depth = m_pResult->Depth;
|
||||
float CorrDepth = m_pResult->CorrDepth;
|
||||
float CoreValue = m_pResult->CoreValue;
|
||||
logio->GetTableFieldData(iIndex,FieldNo,buf,i+1);
|
||||
|
||||
CoreValue=0;
|
||||
sscanf(buf,"%f",&CoreValue);
|
||||
//
|
||||
|
||||
if(i==0)
|
||||
{
|
||||
//最大值,最小值默认采用第一个有效值
|
||||
//vmax = vmin = CoreValue;
|
||||
|
||||
//默认采用0-100范围
|
||||
if(vmax<CoreValue)vmax=CoreValue;
|
||||
if(vmin>CoreValue)vmin=CoreValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
if(vmax<CoreValue)vmax=CoreValue;
|
||||
if(vmin>CoreValue)vmin=CoreValue;
|
||||
}
|
||||
//
|
||||
x.append(-CorrDepth);
|
||||
y.append(CoreValue);
|
||||
// 已经加载了slf文件内容 显示界面上
|
||||
this->addCorePhysicsWithParam(Order, static_cast<double>(-depth), static_cast<double>(-CorrDepth), static_cast<double>(-CoreValue));
|
||||
}
|
||||
logio->CloseTable(iIndex);
|
||||
delete m_pResult;
|
||||
}
|
||||
delete logio;
|
||||
// 加载slf文件结束
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool QMyCustomPlot::LoadFromSLF_SwallCore(QString strSlfName, QString strLineName)
|
||||
{
|
||||
WALLCORE_DATA m_Result;
|
||||
|
|
|
|||
|
|
@ -227,10 +227,12 @@ public:
|
|||
// 岩心图片
|
||||
QMap<QString,QString> zoneOrderImage;
|
||||
bool SaveToSLFImage();
|
||||
bool LoadFromIMAGE_SLF(QString strSlfName, QString strLineName);
|
||||
|
||||
// 岩心分析
|
||||
QMap<QString,QString> zoneOrderCorePhysics;
|
||||
bool saveToSLFCorePhysics();
|
||||
bool loadFromSLFCorePhysics(QString strSlfName, QString strLineName);
|
||||
|
||||
//井壁取心
|
||||
QStringList liths_SWallCore;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user