This commit is contained in:
crqiqi77 2026-04-01 18:05:46 +08:00
commit aa0ba1aae9
28 changed files with 2390 additions and 123 deletions

View File

@ -39,7 +39,7 @@ signals:
void sig_CloseProject();//关闭项目
void sig_ShowParameterCard(QString strSlfName, QString strName);//参数表查看
void sig_ShowCurve(QString strSlfName, QString strName);//曲线数据查看
void sig_ShowCurve(QMap<QString,QList<QString>> mapShowObject);//曲线数据查看
void sig_DepthShift(QString strSlfName, QString strName, double DepthOffset);//深度移动
void sig_ShowTable(QString strSlfName, QString strName);//表格数据查看
void sig_ShowWave(QString strSlfName, QString strName);//波列数据查看

View File

@ -1930,37 +1930,37 @@ void CDataManagger::CallDisplayWaveOrCurve(int Type, const QString& FileName,
}
// void CDataManagger::CallDisplayCurveVerChange(int Type, const QString& FileName,
// const QString& CurveName, QWidget* parent, int value, float tipValue)
// {
// //常规曲线
// if (Type == 0)
// {
// ShowCurve *pDlg=parent->findChild<ShowCurve*>("curveView");
// if(NULL == pDlg)
// {
// pDlg=new ShowCurve(parent);
// pDlg->setObjectName("curveView");
// pDlg->FileName=FileName;
// pDlg->CurveName=CurveName;
// pDlg->init();
// pDlg->show();
// }
void CDataManagger::CallDisplayCurveVerChange(int Type, const QString& FileName,
const QString& CurveName, QWidget* parent, int value, float tipValue)
{
//常规曲线
if (Type == 0)
{
ShowCurve *pDlg=parent->findChild<ShowCurve*>("curveView");
if(NULL == pDlg)
{
pDlg=new ShowCurve(parent);
pDlg->setObjectName("curveView");
pDlg->FileName=FileName;
pDlg->CurveName=CurveName;
pDlg->init();
pDlg->show();
}
// pDlg->linkVerDeptSliderValueChange(value, tipValue);
pDlg->linkVerDeptSliderValueChange(value, tipValue);
// }
}
// }
}
// void CDataManagger::sendTableP2Mgr(QWidget* parent, QScrollBar *p, QTableWidget *t)
// {
// ShowCurve *pDlg = parent->findChild<ShowCurve*>("curveView");
// if(NULL == pDlg) return;
void CDataManagger::sendTableP2Mgr(QWidget* parent, QScrollBar *p, QTableWidget *t)
{
ShowCurve *pDlg = parent->findChild<ShowCurve*>("curveView");
if(NULL == pDlg) return;
// pDlg->setTableBro(p);
// pDlg->setCurveTable(t);
// }
pDlg->setTableBro(p);
pDlg->setCurveTable(t);
}
/*
void CDataManagger::ListMessage(const QString& listName,const QStringList& header,const QStringList& listMessage)

View File

@ -70,6 +70,7 @@ FORMS += \
HEADERS += \
../../common/geometryutils.h \
../include/DataManagger.h \
AdaptionComboBox.h \
AngleAdjTool.h \
CheckHeadView.h \
@ -92,8 +93,7 @@ HEADERS += \
cdialog.h \
dataslothelper.h \
deptlineedit.h \
view.h \
../include/DataManagger.h
view.h
SOURCES += \
../../common/geometryutils.cpp \

View File

@ -138,6 +138,7 @@ public:
public:
void setName(QString strOldPath, QString strOldName, int nObjectType);
void setShowCurveName(QString strPath, QString strName, QMap<QString,QList<QString>> mapShowObject);
};
#endif /* PAITABLEWIDGET_H_ */

View File

