| | |
| | | using Yw.WinFrmUI.Q3D; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Drawing; |
| | | using System.Drawing.Design; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using static Yw.WinFrmUI.Q3D.MapViewEnum; |
| | | using System.Xml.Linq; |
| | | using Newtonsoft.Json; |
| | | using static Yw.WinFrmUI.Q3D.ObjectEnum; |
| | | using System.Drawing.Design; |
| | | using Yw.WinFrmUI.Q3d; |
| | | using static Yw.WinFrmUI.Q3d.MapViewEnum; |
| | | using static Yw.WinFrmUI.Q3d.ObjectEnum; |
| | | |
| | | namespace Yw.WinFrmUI.Q3D |
| | | namespace Yw.WinFrmUI.Q3d |
| | | { |
| | | [Serializable] |
| | | public class LinkViewModel : Q3DLinkCalcModel, IBaseViewModel |
| | | { |
| | | #region 构造函数 |
| | | |
| | | |
| | | |
| | | public LinkViewModel() |
| | | { |
| | | |
| | |
| | | //Points = points; |
| | | } |
| | | #endregion |
| | | |
| | | #region 属性 |
| | | |
| | | |
| | | |
| | | [Category("基本信息")] |
| | | [DisplayName("编号")] |
| | | [Browsable(true)] |
| | |
| | | [Category("基本信息")] |
| | | [DisplayName("起始节点")] |
| | | [Browsable(true)] |
| | | public string Node1 |
| | | public string Node1 |
| | | { |
| | | get |
| | | { |
| | |
| | | base.Node2 = value; |
| | | } |
| | | } |
| | | |
| | | |
| | | [Browsable(false)] |
| | | [JsonIgnore] |
| | | |
| | |
| | | public NodeViewModel EndNode { get { return (NodeViewModel)base.EndNode; } set { base.EndNode = value; } } |
| | | |
| | | private PointF _position { get; set; } = new PointF(0, 0); |
| | | public PointF Position |
| | | public PointF Position |
| | | { |
| | | get |
| | | { |
| | |
| | | } |
| | | return _position; |
| | | } |
| | | set |
| | | { |
| | | set |
| | | { |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | [Category("基本信息")] |
| | | [DisplayName("标高(m)")] |
| | | [Browsable(false)] |
| | | public float Z |
| | | public float Z |
| | | { |
| | | get |
| | | { |
| | |
| | | get |
| | | { |
| | | return base.Length; |
| | | |
| | | |
| | | } |
| | | set |
| | | { |
| | |
| | | [Description("X坐标")] |
| | | [DisplayName("X坐标")] |
| | | [Browsable(true)] |
| | | public float X |
| | | public float X |
| | | { |
| | | get |
| | | { |
| | |
| | | //[Editor(typeof(MyEditor), typeof(UITypeEditor))] |
| | | //public TagList Tags { get; set; } = null; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | [Category("基本信息")] |
| | |
| | | [DisplayName("ID类型")] |
| | | [Browsable(false)] |
| | | #endregion |
| | | |
| | | #region 方法 |
| | | |
| | | |
| | | |
| | | public string IDType => Type.ToString() + "\t" + ID; |
| | | |
| | | public MapObjectType GetTypeString() |
| | |
| | | if (this is TankViewModel) return MapObjectType.水池; |
| | | if (this is MeterViewModel) return MapObjectType.水表; |
| | | if (this is NozzleViewModel) return MapObjectType.喷头; |
| | | |
| | | |
| | | |
| | | |
| | | if (this is PipeViewModel) return MapObjectType.管线; |
| | | if (this is ValveViewModel) return MapObjectType.阀门; |
| | | |
| | | |
| | | if (this is PumpViewModel) return MapObjectType.水泵; |
| | | |
| | | |
| | | |
| | | return MapObjectType.节点; |
| | | } |