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.
302 lines
9.9 KiB
C#
302 lines
9.9 KiB
C#
using GeoSigmaDrawLib;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Xml;
|
|
using System.Xml.Serialization;
|
|
|
|
namespace SigmaDrawerElement
|
|
{
|
|
/// <summary>
|
|
/// 地震剖面类
|
|
/// </summary>
|
|
[XmlRoot("Section")]
|
|
public class DrawerSeismicSection : ElementBase
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="SeismicSection"/> class.
|
|
/// </summary>
|
|
public DrawerSeismicSection()
|
|
{
|
|
ElementType = DrawElementType.ELEMENT_SECTION;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 坐标
|
|
/// </summary>
|
|
[XmlElement("Coordinate")]
|
|
[Browsable(false)]
|
|
public string CoordinateData
|
|
{
|
|
get
|
|
{
|
|
return $"{Coordinate.X},{Coordinate.Y}";
|
|
}
|
|
set
|
|
{
|
|
if (!string.IsNullOrEmpty(value))
|
|
{
|
|
string[] xy = value.Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries);
|
|
if (xy.Length > 1)
|
|
{
|
|
Coordinate.X = Convert.ToDouble(xy[0]);
|
|
Coordinate.Y = Convert.ToDouble(xy[1]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 坐标
|
|
/// </summary>
|
|
[XmlIgnore]
|
|
[Category("\t基本"), DisplayName("\t\t\t\t坐标")]
|
|
[TypeConverter(typeof(GeoSigma.SigmaDrawerStyle.PropertyPointConvert))]
|
|
public GeoSigma.SigmaDrawerStyle.PropertyPoint Coordinate
|
|
{
|
|
get;
|
|
set;
|
|
} = new GeoSigma.SigmaDrawerStyle.PropertyPoint(0, 0);
|
|
/// <summary>
|
|
/// 振幅归一化
|
|
/// </summary>
|
|
[XmlIgnore]
|
|
[Browsable(false)]
|
|
public int NormalizeMode
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
/// <summary>
|
|
/// 显示方式
|
|
/// </summary>
|
|
[XmlIgnore]
|
|
[Category("\t基本"), DisplayName("\t\t\t显示方式")]
|
|
[TypeConverter(typeof(GeoSigma.SigmaDrawerElement.Converter.SectionDisplayTypeConvert))]
|
|
public int SolidMode
|
|
{
|
|
get
|
|
{
|
|
return ViewMode2SolidMode(Base.Flag & (int)SectionStyle.SECTION_VIEW_ALL);
|
|
}
|
|
set
|
|
{
|
|
int nViewMode = SolidMode2ViewMode(value);
|
|
Base.Flag &= ~((int)SectionStyle.SECTION_VIEW_ALL);
|
|
Base.Flag |= nViewMode;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 隔几道抽析显示
|
|
/// </summary>
|
|
[XmlIgnore]
|
|
[Browsable(false)]
|
|
public int DisplayStep { get; set; }
|
|
/// <summary>
|
|
/// 开始时间
|
|
/// </summary>
|
|
[Browsable(false)]
|
|
[XmlIgnore]
|
|
public int BeginTime { get; set; }
|
|
/// <summary>
|
|
/// 结束时间
|
|
/// </summary>
|
|
[Browsable(false)]
|
|
[XmlIgnore]
|
|
public int EndTime { get; set; }
|
|
|
|
/// <summary>
|
|
/// 道数量
|
|
/// </summary>
|
|
[XmlIgnore]
|
|
[Category("\t基本"), DisplayName("\t\t道数")]
|
|
public int TraceCount
|
|
{
|
|
get
|
|
{
|
|
return Base.TraceCount;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 采样点数
|
|
/// </summary>
|
|
[XmlIgnore]
|
|
[Category("\t基本"), DisplayName("\t采样点数")]
|
|
public int SampleCount
|
|
{
|
|
get
|
|
{
|
|
return Base.SampleCount;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 采样间隔
|
|
/// </summary>
|
|
[XmlIgnore]
|
|
[Category("\t基本"), DisplayName("\t采样间隔")]
|
|
public double SampleStep
|
|
{
|
|
get
|
|
{
|
|
return Base.SampleStep;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 格式代码
|
|
/// </summary>
|
|
[XmlIgnore]
|
|
[Category("\t基本"), DisplayName("数据编码")]
|
|
public int FormatCode
|
|
{
|
|
get
|
|
{
|
|
return Base.FormatCode;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 增益
|
|
/// </summary>
|
|
///
|
|
[XmlIgnore]
|
|
[Category("\t基本"), DisplayName("增益")]
|
|
public double Times
|
|
{
|
|
get
|
|
{
|
|
return Base.Times;
|
|
}
|
|
set
|
|
{
|
|
Base.Times = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 基本属性
|
|
/// </summary>
|
|
[Browsable(false)]
|
|
public DrawerSeismicSectionBase Base
|
|
{
|
|
get;
|
|
set;
|
|
} = new DrawerSeismicSectionBase();
|
|
|
|
/// <summary>
|
|
/// 数据块
|
|
/// </summary>
|
|
[XmlIgnore]
|
|
[Browsable(false)]
|
|
public BinaryBlock ValueBlock
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
public int SolidMode2ViewMode(int nSolidMode)
|
|
{
|
|
int dwViewMode = 0;
|
|
switch (nSolidMode)
|
|
{
|
|
case 0: dwViewMode |= (int)SectionStyle.SECTION_VIEW_WIGGLE; break; // 曲线
|
|
default:
|
|
case 1: dwViewMode |= (int)SectionStyle.SECTION_VIEW_POSITIVE_FILL; break; // 右变面积
|
|
case 2: dwViewMode |= (int)SectionStyle.SECTION_VIEW_NEGATIVE_FILL; break; // 左变面积
|
|
case 3: dwViewMode |= (int)SectionStyle.SECTION_VIEW_VARIABLE_DENSITY; break; // 变密度
|
|
case 4: dwViewMode |= ((int)SectionStyle.SECTION_VIEW_VARIABLE_DENSITY | (int)SectionStyle.SECTION_VIEW_WIGGLE); break; //变密度+曲线
|
|
case 5: // 变密度+右变面积
|
|
case 7: dwViewMode |= ((int)SectionStyle.SECTION_VIEW_VARIABLE_DENSITY | (int)SectionStyle.SECTION_VIEW_POSITIVE_FILL); break; //变密度+透明右变面积
|
|
case 6: // 变密度+左变面积
|
|
case 8: dwViewMode |= ((int)SectionStyle.SECTION_VIEW_VARIABLE_DENSITY | (int)SectionStyle.SECTION_VIEW_NEGATIVE_FILL); break; //变密度+透明左变面积
|
|
}
|
|
return dwViewMode;
|
|
}
|
|
public int ViewMode2SolidMode(int nViewMode)
|
|
{
|
|
int nSolidMode = 0;
|
|
if (nViewMode == (int)SectionStyle.SECTION_VIEW_WIGGLE) nSolidMode = 0;
|
|
else if (nViewMode == (int)SectionStyle.SECTION_VIEW_POSITIVE_FILL) nSolidMode = 1;
|
|
else if (nViewMode == (int)SectionStyle.SECTION_VIEW_NEGATIVE_FILL) nSolidMode = 2;
|
|
else if (nViewMode == (int)SectionStyle.SECTION_VIEW_VARIABLE_DENSITY) nSolidMode = 3;
|
|
else if (nViewMode == ((int)SectionStyle.SECTION_VIEW_VARIABLE_DENSITY | (int)SectionStyle.SECTION_VIEW_WIGGLE)) nSolidMode = 4;
|
|
else if (nViewMode == ((int)SectionStyle.SECTION_VIEW_VARIABLE_DENSITY | (int)SectionStyle.SECTION_VIEW_POSITIVE_FILL)) nSolidMode = 5;
|
|
else if (nViewMode == ((int)SectionStyle.SECTION_VIEW_VARIABLE_DENSITY | (int)SectionStyle.SECTION_VIEW_NEGATIVE_FILL)) nSolidMode = 6;
|
|
return nSolidMode;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 剖面基础属性
|
|
/// </summary>
|
|
public class DrawerSeismicSectionBase
|
|
{
|
|
/// <summary>
|
|
/// 道数量
|
|
/// </summary>
|
|
[XmlAttribute]
|
|
public int TraceCount { get; set; }
|
|
/// <summary>
|
|
/// 采样点数
|
|
/// </summary>
|
|
[XmlAttribute]
|
|
public int SampleCount { get; set; }
|
|
/// <summary>
|
|
/// 采样间隔
|
|
/// </summary>
|
|
[XmlAttribute]
|
|
public double SampleStep { get; set; }
|
|
/// <summary>
|
|
/// 数据类型--目前未使用
|
|
/// </summary>
|
|
[XmlAttribute]
|
|
public int DataType { get; set; }
|
|
/// <summary>
|
|
/// 格式代码
|
|
/// </summary>
|
|
[XmlAttribute]
|
|
public int FormatCode { get; set; }
|
|
/// <summary>
|
|
/// 是否PC格式
|
|
/// </summary>
|
|
[XmlAttribute]
|
|
public int IsPC { get; set; }
|
|
/// <summary>
|
|
/// 样式
|
|
/// </summary>
|
|
[XmlAttribute]
|
|
public int Flag { get; set; } = (int)SectionStyle.SECTION_VIEW_POSITIVE_FILL | (int)SectionStyle.SECTION_DISPLAY_FAST | (int)SectionStyle.SECTION_READ_LOADALL | (int)SectionStyle.SECTION_UNIFORM_RMS;
|
|
/// <summary>
|
|
/// 增益
|
|
/// </summary>
|
|
[XmlAttribute]
|
|
public double Times { get; set; } = 1.3;
|
|
}
|
|
/// <summary>
|
|
/// 剖面样式
|
|
/// </summary>
|
|
public enum SectionStyle
|
|
{
|
|
SECTION_DISPLAY_FAST = 0x00000001, // 快速彩色显示,OLD
|
|
SECTION_DISPLAY_SLOW = 0x00000002, // 慢速彩色显示,OLD
|
|
|
|
SECTION_READ_DEFAULT = 0x00000004, // 缺省读方式
|
|
SECTION_READ_LOADALL = 0x00000008, // 全部装入内存方式
|
|
|
|
SECTION_ONLY_REFLASH = 0x00000010, // 仅重新显示一次,并不重新生成图像文件,该情况一般在人工设置好颜色后重新显示,为了加快速度
|
|
|
|
// 剖面归一化方式
|
|
SECTION_UNIFORM_MAX = 0x00000020, // 原始(max(fabs(minVal,maxVal));
|
|
SECTION_UNIFORM_RMS = 0x00000040, // 均方根
|
|
SECTION_UNIFORM_MEAN = 0x00000080, // 平均((最大值+最小值)/2)
|
|
SECTION_UNIFORM_ALL = (SECTION_UNIFORM_MAX | SECTION_UNIFORM_RMS | SECTION_UNIFORM_MEAN),
|
|
|
|
// 剖面显示方式
|
|
SECTION_VIEW_WIGGLE = 0x00000100, // 曲线 wiggle code
|
|
SECTION_VIEW_POSITIVE_FILL = 0x00000200, // 右变面积 positive VA fill code
|
|
SECTION_VIEW_NEGATIVE_FILL = 0x00000400, // 左变面积 negative VA fill code
|
|
SECTION_VIEW_VARIABLE_DENSITY = 0x00000800, // 变密度 variable density code
|
|
SECTION_VIEW_ALL = (SECTION_VIEW_WIGGLE | SECTION_VIEW_POSITIVE_FILL | SECTION_VIEW_NEGATIVE_FILL | SECTION_VIEW_VARIABLE_DENSITY),
|
|
}
|
|
}
|