lixiaojun
2024-10-11 79c8977a39744e046a121e7ef491532b9451babb
WinFrmUI/Yw.WinFrmUI.Hydro.Q3d.Core/MapView/Base/LinkViewModel.cs
@@ -1,4 +1,4 @@
using Hydro.Core.Model;
using Yw.WinFrmUI.Q3d;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -7,16 +7,16 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using static Hydro.MapView.MapViewEnum;
using static Yw.WinFrmUI.Q3d.MapViewEnum;
using System.Xml.Linq;
using Newtonsoft.Json;
using static Hydro.Core.ObjectEnum;
using static Yw.WinFrmUI.Q3d.ObjectEnum;
using System.Drawing.Design;
namespace Hydro.MapView
namespace Yw.WinFrmUI.Q3d
{
    [Serializable]
    public class LinkViewModel : LinkCalcModel, IBaseViewModel
    public class LinkViewModel : Q3DLinkCalcModel, IBaseViewModel
    {
        #region 构造函数
@@ -38,6 +38,7 @@
            //Points = points;
        }
        #endregion
        #region 属性
        
@@ -122,19 +123,19 @@
            if (!is3Dview)
                return new PointF[] { new PointF((float)(StartNode.X), (float)(StartNode.Y)), new PointF((float)(EndNode.X), (float)(EndNode.Y)) };
            else
                return new PointF[] { new PointF((float)(StartNode.X), (float)(StartNode.Y - 2 * StartNode.Elev)), new PointF((float)(EndNode.X), (float)(EndNode.Y - 2 * EndNode.Elev)) };
                return new PointF[] { new PointF((float)(StartNode.X), (float)(StartNode.Y - 2 * StartNode.Z)), new PointF((float)(EndNode.X), (float)(EndNode.Y - 2 * EndNode.Z)) };
        }
        [Category("基本信息")]
        [DisplayName("标高(m)")]
        [Browsable(false)]
        public  float Elev
        public  float Z
        {
            get
            {
                if (StartNode == null || EndNode == null) return 0;
                return (StartNode.Elev + EndNode.Elev) / 2;
                return (StartNode.Z + EndNode.Z) / 2;
            }
            set
            {
@@ -242,11 +243,11 @@
        [DisplayName("是否显示")]
        public bool Visible { get; set; } = true;
        [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;
        
@@ -262,6 +263,7 @@
        [DisplayName("ID类型")]
        [Browsable(false)]
        #endregion
        #region 方法
        
@@ -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 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.节点;
        }