cloudflight
2024-05-07 d750fc90db76b0c6aab2f99b987b7af84b831ce4
Hydraulic/Hydro.MapView/MapViewNetWork.cs
@@ -18,6 +18,7 @@
using System.Runtime.InteropServices;
using Hydro.HydraulicOptimizer;
using Hydro.Core;
using System.Xml.Linq;
namespace Hydro.MapView
{
@@ -571,7 +572,7 @@
                EndPoint = network.EndPoint;
            }
        }
        public List<IBaseViewModel> Add(MapViewNetWork net0, PointF3D offset = null, bool isCopy = false)
        public List<IBaseViewModel> Add(MapViewNetWork net0, PointF3D offset = null, bool isCopy = false,NodeViewModel ConnectNode=null)
        {
            if (offset == null)
            {
@@ -615,6 +616,10 @@
                Hash_ID.Add(l.ID);
                list.Add(l);
            });
            if (ConnectNode!=null)
            {
                list.Add(AddPipe(ConnectNode, net.StartPoint));
            }
            //BuildRelation();
            return list;
        }
@@ -765,6 +770,7 @@
        // 定义 visited 字典记录已访问过的节点和待访问的节点队列
        Dictionary<NodeViewModel, bool> visited;//= new Dictionary<Node, bool>();
        private bool _isCalculated=false;
        public void BFS(MapViewNetWork net, NodeViewModel startNode, Vector3 vector)
        {
@@ -851,6 +857,7 @@
                l.EN_HEADLOSS_MINOR = (float)Math.Round(l.MinorLoss * Math.Pow(l.EN_VELOCITY, 2) / 2 / 9.8, 4);
                l.EN_HEADLOSS_LINE = l.EN_HEADLOSS - l.EN_HEADLOSS_MINOR;
            });
            this._isCalculated = true;
            return list;
            //return new List<TimePoint>();
        }
@@ -901,6 +908,7 @@
            SetLinkFromWparam(this, list, "Flow");
            SetLinkFromWparam(this, list, "Velocity");
            SetLinkFromWparam(this, list, "Headloss");
            this._isCalculated = true;
            return list;
            //return new List<TimePoint>();
        }