From 2afe37c9578fa831f00c5ac4d4c1a3329d79e29d Mon Sep 17 00:00:00 2001 From: duheng <2286773002@qq.com> Date: 星期四, 20 三月 2025 10:08:57 +0800 Subject: [PATCH] --新增设施编辑连接地址及连接方式 --- WinFrmUI/PBS.WinFrmUI.Hydro/99-map-view/Class1.cs | 72 ++++++++++++++++++++--------------- 1 files changed, 41 insertions(+), 31 deletions(-) diff --git a/WinFrmUI/PBS.WinFrmUI.Hydro/99-map-view/Class1.cs b/WinFrmUI/PBS.WinFrmUI.Hydro/99-map-view/Class1.cs index d4605e7..1da99cb 100644 --- a/WinFrmUI/PBS.WinFrmUI.Hydro/99-map-view/Class1.cs +++ b/WinFrmUI/PBS.WinFrmUI.Hydro/99-map-view/Class1.cs @@ -690,10 +690,13 @@ pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash; if (mapOption.IsOrtho) { - var wPos = GetZZWorldPoint(_select_junction1.Position3D, _MousePosition, new Vector3(1, 1, 0)); - //getPointAndHeight(e, _select_junction1, out p, out z); + var wPos = GetZZWorldPoint(_select_junction1.Position3D, _MousePosition, new Vector3(1, 1, 0)); var mapPos = WorldPointToMapPoint(wPos); - bufferG.DrawLine(pen, WorldPointToMapPoint(_select_junction1), mapPos); + if ((!float.IsNaN(mapPos.X)) && (!float.IsNaN(mapPos.Y))) + { + bufferG.DrawLine(pen, WorldPointToMapPoint(_select_junction1), mapPos); + } + } else { @@ -3015,8 +3018,7 @@ attributes &= ~FileAttributes.ReadOnly; // 绉婚櫎鍙鏍囧織 // 璁剧疆鏂扮殑鏂囦欢灞炴�� - File.SetAttributes(filePath, attributes); - + File.SetAttributes(filePath, attributes); } @@ -3526,15 +3528,15 @@ 娉电珯 } - public enum TemplateType - { - 鍏ㄩ儴, - 妤煎眰妯℃澘, - 灏忓尯妯℃澘, - 鍗曞厓妯℃澘, - 鍗曞厓鍒嗗尯妯℃澘, - 鍏朵粬 - } + //public enum PBS.eModelTemplateType + //{ + // 鍏ㄩ儴, + // 妤煎眰妯℃澘, + // 灏忓尯妯℃澘, + // 鍗曞厓妯℃澘, + // 鍗曞厓鍒嗗尯妯℃澘, + // 鍏朵粬 + //} } public class AreaViewModel : NodeViewModel, IBaseViewModel @@ -4091,7 +4093,7 @@ [Browsable(true)] public new RepeatStatus Status { get; set; } - public bool Load(int MaxLevel, dict<string, dynamic> param, Dictionary<TemplateType, bool> viewModel, bool viewMode = true) + public bool Load(int MaxLevel, dict<string, dynamic> param, Dictionary<PBS.eModelTemplateType, bool> viewModel, bool viewMode = true) { if (template == null) @@ -4133,7 +4135,7 @@ } - if (param.Contains("灞傛暟") && param["灞傛暟"] > 0 && template.Type == TemplateType.妤煎眰妯℃澘) + if (param.Contains("灞傛暟") && param["灞傛暟"] > 0 && template.Type == PBS.eModelTemplateType.Floor) { RepeatTimes = (int)param["灞傛暟"]; } @@ -4152,7 +4154,7 @@ net.Name = NetworkPreName + (index == 0 ? "" : index.ToString("00")); net.StartPoint = net.GetNode(template.Node1)[0]; net.EndPoint = net.GetNode(template.Node2)[0]; - if (template.Type == TemplateType.妤煎眰妯℃澘) + if (template.Type == PBS.eModelTemplateType.Floor) ChangeNetbyParam(net, param); if (i == 0) StartNode_inner = net.StartPoint; EndNode_inner = net.EndPoint; @@ -4186,7 +4188,7 @@ n.Y = (n.Y - net.StartPoint.Y) * k + net.StartPoint.Y; }); } - if (param.Contains("鎴锋暟") && template.Type == TemplateType.妤煎眰妯℃澘) + if (param.Contains("鎴锋暟") && template.Type == PBS.eModelTemplateType.Floor) { var MaxLevel = (int)param["鎴锋暟"]; net.MapObjects.ForEach(o => @@ -4606,7 +4608,7 @@ [Browsable(true)] - public TemplateType Type { get; set; } + public PBS.eModelTemplateType Type { get; set; } public Template() @@ -4617,7 +4619,7 @@ filePath = null; } - public Template(string ID, string name, string address, TemplateType type) + public Template(string ID, string name, string address, PBS.eModelTemplateType type) { if (ID == null) this.ID = new Guid().ToString(); @@ -4832,10 +4834,10 @@ { instance = new TemplateList(); // 娣诲姞娴嬭瘯鏁版嵁 - AddTemp(new Template(null, "灏忓尯妯℃澘", @"template\灏忓尯妯℃澘\", TemplateType.灏忓尯妯℃澘)); - AddTemp(new Template(null, "鍒嗗尯妯℃澘", @"template\鍗曞厓鍒嗗尯妯℃澘\", TemplateType.鍗曞厓鍒嗗尯妯℃澘)); - AddTemp(new Template(null, "鍗曞厓妯℃澘", @"template\鍗曞厓妯℃澘\", TemplateType.鍗曞厓妯℃澘)); - AddTemp(new Template(null, "妤煎眰1", @"template\妤煎眰妯℃澘\妤煎眰1.inp", TemplateType.妤煎眰妯℃澘)); + AddTemp(new Template(null, "灏忓尯妯℃澘", @"template\鑷畾涔夋ā鏉縗", PBS.eModelTemplateType.Custom)); + AddTemp(new Template(null, "鍒嗗尯妯℃澘", @"template\鍦板熀妯℃澘\", PBS.eModelTemplateType.Foundation)); + AddTemp(new Template(null, "鍗曞厓妯℃澘", @"template\鍗曞厓妯℃澘\", PBS.eModelTemplateType.Unit)); + AddTemp(new Template(null, "妤煎眰1", @"template\妤煎眰妯℃澘\妤煎眰1.inp", PBS.eModelTemplateType.Floor)); } Inited = true; } @@ -6122,7 +6124,7 @@ Nodes.AddRange(repeater.netList.Nodes); Links.AddRange(repeater.netList.Links); } - public void LoadRepeaters(int MaxLevel, dict<string, dynamic> param, Dictionary<TemplateType, bool> viewModel, bool ViewMode = true) + public void LoadRepeaters(int MaxLevel, dict<string, dynamic> param, Dictionary<PBS.eModelTemplateType, bool> viewModel, bool ViewMode = true) { @@ -8660,7 +8662,7 @@ #endregion } -public partial class PropertyForm : UserControl +/*public partial class PropertyForm : UserControl { private IBaseViewModel _selectedObject; private MapObjectType _selectedType = MapObjectType.鍏ㄩ儴; @@ -8836,13 +8838,21 @@ void RefreshListBox() { if (selectionSet == null) return; + if (comboBox_type.Items==null|| comboBox_type.Items.Count==0) + { + foreach (var item in Enum.GetValues(typeof(MapObjectType))) + { + comboBox_type.Items.Add(item); + } + comboBox_type.SelectedIndex = 0; + + } string txt = comboBox_type.SelectedItem.ToString(); MapObjectType selectedType = (MapObjectType)Enum.Parse(typeof(MapObjectType), txt); // 浣跨敤 LINQ 鏌ヨ绛涢�夐�夋嫨闆� selectionSet.filterType = selectedType; selectionSet.FilterString = textBox_search.Text; - - + listBox1.SelectedIndexChanged -= listBox1_SelectedIndexChanged; @@ -9026,7 +9036,7 @@ } } } -} +}*/ public class SelectionSet { @@ -9113,7 +9123,7 @@ } - +/* partial class PropertyForm { @@ -9334,7 +9344,7 @@ private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.ToolStripMenuItem 鍏ㄩ�塗oolStripMenuItem; } - +*/ public class DRange { -- Gitblit v1.9.3