|
|
#include "StdAfx.h"
|
|
|
|
|
|
#include "WellPoleLib/WellMarkNamesList.h"
|
|
|
|
|
|
#include "WellPoleLib/WellBaseObj.h"
|
|
|
#include "WellPoleLib/WellClassObjGroup.h"
|
|
|
#include "WellPoleLib/InTrackDepthSegment.h"
|
|
|
#include "WellPoleLib/InTrackTextBase.h"
|
|
|
//#include "WellPoleLib\TrackValidThick.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackTextRange.h"
|
|
|
#include "WellPoleLib\InTrackSymbol.h"
|
|
|
#include "WellPoleLib\InTrackLith.h"
|
|
|
#include "WellPoleLib\InTrackResult.h"
|
|
|
#include "WellPoleLib\InTrackOilTest.h"
|
|
|
#include "WellPoleLib\InTrackSample.h"
|
|
|
#include "WellPoleLib\InTrackShot.h"
|
|
|
#include "WellPoleLib\InTrackTestExtraction.h"
|
|
|
|
|
|
#include "WellPoleLib\InTrackLayerGroup.h"
|
|
|
#include "WellPoleLib\InTrackCoring.h"
|
|
|
#include "WellPoleLib\InTrackCoreWell.h"
|
|
|
#include "WellPoleLib\InTrackPicture.h"
|
|
|
#include "WellPoleLib\InTrackFaultPoint.h"
|
|
|
|
|
|
#include "WellPoleLib\TrackObj.h"
|
|
|
#include "WellPoleLib\InclinedTrack.h"
|
|
|
#include "WellPoleLib\TrackStratum.h"
|
|
|
#include "WellPoleLib/TrackCurve.h"
|
|
|
#include "WellPoleLib\TrackCorePosition.h"
|
|
|
#include "WellPoleLib\TrackDepth.h"
|
|
|
#include "WellPoleLib\TrackLith.h"
|
|
|
#include "WellPoleLib\TrackOilTest.h"
|
|
|
#include "WellPoleLib\TrackBury.h"
|
|
|
#include "WellPoleLib\TrackShot.h"
|
|
|
#include "WellPoleLib\TrackSample.h"
|
|
|
#include "WellPoleLib\TrackText.h"
|
|
|
#include "WellPoleLib\TrackPicture.h"
|
|
|
#include "WellPoleLib\TrackResult.h"
|
|
|
#include "WellPoleLib/TrackGroup.h"
|
|
|
#include "WellPoleLib\TrackCoreWell.h"
|
|
|
#include "WellPoleLib\TrackSymbol.h"
|
|
|
#include "WellPoleLib\TrackTestExtraction.h"
|
|
|
#include "WellPoleLib/TrackFluidProducingProfile.h"
|
|
|
#include "WellPoleLib/TrackWaterInjectionProfile.h"
|
|
|
#include "WellPoleLib\TrackPicture.h"
|
|
|
#include "WellPoleLib/WellPole.h"
|
|
|
#include "WellPoleLib\Data\WellData_SandSet.h"
|
|
|
#include "WellPoleLib\Data\WellData_ReservesLayer.h"
|
|
|
#include "WellPoleLib/InTrackCycle.h"
|
|
|
#include "WellPoleLib/InTrackSandstone.h"
|
|
|
#include "WellPoleLib/TrackSandstone.h"
|
|
|
#include "WellPoleLib/InTrackInnerLayer.h"
|
|
|
#include "WellPoleLib/TrackInnerLayer.h"
|
|
|
#include "WellPoleLib/TrackSandLayer.h"
|
|
|
#include "WellPoleLib/InTrackFacies.h"
|
|
|
#include "WellPoleLib/InTrackWaterInjectionProfile.h"
|
|
|
#include "WellPoleLib/InTrackFluidProducingProfile.h"
|
|
|
#include "MultiWellSectionLib/BendObj.h"
|
|
|
#include "MultiWellSectionLib/WellSection.h"
|
|
|
#include "../../SigmaDoc.h"
|
|
|
#include "ItemWcsTrackIn.h"
|
|
|
#include "ItemWcsTrack.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace NItem
|
|
|
{
|
|
|
|
|
|
// int GetDrawTypeIndex(DWORD dwDrawType)
|
|
|
//{
|
|
|
// int nIndex = 0; //<2F><><EFBFBD>η<EFBFBD>ʽ
|
|
|
// switch(dwDrawType)
|
|
|
// {
|
|
|
// default:
|
|
|
// case CSeismicDrawBase::typeWiggle: nIndex = 0; break;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
// case CSeismicDrawBase::typeRightVa: nIndex = 1; break;//<2F>ұ<EFBFBD><D2B1><EFBFBD><EFBFBD><EFBFBD>
|
|
|
// case CSeismicDrawBase::typeLeftVa: nIndex = 2; break;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
// case CSeismicDrawBase::typeVarDensity: nIndex = 3; break;//<2F><><EFBFBD>ܶ<EFBFBD><DCB6><EFBFBD>ʾ
|
|
|
// case CSeismicDrawBase::typeVarDensity|CSeismicDrawBase::typeWiggle: nIndex = 4; break;//<2F><><EFBFBD>ܶ<EFBFBD>+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
// case CSeismicDrawBase::typeVarDensity|CSeismicDrawBase::typeRightVa:nIndex = 5; break;//<2F><><EFBFBD>ܶ<EFBFBD>+<2B>ұ<EFBFBD><D2B1><EFBFBD><EFBFBD><EFBFBD>
|
|
|
// case CSeismicDrawBase::typeVarDensity|CSeismicDrawBase::typeLeftVa: nIndex = 6; break;//<2F><><EFBFBD>ܶ<EFBFBD>+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
// }
|
|
|
// return nIndex;
|
|
|
//}
|
|
|
//DWORD GetDrawType(int nIndex)
|
|
|
//{
|
|
|
// DWORD dwType = CSeismicDrawBase::typeWiggle;
|
|
|
// switch(nIndex)
|
|
|
// {
|
|
|
// default:
|
|
|
// case 0: dwType = CSeismicDrawBase::typeWiggle; break;
|
|
|
// case 1: dwType = CSeismicDrawBase::typeRightVa; break;
|
|
|
// case 2: dwType = CSeismicDrawBase::typeLeftVa; break;
|
|
|
// case 3: dwType = CSeismicDrawBase::typeVarDensity; break;
|
|
|
// case 4: dwType = CSeismicDrawBase::typeVarDensity | CSeismicDrawBase::typeWiggle; break;
|
|
|
// case 5: dwType = CSeismicDrawBase::typeVarDensity | CSeismicDrawBase::typeRightVa; break;
|
|
|
// case 6: dwType = CSeismicDrawBase::typeVarDensity | CSeismicDrawBase::typeLeftVa; break;
|
|
|
// }
|
|
|
// return dwType;
|
|
|
//}
|
|
|
|
|
|
CItemWcsTrack::CItemWcsTrack(CSigmaDoc* pDoc)
|
|
|
: CItemWellBase(pDoc)
|
|
|
,m_bAddTrackIn(FALSE)
|
|
|
{
|
|
|
SetType(ITEM_TRACK);
|
|
|
m_pTrack = NULL;
|
|
|
m_pItemWell = NULL;
|
|
|
|
|
|
m_bWellFrame = TRUE;
|
|
|
m_bAddFaultPoint = FALSE;
|
|
|
//CMapEditFrame *pParentFrame = (CMapEditFrame*)pWnd->GetMapFrame();
|
|
|
//if(!pParentFrame->IsKindOf(RUNTIME_CLASS(CMapWellFrame)))
|
|
|
//{
|
|
|
// m_bWellFrame = FALSE;
|
|
|
//}
|
|
|
//CMapWellFrame *pFrame = (CMapWellFrame*)pWnd->GetMapFrame();
|
|
|
//for(int ii = 0; ii< pFrame->GetMapFrame2D().m_SplitterWnd.GetSize(); ii++)
|
|
|
//{
|
|
|
// m_DcVec.push_back(pFrame->GetMapFrame2D().m_SplitterWnd[ii].pMapWnd2D->GetDC());
|
|
|
|
|
|
// m_WndVec.push_back(pFrame->GetMapFrame2D().m_SplitterWnd[ii].pMapWnd2D);
|
|
|
//}
|
|
|
}
|
|
|
|
|
|
CItemWcsTrack::~CItemWcsTrack(void)
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
void CItemWcsTrack::OnDraw(CXyDC* pXyDC, CDC* pDC)
|
|
|
{
|
|
|
CPen pen(PS_DOT, 0, RGB(0, 0, 0));
|
|
|
CPen *pOldPen = (CPen *)pDC->SelectObject(&pen);
|
|
|
int old = pDC->SetROP2(R2_NOTXORPEN);
|
|
|
if (m_bLDown)
|
|
|
{
|
|
|
CRect rect;
|
|
|
rect.top = m_firstPoint.y;
|
|
|
rect.bottom = m_lastPoint.y;
|
|
|
rect.left = GetDC()->GetScreen(m_pTrack->GetPos()).left;
|
|
|
rect.right = GetDC()->GetScreen(m_pTrack->GetPos()).right;
|
|
|
|
|
|
if(rect.Height() == 0)
|
|
|
{
|
|
|
pDC->MoveTo(rect.left, rect.top);
|
|
|
pDC->LineTo(rect.right, rect.top);
|
|
|
}
|
|
|
else
|
|
|
pDC->Rectangle(rect);
|
|
|
}
|
|
|
pDC->SelectObject(pOldPen);
|
|
|
pen.DeleteObject();
|
|
|
pDC->SetROP2(old);
|
|
|
}
|
|
|
|
|
|
void CItemWcsTrack::OnLButtonDown(CDC *pDC, UINT nFlags, CPoint point, int vk)
|
|
|
{
|
|
|
m_bLDown = TRUE;
|
|
|
m_bAddTrackIn = FALSE;
|
|
|
CPoint2D ptReal = GetDC()->GetReal(point);
|
|
|
m_downPoint = m_firstPoint = m_lastPoint = point;
|
|
|
//<2F><><EFBFBD><EFBFBD>ʮ<EFBFBD><CAAE><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ҫȫͼ<C8AB><CDBC><EFBFBD>ƿ<EFBFBD><C6BF><EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD>Ϊ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>µ<EFBFBD>ʮ<EFBFBD><CAAE><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD><F3A3ACB5><EFBFBD>Ҫʮ<D2AA><CAAE><EFBFBD><EFBFBD>ʱֱ<CAB1><D6B1> OnDrawЧ<77>ʸ<EFBFBD>
|
|
|
//if (::GetPreferences().WorkaroundDisplay.m_bViewCrossLine)
|
|
|
// GetDoc()->Invalidate();
|
|
|
//else
|
|
|
OnDraw(GetDC(),pDC);
|
|
|
|
|
|
//GetView()->SetCapture();
|
|
|
//CXTPPropertyGrid &grid = GetPropertyGrid(GetDoc()->GetMainFrame());
|
|
|
//InitPropertyGrid(grid);
|
|
|
}
|
|
|
|
|
|
void CItemWcsTrack::OnLButtonUp(CDC *pDC, UINT nFlags, CPoint point, int vk)
|
|
|
{
|
|
|
ReleaseCapture();
|
|
|
|
|
|
m_lastPoint = point;
|
|
|
CPoint2D ptDown = GetDC()->GetReal(m_downPoint);
|
|
|
CPoint2D ptLast = GetDC()->GetReal(m_lastPoint);
|
|
|
double yMax=max(ptDown.y0,ptLast.y0);
|
|
|
double yMin=min(ptDown.y0,ptLast.y0);
|
|
|
if (abs(m_downPoint.y-m_lastPoint.y)==0 &&
|
|
|
m_pTrack->GetTrackType() != Track_StandardLayer &&
|
|
|
m_pTrack->GetTrackType() != Track_FaultPoint &&
|
|
|
m_pTrack->GetTrackType() != Track_CoreWell)
|
|
|
{
|
|
|
OnDraw(GetDC(),pDC);
|
|
|
m_bLDown = FALSE;
|
|
|
return;
|
|
|
}
|
|
|
CWellPole *pWellObj = m_pTrack->GetWell();
|
|
|
BOOL bSelect = FALSE;
|
|
|
CRect8 rect;
|
|
|
WELLOBJLIST::iterator it = m_pTrack->GetChildren().begin();
|
|
|
for( ; it != m_pTrack->GetChildren().end(); it++)
|
|
|
{
|
|
|
CWellBaseObj* pObj = *it;
|
|
|
rect = pObj->GetRect();
|
|
|
rect.NormalizeRect();
|
|
|
if (yMin<rect.bottom&&yMax>rect.top)
|
|
|
{
|
|
|
if(m_pItemWell)
|
|
|
{
|
|
|
if (!m_bAddTrackIn)
|
|
|
{
|
|
|
m_pItemWell->m_WellObjSelectlist.RemoveAll();
|
|
|
}
|
|
|
m_pItemWell->Select(pObj, TRUE);
|
|
|
m_pItemWell->SetSelectMode(CItemNestBase::netSelect);
|
|
|
m_pItemWell->SetDrawObj(pWellObj);
|
|
|
}
|
|
|
m_bAddTrackIn = TRUE;
|
|
|
bSelect = TRUE;
|
|
|
}
|
|
|
//else if(yMin<rect.bottom&&yMax>rect.bottom||yMax>rect.top&&yMin<rect.top)
|
|
|
//{
|
|
|
// m_bLDown = FALSE;
|
|
|
// GetDoc()->Invalidate(m_pTrack);
|
|
|
|
|
|
// return;
|
|
|
//}
|
|
|
}
|
|
|
if (bSelect)
|
|
|
{
|
|
|
m_bLDown = FALSE;
|
|
|
CSigmaDoc* pDoc = GetDoc();
|
|
|
pDoc->Invalidate();// m_pTrack);
|
|
|
|
|
|
|
|
|
CItemWcsTrackIn* pItemTrackIn = new CItemWcsTrackIn(GetDoc());
|
|
|
pItemTrackIn->SetPos(GetPos());
|
|
|
if(m_pItemWell)
|
|
|
{
|
|
|
if(m_pItemWell->m_WellObjSelectlist.GetCount() == 1)
|
|
|
{
|
|
|
pItemTrackIn->SetDrawObj(m_pItemWell->m_WellObjSelectlist.GetHead());
|
|
|
//CXTPPropertyGrid &grid = GetPropertyGrid(GetDoc()->GetMainFrame());
|
|
|
//pItemTrackIn->InitPropertyGrid(grid);
|
|
|
}
|
|
|
m_pItemWell->SetItem(pItemTrackIn);
|
|
|
}
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
//CXTPPropertyGrid &grid = GetPropertyGrid(GetDoc()->GetMainFrame());
|
|
|
|
|
|
|
|
|
CInTrackDepthSegment * pTrackIn = NULL;
|
|
|
|
|
|
///////<2F><><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡо<C8A1><D0BE>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>Ի<EFBFBD><D4BB><EFBFBD>
|
|
|
if (m_pTrack->GetTrackType() == Track_StandardLayer ||
|
|
|
m_pTrack->GetTrackType() == Track_FaultPoint ||
|
|
|
m_pTrack->GetTrackType() == Track_CoreWell)
|
|
|
{
|
|
|
OnDraw(GetDC(),pDC);
|
|
|
if(AfxMessageBox(IDS_STRING_ACTION_ADD,MB_YESNO|MB_ICONQUESTION)!=IDYES)
|
|
|
{
|
|
|
m_bLDown = FALSE;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
m_bLDown = FALSE;
|
|
|
|
|
|
pTrackIn = CreatTopEndObj();
|
|
|
|
|
|
if (pTrackIn!=NULL)
|
|
|
{
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
SetReUnDoAction(TRUE, IDS_STRING_ACTION_MOVE, 3, pWellObj);
|
|
|
|
|
|
if (pTrackIn->GetType() == KEP_STANDARD ||
|
|
|
pTrackIn->GetType() == KEP_FAULTPOINT ||
|
|
|
pTrackIn->GetType() == KEP_COREWELL)
|
|
|
{
|
|
|
pTrackIn->GetPos().top = ptDown.y0;
|
|
|
pTrackIn->GetPos().bottom = ptDown.y0;
|
|
|
pTrackIn->GetPos().left = m_pTrack->GetPos().left;
|
|
|
pTrackIn->GetPos().right = m_pTrack->GetPos().right;
|
|
|
pTrackIn->m_fSdep = pWellObj->ScreenYToDepth(pTrackIn->GetPos().top);
|
|
|
pTrackIn->m_fEdep = pWellObj->ScreenYToDepth(pTrackIn->GetPos().bottom);
|
|
|
|
|
|
pTrackIn->SetRectInTrack(pTrackIn->GetPos(),LPVOID(pWellObj));
|
|
|
}
|
|
|
else if (pTrackIn->GetType() == KEP_RESULT ||
|
|
|
pTrackIn->GetType() == KEP_LAYERGROUP)
|
|
|
{
|
|
|
CString strDateTime;
|
|
|
CTime mTime;
|
|
|
mTime = CTime::GetCurrentTime();
|
|
|
strDateTime = mTime.Format(_T("%H%M%S"));
|
|
|
int nID;
|
|
|
nID = atoi(strDateTime);
|
|
|
pTrackIn->SetId(nID);
|
|
|
pTrackIn->GetPos().top = yMax;
|
|
|
pTrackIn->GetPos().bottom = yMin;
|
|
|
pTrackIn->GetPos().left = m_pTrack->GetPos().left;
|
|
|
pTrackIn->GetPos().right = m_pTrack->GetPos().right;
|
|
|
pTrackIn->m_fSdep = pWellObj->ScreenYToDepth(pTrackIn->GetPos().top);
|
|
|
pTrackIn->m_fEdep = pWellObj->ScreenYToDepth(pTrackIn->GetPos().bottom);
|
|
|
pTrackIn->SetRectInTrack(pTrackIn->GetPos(),LPVOID(pWellObj));
|
|
|
}
|
|
|
//else if (pTrackIn->GetType() == KEP_DISCRETESEGMENT)
|
|
|
//{
|
|
|
// CInTrackDiscreteSegment* pDiscreteSegment = (CInTrackDiscreteSegment*)pTrackIn;
|
|
|
// pDiscreteSegment->m_pTrackDiscrete = (CTrackDiscreteObj*)m_pTrack;
|
|
|
// pDiscreteSegment->GetPos().top = yMax;
|
|
|
// pDiscreteSegment->GetPos().bottom = yMin;
|
|
|
// pDiscreteSegment->GetPos().left = m_pTrack->GetPos().left;
|
|
|
// pDiscreteSegment->GetPos().right = m_pTrack->GetPos().right;
|
|
|
// pDiscreteSegment->m_fSdep = pWellObj->ScreenYToDepth(pTrackIn->GetPos().top);
|
|
|
// pDiscreteSegment->m_fEdep = pWellObj->ScreenYToDepth(pTrackIn->GetPos().bottom);
|
|
|
// pDiscreteSegment->SetRectInTrack(pTrackIn->GetPos(),LPVOID(pWellObj));
|
|
|
|
|
|
// pDiscreteSegment->SetParentObj(m_pTrack);
|
|
|
//}
|
|
|
else
|
|
|
{
|
|
|
pTrackIn->GetPos().top = yMax;
|
|
|
pTrackIn->GetPos().bottom = yMin;
|
|
|
pTrackIn->GetPos().left = m_pTrack->GetPos().left;
|
|
|
pTrackIn->GetPos().right = m_pTrack->GetPos().right;
|
|
|
pTrackIn->m_fSdep = pWellObj->ScreenYToDepth(pTrackIn->GetPos().top);
|
|
|
pTrackIn->m_fEdep = pWellObj->ScreenYToDepth(pTrackIn->GetPos().bottom);
|
|
|
pTrackIn->SetRectInTrack(pTrackIn->GetPos(),LPVOID(pWellObj));
|
|
|
}
|
|
|
|
|
|
pTrackIn->NormalText();
|
|
|
m_pTrack->AddChild(pTrackIn);
|
|
|
|
|
|
GetDoc()->Invalidate();// m_pTrack);
|
|
|
|
|
|
CItemWcsTrackIn* pItemTrackIn = new CItemWcsTrackIn(GetDoc());
|
|
|
if(m_pItemWell)
|
|
|
{
|
|
|
m_pItemWell->Select(pTrackIn);
|
|
|
pItemTrackIn->SetDrawObj(pTrackIn);
|
|
|
pItemTrackIn->SetPos(GetPos());
|
|
|
//pItemTrackIn->InitPropertyGrid(grid);
|
|
|
m_pItemWell->SetItem(pItemTrackIn);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
CInTrackDepthSegment* CItemWcsTrack::CreatTopEndObj()
|
|
|
{
|
|
|
CInTrackDepthSegment * pTrackIn = NULL;
|
|
|
if (m_pTrack->GetTrackType() == Track_Text)
|
|
|
{
|
|
|
CInTrackTextRange *pRange = new CInTrackTextRange();
|
|
|
pTrackIn = pRange;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
pTrackIn->m_pen = m_pTrack->m_penChild;
|
|
|
pTrackIn->m_brush.m_color = m_pTrack->m_brushChild.m_color;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_Symbol)
|
|
|
{
|
|
|
CInTrackSymbol* pSymbol = new CInTrackSymbol();
|
|
|
pTrackIn = pSymbol;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_Lith)
|
|
|
{
|
|
|
CInTrackLith* pLith = new CInTrackLith();
|
|
|
pTrackIn = pLith;
|
|
|
}
|
|
|
//else if (m_pTrack->GetTrackType()==Track_Layer)
|
|
|
//{
|
|
|
// CInTrackLayer* pLayer = new CInTrackLayer();
|
|
|
// pTrackIn = pLayer;
|
|
|
//}
|
|
|
else if (m_pTrack->GetTrackType() == Track_Result)
|
|
|
{
|
|
|
CInTrackResult* pResult = new CInTrackResult();
|
|
|
pTrackIn = pResult;
|
|
|
pTrackIn->m_pen = m_pTrack->m_penChild;
|
|
|
|
|
|
if (m_pTrack->GetChildren().size() > 0)
|
|
|
{
|
|
|
WELLOBJLIST::iterator it = m_pTrack->GetChildren().begin();
|
|
|
for (; it != m_pTrack->GetChildren().end(); it++)
|
|
|
{
|
|
|
if ((*it)->GetType() == KEP_RESULT)
|
|
|
{
|
|
|
CInTrackResult* pResult1 = (CInTrackResult*)(*it);
|
|
|
if (pResult1->IsShowName())
|
|
|
pResult->SetShowName(TRUE);
|
|
|
if (pResult1->IsShowPureThickness())
|
|
|
pResult->SetShowPureThickness(TRUE);
|
|
|
if (pResult1->IsShowThickness())
|
|
|
pResult->SetShowThickness(TRUE);
|
|
|
if (pResult1->IsShowRenderBrief())
|
|
|
pResult->SetShowRenderBrief(TRUE);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_Picture)
|
|
|
{
|
|
|
CInTrackPicture* pPicture = new CInTrackPicture();
|
|
|
pTrackIn = pPicture;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_OilTest)
|
|
|
{
|
|
|
CInTrackOilTest* pOilTest = new CInTrackOilTest();
|
|
|
pTrackIn = pOilTest;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_CorePosition)
|
|
|
{
|
|
|
CInTrackCoring* pCoring = new CInTrackCoring();
|
|
|
pTrackIn = pCoring;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
pTrackIn->m_pen = m_pTrack->m_penChild;
|
|
|
pTrackIn->m_brush.m_color = m_pTrack->m_brushChild.m_color;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_CoreWell)
|
|
|
{
|
|
|
CInTrackCoreWell* pCoreWell = new CInTrackCoreWell();
|
|
|
pTrackIn = pCoreWell;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
pTrackIn->m_pen = m_pTrack->m_penChild;
|
|
|
pTrackIn->m_brush.m_color = m_pTrack->m_brushChild.m_color;
|
|
|
//TRACKINCOREWELLDATA trackInCoreData;
|
|
|
//pCoreWell->AddCoreData(trackInCoreData);
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_Sample)
|
|
|
{
|
|
|
CInTrackSample* pSample = new CInTrackSample();
|
|
|
pTrackIn = pSample;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_Shot)
|
|
|
{
|
|
|
CInTrackShot* pShot = new CInTrackShot();
|
|
|
pTrackIn = pShot;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_CementingQuality)
|
|
|
{
|
|
|
//CInTrackCementing* pTrackInCementing = new CInTrackCementing();
|
|
|
//pTrackIn = pTrackInCementing;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_FluidProducingProfile)
|
|
|
{
|
|
|
CInTrackFluidProducingProfile* pTrackInProducedFluid = new CInTrackFluidProducingProfile();
|
|
|
pTrackIn = pTrackInProducedFluid;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
pTrackIn->m_pen = m_pTrack->m_penChild;
|
|
|
pTrackIn->m_brush = m_pTrack->m_brushChild;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_WaterInjectionProfile)
|
|
|
{
|
|
|
CTrackWaterInjectionProfile* pTrackWaterAbsorption = (CTrackWaterInjectionProfile*)m_pTrack;
|
|
|
CInTrackWaterInjectionProfile* pWaterAbsorption = new CInTrackWaterInjectionProfile();
|
|
|
pWaterAbsorption->SetShowAbsolute(pTrackWaterAbsorption->IsShowAbsolute());
|
|
|
pWaterAbsorption->SetShowRelative(pTrackWaterAbsorption->IsShowRelative());
|
|
|
pTrackIn = pWaterAbsorption;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
pTrackIn->m_pen = m_pTrack->m_penChild;
|
|
|
pTrackIn->m_brush = m_pTrack->m_brushChild;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_TestExtraction)
|
|
|
{
|
|
|
CInTrackTestExtraction* pTestExtraction = new CInTrackTestExtraction();
|
|
|
pTrackIn = pTestExtraction;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
pTrackIn->m_pen = m_pTrack->m_penChild;
|
|
|
pTrackIn->m_brush = m_pTrack->m_brushChild;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_OilLayerGroup ||
|
|
|
m_pTrack->GetTrackType() == Track_ProduceLayer || m_pTrack->GetTrackType() == Track_ReserveUnit ||
|
|
|
m_pTrack->GetTrackType() == Track_Stratum)
|
|
|
{
|
|
|
CInTrackLayerGroup* pLayerGroup = new CInTrackLayerGroup();
|
|
|
pTrackIn = pLayerGroup;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
pTrackIn->m_pen = m_pTrack->m_penChild;
|
|
|
pTrackIn->m_brush = m_pTrack->m_brushChild;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_SandLayer)
|
|
|
{
|
|
|
if (m_bAddFaultPoint == FALSE)
|
|
|
{
|
|
|
CInTrackLayerGroup* pLayerGroup = new CInTrackLayerGroup();
|
|
|
pTrackIn = pLayerGroup;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
pTrackIn->m_pen = m_pTrack->m_penChild;
|
|
|
pTrackIn->m_brush = m_pTrack->m_brushChild;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
CInTrackFaultPoint* pFaultPoint = new CInTrackFaultPoint();
|
|
|
|
|
|
pTrackIn = pFaultPoint;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
}
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_Discrete)
|
|
|
{
|
|
|
//CInTrackDiscreteSegment* pDiscreteSegment = new CInTrackDiscreteSegment();
|
|
|
//pTrackIn = pDiscreteSegment;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_FaultPoint)
|
|
|
{
|
|
|
CInTrackFaultPoint* pFaultPoint = new CInTrackFaultPoint();
|
|
|
|
|
|
pTrackIn = pFaultPoint;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_Sandstone)
|
|
|
{
|
|
|
CInTrackSandstone* pInSandstone = new CInTrackSandstone();
|
|
|
pTrackIn = pInSandstone;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_Facies)
|
|
|
{
|
|
|
CInTrackFacies *pRange = new CInTrackFacies();
|
|
|
pTrackIn = pRange;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
pTrackIn->m_pen = m_pTrack->m_penChild;
|
|
|
pTrackIn->m_brush.m_color = m_pTrack->m_brushChild.m_color;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_InnerLayer)
|
|
|
{
|
|
|
CInTrackInnerLayer *pRange = new CInTrackInnerLayer();
|
|
|
pTrackIn = pRange;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
pTrackIn->m_pen = m_pTrack->m_penChild;
|
|
|
pTrackIn->m_brush.m_color = m_pTrack->m_brushChild.m_color;
|
|
|
}
|
|
|
else if (m_pTrack->GetTrackType() == Track_Cycle)
|
|
|
{
|
|
|
CInTrackCycle *pRange = new CInTrackCycle();
|
|
|
pTrackIn = pRange;
|
|
|
pTrackIn->m_font = m_pTrack->m_fontChild;
|
|
|
pTrackIn->m_pen = m_pTrack->m_penChild;
|
|
|
pTrackIn->m_brush.m_color = m_pTrack->m_brushChild.m_color;
|
|
|
}
|
|
|
//else if(m_pTrack->GetTrackType() == Track_Curve)
|
|
|
//{
|
|
|
|
|
|
//}
|
|
|
//else if (m_pTrack->GetTrackType() == Track_CementingQualityCurve)
|
|
|
//{
|
|
|
// CInTrackCementingCurve* pCementingCurve = new CInTrackCementingCurve();
|
|
|
|
|
|
// pTrackIn = pCementingCurve;
|
|
|
//}
|
|
|
return pTrackIn;
|
|
|
}
|
|
|
|
|
|
void CItemWcsTrack::OnLButtonDblClk(UINT nFlags, CPoint point)
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
int CItemWcsTrack::OnMouseMove(CDC *pDC, UINT nFlags, CPoint point)
|
|
|
{
|
|
|
|
|
|
CPoint2D lastPoint = GetDC()->GetReal(point);
|
|
|
if (IsCaptureState() && m_bLDown)
|
|
|
{
|
|
|
|
|
|
OnDraw(GetDC(), pDC);
|
|
|
m_lastPoint = point;
|
|
|
OnDraw(GetDC(), pDC);
|
|
|
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
BOOL CItemWcsTrack::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
|
|
|
{
|
|
|
::SetCursor(AfxGetApp()->LoadCursor(IDC_CURSOR_RANGE));
|
|
|
return TRUE;
|
|
|
}
|
|
|
|
|
|
int CItemWcsTrack::DeleteSelection(void)
|
|
|
{
|
|
|
if(GetDrawObj() == NULL)
|
|
|
return 0;
|
|
|
|
|
|
CWellPole* pWellObj = (CWellPole*)m_pTrack->GetWell();
|
|
|
CTrackGroup* pParentTrack = (CTrackGroup*)m_pTrack->GetParent();
|
|
|
CWellBaseObj* pObj = NULL;
|
|
|
CTrackObj* pTrack = NULL;
|
|
|
|
|
|
int num = 0;
|
|
|
|
|
|
num = pWellObj->GetTrackCount();
|
|
|
|
|
|
if (num<=1)
|
|
|
{
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
if (pWellObj->GetParent()!=NULL)
|
|
|
{
|
|
|
CWellSection* pSection = (CWellSection*)pWellObj->GetParent();
|
|
|
POSITION posBend = pSection->m_BendList.GetHeadPosition();
|
|
|
while (posBend!=NULL)
|
|
|
{
|
|
|
CBendObj* pBend = (CBendObj*)pSection->m_BendList.GetNext(posBend);
|
|
|
if (pBend->m_pLayerLeft->GetParent() == m_pTrack||(pBend->m_pLayerRight!=NULL&&pBend->m_pLayerRight->GetParent()==m_pTrack))
|
|
|
{
|
|
|
POSITION posFind = pSection->m_BendList.Find(pBend);
|
|
|
if (posFind!=NULL)
|
|
|
{
|
|
|
pSection->DeleteBend(pBend);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
//pParentTrack->RemoveTrack(m_pTrack);
|
|
|
pWellObj->RemoveTrack(m_pTrack);
|
|
|
delete m_pTrack;
|
|
|
|
|
|
//if (pParentTrack->GetTrackList().size() == 0 && pParentTrack->GetType() != KEP_WELL)
|
|
|
//{//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD><C7BE><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>
|
|
|
// CTrackGroup* pPParentTrack = (CTrackGroup*)pParentTrack->GetParent();
|
|
|
// pPParentTrack->RemoveTrack(pParentTrack);
|
|
|
// delete pParentTrack;
|
|
|
//}
|
|
|
|
|
|
m_pTrack = NULL;
|
|
|
|
|
|
CPoint2D point = pWellObj->GetAnchorPoint();//pWellObj->GetPos().TopLeft();
|
|
|
pWellObj->CalculateSize(point);
|
|
|
if (pWellObj->IsSectionWell())
|
|
|
{
|
|
|
CWellSection* pSection = (CWellSection*)pWellObj->GetParent();
|
|
|
pSection->ReComputeBends(pWellObj);
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
void CItemWcsTrack::ReadCurveData(CTrackObj* pTrack)
|
|
|
{
|
|
|
CTrackCurveBase* TrackCurve = (CTrackCurveBase*)pTrack;
|
|
|
CString strcurvename = TrackCurve->m_strTrackName;
|
|
|
|
|
|
vector<CString> fields;
|
|
|
StringVectorSet *pdatas = NULL;
|
|
|
|
|
|
|
|
|
//CDataBinderWellCurve WellCurve;
|
|
|
//CDataBinderWellDiscrete WellDis;
|
|
|
//Db::CSqlStatementManager *pSqlManager = AfxGetGeo()->GetSqlStatementManager();
|
|
|
//if (pSqlManager->HasDB())
|
|
|
//{
|
|
|
// AfxGetApp()->BeginWaitCursor();
|
|
|
|
|
|
// CString tableng;
|
|
|
// CString strWellName ;
|
|
|
// if(m_pItemWell)
|
|
|
// strWellName= m_pItemWell->GetWellObject()->GetWellName();
|
|
|
//
|
|
|
// CTrackCurveObjBase* TrackCurve = (CTrackCurveObjBase*)pTrack;
|
|
|
// if (TrackCurve->GetTrackType() == Track_Curve)
|
|
|
// {
|
|
|
// fields.push_back("depth");
|
|
|
// fields.push_back(strcurvename);
|
|
|
// CString strSGXh;
|
|
|
// CString strVer;
|
|
|
|
|
|
// WellCurve.SetParams(strWellName,strcurvename,strSGXh,strVer,Db::LOG_CURVE);
|
|
|
// WellCurve.AttachInput(pSqlManager);
|
|
|
// WellCurve.ReadData();
|
|
|
// //pdatas = &WellCurve.GetDataSet();
|
|
|
// TrackCurve->BuidChildObject(WellCurve.GetCurveDepth(),WellCurve.GetCurveData(),WellCurve.GetDataNum(),TRUE);
|
|
|
// }
|
|
|
// else if (TrackCurve->GetTrackType() == Track_Discrete)
|
|
|
// {
|
|
|
// fields.push_back("depth");
|
|
|
// fields.push_back(strcurvename);
|
|
|
// //CDataBinderWellDiscrete WellDis(strWellName,strcurvename);
|
|
|
// WellDis.SetParams(strWellName,strcurvename);
|
|
|
// WellDis.AttachInput(pSqlManager);
|
|
|
// WellDis.ReadData();
|
|
|
// TrackCurve->BuidChildObject(WellDis.GetCurveDepth(),WellDis.GetCurveData(),WellDis.GetDataNum(),TRUE);
|
|
|
// //pdatas = &WellDis.GetDataSet();
|
|
|
// }
|
|
|
// AfxGetApp()->EndWaitCursor();
|
|
|
//}
|
|
|
//else
|
|
|
{//ʹ<>þ<EFBFBD><C3BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
CTrackCurve *pTrackCurve = (CTrackCurve*)pTrack;
|
|
|
CWellPole *pWell = pTrack->GetWell();
|
|
|
for(int ii = 0; ii< pWell->m_CurveDataVecs.size(); ii++)
|
|
|
{
|
|
|
if(strcurvename == pWell->m_CurveDataVecs[ii]->m_curve_name)
|
|
|
{
|
|
|
pTrackCurve->m_dataObj = *pWell->m_CurveDataVecs[ii];
|
|
|
pTrackCurve->m_fRlev = pTrackCurve->m_dataObj.m_rlev;
|
|
|
pTrackCurve->CaculateStartAndEnd(pWell);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void CItemWcsTrack::ReadWavetraceData(CTrackObj *pTrack,CString newname)
|
|
|
{
|
|
|
//Db::CSqlStatementManager *pSqlManager = AfxGetGeo()->GetSqlStatementManager();
|
|
|
//if (pSqlManager->HasDB())
|
|
|
//{
|
|
|
// AfxGetApp()->BeginWaitCursor();
|
|
|
|
|
|
// if(pTrack->GetTrackType() == Track_VdlImage)
|
|
|
// {
|
|
|
// CTrackVdlImage *pTrackVdl = (CTrackVdlImage*)pTrack;
|
|
|
|
|
|
// CWellObj *pWell = (CWellObj*)pTrack->GetParentObj();
|
|
|
// int well_id = pSqlManager->GetWellID(pWell->GetWellName());
|
|
|
|
|
|
// std::vector<CString>fields;
|
|
|
// std::vector<Db::DB_TABLE_DATA_TYPE>fieldsType;
|
|
|
|
|
|
// fields.push_back("top"); fieldsType.push_back(DB_DATA_DOUBLE);
|
|
|
// fields.push_back("bottom"); fieldsType.push_back(DB_DATA_DOUBLE);
|
|
|
// fields.push_back("DepthRelv"); fieldsType.push_back(DB_DATA_DOUBLE);
|
|
|
// fields.push_back("startTime"); fieldsType.push_back(DB_DATA_DOUBLE);
|
|
|
// fields.push_back("endTime"); fieldsType.push_back(DB_DATA_DOUBLE);
|
|
|
// fields.push_back("timeRelv"); fieldsType.push_back(DB_DATA_DOUBLE);
|
|
|
|
|
|
// fields.push_back("dataRow"); fieldsType.push_back(DB_DATA_INT);
|
|
|
// fields.push_back("datalen"); fieldsType.push_back(DB_DATA_INT);
|
|
|
// fields.push_back("SaveOrder"); fieldsType.push_back(DB_DATA_INT);
|
|
|
|
|
|
// fields.push_back("datatype");fieldsType.push_back(DB_DATA_STRING);
|
|
|
// fields.push_back("depthUnit");fieldsType.push_back(DB_DATA_STRING);
|
|
|
// fields.push_back("timeUnit");fieldsType.push_back(DB_DATA_STRING);
|
|
|
|
|
|
// fields.push_back("Data"); fieldsType.push_back(DB_DATA_BINARY);
|
|
|
|
|
|
// CDataBlobOne bread("well_wavetrace",fields,fieldsType);
|
|
|
|
|
|
// bread.AttachInput(pSqlManager);
|
|
|
|
|
|
// CString strWhere,str1,str2;
|
|
|
// str2.Format("'%s'", pWell->GetWellName() );
|
|
|
// str1 = bread.GetFieldFmtStr("well_id");
|
|
|
// strWhere = str1 + "=" +str2;
|
|
|
|
|
|
// str1 = bread.GetFieldFmtStr("name");
|
|
|
// str2.Format("='%s'",newname);
|
|
|
// strWhere =strWhere +" and " + str1 + str2;
|
|
|
|
|
|
// bread.SetWhereSql(strWhere);
|
|
|
// if(bread.GetBlobOneRecord())
|
|
|
// {
|
|
|
// pTrackVdl->SetNewDataInTrack(bread.GetBlobRecord()[0].data.m_dVal,bread.GetBlobRecord()[1].data.m_dVal,bread.GetBlobRecord()[2].data.m_dVal
|
|
|
// ,bread.GetBlobRecord()[3].data.m_dVal,bread.GetBlobRecord()[4].data.m_dVal,bread.GetBlobRecord()[5].data.m_dVal
|
|
|
// ,bread.GetBlobRecord()[6].data.m_iVal,bread.GetBlobRecord()[7].data.m_iVal,bread.GetBlobRecord()[8].data.m_iVal
|
|
|
// ,bread.GetBlobRecord()[9].m_str,bread.GetBlobRecord()[10].m_str,bread.GetBlobRecord()[11].m_str
|
|
|
// ,bread.GetBlobRecord()[12].GetBlob().pData,bread.GetBlobRecord()[12].GetBlob().cbSize);
|
|
|
|
|
|
// pTrack->m_strTrackName = newname;
|
|
|
// }
|
|
|
// bread.EndBlob();
|
|
|
// }
|
|
|
|
|
|
// AfxGetApp()->EndWaitCursor();
|
|
|
//}
|
|
|
} |