You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1116 lines
36 KiB
C++
1116 lines
36 KiB
C++
/**************************************************************************************
|
|
井内道操作
|
|
主要函数列表:
|
|
1 virtual BOOL InitPropertyGrid(CXTPPropertyGrid& grid); 初始化属性窗口
|
|
2 virtual void OnLButtonDown(UINT nFlags, CPoint point); 鼠标操作
|
|
3 virtual void OnLButtonUp(UINT nFlags, CPoint point);
|
|
4 virtual void OnMouseMove(UINT nFlags, CPoint point);
|
|
5 virtual void OnDraw(CXyDC* pXyDC); 绘制辅助手柄
|
|
6 virtual BOOL OnGridItemChangeValue(CXTPPropertyGridItem* pItem); 响应属性框改变消息的函数
|
|
**************************************************************************************/
|
|
#include "StdAfx.h"
|
|
//#include "CustomItemButton.h"
|
|
|
|
#include "WellPoleDoc.h"
|
|
#include "WellPoleView.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\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/TrackCommonData.h"
|
|
#include "WellPoleLib/InTrackCommonData.h"
|
|
#include "WellPoleLib/InTrackFluidProducingProfile.h"
|
|
#include "WellPoleLib/TrackFluidProducingProfile.h"
|
|
#include "WellPoleLib/TrackWaterInjectionProfile.h"
|
|
#include "WellPoleLib/InTrackWaterInjectionProfile.h"
|
|
//#include "DataConfig.h"
|
|
//#include "PropertyGridItemAdd.h"
|
|
#include "ItemTrackIn.h"
|
|
#include "ItemTrack.h"
|
|
//#include "CustomItemGradientColor.h"
|
|
//#include "DlgWellDataConfig.h"
|
|
|
|
//#include "GDataIO/GDataBinder/DataBinderWell.h"
|
|
//#include "GDataIO/GDataBinder/DataBinderBase.h"
|
|
//#include "DialogCurveReverseRange.h"
|
|
|
|
|
|
|
|
namespace NItem
|
|
{
|
|
|
|
// int GetDrawTypeIndex(DWORD dwDrawType)
|
|
//{
|
|
// int nIndex = 0; //波形方式
|
|
// switch(dwDrawType)
|
|
// {
|
|
// default:
|
|
// case CSeismicDrawBase::typeWiggle: nIndex = 0; break;//波形曲线显示
|
|
// case CSeismicDrawBase::typeRightVa: nIndex = 1; break;//右变面积
|
|
// case CSeismicDrawBase::typeLeftVa: nIndex = 2; break;//左变面积
|
|
// case CSeismicDrawBase::typeVarDensity: nIndex = 3; break;//变密度显示
|
|
// case CSeismicDrawBase::typeVarDensity|CSeismicDrawBase::typeWiggle: nIndex = 4; break;//变密度+波形曲线
|
|
// case CSeismicDrawBase::typeVarDensity|CSeismicDrawBase::typeRightVa:nIndex = 5; break;//变密度+右变面积
|
|
// case CSeismicDrawBase::typeVarDensity|CSeismicDrawBase::typeLeftVa: nIndex = 6; break;//变密度+左变面积
|
|
// }
|
|
// 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;
|
|
//}
|
|
|
|
CItemTrack::CItemTrack(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);
|
|
//}
|
|
}
|
|
|
|
CItemTrack::~CItemTrack(void)
|
|
{
|
|
|
|
}
|
|
|
|
|
|
void CItemTrack::OnDraw(CXyDC* pXyDC, CDC* pDC)
|
|
{
|
|
CSigmaView* pView = GetView();
|
|
//pDC = pView->m_pImgDC;
|
|
//if (this->m_bLDown && pView->GetScreenDC() != NULL)
|
|
//{
|
|
// pDC = pView->GetScreenDC(); // pXyDC->GetDC();
|
|
// TRACE("use track draw screendc --------------\r\n");
|
|
//}
|
|
|
|
//CDC *pDC = GetDC()->GetDC();
|
|
CPen pen(PS_DOT, 0, RGB(0, 0, 0));
|
|
CPen *pOldPen = (CPen *)pDC->SelectObject(&pen);
|
|
int old = pDC->SetROP2(R2_NOTXORPEN);
|
|
if (m_bLDown)
|
|
{
|
|
CWellPole* pWell = m_pTrack->GetWell();
|
|
if (pWell->GetWellType() == Well_Incline)
|
|
{
|
|
CInclinedTrack* pIncliendTrack = (CInclinedTrack*)m_pTrack;
|
|
{
|
|
CPoint2D lastPt = GetDC()->GetReal(m_lastPoint.x, m_lastPoint.y);
|
|
CPoint2D lpt, rpt;
|
|
double depth = pIncliendTrack->GetDepthInWellTrace(lastPt);
|
|
pIncliendTrack->GetBorderPoint(depth, lpt, rpt);
|
|
|
|
CPoint lcpt, rcpt;
|
|
lcpt = GetDC()->GetScreen(lpt);
|
|
rcpt = GetDC()->GetScreen(rpt);
|
|
|
|
pDC->MoveTo(lcpt.x, lcpt.y);
|
|
pDC->LineTo(rcpt.x, rcpt.y);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
CRect rect;
|
|
rect.top = m_firstPoint.y;
|
|
rect.bottom = m_lastPoint.y;
|
|
rect.left = pXyDC->GetScreen(m_pTrack->GetPos()).left;
|
|
rect.right = pXyDC->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 CItemTrack::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;
|
|
//绘制十字线时,需要全图绘制可以去掉因为重复绘制导致的十字线错误,当不要十字线时直线 OnDraw效率高
|
|
//if (::GetPreferences().WorkaroundDisplay.m_bViewCrossLine)
|
|
// GetDoc()->Invalidate();
|
|
//else
|
|
CWellPole* pWell = m_pTrack->GetWell();
|
|
if (pWell->GetWellType() == Well_Incline)
|
|
{
|
|
CInclinedTrack* pIncliendTrack = (CInclinedTrack*)m_pTrack;
|
|
CPoint2D downPt = GetDC()->GetReal(m_downPoint.x, m_downPoint.y);
|
|
CPoint2D lpt, rpt;
|
|
double depth = pIncliendTrack->GetDepthInWellTrace(downPt);
|
|
pIncliendTrack->GetBorderPoint(depth, lpt, rpt);
|
|
TRACE("depth = %.2f \r\n", depth);
|
|
CPoint lcpt, rcpt;
|
|
lcpt = GetDC()->GetScreen(lpt);
|
|
rcpt = GetDC()->GetScreen(rpt);
|
|
|
|
GetDC()->GetDC()->MoveTo(lcpt.x, lcpt.y);
|
|
GetDC()->GetDC()->LineTo(rcpt.x, rcpt.y);
|
|
}
|
|
else
|
|
OnDraw(GetDC(),pDC);
|
|
|
|
//GetView()->SetCapture();
|
|
//CXTPPropertyGrid &grid = GetPropertyGrid(GetDoc()->GetMainFrame());
|
|
//InitPropertyGrid(grid);
|
|
}
|
|
|
|
void CItemTrack::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;
|
|
if (pWellObj->GetWellType() != Well_Incline)
|
|
{
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
if (bSelect)
|
|
{
|
|
m_bLDown = FALSE;
|
|
GetDoc()->Invalidate();// m_pTrack);
|
|
|
|
CItemTrackIn* pItemTrackIn = new CItemTrackIn(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;
|
|
|
|
///////标准层道、断点道、井壁取芯道时弹出提示对话框
|
|
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)
|
|
{
|
|
//备份
|
|
SetReUnDoAction();
|
|
if (pWellObj->GetWellType() == Well_Incline)
|
|
{
|
|
CInclinedTrack* pIncliendTrack = (CInclinedTrack*)m_pTrack;
|
|
double dep1 = pIncliendTrack->GetDepthInWellTrace(ptDown);
|
|
double dep2 = pIncliendTrack->GetDepthInWellTrace(ptLast);
|
|
|
|
if (pTrackIn->GetType() == KEP_STANDARD)
|
|
{
|
|
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_FAULTPOINT || pTrackIn->GetType() == KEP_COREWELL)
|
|
{
|
|
pTrackIn->m_fSdep = pTrackIn->m_fEdep = (dep1 + dep2) / 2;
|
|
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_INTRACK_COMMONDATA)
|
|
{
|
|
if (dep1 > dep2)
|
|
{
|
|
pTrackIn->m_fEdep = dep1;
|
|
pTrackIn->m_fSdep = dep2;
|
|
}
|
|
else
|
|
{
|
|
pTrackIn->m_fEdep = dep2;
|
|
pTrackIn->m_fSdep = dep1;
|
|
}
|
|
CTrackCommonData* pTrackComm = (CTrackCommonData*)m_pTrack;
|
|
CInTrackCommonData* pInTrackComm = (CInTrackCommonData*)pTrackIn;
|
|
pInTrackComm->SetDataItemCount(pTrackComm->m_CommonDataDef.m_CommonDataItems.size());
|
|
}
|
|
else
|
|
{
|
|
if (dep1 > dep2)
|
|
{
|
|
pTrackIn->m_fEdep = dep1;
|
|
pTrackIn->m_fSdep = dep2;
|
|
}
|
|
else
|
|
{
|
|
pTrackIn->m_fEdep = dep2;
|
|
pTrackIn->m_fSdep = dep1;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
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_FAULTPOINT || pTrackIn->GetType() == KEP_COREWELL)
|
|
{
|
|
double cy = (ptDown.y0 + ptLast.y0) / 2;
|
|
pTrackIn->GetPos().top = cy;
|
|
pTrackIn->GetPos().bottom = cy;
|
|
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 if (pTrackIn->GetType() == KEP_INTRACK_COMMONDATA)
|
|
{
|
|
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));
|
|
|
|
CTrackCommonData* pTrackComm = (CTrackCommonData*)m_pTrack;
|
|
CInTrackCommonData* pInTrackComm = (CInTrackCommonData*)pTrackIn;
|
|
pInTrackComm->SetDataItemCount(pTrackComm->m_CommonDataDef.m_CommonDataItems.size());
|
|
}
|
|
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);
|
|
|
|
if (pWellObj->GetWellType() == Well_Incline)
|
|
{
|
|
pTrackIn->CalcInclinedBorder();
|
|
}
|
|
|
|
GetDoc()->Invalidate();// m_pTrack);
|
|
|
|
CItemTrackIn* pItemTrackIn = new CItemTrackIn(GetDoc());
|
|
if(m_pItemWell)
|
|
{
|
|
m_pItemWell->Select(pTrackIn);
|
|
pItemTrackIn->SetDrawObj(pTrackIn);
|
|
pItemTrackIn->SetPos(GetPos());
|
|
//pItemTrackIn->InitPropertyGrid(grid);
|
|
m_pItemWell->SetItem(pItemTrackIn);
|
|
}
|
|
}
|
|
}
|
|
|
|
CInTrackDepthSegment* CItemTrack::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_CommonData)
|
|
{
|
|
CInTrackCommonData* pInCommonData = new CInTrackCommonData();
|
|
pTrackIn = pInCommonData;
|
|
}
|
|
//else if(m_pTrack->GetTrackType() == Track_Curve)
|
|
//{
|
|
|
|
//}
|
|
//else if (m_pTrack->GetTrackType() == Track_CementingQualityCurve)
|
|
//{
|
|
// CInTrackCementingCurve* pCementingCurve = new CInTrackCementingCurve();
|
|
|
|
// pTrackIn = pCementingCurve;
|
|
//}
|
|
return pTrackIn;
|
|
}
|
|
|
|
void CItemTrack::OnLButtonDblClk(UINT nFlags, CPoint point)
|
|
{
|
|
|
|
}
|
|
|
|
int CItemTrack::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 CItemTrack::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
|
|
{
|
|
::SetCursor(AfxGetApp()->LoadCursor(IDC_CURSOR_RANGE));
|
|
return TRUE;
|
|
}
|
|
|
|
int CItemTrack::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->GetParentObj();
|
|
//POSITION posBend = pSection->m_BendList.GetHeadPosition();
|
|
//while (posBend!=NULL)
|
|
//{
|
|
// CBendObj* pBend = (CBendObj*)pSection->m_BendList.GetNext(posBend);
|
|
// if (pBend->m_pLayerLeft->GetParentObj() == m_pTrack||(pBend->m_pLayerRight!=NULL&&pBend->m_pLayerRight->GetParentObj()==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)
|
|
//{//如果父道不是井,且没有子道,就删除
|
|
// 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->GetWellType()==Well_Section)
|
|
//{
|
|
// CWellSection* pSection = (CWellSection*)pWellObj->GetParentObj();
|
|
// pSection->ReComputeBends(pWellObj);
|
|
//}
|
|
|
|
return 1;
|
|
}
|
|
|
|
//void CItemTrack::OnInplaceButtonDown(CXTPPropertyGridItem* pItem)
|
|
//{
|
|
// if(pItem == NULL)
|
|
// return;
|
|
//// if(pItem->GetID() == IDS_STRING_DB_TABLEFIELD_CONFIG) //弹出字段配置对话框
|
|
// {
|
|
// //Db::CSqlStatementManager *pSqlManager = AfxGetGeo()->GetSqlStatementManager();
|
|
// //if (pSqlManager->HasDB())
|
|
// //{
|
|
// // //获取图道的数据表、字段
|
|
// // CString strTrackType;
|
|
// // CString curve;
|
|
// // CString table;
|
|
// // vector<CString> fields;
|
|
// // if(m_pItemWell)
|
|
// // m_pItemWell->GetTrackTable(m_pTrack, strTrackType, table, curve);
|
|
|
|
// // /// 从文件中读取相关类型道的配置
|
|
// // CDataTableConfig TempDataConfig;
|
|
// // TempDataConfig.SetTableID(strTrackType);
|
|
// // TempDataConfig.Read();
|
|
|
|
// // CDlgWellDataConfig dlg;
|
|
// // dlg.SetFields(TempDataConfig.GetFieldsBase());
|
|
// // if (!m_pTrack->m_strConfigTable.IsEmpty())
|
|
// // {
|
|
// // dlg.SetConfigTable(m_pTrack->m_strConfigTable);
|
|
// // dlg.SetConfigFields(m_pTrack->m_VecConfigField);
|
|
// // dlg.SetConfigClass(m_pTrack->m_strConfigClass);
|
|
// // }
|
|
// // else
|
|
// // {
|
|
// // dlg.SetConfigTable(TempDataConfig.GetTableDB());
|
|
// // dlg.SetConfigFields(TempDataConfig.GetFieldsDB());
|
|
// // }
|
|
// // dlg.SetBaseTable(TempDataConfig.GetTableBase());
|
|
// // dlg.m_strTitleName = TempDataConfig.GetTableBase();
|
|
// // dlg.m_strID = TempDataConfig.GetTableID();
|
|
// // dlg.SetDataConfigTableFields(TRUE);
|
|
// // dlg.SetDataConfigDB(TRUE);
|
|
// // if (dlg.DoModal() == IDOK)
|
|
// // {
|
|
// // m_pTrack->m_strConfigTable = dlg.GetConfigTable();
|
|
// // m_pTrack->m_VecConfigField = dlg.GetConfigFields();
|
|
// // m_pTrack->m_strConfigClass = dlg.GetConfigClass();
|
|
// // pItem->SetValue(m_pTrack->m_strConfigTable);
|
|
|
|
// // CItemSingleWell itemsw(GetWnd());
|
|
// // itemsw.ImportTrackDataFromDB(m_pTrack, (CWellObj*)m_pTrack->GetParentObj(), AfxGetGeo()->GetSqlStatementManager());
|
|
// // m_pTrack->ReadCurveData();
|
|
// // GetDoc()->Invalidate(m_pTrack->GetParentObj());
|
|
// // }
|
|
// //}
|
|
// }
|
|
//// else if (pItem->GetID() == IDS_STR_TRACK_CONFIGTOPANDBOT)
|
|
// {
|
|
// //Db::CSqlStatementManager *pSqlManager = AfxGetGeo()->GetSqlStatementManager();
|
|
// //if (pSqlManager->HasDB())
|
|
// //{
|
|
// // //获取图道的数据表、字段
|
|
// // CString strTrackType;
|
|
// // CString curve;
|
|
// // CString table;
|
|
// // vector<CString> fields;
|
|
|
|
// // 从文件中读取相关类型道的配置
|
|
// // CDataTableConfig TempDataConfig;
|
|
// // TempDataConfig.SetTableID(_T("Text"));
|
|
// // TempDataConfig.Read();
|
|
|
|
// // CDlgWellDataConfig dlg;
|
|
// // dlg.SetFields(TempDataConfig.GetFieldsBase());
|
|
// // if (!m_pTrack->m_strConfigTableOther.IsEmpty())
|
|
// // {
|
|
// // dlg.SetConfigTable(m_pTrack->m_strConfigTableOther);
|
|
// // dlg.SetConfigFields(m_pTrack->m_VecConfigFieldOther);
|
|
// // }
|
|
// // else
|
|
// // {
|
|
// // dlg.SetConfigTable(TempDataConfig.GetTableDB());
|
|
// // dlg.SetConfigFields(TempDataConfig.GetFieldsDB());
|
|
// // }
|
|
// // dlg.SetBaseTable(TempDataConfig.GetTableBase());
|
|
// // dlg.m_strTitleName = TempDataConfig.GetTableBase();
|
|
// // dlg.m_strID = TempDataConfig.GetTableID();
|
|
// // dlg.SetDataConfigTableFields(TRUE);
|
|
// // dlg.SetDataConfigDB(TRUE);
|
|
// // if (dlg.DoModal() == IDOK)
|
|
// // {
|
|
// // m_pTrack->m_strConfigTableOther = dlg.GetConfigTable();
|
|
// // m_pTrack->m_VecConfigFieldOther = dlg.GetConfigFields();
|
|
// // pItem->SetValue(m_pTrack->m_strConfigTableOther);
|
|
// // }
|
|
// //}
|
|
// }
|
|
//// else if (pItem->GetID() == IDS_REVERSE_SET_VALUERANGE)
|
|
// {
|
|
// //CDialogCurveReverseRange dlg;
|
|
// //CTrackCurve *pTrackCurve = (CTrackCurve*)m_pTrack;
|
|
// //dlg.m_curve_right = pTrackCurve->m_curve_right;
|
|
// //dlg.m_RangeValueVec.insert(dlg.m_RangeValueVec.begin(),pTrackCurve->m_ReverseRangeVec.begin(),pTrackCurve->m_ReverseRangeVec.end());
|
|
// //if(dlg.DoModal()==IDOK)
|
|
// //{//取到设置好的翻卷数值区间
|
|
// // pTrackCurve->m_ReverseRangeVec.clear();
|
|
// // pTrackCurve->m_ReverseRangeVec.insert(pTrackCurve->m_ReverseRangeVec.begin(),
|
|
// // dlg.m_RangeValueVec.begin(),dlg.m_RangeValueVec.end());
|
|
|
|
// // if(pTrackCurve->m_ReversePenVec.size()< pTrackCurve->m_ReverseRangeVec.size())
|
|
// // {
|
|
// // int num = pTrackCurve->m_ReverseRangeVec.size() - pTrackCurve->m_ReversePenVec.size();
|
|
// // for(int ii = 0; ii<num ;ii++ )
|
|
// // pTrackCurve->m_ReversePenVec.push_back(pTrackCurve->m_penCurve);
|
|
// // }
|
|
// // if(pTrackCurve->m_ReversePenVec.size()> pTrackCurve->m_ReverseRangeVec.size())
|
|
// // {
|
|
// // int num = pTrackCurve->m_ReversePenVec.size() - pTrackCurve->m_ReverseRangeVec.size() ;
|
|
// // for(int ii = num-1; ii>-1 ;ii-- )
|
|
// // pTrackCurve->m_ReversePenVec.pop_back();
|
|
// // }
|
|
|
|
// // CXTPPropertyGrid &grid = GetPropertyGrid(GetDoc()->GetMainFrame());
|
|
// // CXTPPropertyGridItems *pItems = grid.GetCategories();
|
|
|
|
// // CXTPPropertyGridItem *pItem1;
|
|
// // int cateNum = pItems->GetCount();
|
|
// // int id ;
|
|
// // for(int ii = 0; ii< cateNum; ii++)
|
|
// // {
|
|
// // pItem1 = pItems->GetAt(ii);
|
|
// // id = pItem1->GetID();
|
|
// // if(id == IDS_REVERSE_VALUE_RANGE)
|
|
// // {
|
|
// // pItem1->GetChilds()->Clear();
|
|
|
|
// // AddReverseCurveRangeItem(pItem1,pTrackCurve);
|
|
|
|
// // pTrackCurve->ComputePointsInclined();
|
|
|
|
// // GetDoc()->Invalidate(); // (pTrackCurve);
|
|
|
|
// // break;
|
|
// // }
|
|
// // }
|
|
// //}
|
|
// }
|
|
//}
|
|
|
|
void CItemTrack::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
|
|
{//使用井缓冲的曲线数据
|
|
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 CItemTrack::AddReverseCurveRangeItem(CXTPPropertyGridItem* pParentItem,CTrackObj *pTrack)
|
|
//{
|
|
// CTrackCurve *pTarckCurve = (CTrackCurve*)pTrack;
|
|
// CPropertyGridItemAdd ItemAdd(NULL);
|
|
//
|
|
// CString str;
|
|
// str.LoadString(IDS_REVERSE_VALUE_RANGE);
|
|
// int rangeNum = pTarckCurve->m_ReverseRangeVec.size();
|
|
// if(rangeNum>0)
|
|
// {
|
|
// CString tmpStr;
|
|
// CXTPPropertyGridItem *pGridItem,*pItem1;
|
|
// double left,right;
|
|
// GDFLOGPEN tlogPen;
|
|
// for(int ii = 0; ii< rangeNum; ii++)
|
|
// {
|
|
// tmpStr.Format("%s%d",str,ii+1);
|
|
// pGridItem = pParentItem->AddChildItem(new CXTPPropertyGridItemCategory(tmpStr));
|
|
// //pGridItem= grid.AddCategory(tmpStr);
|
|
//
|
|
// ItemAdd.SetItem(pGridItem);
|
|
// if(ii ==0)
|
|
// left = pTarckCurve->m_curve_right;
|
|
// else
|
|
// left = pTarckCurve->m_ReverseRangeVec[ii-1];
|
|
//
|
|
// right = pTarckCurve->m_ReverseRangeVec[ii];
|
|
//
|
|
// pItem1 = ItemAdd.AddItemDouble(IDS_REVERSE_VALUE_LEFT,left);// 曲线的左刻
|
|
// pItem1->SetReadOnly(TRUE);
|
|
//
|
|
// pItem1 = ItemAdd.AddItemDouble(IDS_REVERSE_VALUE_RIGHT,right);// 曲线的右刻
|
|
// pItem1->SetReadOnly(TRUE);
|
|
//
|
|
// ItemAdd.AddItemLine1(IDS_REVERSE_CURVE_LINE, pTarckCurve->m_ReversePenVec[ii], &pTarckCurve->m_ReversePenVec[ii],LineType_Curve);//曲线类型
|
|
// pGridItem->Expand();
|
|
// }
|
|
//
|
|
// pParentItem->Expand();
|
|
// }
|
|
//}
|
|
|
|
void CItemTrack::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();
|
|
//}
|
|
} |