cloudflight
2024-06-22 ccdc621d089fcffaca72b576baa4a121264f9949
fix:CubeView移动问题
已修改5个文件
已添加2个文件
516 ■■■■ 文件已修改
Hydraulic/Hydro.MapUI/Hydro.MapUI.csproj.user 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Hydraulic/Hydro.MapUI/Map/MapViewer.Designer.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Hydraulic/Hydro.MapUI/Map/MapViewer.Draw.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Hydraulic/Hydro.MapUI/Map/MapViewer.cs 369 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Hydraulic/Hydro.MapUI/WindowsForm/ResultForm.Designer.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Hydraulic/Hydro.MapUI/WindowsForm/ResultForm.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Hydraulic/Hydro.MapView/MapViewNetWork.cs 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Hydraulic/Hydro.MapUI/Hydro.MapUI.csproj.user
@@ -34,6 +34,9 @@
    <Compile Update="WindowsForm\propertyform.cs">
      <SubType>UserControl</SubType>
    </Compile>
    <Compile Update="WindowsForm\ResultForm.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Update="WindowsForm\模板管理.cs">
      <SubType>Form</SubType>
    </Compile>
Hydraulic/Hydro.MapUI/Map/MapViewer.Designer.cs
@@ -609,8 +609,8 @@
            this.btn_水量初分配.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.btn_水量初分配.Name = "btn_水量初分配";
            this.btn_水量初分配.Size = new System.Drawing.Size(64, 22);
            this.btn_水量初分配.Text = "初分配";
            this.btn_水量初分配.Click += new System.EventHandler(this.btn_初分配_Click);
            this.btn_水量初分配.Text = "拓扑检查";
            this.btn_水量初分配.Click += new System.EventHandler(this.btn_拓扑检查_Click);
            // 
            // toolStripDropDownButton_工具
            // 
Hydraulic/Hydro.MapUI/Map/MapViewer.Draw.cs
@@ -1,4 +1,5 @@
using Hydro.MapView;
using DevExpress.XtraPrinting.Native;
using Hydro.MapView;
using Hydro.MapView.Base;
using Hydro.MapView.Common;
using System;
@@ -176,7 +177,7 @@
                    var p = new List<PointF>();
                    foreach (var node in area.InnerNodes)
                    {
                        p.Add(WorldPointToMapPoint(node, template.OffSet));
                        p.Add(CubeWorldPointToMapPoint(node, template.OffSet));
                    }
                    if (p.Count < 3) continue;
                    pen0.Color = penClosed.Color = area.color;
