Merge branch 'main' of http://git.hivekion.com:3000/jiayulong/logplus
# Conflicts: # logPlus/formdraw.h
This commit is contained in:
commit
3bb2c89646
|
|
@ -209,6 +209,12 @@ signals:
|
|||
//向左侧树图,追加固井结论表格
|
||||
void sig_AddGujingToTree(QString strSlfName, QString strWellName, QString strLineName);
|
||||
|
||||
//改变固井曲线名
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
#ifndef DATAHELPER_H
|
||||
#define DATAHELPER_H
|
||||
|
||||
#include <Windows.h>
|
||||
#ifdef WIN32
|
||||
#include <Windows.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include <QObject>
|
||||
#include <QTextStream>
|
||||
#include "MemRdWt.h"
|
||||
#include "datamanagerdefs.h"
|
||||
#include "DataManagerDefs.h"
|
||||
#pragma execution_character_set("utf-8")
|
||||
//#define DefTabNum 10//9 whp change 2020.5.25
|
||||
//for 曲线计算
|
||||
|
|
@ -47,6 +50,7 @@ public:
|
|||
static bool m_IsGc;
|
||||
static QStringList GetAllWellName();
|
||||
static QStringList GetAllWellRoundName(QString WellName,QStringList& WellRoundFileNameList);
|
||||
static QMap<QString, QList<QString> > m_qmapWellFiles;
|
||||
};
|
||||
class Function
|
||||
{
|
||||
|
|
@ -84,8 +88,8 @@ public:
|
|||
int isdelim(char c);
|
||||
int iswhite(char c);
|
||||
//int ComputeCurve(CString csExpress,float sdeps,float edeps,BOOL IsCurrentOpen);
|
||||
BOOL GetKey();
|
||||
BOOL CheckKey();
|
||||
// BOOL GetKey();
|
||||
// BOOL CheckKey();
|
||||
int GetCodeLen(int Code);
|
||||
//add whp
|
||||
QString csName[MaxArg],csOutName;
|
||||
|
|
@ -108,4 +112,4 @@ public:
|
|||
static void ReSampling(float *mr,int Row,int Col,float *aDep,float *tDep,int tnp);
|
||||
static void ReSampling(short *mr,int Row,int Col,float *aDep,float *tDep,int tnp);
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ public:
|
|||
~CDataManagger();
|
||||
int GetDefTabNum();
|
||||
DEFAULTTABLE *GetDefauleTable();
|
||||
void SetWellFiles(QMap<QString, QList<QString> > &mapWellFiles);
|
||||
//whp change 2020.3.9 for 统一离散数据入口
|
||||
//交互导入数据表
|
||||
//void execInDefTable(int curitemType,const QString& showWellName,const QString& wellFileName);
|
||||
|
|
@ -25,7 +26,7 @@ public:
|
|||
//void dataInTable(const QStringList& lst );
|
||||
//QStringList dataInTable(int curitemType,const QString& showWellName,const QString& wellFileName);//返回不能识别的非定式的数据文件列表
|
||||
void dataInTable(int curitemType,QString& showWellName,QString& wellFileName);
|
||||
// void CopyObject(int curitemType,const QString& WellName,const QString& wellFileName);
|
||||
void CopyObject(int curitemType,const QString& WellName,const QString& wellFileName);
|
||||
//
|
||||
//曲线属性编辑
|
||||
void CurvePropertyEdit(int Type,const QString& FileName,const QString& CurveName);
|
||||
|
|
|
|||
|
|
@ -1,115 +0,0 @@
|
|||
#ifndef DATAHELPER_H
|
||||
#define DATAHELPER_H
|
||||
|
||||
#ifdef WIN32
|
||||
#include <Windows.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include <QObject>
|
||||
#include <QTextStream>
|
||||
#include "MemRdWt.h"
|
||||
#include "DataManagerDefs.h"
|
||||
#pragma execution_character_set("utf-8")
|
||||
//#define DefTabNum 10//9 whp change 2020.5.25
|
||||
//for 曲线计算
|
||||
#define MaxArg 26 // 最大自变量数
|
||||
#define DELIMITER 1
|
||||
#define VARIABLE 2
|
||||
#define MNUMBER 3
|
||||
struct DEFAULTTABLE
|
||||
{
|
||||
public:
|
||||
QString TableName;
|
||||
QString TableAliasName;
|
||||
int ZdNum;
|
||||
Slf_OBJECT_FIELD *tinfo;
|
||||
//Slf_TABLE_FIELD *tinfo;
|
||||
};
|
||||
|
||||
#pragma endregion 导入表数据定义的函数,可以单独建立动态库文件
|
||||
|
||||
|
||||
class DATAMGS_EXPORT DataHelper
|
||||
{
|
||||
public:
|
||||
DataHelper();
|
||||
~DataHelper();
|
||||
#pragma region 导入表数据定义的函数,可以单独建立动态库文件
|
||||
//whp change 2020.3.9 for 统一离散数据入口
|
||||
//static QStringList GetVlidTable(QStringList listFiles);//过滤掉无效数据表
|
||||
static QStringList GetVlidTable(int curitemType,QStringList listFiles,QStringList &BadlistFiles);//过滤掉无效数据表
|
||||
static int StrType(QString str);//IsNumberStr(QString str)判断字符串是否为数值,是整数还是浮点数
|
||||
|
||||
static DEFAULTTABLE SetTableInf(QString TableName,QString TableHzName,int num,QStringList ZdName,QStringList HzName,QStringList ZdUnit,QStringList ZdType,QStringList ZdLen,QStringList ZdRes);
|
||||
static void InitDefauleTable();
|
||||
|
||||
static void DelDefauleTable();
|
||||
|
||||
static int GetSimilarTable(int ZdNum,int *FieldType);//匹配缺省表,返回缺省表序号m=1,BOOL IsSem=1,BOOL DelDubSpa=1);
|
||||
static bool IsNullLine(QByteArray line);
|
||||
static bool m_IsGc;
|
||||
static QStringList GetAllWellName();
|
||||
static QStringList GetAllWellRoundName(QString WellName,QStringList& WellRoundFileNameList);
|
||||
static QMap<QString, QList<QString> > m_qmapWellFiles;
|
||||
};
|
||||
class Function
|
||||
{
|
||||
public:
|
||||
CMemRdWt *Slffile;
|
||||
float val[10];
|
||||
//whp add 2011.7.19 for字符型字段计算
|
||||
char cval[10][30];
|
||||
char *prog;
|
||||
//int d_iProgramInCurvePos[MaxCurve];
|
||||
// float xx[MaxCurve];
|
||||
// -----------------------------
|
||||
// 计算产生新曲线定义开始
|
||||
//char *prog;
|
||||
char token[80];
|
||||
char tok_type;
|
||||
char vars[MaxArg];
|
||||
// A-Z 26 user's variable
|
||||
// 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
int get_exp(float *result);
|
||||
int level2(float *result);
|
||||
int level3(float *result);
|
||||
int level4(float *result);
|
||||
int level5(float *result);
|
||||
int level6(float *result);
|
||||
int primitive(float *result);
|
||||
void get_token();
|
||||
void arith(char o,float *r,float *h);
|
||||
void unary(char o,float *r);
|
||||
void serror(int error);
|
||||
void putback();
|
||||
int level1(float *result);
|
||||
float find_var(char *s,int *ret);
|
||||
int is_in(char ch,char *s);
|
||||
int isdelim(char c);
|
||||
int iswhite(char c);
|
||||
//int ComputeCurve(CString csExpress,float sdeps,float edeps,BOOL IsCurrentOpen);
|
||||
// BOOL GetKey();
|
||||
// BOOL CheckKey();
|
||||
int GetCodeLen(int Code);
|
||||
//add whp
|
||||
QString csName[MaxArg],csOutName;
|
||||
char TempProg[150];
|
||||
int GetExpress(QString csExpress);//返回输入变量个数(曲线条数)
|
||||
// 计算产生新曲线定义结束
|
||||
};
|
||||
class Resample
|
||||
{
|
||||
public:
|
||||
static float GetXstep(float x2,float x1);
|
||||
static void Linear(float *x,float *y,int n,float *a,float *b);
|
||||
static void Parabola(float *x,float *y,int n,float *a,float *b,float *c);
|
||||
static void Akima(float *x,float *y,int n,float *a,float *b,float *c,float *d);
|
||||
static bool LReSampling(float *aDep,float *aVal,int anp,float *tDep,float *curve,int tnp,int method);
|
||||
static void qs(float *datx,float*mr,int left,int right,int Col);
|
||||
static void qs(float *datx,short*mr,int left,int right,int Col);
|
||||
static void ReOrder(float *mr,int Row,int Col,float *tDep);
|
||||
static void ReOrder(short *mr,int Row,int Col,float *tDep);
|
||||
static void ReSampling(float *mr,int Row,int Col,float *aDep,float *tDep,int tnp);
|
||||
static void ReSampling(short *mr,int Row,int Col,float *aDep,float *tDep,int tnp);
|
||||
};
|
||||
#endif
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
#pragma once
|
||||
#include <QObject>
|
||||
#include <QScrollBar>
|
||||
#include <qtablewidget.h>
|
||||
#include "DataManagerDefs.h"
|
||||
#include "slf.h"
|
||||
// #include "objwelllogRound.h"
|
||||
// #include "ObjWelllog.h"
|
||||
#pragma execution_character_set("utf-8")
|
||||
class DEFAULTTABLE;
|
||||
class DATAMGS_EXPORT CDataManagger:public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CDataManagger();
|
||||
~CDataManagger();
|
||||
int GetDefTabNum();
|
||||
DEFAULTTABLE *GetDefauleTable();
|
||||
void SetWellFiles(QMap<QString, QList<QString> > &mapWellFiles);
|
||||
//whp change 2020.3.9 for 统一离散数据入口
|
||||
//交互导入数据表
|
||||
//void execInDefTable(int curitemType,const QString& showWellName,const QString& wellFileName);
|
||||
void execInDefTable(int curitemType,const QString& showWellName,const QString& wellFileName,const QString& inFile);
|
||||
//数据表自动导入
|
||||
//void dataInTable(const QStringList& lst );
|
||||
//QStringList dataInTable(int curitemType,const QString& showWellName,const QString& wellFileName);//返回不能识别的非定式的数据文件列表
|
||||
void dataInTable(int curitemType,QString& showWellName,QString& wellFileName);
|
||||
void CopyObject(int curitemType,const QString& WellName,const QString& wellFileName);
|
||||
//
|
||||
//曲线属性编辑
|
||||
void CurvePropertyEdit(int Type,const QString& FileName,const QString& CurveName);
|
||||
//whp add 2020.4.9 for 波列曲线预览
|
||||
void DisplayWave(const QString& FileName,const QString& CurveName);
|
||||
//whp add 2020.5.12 for 常规曲线预览
|
||||
void DisplayCurve(const QString& FileName,const QString& CurveName);
|
||||
//曲线数值统计
|
||||
void DataStatistics(int Type,const QString& FileName,const QString& CurveName);
|
||||
//创建新曲线
|
||||
QString CreateNewCurve(const QString& wellname);
|
||||
//whp 2020.7.21
|
||||
//创建新表
|
||||
QString CreateNewTable(const QString& wellname);
|
||||
//2020.7.21 表属性编辑
|
||||
QString TableProEdit(const QString& wellname,const QString& tablename);
|
||||
//2021.3.19 表转曲线
|
||||
QString Table2Curve(const QString& wellname,const QString& tablename);
|
||||
//2021.3.23曲线转结论表格
|
||||
QString Curve2ResultTable(const QString& wellname,const QString& tablename);
|
||||
//曲线计算
|
||||
// void CurveCompute(QList<CObjWellLog*>objs,int No=0);
|
||||
|
||||
void CurveCompute(const QString& FileName,const QStringList& CurveNameList);
|
||||
//whp add 2020.4.14 合成阵列曲线
|
||||
QString WaveCompose(const QString& FileName,const QStringList& CurveNameList);
|
||||
//单位转换
|
||||
void UnitConvert(const QString& Filename);//,CObjWelllogRound* pround);
|
||||
//通用列表函数
|
||||
//void ListMessage(const QString& listName,const QStringList& header,const QStringList& listMessage);
|
||||
//外部接口
|
||||
//曲线数值统计
|
||||
void CallDisplayWaveOrCurve(int Type,
|
||||
const QString& FileName,
|
||||
const QString& CurveName,
|
||||
QWidget* parent);
|
||||
//曲线数值统计
|
||||
//20210111 GZL add 纵滑块联动
|
||||
void CallDisplayCurveVerChange(int Type,
|
||||
const QString& FileName,
|
||||
const QString& CurveName,
|
||||
QWidget* parent,
|
||||
int value,
|
||||
float tipValue);
|
||||
void sendTableP2Mgr(QWidget* parent, QScrollBar *p, QTableWidget *t);
|
||||
|
||||
void DataStatistics(int Type,
|
||||
const QString& FileName,
|
||||
const QString& CurveName,
|
||||
QWidget* parent);
|
||||
//曲线属性编辑
|
||||
void CurvePropertyEdit(int Type,
|
||||
const QString& FileName,
|
||||
const QString& CurveName,
|
||||
QWidget* parent);
|
||||
//曲线计算
|
||||
void CurveCompute(const QString& FileName,
|
||||
const QStringList& CurveNameList,
|
||||
QWidget* parent);
|
||||
QString m_CurveName,m_FileName;
|
||||
QLineEdit *m_edit1,*m_edit2,*m_edit3;
|
||||
QDialog *m_pDialog;
|
||||
//void curveViewMousePress(int pos);
|
||||
signals:
|
||||
//void mousePressPos(int);
|
||||
|
||||
private slots:
|
||||
void slotCurveComputeGc(QStringList listCurveNames);
|
||||
void slotCurvePropertyGc();
|
||||
void accept1();
|
||||
void accept2();
|
||||
private:
|
||||
QString m_fileName;
|
||||
QStringList m_CurveNameList;
|
||||
// QList<CObjWellLog*> m_ObjList;
|
||||
};
|
||||
|
||||
|
|
@ -78,8 +78,6 @@ HEADERS += \
|
|||
CurveComputePage.h \
|
||||
CurveComputerDlg.h \
|
||||
CurvePropertyEdit.h \
|
||||
DataHelper.h \
|
||||
DataManagger.h \
|
||||
DrawCurveView.h \
|
||||
DrawWaveView.h \
|
||||
GeneratedFiles/SmoothTool.h \
|
||||
|
|
|
|||
|
|
@ -91,11 +91,36 @@ void PropertyWidget::InitCurrentViewInfo(bool bAll)
|
|||
}
|
||||
}
|
||||
|
||||
//处理通用属性
|
||||
void PropertyWidget::CommonPropertyChanged( QtProperty *pProperty, const QVariant &variant )
|
||||
{
|
||||
if("显示名称" == m_propertyData[pProperty])
|
||||
{
|
||||
QString newAliasName = variant.value<QString>();
|
||||
m_formInfo->m_strAliasName = newAliasName;
|
||||
m_formInfo->update();
|
||||
}
|
||||
else if("字体" == m_propertyData[pProperty])
|
||||
{
|
||||
//字体
|
||||
// 假设variant已经被设置为包含QColor
|
||||
QFont newFont = variant.value<QFont>();
|
||||
m_formInfo->m_curveNameFont = newFont;
|
||||
m_formInfo->update();
|
||||
}
|
||||
else if("颜色" == m_propertyData[pProperty])
|
||||
{
|
||||
QColor newColor = variant.value<QColor>();
|
||||
m_formInfo->m_lineColor = newColor;
|
||||
m_formInfo->update();
|
||||
}
|
||||
}
|
||||
|
||||
void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant &variant )
|
||||
{
|
||||
if(m_strCurrentProperty == "")
|
||||
return;
|
||||
if (m_strCurrentProperty == Table_Property)
|
||||
if (m_strCurrentProperty == Table_Property)//解释结论
|
||||
{
|
||||
bool bDraw = false;
|
||||
QStringList slist;
|
||||
|
|
@ -201,29 +226,69 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
|
|||
}
|
||||
return;
|
||||
}
|
||||
// else if (m_strCurrentProperty == Table_Property)
|
||||
// {
|
||||
// if("显示名称" == m_propertyData[pProperty])
|
||||
// {
|
||||
// QString newAliasName = variant.value<QString>();
|
||||
// m_formInfo->m_strAliasName = newAliasName;
|
||||
// m_formInfo->update();
|
||||
// }
|
||||
// else if("字体" == m_propertyData[pProperty])
|
||||
// {
|
||||
// //字体
|
||||
// // 假设variant已经被设置为包含QColor
|
||||
// QFont newFont = variant.value<QFont>();
|
||||
// m_formInfo->m_curveNameFont = newFont;
|
||||
// m_formInfo->update();
|
||||
// }
|
||||
// else if("颜色" == m_propertyData[pProperty])
|
||||
// {
|
||||
// QColor newColor = variant.value<QColor>();
|
||||
// m_formInfo->m_lineColor = newColor;
|
||||
// m_formInfo->update();
|
||||
// }
|
||||
// }
|
||||
else if (m_strCurrentProperty == Gujing_Property)//固井结论道
|
||||
{
|
||||
//先处理通用属性
|
||||
CommonPropertyChanged(pProperty, variant);
|
||||
|
||||
//
|
||||
if("选择井曲线" == m_propertyData[pProperty])
|
||||
{
|
||||
QString sFilePath = variant.value<QString>();
|
||||
if(sFilePath.indexOf("@")>-1)
|
||||
{
|
||||
int ind=sFilePath.indexOf("@");
|
||||
QString strLineName = sFilePath.left(ind);
|
||||
sFilePath=sFilePath.mid(ind+1);
|
||||
sFilePath.trimmed();
|
||||
//只支持以下名称
|
||||
if (strLineName == "GUJING1_RESULT" || strLineName == "GUJING2_RESULT" || strLineName == "GUJING3_RESULT")
|
||||
{
|
||||
QString strOldLineName = m_formInfo->m_strLineName;
|
||||
QString strOldSlfName = m_formInfo->m_strSlfName;
|
||||
//暂时不允许改变slf井次名称,不然不在同一口井绘制
|
||||
if(strOldSlfName != sFilePath)
|
||||
{
|
||||
QMessageBox::information(nullptr,"提示","不允许改变slf井次名称");
|
||||
return;
|
||||
}
|
||||
//名称不变
|
||||
if(strOldLineName == strLineName)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
m_formInfo->m_strLineName = strLineName;
|
||||
//m_formInfo->m_strSlfName = sFilePath;
|
||||
m_formInfo->update();
|
||||
|
||||
//改变固井曲线名
|
||||
emit CallManage::getInstance()->sig_changeGujingLine(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, strOldLineName, strLineName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_strCurrentProperty == SwallCore_Property)//井壁取心
|
||||
{
|
||||
//先处理通用属性
|
||||
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
|
||||
|
|
@ -264,6 +329,163 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (m_strCurrentProperty == SwallCoreItem_Property)
|
||||
{
|
||||
//井壁取心item
|
||||
if("深度" == m_propertyData[pProperty])
|
||||
{
|
||||
//qDebug() << "深度->改变";
|
||||
if(m_tdSwallCore)
|
||||
{
|
||||
double lower = variant.value<double>();
|
||||
// 设置初始范围
|
||||
double h = SideWallCoreHeight * g_dPixelPerCm; //0.4cm //40;
|
||||
double x1 = m_tdSwallCore->mPlot->xAxis->coordToPixel(-lower);
|
||||
//
|
||||
double Depth2 = m_tdSwallCore->mPlot->xAxis->pixelToCoord(x1-h);
|
||||
m_tdSwallCore->setRange(-lower, Depth2);
|
||||
//保存
|
||||
m_tdSwallCore->mPlot->SaveToSLF_SwallCore();
|
||||
}
|
||||
}
|
||||
else if("岩性" == m_propertyData[pProperty])
|
||||
{
|
||||
//qDebug() << "岩性->改变";
|
||||
if(m_tdSwallCore)
|
||||
{
|
||||
QString newResult = variant.value<QString>();
|
||||
m_tdSwallCore->setLith(newResult);
|
||||
//
|
||||
QCPRange currentRange = m_tdSwallCore->getRange();
|
||||
m_tdSwallCore->setRange(currentRange.lower, currentRange.upper);
|
||||
//保存
|
||||
m_tdSwallCore->mPlot->SaveToSLF_SwallCore();
|
||||
}
|
||||
}
|
||||
else if("油气" == m_propertyData[pProperty])
|
||||
{
|
||||
//qDebug() << "油气->改变";
|
||||
if(m_tdSwallCore)
|
||||
{
|
||||
QString newResult = variant.value<QString>();
|
||||
m_tdSwallCore->setOil(newResult);
|
||||
//
|
||||
QCPRange currentRange = m_tdSwallCore->getRange();
|
||||
m_tdSwallCore->setRange(currentRange.lower, currentRange.upper);
|
||||
//保存
|
||||
m_tdSwallCore->mPlot->SaveToSLF_SwallCore();
|
||||
}
|
||||
}
|
||||
else if("颜色" == m_propertyData[pProperty])
|
||||
{
|
||||
//qDebug() << "颜色->改变";
|
||||
if(m_tdSwallCore)
|
||||
{
|
||||
QString ColorImage = variant.value<QString>();
|
||||
|
||||
QString name = "";
|
||||
int CoreColor = 0;
|
||||
ColorImage.replace("\\","/");
|
||||
int l=ColorImage.lastIndexOf("/");
|
||||
if(l>-1) name=ColorImage.mid(l+1);
|
||||
|
||||
l=name.indexOf(".");
|
||||
if(l>-1)name=name.left(l);
|
||||
int ind=m_tdSwallCore->mPlot->colors_SWallCore.indexOf(name);
|
||||
if(ind<0||ind>=m_tdSwallCore->mPlot->colorinds_SWallCore.size()) CoreColor=0;
|
||||
else CoreColor=m_tdSwallCore->mPlot->colorinds_SWallCore[ind].toInt();
|
||||
|
||||
m_tdSwallCore->setTitle(QString::number(CoreColor));
|
||||
//
|
||||
QCPRange currentRange = m_tdSwallCore->getRange();
|
||||
m_tdSwallCore->setRange(currentRange.lower, currentRange.upper);
|
||||
//保存
|
||||
m_tdSwallCore->mPlot->SaveToSLF_SwallCore();
|
||||
}
|
||||
}
|
||||
else if("起始位置" == m_propertyData[pProperty])
|
||||
{
|
||||
//qDebug() << "起始位置->改变";
|
||||
if(m_tdSwallCore)
|
||||
{
|
||||
double Sideleft = variant.value<double>();
|
||||
m_tdSwallCore->m_fLeftSpace = Sideleft*g_dPixelPerCm;
|
||||
//
|
||||
QCPRange currentRange = m_tdSwallCore->getRange();
|
||||
m_tdSwallCore->setRange(currentRange.lower, currentRange.upper);
|
||||
//保存
|
||||
m_tdSwallCore->mPlot->SaveToSLF_SwallCore();
|
||||
}
|
||||
}
|
||||
}
|
||||
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])
|
||||
{
|
||||
|
|
@ -1400,6 +1622,16 @@ void PropertyWidget::initProperty(FormInfo *formInfo)
|
|||
//固井结论
|
||||
this->initGujingProperty(formInfo);
|
||||
}
|
||||
else if (m_strLineName == "SWALL_CORE")
|
||||
{
|
||||
//井壁取心
|
||||
this->initSwallCoreProperty(formInfo);
|
||||
}
|
||||
else if (m_strLineName == "GEO_LITH")
|
||||
{
|
||||
//录井剖面
|
||||
this->initGeoLithProperty(formInfo);
|
||||
}
|
||||
else{
|
||||
this->initTableProperty(formInfo);
|
||||
}
|
||||
|
|
@ -1535,6 +1767,35 @@ void PropertyWidget::initWaveProperty(FormInfo *formInfo, int nType)
|
|||
m_strCurrentProperty = Wave_Property;
|
||||
}
|
||||
|
||||
void PropertyWidget::initSwallCoreProperty(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);
|
||||
|
||||
m_strCurrentProperty = SwallCore_Property;
|
||||
}
|
||||
|
||||
void PropertyWidget::initSwallCoreItemProperty(TransparentDraggableSwallCore* tdSwallCore, double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int iColor)
|
||||
{
|
||||
//初始化,清空
|
||||
InitCurrentViewInfo();
|
||||
|
||||
//当前属性类型
|
||||
m_strCurrentProperty = SwallCoreItem_Property;
|
||||
m_tdSwallCore = tdSwallCore;
|
||||
|
||||
//
|
||||
_CreateVariantPropertyItem("当前项", "深度", -Depth, QVariant::Double);
|
||||
_CreateVariantPropertyItem("当前项", "岩性", LithologyImage, VariantManager::filePathTypeId());
|
||||
_CreateVariantPropertyItem("当前项", "油气", OilGasImage, VariantManager::filePathTypeId());
|
||||
_CreateVariantPropertyItem("当前项", "颜色", ColorImage, VariantManager::filePathTypeId());
|
||||
_CreateVariantPropertyItem("当前项", "起始位置", Sideleft, QVariant::Double);
|
||||
//_CreateVariantPropertyItem("当前项", "宽度", -Depth, QVariant::Double);
|
||||
}
|
||||
|
||||
void PropertyWidget::initGujingProperty(FormInfo *formInfo)
|
||||
{
|
||||
_CreateVariantPropertyItem("通常", "选择井曲线", m_strLineName + "@" + m_strSlfName, QVariant::String);
|
||||
|
|
@ -1543,7 +1804,7 @@ void PropertyWidget::initGujingProperty(FormInfo *formInfo)
|
|||
_CreateVariantPropertyItem("对象", "字体", formInfo->m_curveNameFont, QVariant::Font);
|
||||
_CreateVariantPropertyItem("对象", "颜色", formInfo->m_lineColor, QVariant::Color);
|
||||
|
||||
m_strCurrentProperty = Table_Property;
|
||||
m_strCurrentProperty = Gujing_Property;
|
||||
}
|
||||
|
||||
void PropertyWidget::initGujingItemProperty(TransparentDraggableGujing* tdGujing, double lower, double upper, QString strResult)
|
||||
|
|
@ -1560,3 +1821,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());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@
|
|||
#include "qmytablewidget.h"
|
||||
#include "formtracktop.h"
|
||||
#include "TransparentDraggableGujing.h"
|
||||
#include "TransparentDraggableSwallCore.h"
|
||||
#include "TransparentDraggableGeoLith.h"
|
||||
|
||||
//当前曲线类型
|
||||
#define Widget_Property "Widget_Property"
|
||||
|
|
@ -28,11 +30,17 @@
|
|||
#define Track_Property "Track_Property" //道
|
||||
#define Curve_Property "Curve_Property" //曲线
|
||||
#define Wave_Property "Wave_Property" //波列
|
||||
#define Table_Property "Table_Property" //表格曲线
|
||||
#define Head_Property "Head_Property" //图头,单元格
|
||||
#define GujingItem_Property "GujingItem_Property" //固井item
|
||||
|
||||
#define Table_Property "Table_Property" //解释结论
|
||||
#define Head_Property "Head_Property" //图头,单元格
|
||||
|
||||
#define Gujing_Property "Gujing_Property" //固井结论
|
||||
#define GujingItem_Property "GujingItem_Property" //固井item
|
||||
|
||||
#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")
|
||||
|
||||
|
|
@ -99,7 +107,9 @@ public:
|
|||
bool m_bSelfChange=false;
|
||||
|
||||
//
|
||||
TransparentDraggableGujing* m_tdGujing;
|
||||
TransparentDraggableGujing* m_tdGujing;
|
||||
TransparentDraggableSwallCore* m_tdSwallCore;
|
||||
TransparentDraggableGeoLith* m_tdGeoLith;
|
||||
|
||||
public:
|
||||
QWidget* GetPropertyWidget();
|
||||
|
|
@ -130,16 +140,27 @@ 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);
|
||||
|
||||
void ChangFillProperty();//填充属性改变
|
||||
// 井壁取心属性
|
||||
void initSwallCoreProperty(FormInfo *formInfo);
|
||||
void initSwallCoreItemProperty(TransparentDraggableSwallCore* tdSwallCore, double Depth, QString LithologyImage, QString OilGasImage, QString ColorImage, double Sideleft, double width, int iColor);
|
||||
|
||||
// 固井结论属性
|
||||
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();//图头项改变
|
||||
|
||||
//处理通用属性
|
||||
void CommonPropertyChanged(QtProperty *pProperty, const QVariant &variant);
|
||||
|
||||
public slots:
|
||||
void SlotPropertyChanged( QtProperty *property, const QVariant &variant );
|
||||
void SlotPropertyChanged(QtProperty *property, const QVariant &variant);
|
||||
void SlotPropertyChanged(QtProperty *property, const int &val, bool islinestyle);
|
||||
};
|
||||
|
||||
|
|
|
|||
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,14 +316,18 @@ 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, "", "", "", "", 1, "");
|
||||
emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 0, "");
|
||||
}
|
||||
|
||||
//删除
|
||||
|
|
@ -380,7 +384,7 @@ void TransparentDraggableGujing::setItemDepthOffset()
|
|||
PropertyService()->InitCurrentViewInfo();
|
||||
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 1, "");
|
||||
emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 0, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -606,7 +610,7 @@ void TransparentDraggableGujing::onMouseRelease(QMouseEvent *event)
|
|||
mPlot->SaveToSLF_Gujing();
|
||||
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 1, "");
|
||||
emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 0, "");
|
||||
}
|
||||
|
||||
//避免二次绘制框图
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@ TransparentDraggableSwallCore::TransparentDraggableSwallCore(QMyCustomPlot *pare
|
|||
: QObject(parentPlot), mPlot(parentPlot), mstrTitle(strTitle), mMinWidth(minWidth)
|
||||
{
|
||||
m_strUuid = strUuid;
|
||||
|
||||
//图片高度(需要根据高度宏定义,重新计算)
|
||||
// double h = SideWallCoreHeight * g_dPixelPerCm; //0.4cm //40;
|
||||
// m_fImageHeight = h/2.0;
|
||||
|
||||
//
|
||||
initRect();
|
||||
}
|
||||
|
|
@ -530,8 +535,18 @@ void TransparentDraggableSwallCore::onMousePress(QMouseEvent *event)
|
|||
//event->accept();
|
||||
|
||||
double low = mRect->topLeft->coords().x();
|
||||
double hight = mRect->bottomRight->coords().x();
|
||||
//PropertyService()->initSwallCoreItemProperty(this, low, hight, m_Result);
|
||||
//double hight = mRect->bottomRight->coords().x();
|
||||
QString ColorImage = "";
|
||||
int ind=mPlot->colorinds_SWallCore.indexOf(mstrTitle);
|
||||
if (ind>-1&&ind<mPlot->colors_SWallCore.size())
|
||||
{
|
||||
ColorImage=::GetColorSymbolDir()+""+mPlot->colors_SWallCore[ind]+".svg";
|
||||
}
|
||||
else {
|
||||
ColorImage="";
|
||||
}
|
||||
|
||||
PropertyService()->initSwallCoreItemProperty(this, low, m_Lith, m_Oil, ColorImage, m_fLeftSpace / g_dPixelPerCm, 1, mstrTitle.toInt());
|
||||
|
||||
QMenu menu(nullptr);
|
||||
menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除选中对象", this, &TransparentDraggableSwallCore::onDelRect);
|
||||
|
|
@ -701,10 +716,6 @@ void TransparentDraggableSwallCore::setItemDepthOffset()
|
|||
setRange(newRange.lower, newRange.upper);
|
||||
|
||||
{
|
||||
// double low = mRect->topLeft->coords().x();
|
||||
// double hight = mRect->bottomRight->coords().x();
|
||||
// PropertyService()->initGujingItemProperty(this, low, hight, m_Result);
|
||||
|
||||
//保存
|
||||
mPlot->SaveToSLF_SwallCore();
|
||||
|
||||
|
|
@ -712,7 +723,7 @@ void TransparentDraggableSwallCore::setItemDepthOffset()
|
|||
PropertyService()->InitCurrentViewInfo();
|
||||
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 1, "");
|
||||
emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 0, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -720,6 +731,29 @@ void TransparentDraggableSwallCore::onMouseRelease(QMouseEvent *event)
|
|||
{
|
||||
if(event->button() == Qt::LeftButton && mDragMode != DragNone) {
|
||||
event->accept();
|
||||
//属性
|
||||
//if(mDragMode == DragRect)
|
||||
{
|
||||
double low = mRect->topLeft->coords().x();
|
||||
QString ColorImage = "";
|
||||
int ind=mPlot->colorinds_SWallCore.indexOf(mstrTitle);
|
||||
if (ind>-1&&ind<mPlot->colors_SWallCore.size())
|
||||
{
|
||||
ColorImage=::GetColorSymbolDir()+""+mPlot->colors_SWallCore[ind]+".svg";
|
||||
}
|
||||
else {
|
||||
ColorImage="";
|
||||
}
|
||||
|
||||
PropertyService()->initSwallCoreItemProperty(this, low, m_Lith, m_Oil, ColorImage, m_fLeftSpace / g_dPixelPerCm, 1, mstrTitle.toInt());
|
||||
|
||||
//保存
|
||||
mPlot->SaveToSLF_SwallCore();
|
||||
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 0, "");
|
||||
}
|
||||
|
||||
//避免二次绘制框图
|
||||
mPlot->m_bDrawRect = false;
|
||||
//emit rangeChanged(getRange());
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ public:
|
|||
float m_fTriangleLen=40;//三角形长度
|
||||
//
|
||||
float m_fImageWidth=70;//图片长度
|
||||
float m_fImageHeight=20;//图片高度
|
||||
float m_fImageHeight=20;//图片高度(需要根据高度宏定义,重新计算)
|
||||
//
|
||||
float m_fColorWordLen=40;//颜色文字长度
|
||||
};
|
||||
|
|
|
|||
|
|
@ -299,10 +299,11 @@ 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")
|
||||
{
|
||||
//固井结论
|
||||
DisplayType_Gujing(lineObjInfo);
|
||||
//固井结论/井壁取心/录井剖面
|
||||
DisplayTable_One(lineObjInfo);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -315,8 +316,8 @@ void FormDraw::DisplayLines(QJsonArray linesArray)
|
|||
}
|
||||
}
|
||||
|
||||
//固井结论
|
||||
void FormDraw::DisplayType_Gujing(QJsonObject lineObjInfo)
|
||||
//结论
|
||||
void FormDraw::DisplayTable_One(QJsonObject lineObjInfo)
|
||||
{
|
||||
QString strSlfName = "";
|
||||
QString strWellName = "";
|
||||
|
|
@ -389,10 +390,16 @@ void FormDraw::DisplayType_Gujing(QJsonObject lineObjInfo)
|
|||
if (strLineName != "")
|
||||
{
|
||||
QStringList listOtherProperty;
|
||||
listOtherProperty.append(strAliasName);//固井别名
|
||||
listOtherProperty.append(lineColor.name());//固井名称颜色
|
||||
listOtherProperty.append(curveNameFont.toString());//固井名称字体
|
||||
//固井结论
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -874,12 +881,32 @@ 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")
|
||||
{
|
||||
//井壁取心
|
||||
initSwallCore(curv, strSlfName, strLineName);
|
||||
if(listOtherProperty.size()>=3)
|
||||
{
|
||||
QString strAliasName = listOtherProperty[0];
|
||||
QColor newlineColor=QColor(0,0,0);
|
||||
newlineColor.setNamedColor(listOtherProperty[1]);
|
||||
initSwallCore(curv, strSlfName, strLineName, strAliasName, newlineColor, listOtherProperty);
|
||||
}
|
||||
else
|
||||
{
|
||||
initSwallCore(curv, strSlfName, strLineName);
|
||||
}
|
||||
}
|
||||
else if (strLineName == "GUJING1_RESULT" || strLineName == "GUJING2_RESULT" || strLineName == "GUJING3_RESULT")
|
||||
{
|
||||
|
|
@ -3994,9 +4021,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;
|
||||
|
|
@ -4026,127 +4052,30 @@ 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)
|
||||
void FormDraw::initSwallCore(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName, QColor newlineColor, QStringList listOtherProperty)
|
||||
{
|
||||
|
||||
int iMyWidth = widget->axisRect(0)->width();
|
||||
|
|
@ -4181,13 +4110,16 @@ void FormDraw::initSwallCore(QMyCustomPlot *widget, QString strSlfName, QString
|
|||
//
|
||||
widget->LoadFromSLF_SwallCore(strSlfName, strLineName);
|
||||
|
||||
QString strAliasName = "";
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,11 +57,12 @@ public:
|
|||
void DisplayLines(QJsonArray linesArray);
|
||||
void DisplayLine_One(QJsonObject lineObjInfo);
|
||||
void DisplayType_One(QJsonObject objInfo);
|
||||
void DisplayType_Gujing(QJsonObject lineObjInfo);//固井结论
|
||||
|
||||
void DisplayTable_One(QJsonObject lineObjInfo); //结论
|
||||
|
||||
// 跨道设置
|
||||
void crossTrackSetting();
|
||||
|
||||
|
||||
private:
|
||||
Ui::FormDraw *ui;
|
||||
|
||||
|
|
@ -189,11 +190,10 @@ 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);
|
||||
void initSwallCore(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName = "井壁取心", QColor newlineColor=QColor(0,0,0), QStringList listOtherProperty={});
|
||||
|
||||
//固井结论
|
||||
void initGujing(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QString strAliasName = "固井结论", QColor newlineColor=QColor(0,0,0), QStringList listOtherProperty={});
|
||||
|
|
|
|||
|
|
@ -141,6 +141,26 @@ QJsonObject FormInfo::makeJson()
|
|||
//item属性写入slf文件,不需要此次记录
|
||||
return rootObj;
|
||||
}
|
||||
else if (m_strLineName == "SWALL_CORE")
|
||||
{
|
||||
//井壁取心
|
||||
rootObj["Type"] = m_strType;
|
||||
rootObj["curveNameFont"] = m_curveNameFont.toString();
|
||||
rootObj["lineColor"] = m_lineColor.name();
|
||||
//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;
|
||||
|
|
@ -411,12 +431,12 @@ 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")
|
||||
{
|
||||
//井壁取心,不绘制左右范围
|
||||
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 == "GUJING1_RESULT" || m_strLineName == "GUJING2_RESULT" || m_strLineName == "GUJING3_RESULT")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -145,6 +145,8 @@ public:
|
|||
QFont m_layerFont; // 层号字体
|
||||
float m_fLayerRotate = 0.0f; // 层号旋转
|
||||
|
||||
//录井剖面
|
||||
double m_dOilZhan=8; //含油占比
|
||||
|
||||
public:
|
||||
void setLineWidth(double dWidth);
|
||||
|
|
|
|||
|
|
@ -576,15 +576,25 @@ void FormTrack::s_AddTableLine(QString strSlfName, QString strWellName, QString
|
|||
formInfo->setVMin(vmin);
|
||||
formInfo->setFrontColor(QColor(0,0,0));
|
||||
formInfo->setBackColor(QColor(255,255,255));
|
||||
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")
|
||||
{
|
||||
//固井结论
|
||||
//固井结论 / 井壁取心 / 录井剖面
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -2147,6 +2147,11 @@ QStringList MainWindowCurve::getSelectWell_New()
|
|||
QString strSlfName = m_SelectTableItem.m_strSlfName;
|
||||
QString strWellName = m_SelectTableItem.m_strWellName;
|
||||
|
||||
if(strSlfName=="" || strWellName=="")
|
||||
{
|
||||
QMessageBox::warning(this, "提示", "请先选中待处理井次!");
|
||||
return sret;
|
||||
}
|
||||
sret << strWellName << strSlfName;
|
||||
return sret;
|
||||
}
|
||||
|
|
@ -2502,7 +2507,7 @@ void MainWindowCurve::mousePressEvent(QMouseEvent *event)
|
|||
|
||||
PropertyService()->initWidgetProperty(m_strUuid, m_iScale);
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "", 1, "");
|
||||
emit CallManage::getInstance()->sig_Raise(m_strUuid, "", "", "", "", 0, "");
|
||||
}
|
||||
|
||||
void MainWindowCurve::s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType, QString strFormInfoType)
|
||||
|
|
@ -2552,7 +2557,7 @@ void MainWindowCurve::onItemClicked(QTableWidgetItem* item)
|
|||
|
||||
PropertyService()->initWellProperty(m_strUuid, strSlfName, strWellName, m_iY1, m_iY2);
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(m_strUuid, strSlfName, strWellName, "", "", 1, "");
|
||||
emit CallManage::getInstance()->sig_Raise(m_strUuid, strSlfName, strWellName, "", "", 0, "");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -121,6 +121,10 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
|
|||
connect(CallManage::getInstance(), SIGNAL(sig_ReloadPlot(QString, QString, QString)), this, SLOT(s_ReloadPlot(QString, QString, QString)));
|
||||
|
||||
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)
|
||||
|
|
@ -954,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);
|
||||
//井壁取心
|
||||
|
|
@ -967,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);
|
||||
|
|
@ -1172,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;
|
||||
|
|
@ -1348,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()
|
||||
{
|
||||
|
|
@ -1560,37 +1880,7 @@ void QMyCustomPlot::moveItems_SWallCore()
|
|||
|
||||
//从剪切板文本数据粘贴
|
||||
void QMyCustomPlot::addItems_SWallCore()
|
||||
{
|
||||
//清空
|
||||
liths_SWallCore.clear();
|
||||
oils_SWallCore.clear();
|
||||
colors_SWallCore.clear();
|
||||
colorinds_SWallCore.clear();
|
||||
|
||||
QString cs=GetConfPath();
|
||||
QString color;
|
||||
for(int j=0;j<4;j++)
|
||||
{
|
||||
if(j==0) color=cs+"corecolor.ini";
|
||||
else if(j==1) color=cs+"corelith.ini";
|
||||
else if(j==2) color=cs+"coreoil.ini";
|
||||
else color=cs+"colorind.ini";
|
||||
FILE *fp=fopen(color.toStdString().c_str(),"rt");
|
||||
QStringList ss;
|
||||
char buf[100];
|
||||
if(fp) {
|
||||
while(!feof(fp)) {
|
||||
fscanf(fp,"%s",buf);
|
||||
ss.append(buf);
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
if(j==0) colors_SWallCore=ss;
|
||||
else if(j==1) liths_SWallCore=ss;
|
||||
else if(j==2) oils_SWallCore=ss;
|
||||
else colorinds_SWallCore=ss;
|
||||
}
|
||||
|
||||
{
|
||||
QClipboard *clipboard = QApplication::clipboard(); //获取系统剪贴板指针
|
||||
QString originalText = clipboard->text(); //获取剪贴板上文本信息
|
||||
int isspace=originalText.indexOf(" ");
|
||||
|
|
@ -1740,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()
|
||||
{
|
||||
|
|
@ -1759,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;
|
||||
|
|
@ -1770,10 +2415,11 @@ bool QMyCustomPlot::LoadFromSLF_SwallCore(QString strSlfName, QString strLineNam
|
|||
return false;
|
||||
}
|
||||
|
||||
QStringList liths;
|
||||
QStringList oils;
|
||||
QStringList colors;
|
||||
QStringList colorinds;
|
||||
//清空
|
||||
liths_SWallCore.clear();
|
||||
oils_SWallCore.clear();
|
||||
colors_SWallCore.clear();
|
||||
colorinds_SWallCore.clear();
|
||||
|
||||
QString cs=GetConfPath();
|
||||
QString color;
|
||||
|
|
@ -1793,10 +2439,10 @@ bool QMyCustomPlot::LoadFromSLF_SwallCore(QString strSlfName, QString strLineNam
|
|||
}
|
||||
fclose(fp);
|
||||
}
|
||||
if(j==0) colors=ss;
|
||||
else if(j==1) liths=ss;
|
||||
else if(j==2) oils=ss;
|
||||
else colorinds=ss;
|
||||
if(j==0) colors_SWallCore=ss;
|
||||
else if(j==1) liths_SWallCore=ss;
|
||||
else if(j==2) oils_SWallCore=ss;
|
||||
else colorinds_SWallCore=ss;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -1817,25 +2463,25 @@ bool QMyCustomPlot::LoadFromSLF_SwallCore(QString strSlfName, QString strLineNam
|
|||
if(m_Result.CoreLith<1) {
|
||||
LithologyImage="";
|
||||
}
|
||||
else if (liths.size()>=m_Result.CoreLith)
|
||||
else if (liths_SWallCore.size()>=m_Result.CoreLith)
|
||||
{
|
||||
LithologyImage=::GetSymbolDir()+"/取心岩性符号/"+liths[m_Result.CoreLith-1]+".svg";
|
||||
LithologyImage=::GetSymbolDir()+"/取心岩性符号/"+liths_SWallCore[m_Result.CoreLith-1]+".svg";
|
||||
QDir ss(LithologyImage);
|
||||
if(!ss.exists()) {
|
||||
LithologyImage=::GetSymbolDir()+"/取心岩性符号/"+liths[m_Result.CoreLith-1]+".png";
|
||||
LithologyImage=::GetSymbolDir()+"/取心岩性符号/"+liths_SWallCore[m_Result.CoreLith-1]+".png";
|
||||
}
|
||||
}
|
||||
if (m_Result.CoreOil>0&&oils.size()>=m_Result.CoreOil)
|
||||
if (m_Result.CoreOil>0&&oils_SWallCore.size()>=m_Result.CoreOil)
|
||||
{
|
||||
OilGasImage=::GetGasSymbolDir()+""+oils[m_Result.CoreOil-1]+".svg";
|
||||
OilGasImage=::GetGasSymbolDir()+""+oils_SWallCore[m_Result.CoreOil-1]+".svg";
|
||||
}
|
||||
else {
|
||||
OilGasImage="";
|
||||
}
|
||||
int ind=colorinds.indexOf(QString::number(m_Result.CoreColor));
|
||||
if (ind>-1&&ind<colors.size())
|
||||
int ind=colorinds_SWallCore.indexOf(QString::number(m_Result.CoreColor));
|
||||
if (ind>-1&&ind<colors_SWallCore.size())
|
||||
{
|
||||
ColorImage=::GetColorSymbolDir()+""+colors[ind]+".svg";
|
||||
ColorImage=::GetColorSymbolDir()+""+colors_SWallCore[ind]+".svg";
|
||||
}
|
||||
else {
|
||||
ColorImage="";
|
||||
|
|
@ -2887,7 +3533,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();
|
||||
|
|
@ -2899,7 +3545,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
|
||||
//最小宽度
|
||||
|
|
@ -4249,3 +4895,57 @@ void QMyCustomPlot::slot_time()
|
|||
}
|
||||
//replot();
|
||||
}
|
||||
|
||||
//改变固井曲线名
|
||||
void QMyCustomPlot::s_changeGujingLine(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strNewLineName)
|
||||
{
|
||||
if(m_strUuid == strUuid &&
|
||||
m_strSlfName == strSlfName &&
|
||||
m_strWellName == strWellName &&
|
||||
m_strTrackName == strTrackName &&
|
||||
m_strLineName == strLineName)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_strLineName = strNewLineName;
|
||||
//刷新数据
|
||||
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);
|
||||
|
||||
//不清空属性窗口
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,10 +172,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();
|
||||
|
||||
|
|
@ -191,7 +204,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);
|
||||
|
||||
|
|
@ -273,10 +286,12 @@ public slots:
|
|||
//右键--编辑曲线
|
||||
void onEditLine();
|
||||
|
||||
//通用
|
||||
void ClearSelectItems(); //取消选中
|
||||
|
||||
//右键--编辑固井
|
||||
void onEditGujing();
|
||||
void addItems_Gujing(); //从剪切板文本数据粘贴
|
||||
void ClearSelectItems(); //取消选中
|
||||
void DeleteItems_Gujing(); //全部清空
|
||||
void RefreshItems_Gujing(); //刷新数据
|
||||
void MegResult_Gujing(); //合并结论
|
||||
|
|
@ -289,6 +304,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,12 @@ public slots:
|
|||
//蝌蚪图重绘网格线
|
||||
void drawCustomElements();
|
||||
|
||||
//改变固井曲线名
|
||||
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