duheng
2025-03-20 2afe37c9578fa831f00c5ac4d4c1a3329d79e29d
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 全选ToolStripMenuItem;
}
*/
public class DRange
{