Shuxia Ning
2025-01-07 5f51a2fe3461e1f88e75b0b6959719d25f657ef3
WinFrmUI/Yw.WinFrmUI.Hydro.Q3d.Core/MapView/Base/LinkViewModel.cs
@@ -1,26 +1,26 @@
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()
        {
@@ -38,9 +38,10 @@
            //Points = points;
        }
        #endregion
        #region 属性
        [Category("基本信息")]
        [DisplayName("编号")]
        [Browsable(true)]
@@ -54,7 +55,7 @@
        [Category("基本信息")]
        [DisplayName("起始节点")]
        [Browsable(true)]
        public string Node1
        public string Node1
        {
            get
            {
@@ -82,7 +83,7 @@
                base.Node2 = value;
            }
        }
        [Browsable(false)]
        [JsonIgnore]
@@ -93,7 +94,7 @@
        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
            {
@@ -107,10 +108,10 @@
                }
                return _position;
            }
            set
            {
            set
            {
            }
        }
@@ -129,7 +130,7 @@
        [Category("基本信息")]
        [DisplayName("标高(m)")]
        [Browsable(false)]
        public  float Z
        public float Z
        {
            get
            {
@@ -181,7 +182,7 @@
            get
            {
                return base.Length;
            }
            set
            {
@@ -203,7 +204,7 @@
        [Description("X坐标")]
        [DisplayName("X坐标")]
        [Browsable(true)]
        public  float X
        public float X
        {
            get
            {
@@ -248,7 +249,7 @@
        //[Editor(typeof(MyEditor), typeof(UITypeEditor))]
        //public TagList Tags { get; set; } = null;
        [Category("基本信息")]
@@ -262,9 +263,10 @@
        [DisplayName("ID类型")]
        [Browsable(false)]
        #endregion
        #region 方法
        public string IDType => Type.ToString() + "\t" + ID;
        public MapObjectType GetTypeString()
@@ -274,14 +276,14 @@
            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.节点;
        }