@@ -815,17 +816,18 @@
        // æ ¹æ®æ—‹è½¬è§’度计算旋转后的坐标
        private PointF Get平面旋转Point(PointF p)
        private PointF Get平面旋转Point(PointF p, PointF MapC)
        {
            PointF center = MapCenter;
            PointF center = MapC ;
            double radian = Rotation * Math.PI / 180;  // è§’度转弧度
            float x = (float)(Math.Cos(radian) * (p.X - center.X) - Math.Sin(radian) * (p.Y - center.Y) + center.X);
            float y = (float)(Math.Sin(radian) * (p.X - center.X) + Math.Cos(radian) * (p.Y - center.Y) + center.Y);
            return new PointF(x, y);
        }
        private PointF Get平面还原Point(PointF p)
        private PointF Get平面还原Point(PointF p, PointF MapC)
        {
            PointF center = MapCenter;
            PointF center = MapC;
            double radian = -Rotation * Math.PI / 180;  // è§’度转弧度
            float x = (float)(Math.Cos(radian) * (p.X - center.X) - Math.Sin(radian) * (p.Y - center.Y) + center.X);
            float y = (float)(Math.Sin(radian) * (p.X - center.X) + Math.Cos(radian) * (p.Y - center.Y) + center.Y);
@@ -834,9 +836,9 @@
        private PointF Get俯视角旋转Point(PointF p, float z)
        private PointF Get俯视角旋转Point(PointF p, float z, PointF MapC)
        {
            PointF center = MapCenter;
            PointF center = MapC;
            double radian_fushi = ä¿¯è§†å¼§åº¦;
            float sin = (float)Math.Sin(radian_fushi);
            float cos = (float)Math.Cos(radian_fushi);
@@ -844,9 +846,9 @@
            float y = (float)(sin * (p.Y - center.Y) + center.Y) + cos * z;
            return new PointF(x, y);
        }
        private PointF Get俯视角还原Point(PointF p, float z)
        private PointF Get俯视角还原Point(PointF p, float z, PointF MapC)
        {
            PointF center = MapCenter;
            PointF center = MapC;
            double radian_fushi = ä¿¯è§†å¼§åº¦;
            float sin = (float)Math.Sin(radian_fushi);
            float cos = (float)Math.Cos(radian_fushi);
@@ -875,9 +877,9 @@
            if (offset == null) offset = new PointF3D(0, 0, 0);
            point = new PointF(point.X + offset.X, point.Y + offset.Y);
            var pointR = Get平面旋转Point(point);
            var pointR = Get平面旋转Point(point, MapCenter);
            var pointT = Get俯视角旋转Point(pointR, z + offset.Z);
            var pointT = Get俯视角旋转Point(pointR, z + offset.Z, MapCenter);
            //var n=new PointF((float)pointR.X - Z(z).X, (float)(pointR.Y - Z(z).Y));
            return pointT;
@@ -893,7 +895,19 @@
            if (junction == null) return new PointF(0, 0);
            p = WorldPointToMapPoint(junction.Position, junction.Elev, offset);
            return p;
        }
        private PointF CubeWorldPointToMapPoint(NodeViewModel junction, PointF3D offset = null)
        {
            PointF p;
            if (junction == null) return new PointF(0, 0);
            var point = junction.Position;
            var z = junction.Elev;
            if (offset == null) offset = new PointF3D(0, 0, 0);
            point = new PointF(point.X + offset.X, point.Y + offset.Y);
            var pointR = Get平面旋转Point(point, new PointF(0, 0));
            var pointT = Get俯视角旋转Point(pointR, z + offset.Z, new PointF(0, 0));
            //var n=new PointF((float)pointR.X - Z(z).X, (float)(pointR.Y - Z(z).Y));
            return pointT;
        }
        private List<PointF> WorldPointToMapPoint(LinkViewModel pipe, PointF3D offset = null)
        {
@@ -992,8 +1006,8 @@
        /// <returns></returns>
        public PointF MapPointToWorldPoint(PointF point, float z = 0)
        {
            var pointT = Get俯视角还原Point(point, z);
            pointT = Get平面还原Point(pointT);
            var pointT = Get俯视角还原Point(point, z,MapCenter);
            pointT = Get平面还原Point(pointT, MapCenter);
            //var n=new PointF((float)pointR.X - Z(z).X, (float)(pointR.Y - Z(z).Y));
            return pointT;
Hydraulic/Hydro.MapUI/Map/MapViewer.cs
@@ -1,5 +1,6 @@
//using CloudWaterNetwork.Magnifier;
//using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Filtering;
using Hydro.CommonBase;
using Hydro.Core.Model;
using Hydro.Inp;
@@ -229,7 +230,7 @@
                }
                TCCube.template.network.Areas.Add(area);
            }
            CubeView.Init(TCCube, new DrawDelegate[] { Draw, Draw, DrawBackGroud, DrawH }, new MouseDelegate[] { mapMouseDown, mapMouseMove, mapMouseUp, mapMouseWheel });
            CubeView.Init(TCCube, new DrawDelegate[] { Draw, Draw, DrawBackGroud, DrawH }, new MouseDelegate[] { CubeViewMouseDown, CubeViewMouseMove, CubeViewMouseUp, mapMouseWheel });
        }
