|
|
|
|
|
using GeoSigma;
|
|
|
|
|
|
using GeoSigma.SigmaDrawerElement;
|
|
|
|
|
|
using GeoSigma.SigmaDrawerStyle;
|
|
|
|
|
|
using GeoSigma.SigmaDrawerStyle.Converter;
|
|
|
|
|
|
using SigmaDrawerStyle;
|
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Drawing.Design;
|
|
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
|
//using PropertyEditorColor = GeoSigma.SigmaDrawerStyle.PropertyEditorColor;
|
|
|
|
|
|
|
|
|
|
|
|
namespace SigmaDrawerElement
|
|
|
|
|
|
{
|
|
|
|
|
|
#pragma warning disable SA1402 // File may only contain a single type
|
|
|
|
|
|
#pragma warning disable SA1600 // Elements should be documented
|
|
|
|
|
|
#pragma warning disable SA1649 // File name should match first type name
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 文本道
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[XmlRoot("Pcg")]
|
|
|
|
|
|
[TypeConverter(typeof(PropertySorter))]
|
|
|
|
|
|
public class WellTextTrack
|
|
|
|
|
|
{
|
|
|
|
|
|
private const string WellTrackCategory = "\t\t\t文本道";
|
|
|
|
|
|
private const string TrackObjectSettingsCategory = "\t\t道内对象设置";
|
|
|
|
|
|
private const string datasourceCategory = "\t数据源设置";
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(WellTrackCategory)]
|
|
|
|
|
|
[DisplayName("标题")]
|
|
|
|
|
|
[PropertyOrder(0)]
|
|
|
|
|
|
public string Title
|
|
|
|
|
|
{
|
|
|
|
|
|
get => WellTrack.Title.Font.Text;
|
|
|
|
|
|
set => WellTrack.Title.Font.Text = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(WellTrackCategory)]
|
|
|
|
|
|
[DisplayName("宽度")]
|
|
|
|
|
|
[PropertyOrder(1)]
|
|
|
|
|
|
public double Width
|
|
|
|
|
|
{
|
|
|
|
|
|
get => WellTrack.Width;
|
|
|
|
|
|
set => WellTrack.Width = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(WellTrackCategory)]
|
|
|
|
|
|
[DisplayName("填充")]
|
|
|
|
|
|
[PropertyOrder(2)]
|
|
|
|
|
|
[TypeConverter(typeof(YesNoConverter))]
|
|
|
|
|
|
public bool IsFilled
|
|
|
|
|
|
{
|
|
|
|
|
|
get => WellTrack.BackFill != 0;
|
|
|
|
|
|
set => WellTrack.BackFill = value ? 1 : 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(WellTrackCategory)]
|
|
|
|
|
|
[DisplayName("背景颜色")]
|
|
|
|
|
|
[Editor(typeof(PropertyEditorWellFontEx), typeof(UITypeEditor))]
|
|
|
|
|
|
[PropertyOrder(3)]
|
|
|
|
|
|
[Editor(typeof(PropertyEditorColor), typeof(UITypeEditor))]
|
|
|
|
|
|
public Color BackgroundColor
|
|
|
|
|
|
{
|
|
|
|
|
|
get => ColorTranslator2.FromHtml(WellTrack.BackColor);
|
|
|
|
|
|
set => WellTrack.BackColor = ColorTranslator2.ToHtml(value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(WellTrackCategory)]
|
|
|
|
|
|
[DisplayName("道头字体")]
|
|
|
|
|
|
[PropertyOrder(4)]
|
|
|
|
|
|
[Editor(typeof(PropertyEditorWellFontEx), typeof(UITypeEditor))]
|
|
|
|
|
|
public WellFontEx HeaderFont
|
|
|
|
|
|
{
|
|
|
|
|
|
get => WellTrack.Title.Font;
|
|
|
|
|
|
set => WellTrack.Title.Font = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 通内对象设置
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(TrackObjectSettingsCategory)]
|
|
|
|
|
|
[DisplayName("边框线")]
|
|
|
|
|
|
[PropertyOrder(5)]
|
|
|
|
|
|
[Editor(typeof(PropertyEditorWellCurveStyle), typeof(UITypeEditor))]
|
|
|
|
|
|
public WellLineStyle BorderLine
|
|
|
|
|
|
{
|
|
|
|
|
|
get => LayerStyleHelper.GetWellLineStyle(WellTrack.LayerStyle);
|
|
|
|
|
|
set => LayerStyleHelper.SetWellLineStyle(WellTrack.LayerStyle, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(TrackObjectSettingsCategory)]
|
|
|
|
|
|
[DisplayName("背景颜色")]
|
|
|
|
|
|
[PropertyOrder(6)]
|
|
|
|
|
|
[Editor(typeof(PropertyEditorColor), typeof(UITypeEditor))]
|
|
|
|
|
|
public Color ObjectBackgroundColor
|
|
|
|
|
|
{
|
|
|
|
|
|
get => ColorTranslator2.FromHtml(WellTrack.LayerStyle.BackColor);
|
|
|
|
|
|
set => WellTrack.LayerStyle.BackColor = ColorTranslator2.ToHtml(value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(TrackObjectSettingsCategory)]
|
|
|
|
|
|
[DisplayName("字体")]
|
|
|
|
|
|
[PropertyOrder(7)]
|
|
|
|
|
|
[Editor(typeof(PropertyEditorWellFontEx), typeof(UITypeEditor))]
|
|
|
|
|
|
public WellFontEx ObjectFont
|
|
|
|
|
|
{
|
|
|
|
|
|
get => LayerStyleHelper.GetFontEx(WellTrack.LayerStyle);
|
|
|
|
|
|
set => LayerStyleHelper.SetFontEx(WellTrack.LayerStyle, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(datasourceCategory)]
|
|
|
|
|
|
[DisplayName("数据表"), PropertyOrder(20)]
|
|
|
|
|
|
[TypeConverter(typeof(dataSourceTableTextTrackConverter))]
|
|
|
|
|
|
public string tableId
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return tableInfoQuery.tableChsName(WellTrack.Data.RefTableId);
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
WellTrack.Data.RefTableId = tableInfoQuery.tableEngName(value);
|
|
|
|
|
|
WellTrack.bRefreshWorkAreaData = true;
|
|
|
|
|
|
WellTrack.Data.RefColId = "";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(datasourceCategory)]
|
|
|
|
|
|
[DisplayName("数据字段"), PropertyOrder(21)]
|
|
|
|
|
|
[TypeConverter(typeof(dataFieldTextTrackConverter))]
|
|
|
|
|
|
public string columnId
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return tableInfoQuery.getColumnChsNameFromEngName(WellTrack.Data.RefTableId, WellTrack.Data.RefColId);
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
WellTrack.Data.RefColId = tableInfoQuery.getColumnNameFromChsName(WellTrack.Data.RefTableId, value);
|
|
|
|
|
|
WellTrack.bRefreshWorkAreaData = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlAttribute("Version")]
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
public string Version { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[XmlElement("WellTrack")]
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
public WellTrackWellTrack WellTrack { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static class DataServiceTextTrackTableFieldNames
|
|
|
|
|
|
{
|
|
|
|
|
|
public static string[] GetAvailableOptions(Object param1)
|
|
|
|
|
|
{
|
|
|
|
|
|
//string[] names = new string[0];
|
|
|
|
|
|
List<string> namesList = new List<string>();
|
|
|
|
|
|
if (param1 is WellTextTrack settings)
|
|
|
|
|
|
{
|
|
|
|
|
|
List<EntityColumnInfo> collist = tableInfoQuery.getListTableColumn(settings.WellTrack.Data.RefTableId);
|
|
|
|
|
|
foreach(EntityColumnInfo var in collist)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (var.DbColumnName == null)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
if (var.DbColumnName == "")
|
|
|
|
|
|
continue;
|
|
|
|
|
|
if (var.DbColumnName == "ID" || var.DbColumnName == "XHID")
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
namesList.Add(var.ColumnDescription);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
return namesList.ToArray();
|
|
|
|
|
|
//return names;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public class dataFieldTextTrackConverter : GenericWellOptionsConverter<WellTextTrack>
|
|
|
|
|
|
{
|
|
|
|
|
|
public dataFieldTextTrackConverter() : base(settings => DataServiceTextTrackTableFieldNames.GetAvailableOptions(settings))
|
|
|
|
|
|
{ }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static class DataServiceDataSourceTableNames
|
|
|
|
|
|
{
|
|
|
|
|
|
public static string[] GetAvailableOptions(Object param1)
|
|
|
|
|
|
{
|
|
|
|
|
|
//string[] names = new string[0];
|
|
|
|
|
|
List<string> namesList = new List<string>();
|
|
|
|
|
|
//if (param1 is WellTextTrack settings)
|
|
|
|
|
|
{
|
|
|
|
|
|
namesList.Add("");
|
|
|
|
|
|
foreach (var (engName, chsName) in tableInfoQuery.TableDescriptionMap)
|
|
|
|
|
|
{
|
|
|
|
|
|
namesList.Add(chsName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
return namesList.ToArray();
|
|
|
|
|
|
//return names;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class dataSourceTableTextTrackConverter : GenericWellOptionsConverter<WellTextTrack>
|
|
|
|
|
|
{
|
|
|
|
|
|
public dataSourceTableTextTrackConverter() : base(settings => DataServiceDataSourceTableNames.GetAvailableOptions(settings))
|
|
|
|
|
|
{ }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#pragma warning restore SA1649 // File name should match first type name
|
|
|
|
|
|
#pragma warning restore SA1600 // Elements should be documented
|
|
|
|
|
|
#pragma warning restore SA1402 // File may only contain a single type
|
|
|
|
|
|
}
|