| | |
| | | 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 |
| | | { |
| | |
| | | attributes &= ~FileAttributes.ReadOnly; // 移除只读标志 |
| | | |
| | | // 设置新的文件属性 |
| | | File.SetAttributes(filePath, attributes); |
| | | |
| | | File.SetAttributes(filePath, attributes); |
| | | |
| | | } |
| | | |
| | |
| | | 泵站 |
| | | } |
| | | |
| | | public enum TemplateType |
| | | { |
| | | 全部, |
| | | 楼层模板, |
| | | 小区模板, |
| | | 单元模板, |
| | | 单元分区模板, |
| | | 其他 |
| | | } |
| | | //public enum PBS.eModelTemplateType |
| | | //{ |
| | | // 全部, |
| | | // 楼层模板, |
| | | // 小区模板, |
| | | // 单元模板, |
| | | // 单元分区模板, |
| | | // 其他 |
| | | //} |
| | | } |
| | | |
| | | public class AreaViewModel : NodeViewModel, IBaseViewModel |
| | |
| | | [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) |
| | |
| | | } |
| | | |
| | | |
| | | if (param.Contains("层数") && param["层数"] > 0 && template.Type == TemplateType.楼层模板) |
| | | if (param.Contains("层数") && param["层数"] > 0 && template.Type == PBS.eModelTemplateType.Floor) |
| | | { |
| | | RepeatTimes = (int)param["层数"]; |
| | | } |
| | |
| | | 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; |
| | |
| | | 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 => |
| | |
| | | |
| | | |
| | | [Browsable(true)] |
| | | public TemplateType Type { get; set; } |
| | | public PBS.eModelTemplateType Type { get; set; } |
| | | |
| | | |
| | | public Template() |
| | |
| | | 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(); |
| | |
| | | { |
| | | 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; |
| | | } |
| | |
| | | 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) |
| | | { |
| | | |
| | | |
| | |
| | | #endregion |
| | | |
| | | } |
| | | public partial class PropertyForm : UserControl |
| | | /*public partial class PropertyForm : UserControl |
| | | { |
| | | private IBaseViewModel _selectedObject; |
| | | private MapObjectType _selectedType = MapObjectType.全部; |
| | |
| | | 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; |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | public class SelectionSet |
| | | { |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | /* |
| | | partial class PropertyForm |
| | | { |
| | | |
| | |
| | | private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; |
| | | private System.Windows.Forms.ToolStripMenuItem 全选ToolStripMenuItem; |
| | | } |
| | | |
| | | */ |
| | | public class DRange |
| | | { |
| | | |