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.
kev/Drawer/UCDraw/GeoSigmaDrawLib/GeoSigmaWellSectionXY.cs

293 lines
9.7 KiB
C#

1 month ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using Newtonsoft.Json.Linq;
using System.Xml;
using System.Collections.Generic;
using System.Drawing;
using System.Reflection.Metadata.Ecma335;
namespace GeoSigmaDrawLib
{
public class GeoSigmaWellSectionXY : GeoSigmaWellPoleXY
{
public GeoSigmaWellSectionXY(GeoSigmaXY.eViewType vType = GeoSigmaXY.eViewType.wellsection) : base(vType)
{
// mViewType = GeoSigmaXY.eViewType.wellpole;
//pView = GeoSigmaLib.CreateWellPoleView();
// GeoSigmaLib.RegisterCallback(pView, s_wndCallback);
ReadParamsFile();
}
public bool SetBendsSmooth()
{
bool b = GeoSigmaLib.SetBendsSmooth(pView);
return b;
}
public bool IsSelectedWellSection()
{
return GeoSigmaLib.IsSelectedWellSection(pView);
}
public bool IsWellSectionBendsSmooth()
{
return GeoSigmaLib.IsWellSectionBendsSmooth(pView);
}
public int WellSectionFlatternStyle()
{
return GeoSigmaLib.WellSectionFlatternStyle(pView);
}
//层拉平方式 0真是位置1层顶拉平2层底拉平,3井顶拉平4井底拉平
public bool SetWellSectionFlatternStyle(int style)
{
return GeoSigmaLib.SetWellSectionFlatternStyle(pView, style);
}
public int SectionWellShowStyle()
{
return GeoSigmaLib.SectionWellShowStyle(pView);
}
// 1 =简单样式 2= 完整样式 , 3= 分割线样式
public bool SetSectionWellShowStyle(int style)
{
return GeoSigmaLib.SetSectionWellShowStyle(pView, style);
}
public bool WellSectionConnectAllLayers()
{
return GeoSigmaLib.WellSectionConnectAllLayers(pView);
}
public bool WellSectionBreakAllBends()
{
return GeoSigmaLib.WellSectionBreakAllBends(pView);
}
public int WellSectionBendLinkStyle()
{
return GeoSigmaLib.WellSectionBendLinkStyle(pView);
}
//=1 井柱外, =2 井柱中心 3= 地层道 4=小层道
public bool SetWellSectionBendLinkStyle(int style)
{
return GeoSigmaLib.SetWellSectionBendLinkStyle(pView, style);
}
public int WellSectionBendLeftExtendStyle()
{//=1 不延伸 =2水平延伸3=趋势延伸
return GeoSigmaLib.WellSectionBendLeftExtendStyle(pView);
}
public bool SetWellSectionBendLeftExtendStyle(int style)//=1 不延伸 =2水平延伸3=趋势延伸
{
return GeoSigmaLib.SetWellSectionBendLeftExtendStyle(pView, style);
}
public int WellSectionBendRightExtendStyle()
{//=1 不延伸 =2水平延伸3=趋势延伸
return GeoSigmaLib.WellSectionBendRightExtendStyle(pView);
}
public bool SetWellSectionBendRightExtendStyle(int style)//=1 不延伸 =2水平延伸3=趋势延伸
{
return GeoSigmaLib.SetWellSectionBendRightExtendStyle(pView, style);
}
public bool SetWellSectionDrawAddFaultItem()
{
return GeoSigmaLib.SetWellSectionDrawAddFaultItem(pView);
}
public bool WellSectionAddDepthRuler()
{
return GeoSigmaLib.WellSectionAddDepthRuler(pView);
}
public bool WellSectionIsAddBendLayerPoint()
{
return GeoSigmaLib.WellSectionIsAddBendLayerPoint(pView);
}
public bool WellSectionAddBendLayerPoint()
{
return GeoSigmaLib.WellSectionAddBendLayerPoint(pView);
}
public bool WellSectionDeleteBendLayerPoint()
{
return GeoSigmaLib.WellSectionDeleteBendLayerPoint(pView);
}
public bool WellSectionIsAddFaultPoint()
{
return GeoSigmaLib.WellSectionIsAddFaultPoint(pView);
}
public bool WellSectionAddFaultPoint()
{
return GeoSigmaLib.WellSectionAddFaultPoint(pView);
}
public bool WellSectionDeleteFaultPoint()
{
return GeoSigmaLib.WellSectionDeleteFaultPoint(pView);
}
public bool WellSectionBreakLeftBend()
{
return GeoSigmaLib.WellSectionBreakLeftBend(pView);
}
public bool WellSectionBreakRightBend()
{
return GeoSigmaLib.WellSectionBreakRightBend(pView);
}
public bool WellSectionConnectLeftLayer()
{
return GeoSigmaLib.WellSectionConnectLeftLayer(pView);
}
public bool WellSectionConnectRightLayer()
{
return GeoSigmaLib.WellSectionConnectRightLayer(pView);
}
public bool WellSectionConnectLeftRightLayer()
{
return GeoSigmaLib.WellSectionConnectLeftRightLayer(pView);
}
public IntPtr CreateWellSection(string title,double depthScale,double levelScale,double horizonScale)
{
return GeoSigmaLib.CreateWellSection(pView, title, depthScale, levelScale, horizonScale);
}
public bool WellSectionAddNewWell(string wellName, double depthScale, double top, double bottom, double x, double y, double bushingLevel, string wellTemplateFile, ref UInt64 objHandle)
{
return GeoSigmaLib.WellSectionAddNewWell(pView, wellName, depthScale, top, bottom, x, y, bushingLevel, wellTemplateFile, ref objHandle);
}
public bool WellSectionReSetAllWellsPosition(bool bNeedComputedDepth,double topExtent, double bottomExtent)
{
return GeoSigmaLib.WellSectionReSetAllWellsPosition(pView,bNeedComputedDepth ,topExtent,bottomExtent);
}
public bool WellSectionConnectLayers(string trackTypeStr)
{
return GeoSigmaLib.WellSectionConnectLayers(pView, trackTypeStr);
}
public static bool SetWellSectionStratificationJson(IntPtr pSection, string str)
{
bool b = GeoSigmaLib.SetWellSectionStratificationJson(pSection, str);
return b;
}
public static bool SetWellSectionStratumDivisionJson(IntPtr pSection, string str)
{
bool b = GeoSigmaLib.SetWellSectionStratumDivisionJson(pSection, str);
return b;
}
public bool WellSectionApplyingTemplateFileForWell(string filePath, UInt64 wellHandle)
{
bool b = GeoSigmaLib.WellSectionApplyingTemplateFileForWell(pView, filePath, wellHandle);
return b;
}
public bool WellSectionApplyingWellTemplateForSection(UInt64 wellHandle)
{
bool b = GeoSigmaLib.WellSectionApplyingWellTemplateForSection(pView, wellHandle);
return b;
}
public bool WellSectionApplyingTemplateFileForSection(string filePath)
{
bool b = GeoSigmaLib.WellSectionApplyingTemplateFileForSection(pView, filePath);
return b;
}
public bool WellSectionGetLinkTracksTypes(UInt64 sectionHandle, out string[] NamesArr)
{//获得有连接bend的井道类型
NamesArr = new string[0];
IntPtr typeStrBuf;
typeStrBuf = IntPtr.Zero;
int typeStrLen;
typeStrLen = 0;
bool b = GeoSigmaLib.WellSectionGetLinkTracksTypes(sectionHandle, ref typeStrBuf, ref typeStrLen);
if (b && typeStrLen > 0)
{
string strType = Marshal.PtrToStringAnsi(typeStrBuf, typeStrLen);
NamesArr = strType.Split('|');
GeoSigmaLib.FreeByteArray(typeStrBuf);
}
return b;
}
public bool WellSectionBreakBends(UInt64 sectionHandle, string[] trackTypes)
{
bool b = false;
string strTypes = "";
for(int i = 0; i < trackTypes.Length; i++)
{
strTypes = strTypes + "|" + trackTypes[i];
}
strTypes = strTypes.TrimStart('|');
b = GeoSigmaLib.WellSectionBreakBends(pView,sectionHandle, strTypes);
return b;
}
public bool WellSectionGetWellStratumTracksTypes(UInt64 sectionHandle, out string[] NamesArr)
{ //获得剖面中井能够进行层位连接的井道类型
NamesArr = new string[0];
IntPtr typeStrBuf;
typeStrBuf = IntPtr.Zero;
int typeStrLen;
typeStrLen = 0;
bool b = GeoSigmaLib.WellSectionGetWellStratumTracksTypes(sectionHandle, ref typeStrBuf, ref typeStrLen);
if (b && typeStrLen > 0)
{
string strType = Marshal.PtrToStringAnsi(typeStrBuf, typeStrLen);
NamesArr = strType.Split('|');
GeoSigmaLib.FreeByteArray(typeStrBuf);
}
return b;
}
public bool WellSectionSetWellRealDistance()
{
bool b = GeoSigmaLib.WellSectionSetWellRealDistance(pView);
return b;
}
public bool WellSectionGetTotalWellsDistance(UInt64 sectionHandle, ref int wellNum, ref double totalDistance)
{
bool b = GeoSigmaLib.WellSectionGetTotalWellsDistance(sectionHandle, ref wellNum, ref totalDistance);
return b;
}
public bool WellSectionSetWellsDistance(UInt64 sectionHandle,double distance)
{
return GeoSigmaLib.WellSectionSetWellsDistance(sectionHandle, distance);
}
public bool WellSectionAddWellsMap(string sybmolPath)
{
return GeoSigmaLib.WellSectionAddWellsMap(pView, sybmolPath);
}
}
}