@@ -1561,6 +1562,196 @@
        private int _lastMouseY;
        #endregion
        #region CubeView鼠标事件
        void CubeViewMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            _ClickStartPos = new PointF(e.X, e.Y);
            DragStartPos = ScreenToMap(new PointF(e.X, e.Y));
            mousePosition = _MousePosition = ScreenToMap(new PointF(e.X, e.Y));
            if (e.Button == MouseButtons.Left && _isInsertingObject)
            {
            }
            else if (e.Button == MouseButtons.Left && _mouseState == MouseState.无)
            {
            }
            else if (e.Button == MouseButtons.Left && _mouseState == MouseState.设置底图范围)
            {
            }
            else if (e.Button == MouseButtons.Right)
            {
                RotaStartPos = new PointF(e.X, e.Y);
                Rotation0 = Rotation;
                ä¿¯è§†è§’度_start = RotationF;
                _lastCursor = this.Cursor;
                Cursor = Cursors.Hand;
                mapOption0 = mapOption.Copy();
                _isRotating = true;
            }
        }
        void CubeViewMouseMove(MouseEventArgs e)
        {
            //base.OnMouseMove(e);
            bool needInvalidate = false;
            _MousePosition = ScreenToMap(new PointF(e.X, e.Y));
            if (_isRotating)
            {
                mousePosition = _MousePosition;
                bool is下半屏幕 = RotaStartPos.Y >= this.map.Height / 2;
                if (ModifierKeys != Keys.Alt) Rotation = Rotation0 + ((float)e.X - (float)RotaStartPos.X) * 180 * 2.5 / (float)this.map.Width * (is下半屏幕 ? 1 : 1);
                if (ModifierKeys != Keys.Shift) RotationF = ä¿¯è§†è§’度_start + ((float)e.Y - (float)RotaStartPos.Y) * 180 * 2.5 / (float)this.map.Height;
                if (RotationF > 90) RotationF = 90;
                if (RotationF < 0) RotationF = 0;
                needInvalidate = true;
            }
            //else
            /*判断是否触碰到对象*/
            if (_mouseHoverCheckFlag)
            {
                _mouseHoverCheckFlag = false;
                // éåŽ†æ‰€æœ‰å¯¹è±¡,找出范围内的对象
                PointF clickedPoint = new PointF(e.X, e.Y);  //ScreenToMap(new PointF(e.X, e.Y));
                var obj = GetObj_by_ScreenPoint(clickedPoint);
                if (hoveredObjs.Count > 0 && hoveredObjs[0] == obj || hoveredObjs.Count == 0 && obj == null)
                {
                    //needInvalidate = false;
                }
                else
                {
                    needInvalidate = true;
                    hoveredObjs.ForEach(o => o.Hovered = false);
                    hoveredObjs.Clear();
                    if (obj != null)
                    {
                        obj.Hovered = true;
                        hoveredObjs.Add(obj);
                    }
                }
            }
            if (needInvalidate) this.SetMapInvalidate();
            label_mouse.Text = $"X:{e.X.ToString("0")} Y:{e.Y.ToString("0")} [Map]X:{_MousePosition.X.ToString("0.00")} Y:{_MousePosition.Y.ToString("0.00")}";
            _lastMouseX = e.X;
            _lastMouseY = e.Y;
        }
        void CubeViewMouseUp(MouseEventArgs e)
        {
            //BookMark    ï¼šé¼ æ ‡æŠ¬èµ·äº‹ä»¶
            base.OnMouseUp(e);
            bool isMouseMoved = Get_dist(_ClickStartPos, new PointF(e.X, e.Y)) > 10;
            bool isdoubleClick = (DateTime.Now - _lastMouseUp).TotalMilliseconds <= doubleClick_Delay;
            _lastMouseUp = DateTime.Now;
            if /*点选*/(!isMouseMoved && _mouseState == MouseState.无 && e.Button == MouseButtons.Left && ModifierKeys == Keys.None)
            {
                _isDragging = false;
                // éåŽ†æ‰€æœ‰ç‚¹ï¼Œæ‰¾å‡ºæœ€è¿‘çš„ç‚¹
                PointF clickedPoint = new PointF(e.X, e.Y);  //ScreenToMap(new PointF(e.X, e.Y));
                var obj = GetObj_by_ScreenPoint(clickedPoint);
                bool isJunction = obj is NodeViewModel;
                if (obj != null)
                {
                    selectedObjs.ForEach(o => o.Selected = false);
                    selectedObjs.Clear();
                    obj.Selected = true;
                    selectedObjs.Add(obj);
                    if (GlobalObject.PropertyForm != null)
                        GlobalObject.PropertyForm.SetObjs(selectedObjs);
                    _OperaNode = null;
                    SetMapInvalidate();
                    mousePosition = new PointF(0, 0);
                }
                else
                {
                    //GlobalObject.LockSelect
                    selectedObjs.ForEach(o => o.Selected = false);
                    selectedObjs.Clear();
                    if (GlobalObject.PropertyForm != null)
                        GlobalObject.PropertyForm.SetObjs(selectedObjs);
                    _OperaNode = null;
                    SetMapInvalidate();
                }
                return;
            }
            if (/*叠加点选*/!isMouseMoved && _mouseState == MouseState.无 && e.Button == MouseButtons.Left && ModifierKeys == Keys.Control)
            {
                _isDragging = false;
                // éåŽ†æ‰€æœ‰ç‚¹ï¼Œæ‰¾å‡ºæœ€è¿‘çš„ç‚¹
                PointF clickedPoint = new PointF(e.X, e.Y);  //ScreenToMap(new PointF(e.X, e.Y));
                var obj = GetObj_by_ScreenPoint(clickedPoint);
                bool isJunction = obj is NodeViewModel;
                if (obj != null)
                {
                    if (selectedObjs.Contains(obj))
                    {
                        obj.Selected = false;
                        selectedObjs.Remove(obj);
                        if (GlobalObject.PropertyForm != null)
                            GlobalObject.PropertyForm.SetObjs(selectedObjs);
                        SetMapInvalidate();
                        mousePosition = new PointF(0, 0);
                    }
                    else
                    {
                        obj.Selected = true;
                        selectedObjs.Add(obj);
                        if (GlobalObject.PropertyForm != null)
                            GlobalObject.PropertyForm.SetObjs(selectedObjs);
                        SetMapInvalidate();
                        mousePosition = new PointF(0, 0);
                    }
                }
                return;
            }
            if (e.Button == MouseButtons.Right)
            {
                if (_isRotating)
                {
                    _isRotating = false;
                    this.Cursor = _lastCursor;
                    if (recordView) MapObjectExtensions.AddCommand(mapOption, "Map", mapOption0, mapOption);
                    mousePosition = new PointF(0, 0);
                }
            }
        }
        #endregion
        #endregion ä¸€ã€å…¨å±€
        #region äºŒã€å·¥å…·æ 
