套管组件,新增基础属性、右键新建套管组件、位移等功能。
This commit is contained in:
parent
722538d778
commit
309e7c05a9
|
|
@ -83,7 +83,7 @@ signals:
|
|||
void sig_AddLogface(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW = 0, QStringList listOtherProperty={});
|
||||
|
||||
//套管组件
|
||||
void sig_AddTubingstring(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW = 0);
|
||||
void sig_AddTubingstring(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW = 0, QStringList listOtherProperty={});
|
||||
|
||||
//TDT
|
||||
void sig_AddTDT(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW = 0);
|
||||
|
|
|
|||
|
|
@ -1,178 +0,0 @@
|
|||
#include <cassert>
|
||||
#include "ObjTubingstringResult.h"
|
||||
#include "MemRdWt.h"
|
||||
#include "geometryutils.h"
|
||||
|
||||
CObjTubingstringResult::CObjTubingstringResult()
|
||||
{
|
||||
if(zoneOrder.size()==0)
|
||||
{
|
||||
zoneOrder=GetZoneOrder(QString("TubTools.ini"));
|
||||
}
|
||||
|
||||
cclimgpath=GetSymbolDir()+"\\管柱组件\\";
|
||||
}
|
||||
|
||||
CObjTubingstringResult::~CObjTubingstringResult()
|
||||
{
|
||||
m_pResultList.clear();
|
||||
}
|
||||
|
||||
bool CObjTubingstringResult::LoadFromSLF(QMyCustomPlot *widget, QString strSlfName, QString csCurve)
|
||||
{
|
||||
m_pResultList.clear();
|
||||
|
||||
// //隐藏刻度
|
||||
// widget->xAxis->setTicks(false);
|
||||
// widget->yAxis->setTicks(false);
|
||||
// widget->xAxis2->setTicks(false);
|
||||
// widget->yAxis2->setTicks(false);
|
||||
|
||||
Slf_JIEGUPOS *m_pResult=NULL;
|
||||
CMemRdWt *logio=new CMemRdWt();
|
||||
if(strSlfName==""||!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead))
|
||||
{
|
||||
delete logio;
|
||||
// QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int iIndex=logio->OpenTable(csCurve.toStdString().c_str());
|
||||
if(iIndex>-1) {
|
||||
int count=logio->GetTableRecordCount(iIndex);
|
||||
//int fieldnum=logio->GetTableFieldCount(iIndex);
|
||||
int len=logio->GetTableRecordLength(iIndex);
|
||||
m_pResult=(Slf_JIEGUPOS *)new char[len+1];
|
||||
char buf[200];
|
||||
logio->IsChange=true;
|
||||
|
||||
bool bDrawGuanzhu = false;
|
||||
for(int i=0;i<count;i++)
|
||||
{
|
||||
memset(m_pResult,0,sizeof(len));
|
||||
logio->ReadTable(iIndex,i+1,m_pResult);
|
||||
|
||||
Slf_JIEGUPOS result;
|
||||
result.Depth=m_pResult->Depth;
|
||||
result.Order=m_pResult->Order;
|
||||
result.Number=m_pResult->Number;
|
||||
m_pResultList.append(result);
|
||||
|
||||
//
|
||||
double depth=m_pResult->Depth;
|
||||
int Order=m_pResult->Order;
|
||||
int Number=m_pResult->Number;
|
||||
|
||||
if(bDrawGuanzhu == false)
|
||||
{
|
||||
//还没有画管柱
|
||||
if(Number == zoneOrder.value("管底部").toInt()||
|
||||
Number == zoneOrder.value("油管深").toInt()||
|
||||
Number == zoneOrder.value("喇叭口").toInt()||
|
||||
Number == zoneOrder.value("剌叭口").toInt())
|
||||
{
|
||||
bDrawGuanzhu = true;//画管柱
|
||||
|
||||
QString shotimgfile=GetSymbolDir()+"\\管柱组件\\管柱.png";
|
||||
//QImage shotimg(shotimgfile);
|
||||
//pPainter->drawImage(rect,shotimg);
|
||||
|
||||
double lY1 = widget->yAxis->range().lower;//+10
|
||||
double lY2 = widget->yAxis->range().upper;
|
||||
QCPItemPixmap *mPixmap;
|
||||
mPixmap = new QCPItemPixmap(widget);
|
||||
//mPixmap->setPixmap(QPixmap(":/image/file.png")); // 设置图片
|
||||
mPixmap->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式
|
||||
mPixmap->setLayer("overlay"); // 确保在最上层
|
||||
//
|
||||
float upper = widget->xAxis->range().upper;
|
||||
mPixmap->topLeft->setCoords(upper, lY1 + (lY2-lY1-m_Oguan)/2.0);
|
||||
mPixmap->bottomRight->setCoords(-depth, lY2 - (lY2-lY1-m_Oguan)/2.0);
|
||||
mPixmap->setPixmap(QPixmap(shotimgfile)); // 设置图片
|
||||
}
|
||||
}
|
||||
}
|
||||
logio->CloseTable(iIndex);
|
||||
delete m_pResult;
|
||||
}
|
||||
delete logio;
|
||||
|
||||
for(int i=0; i<m_pResultList.size(); i++)
|
||||
{
|
||||
Slf_JIEGUPOS result = m_pResultList[i];
|
||||
//
|
||||
drawOne(widget, result);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void CObjTubingstringResult::drawOne(QMyCustomPlot *widget, Slf_JIEGUPOS result)
|
||||
{
|
||||
double depth=result.Depth;
|
||||
int Order=result.Order;
|
||||
int Number=result.Number;
|
||||
|
||||
float h=20;
|
||||
float in=m_Oind;
|
||||
if(!m_bDrawCCL)
|
||||
{
|
||||
if(Number==1) {
|
||||
in=m_Oind+1;
|
||||
}
|
||||
else if(Number==zoneOrder.value("套管接箍").toInt()){
|
||||
h=10;
|
||||
in=m_Oind;
|
||||
}
|
||||
else if(Number==zoneOrder.value("封隔器").toInt()||
|
||||
Number==zoneOrder.value("水力猫").toInt()||
|
||||
Number==zoneOrder.value("卡瓦").toInt()||
|
||||
Number==zoneOrder.value("定封隔猫").toInt()
|
||||
)
|
||||
{
|
||||
if(Number==zoneOrder.value("封隔器").toInt()) h=25;
|
||||
in=m_Oind;
|
||||
}
|
||||
else {
|
||||
in=m_Oind+1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
in=m_Oind+1;
|
||||
}
|
||||
|
||||
QString name;
|
||||
if(!m_bDrawCCL)
|
||||
{
|
||||
name=zoneOrder.key(QString::number(Number));
|
||||
if(name.isEmpty()) name=zoneOrder.key(QString::number(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
name=zoneOrder.key(QString::number(1));
|
||||
}
|
||||
|
||||
QString cclimgfile=cclimgpath+name+".png";
|
||||
float upper = widget->xAxis->coordToPixel(-depth)-h/2.0;
|
||||
float lower = widget->xAxis->coordToPixel(-depth)+h/2.0;
|
||||
float newUpper = widget->xAxis->pixelToCoord(upper);
|
||||
float newLower = widget->xAxis->pixelToCoord(lower);
|
||||
widget->addGuanToPlot(newLower, newUpper, cclimgfile, in);
|
||||
|
||||
// QString cclimgfile=cclimgpath+name+".png";
|
||||
// double lY1 = widget->yAxis->range().lower;//+10
|
||||
// double lY2 = widget->yAxis->range().upper;
|
||||
// QCPItemPixmap *mPixmap;
|
||||
// mPixmap = new QCPItemPixmap(widget);
|
||||
// mPixmap->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式
|
||||
// mPixmap->setLayer("overlay"); // 确保在最上层
|
||||
// //
|
||||
// float upper = widget->xAxis->coordToPixel(-depth)-h/2.0;
|
||||
// float lower = widget->xAxis->coordToPixel(-depth)+h/2.0;
|
||||
// float newUpper = widget->xAxis->pixelToCoord(upper);
|
||||
// float newLower = widget->xAxis->pixelToCoord(lower);
|
||||
// mPixmap->topLeft->setCoords(newUpper, lY1 + (lY2-lY1-in)/2.0);
|
||||
// mPixmap->bottomRight->setCoords(newLower, lY2 - (lY2-lY1-in)/2.0);
|
||||
// mPixmap->setPixmap(QPixmap(cclimgfile)); // 设置图片
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
#ifndef OBTubingstringResultITEM_H
|
||||
#define OBTubingstringResultITEM_H
|
||||
|
||||
#include <QObject>
|
||||
#include "qmycustomplot.h"
|
||||
|
||||
//套管
|
||||
class CObjTubingstringResult :public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CObjTubingstringResult();
|
||||
virtual ~CObjTubingstringResult();
|
||||
|
||||
|
||||
public:
|
||||
bool LoadFromSLF(QMyCustomPlot *widget, QString strSlfName, QString csCurve);
|
||||
void drawOne(QMyCustomPlot *widget, Slf_JIEGUPOS result);
|
||||
|
||||
public:
|
||||
QMap<QString,QString> zoneOrder;
|
||||
float m_Oguan = 63.5;
|
||||
float m_Oind = 121.36;
|
||||
bool m_bDrawCCL = false;
|
||||
QString cclimgpath="";
|
||||
|
||||
QList<Slf_JIEGUPOS> m_pResultList;
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -662,6 +662,8 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1216,6 +1218,11 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
|
|||
emit CallManage::getInstance()->sig_changeFacShow(m_formInfo->m_strUuid, m_formInfo->m_strSlfName, m_formInfo->m_strWellName, m_formInfo->m_strTrackName, m_formInfo->m_strLineName, m_propertyData[pProperty], bShow);
|
||||
}
|
||||
}
|
||||
else if (m_strCurrentProperty == Tubing_Property)//套管组件
|
||||
{
|
||||
//先处理通用属性
|
||||
CommonPropertyChanged(pProperty, variant);
|
||||
}
|
||||
|
||||
if("深度比例尺" == m_propertyData[pProperty])
|
||||
{
|
||||
|
|
@ -2419,10 +2426,15 @@ void PropertyWidget::initProperty(FormInfo *formInfo)
|
|||
//沉积相
|
||||
this->initFacProperty(formInfo);
|
||||
}
|
||||
else if(formInfo->m_strType=="SantuyibiaoObject")
|
||||
else if(formInfo->m_strType=="SantuyibiaoObject")
|
||||
{
|
||||
this->initTvdProperty(formInfo);
|
||||
}
|
||||
else if (formInfo->m_strType == "TubingstringObject")
|
||||
{
|
||||
//套管组件
|
||||
this->initTubingProperty(formInfo);
|
||||
}
|
||||
}
|
||||
|
||||
void PropertyWidget::initRoseProperty(FormInfo *formInfo)
|
||||
|
|
@ -3124,3 +3136,15 @@ void PropertyWidget::initFacProperty(FormInfo *formInfo)
|
|||
|
||||
m_strCurrentProperty = Fac_Property;
|
||||
}
|
||||
|
||||
//套管组件
|
||||
void PropertyWidget::initTubingProperty(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 = Tubing_Property;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,8 +63,12 @@
|
|||
#define JiegutextItem_Property "JiegutextItem_Property" //气测/FMT/射孔/文本item
|
||||
|
||||
#define Fac_Property "Fac_Property" //沉积相
|
||||
|
||||
#define Tvd_Property "Tvd_Property" //斜井三图一表
|
||||
|
||||
#define Tubing_Property "Tubing_Property" //套管组件
|
||||
#define TubingItem_Property "TubingItem_Property" //套管组件item
|
||||
|
||||
#pragma execution_character_set("utf-8")
|
||||
|
||||
/**
|
||||
|
|
@ -206,6 +210,10 @@ public:
|
|||
// 斜井三图一表属性
|
||||
void initTvdProperty(FormInfo *formInfo);
|
||||
void ChangTvdProperty( QtProperty *pProperty, const QVariant &variant );
|
||||
|
||||
//套管组件
|
||||
void initTubingProperty(FormInfo *formInfo);
|
||||
|
||||
void ChangFillProperty();//填充属性改变
|
||||
void ChangHeadItemProperty();//图头项改变
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ void TransparentDraggableFac::deleteRect()
|
|||
//mPlot->removeItem(mPixmap);
|
||||
mPlot->removeItem(mItemTitle);
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -501,7 +501,7 @@ void TransparentDraggableGeoLith::deleteRect()
|
|||
mPlot->removeItem(mPixmap_Color);
|
||||
mPlot->removeItem(mItemTitle);
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
|
||||
//
|
||||
|
|
@ -611,6 +611,7 @@ void TransparentDraggableGeoLith::onDelRect()
|
|||
//mDragMode = DragNone;
|
||||
//删除框图
|
||||
deleteRect();
|
||||
mPlot->replot();
|
||||
//保存
|
||||
mPlot->SaveToSLF_GeoLith();
|
||||
//属性清空
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ void TransparentDraggableGujing::deleteRect()
|
|||
mPlot->removeItem(mPixmap);
|
||||
mPlot->removeItem(mItemTitle);
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
|
||||
//
|
||||
|
|
@ -336,6 +336,7 @@ void TransparentDraggableGujing::onDelRect()
|
|||
//mDragMode = DragNone;
|
||||
//删除框图
|
||||
deleteRect();
|
||||
mPlot->replot();
|
||||
//保存
|
||||
mPlot->SaveToSLF_Gujing();
|
||||
//属性清空
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ void TransparentDraggableJiegutext::deleteRect()
|
|||
mPlot->removeItem(pLine[i]);
|
||||
}
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
|
||||
//
|
||||
|
|
@ -227,6 +227,7 @@ void TransparentDraggableJiegutext::onDelRect()
|
|||
{
|
||||
//删除框图
|
||||
deleteRect();
|
||||
mPlot->replot();
|
||||
//保存
|
||||
mPlot->SaveToSLF_Jiegutext();
|
||||
//属性清空
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ void TransparentDraggableLayer::deleteRect()
|
|||
mPlot->removeItem(mPixmap);
|
||||
mPlot->removeItem(mItemTitle);
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
}
|
||||
}
|
||||
|
|
@ -279,6 +279,7 @@ void TransparentDraggableLayer::onDelRect()
|
|||
//mDragMode = DragNone;
|
||||
//删除框图
|
||||
deleteRect();
|
||||
mPlot->replot();
|
||||
//保存
|
||||
mPlot->SaveToSLF_Layer();
|
||||
//属性清空
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ void TransparentDraggableLine::deleteRect()
|
|||
|
||||
mPlot->removeItem(qcpItemLine);
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
}
|
||||
}
|
||||
|
|
@ -108,6 +108,7 @@ void TransparentDraggableLine::onDelRect()
|
|||
//mDragMode = DragNone;
|
||||
//删除框图
|
||||
deleteRect();
|
||||
mPlot->replot();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ void TransparentDraggableMFac::deleteRect()
|
|||
//mPlot->removeItem(mPixmap);
|
||||
mPlot->removeItem(mItemTitle);
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
|
||||
//
|
||||
|
|
@ -250,6 +250,7 @@ void TransparentDraggableMFac::onDelRect()
|
|||
//mDragMode = DragNone;
|
||||
//删除框图
|
||||
deleteRect();
|
||||
//mPlot->replot();
|
||||
//保存
|
||||
mPlot->SaveToSLF_Fac();
|
||||
//刷新 bAdd不支持true,否则崩溃,因为发消息的item本身会被删除,无法继续后续处理
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ void TransparentDraggablePhase::deleteRect()
|
|||
//mPlot->removeItem(mPixmap);
|
||||
mPlot->removeItem(mItemTitle);
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ void TransparentDraggableRect::deleteRect()
|
|||
mPlot->removeItem(mPixmap);
|
||||
mPlot->removeItem(mItemTitle);
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
}
|
||||
}
|
||||
|
|
@ -161,6 +161,7 @@ void TransparentDraggableRect::onDelRect()
|
|||
//mDragMode = DragNone;
|
||||
//删除框图
|
||||
deleteRect();
|
||||
mPlot->replot();
|
||||
//保存
|
||||
mPlot->SaveToSLF_Text();
|
||||
//属性清空
|
||||
|
|
|
|||
|
|
@ -413,6 +413,7 @@ void TransparentDraggableResult::onDelRect()
|
|||
//mDragMode = DragNone;
|
||||
//删除框图
|
||||
deleteRect();
|
||||
mPlot->replot();
|
||||
}
|
||||
|
||||
void TransparentDraggableResult::onMousePress(QMouseEvent *event)
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ void TransparentDraggableSwallCore::deleteRect()
|
|||
mPlot->removeItem(m_qcpItemLine2);
|
||||
mPlot->removeItem(m_qcpItemLine3);
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
|
||||
//
|
||||
|
|
@ -452,6 +452,7 @@ void TransparentDraggableSwallCore::onDelRect()
|
|||
//mDragMode = DragNone;
|
||||
//删除框图
|
||||
deleteRect();
|
||||
mPlot->replot();
|
||||
//保存
|
||||
mPlot->SaveToSLF_SwallCore();
|
||||
//属性清空
|
||||
|
|
|
|||
|
|
@ -440,7 +440,7 @@ void TransparentGroupResult::deleteRect()
|
|||
mPlot->removeItem(mItemTitle);
|
||||
mPlot->removeItem(mDragLine);
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
|
||||
}
|
||||
|
|
@ -698,6 +698,7 @@ void TransparentGroupResult::onDelRect()
|
|||
//mDragMode = DragNone;
|
||||
//删除框图
|
||||
deleteRect();
|
||||
mPlot->replot();
|
||||
}
|
||||
|
||||
void TransparentGroupResult::onMousePress(QMouseEvent *event)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#include <QtMath>
|
||||
#include "Gradient.h"
|
||||
#include "PickFrac.h"
|
||||
#include "ObjTubingstringResult.h"
|
||||
#include "DrawNrad.h"
|
||||
#include "formline.h"
|
||||
|
||||
|
|
@ -94,7 +93,7 @@ FormDraw::FormDraw(QWidget *parent, QString strWellName, QString strTrackName) :
|
|||
connect(CallManage::getInstance(), SIGNAL(sig_AddMCals(QString, QString, QString, QString, QString, int)), this, SLOT(s_addMCals(QString, QString, QString, QString, QString,int)));
|
||||
|
||||
//套管组件
|
||||
connect(CallManage::getInstance(), SIGNAL(sig_AddTubingstring(QString, QString, QString, QString, QString, int)), this, SLOT(s_addTubingstring(QString, QString, QString, QString, QString,int)));
|
||||
connect(CallManage::getInstance(), SIGNAL(sig_AddTubingstring(QString, QString, QString, QString, QString, int, QStringList)), this, SLOT(s_addTubingstring(QString, QString, QString, QString, QString,int, QStringList)));
|
||||
|
||||
//改变固井曲线名
|
||||
connect(CallManage::getInstance(), SIGNAL(sig_changeGujingLine(QString, QString, QString, QString, QString, QString)), this, SLOT(s_changeGujingLine(QString, QString, QString, QString, QString, QString)));
|
||||
|
|
@ -318,6 +317,11 @@ void FormDraw::DisplayLines(QJsonArray linesArray)
|
|||
//沉积相
|
||||
DisplayFac_One(lineObjInfo);
|
||||
}
|
||||
else if (strType == "TubingstringObject")
|
||||
{
|
||||
//套管组件
|
||||
DisplayTubing_One(lineObjInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayType_One(lineObjInfo);
|
||||
|
|
@ -762,6 +766,91 @@ void FormDraw::DisplayFac_One(QJsonObject lineObjInfo)
|
|||
}
|
||||
}
|
||||
|
||||
//套管組件
|
||||
void FormDraw::DisplayTubing_One(QJsonObject lineObjInfo)
|
||||
{
|
||||
QString strSlfName = "";
|
||||
QString strWellName = "";
|
||||
QString strLineName = "";
|
||||
QString strAliasName = "";//显示名称
|
||||
QFont curveNameFont("微软雅黑", 10); // 名称字体
|
||||
QColor lineColor = QColor(0, 0, 0);//颜色
|
||||
|
||||
if (lineObjInfo.contains("SlfName"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("SlfName");
|
||||
if (value.isString()) {
|
||||
strSlfName = value.toString();
|
||||
//qDebug() << "SlfName:" << strSlfName;
|
||||
|
||||
//
|
||||
QString slffilename = QString("");
|
||||
int ind = strSlfName.lastIndexOf('\\');
|
||||
int ind2 = strSlfName.lastIndexOf('/');
|
||||
if (ind2 > ind) ind = ind2;
|
||||
if (ind > -1) {
|
||||
slffilename = strSlfName.mid(ind + 1);
|
||||
strSlfName = slffilename;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("WellName"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("WellName");
|
||||
if (value.isString()) {
|
||||
strWellName = value.toString();
|
||||
//qDebug() << "WellName:" << strWellName;
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("LineName"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("LineName");
|
||||
if (value.isString()) {
|
||||
strLineName = value.toString();
|
||||
//qDebug() << "LineName:" << strLineName;
|
||||
}
|
||||
}
|
||||
if (lineObjInfo.contains("AliasName"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("AliasName");
|
||||
if (value.isString()) {
|
||||
strAliasName = value.toString();
|
||||
//qDebug() << "strAliasName:" << strAliasName;
|
||||
}
|
||||
}
|
||||
//字体
|
||||
if (lineObjInfo.contains("curveNameFont"))
|
||||
{
|
||||
QJsonValue value = lineObjInfo.value("curveNameFont");
|
||||
if (value.isString()) {
|
||||
curveNameFont.fromString(value.toString());
|
||||
//qDebug() << "strUnit:" << strUnit;
|
||||
}
|
||||
}
|
||||
//
|
||||
if (lineObjInfo.contains("lineColor"))
|
||||
{
|
||||
lineColor.setNamedColor(lineObjInfo.value("lineColor").toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
QString folderPath = GetLogdataPath();
|
||||
folderPath = folderPath + g_prjname;
|
||||
strSlfName = folderPath + "/" + "#" + strWellName + "/" + strSlfName;
|
||||
|
||||
if (strLineName != "")
|
||||
{
|
||||
QStringList listOtherProperty;
|
||||
listOtherProperty.append(strAliasName);//别名
|
||||
listOtherProperty.append(lineColor.name());//名称颜色
|
||||
listOtherProperty.append(curveNameFont.toString());//名称字体
|
||||
|
||||
//套管組件
|
||||
this->s_addTubingstring(m_strUuid, strSlfName, strWellName, m_strTrackName, strLineName, 0, listOtherProperty); //
|
||||
}
|
||||
}
|
||||
|
||||
void FormDraw::DisplayLine_One(QJsonObject lineObjInfo)
|
||||
{
|
||||
QString strSlfName = "";
|
||||
|
|
@ -2847,7 +2936,7 @@ void FormDraw::s_addMCals(QString strUuid, QString strSlfName, QString strWellNa
|
|||
}
|
||||
|
||||
//套管组件
|
||||
void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW)
|
||||
void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW, QStringList listOtherProperty)
|
||||
{
|
||||
//井名&道名不一致
|
||||
if(strUuid == m_strUuid && m_strWellName == strWellName && m_strTrackName == strTrackName)
|
||||
|
|
@ -2922,9 +3011,8 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st
|
|||
curv->yAxis2->setTicks(false);
|
||||
|
||||
//套管组件
|
||||
QString strWaveName = "TUBTOOLS";
|
||||
CObjTubingstringResult *objTubingstringResult = new CObjTubingstringResult();
|
||||
objTubingstringResult->LoadFromSLF(curv, strSlfName, strWaveName);
|
||||
//QString strWaveName = "TUBTOOLS";
|
||||
curv->LoadFromSLF_Tubing(strSlfName, strLineName);
|
||||
|
||||
//
|
||||
connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*)));
|
||||
|
|
@ -2933,12 +3021,18 @@ void FormDraw::s_addTubingstring(QString strUuid, QString strSlfName, QString st
|
|||
m_listTableName.push_back(strLineName);
|
||||
|
||||
QString strAliasName = "套管组件";
|
||||
QString strUnit = "";
|
||||
QColor newlineColor=QColor(0,0,0);
|
||||
if(listOtherProperty.size()>=3)
|
||||
{
|
||||
strAliasName = listOtherProperty[0];
|
||||
newlineColor.setNamedColor(listOtherProperty[1]);
|
||||
}
|
||||
|
||||
QString strUnit = "";
|
||||
double width=2;
|
||||
QString strScaleType = "";
|
||||
//道-对象
|
||||
m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strWaveName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "TubingstringObject");
|
||||
m_formTrack->Add(strSlfName, m_strWellName, m_strTrackName, strLineName, strAliasName, strUnit, newlineColor, width, m_RightVal, m_LeftVal, strScaleType, "TubingstringObject", listOtherProperty);
|
||||
}
|
||||
|
||||
void FormDraw::initForm(QMyCustomPlot *widget, QString strSlfName, QString strLineName,
|
||||
|
|
|
|||
|
|
@ -69,6 +69,9 @@ public:
|
|||
//沉积相
|
||||
void DisplayFac_One(QJsonObject lineObjInfo);
|
||||
|
||||
//套管組件
|
||||
void DisplayTubing_One(QJsonObject lineObjInfo);
|
||||
|
||||
// 跨道设置
|
||||
void crossTrackSetting();
|
||||
|
||||
|
|
@ -263,7 +266,7 @@ public slots:
|
|||
void s_addMCals(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);
|
||||
|
||||
//套管组件
|
||||
void s_addTubingstring(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);
|
||||
void s_addTubingstring(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW, QStringList listOtherProperty);
|
||||
|
||||
//TDT
|
||||
// void s_addTDT(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int nW);
|
||||
|
|
|
|||
|
|
@ -181,6 +181,13 @@ QJsonObject FormInfo::makeJson()
|
|||
//item属性写入slf文件,不需要此次记录
|
||||
return rootObj;
|
||||
}
|
||||
else if (m_strType == "TubingstringObject")
|
||||
{
|
||||
//套管组件
|
||||
|
||||
//item属性写入slf文件,不需要此次记录
|
||||
return rootObj;
|
||||
}
|
||||
|
||||
rootObj["Unit"] = m_strUnit;
|
||||
rootObj["Width"] = m_dWidth;
|
||||
|
|
@ -1089,6 +1096,14 @@ void FormInfo::contextMenuEvent(QContextMenuEvent *event)
|
|||
menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除当前对象", this, &FormInfo::onDeleteTable);
|
||||
menu.exec(event->globalPos());
|
||||
}
|
||||
else if(m_strType=="TubingstringObject")
|
||||
{
|
||||
//套管组件
|
||||
QMenu menu(this);
|
||||
menu.addAction(QIcon(::GetImagePath() + "icon/Sheet.png"), "数据对象查看", this, &FormInfo::onShowTable);
|
||||
menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除当前对象", this, &FormInfo::onDeleteTable);
|
||||
menu.exec(event->globalPos());
|
||||
}
|
||||
}
|
||||
|
||||
//曲线数据查看
|
||||
|
|
|
|||
|
|
@ -107,8 +107,8 @@ FormTrack::FormTrack(QWidget *parent, QString strWellName, QString strTrackName)
|
|||
this, SLOT(s_addMCals(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
|
||||
|
||||
//套管组件
|
||||
connect(this, SIGNAL(sig_AddTubingstring(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)),
|
||||
this, SLOT(s_addTubingstring(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString)));
|
||||
connect(this, SIGNAL(sig_AddTubingstring(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString, QStringList)),
|
||||
this, SLOT(s_addTubingstring(QString, QString, QString, QString, QString, QString, QColor, double, float, float, QString, QStringList)));
|
||||
|
||||
//曲线选中,置顶
|
||||
connect(CallManage::getInstance(), SIGNAL(sig_Raise(QString, QString, QString, QString, QString, int, QString)), this, SLOT(s_Raise(QString, QString, QString, QString, QString, int, QString)));
|
||||
|
|
@ -267,7 +267,7 @@ void FormTrack::Add(QString strSlfName, QString strWellName, QString strTrackNam
|
|||
}
|
||||
else if(strType=="TubingstringObject")
|
||||
{
|
||||
emit sig_AddTubingstring(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType);
|
||||
emit sig_AddTubingstring(strSlfName, strWellName, m_strTrackName, strLineName, strAliasName, strUnit, lineColor, dWidth, vmax, vmin, strScaleType, listOtherProperty);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1078,7 +1078,7 @@ void FormTrack::s_addMCals(QString strSlfName, QString strWellName, QString strT
|
|||
}
|
||||
|
||||
//套管
|
||||
void FormTrack::s_addTubingstring(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType)
|
||||
void FormTrack::s_addTubingstring(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty)
|
||||
{
|
||||
qDebug() << "FormTrack s_addTubingstring";
|
||||
|
||||
|
|
@ -1103,6 +1103,13 @@ void FormTrack::s_addTubingstring(QString strSlfName, QString strWellName, QStri
|
|||
formInfo->setVMin(vmin);
|
||||
formInfo->setFrontColor(QColor(0,0,0));
|
||||
formInfo->setBackColor(QColor(255,255,255));
|
||||
//
|
||||
if(listOtherProperty.size()>=3)
|
||||
{
|
||||
QFont curveNameFont("微软雅黑", 10); // 名称字体
|
||||
curveNameFont.fromString(listOtherProperty[2]);
|
||||
formInfo->m_curveNameFont = curveNameFont;
|
||||
}
|
||||
//设置高度
|
||||
ui->tableWidget->setRowHeight(row, 100);
|
||||
//单元格委托
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ signals:
|
|||
void sig_AddJiegutext(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty={});
|
||||
void sig_AddLogface(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty={});
|
||||
void sig_AddMCals(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
||||
void sig_AddTubingstring(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
||||
void sig_AddTubingstring(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty={});
|
||||
|
||||
public slots:
|
||||
void s_addLine(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty={});
|
||||
|
|
@ -116,7 +116,7 @@ public slots:
|
|||
void s_addJiegutext(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty={});
|
||||
void s_addLogface(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty={});
|
||||
void s_addMCals(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
||||
void s_addTubingstring(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
||||
void s_addTubingstring(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType, QStringList listOtherProperty={});
|
||||
void s_addTDT(QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, QString strAliasName, QString strUnit, QColor lineColor, double dWidth, float vmax, float vmin, QString strScaleType);
|
||||
|
||||
void s_Raise(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strLineName, int iTableType, QString strFormInfoType);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ SOURCES += \
|
|||
Gradient.cpp \
|
||||
InDefTableDlg.cpp \
|
||||
InterfaceWidget.cpp \
|
||||
ObjTubingstringResult.cpp \
|
||||
PickFrac.cpp \
|
||||
PropertyWidget.cpp \
|
||||
QCPSizeHandle.cpp \
|
||||
|
|
@ -103,7 +102,6 @@ HEADERS += \
|
|||
Gradient.h \
|
||||
InDefTableDlg.h \
|
||||
InterfaceWidget.h \
|
||||
ObjTubingstringResult.h \
|
||||
PickFrac.h \
|
||||
PropertyWidget.h \
|
||||
QCPSizeHandle.h \
|
||||
|
|
|
|||
|
|
@ -3273,7 +3273,18 @@ void MainWindowCurve::s_NewMCals()
|
|||
//套管组件
|
||||
void MainWindowCurve::s_NewTubingstring()
|
||||
{
|
||||
QStringList sret = this->getSelectWell();
|
||||
// QStringList sret = this->getSelectWell();
|
||||
// if(sret.length() <= 0)
|
||||
// return;
|
||||
|
||||
//选中道
|
||||
if(m_SelectTableItem.m_iTableType==2) {
|
||||
//新建表格曲线
|
||||
emit CallManage::getInstance()->sig_AddTableLine(m_strUuid, m_SelectTableItem.m_strSlfName, m_SelectTableItem.m_strWellName, m_SelectTableItem.m_strTrackName, "IMAGE_DATA");
|
||||
return;
|
||||
}
|
||||
|
||||
QStringList sret = this->getSelectWell_New();
|
||||
if(sret.length() <= 0)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,13 @@ QMyCustomPlot::QMyCustomPlot(QWidget *parent, QString strSlfName, QString strWel
|
|||
xAxis2->setTickLabels(false);
|
||||
yAxis2->setTickLabels(false);
|
||||
|
||||
//套管组件
|
||||
zoneOrder_Tubing.clear();
|
||||
if(zoneOrder_Tubing.size()==0)
|
||||
{
|
||||
zoneOrder_Tubing=GetZoneOrder(QString("TubTools.ini"));
|
||||
}
|
||||
|
||||
connect(this->selectionRect(), &QCPSelectionRect::accepted, this, &QMyCustomPlot::slotSelectionRectAccepted);
|
||||
// make bottom and left axes transfer their ranges to top and right axes:
|
||||
connect(xAxis, SIGNAL(rangeChanged(QCPRange)), xAxis2, SLOT(setRange(QCPRange)));
|
||||
|
|
@ -1299,6 +1306,26 @@ void QMyCustomPlot::contextMenuEvent(QContextMenuEvent *event)
|
|||
//menu.addAction(QIcon(::GetImagePath() + "icon/Layer.png"), "沉积相自动描述", this, &QMyCustomPlot::ChangeDep);
|
||||
menu.exec(event->globalPos());
|
||||
}
|
||||
else if (strType == "TubingstringObject")
|
||||
{
|
||||
QStringList strs=zoneOrder_Tubing.keys();
|
||||
QStringList mstrs=QString("油管接箍,套管接箍,偏配,封隔器,筛管,喇叭口,水力猫,短接,管底部,油管深").split(",");
|
||||
QMenu menu(this);
|
||||
QMenu *pSubMenu = menu.addMenu("特殊工具");
|
||||
//套管组件
|
||||
for(int i=0;i<strs.size();i++) {
|
||||
QString str;
|
||||
str="添加"+strs.at(i);
|
||||
if(mstrs.indexOf(strs.at(i))>-1) {
|
||||
menu.addAction(QIcon(::GetImagePath() + "icon/OneSideWallCore.png"), str, this, &QMyCustomPlot::addItem_Tubing);
|
||||
}
|
||||
else {
|
||||
pSubMenu->addAction(QIcon(::GetImagePath() + "icon/OneSideWallCore.png"), str, this, &QMyCustomPlot::addItem_Tubing);
|
||||
}
|
||||
}
|
||||
//menu.addAction(QIcon(::GetImagePath() + "icon/OneSideWallCore.png"), "添加偏配", this, &QMyCustomPlot::addItem_Tubing);
|
||||
menu.exec(event->globalPos());
|
||||
}
|
||||
}
|
||||
|
||||
//右键--添加分段线
|
||||
|
|
@ -7824,6 +7851,29 @@ bool QMyCustomPlot::LoadFromSLF_Fac(QString strSlfName, QString csCurve, bool bA
|
|||
return true;
|
||||
}
|
||||
|
||||
//添加套管组件
|
||||
void QMyCustomPlot::addItem_Tubing()
|
||||
{
|
||||
double right_Hight = xAxis->pixelToCoord(m_event->pos().y());//x轴展示深度
|
||||
|
||||
QAction *pAct=dynamic_cast<QAction *>(sender());
|
||||
if(pAct){
|
||||
QString str=pAct->text();
|
||||
str.remove("添加");
|
||||
int i=zoneOrder_Tubing[str].toInt();
|
||||
if(i>-1) {
|
||||
Slf_JIEGUPOS result;
|
||||
result.Depth=-right_Hight;
|
||||
result.Order=0;
|
||||
result.Number=i;
|
||||
//
|
||||
drawOne_Tubing(result);
|
||||
//保存
|
||||
SaveToSLF_Tubing();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//添加沉积相
|
||||
void QMyCustomPlot::addItem_Fac()
|
||||
{
|
||||
|
|
@ -8042,3 +8092,263 @@ void QMyCustomPlot::RefreshItems_Fac(bool bAdd)
|
|||
//属性清空
|
||||
//PropertyService()->InitCurrentViewInfo();
|
||||
}
|
||||
|
||||
|
||||
bool QMyCustomPlot::LoadFromSLF_Tubing(QString strSlfName, QString csCurve)
|
||||
{
|
||||
m_pResultList_Tubing.clear();
|
||||
|
||||
cclimgpath_Tubing=GetSymbolDir()+"\\管柱组件\\";
|
||||
|
||||
Slf_JIEGUPOS *m_pResult=NULL;
|
||||
CMemRdWt *logio=new CMemRdWt();
|
||||
if(strSlfName==""||!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead))
|
||||
{
|
||||
delete logio;
|
||||
// QMessageBox::information(NULL,"提示","SLF文件打开失败,请检查!!",QMessageBox::Yes);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int iIndex=logio->OpenTable(csCurve.toStdString().c_str());
|
||||
if(iIndex>-1) {
|
||||
int count=logio->GetTableRecordCount(iIndex);
|
||||
//int fieldnum=logio->GetTableFieldCount(iIndex);
|
||||
int len=logio->GetTableRecordLength(iIndex);
|
||||
m_pResult=(Slf_JIEGUPOS *)new char[len+1];
|
||||
char buf[200];
|
||||
logio->IsChange=true;
|
||||
|
||||
bool bDrawGuanzhu = false;
|
||||
for(int i=0;i<count;i++)
|
||||
{
|
||||
memset(m_pResult,0,sizeof(len));
|
||||
logio->ReadTable(iIndex,i+1,m_pResult);
|
||||
|
||||
Slf_JIEGUPOS result;
|
||||
result.Depth=m_pResult->Depth;
|
||||
result.Order=m_pResult->Order;
|
||||
result.Number=m_pResult->Number;
|
||||
m_pResultList_Tubing.append(result);
|
||||
|
||||
//
|
||||
double depth=m_pResult->Depth;
|
||||
int Order=m_pResult->Order;
|
||||
int Number=m_pResult->Number;
|
||||
|
||||
if(bDrawGuanzhu == false)
|
||||
{
|
||||
//还没有画管柱
|
||||
if(Number == zoneOrder_Tubing.value("管底部").toInt()||
|
||||
Number == zoneOrder_Tubing.value("油管深").toInt()||
|
||||
Number == zoneOrder_Tubing.value("喇叭口").toInt()||
|
||||
Number == zoneOrder_Tubing.value("剌叭口").toInt())
|
||||
{
|
||||
bDrawGuanzhu = true;//画管柱
|
||||
|
||||
QString shotimgfile=GetSymbolDir()+"\\管柱组件\\管柱.png";
|
||||
//QImage shotimg(shotimgfile);
|
||||
//pPainter->drawImage(rect,shotimg);
|
||||
|
||||
double lY1 = this->yAxis->range().lower;//+10
|
||||
double lY2 = this->yAxis->range().upper;
|
||||
QCPItemPixmap *mPixmap;
|
||||
mPixmap = new QCPItemPixmap(this);
|
||||
//mPixmap->setPixmap(QPixmap(":/image/file.png")); // 设置图片
|
||||
mPixmap->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式
|
||||
mPixmap->setLayer("overlay"); // 确保在最上层
|
||||
//
|
||||
float upper = this->xAxis->range().upper;
|
||||
mPixmap->topLeft->setCoords(upper, lY1 + (lY2-lY1-m_Oguan_Tubing)/2.0);
|
||||
mPixmap->bottomRight->setCoords(-depth, lY2 - (lY2-lY1-m_Oguan_Tubing)/2.0);
|
||||
mPixmap->setPixmap(QPixmap(shotimgfile)); // 设置图片
|
||||
}
|
||||
}
|
||||
}
|
||||
logio->CloseTable(iIndex);
|
||||
delete m_pResult;
|
||||
}
|
||||
delete logio;
|
||||
|
||||
for(int i=0; i<m_pResultList_Tubing.size(); i++)
|
||||
{
|
||||
Slf_JIEGUPOS result = m_pResultList_Tubing[i];
|
||||
//
|
||||
drawOne_Tubing(result);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void QMyCustomPlot::drawOne_Tubing(Slf_JIEGUPOS result)
|
||||
{
|
||||
double depth=result.Depth;
|
||||
//int Order=result.Order;
|
||||
int Number=result.Number;
|
||||
|
||||
float h=20;
|
||||
float in=m_Oind_Tubing;
|
||||
if(!m_bDrawCCL_Tubing)
|
||||
{
|
||||
if(Number==1) {
|
||||
in=m_Oind_Tubing+1;
|
||||
}
|
||||
else if(Number==zoneOrder_Tubing.value("套管接箍").toInt()){
|
||||
h=10;
|
||||
in=m_Oind_Tubing;
|
||||
}
|
||||
else if(Number==zoneOrder_Tubing.value("封隔器").toInt()||
|
||||
Number==zoneOrder_Tubing.value("水力猫").toInt()||
|
||||
Number==zoneOrder_Tubing.value("卡瓦").toInt()||
|
||||
Number==zoneOrder_Tubing.value("定封隔猫").toInt()
|
||||
)
|
||||
{
|
||||
if(Number==zoneOrder_Tubing.value("封隔器").toInt()) h=25;
|
||||
in=m_Oind_Tubing;
|
||||
}
|
||||
else {
|
||||
in=m_Oind_Tubing+1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
in=m_Oind_Tubing+1;
|
||||
}
|
||||
|
||||
QString name;
|
||||
if(!m_bDrawCCL_Tubing)
|
||||
{
|
||||
name=zoneOrder_Tubing.key(QString::number(Number));
|
||||
if(name.isEmpty()) name=zoneOrder_Tubing.key(QString::number(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
name=zoneOrder_Tubing.key(QString::number(1));
|
||||
}
|
||||
|
||||
QString cclimgfile=cclimgpath_Tubing+name+".png";
|
||||
float upper = this->xAxis->coordToPixel(-depth)-h/2.0;
|
||||
float lower = this->xAxis->coordToPixel(-depth)+h/2.0;
|
||||
float newUpper = this->xAxis->pixelToCoord(upper);
|
||||
float newLower = this->xAxis->pixelToCoord(lower);
|
||||
this->addGuanToPlot(newLower, newUpper, cclimgfile, in);
|
||||
|
||||
// QString cclimgfile=cclimgpath+name+".png";
|
||||
// double lY1 = widget->yAxis->range().lower;//+10
|
||||
// double lY2 = widget->yAxis->range().upper;
|
||||
// QCPItemPixmap *mPixmap;
|
||||
// mPixmap = new QCPItemPixmap(widget);
|
||||
// mPixmap->setScaled(true, Qt::IgnoreAspectRatio); // 设置缩放方式
|
||||
// mPixmap->setLayer("overlay"); // 确保在最上层
|
||||
// //
|
||||
// float upper = widget->xAxis->coordToPixel(-depth)-h/2.0;
|
||||
// float lower = widget->xAxis->coordToPixel(-depth)+h/2.0;
|
||||
// float newUpper = widget->xAxis->pixelToCoord(upper);
|
||||
// float newLower = widget->xAxis->pixelToCoord(lower);
|
||||
// mPixmap->topLeft->setCoords(newUpper, lY1 + (lY2-lY1-in)/2.0);
|
||||
// mPixmap->bottomRight->setCoords(newLower, lY2 - (lY2-lY1-in)/2.0);
|
||||
// mPixmap->setPixmap(QPixmap(cclimgfile)); // 设置图片
|
||||
}
|
||||
|
||||
bool QMyCustomPlot::SaveToSLF_Tubing()
|
||||
{
|
||||
static int isrun=false;
|
||||
if(isrun) return false;
|
||||
QString ss=m_strSlfName;
|
||||
if(ss=="") return false;
|
||||
isrun=true;
|
||||
|
||||
Slf_JIEGUPOS m_Result;
|
||||
CMemRdWt *logio=new CMemRdWt();
|
||||
if(!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_Guan.size()) {
|
||||
delete logio;
|
||||
isrun=false;
|
||||
return false;
|
||||
}
|
||||
if(m_strLineName.indexOf("READCCL",0,Qt::CaseInsensitive)>-1) {
|
||||
iIndex=logio->Open_Set_Table(m_strLineName.toStdString().c_str(),0,3,
|
||||
"NO,DEPTH,NUMBER",
|
||||
"4,4,4",//字段长度
|
||||
"1,4,4",//字段类型
|
||||
"0,0,0");//字段备注,1-枚举
|
||||
}
|
||||
else iIndex=logio->Open_Set_Table(m_strLineName.toStdString().c_str(),0,4,
|
||||
"NO,DEPTH,NUMBER,DEST",
|
||||
"4,4,4,64",//字段长度
|
||||
"1,4,4,6",//字段类型
|
||||
"0,0,8,0");//字段备注,1-枚举
|
||||
isfirst=true;
|
||||
}
|
||||
logio->IsChange=true;
|
||||
logio->SetTableRecordCount(iIndex,m_mapDraggable_Guan.size());
|
||||
if(!m_mapDraggable_Guan.size()) {
|
||||
delete logio;
|
||||
if(isfirst)AddTableToWellRound();
|
||||
isrun=false;
|
||||
return false;
|
||||
}
|
||||
int len=logio->GetTableRecordLength(iIndex);
|
||||
|
||||
TransparentDraggableGuan *pDraggableRect =NULL;
|
||||
//排序
|
||||
QList<float> listSDepth;
|
||||
for (QMap<QString,QObject *>::Iterator iter = m_mapDraggable_Guan.begin(); iter != m_mapDraggable_Guan.end(); iter++)
|
||||
{
|
||||
pDraggableRect = (TransparentDraggableGuan*)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_Guan.begin(); iter != m_mapDraggable_Guan.end(); iter++)
|
||||
{
|
||||
pDraggableRect = (TransparentDraggableGuan*)iter.value();
|
||||
//
|
||||
QCPRange tmpRange = pDraggableRect->getRange();
|
||||
float fSDepth = -tmpRange.upper;
|
||||
float fEDepth = -tmpRange.lower;
|
||||
if(fSDepth == listSDepth[i])//按顺序写入
|
||||
{
|
||||
memset(&m_Result,0,len);
|
||||
m_Result.Order=i+1;
|
||||
m_Result.Depth=(fSDepth+fEDepth)/2.0;
|
||||
//
|
||||
QString name,itemName;
|
||||
pDraggableRect->m_Result.replace("\\","/");
|
||||
int l=pDraggableRect->m_Result.lastIndexOf("/");
|
||||
if(l>-1) name=pDraggableRect->m_Result.mid(l+1);
|
||||
l=name.indexOf(".");
|
||||
name=name.left(l);
|
||||
itemName=name;
|
||||
//
|
||||
m_Result.Number=zoneOrder_Tubing.value(itemName).toInt();
|
||||
if(len==sizeof(Slf_JIEGUPOS)) {
|
||||
strncpy(m_Result.Dest,"",64);
|
||||
m_Result.Dest[63]=0;
|
||||
}
|
||||
logio->WriteTable(iIndex,i+1,&m_Result);
|
||||
}
|
||||
}
|
||||
}
|
||||
logio->CloseTable(iIndex);
|
||||
delete logio;
|
||||
if(isfirst)AddTableToWellRound();
|
||||
isrun=false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -270,6 +270,18 @@ public:
|
|||
//保存
|
||||
void SaveToSLF_Fac();
|
||||
|
||||
//套管組件
|
||||
QMap<QString,QString> zoneOrder_Tubing;
|
||||
float m_Oguan_Tubing = 63.5;
|
||||
float m_Oind_Tubing = 121.36;
|
||||
bool m_bDrawCCL_Tubing = false;
|
||||
QString cclimgpath_Tubing="";
|
||||
QList<Slf_JIEGUPOS> m_pResultList_Tubing;
|
||||
QString m_strAddTubing="";
|
||||
bool LoadFromSLF_Tubing(QString strSlfName, QString csCurve);
|
||||
void drawOne_Tubing(Slf_JIEGUPOS result);
|
||||
bool SaveToSLF_Tubing();
|
||||
|
||||
public slots:
|
||||
void slot_time();
|
||||
|
||||
|
|
@ -439,6 +451,10 @@ public slots:
|
|||
void addItem_Fac(); //添加沉积相
|
||||
void RefreshItems_Fac(bool bAdd=true); //刷新数据
|
||||
|
||||
//右键--套管组件
|
||||
void addItem_Tubing(); //添加套管组件
|
||||
//void RefreshItems_Tubing(); //刷新数据
|
||||
|
||||
//右键--解释结论
|
||||
void onOpenEditResult();
|
||||
void onCloseEditResult();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "transparentdraggableGuan.h"
|
||||
|
||||
#include "PropertyWidget.h"
|
||||
#include "CallManage.h"
|
||||
|
||||
extern double g_dPixelPerCm;//每厘米像素数
|
||||
//static GeoIndicatorGenerator m_drawGeo;
|
||||
|
|
@ -236,20 +237,52 @@ void TransparentDraggableGuan::deleteRect()
|
|||
mPlot->removeItem(mPixmap);
|
||||
// mPlot->removeItem(mItemTitle);
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
|
||||
//
|
||||
// //避免二次绘制框图
|
||||
// mPlot->m_bDrawRect = false;
|
||||
// mDragMode = DragNone;
|
||||
// //取消选中框
|
||||
// mPlot->selectionRect()->cancel();
|
||||
// mPlot->replot();
|
||||
// mPlot->selectionRect()->mActive=true;
|
||||
}
|
||||
}
|
||||
|
||||
//设置深度移动量
|
||||
void TransparentDraggableGuan::setItemDepthOffset()
|
||||
{
|
||||
bool ok=0;
|
||||
double depthshift=QInputDialog::getDouble(NULL,"深度移动","请输入移动的深度量(上移-,下移+)",0.0,-2147483647, 2147483647,4,&ok);
|
||||
if(!ok) return;
|
||||
|
||||
QCPRange currentRange = getRange();
|
||||
QCPRange newRange = currentRange;
|
||||
|
||||
newRange.lower = currentRange.lower-depthshift;
|
||||
newRange.upper = currentRange.upper-depthshift;
|
||||
|
||||
//
|
||||
double width = currentRange.size();
|
||||
// //double center = mDragStartRange.center() + dx;
|
||||
// double center = currentRange.center() - depthshift;
|
||||
// newRange.lower = center - width/2;
|
||||
// newRange.upper = center + width/2;
|
||||
|
||||
// 检查是否超出轴范围
|
||||
if(newRange.lower < getMyLower()) {
|
||||
return;
|
||||
}
|
||||
else if(newRange.upper > getMyUpper()) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
setRange(newRange.lower, newRange.upper);
|
||||
|
||||
{
|
||||
//保存
|
||||
mPlot->SaveToSLF_Tubing();
|
||||
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 0, "");
|
||||
}
|
||||
}
|
||||
|
||||
void TransparentDraggableGuan::initRect()
|
||||
{
|
||||
|
|
@ -317,6 +350,11 @@ void TransparentDraggableGuan::onDelRect()
|
|||
//mDragMode = DragNone;
|
||||
//删除框图
|
||||
deleteRect();
|
||||
mPlot->replot();
|
||||
//保存
|
||||
mPlot->SaveToSLF_Tubing();
|
||||
//属性清空
|
||||
PropertyService()->InitCurrentViewInfo();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -343,19 +381,13 @@ void TransparentDraggableGuan::onMousePress(QMouseEvent *event)
|
|||
|
||||
//event->accept();
|
||||
|
||||
// double low = mRect->topLeft->coords().x();
|
||||
// double hight = mRect->bottomRight->coords().x();
|
||||
// PropertyService()->initTubingItemProperty(this, low, hight, m_Result);
|
||||
|
||||
QMenu menu(nullptr);
|
||||
QAction *delAction = menu.addAction("删除框图");
|
||||
//delAction->installEventFilter(this);
|
||||
connect(delAction, &QAction::triggered, this, &TransparentDraggableGuan::onDelRect);
|
||||
|
||||
// QAction* pItem = menu.exec(event->globalPos());
|
||||
// if(pItem == delAction)
|
||||
// {
|
||||
// //event->accept();
|
||||
|
||||
// int ii=0;
|
||||
// ii++;
|
||||
// }
|
||||
menu.addAction(QIcon(::GetImagePath() + "icon/Delete.png"), "删除选中对象", this, &TransparentDraggableGuan::onDelRect);
|
||||
menu.addAction(QIcon(::GetImagePath() + "icon/Shift.png"), "设置深度移动量", this, &TransparentDraggableGuan::setItemDepthOffset);
|
||||
menu.exec(event->globalPos());
|
||||
|
||||
return;
|
||||
|
|
@ -393,8 +425,32 @@ void TransparentDraggableGuan::onMousePress(QMouseEvent *event)
|
|||
|
||||
}
|
||||
|
||||
int TransparentDraggableGuan::getCursor()
|
||||
{
|
||||
if (m_bMoveRect)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
if (m_bArrow)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void TransparentDraggableGuan::onMouseMove(QMouseEvent *event)
|
||||
{
|
||||
if (mDragMode == DragRect)
|
||||
{
|
||||
m_bMoveRect = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bArrow = false;
|
||||
m_bMoveRect = false;
|
||||
}
|
||||
|
||||
//--------------------
|
||||
if(mDragMode == DragNone) return;
|
||||
|
||||
event->accept();
|
||||
|
|
@ -487,6 +543,12 @@ void TransparentDraggableGuan::onMouseMove(QMouseEvent *event)
|
|||
}
|
||||
}
|
||||
|
||||
//位置改变,鼠标拖动item
|
||||
if(newRange.lower!= mDragStartRange.lower || newRange.upper!= mDragStartRange.upper)
|
||||
{
|
||||
m_bChange = true;
|
||||
}
|
||||
|
||||
setRange(newRange.lower, newRange.upper);
|
||||
|
||||
}
|
||||
|
|
@ -495,6 +557,21 @@ void TransparentDraggableGuan::onMouseRelease(QMouseEvent *event)
|
|||
{
|
||||
if(event->button() == Qt::LeftButton && mDragMode != DragNone) {
|
||||
event->accept();
|
||||
//属性
|
||||
{
|
||||
// double low = mRect->topLeft->coords().x();
|
||||
// double hight = mRect->bottomRight->coords().x();
|
||||
// PropertyService()->initGujingItemProperty(this, low, hight, m_Result);
|
||||
if(m_bChange)
|
||||
{
|
||||
//保存
|
||||
mPlot->SaveToSLF_Tubing();
|
||||
}
|
||||
|
||||
//取消所有选中单元格
|
||||
emit CallManage::getInstance()->sig_Raise(mPlot->m_strUuid, "", "", "", "", 0, "");
|
||||
}
|
||||
|
||||
//避免二次绘制框图
|
||||
mPlot->m_bDrawRect = false;
|
||||
//emit rangeChanged(getRange());
|
||||
|
|
|
|||
|
|
@ -55,14 +55,15 @@ private:
|
|||
void updateHandles() ;
|
||||
|
||||
private slots:
|
||||
void onDelRect();
|
||||
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 +84,13 @@ private:
|
|||
// 添加最小宽度成员变量
|
||||
double mMinWidth;
|
||||
float mIn=123;
|
||||
|
||||
//鼠标形状
|
||||
bool m_bArrow = false;
|
||||
bool m_bMoveRect = false;
|
||||
int getCursor();
|
||||
//鼠标是否拖动item
|
||||
bool m_bChange = false;
|
||||
};
|
||||
|
||||
#endif // TRANSPARENTDRAGGABLEGUAN_H
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ void TransparentDraggableRightList::deleteRect()
|
|||
}
|
||||
mPlot->m_bPriviewRightList = false;//当前是否正在编辑曲线。
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
|
||||
//
|
||||
|
|
@ -244,6 +244,7 @@ void TransparentDraggableRightList::onDelRect()
|
|||
//mDragMode = DragNone;
|
||||
//删除框图
|
||||
deleteRect();
|
||||
mPlot->replot();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ void TransparentDraggableSelectRect::deleteRect()
|
|||
}
|
||||
mPlot->m_bEditRect = false;//当前是否正在编辑曲线。
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
|
||||
//
|
||||
|
|
@ -276,6 +276,7 @@ void TransparentDraggableSelectRect::onDelRect()
|
|||
//mDragMode = DragNone;
|
||||
//删除框图
|
||||
deleteRect();
|
||||
mPlot->replot();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ void TransparentDraggableImage::deleteRect()
|
|||
mPlot->removeItem(mPixmap);
|
||||
mPlot->removeItem(mItemTitle);
|
||||
|
||||
mPlot->replot();
|
||||
//mPlot->replot();
|
||||
this->deleteLater();
|
||||
|
||||
//
|
||||
|
|
@ -365,6 +365,7 @@ void TransparentDraggableImage::onDelRect()
|
|||
//mDragMode = DragNone;
|
||||
//删除框图
|
||||
deleteRect();
|
||||
mPlot->replot();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user