lixiaojun
2025-01-22 46f64905a3c309a50c0f245b3350cdeb8dd699c6
WinFrmUI/Yw.WinFrmUI.Hydro.Q3d.Core/MapView/Base/NodeViewModel.cs
@@ -1,5 +1,4 @@
using Hydro.Core.Model;
using Hydro.Model;
using Hydro.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -11,12 +10,13 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using static Hydro.MapView.MapViewEnum;
using Yw.WinFrmUI.Q3d;
using static Yw.WinFrmUI.Q3d.MapViewEnum;
namespace Hydro.MapView
namespace Yw.WinFrmUI.Q3d
{
    [Serializable]
    public class NodeViewModel : NodeCalcModel, IBaseViewModel
    public class NodeViewModel : Q3DNodeCalcModel, IBaseViewModel
    {
        #region 构造函数
        public NodeViewModel()
@@ -33,7 +33,7 @@
        #endregion
        #region 属性
        [Category("基本信息")]
        [DisplayName("编号")]
@@ -50,12 +50,12 @@
        {
            get
            {
                return new PointF3D(X, Y, Elev);
                return new PointF3D(X, Y, Z);
            }
            set
            {
                Position = new PointF(value.X, value.Y);
                Elev = value.Z;
                Z = value.Z;
            }
        }
@@ -95,7 +95,7 @@
        [Description("标高(m)")]
        [DisplayName("标高(m)")]
        [Browsable(true)]
        public new float Elev { get { return base.Elev; } set { base.Elev = value; } }
        public new float Z { get { return base.Z; } set { base.Z = value; } }
        [Category("基本信息")]
        [Description("类型")]
        [DisplayName("类型")]
@@ -124,25 +124,14 @@
        [Browsable(true)]
        public virtual string PatternID { get; set; }
        [Category("其他参数")]
        [DisplayName("链表清单")]
        [Browsable(true)]
        [JsonIgnore]
        public List<LinkCalcModel> Links
        {
            get
            {
                //if (base.Links == null) return null;
                return base.Links;
            }
            set
            {
                base.Links = value;
            }
        }
        public LinkViewModelList Links { get; set; } = new LinkViewModelList();
        public List<LinkViewModel> ViewLinks
        {
@@ -150,7 +139,7 @@
            {
                return base.Links.Select(oo => oo as LinkViewModel).ToList();
            }
        }
@@ -159,7 +148,7 @@
        [Category("其他参数")]
@@ -175,13 +164,13 @@
            set { if (value != null) X = value.X; Y = value.Y; }
        }
        [Category("其他参数")]
        [Description("标签")]
        [DisplayName("标签")]
        [Editor(typeof(MyEditor), typeof(UITypeEditor))]
        public TagList Tags { get; set; } = null;
        //[Category("其他参数")]
        //[Description("标签")]
        //[DisplayName("标签")]
        //[Editor(typeof(MyEditor), typeof(UITypeEditor))]
        //public TagList Tags { get; set; } = null;
        [Browsable(false)]
        [JsonIgnore]
@@ -217,7 +206,7 @@
        {
            X += vector.X;
            Y += vector.Y;
            Elev += vector.Z;
            Z += vector.Z;
        }
@@ -228,14 +217,14 @@
            if (this is TankViewModel) return MapObjectType.水池;
            if (this is MeterViewModel) return MapObjectType.水表;
            if (this is NozzleViewModel) return MapObjectType.喷头;
            if (this is ValveNodeViewModel) return MapObjectType.阀门点;
            if (this is PipeViewModel) return MapObjectType.管线;
            if (this is ValveViewModel) return MapObjectType.阀门;
            if (this is RepeaterViewModel) return MapObjectType.重复器;
            if (this is PumpViewModel) return MapObjectType.水泵;
            if (this is PumpNodeViewModel) return MapObjectType.水泵点;
            return MapObjectType.节点;
        }
@@ -261,7 +250,7 @@
        private PointF3D ToPointF3D()
        {
            return new PointF3D(X, Y, Elev);
            return new PointF3D(X, Y, Z);
        }
        #endregion