@@ -2532,102 +2723,106 @@
        }
        private void btn_初分配_Click(object sender, EventArgs e)
        private void btn_拓扑检查_Click(object sender, EventArgs e)
        {
            string result = null;
            if ((result=_Template.network.CheckValidate())!=null)
            Dictionary<string,List<string>> result = _Template.network.CheckValidate();
            if (result.Count>0)
            {
                MessageBox.Show(result);
                return;
                //ListBox listBox2 = new ListBox();
                //listBox2.Dock = DockStyle.Fill;
                ////listBox2的item为什么显示不出来?
                //listBox2.SelectedIndexChanged += (s, e) =>
                //{
                //    if (listBox2.SelectedIndex >= 0)
                //    {
                //        List<IBaseViewModel> Objs = new List<IBaseViewModel>();
                //        Objs.AddRange(_Nodes.Select(n=>(NodeViewModel)n));
                //        Objs.AddRange(_Links.Select(l => (LinkViewModel)l));
                //        var obj = Objs.Find(o => o.ID == listBox2.SelectedItem.ToString());
                //        if (obj != null)
                //        {
                //            obj.Selected = true;
                //            selectedObjs.Add((NodeViewModel)obj);
                //            SetMapInvalidate();
                //        }
                //    }
                //};
                ListBox listBox1 = new ListBox();
                listBox1.Dock = DockStyle.Fill;
                listBox1.Width = 200;
                listBox1.Height = 400;
                listBox1.Items.AddRange(result.Keys.ToArray());
                listBox1.SelectedIndexChanged += (s, e) =>
                {
                    //listBox2.Items.Clear();
                    if (listBox1.SelectedIndex >= 0)
                    {
                        var arr=result[listBox1.SelectedItem.ToString()].ToHashSet();
                        List<IBaseViewModel> Objs = new List<IBaseViewModel>();
                        Objs.AddRange(_Nodes.Select(n => (NodeViewModel)n));
                        Objs.AddRange(_Links.Select(l => (LinkViewModel)l));
                        var nodes = _Nodes.FindAll(o => arr.Contains(o.ID));
                        var links = _Links.FindAll(o => arr.Contains(o.ID));
                        //listBox2.Items.AddRange(result[listBox1.SelectedItem.ToString()].ToArray());
                        selectedObjs.ForEach(obj => obj.Selected = false);
                        selectedObjs.Clear();
                        nodes.ForEach(obj =>
                        {
                            obj.Selected = true;
                            selectedObjs.Add((NodeViewModel)obj);
                        });
                        links.ForEach(obj =>
                        {
                            obj.Selected = true;
                            selectedObjs.Add((LinkViewModel)obj);
                        });
                        if (GlobalObject.PropertyForm != null)
                            GlobalObject.PropertyForm.SetObjs(selectedObjs);
                        SetMapInvalidate();
                    }
                };
                Form ResultForm = new Form();
                ResultForm.Text = "拓扑检查结果";
                ResultForm.Width = 300;
                ResultForm.Height = 400;
                ResultForm.StartPosition = FormStartPosition.CenterScreen;
                ResultForm.Controls.Add(listBox1);
                ResultForm.MinimizeBox = false;
                ResultForm.MaximizeBox = false;
                //ResultForm.Controls.Add(listBox2);
                //listBox2.Invalidate();
                ResultForm.Show();
                //新建一个窗口,显示检查结果
                //CheckForm checkForm = new CheckForm();
                //checkForm.Show();
            }
            List<WaterEquivalentSettings> settings = new List<WaterEquivalentSettings>();
            settings.Add(new WaterEquivalentSettings()
            else
            {
                waterEquivalents=new WaterEquivalentTemplate()
                {
                    ID="1",
                    Name="1",
                    WaterEquivalentCollection=new WaterEquivalentCollection()
                    {
                        new WaterEquivalent()
                        {
                            ID=1008,
                            MinRatedFlow=0.48f,
                            RatedFlow=0.72f,
                            Count=1,
                        },
                        new WaterEquivalent()
                        {
                            ID=1009,
                            MinRatedFlow=0.88f,
                            RatedFlow=0.96f,
                            Count=2,
                        },
                        new WaterEquivalent()
                        {
                            ID=1010,
                            MinRatedFlow=1.08f,
                            RatedFlow=1.08f,
                            Count=3,
                        }
                    }
                },
                Meters=new List<string>()
                {
                    //按以下规律生成数组到M10,"M1","M2"
                MessageBox.Show("拓扑检查通过");
            }
            //if (!string.IsNullOrEmpty(result))
            //{
            //    MessageBox.Show(result);
            //    return;
            //}
                        "M1","M2","M3","M4","M5","M6","M7","M8","M9","M10","M11","M12","M13","M14","M15","M16",
                    "M17","M18","M19","M20","M21","M22","M23","M24","M25","M26","M27","M28","M29","M30"
                },
            });
            settings.Add(new WaterEquivalentSettings()
            {
                waterEquivalents = new WaterEquivalentTemplate()
                {
                    ID = "1",
                    Name = "1",
                    WaterEquivalentCollection = new WaterEquivalentCollection()
                    {
                        new WaterEquivalent()
                        {
                            ID=2008,
                            MinRatedFlow=0.48f,
                            RatedFlow=0.48f,
                            Count=1,
                        },
                        new WaterEquivalent()
                        {
                            ID=2009,
                            MinRatedFlow=0.12f,
                            RatedFlow=0.12f,
                            Count=5,
                        },
                        new WaterEquivalent()
                        {
                            ID=2010,
                            MinRatedFlow=0.16f,
                            RatedFlow=0.18f,
                            Count=6,
                        }
                    }
                },
                Meters = new List<string>()
                {
                    //按以下规律生成数组到M10,"M1","M2"
                       "M31","M32","M33","M34","M35","M36","M37","M38","M39","M40","M41","M42","M43","M44","M45","M46","M47","M48","M49","M50","M51","M52","M53","M54","M55","M56","M57","M58","M59","M60","M61","M62","M63","M64","M65","M66","M67","M68","M69","M70","M71","M72","M73","M74","M75","M76","M77","M78","M79","M80"
                },
            });
            var head=_Network.reservoirs.FirstOrDefault().Head;
            _Network.WaterDistribution(_Template.FullPath, GlobalPath.configPath + "config_waterDistri.wdb",settings,40, head);
        }
        public void toolStripButton_计算_Click(object sender, EventArgs e)
        {
            //LoadData();
           if (_Template==null)
            {
                MessageBox.Show("请先打开文件");
                return;
            }
            _Network.Calc(_Template.FullPath, GlobalPath.configPath+ "config_calc.wdb");
        }
