From 46f64905a3c309a50c0f245b3350cdeb8dd699c6 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期三, 22 一月 2025 17:29:02 +0800
Subject: [PATCH] 计算优化

---
 WinFrmUI/Yw.WinFrmUI.Hydro.Q3d.Core/MapView/Base/NodeViewModel.cs |   61 ++++++++++++------------------
 1 files changed, 25 insertions(+), 36 deletions(-)

diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Q3d.Core/MapView/Base/NodeViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Q3d.Core/MapView/Base/NodeViewModel.cs
index 30dc9e3..98b0430 100644
--- a/WinFrmUI/Yw.WinFrmUI.Hydro.Q3d.Core/MapView/Base/NodeViewModel.cs
+++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Q3d.Core/MapView/Base/NodeViewModel.cs
@@ -1,5 +1,4 @@
-锘縰sing Hydro.Core.Model;
-using Hydro.Model;
+锘縰sing 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

--
Gitblit v1.9.3