套管底部位置,随着套管组件更新
This commit is contained in:
parent
ce7b7b962f
commit
2cc2765790
|
|
@ -1356,6 +1356,13 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
|
||||||
m_tdGuan->setRange(-depth-m_tdGuan->mH/2.0, -depth+m_tdGuan->mH/2.0);
|
m_tdGuan->setRange(-depth-m_tdGuan->mH/2.0, -depth+m_tdGuan->mH/2.0);
|
||||||
//保存
|
//保存
|
||||||
m_tdGuan->mPlot->SaveToSLF_Tubing();
|
m_tdGuan->mPlot->SaveToSLF_Tubing();
|
||||||
|
//检查套管组件名称,是否需要更新套管图形
|
||||||
|
bool bReDraw = m_tdGuan->mPlot->checkTubingName(m_tdGuan->m_Result);
|
||||||
|
if(bReDraw)
|
||||||
|
{
|
||||||
|
//组件改变后,重绘管柱
|
||||||
|
m_tdGuan->mPlot->LoadFromSLF_ReDrawTubing(m_tdGuan->mPlot->m_strSlfName, m_tdGuan->mPlot->m_strLineName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if("组件类型" == m_propertyData[pProperty])
|
else if("组件类型" == m_propertyData[pProperty])
|
||||||
|
|
@ -1363,6 +1370,10 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
|
||||||
//qDebug() << "组件类型->改变";
|
//qDebug() << "组件类型->改变";
|
||||||
if(m_tdGuan)
|
if(m_tdGuan)
|
||||||
{
|
{
|
||||||
|
//检查套管组件名称,是否需要更新套管图形
|
||||||
|
bool bReDrawOld = m_tdGuan->mPlot->checkTubingName(m_tdGuan->m_Result);
|
||||||
|
|
||||||
|
//--------------------------
|
||||||
QString newResult = variant.value<QString>();
|
QString newResult = variant.value<QString>();
|
||||||
m_tdGuan->setResult(newResult);
|
m_tdGuan->setResult(newResult);
|
||||||
//
|
//
|
||||||
|
|
@ -1370,6 +1381,14 @@ void PropertyWidget::SlotPropertyChanged( QtProperty *pProperty, const QVariant
|
||||||
m_tdGuan->setRange(currentRange.lower, currentRange.upper);
|
m_tdGuan->setRange(currentRange.lower, currentRange.upper);
|
||||||
//保存
|
//保存
|
||||||
m_tdGuan->mPlot->SaveToSLF_Tubing();
|
m_tdGuan->mPlot->SaveToSLF_Tubing();
|
||||||
|
|
||||||
|
//---------
|
||||||
|
bool bReDrawNew = m_tdGuan->mPlot->checkTubingName(m_tdGuan->m_Result);
|
||||||
|
if(bReDrawOld || bReDrawNew)
|
||||||
|
{
|
||||||
|
//组件改变后,重绘管柱
|
||||||
|
m_tdGuan->mPlot->LoadFromSLF_ReDrawTubing(m_tdGuan->mPlot->m_strSlfName, m_tdGuan->mPlot->m_strLineName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8363,6 +8363,17 @@ void QMyCustomPlot::addItem_Tubing()
|
||||||
drawOne_Tubing(result);
|
drawOne_Tubing(result);
|
||||||
//保存
|
//保存
|
||||||
SaveToSLF_Tubing();
|
SaveToSLF_Tubing();
|
||||||
|
|
||||||
|
//检查套管组件名称,是否需要更新套管图形
|
||||||
|
//画管柱
|
||||||
|
if(str == "管底部" ||
|
||||||
|
str == "油管深" ||
|
||||||
|
str == "喇叭口" ||
|
||||||
|
str == "剌叭口")
|
||||||
|
{
|
||||||
|
//组件改变后,重绘管柱
|
||||||
|
LoadFromSLF_ReDrawTubing(m_strSlfName, m_strLineName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -8724,6 +8735,77 @@ void QMyCustomPlot::drawOne_Tubing(Slf_JIEGUPOS result)
|
||||||
this->addGuanToPlot(newLower, newUpper, cclimgfile, in, false);
|
this->addGuanToPlot(newLower, newUpper, cclimgfile, in, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QMyCustomPlot::LoadFromSLF_ReDrawTubing(QString strSlfName, QString csCurve)
|
||||||
|
{
|
||||||
|
cclimgpath_Tubing=GetSymbolDir()+"\\管柱组件\\";
|
||||||
|
|
||||||
|
Slf_JIEGUPOS *m_pResult=NULL;
|
||||||
|
CMemRdWt *logio=new CMemRdWt();
|
||||||
|
if(strSlfName==""||!logio->Open(strSlfName.toStdString().c_str(),CSlfIO::modeRead))
|
||||||
|
{
|
||||||
|
delete logio;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int iIndex=logio->OpenTable(csCurve.toStdString().c_str());
|
||||||
|
if(iIndex<0)
|
||||||
|
{
|
||||||
|
delete logio;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
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;
|
||||||
|
|
||||||
|
//
|
||||||
|
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;//画管柱
|
||||||
|
m_depth_Tubing = depth;//管柱深度
|
||||||
|
|
||||||
|
//绘制管柱
|
||||||
|
DrawTubing();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
logio->CloseTable(iIndex);
|
||||||
|
delete m_pResult;
|
||||||
|
}
|
||||||
|
delete logio;
|
||||||
|
//统一刷新
|
||||||
|
this->replot();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool QMyCustomPlot::SaveToSLF_Tubing()
|
bool QMyCustomPlot::SaveToSLF_Tubing()
|
||||||
{
|
{
|
||||||
static int isrun=false;
|
static int isrun=false;
|
||||||
|
|
@ -8827,3 +8909,26 @@ bool QMyCustomPlot::SaveToSLF_Tubing()
|
||||||
isrun=false;
|
isrun=false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//检查套管组件名称,是否需要更新套管图形
|
||||||
|
bool QMyCustomPlot::checkTubingName(QString m_Result)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
QString name,itemName;
|
||||||
|
m_Result.replace("\\","/");
|
||||||
|
int l=m_Result.lastIndexOf("/");
|
||||||
|
if(l>-1) name=m_Result.mid(l+1);
|
||||||
|
l=name.indexOf(".");
|
||||||
|
name=name.left(l);
|
||||||
|
itemName=name;
|
||||||
|
//画管柱
|
||||||
|
if(itemName == "管底部" ||
|
||||||
|
itemName == "油管深" ||
|
||||||
|
itemName == "喇叭口" ||
|
||||||
|
itemName == "剌叭口")
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -298,6 +298,10 @@ public:
|
||||||
void DrawStruct();
|
void DrawStruct();
|
||||||
//绘制管柱
|
//绘制管柱
|
||||||
void DrawTubing();
|
void DrawTubing();
|
||||||
|
//组件改变后,重绘管柱
|
||||||
|
bool LoadFromSLF_ReDrawTubing(QString strSlfName, QString csCurve);
|
||||||
|
//检查套管组件名称,是否需要更新套管图形
|
||||||
|
bool checkTubingName(QString m_Result);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void slot_time();
|
void slot_time();
|
||||||
|
|
|
||||||
|
|
@ -316,6 +316,14 @@ void TransparentDraggableGuan::setItemDepthOffset()
|
||||||
//保存
|
//保存
|
||||||
mPlot->SaveToSLF_Tubing();
|
mPlot->SaveToSLF_Tubing();
|
||||||
|
|
||||||
|
//检查套管组件名称,是否需要更新套管图形
|
||||||
|
bool bReDraw = mPlot->checkTubingName(m_Result);
|
||||||
|
if(bReDraw)
|
||||||
|
{
|
||||||
|
//组件改变后,重绘管柱
|
||||||
|
mPlot->LoadFromSLF_ReDrawTubing(mPlot->m_strSlfName, mPlot->m_strLineName);
|
||||||
|
}
|
||||||
|
|
||||||
//属性清空
|
//属性清空
|
||||||
PropertyService()->InitCurrentViewInfo();
|
PropertyService()->InitCurrentViewInfo();
|
||||||
|
|
||||||
|
|
@ -406,6 +414,13 @@ void TransparentDraggableGuan::onDelRect()
|
||||||
mPlot->replot();
|
mPlot->replot();
|
||||||
//保存
|
//保存
|
||||||
mPlot->SaveToSLF_Tubing();
|
mPlot->SaveToSLF_Tubing();
|
||||||
|
//检查套管组件名称,是否需要更新套管图形
|
||||||
|
bool bReDraw = mPlot->checkTubingName(m_Result);
|
||||||
|
if(bReDraw)
|
||||||
|
{
|
||||||
|
//组件改变后,重绘管柱
|
||||||
|
mPlot->LoadFromSLF_ReDrawTubing(mPlot->m_strSlfName, mPlot->m_strLineName);
|
||||||
|
}
|
||||||
//属性清空
|
//属性清空
|
||||||
PropertyService()->InitCurrentViewInfo();
|
PropertyService()->InitCurrentViewInfo();
|
||||||
}
|
}
|
||||||
|
|
@ -606,6 +621,7 @@ void TransparentDraggableGuan::onMouseMove(QMouseEvent *event)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TransparentDraggableGuan::onMouseRelease(QMouseEvent *event)
|
void TransparentDraggableGuan::onMouseRelease(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if(event->button() == Qt::LeftButton && mDragMode != DragNone) {
|
if(event->button() == Qt::LeftButton && mDragMode != DragNone) {
|
||||||
|
|
@ -619,6 +635,13 @@ void TransparentDraggableGuan::onMouseRelease(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
//保存
|
//保存
|
||||||
mPlot->SaveToSLF_Tubing();
|
mPlot->SaveToSLF_Tubing();
|
||||||
|
//检查套管组件名称,是否需要更新套管图形
|
||||||
|
bool bReDraw = mPlot->checkTubingName(m_Result);
|
||||||
|
if(bReDraw)
|
||||||
|
{
|
||||||
|
//组件改变后,重绘管柱
|
||||||
|
mPlot->LoadFromSLF_ReDrawTubing(mPlot->m_strSlfName, mPlot->m_strLineName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//取消所有选中单元格
|
//取消所有选中单元格
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ public:
|
||||||
//设置外径长
|
//设置外径长
|
||||||
void setOin(float in);
|
void setOin(float in);
|
||||||
|
|
||||||
//设置解释结论
|
//设置套管组件
|
||||||
void setResult(QString filePath);
|
void setResult(QString filePath);
|
||||||
void drawResult(double left_Low, double right_Hight, double lY1, double lY2);
|
void drawResult(double left_Low, double right_Hight, double lY1, double lY2);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user