duheng
2024-10-15 21d9f7bcbe8c82d2af9dbdc18f189a3bb1672d74
WinFrmUI/Yw.WinFrmUI.Hydro.Q3d.Core/MapView/Base/NodeViewModel.cs
@@ -1,4 +1,4 @@
using Hydro.Core.Model;
using Yw.WinFrmUI.Q3d;
using Hydro.Model;
using Newtonsoft.Json;
using System;
@@ -11,12 +11,12 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using static Hydro.MapView.MapViewEnum;
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()
@@ -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("类型")]
@@ -130,7 +130,7 @@
        [DisplayName("链表清单")]
        [Browsable(true)]
        [JsonIgnore]
        public List<LinkCalcModel> Links
        public List<Q3DLinkCalcModel> Links
        { 
            get
            {
@@ -175,11 +175,11 @@
            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;
        
@@ -217,7 +217,7 @@
        {
            X += vector.X;
            Y += vector.Y;
            Elev += vector.Z;
            Z += vector.Z;
        }
@@ -228,14 +228,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 +261,7 @@
        private PointF3D ToPointF3D()
        {
            return new PointF3D(X, Y, Elev);
            return new PointF3D(X, Y, Z);
        }
        #endregion