| | |
| | | using System.Runtime.InteropServices; |
| | | using Hydro.HydraulicOptimizer; |
| | | using Hydro.Core; |
| | | using System.Xml.Linq; |
| | | |
| | | namespace Hydro.MapView |
| | | { |
| | |
| | | public NodeViewModel StartPoint { get; set; } |
| | | |
| | | public NodeViewModel EndPoint { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 当量集合,当量模板ID,<器具ID,数量> |
| | | /// </summary> |
| | | //public Dictionary<long,Dictionary<long,int>> DlList { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 核心承载字段 |
| | |
| | | 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) |
| | | { |
| | |
| | | Hash_ID.Add(l.ID); |
| | | list.Add(l); |
| | | }); |
| | | if (ConnectNode!=null) |
| | | { |
| | | list.Add(AddPipe(ConnectNode, net.StartPoint)); |
| | | } |
| | | //BuildRelation(); |
| | | return list; |
| | | } |
| | |
| | | |
| | | // 定义 visited 字典记录已访问过的节点和待访问的节点队列 |
| | | Dictionary<NodeViewModel, bool> visited;//= new Dictionary<Node, bool>(); |
| | | private bool _isCalculated=false; |
| | | |
| | | public void BFS(MapViewNetWork net, NodeViewModel startNode, Vector3 vector) |
| | | { |
| | |
| | | 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>(); |
| | | } |
| | |
| | | SetLinkFromWparam(this, list, "Flow"); |
| | | SetLinkFromWparam(this, list, "Velocity"); |
| | | SetLinkFromWparam(this, list, "Headloss"); |
| | | this._isCalculated = true; |
| | | return list; |
| | | //return new List<TimePoint>(); |
| | | } |