Hydraulic/Hydro.MapUI/WindowsForm/ResultForm.Designer.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
namespace Hydro.MapUI.WindowsForm
{
    partial class ResultForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(800, 450);
            this.Text = "ResultForm";
        }
        #endregion
    }
}
Hydraulic/Hydro.MapUI/WindowsForm/ResultForm.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Hydro.MapUI.WindowsForm
{
    public partial class ResultForm : Form
    {
        public ResultForm()
        {
            InitializeComponent();
        }
    }
}
Hydraulic/Hydro.MapView/MapViewNetWork.cs
@@ -1019,46 +1019,65 @@
            return list;
            //return new List<TimePoint>();
        }
        public string CheckValidate()
        public Dictionary<string, List<string>> CheckValidate()
        {
            BuildRelation();
            string result = null;
            Dictionary<string, List<string>> result_dict = new Dictionary<string, List<string>>();
            StringBuilder result_sb=new StringBuilder();
            //to-do
            var objs = new List<LinkViewModel>() { Links[0] }; //Links.FindAll(o => o is LinkViewModel).Select(o => o as LinkViewModel).ToList();
            var objs = Links.Select(o => o as LinkViewModel).ToList();//new List<LinkViewModel>() { Links[0] }; //Links.FindAll(o => o is LinkViewModel).Select(o => o as LinkViewModel).ToList();
            //objs去掉重复的元素
            objs = objs.Distinct().ToList();
            var visitedNodes = new HashSet<NodeViewModel>();
            FindObjs = new HashSet<IBaseViewModel>();
            objs.ForEach(o => TraversePipeNetworkALL(o, visitedNodes));
            List<string> list_孤立点 = new List<string>();
            for(int i=0;i<Nodes.Count;i++)
            {
                if (!FindObjs.Contains(Nodes[i])) result_sb .AppendLine($"节点{Nodes[i].ID}是孤立点");
                if (!FindObjs.Contains(Nodes[i]))
                {
                    result_sb.AppendLine($"节点{Nodes[i].ID}是孤立点");
                    list_孤立点.Add(Nodes[i].ID);
                }
            }
            if (list_孤立点.Count>0)result_dict.Add("孤立点", list_孤立点);
            //属性判断
            var list_管道连接关系异常 = new List<string>();
            var list_管道长度小于等于0 = new List<string>();
            var list_粗糙系数设置错误 = new List<string>();
            var list_管径设置错误 = new List<string>();
            pipes.ForEach(p =>
            {
                if (p.StartNode == null || p.EndNode == null)
                {
                    result_sb.AppendLine($"{p.ID}管道未连接");
                    result_sb.AppendLine($"{p.ID}管道连接关系异常");
                    list_管道连接关系异常.Add(p.ID);
                }
                if (p.Length<=0)
                {
                    result_sb.AppendLine($"{p.ID}管道长度小于等于0");
                    list_管道长度小于等于0.Add(p.ID);
                }
                if (p.Roughness<=0.1 || p.Roughness>10000)
                {
                    result_sb.AppendLine($"{p.ID}粗糙系数设置错误");
                    list_粗糙系数设置错误.Add(p.ID);
                }
                if (p.Diameter<=0.1 || p.Diameter>10000)
                {
                    result_sb.AppendLine($"{p.ID}管径设置错误");
                    list_管径设置错误.Add(p.ID);
                }
            });
            return result_sb.ToString();
            if (list_管道连接关系异常.Count > 0) result_dict.Add("管道连接关系异常", list_管道连接关系异常);
            if (list_管道长度小于等于0.Count > 0) result_dict.Add("管道长度小于等于0", list_管道长度小于等于0);
            if (list_粗糙系数设置错误.Count > 0) result_dict.Add("粗糙系数设置错误", list_粗糙系数设置错误);
            if (list_管径设置错误.Count > 0) result_dict.Add("管径设置错误", list_管径设置错误);
            return result_dict;
          
@@ -1187,7 +1206,8 @@
                    }
                    if (k2 == list.Count)
                    {
                        throw new Exception($"未找到Node[{J.ID}]的{valueType}");
                        return;
                        //throw new Exception($"未找到Node[{J.ID}]的{valueType}");
                    }
                    switch (valueType)
                    {
@@ -1228,7 +1248,8 @@
                    }
                    if (k2 == list.Count)
                    {
                        throw new Exception($"未找到Link[{J.ID}]的{valueType}");
                        return;
                        //throw new Exception($"未找到Link[{J.ID}]的{valueType}");
                    }
                    switch (valueType)
                    {