@ -191,6 +191,7 @@ void WellLogTableDialogNew::setName(QString strOldPath, QString strOldName, int
pWellLog->m_name = strOldName;
m_pWellLogs.clear();
m_pWellLogs.append(pWellLog);
//初始化
InitWell();
@ -205,6 +206,46 @@ void WellLogTableDialogNew::setName(QString strOldPath, QString strOldName, int
//m_pUI->tableWidget->setCurrentCell(300, 0);
}
void WellLogTableDialogNew::setShowCurveName(QString strPath, QString strName, QMap<QString,QList<QString>> mapShowObject)
{
FileName = strPath;
CurveName = strName;
m_ObjectType = CURVE_OBJECT;
if (WAVE_OBJECT != m_ObjectType)
m_pUI->horizontalScrollBar->hide();
m_pWellLogs.clear();
QList<QString> listShowSlfName = mapShowObject.keys();
for(int i= 0; i < listShowSlfName.size(); i++)
{
QString strSlfName = listShowSlfName.at(i);
QList<QString> listObjectName = mapShowObject[listShowSlfName.at(i)];
for(int j= 0; j < listObjectName.size(); j++)
{
QString strCurveName = listObjectName.at(j);
CObjWellLog* pWellLog = new CObjWellLog;
pWellLog->SetSlfFileName(strSlfName);
pWellLog->m_name = strCurveName;
m_pWellLogs.append(pWellLog);
}
}
//初始化
InitWell();
m_gridData->m_middleWidth=0;
m_gridData->m_gridWidth=0;
InitWellLog();
qDebug() << "count=" << QString::number(count);
m_pUI->tableWidget->verticalScrollBar()->setRange(0, count);//count
m_pUI->tableWidget->verticalScrollBar()->setValue(count / 2);
//m_pUI->tableWidget->setCurrentCell(300, 0);
}
//井眼轨迹
void WellLogTableDialogNew::InitWell()
{

View File

@ -3448,17 +3448,17 @@ void GridDataAdapter::slotVerScrollValueChange(int nValue)
m_popTip->moveCursorPoint(m_popTipValue);
if(m_dtype == D_WellLogData){
// //20210111 GZL add 联动
// QWidget* parent=qobject_cast<QWidget*>(m_table->parent());
// QWidget* pvPage=parent->findChild<QWidget*>("curvePreViewPage");
// int value = (m_EDep-m_popTipValue)*CurveViewVerRange/(m_EDep-m_SDep)+1;
// if(value >= 0 && value <= CurveViewVerRange){
// m_mgr->CallDisplayCurveVerChange(0,fileName,curveName,pvPage,value,m_popTipValue);
//20210111 GZL add 联动
QWidget* parent=qobject_cast<QWidget*>(m_table->parent());
QWidget* pvPage=parent->findChild<QWidget*>("curvePreViewPage");
int value = (m_EDep-m_popTipValue)*CurveViewVerRange/(m_EDep-m_SDep)+1;
if(value >= 0 && value <= CurveViewVerRange){
m_mgr->CallDisplayCurveVerChange(0,fileName,curveName,pvPage,value,m_popTipValue);
// m_mgr->sendTableP2Mgr(pvPage, m_verScrolBar, m_table);
// }
m_mgr->sendTableP2Mgr(pvPage, m_verScrolBar, m_table);
}
// //updateTableView();
//updateTableView();
}
}
else{

View File

@ -0,0 +1,81 @@
#include "PluginDialog.h"
#include <QLabel>
#include <QDoubleValidator>
#include <QMessageBox>
#define DT_LEFT Qt::AlignLeft
#define DT_TOP Qt::AlignTop
#pragma execution_character_set("utf-8")
CPluginDialog::CPluginDialog(QWidget* parent):QDialog(parent)
, mNARMS(250)
{
//pushButton
uiDlg = new Ui_PluginDialog();
uiDlg->setupUi(this);
// 初始化按钮
initActions();
}
CPluginDialog::~CPluginDialog()
{
}
void CPluginDialog::paintEvent( QPaintEvent * event )
{
}
void CPluginDialog::init()
{
}
void CPluginDialog::initActions()
{
QAction* pAct1 = new QAction("Act1"); // 按钮1
pAct1->setProperty("icon_v", "icon/11.png"); // 设置按钮icon属性
pAct1->setToolTip("PluginDialog按钮1Tip"); // 设置按钮Tip
//
connect(pAct1, &QAction::triggered, this, &CPluginDialog::onAction1Func);
QAction* pAct2 = new QAction("Act2");
pAct2->setProperty("icon_v", "icon/bin.png");
pAct2->setToolTip("PluginDialog按钮2Tip");
connect(pAct2, &QAction::triggered, this, &CPluginDialog::onAction2Func);
QAction* pAct3 = new QAction("Act3");
pAct3->setProperty("icon_v", "icon/black.png");
pAct3->setToolTip("PluginDialog按钮2Tip111");
connect(pAct3, &QAction::triggered, this, &CPluginDialog::onAction3Func);
QAction* pAct4 = new QAction("Act4");
pAct4->setProperty("icon_v", "icon/black.png");
pAct4->setToolTip("PluginDialog按钮4Tip111");
m_listAction << pAct1;
m_listAction << pAct2;
m_listAction << pAct3;
m_listAction << pAct4;
}
QList<QAction *> CPluginDialog::getListAction()
{
return m_listAction;
}
void CPluginDialog::onAction1Func()
{
QMessageBox::information(NULL, "提示", "example_plugin 我是按钮111111弹窗");
}
void CPluginDialog::onAction2Func()
{
QMessageBox::information(NULL, "提示", "example_plugin 我是按钮222222弹窗");
}
void CPluginDialog::onAction3Func()
{
QMessageBox::information(NULL, "提示", "example_plugin 我是按钮333333弹窗");
}

View File

@ -0,0 +1,47 @@
#ifndef PLUGIN_DIALOG
#define PLUGIN_DIALOG
#include <QDialog>
#include <QWidget>
#include "ui_PluginDialog.h"
#define BOOL bool
#pragma once
#include <QAction>
class CPluginDialog:public QDialog
{
Q_OBJECT
protected:
void paintEvent( QPaintEvent * event );
public:
CPluginDialog(QWidget* parent);
~CPluginDialog();
void init();
// 初始化按钮显示在平台右侧ToolBar
void initActions();
// 平台获取该模块中自定义的QAction
QList<QAction*> getListAction();
public:
float m_StartDep;
float m_EndDep;
int mNARMS;
private:
Ui_PluginDialog *uiDlg;
QList<QAction*> m_listAction;
public:
public slots:
// QAction的槽函数处理
void onAction1Func();
void onAction2Func();
void onAction3Func();
};
#endif

View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PluginDialog</class>
<widget class="QDialog" name="PluginDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>425</width>
<height>304</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>160</x>
<y>120</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>TEST</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_2">
<property name="geometry">
<rect>
<x>170</x>
<y>160</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,350 @@
#include "memrdwt.h"
#include "math.h"
#include "basefun.h"
#include "DepthProgress.h"
#include "PluginDialog.h"
#include "pythonhandler.h"
Slf_WAVE mWave[1];
extern "C"{
__declspec (dllexport) struct INC_STRU INC=INC={6,
"FWGN_W:波名1,raw;;\
NWGN_W:2,raw;;\
RWGN_W:3,raw;;\
GR:,API;;\
NWGN_C:线2,raw;;\
RWGN_C:线3,raw;;\
"
};//输入曲线定义 6:输入6条数据, "数据英文:数据中文,数据单位;;"
__declspec (dllexport) struct INP_STRU INP; //使用GetINValue(RGN_C, 6, 1);函数需要定义该变量
__declspec (dllexport) struct OUTC_STRU OUTC={2,
"ATT:波名1,raw;;\
THCAV:线1,raw;;\
"
};//输出曲线定义 2:输出2条数据, "数据英文:数据中文,数据单位;;"(注:先写波形数据,再写曲线数据)
__declspec (dllexport) struct OUTP_STRU OUTP;
__declspec (dllexport) struct HD_STRU HD={0.0,9999.0,0.0,0.0,0.0,0.0,0.0,"example_plugin.INP","example_plugin.TLP"};
__declspec (dllexport) struct CONC_STRU CONC={4,
"CTH:参数名1,mm;;;;10.5;\
CT:2,%;;;;1;\
IT:3,mm;;;;9.7;\
MT:4,%;;;;1;"
};//常量参数定义 4:4个参数, "数据英文:数据中文,单位;;;;参数默认值;"
__declspec (dllexport) struct CON_STRU CON={10.5, 1, 9.7, 1}; //再次设置默认值(需要与前面相同)
__declspec (dllexport) struct ErrorInf errorinf;
//定义输出数据类型(注:需要与前面输出定义一一对应)
__declspec (dllexport) struct LogType LogType={WAVE_OBJECT, CURVE_OBJECT}; //{WAVE_OBJECT, CURVE_OBJECT}
__declspec( dllexport ) CMemRdWt MemRdWt;
__declspec (dllexport) int example_plugin(); //改成自己的工程名
//以下两行代码用于创建自定义界面来控制参数的对话框如果不需开发者自己定义对话框则不需要这两行及下面的InitDialog函数初始化
__declspec (dllexport) QDialog* InitDialog(QWidget *pF);
__declspec( dllexport ) CPluginDialog *PLGDialog=NULL;
__declspec( dllexport ) void* getAction_CApi(int* count);
__declspec (dllexport) int Init();
__declspec (dllexport) int Finish();
}
struct Process_Struct{
float fa;
float fb;
float fc;
int Process();
};
int Init()
{
return 1;
}
//此部分用于创建对话框,该第一话框将被显示在平台的参数区
//如果需要独立显示对话框,则不需熬此函数
QDialog* InitDialog(QWidget *pF)
{
PLGDialog=new CPluginDialog(pF);
return PLGDialog;
}
// 实现
void* getAction_CApi(int* count)
{
if(PLGDialog == nullptr)
InitDialog(nullptr);
QList<QAction*> actions = PLGDialog->getListAction();
int ncnt = actions.size();
*count = ncnt;
// 需要确保内存管理方式一致
QAction** array = new QAction*[ncnt];
for(int i = 0; i < ncnt; ++i) {
array[i] = actions[i];
}
return array;
}
int Finish()
{
return 1;
}
int example_plugin()
{
Process_Struct Process;
return Process.Process();
}
//固井结构体(注:此处为表格输出示例)
typedef struct ss_struct
{
int GNO;
float GSDEP,GEDEP;
int GRESULT;
} GUJING;
//结论结构体
void callPython(float FGN_C, float NGN_C, float RGN_C, float* FGN_W, float* NGN_W, float* Att0all, int nlen)
{
QVariantList args;
QVariantList arg1;
QVariantList arg2;
// 填充列表
for (int i = 0; i < nlen; ++i) {
arg1 << (double)FGN_W[i];
arg2 << (double)NGN_W[i];
}
args.append(QVariant::fromValue(arg1)); // 直接将 innerList1 作为元素添加
args.append(QVariant::fromValue(arg2)); // 使用 << 操作符
args << (double)FGN_C << (double)NGN_C << (double)RGN_C;
PythonHandler::getInstance()->executeScript("fdsa4_test", "process_arrays", args, Att0all, nlen);
}
int Process_Struct::Process()
{
if(HD.Sdep >= HD.EndDep)
{
// AfxMessageBox("当前处理井段深度有误!\n已停止计算");
// AfxMessageBox("The current depth of the processing interval is incorrect!\n Calculation has been stopped");
return 0;
}
/*******************************************************写数据前的准备操作*******************************************************
******************************begin****************************/
//1初始化参数、输入
MemRdWt.Const();
MemRdWt.In();
//2波形类型的输出数据初始化检查
char outname[2][16];
int OUTindex = 0, WaveIndex = 0;
MemRdWt.GetOutCurveName(OUTindex, outname[OUTindex]);//获取输出数据名称参数1是序列值从0开始波形/曲线均使用GetOutCurveName函数
int index1 = MemRdWt.OpenWave(outname[OUTindex]);//检查是否存在outname[OUTindex]波形
if(index1 < 0) //返回索引小于0说明没有该波形需要创建
{
//创建方式:
Slf_WAVE myWave;
strcpy(myWave.Name, outname[OUTindex]);
strcpy(myWave.AliasName, outname[OUTindex]);
strcpy(myWave.DepthUnit, "m");
myWave.CodeLen = 4;
myWave.RepCode = 4;
myWave.DefVal = 0;
myWave.StartDepth = HD.Sdep;
myWave.EndDepth = HD.Edep;
myWave.DepLevel = HD.Rlev;
strcpy(myWave.DepthUnit, "m");
myWave.StartTime = 0; //起始记录时间
myWave.TimeLevel = 5; //时间采样间隔
myWave.ArrayNum = 1; //阵列数
myWave.TimeSamples = 36; //时间采样总数
strcpy(myWave.TimeUnit, "ns"); //时间单位
index1 = MemRdWt.OpenWave((Slf_WAVE *)&myWave); //创建波形(注:此时返回索引应>1代表创建成功
}
if(index1 < 0)
{
// AfxMessageBox("阵列数据创建失败!\n已停止计算");
// AfxMessageBox("Array data creation failed!\nCalculation stopped");
return 0;
}else{
WaveIndex = index1;
}
//3曲线类型的输出数据初始化检查
OUTindex = 1;//按extern "C"中定义的输出数据顺序设置
MemRdWt.GetOutCurveName(OUTindex, outname[OUTindex]);//获取输出数据名称参数1是序列值从0开始
index1 = MemRdWt.OpenCurve(outname[1]);//index1 = MemRdWt.OpenCurve("EEE");//检查数据是否存在//outname[OUTindex]
if(index1 < 0) //返回索引小于0说明没有这条曲线需要创建
{
//创建方式:
Slf_CURVE myCurve; //定义曲线对象
strcpy(myCurve.Name, outname[1]); //设置名称
strcpy(myCurve.AliasName, outname[1]); //设置别名
strcpy(myCurve.Unit, "m"); //设置数据单位
myCurve.CodeLen = 4; //设置字节长度4float
myCurve.RepCode = 4; //设置数据类型4float
myCurve.DefVal = 0; //设置默认值
myCurve.StartDepth = HD.Sdep; //设置起始深度
myCurve.EndDepth = HD.Edep; //设置结束深度
myCurve.DepLevel = HD.Rlev; //设置采样间隔
strcpy(myCurve.DepthUnit, "m"); //设置深度单位
index1 = MemRdWt.OpenCurve((Slf_CURVE *)&myCurve); //创建曲线(注:此时返回索引应>1代表创建成功
}
if(index1 < 0)
{
// AfxMessageBox("波形数据创建失败!\n已停止计算");
// AfxMessageBox("Array data creation failed!\nCalculation stopped");
return 0;
}
/*********************************************************end************************************************************/
//4平台进度条设置
DepthProgress mmProgress;
mmProgress.CreatProgress(HD.Stdep, HD.EndDep, "程序处理中...");
//5深度循环
while(HD.Dep <= HD.EndDep)//逐深度处理
{
mmProgress.SetDepth(HD.Dep);//设置平台进度条
/********************************************************获取常量参数示例***************************************************
******************************begin****************************/
//GetPosValue函数的参数3为序列值要和extern "C"的CONC内容对应上从1开始
float CTH, CT, IT, MT;
GetPosValue(CTH, CON, 1, 1);
GetPosValue(CT, CON, 2, 1);
GetPosValue(IT, CON, 3, 1);
GetPosValue(MT, CON, 4, 1);
/***************************************************************end*************************************************************/
/********************************************************读数据示例***************************************************************
*****************************begin****************************/
//1读wave数据
char inname[3][36];
int index[4] = {-1};
//获取输入数据对应的波列名称参数1是序列值从0开始
MemRdWt.GetInCurveName(0, inname[0]);
MemRdWt.GetInCurveName(1, inname[1]);
MemRdWt.GetInCurveName(2, inname[2]);
//获取波列数据对应的index,再读数据
index[0] = MemRdWt.OpenWave(inname[0]);
index[1] = MemRdWt.OpenWave(inname[1]);
index[2] = MemRdWt.OpenWave(inname[2]);
if(index[0] < 0 || index[1] < 0 || index[2] < 0){
// AfxMessageBox("波列数据获取失败\n已停止计算");
// AfxMessageBox("Waveform data acquisition failed\nCalculation stopped");
return 0;
}
float FGN_W[60], NGN_W[60], RGN_W[60]; //必须根据wave数据的大小声明
int a = 0;
int b = 0; int c = 0;
c = MemRdWt.ReadWaveToFloatBuf(index[2], HD.Dep, 1, RGN_W);
b = MemRdWt.ReadWaveToFloatBuf(index[1], HD.Dep, 1, NGN_W);
a = MemRdWt.ReadWaveToFloatBuf(index[0], HD.Dep, 1, FGN_W);//读取wave数据从HD.Dep深度开始读1个深度位置的wave数据至FGN_W中
//2读曲线数据
//GetINValue函数的参数2为序列值要和extern "C"的INC内容的顺序对应上
float FGN_C, NGN_C, RGN_C;
GetINValue(FGN_C, 4, 1);
GetINValue(NGN_C, 5, 1);
GetINValue(RGN_C, 6, 1);
/********************************************************end*************************************************************/
/*******************************************处理程序示例(注:改成自己的算法)******************************************
*****************************begin****************************/
float Att0all[36];
float THCAV = 0.0;
bool bPython = true;
if (bPython)
{
callPython(FGN_C, NGN_C, RGN_C, FGN_W, NGN_W, Att0all, 36);
}
else
{
for(int i = 0; i < 36; i++)
Att0all[i] = FGN_W[i] + NGN_W[i];
THCAV = FGN_C + NGN_C + RGN_C;
}
/********************************************************end********************************************************/
/*******************************************************向平台写数据示例**********************************************
*****************************begin****************************/
//1写wave数据
MemRdWt.WriteWave(WaveIndex, HD.Dep, 1, &Att0all);
//2写curve数据
int THCAV_index = MemRdWt.OpenCurve(outname[1]);//outname[1]
if(THCAV_index > 0)
MemRdWt.WriteCurve(THCAV_index, HD.Dep, 1, &THCAV);
/*******************************************************end**********************************************************/
MemRdWt.In(); //继续深度循环
}
/*************************************************向平台写表格示例*************************************************************
*****************************begin****************************/
//1固井结论表格
int itable1 = MemRdWt.OpenOG_RESULT("固井质量");//例如表格取名为“固井质量”
MemRdWt.SetTableRecordCount(itable1, 0); //清空原有表格数据
GUJING *CCNN2 = new GUJING[5];
for(int i = 0; i < 5; i++)
{
CCNN2[i].GNO = i + 1;
CCNN2[i].GSDEP = 2000 + i * 10;
CCNN2[i].GEDEP = 2000 + (i + 1) * 10;
CCNN2[i].GRESULT = 1;
int temp = MemRdWt.WriteTable(itable1, i + 1, &CCNN2[i]);
}
//2其他表格
struct Slf_RST{
int Order;
float Depth;
float CorrDepth;
};
struct Slf_RST m_Result;
itable1 = MemRdWt.OpenTable("ABCD");
if (itable1 < 0)
{
itable1 = MemRdWt.Open_Set_Table("ABCD",0,3,
"NO,DEPTH,DDEP",
"4,4,4",//字段长度
"1,4,4",//字段类型
"0,0,0");//字段备注,1-枚举
}
MemRdWt.SetTableRecordCount(itable1,3); //设置表格有3行数据
for(int j = 0; j < 3; j++)
{
memset(&m_Result, 0, sizeof(Slf_RST));
m_Result.Order = j + 1;
m_Result.Depth = 10;
m_Result.CorrDepth = 20 + j;
MemRdWt.WriteTable(itable1, j + 1, &m_Result);
}
MemRdWt.CloseTable(itable1);
/******************************************************end*************************************************************/
return 1;
}

View File

@ -0,0 +1,32 @@
#pragma once
#define BOOL bool
#if defined(_WIN64)
typedef __int64 INT_PTR, *PINT_PTR;
typedef unsigned __int64 UINT_PTR, *PUINT_PTR;
typedef __int64 LONG_PTR, *PLONG_PTR;
typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
#define __int3264 __int64
#else
typedef _W64 int INT_PTR, *PINT_PTR;
typedef _W64 unsigned int UINT_PTR, *PUINT_PTR;
typedef _W64 long LONG_PTR, *PLONG_PTR;
typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR;
#define __int3264 __int32
#endif
typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR;
typedef long LONG;
#define MAKEWORD(a, b) ((WORD)(((BYTE)(((DWORD_PTR)(a)) & 0xff)) | ((WORD)((BYTE)(((DWORD_PTR)(b)) & 0xff))) << 8))
#define MAKELONG(a, b) ((LONG)(((WORD)(((DWORD_PTR)(a)) & 0xffff)) | ((DWORD)((WORD)(((DWORD_PTR)(b)) & 0xffff))) << 16))
#define LOWORD(l) ((WORD)(((DWORD_PTR)(l)) & 0xffff))
#define HIWORD(l) ((WORD)((((DWORD_PTR)(l)) >> 16) & 0xffff))
#define LOBYTE(w) ((BYTE)(((DWORD_PTR)(w)) & 0xff))
#define HIBYTE(w) ((BYTE)((((DWORD_PTR)(w)) >> 8) & 0xff))
#include "DepthProgress.h"

View File

@ -0,0 +1,54 @@
TEMPLATE = lib
TARGET = example_plugin
DEFINES += _TIMESPEC_DEFINED
QT += core \
gui \
network \
opengl
INCLUDEPATH += $$PWD/../../common \
$$PWD/../../include \
$$PWD/../../Slfio/include \
$$PWD/../../BaseFun/include \
$$PWD/../../Bin/Python312/include\
$$PWD/../../Bin/Python312/Lib/site-packages/numpy/_core/include\
$(QTDIR)/include \
OBJECTS_DIR = ../obj
CONFIG(debug, debug|release){
DESTDIR = $$PWD/../../Bin/app
TARGET = $$join(TARGET,,,d) #为debug版本生成的文件增加d的后缀
} else {
DESTDIR = $$PWD/../../BinR/app
TARGET = $$join(TARGET,,,)
}
CONFIG += qt warn_off \
debug_and_release
DEFINES += QT_DLL
HeadS += ../include/*.h
SOURCES += *.cpp
HEADERS += *.h
# 设置源文件编码为UTF-8
#win32: QMAKE_CXXFLAGS += /source-charset:utf-8 /execution-charset:utf-8
#macx: QMAKE_CXXFLAGS += -finput-charset=UTF-8 -fexec-charset=UTF-8
#linux: QMAKE_CXXFLAGS += -finput-charset=UTF-8 -fexec-charset=UTF-8
#CPATH = $$system(pwd)
# 目标文件夹
#CATEGORY = OSGDataModel
CONFIG(debug, debug|release){
LIBS += -L$$PWD/../../Bin -lBaseFund -lslfiod
LIBS += -L$$PWD/../../Bin/Python312/libs -lpython312
} else {
LIBS += -L$$PWD/../../BinR -lBaseFun -lslfio
LIBS += -L$$PWD/../../Bin/Python312/libs -lpython312
}
FORMS += \
PluginDialog.ui

View File

@ -0,0 +1,436 @@
#include "pythonhandler.h"
#include <QCoreApplication>
#include <QFile>
#include <QProcessEnvironment>
PythonHandler::PythonHandler(QObject *parent)
: QObject(parent)
, m_initialized(false)
{
}
PythonHandler::~PythonHandler()
{
finalize();
}
PythonHandler *PythonHandler::getInstance()
{
static PythonHandler ref;
return &ref;
}
bool PythonHandler::initialize()
{
if (m_initialized) {
return true;
}
// 获取程序所在目录
QString appDir = QCoreApplication::applicationDirPath();
QString strPy= appDir + "/" + PYTHON_VER;
setupEnvironment(strPy);
strPy.toStdWString().c_str();
// 初始化Python解释器
Py_Initialize();
if (!Py_IsInitialized()) {
qDebug() << "Python初始化失败";
return false;
}
// 添加Python脚本路径 - 使用绝对路径会更可靠
QString currentPath = QCoreApplication::applicationDirPath();
QString scriptPath = currentPath + "/python_scripts";
// QString strPy= currentPath + "/" + PYTHON_VER;
// QString scriptPython2 = strPy + "/DLLs";
// QString scriptPython3 = strPy + "/Lib";
// QString scriptPython4 = strPy + "/lib/site-packages";
// emit addLog(scriptPath);
QString pythonCode = QString(
"import sys\n"
"import os\n"
"sys.path.append('%1')\n"
"print('========== Python 调试信息 ==========')\n"
"print('当前工作目录:', os.getcwd())\n"
"print('exepath:', sys.executable)\n"
"print('Python 搜索路径:')\n"
"for p in sys.path:\n"
" print(' -', p)\n"
"print('======================================')\n"
).arg(scriptPath);
// emit addLog(pythonCode);
PyRun_SimpleString(pythonCode.toStdString().c_str());
m_initialized = true;
return true;
}
void PythonHandler::setupEnvironment(QString strPy)
{
// 使用 Qt 的方式设置环境变量
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
// 设置 PYTHONHOME
qputenv("PYTHONHOME", strPy.toLocal8Bit());
// 设置 PYTHONPATH
QString pythonPath = strPy + "/Lib;" + strPy + "/lib/site-packages;" + strPy + "/DLLs;";
qputenv("PYTHONPATH", pythonPath.toLocal8Bit());
// 修改 PATH添加程序目录
QString currentPath = QString::fromLocal8Bit(qgetenv("PATH"));
QString newPath = strPy + "/DLLs;" + currentPath;
qputenv("PATH", newPath.toLocal8Bit());
qDebug() << "Environment:";
qDebug() << "PYTHONHOME:" << qgetenv("PYTHONHOME");
qDebug() << "PYTHONPATH:" << qgetenv("PYTHONPATH");
}
void PythonHandler::finalize()
{
if (m_initialized) {
Py_Finalize();
m_initialized = false;
}
}
PyObject* PythonHandler::qVariantToPythonObject(const QVariant &value)
{
switch (value.type()) {
case QVariant::Int:
return PyLong_FromLong(value.toInt());
case QVariant::Double:
return PyFloat_FromDouble(value.toDouble());
case QVariant::String:
return PyUnicode_FromString(value.toString().toStdString().c_str());
case QVariant::List: {
QVariantList list = value.toList();
PyObject* pyList = PyList_New(list.size());
for (int i = 0; i < list.size(); ++i) {
PyList_SetItem(pyList, i, qVariantToPythonObject(list[i]));
}
return pyList;
}
case QVariant::Bool:
return PyBool_FromLong(value.toBool() ? 1 : 0);
default:
return Py_None;
}
}
QVariant PythonHandler::pythonObjectToQVariant(PyObject *obj)
{
if (!obj) {
qDebug() << "pythonObjectToQVariant: 输入对象为NULL";
return QVariant();
}
qDebug() << "pythonObjectToQVariant: 转换类型" << Py_TYPE(obj)->tp_name;
if (PyLong_Check(obj)) {
long long value = PyLong_AsLongLong(obj);
if (PyErr_Occurred()) {
PyErr_Clear();
return QVariant();
}
qDebug() << "转换为整数:" << value;
return QVariant(value);
}
else if (PyFloat_Check(obj)) {
double value = PyFloat_AsDouble(obj);
qDebug() << "转换为浮点数:" << value;
return QVariant(value);
}
else if (PyBool_Check(obj)) {
bool value = (obj == Py_True);
qDebug() << "转换为布尔值:" << value;
return QVariant(value);
}
else if (PyUnicode_Check(obj)) {
QString value = QString::fromUtf8(PyUnicode_AsUTF8(obj));
qDebug() << "转换为字符串:" << value;
return QVariant(value);
}
else if (PyList_Check(obj)) {
QVariantList list;
Py_ssize_t size = PyList_Size(obj);
qDebug() << "转换为列表,大小:" << size;
for (Py_ssize_t i = 0; i < size; ++i) {
PyObject* item = PyList_GetItem(obj, i);
if (item) {
list.append(pythonObjectToQVariant(item));
} else {
list.append(QVariant());
}
}
return list;
}
else if (PyTuple_Check(obj)) {
QVariantList list;
Py_ssize_t size = PyTuple_Size(obj);
qDebug() << "转换为元组,大小:" << size;
for (Py_ssize_t i = 0; i < size; ++i) {
PyObject* item = PyTuple_GetItem(obj, i);
if (item) {
list.append(pythonObjectToQVariant(item));
} else {
list.append(QVariant());
}
}
return list;
}
else if (PyDict_Check(obj)) {
QVariantMap map;
PyObject* pKeys = PyDict_Keys(obj);
Py_ssize_t size = PyList_Size(pKeys);
qDebug() << "转换为字典,大小:" << size;
for (Py_ssize_t i = 0; i < size; ++i) {
PyObject* pKey = PyList_GetItem(pKeys, i);
PyObject* pValue = PyDict_GetItem(obj, pKey);
if (pKey && pValue && PyUnicode_Check(pKey)) {
QString key = QString::fromUtf8(PyUnicode_AsUTF8(pKey));
map[key] = pythonObjectToQVariant(pValue);
}
}
Py_DECREF(pKeys);
return map;
}
else if (obj == Py_None) {
qDebug() << "转换为None";
return QVariant();
}
else {
qDebug() << "未知类型返回空QVariant";
return QVariant();
}
}
QString PythonHandler::capturePythonError() {
QString errorMsg;
PyObject *ptype, *pvalue, *ptraceback;
PyErr_Fetch(&ptype, &pvalue, &ptraceback);
if (pvalue) {
PyObject* pstr = PyObject_Str(pvalue);
if (pstr) {
errorMsg = QString::fromUtf8(PyUnicode_AsUTF8(pstr));
Py_DECREF(pstr);
}
}
// 清理
Py_XDECREF(ptype);
Py_XDECREF(pvalue);
Py_XDECREF(ptraceback);
return errorMsg;
}
QVariant PythonHandler::executeScript(const QString &scriptPath,
const QString &functionName,
const QVariantList &args,
float* outAtt0all,
int nlen)
{
if (!m_initialized && !initialize()) {
return QVariant();
}
// 获取全局字典
PyObject* pModule = nullptr;
PyObject* pFunc = nullptr;
PyObject* pArgs = nullptr;
PyObject* pResult = nullptr;
QVariant result;
// 导入模块
QString moduleName = scriptPath;
if (moduleName.endsWith(".py")) {
moduleName.chop(3);
}
// pModule = PyImport_ImportModule("numpy");
// if (!pModule) {
// QString error = capturePythonError();
// qDebug() << "Python error:" << error;
//
// PyErr_Print();
// emit addLog("无法导入Python模块:" + moduleName);
// return QVariant();
// }
pModule = PyImport_ImportModule(moduleName.toStdString().c_str());
if (!pModule) {
QString error = capturePythonError();
qDebug() << "Python error:" << error;
//PyErr_Print();
emit addLog("无法导入Python模块:" + moduleName);
return QVariant();
}
// 获取函数
pFunc = PyObject_GetAttrString(pModule, functionName.toStdString().c_str());
if (!pFunc || !PyCallable_Check(pFunc)) {
if (PyErr_Occurred()) {
PyErr_Print();
}
emit addLog("无法找到函数:" + functionName);
Py_XDECREF(pFunc);
Py_DECREF(pModule);
return QVariant();
}
// 构建参数
pArgs = PyTuple_New(args.size());
for (int i = 0; i < args.size(); ++i) {
PyTuple_SetItem(pArgs, i, qVariantToPythonObject(args[i]));
}
// 调用函数
pResult = PyObject_CallObject(pFunc, pArgs);
if (pResult) {
if(outAtt0all)
{
PyObject* array1 = PyTuple_GetItem(pResult, 0);
double dR = PyFloat_AsDouble(PyTuple_GetItem(pResult, 1)); // 获取double
// // 将numpy数组转换为C++数组例如使用numpy的API
// PyArrayObject* arr1 = (PyArrayObject*)PyArray_FromAny(array1, NULL, 0, 0, NPY_ARRAY_CARRAY, NULL);
PyArrayObject* arr1 = (PyArrayObject*)array1;
double* data1 = (double*)PyArray_DATA(arr1);
int len = PyArray_DIM(arr1, 0); // 获取数组长度
if (len>nlen)
len = nlen;
for (int i = 0; i < len; i++) {
outAtt0all[i] = data1[i];
}
#ifdef _RELEASE
Py_DECREF(arr1);
#endif
}
else
{
result = pythonObjectToQVariant(pResult);
QMap<QString, QVariant> imgResult = result.toMap();
emit addLog("1#executeScript" + QString::number(imgResult.size()));
}
} else {
PyErr_Print();
emit addLog("函数调用失败");
}
#ifdef _RELEASE
// 清理
Py_XDECREF(pResult);
Py_XDECREF(pArgs);
Py_XDECREF(pFunc);
Py_XDECREF(pModule);
#endif
return result;
}
/*
QVariant PythonHandler::executeScript(const QString &scriptPath,
const QString &functionName,
const QVariantList &args)
{
if (!m_initialized && !initialize()) {
return QVariant();
}
// 获取全局字典
PyObject* pModule = nullptr;
PyObject* pFunc = nullptr;
PyObject* pArgs = nullptr;
PyObject* pResult = nullptr;
QVariant result;
// 导入模块
QString moduleName = scriptPath;
if (moduleName.endsWith(".py")) {
moduleName.chop(3);
}
pModule = PyImport_ImportModule(moduleName.toStdString().c_str());
if (!pModule) {
PyErr_Print();
emit addLog("无法导入Python模块:" + moduleName);
return QVariant();
}
// 获取函数
pFunc = PyObject_GetAttrString(pModule, functionName.toStdString().c_str());
if (!pFunc || !PyCallable_Check(pFunc)) {
if (PyErr_Occurred()) {
PyErr_Print();
}
emit addLog("无法找到函数:" + functionName);
Py_XDECREF(pFunc);
Py_DECREF(pModule);
return QVariant();
}
// 构建参数
pArgs = PyTuple_New(args.size());
for (int i = 0; i < args.size(); ++i) {
PyTuple_SetItem(pArgs, i, qVariantToPythonObject(args[i]));
}
// 调用函数
pResult = PyObject_CallObject(pFunc, pArgs);
if (pResult) {
result = pythonObjectToQVariant(pResult);
QMap<QString, QVariant> imgResult = result.toMap();
emit addLog("1#executeScript" + QString::number(imgResult.size()));
} else {
PyErr_Print();
emit addLog("函数调用失败");
}
#ifdef _RELEASE
// 清理
Py_XDECREF(pResult);
Py_XDECREF(pArgs);
Py_XDECREF(pFunc);
Py_XDECREF(pModule);
#endif
return result;
}
*/
QVariant PythonHandler::executeCode(const QString &code)
{
if (!m_initialized && !initialize()) {
return QVariant();
}
PyObject* pMain = PyImport_AddModule("__main__");
PyObject* pDict = PyModule_GetDict(pMain);
PyObject* pResult = PyRun_String(code.toStdString().c_str(),
Py_eval_input,
pDict,
pDict);
if (pResult) {
QVariant result = pythonObjectToQVariant(pResult);
Py_DECREF(pResult);
return result;
} else {
PyErr_Print();
return QVariant();
}
}

View File

@ -0,0 +1,59 @@
#ifndef PYTHONHANDLER_H
#define PYTHONHANDLER_H
#include <QObject>
#include <QString>
#include <QVariant>
#include <QDebug>
// 在包含 Python.h 之前,保存并取消 Qt 的 slots 宏
#pragma push_macro("slots")
#undef slots
#include <Python.h>
#include <numpy/arrayobject.h>
// 包含之后恢复 slots 宏(如果需要继续使用 Qt 的 slots
#pragma pop_macro("slots")
#define PYTHON_VER "Python312"
class PythonHandler : public QObject
{
Q_OBJECT
public:
explicit PythonHandler(QObject *parent = nullptr);
~PythonHandler();
static PythonHandler* getInstance();
// 初始化Python解释器
bool initialize();
void setupEnvironment(QString strPy);
QString capturePythonError();
// 执行Python脚本
QVariant executeScript(const QString &scriptPath,
const QString &functionName,
const QVariantList &args = QVariantList() ,
float* outAtt0all = NULL, int nlen = 0);
// 直接执行Python代码
QVariant executeCode(const QString &code);
// 关闭Python解释器
void finalize();
signals:
void addLog(QString msg);
private:
bool m_initialized;
QVariant pythonObjectToQVariant(PyObject *obj);
PyObject* qVariantToPythonObject(const QVariant &value);
};
#endif // PYTHONHANDLER_H

View File

@ -46,7 +46,7 @@ HEADERS += \
CONFIG(debug, debug|release){
LIBS += -L$$PWD/../../Bin -lslfiod
LIBS += -L$$PWD/../../Bin -lBaseFund
LIBS += -LD:/Python312/libs -lpython312_d
LIBS += -LD:/Python312/libs -lpython312
# LIBS += -L$(QTDIR)/lib -lQtNetworkd4
# LIBS += -LD:/Qt4.7.1/lib -lQtNetworkd4
} else {

View File

@ -1,12 +0,0 @@
# This Python file uses the following encoding: utf-8
# if __name__ == "__main__":
# pass
import os
import sys
import numpy as np
def process_arrays(a, b, c, d, e):
result = [x + y for x, y in zip(a, b)]
return np.array(result), c+d+e

View File

@ -7,10 +7,6 @@ PythonHandler::PythonHandler(QObject *parent)
: QObject(parent)
, m_initialized(false)
{
// 初始化Python
if (!this->initialize()) {
qDebug() << "Python初始化失败";
}
}
PythonHandler::~PythonHandler()
@ -30,8 +26,11 @@ bool PythonHandler::initialize()
return true;
}
setupEnvironment();
// 获取程序所在目录
QString appDir = QCoreApplication::applicationDirPath();
QString strPy= appDir + "/" + PYTHON_VER;
setupEnvironment(strPy);
strPy.toStdWString().c_str();
// 初始化Python解释器
Py_Initialize();
@ -44,22 +43,15 @@ bool PythonHandler::initialize()
QString currentPath = QCoreApplication::applicationDirPath();
QString scriptPath = currentPath + "/python_scripts";
QString strPy= currentPath + "/" + PYTHON_VER;
QString scriptPython2 = strPy + "/DLLs";
QString scriptPython3 = strPy + "/Lib";
QString scriptPython4 = strPy + "/lib/site-packages";
// QString strPy= currentPath + "/" + PYTHON_VER;
// QString scriptPython2 = strPy + "/DLLs";
// QString scriptPython3 = strPy + "/Lib";
// QString scriptPython4 = strPy + "/lib/site-packages";
// emit addLog(scriptPath);
QString pythonCode = QString(
"import sys\n"
"import os\n"
"print('Python_:', sys.path)\n"
"sys.path.append('%1')\n"
"sys.path.append('%2')\n"
"sys.path.append('%3')\n"
"sys.path.append('%4')\n"
"sys.path.append('%5')\n"
"sys.path.append('%6')\n"
"print('end_:', sys.path)\n"
"print('========== Python 调试信息 ==========')\n"
"print('当前工作目录:', os.getcwd())\n"
"print('exepath:', sys.executable)\n"
@ -67,8 +59,7 @@ bool PythonHandler::initialize()
"for p in sys.path:\n"
" print(' -', p)\n"
"print('======================================')\n"
).arg(currentPath).arg(scriptPath)
.arg(strPy).arg(scriptPython2).arg(scriptPython3).arg(scriptPython4);
).arg(scriptPath);
// emit addLog(pythonCode);
PyRun_SimpleString(pythonCode.toStdString().c_str());
@ -76,28 +67,24 @@ bool PythonHandler::initialize()
return true;
}
void PythonHandler::setupEnvironment()
void PythonHandler::setupEnvironment(QString strPy)
{
// 获取程序所在目录
QString appDir = QCoreApplication::applicationDirPath();
// 使用 Qt 的方式设置环境变量
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
// 设置 PYTHONHOME
qputenv("PYTHONHOME", appDir.toLocal8Bit());
qputenv("PYTHONHOME", strPy.toLocal8Bit());
QString strPy= appDir + "/" + PYTHON_VER;
// 设置 PYTHONPATH
QString pythonPath = strPy + "/Lib;" + strPy + "/DLLs;" + strPy + "/python_scripts";
QString pythonPath = strPy + "/Lib;" + strPy + "/lib/site-packages;" + strPy + "/DLLs;";
qputenv("PYTHONPATH", pythonPath.toLocal8Bit());
// 修改 PATH添加程序目录
QString currentPath = QString::fromLocal8Bit(qgetenv("PATH"));
QString newPath = appDir + ";" + strPy + "/DLLs;" + currentPath;
QString newPath = strPy + "/DLLs;" + currentPath;
qputenv("PATH", newPath.toLocal8Bit());
qDebug() << "环境变量已设置:";
qDebug() << "Environment:";
qDebug() << "PYTHONHOME:" << qgetenv("PYTHONHOME");
qDebug() << "PYTHONPATH:" << qgetenv("PYTHONPATH");
}
@ -225,6 +212,32 @@ QVariant PythonHandler::pythonObjectToQVariant(PyObject *obj)
}
}
QString PythonHandler::capturePythonError() {
QString errorMsg;
PyObject *ptype, *pvalue, *ptraceback;
PyErr_Fetch(&ptype, &pvalue, &ptraceback);
if (pvalue) {
PyObject* pstr = PyObject_Str(pvalue);
if (pstr) {
errorMsg = QString::fromUtf8(PyUnicode_AsUTF8(pstr));
#ifdef _RELEASE
Py_DECREF(pstr);
#endif
}
}
#ifdef _RELEASE
// 清理
Py_XDECREF(ptype);
Py_XDECREF(pvalue);
Py_XDECREF(ptraceback);
#endif
return errorMsg;
}
QVariant PythonHandler::executeScript(const QString &scriptPath,
const QString &functionName,
const QVariantList &args,
@ -247,11 +260,22 @@ QVariant PythonHandler::executeScript(const QString &scriptPath,
if (moduleName.endsWith(".py")) {
moduleName.chop(3);
}
// pModule = PyImport_ImportModule("numpy");
// if (!pModule) {
// QString error = capturePythonError();
// qDebug() << "Python error:" << error;
//
// PyErr_Print();
// emit addLog("无法导入Python模块:" + moduleName);
// return QVariant();
// }
pModule = PyImport_ImportModule(moduleName.toStdString().c_str());
if (!pModule) {
PyErr_Print();
QString error = capturePythonError();
qDebug() << "Python error:" << error;
//PyErr_Print();
emit addLog("无法导入Python模块:" + moduleName);
return QVariant();
}
@ -319,6 +343,78 @@ QVariant PythonHandler::executeScript(const QString &scriptPath,
return result;
}
/*
QVariant PythonHandler::executeScript(const QString &scriptPath,
const QString &functionName,
const QVariantList &args)
{
if (!m_initialized && !initialize()) {
return QVariant();
}
// 获取全局字典
PyObject* pModule = nullptr;
PyObject* pFunc = nullptr;
PyObject* pArgs = nullptr;
PyObject* pResult = nullptr;
QVariant result;
// 导入模块
QString moduleName = scriptPath;
if (moduleName.endsWith(".py")) {
moduleName.chop(3);
}
pModule = PyImport_ImportModule(moduleName.toStdString().c_str());
if (!pModule) {
PyErr_Print();
emit addLog("无法导入Python模块:" + moduleName);
return QVariant();
}
// 获取函数
pFunc = PyObject_GetAttrString(pModule, functionName.toStdString().c_str());
if (!pFunc || !PyCallable_Check(pFunc)) {
if (PyErr_Occurred()) {
PyErr_Print();
}
emit addLog("无法找到函数:" + functionName);
Py_XDECREF(pFunc);
Py_DECREF(pModule);
return QVariant();
}
// 构建参数
pArgs = PyTuple_New(args.size());
for (int i = 0; i < args.size(); ++i) {
PyTuple_SetItem(pArgs, i, qVariantToPythonObject(args[i]));
}
// 调用函数
pResult = PyObject_CallObject(pFunc, pArgs);
if (pResult) {
result = pythonObjectToQVariant(pResult);
QMap<QString, QVariant> imgResult = result.toMap();
emit addLog("1#executeScript" + QString::number(imgResult.size()));
} else {
PyErr_Print();
emit addLog("函数调用失败");
}
#ifdef _RELEASE
// 清理
Py_XDECREF(pResult);
Py_XDECREF(pArgs);
Py_XDECREF(pFunc);
Py_XDECREF(pModule);
#endif
return result;
}
*/
QVariant PythonHandler::executeCode(const QString &code)
{
if (!m_initialized && !initialize()) {

View File

@ -31,7 +31,9 @@ public:
// 初始化Python解释器
bool initialize();
void setupEnvironment();
void setupEnvironment(QString strPy);
QString capturePythonError();
// 执行Python脚本
QVariant executeScript(const QString &scriptPath,

View File

@ -95,6 +95,12 @@ typedef struct s2_struct
void callPython(float FGN_C, float NGN_C, float RGN_C, float* FGN_W, float* NGN_W, float* Att0all, int nlen)
{
QVariantList args;
// args << 0.77;
// args << 2.93;
// args << 50;
// PythonHandler::getInstance()->executeScript("UCS_test_0330", "get_UCS_Horsrud_correlation_shale", args, NULL, nlen);
// return;
QVariantList arg1;
QVariantList arg2;
// 填充列表

View File

@ -1655,7 +1655,13 @@ void FormInfo::contextMenuEvent(QContextMenuEvent *event)
//曲线数据查看
void FormInfo::onShowCurve()
{
emit CallManage::getInstance()->sig_ShowCurve(m_strSlfName, m_strLineName);
QMap<QString,QList<QString>> mapShowObject;
QList<QString> selList;
selList.clear();
mapShowObject.insert(m_strSlfName,selList);
mapShowObject[m_strSlfName].append(m_strLineName);
emit CallManage::getInstance()->sig_ShowCurve(mapShowObject);
// emit CallManage::getInstance()->sig_ShowCurve(m_strSlfName, m_strLineName);
}
//删除曲线
void FormInfo::onDeleteCurv()

284
logPlus/logplus.vcxproj Normal file
View File

@ -0,0 +1,284 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<QtMoc Include="selectwelldialog.h" />
<QtMoc Include="TransparentDraggableCorePhysics.h" />
<QtMoc Include="YxzpDialog.h" />
<QtMoc Include="TransparentDraggableLayer.h" />
<QtMoc Include="TransparentGroupResult.h" />
<QtMoc Include="transparentdraggableRightList.h" />
<QtMoc Include="transparentdraggableSelectRect.h" />
<QtMoc Include="..\CallManage\CallManage.h" />
<QtMoc Include="..\common\dropdownbutton.h" />
<ClInclude Include="..\common\geometryutils.h" />
<ClInclude Include="3rd_qcustomplot\smoothcurve.h" />
<QtMoc Include="3rd_qcustomplot\v2_1\qcustomplot.h" />
<ClInclude Include="backgrounddelegate.h" />
<ClInclude Include="CStringType.h" />
<ClInclude Include="CurveLine.h" />
<ClInclude Include="customellipse.h" />
<ClInclude Include="DepPairs.h" />
<ClInclude Include="DrawTvd.h" />
<QtMoc Include="formhead.h" />
<QtMoc Include="formmultiheads.h" />
<QtMoc Include="fracsel.h" />
<ClInclude Include="GeoIndicatorGenerator.h" />
<ClInclude Include="Gradient.h" />
<QtMoc Include="mainwindowsplitter.h" />
<ClInclude Include="ObjectArchive.h" />
<QtMoc Include="ViewInfo.h" />
<QtMoc Include="variantmanager.h" />
<QtMoc Include="variantfactory.h" />
<QtMoc Include="TransparentDraggableSwallCore.h" />
<QtMoc Include="TransparentDraggableResult.h" />
<QtMoc Include="TransparentDraggableRect.h" />
<QtMoc Include="TransparentDraggablePhase.h" />
<QtMoc Include="TransparentDraggableMFac.h" />
<QtMoc Include="TransparentDraggableLine.h" />
<QtMoc Include="TransparentDraggableJiegutext.h" />
<QtMoc Include="transparentdraggableimage.h" />
<QtMoc Include="TransparentDraggableGujing.h" />
<QtMoc Include="transparentdraggableGuan.h" />
<QtMoc Include="TransparentDraggableGeoLith.h" />
<QtMoc Include="TransparentDraggableFac.h" />
<QtMoc Include="totalTitleBar.h" />
<QtMoc Include="qtprojectwidgets.h" />
<QtMoc Include="qtcommonclass.h" />
<QtMoc Include="qtcenterwidgets.h" />
<QtMoc Include="qmytreewidget.h" />
<QtMoc Include="qmytablewidget.h" />
<QtMoc Include="qmycustomplot.h" />
<QtMoc Include="QCPSizeHandleManager.h" />
<QtMoc Include="QCPSizeHandle.h" />
<QtMoc Include="PropertyWidget.h" />
<QtMoc Include="preqtablewidget.h" />
<QtMoc Include="PickFrac.h" />
<QtMoc Include="newheaddialog.h" />
<QtMoc Include="mycustomplot.h" />
<QtMoc Include="mainwindowcurve.h" />
<QtMoc Include="mainwindow.h" />
<QtMoc Include="InterfaceWidget.h" />
<QtMoc Include="InDefTableDlg.h" />
<QtMoc Include="formwell.h" />
<QtMoc Include="formtracktop.h" />
<QtMoc Include="formtrack.h" />
<QtMoc Include="formtitle.h" />
<QtMoc Include="formline.h" />
<QtMoc Include="forminfo.h" />
<QtMoc Include="formdraw.h" />
<QtMoc Include="fileopenthread.h" />
<QtMoc Include="fileedit.h" />
<QtMoc Include="DrawNrad.h" />
<QtMoc Include="DraggablePixmap.h" />
<QtMoc Include="customtabwidget.h" />
<QtMoc Include="customtabbar.h" />
<QtMoc Include="ConsoleOutputWidget.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\CallManage\CallManage.cpp" />
<ClCompile Include="..\common\dropdownbutton.cpp" />
<ClCompile Include="..\common\geometryutils.cpp" />
<ClCompile Include="3rd_qcustomplot\smoothcurve.cpp" />
<ClCompile Include="3rd_qcustomplot\v2_1\qcustomplot.cpp" />
<ClCompile Include="backgrounddelegate.cpp" />
<ClCompile Include="ConsoleOutputWidget.cpp" />
<ClCompile Include="CStringType.cpp" />
<ClCompile Include="CurveLine.cpp" />
<ClCompile Include="customtabbar.cpp" />
<ClCompile Include="customtabwidget.cpp" />
<ClCompile Include="DepPairs.cpp" />
<ClCompile Include="DrawNrad.cpp" />
<ClCompile Include="DrawTvd.cpp" />
<ClCompile Include="fileedit.cpp" />
<ClCompile Include="fileopenthread.cpp" />
<ClCompile Include="formdraw.cpp" />
<ClCompile Include="formhead.cpp" />
<ClCompile Include="forminfo.cpp" />
<ClCompile Include="formline.cpp" />
<ClCompile Include="formmultiheads.cpp" />
<ClCompile Include="formtitle.cpp" />
<ClCompile Include="formtrack.cpp" />
<ClCompile Include="formtracktop.cpp" />
<ClCompile Include="formwell.cpp" />
<ClCompile Include="fracsel.cpp" />
<ClCompile Include="GeoIndicatorGenerator.cpp" />
<ClCompile Include="Gradient.cpp" />
<ClCompile Include="InDefTableDlg.cpp" />
<ClCompile Include="InterfaceWidget.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="mainwindow.cpp" />
<ClCompile Include="mainwindowcurve.cpp" />
<ClCompile Include="mainwindowsplitter.cpp" />
<ClCompile Include="mycustomplot.cpp" />
<ClCompile Include="newheaddialog.cpp" />
<ClCompile Include="ObjectArchive.cpp" />
<ClCompile Include="PickFrac.cpp" />
<ClCompile Include="preqtablewidget.cpp" />
<ClCompile Include="PropertyWidget.cpp" />
<ClCompile Include="QCPSizeHandle.cpp" />
<ClCompile Include="QCPSizeHandleManager.cpp" />
<ClCompile Include="qmycustomplot.cpp" />
<ClCompile Include="qmytablewidget.cpp" />
<ClCompile Include="qmytreewidget.cpp" />
<ClCompile Include="qtcenterwidgets.cpp" />
<ClCompile Include="qtcommonclass.cpp" />
<ClCompile Include="qtprojectwidgets.cpp" />
<ClCompile Include="selectwelldialog.cpp" />
<ClCompile Include="totalTitleBar.cpp" />
<ClCompile Include="TransparentDraggableCorePhysics.cpp" />
<ClCompile Include="TransparentDraggableFac.cpp" />
<ClCompile Include="TransparentDraggableGeoLith.cpp" />
<ClCompile Include="transparentdraggableGuan.cpp" />
<ClCompile Include="TransparentDraggableGujing.cpp" />
<ClCompile Include="transparentdraggableimage.cpp" />
<ClCompile Include="TransparentDraggableJiegutext.cpp" />
<ClCompile Include="TransparentDraggableLayer.cpp" />
<ClCompile Include="TransparentDraggableLine.cpp" />
<ClCompile Include="TransparentDraggableMFac.cpp" />
<ClCompile Include="TransparentDraggablePhase.cpp" />
<ClCompile Include="TransparentDraggableRect.cpp" />
<ClCompile Include="TransparentDraggableResult.cpp" />
<ClCompile Include="transparentdraggableRightList.cpp" />
<ClCompile Include="transparentdraggableSelectRect.cpp" />
<ClCompile Include="TransparentDraggableSwallCore.cpp" />
<ClCompile Include="TransparentGroupResult.cpp" />
<ClCompile Include="variantfactory.cpp" />
<ClCompile Include="variantmanager.cpp" />
<ClCompile Include="ViewInfo.cpp" />
<ClCompile Include="YxzpDialog.cpp" />
</ItemGroup>
<ItemGroup>
<QtRcc Include="logplus.qrc" />
</ItemGroup>
<ItemGroup>
<QtUic Include="formdraw.ui" />
<QtUic Include="formhead.ui" />
<QtUic Include="forminfo.ui" />
<QtUic Include="formline.ui" />
<QtUic Include="formmultiheads.ui" />
<QtUic Include="formtitle.ui" />
<QtUic Include="formtrack.ui" />
<QtUic Include="formtracktop.ui" />
<QtUic Include="formwell.ui" />
<QtUic Include="fracsel.ui" />
<QtUic Include="InDefTable.ui" />
<QtUic Include="interfaceWidget.ui" />
<QtUic Include="mainwindow.ui" />
<QtUic Include="mainwindowcurve.ui" />
<QtUic Include="mainwindownew.ui" />
<QtUic Include="mainwindowsplitter.ui" />
<QtUic Include="newheaddialog.ui" />
<QtUic Include="qtcenterwidgets.ui" />
<QtUic Include="qtprojectwidgets.ui" />
<QtUic Include="selectwelldialog.ui" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{BE733E79-9D41-44C5-A0A3-048959EE70A0}</ProjectGuid>
<Keyword>QtVS_v304</Keyword>
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0.22621.0</WindowsTargetPlatformVersion>
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
<Import Project="$(QtMsBuild)\qt_defaults.props" />
</ImportGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
<QtInstall>msvc2017_64</QtInstall>
<QtModules>core;gui;svg;widgets;printsupport</QtModules>
<QtBuildConfig>debug</QtBuildConfig>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
<QtInstall>msvc2017_64</QtInstall>
<QtModules>core;gui;svg;widgets;printsupport</QtModules>
<QtBuildConfig>release</QtBuildConfig>
</PropertyGroup>
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
</Target>
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="Shared" />
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(QtMsBuild)\Qt.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(QtMsBuild)\Qt.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<OutDir>..\Bin</OutDir>
<IntDir>..\tmp\x64\$(ProjectName)d</IntDir>
<TargetName>$(ProjectName)d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>../include;../CallPlugin;./;./3rd_qcustomplot;./3rd_qcustomplot/v2_1;../EditPlotHeader/include;../Slfio/include;../CallManage;../common;../WellLogUI/include;../qtpropertybrowser;../BaseFun/include;../ConvertorManager/include;../OSGDataModel/include;../OSGFramework/include;../DataOutput/include;../DataMgr/include;../DrawBase/include;../ModuleConsole/include;../WellLogModule/include;../Workflow/include;../Workflow/WFCrystal/Crystal/include;../Workflow/WFCrystal/Plugin/include;../Workflow/WFCrystal/SysUtility/utils/include;../Workflow/WFEngine/IOService/include;../Workflow/WFEngine/Module/include;../Workflow/WFEngine/Component/WorkflowWidget/include;../Workflow/WFEngine/ObjectModel/ObjectModel/include;../Workflow/WFEngine/WorkflowEngine/include;../Workflow/WFEngine/ObjectModel/ObjectModelBase/include;../Workflow/WFWidget/include%(AdditionalIncludeDirectories);$(Qt_INCLUDEPATH_)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\Bin;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>BaseFund.lib;slfiod.lib;WellLogUId.lib;qtpropertybrowserd.lib;ConvertorManagerd.lib;OSGDataModeld.lib;DataOutputd.lib;CallPlugind.lib;HPluginManaged.lib;DataMgrd.lib;DrawBased.lib;LogModuleConsoled.lib;WFEngined.lib;EditPlotHeaderd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>../include;../CallPlugin;./;./3rd_qcustomplot;./3rd_qcustomplot/v2_1;../Slfio/include;../CallManage;../common;../WellLogUI/include;../qtpropertybrowser;../BaseFun/include;../ConvertorManager/include;../OSGDataModel/include;../OSGFramework/include;../DataOutput/include;../DataMgr/include;../DrawBase/include;../ModuleConsole/include;../WellLogModule/include;../Workflow/include;../Workflow/WFCrystal/Crystal/include;../Workflow/WFCrystal/Plugin/include;../Workflow/WFCrystal/SysUtility/utils/include;../Workflow/WFEngine/IOService/include;../Workflow/WFEngine/Module/include;../Workflow/WFEngine/Component/WorkflowWidget/include;../Workflow/WFEngine/ObjectModel/ObjectModel/include;../Workflow/WFEngine/WorkflowEngine/include;../Workflow/WFEngine/ObjectModel/ObjectModelBase/include;../Workflow/WFWidget/include%(AdditionalIncludeDirectories);$(Qt_INCLUDEPATH_)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>BaseFun.lib;slfio.lib;WellLogUI.lib;qtpropertybrowser.lib;ConvertorManager.lib;OSGDataModel.lib;DataOutput.lib;CallPlugin.lib;HPluginManage.lib;DataMgr.lib;DrawBase.lib;LogModuleConsole.lib;WFEngine.lib;%(AdditionalDependencies);$(Qt_LIBS_)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\Bin;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
<ClCompile>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
<ClCompile>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DebugInformationFormat>None</DebugInformationFormat>
<Optimization>MaxSpeed</Optimization>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
<Import Project="$(QtMsBuild)\qt.targets" />
</ImportGroup>
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,539 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Form Files">
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
<Extensions>ui</Extensions>
</Filter>
<Filter Include="Translation Files">
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
<Extensions>ts</Extensions>
</Filter>
<Filter Include="3rd_qcustomplot">
<UniqueIdentifier>{b7779623-e341-415d-98e1-f2cca4b9c2f5}</UniqueIdentifier>
</Filter>
<Filter Include="3rd_qcustomplot\v2_1">
<UniqueIdentifier>{1f2b53b3-aa5f-43c7-8ab9-93f4396930b7}</UniqueIdentifier>
</Filter>
<Filter Include="CallManage">
<UniqueIdentifier>{01484347-5324-4654-80c8-0972752803c6}</UniqueIdentifier>
</Filter>
<Filter Include="common">
<UniqueIdentifier>{90fce5ea-3cd6-47d8-9400-aea11137b079}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="backgrounddelegate.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="CStringType.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="CurveLine.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="customellipse.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DepPairs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DrawTvd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="GeoIndicatorGenerator.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Gradient.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ObjectArchive.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="3rd_qcustomplot\smoothcurve.h">
<Filter>3rd_qcustomplot</Filter>
</ClInclude>
<ClInclude Include="..\common\geometryutils.h">
<Filter>common</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<QtMoc Include="ConsoleOutputWidget.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="customtabbar.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="customtabwidget.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="DraggablePixmap.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="DrawNrad.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="fileedit.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="fileopenthread.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="formdraw.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="forminfo.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="formline.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="formtitle.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="formtrack.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="formtracktop.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="formwell.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="InDefTableDlg.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="InterfaceWidget.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="mainwindow.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="mainwindowcurve.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="mycustomplot.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="newheaddialog.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="PickFrac.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="preqtablewidget.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="PropertyWidget.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="QCPSizeHandle.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="QCPSizeHandleManager.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="qmycustomplot.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="qmytablewidget.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="qmytreewidget.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="qtcenterwidgets.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="qtcommonclass.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="qtprojectwidgets.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="totalTitleBar.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="TransparentDraggableFac.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="TransparentDraggableGeoLith.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="transparentdraggableGuan.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="TransparentDraggableGujing.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="transparentdraggableimage.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="TransparentDraggableJiegutext.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="TransparentDraggableLine.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="TransparentDraggableMFac.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="TransparentDraggablePhase.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="TransparentDraggableRect.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="TransparentDraggableResult.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="TransparentDraggableSwallCore.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="variantfactory.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="variantmanager.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="ViewInfo.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="3rd_qcustomplot\v2_1\qcustomplot.h">
<Filter>3rd_qcustomplot\v2_1</Filter>
</QtMoc>
<QtMoc Include="..\CallManage\CallManage.h">
<Filter>CallManage</Filter>
</QtMoc>
<QtMoc Include="formhead.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="formmultiheads.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="transparentdraggableSelectRect.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="transparentdraggableRightList.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="TransparentGroupResult.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="TransparentDraggableLayer.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="YxzpDialog.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="fracsel.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="..\common\dropdownbutton.h">
<Filter>common</Filter>
</QtMoc>
<QtMoc Include="mainwindowsplitter.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="TransparentDraggableCorePhysics.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="selectwelldialog.h">
<Filter>Header Files</Filter>
</QtMoc>
</ItemGroup>
<ItemGroup>
<ClCompile Include="backgrounddelegate.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ConsoleOutputWidget.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CStringType.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CurveLine.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="customtabbar.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="customtabwidget.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DepPairs.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DrawNrad.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DrawTvd.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="fileedit.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="fileopenthread.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="formdraw.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="forminfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="formline.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="formtitle.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="formtrack.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="formtracktop.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="formwell.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="GeoIndicatorGenerator.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Gradient.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="InDefTableDlg.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="InterfaceWidget.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mainwindow.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mainwindowcurve.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mycustomplot.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="newheaddialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ObjectArchive.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="PickFrac.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="preqtablewidget.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="PropertyWidget.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="QCPSizeHandle.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="QCPSizeHandleManager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="qmycustomplot.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="qmytablewidget.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="qmytreewidget.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="qtcenterwidgets.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="qtcommonclass.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="qtprojectwidgets.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="totalTitleBar.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TransparentDraggableFac.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TransparentDraggableGeoLith.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="transparentdraggableGuan.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TransparentDraggableGujing.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="transparentdraggableimage.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TransparentDraggableJiegutext.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TransparentDraggableLine.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TransparentDraggableMFac.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TransparentDraggablePhase.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TransparentDraggableRect.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TransparentDraggableResult.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TransparentDraggableSwallCore.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="variantfactory.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="variantmanager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ViewInfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="3rd_qcustomplot\v2_1\qcustomplot.cpp">
<Filter>3rd_qcustomplot\v2_1</Filter>
</ClCompile>
<ClCompile Include="3rd_qcustomplot\smoothcurve.cpp">
<Filter>3rd_qcustomplot</Filter>
</ClCompile>
<ClCompile Include="..\CallManage\CallManage.cpp">
<Filter>CallManage</Filter>
</ClCompile>
<ClCompile Include="..\common\geometryutils.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="formhead.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="formmultiheads.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="transparentdraggableSelectRect.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="transparentdraggableRightList.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TransparentGroupResult.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TransparentDraggableLayer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="YxzpDialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="fracsel.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\common\dropdownbutton.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="mainwindowsplitter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TransparentDraggableCorePhysics.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="selectwelldialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<QtRcc Include="logplus.qrc">
<Filter>Resource Files</Filter>
</QtRcc>
</ItemGroup>
<ItemGroup>
<QtUic Include="formdraw.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="formhead.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="forminfo.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="formline.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="formmultiheads.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="formtitle.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="formtrack.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="formtracktop.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="formwell.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="InDefTable.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="interfaceWidget.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="mainwindow.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="mainwindowcurve.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="mainwindownew.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="newheaddialog.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="qtcenterwidgets.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="qtprojectwidgets.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="fracsel.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="mainwindowsplitter.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="selectwelldialog.ui">
<Filter>Form Files</Filter>
</QtUic>
</ItemGroup>
</Project>

View File

@ -89,7 +89,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(CallManage::getInstance(), SIGNAL(sig_ShowParameterCard(QString, QString)), this, SLOT(s_ShowParameterCard(QString, QString)));
//曲线
//关联信号槽,数据查看曲线数据
connect(CallManage::getInstance(), SIGNAL(sig_ShowCurve(QString, QString)), this, SLOT(s_ShowCurve(QString, QString)));
connect(CallManage::getInstance(), SIGNAL(sig_ShowCurve(QMap<QString,QList<QString>>)), this, SLOT(s_ShowCurve(QMap<QString,QList<QString>>)));
//关联信号槽,数据查看表格数据
connect(CallManage::getInstance(), SIGNAL(sig_ShowTable(QString, QString)), this, SLOT(s_ShowTable(QString, QString)));
@ -583,12 +583,21 @@ void MainWindow::s_ShowParameterCard(QString strSlfName, QString strName)
}
//曲线数据查看
void MainWindow::s_ShowCurve(QString strSlfName, QString strName)
void MainWindow::s_ShowCurve(QMap<QString,QList<QString>> mapShowObject)
{
if(m_centerWidgets)
{
QString strSlfName;
QString strName;
QList<QString> listShowSlfName = mapShowObject.keys();
if (listShowSlfName.size()>0)
{
strSlfName = listShowSlfName.at(0);
strName = mapShowObject[listShowSlfName.at(0)].at(0);
}
WellLogTableDialogNew* pDialog = new WellLogTableDialogNew();
pDialog->setName(strSlfName, strName, CURVE_OBJECT);
pDialog->setShowCurveName(strSlfName, strName, mapShowObject);
QString wellname;
QString path;
GetWellNameAndPath(strSlfName, wellname, path);

View File

@ -91,7 +91,7 @@ public slots:
//开发工具
void s_development();
void s_ShowParameterCard(QString strSlfName, QString strName);//参数卡数据查看
void s_ShowCurve(QString strSlfName, QString strName);//曲线数据查看
void s_ShowCurve(QMap<QString,QList<QString>> mapShowObject);//曲线数据查看
void s_ShowTable(QString strSlfName, QString strName);//表格数据查看
void s_ShowWave(QString strSlfName, QString strName); //波列数据查看
void s_WelllogInformation(QString strSlfName);//编辑测井信息

View File

@ -63,7 +63,7 @@ QtProjectWidgets::QtProjectWidgets(QWidget *parent)
// 设置选择模式为多选模式
ui->treeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); // 或者使用 QAbstractItemView::MultiSelection
m_ReFlag = 0;
}
QtProjectWidgets::~QtProjectWidgets()
@ -76,6 +76,19 @@ QString QtProjectWidgets::getLeftTreeString()
return ui->treeWidget->getCurrentItemString();
}
void QtProjectWidgets::slotButtonCancel()
{
m_ReFlag=QDialogButtonBox::StandardButton::Cancel;
}
void QtProjectWidgets::slotButtonOk()
{
m_ReFlag=QDialogButtonBox::StandardButton::Yes;
}
void QtProjectWidgets::slotButtonNo()
{
m_ReFlag=QDialogButtonBox::StandardButton::No;
}
////初始化树图控件
//void QtProjectWidgets::initTreeWidget(QString fullPath, QString strProjectName)
//{
@ -937,7 +950,28 @@ void QtProjectWidgets::onShowParameterCard(bool checked)
//曲线数据查看
void QtProjectWidgets::onShowCurve(bool checked)
{
emit CallManage::getInstance()->sig_ShowCurve(m_strSlfName, m_strCurveObjectName);
m_mapShowObject.clear();
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
{
QTreeWidgetItem *parentItem = pItem->parent()->parent(); // 上两层目录是井次
if (parentItem)
{
QString strSlfName = parentItem->data(0, Qt::UserRole+1).toString();
if (strSlfName.contains(".slf"))
{
QString strObjectName = pItem->text(0);
if(!m_mapShowObject.contains(strSlfName))
{
QList<QString> selList;
selList.clear();
m_mapShowObject.insert(strSlfName,selList);
}
m_mapShowObject[strSlfName].append(strObjectName);
}
}
}
if(m_mapShowObject.size()>0)
emit CallManage::getInstance()->sig_ShowCurve(m_mapShowObject);
}
//深度移动
@ -1160,41 +1194,169 @@ void QtProjectWidgets::onDeleteObject()
void QtProjectWidgets::onCopySelObject() // 复制
{
m_strCopySlfName = m_strSlfName; // 当前复制的对象Slf文件
m_strCopyCurveObjectName = m_strCurveObjectName; // 当前复制的对象名
m_mapCopyObject.clear();
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
{
QTreeWidgetItem *parentItem = pItem->parent()->parent(); // 上两层目录是井次
if (parentItem)
{
QString strSlfName = parentItem->data(0, Qt::UserRole+1).toString();
if (strSlfName.contains(".slf"))
{
QString strObjectName = pItem->text(0);
if(!m_mapCopyObject.contains(strSlfName))
{
QList<QString> selList;
selList.clear();
m_mapCopyObject.insert(strSlfName,selList);
}
m_mapCopyObject[strSlfName].append(strObjectName);
}
}
}
}
void QtProjectWidgets::onPasteSelObject() // 粘贴
{
if (m_strCopySlfName == m_strSlfName)
int flag=0;
int check=0;
m_ReFlag=0;
QList<QString> listCopySlfName = m_mapCopyObject.keys();
for(int i= 0; i < listCopySlfName.size(); i++)
{
CLogIO *logio=new CLogIO;
if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) {
delete logio;
return;
}
char buf[1000];
int i=1;
while(1) {
sprintf(buf,"%s_%d",m_strCopyCurveObjectName.toLocal8Bit().data(),i++);
if (0>logio->FindObjectName(buf))
break;
}
logio->CopyObject(m_strCopyCurveObjectName.toLocal8Bit().data(), buf);
logio->Close();
delete logio;
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
QString strCopySlfName = listCopySlfName.at(i);
QList<QString> listObjectName = m_mapCopyObject[listCopySlfName.at(i)];
if (strCopySlfName == m_strSlfName)
{
QTreeWidgetItem *parentItem = pItem/*->parent()*/; // 上一层目录是井次
if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
RefreshWellRoundTree(parentItem);
parentItem = parentItem = pItem->parent();
if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
RefreshWellRoundTree(parentItem);
break;
CLogIO *logio=new CLogIO;
if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) {
delete logio;
return;
}
for(int j= 0; j < listObjectName.size(); j++)
{
char buf[1000];
int nindex=1;
while(1) {
sprintf(buf,"%s_%d",listObjectName.at(j).toLocal8Bit().data(),nindex++);
if (0>logio->FindObjectName(buf))
break;
}
logio->CopyObject(listObjectName.at(j).toLocal8Bit().data(), buf);
}
logio->Close();
delete logio;
}
return;
else
{
for(int j= 0; j < listObjectName.size(); j++)
{
bool bExistence = false;
CLogIO *logio=new CLogIO;
if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) {
delete logio;
return;
}
if (logio->FindObjectName(listObjectName.at(j).toLocal8Bit().data())>=0)
bExistence = true;
logio->Close();
delete logio;
if((!flag||!check)&&bExistence)
{
QDialog dialog(NULL);
Qt::WindowFlags flags = dialog.windowFlags();
flags |= Qt::WindowStaysOnTopHint;
flags &= ~Qt::WindowContextHelpButtonHint;
dialog.setWindowTitle("提示");
QString mess="已存在!\n 该功能只具覆盖或另创建能力,无法完成拼接操作。\n如需要进行拼接,请在图形区可视化编辑状态完成。\n请选择操作模式:\n";
QFormLayout form(&dialog);
form.addRow(new QLabel(listObjectName.at(j)+mess));
QCheckBox *pCheckBox=new QCheckBox("均按下列操作",&dialog);
form.addRow(pCheckBox);
QDialogButtonBox buttonBox(QDialogButtonBox::Yes |QDialogButtonBox::No | QDialogButtonBox::Cancel,
Qt::Horizontal, &dialog);
form.addRow(&buttonBox);
buttonBox.button(QDialogButtonBox::Yes)->setText(QString("覆盖"));
buttonBox.button(QDialogButtonBox::No)->setText(QString("增加"));
buttonBox.button(QDialogButtonBox::Cancel)->setText(QString("放弃"));
form.addRow(&buttonBox);
QObject::connect(buttonBox.button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(slotButtonCancel()));
QObject::connect(buttonBox.button(QDialogButtonBox::Yes), SIGNAL(clicked()), this, SLOT(slotButtonOk()));
QObject::connect(buttonBox.button(QDialogButtonBox::No), SIGNAL(clicked()), this, SLOT(slotButtonNo()));
QObject::connect(&buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));
dialog.exec();
flag=m_ReFlag;
check=pCheckBox->checkState();
}
if (flag==QDialogButtonBox::Cancel)
{
QMessageBox::information(NULL,"Cancel","Cancel");
continue;
}
else if (flag==QDialogButtonBox::Yes)
{
CLogIO *logio=new CLogIO;
if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) {
delete logio;
return;
}
logio->DeleteObject(listObjectName.at(j).toLocal8Bit().data());
logio->Close();
delete logio;
CObjWellLog* pcopyingwelllog= new CObjWellLog();
pcopyingwelllog->SetSlfFileName(strCopySlfName);
pcopyingwelllog->SetName(listObjectName.at(j));
pcopyingwelllog->CopyToSLFFile(m_strSlfName);
delete pcopyingwelllog;
}
else if (flag==QDialogButtonBox::No && bExistence)
{
CLogIO *logio=new CLogIO;
if(!logio->Open(m_strSlfName.toStdString().c_str(),CLogIO::modeReadWrite)) {
delete logio;
return;
}
char buf[1000];
int nindex=1;
while(1) {
sprintf(buf,"%s_%d",listObjectName.at(j).toLocal8Bit().data(),nindex++);
if (0>logio->FindObjectName(buf))
break;
}
logio->Close();
delete logio;
CObjWellLog* pcopyingwelllog= new CObjWellLog();
pcopyingwelllog->SetSlfFileName(strCopySlfName);
pcopyingwelllog->SetName(listObjectName.at(j));
pcopyingwelllog->CopyToSLFFile(m_strSlfName,false,buf);
delete pcopyingwelllog;
}
else if (!bExistence)
{
CObjWellLog* pcopyingwelllog= new CObjWellLog();
pcopyingwelllog->SetSlfFileName(strCopySlfName);
pcopyingwelllog->SetName(listObjectName.at(j));
pcopyingwelllog->CopyToSLFFile(m_strSlfName);
delete pcopyingwelllog;
}
}
}
}
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
{
QTreeWidgetItem *parentItem = pItem/*->parent()*/; // 上一层目录是井次
if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
RefreshWellRoundTree(parentItem);
parentItem = parentItem = pItem->parent();
if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
RefreshWellRoundTree(parentItem);
break;
}
}
@ -1489,11 +1651,11 @@ void QtProjectWidgets::onItemClicked(QTreeWidgetItem* item, int index)
m_strSlfName = item->parent()->data(0, Qt::UserRole+1).toString();//从父节点井次获取slf
}
if (m_strCopySlfName != m_strSlfName)
if (m_mapCopyObject.size()==0)
m_action_Paste->setVisible(false);
else
m_action_Paste->setVisible(true);
//
if (qApp->mouseButtons() == Qt::RightButton) // 只针对鼠标右键,弹出菜单
{
if (NULL == popMenu)

View File

@ -24,6 +24,9 @@ private:
Ui::QtProjectWidgetsClass *ui;
public slots:
void slotButtonOk();
void slotButtonNo();
void slotButtonCancel();
//void s_initTreeWidget(QString strName);//初始化树图控件
void s_loadTreeWidget(QString fileFull);//加载树图
@ -85,7 +88,7 @@ public:
QMenu *_menuParCardFolder; //参数卡目录
QMenu *_menuWaveFolder; //波列目录
QAction* m_action_Paste; //
QAction* m_action_Paste; //
//根节点(项目名称)-右键菜单
QAction* m_action_New;
QAction* m_action_Open;
@ -99,8 +102,9 @@ public:
QString m_strSlfName;
QString m_strCurveObjectName;
QString m_strCopySlfName; // 当前复制的对象Slf文件
QString m_strCopyCurveObjectName; // 当前复制的对象名
QMap<QString,QList<QString>> m_mapShowObject;// 显示Slf文件里对象名
QMap<QString,QList<QString>> m_mapCopyObject;// 复制Slf文件里对象名
int m_ReFlag;
public:
void loadIndexSysTree(QTreeWidgetItem *parent, QString fileFull, QString prjname);

25
logplus.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.33801.198
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logplus", "logPlus\logplus.vcxproj", "{BE733E79-9D41-44C5-A0A3-048959EE70A0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BE733E79-9D41-44C5-A0A3-048959EE70A0}.Debug|x64.ActiveCfg = Debug|x64
{BE733E79-9D41-44C5-A0A3-048959EE70A0}.Debug|x64.Build.0 = Debug|x64
{BE733E79-9D41-44C5-A0A3-048959EE70A0}.Release|x64.ActiveCfg = Release|x64
{BE733E79-9D41-44C5-A0A3-048959EE70A0}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7C88C44D-031B-4F5B-B088-082BF3815909}
EndGlobalSection
EndGlobal

View File

@ -4,7 +4,7 @@ import numpy as np
setup(
ext_modules=cythonize(
"fdsa4_test.py", # 要编译的Python文件
"UCS_test_0330.py", # 要编译的Python文件
compiler_directives={
'language_level': 3, # Python 3
'boundscheck': False, # 关闭边界检查提升性能