录井剖面道,新增8个右键菜单,7个属性配置。
This commit is contained in:
parent
d21ed1aae5
commit
6dd71911fa
|
|
@ -208,6 +208,9 @@ signals:
|
|||
//改变固井曲线名
|
||||
void sig_changeGujingLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strNewLineName);
|
||||
|
||||
//改变录井剖面属性
|
||||
void sig_changeGeoLithLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double dOilZhan);
|
||||
|
||||
//
|
||||
//void sig_addImageToPlot(QMyCustomPlot* customPlot, double left_Low, double right_Hight, QString imagePath);
|
||||
|
||||
|
|
|
|||
|
|
@ -273,6 +273,21 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
|
|||
//先处理通用属性
|
||||
CommonPropertyChanged(pProperty, variant);
|
||||
}
|
||||
else if (m_strCurrentProperty == GeoLith_Property)//录井剖面
|
||||
{
|
||||
//先处理通用属性
|
||||
CommonPropertyChanged(pProperty, variant);
|
||||
|
||||
if("含油占比(1~8)" == m_propertyData[pProperty])
|
||||
{
|
||||
//qDebug() << "含油占比(1~8)->改变";
|
||||
|
||||
double dOilZhan = variant.value<double>();
|
||||
m_formInfo->m_dOilZhan = dOilZhan;
|
||||
//改变录井剖面属性,含油占比
|
||||
emit CallManage::getInstance()->sig_changeGeoLithLine(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, dOilZhan);
|
||||
}
|
||||
}
|
||||
else if (m_strCurrentProperty == GujingItem_Property)
|
||||
{
|
||||
//固井结论item
|
||||
|
|
@ -402,6 +417,74 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (m_strCurrentProperty == GeoLithItem_Property)
|
||||
{
|
||||
//录井剖面item
|
||||
if("顶深(m)" == m_propertyData[pProperty])
|
||||
{
|
||||
//qDebug() << "顶深(m)->改变";
|
||||
if(m_tdGeoLith)
|
||||
{
|
||||
double upper = variant.value<double>();
|
||||
m_tdGeoLith->setUpper(-upper);
|
||||
//保存
|
||||
m_tdGeoLith->mPlot->SaveToSLF_GeoLith();
|
||||
}
|
||||
}
|
||||
else if("底深(m)" == m_propertyData[pProperty])
|
||||
{
|
||||
//qDebug() << "底深(m)->改变";
|
||||
if(m_tdGeoLith)
|
||||
{
|
||||
double lower = variant.value<double>();
|
||||
m_tdGeoLith->setLower(-lower);
|
||||
//保存
|
||||
m_tdGeoLith->mPlot->SaveToSLF_GeoLith();
|
||||
}
|
||||
}
|
||||
else if("岩性" == m_propertyData[pProperty])
|
||||
{
|
||||
//qDebug() << "岩性->改变";
|
||||
if(m_tdGeoLith)
|
||||
{
|
||||
QString newResult = variant.value<QString>();
|
||||
m_tdGeoLith->setLith(newResult, m_tdGeoLith->m_Color);
|
||||
//
|
||||
QCPRange currentRange = m_tdGeoLith->getRange();
|
||||
m_tdGeoLith->setRange(currentRange.lower, currentRange.upper);
|
||||
//保存
|
||||
m_tdGeoLith->mPlot->SaveToSLF_GeoLith();
|
||||
}
|
||||
}
|
||||
else if("油气" == m_propertyData[pProperty])
|
||||
{
|
||||
//qDebug() << "油气->改变";
|
||||
if(m_tdGeoLith)
|
||||
{
|
||||
QString newResult = variant.value<QString>();
|
||||
m_tdGeoLith->setOil(newResult);
|
||||
//
|
||||
QCPRange currentRange = m_tdGeoLith->getRange();
|
||||
m_tdGeoLith->setRange(currentRange.lower, currentRange.upper);
|
||||
//保存
|
||||
m_tdGeoLith->mPlot->SaveToSLF_GeoLith();
|
||||
}
|
||||
}
|
||||
else if("颜色" == m_propertyData[pProperty])
|
||||
{
|
||||
//qDebug() << "颜色->改变";
|
||||
if(m_tdGeoLith)
|
||||
{
|
||||
QString newResult = variant.value<QString>();
|
||||
m_tdGeoLith->setLith(m_tdGeoLith->m_Lith, newResult);
|
||||
//
|
||||
QCPRange currentRange = m_tdGeoLith->getRange();
|
||||
m_tdGeoLith->setRange(currentRange.lower, currentRange.upper);
|
||||
//保存
|
||||
m_tdGeoLith->mPlot->SaveToSLF_GeoLith();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if("深度比例尺" == m_propertyData[pProperty])
|
||||
{
|
||||
|
|
@ -1519,6 +1602,11 @@ void PropertyWidget::initProperty(FormInfo *formInfo)
|
|||
//井壁取心
|
||||
this->initSwallCoreProperty(formInfo);
|
||||
}
|
||||
else if (m_strLineName == "GEO_LITH")
|
||||
{
|
||||
//录井剖面
|
||||
this->initGeoLithProperty(formInfo);
|
||||
}
|
||||
else{
|
||||
this->initTableProperty(formInfo);
|
||||
}
|
||||
|
|
@ -1708,3 +1796,33 @@ void PropertyWidget::initGujingItemProperty(TransparentDraggableGujing* tdGujing
|
|||
_CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double);
|
||||
_CreateVariantPropertyItem("当前项", "固井结论", strResult, VariantManager::filePathTypeId());
|
||||
}
|
||||
|
||||
void PropertyWidget::initGeoLithProperty(FormInfo *formInfo)
|
||||
{
|
||||
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
|
||||
|
||||
_CreateVariantPropertyItem("对象", "显示名称", formInfo->m_strAliasName, QVariant::String);
|
||||
_CreateVariantPropertyItem("对象", "字体", formInfo->m_curveNameFont, QVariant::Font);
|
||||
_CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color);
|
||||
|
||||
_CreateVariantPropertyItem("显示", "含油占比(1~8)", formInfo->m_dOilZhan, QVariant::Double, 1, 8);
|
||||
|
||||
m_strCurrentProperty = GeoLith_Property;
|
||||
}
|
||||
|
||||
void PropertyWidget::initGeoLithItemProperty(TransparentDraggableGeoLith* tdGeoLith, double lower, double upper, const QString myLith, const QString myOil, const QString myColor)
|
||||
{
|
||||
//初始化,清空
|
||||
InitCurrentViewInfo();
|
||||
|
||||
//当前属性类型
|
||||
m_strCurrentProperty = GeoLithItem_Property;
|
||||
m_tdGeoLith = tdGeoLith;
|
||||
|
||||
//
|
||||
_CreateVariantPropertyItem("当前项", "顶深(m)", -upper, QVariant::Double);
|
||||
_CreateVariantPropertyItem("当前项", "底深(m)", -lower, QVariant::Double);
|
||||
_CreateVariantPropertyItem("当前项", "岩性", myLith, VariantManager::filePathTypeId());
|
||||
_CreateVariantPropertyItem("当前项", "油气", myOil, VariantManager::filePathTypeId());
|
||||
_CreateVariantPropertyItem("当前项", "颜色", myColor, VariantManager::filePathTypeId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include "formtracktop.h"
|
||||
#include "TransparentDraggableGujing.h"
|
||||
#include "TransparentDraggableSwallCore.h"
|
||||
#include "TransparentDraggableGeoLith.h"
|
||||
|
||||
//当前曲线类型
|
||||
#define Widget_Property "Widget_Property"
|
||||
|
|
@ -38,6 +39,9 @@
|
|||
#define SwallCore_Property "SwallCore_Property" //井壁取心
|
||||
#define SwallCoreItem_Property "SwallCoreItem_Property" //井壁取心item
|
||||
|
||||
#define GeoLith_Property "GeoLith_Property" //录井剖面
|
||||
#define GeoLithItem_Property "GeoLithItem_Property" //录井剖面item
|
||||
|
||||
#pragma execution_character_set("utf-8")
|
||||
|
||||
/**
|
||||
|
|
@ -104,6 +108,7 @@ public:
|
|||
//
|
||||
TransparentDraggableGujing* m_tdGujing;
|
||||
TransparentDraggableSwallCore* m_tdSwallCore;
|
||||
TransparentDraggableGeoLith* m_tdGeoLith;
|
||||
|
||||
public:
|
||||
QWidget* GetPropertyWidget();
|
||||
|
|
@ -134,6 +139,7 @@ public:
|
|||
void initRoseProperty(FormInfo *formInfo);
|
||||
// 波列属性
|
||||
void initWaveProperty(FormInfo *formInfo, int nType = 3);
|
||||
|
||||
// 固井结论属性
|
||||
void initGujingProperty(FormInfo *formInfo);
|
||||
void initGujingItemProperty(TransparentDraggableGujing* tdGujing, double lower, double upper, QString strResult);
|
||||
|
|
@ -142,8 +148,11 @@ public:
|
|||
void initSwallCoreProperty(FormInfo *formInfo);
|
||||
void initSwallCoreItemProperty(TransparentDraggableSwallCore* tdSwallCore, double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int iColor);
|
||||
|
||||
void ChangFillProperty();//填充属性改变
|
||||
// 固井结论属性
|
||||
void initGeoLithProperty(FormInfo *formInfo);
|
||||
void initGeoLithItemProperty(TransparentDraggableGeoLith* tdGeoLith, double lower, double upper, const QString myLith, const QString myOil, const QString myColor);
|
||||
|
||||
void ChangFillProperty();//填充属性改变
|
||||
void ChangHeadItemProperty();//图头项改变
|
||||
|
||||
//处理通用属性
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -34,14 +34,14 @@ public:
|
|||
void setLith(QString filePath, QString colorPath);
|
||||
void drawLith(double left_Low, double right_Hight, double lY1, double lY2);
|
||||
|
||||
void setColor(QString filePath);
|
||||
// void setColor(QString filePath);
|
||||
|
||||
//设置m_Oil
|
||||
void setOil(QString filePath);
|
||||
void drawOil(double left_Low, double right_Hight, double lY1, double lY2);
|
||||
|
||||
// 设置矩形范围
|
||||
void setRange(double left_Low, double right_Hight);
|
||||
void setRange(double left_Low, double right_Hight, bool bRefresh=true);
|
||||
// 获取当前范围
|
||||
QCPRange getRange();
|
||||
|
||||
|
|
@ -51,6 +51,11 @@ public:
|
|||
// 删除框图
|
||||
void deleteRect();
|
||||
|
||||
//设置顶深
|
||||
void setUpper(double upper);
|
||||
//设置底深
|
||||
void setLower(double lower);
|
||||
|
||||
signals:
|
||||
void rangeChanged(QCPRange newRange);
|
||||
|
||||
|
|
@ -59,14 +64,16 @@ private:
|
|||
void updateHandles() ;
|
||||
|
||||
private slots:
|
||||
void onDelRect();
|
||||
void onSplitRect(); //分割
|
||||
void onDelRect(); //删除
|
||||
void setItemDepthOffset(); //设置深度移动量
|
||||
void onMousePress(QMouseEvent *event);
|
||||
void onMouseMove(QMouseEvent *event);
|
||||
void onMouseRelease(QMouseEvent *event);
|
||||
double getMyLower();
|
||||
double getMyUpper();
|
||||
|
||||
private:
|
||||
public:
|
||||
QMyCustomPlot *mPlot;
|
||||
QCPItemRect *mRect;
|
||||
QCPItemRect *mLeftHandle;
|
||||
|
|
@ -83,6 +90,8 @@ private:
|
|||
QString m_Oil;
|
||||
QString m_Color;
|
||||
|
||||
//double m_dOilZhan=8; //含油占比
|
||||
|
||||
GeoIndicatorGenerator m_drawGeo;
|
||||
|
||||
enum DragMode { DragNone, DragLeft, DragRight, DragRect };
|
||||
|
|
|
|||
|
|
@ -316,12 +316,16 @@ void TransparentDraggableGujing::onSplitRect()
|
|||
//添加下半部分
|
||||
mPlot->addGujingToPlot(currentRange.lower, (currentRange.lower+currentRange.upper)/2.0, m_Result);
|
||||
|
||||
double low = mRect->topLeft->coords().x();
|
||||
double hight = mRect->bottomRight->coords().x();
|
||||
PropertyService()->initGujingItemProperty(this, low, hight, m_Result);
|
||||
// double low = mRect->topLeft->coords().x();
|
||||
// double hight = mRect->bottomRight->coords().x();
|
||||
// PropertyService()->initGujingItemProperty(this, low, hight, m_Result);
|
||||
|
||||
//保存
|
||||
mPlot->SaveToSLF_Gujing();
|
||||
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 0, "");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -295,14 +295,10 @@ void FormDraw::DisplayLines(QJsonArray linesArray)
|
|||
//qDebug() << "LineName:" << strLineName;
|
||||
}
|
||||
}
|
||||
if (strLineName == "GUJING1_RESULT" || strLineName == "GUJING2_RESULT" || strLineName == "GUJING3_RESULT")
|
||||
if (strLineName == "GUJING1_RESULT" || strLineName == "GUJING2_RESULT" || strLineName == "GUJING3_RESULT"
|
||||
|| strLineName == "GEO_LITH" || strLineName == "SWALL_CORE")
|
||||
{
|
||||
//固井结论
|
||||
DisplayTable_One(lineObjInfo);
|
||||
}
|
||||
else if (strLineName == "SWALL_CORE")
|
||||
{
|
||||
//井壁取心
|
||||
//固井结论/井壁取心/录井剖面
|
||||
DisplayTable_One(lineObjInfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -393,6 +389,12 @@ void FormDraw::DisplayTable_One(QJsonObject lineObjInfo)
|
|||
listOtherProperty.append(strAliasName);//别名
|
||||
listOtherProperty.append(lineColor.name());//名称颜色
|
||||
listOtherProperty.append(curveNameFont.toString());//名称字体
|
||||
//
|
||||
if (lineObjInfo.contains("OilZhan"))//含油占比
|
||||
{
|
||||
listOtherProperty.append(QString::number(lineObjInfo.value("OilZhan").toInt()));
|
||||
}
|
||||
|
||||
//结论
|
||||
this->addTableLine(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, listOtherProperty);
|
||||
}
|
||||
|
|
@ -820,7 +822,17 @@ QMyCustomPlot* FormDraw::addTableLine(QString strUuid, QString strSlfName, QStri
|
|||
else if (strLineName == "GEO_LITH")
|
||||
{
|
||||
//录井剖面
|
||||
initGeoLith(curv, strSlfName, strLineName);
|
||||
if(listOtherProperty.size()>=3)
|
||||
{
|
||||
QString strAliasName = listOtherProperty[0];
|
||||
QColor newlineColor=QColor(0,0,0);
|
||||
newlineColor.setNamedColor(listOtherProperty[1]);
|
||||
initGeoLith(curv, strSlfName, strLineName, strAliasName, newlineColor, listOtherProperty);
|
||||
}
|
||||
else
|
||||
{
|
||||
initGeoLith(curv, strSlfName, strLineName);
|
||||
}
|
||||
}
|
||||
else if (strLineName == "SWALL_CORE")
|
||||
{
|
||||
|
|
@ -3960,9 +3972,8 @@ bool FormDraw::LoadFromSLF_Result(QMyCustomPlot *widget, QString strSlfName, QSt
|
|||
}
|
||||
|
||||
//录井剖面
|
||||
void FormDraw::initGeoLith(QMyCustomPlot *widget, QString strSlfName, QString strLineName)
|
||||
void FormDraw::initGeoLith(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName, QColor newlineColor, QStringList listOtherProperty)
|
||||
{
|
||||
|
||||
int iMyWidth = widget->axisRect(0)->width();
|
||||
float vmax = iMyWidth;
|
||||
float vmin = 0;
|
||||
|
|
@ -3992,125 +4003,28 @@ void FormDraw::initGeoLith(QMyCustomPlot *widget, QString strSlfName, QString st
|
|||
widget->yAxis->setTicks(false);
|
||||
widget->xAxis2->setTicks(false);
|
||||
widget->yAxis2->setTicks(false);
|
||||
//
|
||||
LoadFromSLF_GeoLith(widget, strSlfName, strLineName);
|
||||
|
||||
QString strAliasName = "";
|
||||
//含油占比
|
||||
if(listOtherProperty.size()>=4)
|
||||
{
|
||||
widget->m_dOilZhan = listOtherProperty[3].toDouble();
|
||||
}
|
||||
//加载
|
||||
widget->LoadFromSLF_GeoLith(strSlfName, strLineName);
|
||||
|
||||
if(listOtherProperty.size()>=3)
|
||||
{
|
||||
strAliasName = listOtherProperty[0];
|
||||
newlineColor.setNamedColor(listOtherProperty[1]);
|
||||
}
|
||||
QString strUnit = "";
|
||||
QColor newlineColor=QColor(0,0,0);
|
||||
double width=2;
|
||||
QString strScaleType = "";
|
||||
//道-对象
|
||||
m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "tableObject");
|
||||
m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "tableObject", listOtherProperty);
|
||||
|
||||
}
|
||||
|
||||
bool FormDraw::LoadFromSLF_GeoLith(QMyCustomPlot *widget, QString strSlfName, QString strLineName)
|
||||
{
|
||||
CMemRdWt *logio=new CMemRdWt();
|
||||
if(!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead))
|
||||
{
|
||||
delete logio;
|
||||
return false;
|
||||
}
|
||||
int iIndex=logio->OpenTable(strLineName.toStdString().c_str());
|
||||
if(iIndex>-1) {
|
||||
int len=logio->GetTableRecordLength(iIndex);
|
||||
int sl=sizeof(GeoLith_DATA);
|
||||
if(sl>len) len=sl;
|
||||
GeoLith_DATA *m_Result;
|
||||
m_Result=(GeoLith_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);
|
||||
//
|
||||
QMap<QString,QString> OilOrder;
|
||||
QMap<QString,QString> LithOrder;
|
||||
QMap<QString,QString> ColorOrder;
|
||||
QMap<QString,QString> ColorInds;
|
||||
//
|
||||
LithOrder=GetZoneOrder(QString("GeoLith"));
|
||||
OilOrder=GetZoneOrder(QString("CoreOil"));
|
||||
ColorOrder=GetZoneOrder(QString("CoreColor"));
|
||||
ColorInds=GetZoneOrder(QString("ColorInd"));
|
||||
|
||||
QString iconshotname="";
|
||||
QString IntLith = QString::number(m_Result->Lith);
|
||||
if(IntLith=="0") {
|
||||
iconshotname="";
|
||||
}
|
||||
else
|
||||
{
|
||||
iconshotname=LithOrder.key(IntLith);
|
||||
}
|
||||
|
||||
//
|
||||
QString Lith = "";
|
||||
if(iconshotname!="")
|
||||
Lith=::GetMudSymbolDir()+""+iconshotname+".svg";
|
||||
int len=2;
|
||||
int pos=Lith.indexOf(".//");
|
||||
if(pos<0) pos=Lith.indexOf("./");
|
||||
else len=3;
|
||||
QString svg;
|
||||
if(pos==0)
|
||||
{
|
||||
svg=QCoreApplication::applicationDirPath()+ QDir::separator();
|
||||
svg+=Lith.mid(len-1);
|
||||
}
|
||||
else svg=Lith;
|
||||
QDir ss;
|
||||
if(!ss.exists(svg))
|
||||
{
|
||||
QString path=svg.left(svg.lastIndexOf('.')+1);
|
||||
svg=path+"png";
|
||||
}
|
||||
Lith=svg;
|
||||
|
||||
//
|
||||
QString Oil = "";
|
||||
iconshotname=OilOrder.key(QString::number(m_Result->Oil));
|
||||
if(iconshotname!="")
|
||||
Oil=::GetGasSymbolDir()+""+iconshotname+".svg";
|
||||
len=2;
|
||||
pos=Oil.indexOf(".//");
|
||||
if(pos<0) pos=Oil.indexOf("./");
|
||||
else len=3;
|
||||
if(pos==0)
|
||||
{
|
||||
svg=QCoreApplication::applicationDirPath()+ QDir::separator();
|
||||
svg+=Oil.mid(len-1);
|
||||
}
|
||||
else svg=Oil;
|
||||
if(!ss.exists(svg))
|
||||
{
|
||||
QString path=svg.left(svg.lastIndexOf('.')+1);
|
||||
svg=path+"png";
|
||||
}
|
||||
Oil=svg;
|
||||
|
||||
//
|
||||
QString Color = "";
|
||||
int ind=ColorInds.value(QString::number(m_Result->Color)).toInt();
|
||||
if (ind>-1&&ind<ColorOrder.size())
|
||||
{
|
||||
Color=::GetColorSymbolDir()+""+ColorOrder.key(QString::number(ind))+".svg";
|
||||
}
|
||||
else {
|
||||
Color=::GetColorSymbolDir()+"空白.svg";
|
||||
}
|
||||
|
||||
//
|
||||
widget->addGeoLithToPlot(-m_Result->EDEP, -m_Result->SDEP, Lith, Oil, Color);
|
||||
}
|
||||
logio->CloseTable(iIndex);
|
||||
delete m_Result;
|
||||
}
|
||||
delete logio;
|
||||
return true;
|
||||
}
|
||||
|
||||
//井壁取心
|
||||
void FormDraw::initSwallCore(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName, QColor newlineColor, QStringList listOtherProperty)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -181,8 +181,7 @@ public:
|
|||
bool LoadFromSLF_Result(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
|
||||
|
||||
//录井剖面
|
||||
void initGeoLith(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
|
||||
bool LoadFromSLF_GeoLith(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
|
||||
void initGeoLith(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName = "录井剖面", QColor newlineColor=QColor(0,0,0), QStringList listOtherProperty={});
|
||||
|
||||
//井壁取心
|
||||
void initSwallCore(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName = "井壁取心", QColor newlineColor=QColor(0,0,0), QStringList listOtherProperty={});
|
||||
|
|
|
|||
|
|
@ -150,6 +150,17 @@ QJsonObject FormInfo::makeJson()
|
|||
//item属性写入slf文件,不需要此次记录
|
||||
return rootObj;
|
||||
}
|
||||
else if (m_strLineName == "GEO_LITH")
|
||||
{
|
||||
//录井剖面
|
||||
rootObj["Type"] = m_strType;
|
||||
rootObj["curveNameFont"] = m_curveNameFont.toString();
|
||||
rootObj["lineColor"] = m_lineColor.name();
|
||||
|
||||
rootObj["OilZhan"] = m_dOilZhan;//含油占比
|
||||
//item属性写入slf文件,不需要此次记录
|
||||
return rootObj;
|
||||
}
|
||||
}
|
||||
|
||||
rootObj["Unit"] = m_strUnit;
|
||||
|
|
@ -420,7 +431,7 @@ void FormInfo::paintEvent(QPaintEvent* event)
|
|||
else if(m_strLineName=="GEO_LITH")
|
||||
{
|
||||
//录井剖面,不绘制左右范围
|
||||
painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "录井剖面");
|
||||
//painter.drawText(rect.left(), rect.top()+rect.height()/3, rect.width(), rect.height()/3 ,Qt::AlignCenter, "录井剖面");
|
||||
}
|
||||
else if(m_strLineName=="SWALL_CORE")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -142,6 +142,8 @@ public:
|
|||
QFont m_layerFont; // 层号字体
|
||||
float m_fLayerRotate = 0.0f; // 层号旋转
|
||||
|
||||
//录井剖面
|
||||
double m_dOilZhan=8; //含油占比
|
||||
|
||||
public:
|
||||
void setLineWidth(double dWidth);
|
||||
|
|
|
|||
|
|
@ -534,15 +534,24 @@ void FormTrack::s_AddTableLine(QString strSlfName, QString strWellName, QString
|
|||
formInfo->setFrontColor(QColor(0,0,0));
|
||||
formInfo->setBackColor(QColor(255,255,255));
|
||||
if(strLineName == "GUJING1_RESULT" || strLineName == "GUJING2_RESULT" || strLineName == "GUJING3_RESULT"
|
||||
|| strLineName == "SWALL_CORE")
|
||||
|| strLineName == "GEO_LITH" || strLineName == "SWALL_CORE")
|
||||
{
|
||||
//固井结论/ 井壁取心
|
||||
//固井结论 / 井壁取心 / 录井剖面
|
||||
if(listOtherProperty.size()>=3)
|
||||
{
|
||||
QFont curveNameFont("微软雅黑", 10); // 名称字体
|
||||
curveNameFont.fromString(listOtherProperty[2]);
|
||||
formInfo->m_curveNameFont = curveNameFont;
|
||||
}
|
||||
|
||||
//录井剖面
|
||||
if(strLineName == "GEO_LITH")
|
||||
{
|
||||
if(listOtherProperty.size()>=4)
|
||||
{
|
||||
formInfo->m_dOilZhan = listOtherProperty[3].toDouble();
|
||||
}
|
||||
}
|
||||
}
|
||||
//设置高度
|
||||
ui->tableWidget->setRowHeight(row, 100);
|
||||
|
|
|
|||
|
|
@ -123,6 +123,8 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
|
|||
connect(CallManage::getInstance(), SIGNAL(sig_changeDrawProperty(QVariantList)), this, SLOT(s_changeDrawProperty(QVariantList)));
|
||||
//改变固井曲线名
|
||||
connect(CallManage::getInstance(), SIGNAL(sig_changeGujingLine(QString, QString, QString, QString, QString, QString)), this, SLOT(s_changeGujingLine(QString, QString, QString, QString, QString, QString)));
|
||||
//改变录井剖面属性
|
||||
connect(CallManage::getInstance(), SIGNAL(sig_changeGeoLithLine(QString, QString, QString, QString, QString, double)), this, SLOT(s_changeGeoLithLine(QString, QString, QString, QString, QString, double)));
|
||||
}
|
||||
|
||||
void QMyCustomPlot::initGeometry(QString strUuid, int nscale, int nW)
|
||||
|
|
@ -956,8 +958,7 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event)
|
|||
menu.addAction(QIcon(::GetImagePath() + "development.png"), "合并结论", this, &QMyCustomPlot::MegResult_Gujing);
|
||||
menu.exec(event->globalPos());
|
||||
}
|
||||
|
||||
if (m_strLineName == "SWALL_CORE")
|
||||
else if (m_strLineName == "SWALL_CORE")
|
||||
{
|
||||
QMenu menu(this);
|
||||
//井壁取心
|
||||
|
|
@ -969,6 +970,17 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event)
|
|||
menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_SWallCore);
|
||||
menu.exec(event->globalPos());
|
||||
}
|
||||
else if (m_strLineName == "GEO_LITH")
|
||||
{
|
||||
QMenu menu(this);
|
||||
//录井剖面
|
||||
menu.addAction(QIcon(::GetImagePath() + "curve.png"), "开始编辑录井剖面", this, &QMyCustomPlot::onEditGeoLith);
|
||||
menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "从剪切板文本数据粘贴", this, &QMyCustomPlot::addItems_GeoLith);
|
||||
menu.addAction(QIcon(::GetImagePath() + "icon/ClearSelectCore.png"), "取消选中", this, &QMyCustomPlot::ClearSelectItems);
|
||||
menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "全部清空", this, &QMyCustomPlot::DeleteItems_GeoLith);
|
||||
menu.addAction(QIcon(::GetImagePath() + "icon/CopyCoreTxt.png"), "刷新数据", this, &QMyCustomPlot::RefreshItems_GeoLith);
|
||||
menu.exec(event->globalPos());
|
||||
}
|
||||
|
||||
// QAction *resetAction = menu.addAction("添加框图");
|
||||
// connect(resetAction, &QAction::triggered, this, &QMyCustomPlot::onAddRect);
|
||||
|
|
@ -1174,6 +1186,167 @@ void QMyCustomPlot::onEditGujing()
|
|||
}
|
||||
}
|
||||
|
||||
//右键--添加录井剖面
|
||||
void QMyCustomPlot::onEditGeoLith()
|
||||
{
|
||||
this->setInteractions(QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables | QCP::iMultiSelect); // 轴、图例、图表可以被选择,并且是多选的方式
|
||||
this->setSelectionRectMode(QCP::srmCustom); // 鼠标框选
|
||||
|
||||
if(m_bFirstTimeConnect)
|
||||
{
|
||||
//信号槽只绑定一次,避免重复绑定
|
||||
m_bFirstTimeConnect = false;
|
||||
|
||||
for (int i=0; i < this->graphCount(); ++i) {
|
||||
QCPGraph *graph = this->graph(i);
|
||||
graph->setSelectable(QCP::stDataRange);
|
||||
break;
|
||||
}
|
||||
|
||||
connect(this->selectionRect(), &QCPSelectionRect::accepted, [this](){
|
||||
if(this->m_bDrawRect == false)
|
||||
{
|
||||
this->m_bDrawRect = true;
|
||||
return;
|
||||
}
|
||||
// 当选择完成时,获取矩形范围并放大
|
||||
QRectF rect = this->selectionRect()->rect(); // 获取选择的矩形区域(像素坐标)
|
||||
m_bEditRect=true;//当前是否正在编辑曲线。
|
||||
|
||||
// 转换为坐标轴范围
|
||||
double top = rect.top();
|
||||
double bottom = rect.bottom();
|
||||
|
||||
double right_Hight = this->xAxis->pixelToCoord(top);
|
||||
double left_Low = this->xAxis->pixelToCoord(bottom);
|
||||
|
||||
//追加判断,避免框选重叠
|
||||
TransparentDraggableGeoLith *pDraggableRect =NULL;
|
||||
{
|
||||
QMap<QString,QObject *>::Iterator it = m_mapDraggable_GeoLith.begin();
|
||||
while( it != m_mapDraggable_GeoLith.end() )
|
||||
{
|
||||
pDraggableRect = (TransparentDraggableGeoLith*)it.value();
|
||||
//
|
||||
QCPRange tmpRange = pDraggableRect->getRange();
|
||||
if(tmpRange.lower >= left_Low && tmpRange.upper <= right_Hight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(tmpRange.upper >= left_Low && tmpRange.upper <= right_Hight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(tmpRange.lower >= left_Low && tmpRange.lower <= right_Hight)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
//
|
||||
QMap<QString,QString> OilOrder;
|
||||
QMap<QString,QString> LithOrder;
|
||||
QMap<QString,QString> ColorOrder;
|
||||
QMap<QString,QString> ColorInds;
|
||||
//
|
||||
LithOrder=GetZoneOrder(QString("GeoLith"));
|
||||
OilOrder=GetZoneOrder(QString("CoreOil"));
|
||||
ColorOrder=GetZoneOrder(QString("CoreColor"));
|
||||
ColorInds=GetZoneOrder(QString("ColorInd"));
|
||||
|
||||
int iOil=1;//含油性
|
||||
int iLith=50;//岩性
|
||||
int iColor=0;//颜色
|
||||
|
||||
QString iconshotname="";
|
||||
QString IntLith = QString::number(iLith);
|
||||
if(IntLith=="0") {
|
||||
iconshotname="";
|
||||
}
|
||||
else
|
||||
{
|
||||
iconshotname=LithOrder.key(IntLith);
|
||||
}
|
||||
|
||||
//
|
||||
QString Lith = "";
|
||||
if(iconshotname!="")
|
||||
Lith=::GetMudSymbolDir()+""+iconshotname+".svg";
|
||||
int len=2;
|
||||
int pos=Lith.indexOf(".//");
|
||||
if(pos<0) pos=Lith.indexOf("./");
|
||||
else len=3;
|
||||
QString svg;
|
||||
if(pos==0)
|
||||
{
|
||||
svg=QCoreApplication::applicationDirPath()+ QDir::separator();
|
||||
svg+=Lith.mid(len-1);
|
||||
}
|
||||
else svg=Lith;
|
||||
QDir ss;
|
||||
if(!ss.exists(svg))
|
||||
{
|
||||
QString path=svg.left(svg.lastIndexOf('.')+1);
|
||||
svg=path+"png";
|
||||
}
|
||||
Lith=svg;
|
||||
|
||||
//
|
||||
QString Oil = "";
|
||||
iconshotname=OilOrder.key(QString::number(iOil));
|
||||
if(iconshotname!="")
|
||||
Oil=::GetGasSymbolDir()+""+iconshotname+".svg";
|
||||
len=2;
|
||||
pos=Oil.indexOf(".//");
|
||||
if(pos<0) pos=Oil.indexOf("./");
|
||||
else len=3;
|
||||
if(pos==0)
|
||||
{
|
||||
svg=QCoreApplication::applicationDirPath()+ QDir::separator();
|
||||
svg+=Oil.mid(len-1);
|
||||
}
|
||||
else svg=Oil;
|
||||
if(!ss.exists(svg))
|
||||
{
|
||||
QString path=svg.left(svg.lastIndexOf('.')+1);
|
||||
svg=path+"png";
|
||||
}
|
||||
Oil=svg;
|
||||
|
||||
//
|
||||
QString Color = "";
|
||||
int ind=ColorInds.value(QString::number(iColor)).toInt();
|
||||
if (ind>-1&&ind<ColorOrder.size())
|
||||
{
|
||||
Color=::GetColorSymbolDir()+""+ColorOrder.key(QString::number(ind))+".svg";
|
||||
}
|
||||
else {
|
||||
Color=::GetColorSymbolDir()+"空白.svg";
|
||||
}
|
||||
|
||||
//添加录井剖面
|
||||
this->addGeoLithToPlot(left_Low, right_Hight, Lith, Oil, Color);
|
||||
|
||||
//保存
|
||||
this->SaveToSLF_GeoLith();
|
||||
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
|
||||
//取消框选
|
||||
this->setInteractions(QCP::iSelectLegend | QCP::iSelectPlottables);
|
||||
this->setSelectionRectMode(QCP::srmNone);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
bool QMyCustomPlot::SaveToSLF_SwallCore()
|
||||
{
|
||||
static int isrun=false;
|
||||
|
|
@ -1350,6 +1523,151 @@ bool QMyCustomPlot::SaveToSLF_SwallCore()
|
|||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
QString QMyCustomPlot::GetIntLith(QString Lith)
|
||||
{
|
||||
if(Lith=="") return "";
|
||||
QFileInfo afile(Lith);
|
||||
return LithOrder.value(afile.completeBaseName());
|
||||
}
|
||||
|
||||
QString QMyCustomPlot::GetIntOil(QString Oil)
|
||||
{
|
||||
if(Oil=="") return "";
|
||||
QFileInfo afile(Oil);
|
||||
return OilOrder.value(afile.completeBaseName());
|
||||
}
|
||||
QString QMyCustomPlot::GetIntColor(QString Color)
|
||||
{
|
||||
if(Color=="") return "";
|
||||
QFileInfo afile(Color);
|
||||
return ColorOrder.value(afile.completeBaseName());
|
||||
}
|
||||
|
||||
//保存录井剖面
|
||||
bool QMyCustomPlot::SaveToSLF_GeoLith()
|
||||
{
|
||||
static int isrun=false;
|
||||
if(isrun) return false;
|
||||
QString ss=m_strSlfName;
|
||||
if(ss=="") return false;
|
||||
isrun=true;
|
||||
|
||||
GeoLith_DATA m_Result;
|
||||
CMemRdWt *logio=new CMemRdWt();
|
||||
if(ss==""||!logio->Open(ss.toStdString().c_str(),CSlfIO::modeReadWrite))
|
||||
{
|
||||
delete logio;
|
||||
QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes);
|
||||
isrun=false;
|
||||
return false;
|
||||
}
|
||||
bool isfirst=false;
|
||||
int iIndex=logio->OpenTable(m_strLineName.toStdString().c_str());
|
||||
if (iIndex < 0)
|
||||
{
|
||||
if(!m_mapDraggable_GeoLith.size()) {
|
||||
delete logio;
|
||||
isrun=false;
|
||||
return false;
|
||||
}
|
||||
iIndex=logio->Open_Set_Table(m_strLineName.toStdString().c_str(),0,7,
|
||||
"NO,SDEP,EDEP,OIL,LITH,COLOR,DEST",
|
||||
"4,4,4,4,4,4,64",//字段长度
|
||||
"1,4,4,1,1,1,6",//字段类型
|
||||
"0,0,0,3,7,5,0");//字段备注
|
||||
isfirst=true;
|
||||
}
|
||||
logio->SetTableRecordCount(iIndex,m_mapDraggable_GeoLith.size());
|
||||
|
||||
if(!m_mapDraggable_GeoLith.size()) {
|
||||
delete logio;
|
||||
if(isfirst)AddTableToWellRound();
|
||||
isrun=false;
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----
|
||||
LithOrder.clear();
|
||||
OilOrder.clear();
|
||||
ColorOrder.clear();
|
||||
ColorInds.clear();
|
||||
LithOrder=GetZoneOrder(QString("GeoLith"));
|
||||
OilOrder=GetZoneOrder(QString("CoreOil"));
|
||||
ColorOrder=GetZoneOrder(QString("CoreColor"));
|
||||
ColorInds=GetZoneOrder(QString("ColorInd"));
|
||||
|
||||
TransparentDraggableGeoLith *pDraggableRect =NULL;
|
||||
|
||||
//排序
|
||||
QList<float> listSDepth;
|
||||
for (QMap<QString,QObject *>::Iterator iter = m_mapDraggable_GeoLith.begin(); iter != m_mapDraggable_GeoLith.end(); iter++)
|
||||
{
|
||||
pDraggableRect = (TransparentDraggableGeoLith*)iter.value();
|
||||
//
|
||||
QCPRange tmpRange = pDraggableRect->getRange();
|
||||
//
|
||||
float fSDepth = -tmpRange.upper;
|
||||
listSDepth.append(fSDepth);
|
||||
}
|
||||
qSort(listSDepth);
|
||||
|
||||
//
|
||||
for(int i=0; i<listSDepth.size(); i++)
|
||||
{
|
||||
for (QMap<QString,QObject *>::Iterator iter = m_mapDraggable_GeoLith.begin(); iter != m_mapDraggable_GeoLith.end(); iter++)
|
||||
{
|
||||
pDraggableRect = (TransparentDraggableGeoLith*)iter.value();
|
||||
//
|
||||
QCPRange tmpRange = pDraggableRect->getRange();
|
||||
float fSDepth = -tmpRange.upper;
|
||||
if(fSDepth == listSDepth[i])//按顺序写入
|
||||
{
|
||||
memset(&m_Result,0,sizeof(GeoLith_DATA));
|
||||
m_Result.SDEP = -tmpRange.upper;
|
||||
m_Result.EDEP = -tmpRange.lower;
|
||||
m_Result.NO=i+1;
|
||||
m_Result.Lith=325;
|
||||
QString innerresult=GetIntLith(pDraggableRect->m_Lith);
|
||||
if(innerresult!="")
|
||||
m_Result.Lith=innerresult.toInt();
|
||||
if(m_Result.Lith<1) m_Result.Lith=325;
|
||||
m_Result.Oil=1;
|
||||
innerresult=GetIntOil(pDraggableRect->m_Oil);
|
||||
if(innerresult!="")
|
||||
m_Result.Oil=innerresult.toInt();
|
||||
if(m_Result.Oil<1) m_Result.Oil=1;
|
||||
|
||||
QString name,path;
|
||||
GetWellNameAndPath(pDraggableRect->m_Color,name,path);
|
||||
if(name!="空白"&&name!="空"&&name!="白色") strcpy(m_Result.Dest,name.toStdString().c_str());
|
||||
int ind=ColorOrder.value(name).toInt();
|
||||
if(ind<0||ind>=ColorInds.size()) m_Result.Color=0;
|
||||
else m_Result.Color=ColorInds.key(QString::number(ind)).toInt();
|
||||
name="";
|
||||
GetWellNameAndPath(pDraggableRect->m_Oil,name,path);
|
||||
if(name!="空白"&&name!="空") strcat(m_Result.Dest,name.toStdString().c_str());
|
||||
name="";
|
||||
GetWellNameAndPath(pDraggableRect->m_Lith,name,path);
|
||||
if(name!="空白"&&name!="空") strcat(m_Result.Dest,name.toStdString().c_str());
|
||||
name=m_Result.Dest;
|
||||
name.remove("空白");
|
||||
//此处统一转换
|
||||
int n=strlen(name.toStdString().c_str());
|
||||
if(n>sizeof(m_Result.Dest)) n=sizeof(m_Result.Dest);
|
||||
strncpy(m_Result.Dest,name.toLocal8Bit().data(),n);
|
||||
//
|
||||
logio->WriteTable(iIndex,i+1,&m_Result);
|
||||
}
|
||||
}
|
||||
}
|
||||
logio->CloseTable(iIndex);
|
||||
delete logio;
|
||||
if(isfirst)AddTableToWellRound();
|
||||
isrun=false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//保存固井结论道
|
||||
bool QMyCustomPlot::SaveToSLF_Gujing()
|
||||
{
|
||||
|
|
@ -1712,6 +2030,342 @@ void QMyCustomPlot::DeleteItems_SWallCore()
|
|||
PropertyService()->InitCurrentViewInfo();
|
||||
}
|
||||
|
||||
//全部清空
|
||||
void QMyCustomPlot::DeleteItems_GeoLith()
|
||||
{
|
||||
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();
|
||||
|
||||
//删除对象
|
||||
TransparentDraggableGeoLith *pDraggableRect =NULL;
|
||||
QMap<QString,QObject *>::Iterator it = m_mapDraggable_GeoLith.begin();
|
||||
while( it != m_mapDraggable_GeoLith.end() )
|
||||
{
|
||||
pDraggableRect = (TransparentDraggableGeoLith*)it.value();
|
||||
it++;
|
||||
pDraggableRect->deleteRect();
|
||||
}
|
||||
|
||||
//保存
|
||||
this->SaveToSLF_GeoLith();
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
}
|
||||
|
||||
//从剪切板文本数据粘贴
|
||||
void QMyCustomPlot::addItems_GeoLith()
|
||||
{
|
||||
QClipboard *clipboard = QApplication::clipboard(); //获取系统剪贴板指针
|
||||
QString originalText = clipboard->text(); //获取剪贴板上文本信息
|
||||
int isspace=originalText.indexOf(" ");
|
||||
int istab=originalText.indexOf("\t");
|
||||
int isd=originalText.indexOf(",");
|
||||
|
||||
if((istab>-1|isd>-1)&&isspace>-1)
|
||||
{
|
||||
QMessageBox::information(NULL,"提示", "\",\"或制表符与空格键并存,自动分解可能有误!\n建议用单一符号风格!");
|
||||
}
|
||||
originalText.replace("\t"," ");
|
||||
originalText.replace(","," ");
|
||||
originalText.replace("\r\n","\n");
|
||||
originalText.replace("\r","\n");
|
||||
QStringList line=originalText.split("\n");
|
||||
line.removeAll("");
|
||||
for(int i=0;i<line.size();i++) {
|
||||
QStringList coredat=line[i].split(" ");
|
||||
if((istab==-1||isd==-1)&&isspace>=0) coredat.removeAll("");
|
||||
if(coredat.size()<1) continue;
|
||||
if(!coredat[0].isEmpty()&&!coredat[0].at(0).isDigit()) continue;
|
||||
|
||||
//录井剖面
|
||||
AddItem_GeoLith(coredat);
|
||||
}
|
||||
|
||||
//保存
|
||||
this->SaveToSLF_GeoLith();
|
||||
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
}
|
||||
|
||||
void QMyCustomPlot::AddItem_GeoLith(QStringList lists)
|
||||
{
|
||||
//初始化LithOrder
|
||||
if(LithOrder.size()<=0)
|
||||
{
|
||||
LithOrder=GetZoneOrder(QString("GeoLith"));
|
||||
}
|
||||
if(OilOrder.size()<=0)
|
||||
{
|
||||
OilOrder=GetZoneOrder(QString("CoreOil"));
|
||||
}
|
||||
if(ColorOrder.size()<=0)
|
||||
{
|
||||
ColorOrder=GetZoneOrder(QString("CoreColor"));
|
||||
}
|
||||
if(ColorInds.size()<=0)
|
||||
{
|
||||
ColorInds=GetZoneOrder(QString("ColorInd"));
|
||||
}
|
||||
if(LithWidth.size()<=0)
|
||||
{
|
||||
QString configfile=::GetConfPath()+GetOilFieldName()+"LithWidth";
|
||||
QDir ss1;
|
||||
if(!ss1.exists(configfile+".txt")) configfile+=".ini";
|
||||
else configfile+=".txt";
|
||||
QStringList lines;
|
||||
QFile file( configfile );
|
||||
if ( file.open( QIODevice::ReadOnly ) ) {
|
||||
QTextStream stream( &file );
|
||||
QString line;
|
||||
while ( !stream.atEnd() ) {
|
||||
line = stream.readLine(); // 不包括“\n”的一行文本
|
||||
lines += line;
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
LithWidth=lines;
|
||||
}
|
||||
if(lists.size()<3) return;
|
||||
if(lists.size()<4) lists.insert(0,"0");
|
||||
GeoLith_DATA m_Result;
|
||||
memset(&m_Result,0,sizeof(GeoLith_DATA));
|
||||
double top=-9999.0;
|
||||
double bottom=-9999.0;
|
||||
m_Result.NO=lists[0].toInt();
|
||||
top=(int)(lists[1].toDouble()*1000+0.5)/1000.0;
|
||||
bottom=(int)(lists[2].toDouble()*1000+0.5)/1000.0;
|
||||
m_Result.SDEP=top;
|
||||
m_Result.EDEP=bottom;
|
||||
m_Result.Oil=-1;
|
||||
m_Result.Lith=325;
|
||||
if(lists.size()>2) {
|
||||
if(!lists[3].isEmpty()) {
|
||||
if(lists[3].at(0).isDigit()||lists[3].at(0)=='.') {
|
||||
m_Result.Oil=lists[3].toDouble();
|
||||
if(lists.size()>4) m_Result.Lith=lists[4].toDouble();
|
||||
}
|
||||
else {
|
||||
for(int j=0;j<3;j++) {
|
||||
QMap<QString,QString> ss;
|
||||
if(j==0) ss=LithOrder;
|
||||
else if(j==1)ss=OilOrder;
|
||||
else ss=ColorOrder;
|
||||
int len=0;
|
||||
int len1=0;
|
||||
int iid=-1;
|
||||
QString key,value;
|
||||
for(int i=0;i<ss.size();i++) {
|
||||
key=ss.key(QString::number(i+1));
|
||||
value=lists[3];
|
||||
if(!key.isEmpty()&&value.indexOf(key)>-1) {
|
||||
len1=strlen(key.toStdString().c_str());
|
||||
if(len<len1) {
|
||||
len=len1;
|
||||
iid=i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(len) {
|
||||
if(j==0) m_Result.Lith=iid+1;
|
||||
else if(j==1) m_Result.Oil=iid+1;
|
||||
else {
|
||||
if(iid>=0&&iid<ColorInds.size()) m_Result.Color=ColorInds.key(QString::number(iid+1)).toInt();
|
||||
else m_Result.Color=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(top==0&&bottom==0) return;
|
||||
if(bottom<top) {
|
||||
return;
|
||||
}
|
||||
|
||||
//----------
|
||||
QString iconshotname="";
|
||||
QString IntLith = QString::number(m_Result.Lith);
|
||||
if(IntLith=="0") {
|
||||
iconshotname="";
|
||||
}
|
||||
else
|
||||
{
|
||||
iconshotname=LithOrder.key(IntLith);
|
||||
}
|
||||
|
||||
//
|
||||
QString Lith = "";
|
||||
if(iconshotname!="")
|
||||
Lith=::GetMudSymbolDir()+""+iconshotname+".svg";
|
||||
int len=2;
|
||||
int pos=Lith.indexOf(".//");
|
||||
if(pos<0) pos=Lith.indexOf("./");
|
||||
else len=3;
|
||||
QString svg;
|
||||
if(pos==0)
|
||||
{
|
||||
svg=QCoreApplication::applicationDirPath()+ QDir::separator();
|
||||
svg+=Lith.mid(len-1);
|
||||
}
|
||||
else svg=Lith;
|
||||
QDir ss;
|
||||
if(!ss.exists(svg))
|
||||
{
|
||||
QString path=svg.left(svg.lastIndexOf('.')+1);
|
||||
svg=path+"png";
|
||||
}
|
||||
Lith=svg;
|
||||
|
||||
//
|
||||
QString Oil = "";
|
||||
iconshotname=OilOrder.key(QString::number(m_Result.Oil));
|
||||
if(iconshotname!="")
|
||||
Oil=::GetGasSymbolDir()+""+iconshotname+".svg";
|
||||
len=2;
|
||||
pos=Oil.indexOf(".//");
|
||||
if(pos<0) pos=Oil.indexOf("./");
|
||||
else len=3;
|
||||
if(pos==0)
|
||||
{
|
||||
svg=QCoreApplication::applicationDirPath()+ QDir::separator();
|
||||
svg+=Oil.mid(len-1);
|
||||
}
|
||||
else svg=Oil;
|
||||
if(!ss.exists(svg))
|
||||
{
|
||||
QString path=svg.left(svg.lastIndexOf('.')+1);
|
||||
svg=path+"png";
|
||||
}
|
||||
Oil=svg;
|
||||
|
||||
//
|
||||
QString Color = "";
|
||||
int ind=ColorInds.value(QString::number(m_Result.Color)).toInt();
|
||||
if (ind>-1&&ind<ColorOrder.size())
|
||||
{
|
||||
Color=::GetColorSymbolDir()+""+ColorOrder.key(QString::number(ind))+".svg";
|
||||
}
|
||||
else {
|
||||
Color=::GetColorSymbolDir()+"空白.svg";
|
||||
}
|
||||
|
||||
//
|
||||
this->addGeoLithToPlot(-m_Result.EDEP, -m_Result.SDEP, Lith, Oil, Color);
|
||||
}
|
||||
|
||||
bool QMyCustomPlot::LoadFromSLF_GeoLith(QString strSlfName, QString strLineName)
|
||||
{
|
||||
//
|
||||
LithOrder.clear();
|
||||
OilOrder.clear();
|
||||
ColorOrder.clear();
|
||||
ColorInds.clear();
|
||||
LithOrder=GetZoneOrder(QString("GeoLith"));
|
||||
OilOrder=GetZoneOrder(QString("CoreOil"));
|
||||
ColorOrder=GetZoneOrder(QString("CoreColor"));
|
||||
ColorInds=GetZoneOrder(QString("ColorInd"));
|
||||
|
||||
CMemRdWt *logio=new CMemRdWt();
|
||||
if(!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead))
|
||||
{
|
||||
delete logio;
|
||||
return false;
|
||||
}
|
||||
int iIndex=logio->OpenTable(strLineName.toStdString().c_str());
|
||||
if(iIndex>-1) {
|
||||
int len=logio->GetTableRecordLength(iIndex);
|
||||
int sl=sizeof(GeoLith_DATA);
|
||||
if(sl>len) len=sl;
|
||||
GeoLith_DATA *m_Result;
|
||||
m_Result=(GeoLith_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);
|
||||
|
||||
QString iconshotname="";
|
||||
QString IntLith = QString::number(m_Result->Lith);
|
||||
if(IntLith=="0") {
|
||||
iconshotname="";
|
||||
}
|
||||
else
|
||||
{
|
||||
iconshotname=LithOrder.key(IntLith);
|
||||
}
|
||||
|
||||
//
|
||||
QString Lith = "";
|
||||
if(iconshotname!="")
|
||||
Lith=::GetMudSymbolDir()+""+iconshotname+".svg";
|
||||
int len=2;
|
||||
int pos=Lith.indexOf(".//");
|
||||
if(pos<0) pos=Lith.indexOf("./");
|
||||
else len=3;
|
||||
QString svg;
|
||||
if(pos==0)
|
||||
{
|
||||
svg=QCoreApplication::applicationDirPath()+ QDir::separator();
|
||||
svg+=Lith.mid(len-1);
|
||||
}
|
||||
else svg=Lith;
|
||||
QDir ss;
|
||||
if(!ss.exists(svg))
|
||||
{
|
||||
QString path=svg.left(svg.lastIndexOf('.')+1);
|
||||
svg=path+"png";
|
||||
}
|
||||
Lith=svg;
|
||||
|
||||
//
|
||||
QString Oil = "";
|
||||
iconshotname=OilOrder.key(QString::number(m_Result->Oil));
|
||||
if(iconshotname!="")
|
||||
Oil=::GetGasSymbolDir()+""+iconshotname+".svg";
|
||||
len=2;
|
||||
pos=Oil.indexOf(".//");
|
||||
if(pos<0) pos=Oil.indexOf("./");
|
||||
else len=3;
|
||||
if(pos==0)
|
||||
{
|
||||
svg=QCoreApplication::applicationDirPath()+ QDir::separator();
|
||||
svg+=Oil.mid(len-1);
|
||||
}
|
||||
else svg=Oil;
|
||||
if(!ss.exists(svg))
|
||||
{
|
||||
QString path=svg.left(svg.lastIndexOf('.')+1);
|
||||
svg=path+"png";
|
||||
}
|
||||
Oil=svg;
|
||||
|
||||
//
|
||||
QString Color = "";
|
||||
int ind=ColorInds.value(QString::number(m_Result->Color)).toInt();
|
||||
if (ind>-1&&ind<ColorOrder.size())
|
||||
{
|
||||
Color=::GetColorSymbolDir()+""+ColorOrder.key(QString::number(ind))+".svg";
|
||||
}
|
||||
else {
|
||||
Color=::GetColorSymbolDir()+"空白.svg";
|
||||
}
|
||||
|
||||
//不单独刷新
|
||||
bool bRefresh = true;
|
||||
this->addGeoLithToPlot(-m_Result->EDEP, -m_Result->SDEP, Lith, Oil, Color, bRefresh);
|
||||
}
|
||||
//最后统一刷新
|
||||
//widget->replot();
|
||||
|
||||
logio->CloseTable(iIndex);
|
||||
delete m_Result;
|
||||
}
|
||||
delete logio;
|
||||
return true;
|
||||
}
|
||||
|
||||
//刷新数据
|
||||
void QMyCustomPlot::RefreshItems_SWallCore()
|
||||
{
|
||||
|
|
@ -1731,6 +2385,25 @@ void QMyCustomPlot::RefreshItems_SWallCore()
|
|||
PropertyService()->InitCurrentViewInfo();
|
||||
}
|
||||
|
||||
//刷新数据
|
||||
void QMyCustomPlot::RefreshItems_GeoLith()
|
||||
{
|
||||
//删除对象
|
||||
TransparentDraggableGeoLith *pDraggableRect =NULL;
|
||||
QMap<QString,QObject *>::Iterator it = m_mapDraggable_GeoLith.begin();
|
||||
while( it != m_mapDraggable_GeoLith.end() )
|
||||
{
|
||||
pDraggableRect = (TransparentDraggableGeoLith*)it.value();
|
||||
it++;
|
||||
pDraggableRect->deleteRect();
|
||||
}
|
||||
|
||||
//重新加载
|
||||
LoadFromSLF_GeoLith(m_strSlfName, m_strLineName);
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
}
|
||||
|
||||
bool QMyCustomPlot::LoadFromSLF_SwallCore(QString strSlfName, QString strLineName)
|
||||
{
|
||||
WALLCORE_DATA m_Result;
|
||||
|
|
@ -2859,7 +3532,7 @@ void QMyCustomPlot::addSwallCoreToPlot(double Depth, QString LithologyImage, QSt
|
|||
//this->replot();
|
||||
}
|
||||
|
||||
void QMyCustomPlot::addGeoLithToPlot(double left_Low, double right_Hight, const QString myLith, const QString myOil, const QString myColor)
|
||||
void QMyCustomPlot::addGeoLithToPlot(double left_Low, double right_Hight, const QString myLith, const QString myOil, const QString myColor, bool bRefresh)
|
||||
{
|
||||
QtCommonClass *qtCommon = new QtCommonClass(this);
|
||||
QString strUuid = qtCommon->getUUid();
|
||||
|
|
@ -2871,7 +3544,7 @@ void QMyCustomPlot::addGeoLithToPlot(double left_Low, double right_Hight, const
|
|||
dragRect->setLith(myLith, myColor);
|
||||
|
||||
// 设置初始范围
|
||||
dragRect->setRange(left_Low, right_Hight);
|
||||
dragRect->setRange(left_Low, right_Hight, bRefresh);
|
||||
// 可选:设置颜色
|
||||
dragRect->setColor(QColor(255, 255, 255, 80)); // 半透明红色255, 100, 100, 80
|
||||
//最小宽度
|
||||
|
|
@ -4234,3 +4907,36 @@ void QMyCustomPlot::s_changeGujingLine(QString strUuid, QString strSlfName, QStr
|
|||
//刷新数据
|
||||
RefreshItems_Gujing();
|
||||
}
|
||||
|
||||
//改变录井剖面属性
|
||||
void QMyCustomPlot::s_changeGeoLithLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double dOilZhan)
|
||||
{
|
||||
if(m_strUuid == strUuid &&
|
||||
m_strSlfName == strSlfName &&
|
||||
m_strWellName == strWellName &&
|
||||
m_strTrackName == strTrackName &&
|
||||
m_strLineName == strLineName)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_dOilZhan = dOilZhan;
|
||||
//删除对象
|
||||
TransparentDraggableGeoLith *pDraggableRect =NULL;
|
||||
QMap<QString,QObject *>::Iterator it = m_mapDraggable_GeoLith.begin();
|
||||
while( it != m_mapDraggable_GeoLith.end() )
|
||||
{
|
||||
pDraggableRect = (TransparentDraggableGeoLith*)it.value();
|
||||
it++;
|
||||
pDraggableRect->deleteRect();
|
||||
}
|
||||
|
||||
//重新加载
|
||||
LoadFromSLF_GeoLith(m_strSlfName, m_strLineName);
|
||||
|
||||
//不清空属性窗口
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,10 +169,23 @@ public:
|
|||
QStringList oils_SWallCore;
|
||||
QStringList colors_SWallCore;
|
||||
QStringList colorinds_SWallCore;
|
||||
//
|
||||
bool SaveToSLF_SwallCore();
|
||||
bool LoadFromSLF_SwallCore(QString strSlfName, QString strLineName);
|
||||
|
||||
//录井剖面
|
||||
QMap<QString,QString> OilOrder;
|
||||
QMap<QString,QString> LithOrder;
|
||||
QMap<QString,QString> ColorOrder;
|
||||
QMap<QString,QString> ColorInds;
|
||||
QStringList LithWidth;
|
||||
QString GetIntLith(QString Lith);
|
||||
QString GetIntOil(QString Oil);
|
||||
QString GetIntColor(QString Color);
|
||||
bool SaveToSLF_GeoLith();
|
||||
bool LoadFromSLF_GeoLith(QString strSlfName, QString strLineName);
|
||||
//录井剖面
|
||||
double m_dOilZhan=8; //含油占比
|
||||
|
||||
public slots:
|
||||
void slot_time();
|
||||
|
||||
|
|
@ -188,7 +201,7 @@ public:
|
|||
|
||||
void addResultToPlot(double left_Low, double right_Hight, QString myResult, QString &strUuid, QString strText="");
|
||||
|
||||
void addGeoLithToPlot(double left_Low, double right_Hight, const QString myLith, const QString myOil, const QString myColor);
|
||||
void addGeoLithToPlot(double left_Low, double right_Hight, const QString myLith, const QString myOil, const QString myColor, bool bRefresh=true);
|
||||
|
||||
void addSwallCoreToPlot(double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int iColor);
|
||||
|
||||
|
|
@ -270,10 +283,12 @@ public slots:
|
|||
//右键--编辑曲线
|
||||
void onEditLine();
|
||||
|
||||
//通用
|
||||
void ClearSelectItems(); //取消选中
|
||||
|
||||
//右键--编辑固井
|
||||
void onEditGujing();
|
||||
void addItems_Gujing(); //从剪切板文本数据粘贴
|
||||
void ClearSelectItems(); //取消选中
|
||||
void DeleteItems_Gujing(); //全部清空
|
||||
void RefreshItems_Gujing(); //刷新数据
|
||||
void MegResult_Gujing(); //合并结论
|
||||
|
|
@ -286,6 +301,13 @@ public slots:
|
|||
void RefreshItems_SWallCore(); //刷新数据
|
||||
void AddItem_SWallCore(QStringList lists);
|
||||
|
||||
//右键--编辑录井剖面
|
||||
void onEditGeoLith();
|
||||
void addItems_GeoLith(); //从剪切板文本数据粘贴
|
||||
void DeleteItems_GeoLith(); //全部清空
|
||||
void RefreshItems_GeoLith(); //刷新数据
|
||||
void AddItem_GeoLith(QStringList lists);
|
||||
|
||||
//
|
||||
void addItems_Core();
|
||||
|
||||
|
|
@ -314,6 +336,9 @@ public slots:
|
|||
//改变固井曲线名
|
||||
void s_changeGujingLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strNewLineName);
|
||||
|
||||
//改变录井剖面属性
|
||||
void s_changeGeoLithLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, double dOilZhan);
|
||||
|
||||
public:
|
||||
//蝌蚪图重绘网格线
|
||||
bool mKedou = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user