From 215965cada89ff0f5fd5acebbfe091585dc1b9c4 Mon Sep 17 00:00:00 2001 From: cloudflight <cloudflight@126.com> Date: 星期三, 08 五月 2024 10:40:51 +0800 Subject: [PATCH] 提交2024年5月8日 --- WinfrmUI/Hydro.WinfrmUI.Browser/Viewer.cs | 92 ++++++++++++++++++++-------------------------- 1 files changed, 40 insertions(+), 52 deletions(-) diff --git a/WinfrmUI/Hydro.WinfrmUI.Browser/Viewer.cs b/WinfrmUI/Hydro.WinfrmUI.Browser/Viewer.cs index 88e8cb3..faa675b 100644 --- a/WinfrmUI/Hydro.WinfrmUI.Browser/Viewer.cs +++ b/WinfrmUI/Hydro.WinfrmUI.Browser/Viewer.cs @@ -17,7 +17,7 @@ using System.Text; using System.Windows.Forms; using static Hydro.MapView.MapViewEnum; -using Cursor = System.Windows.Forms.Cursor; + namespace Hydro.WinfrmUI { @@ -1723,6 +1723,22 @@ #region 鏂囦欢宸ュ叿 + public void OpenFile(string filePath) + { + _Template = new Template(); + _Template.network = new MapViewNetWork(); + + + + + // 璇诲彇鏂囦欢鍐呭 + _Network.BuildFromInp(filePath); + _Template.filePath = filePath; + //_filePath = filePath; + SetData(_Template); + + } + private void tool鎵撳紑_ButtonClick(object sender, EventArgs e) { @@ -1748,58 +1764,28 @@ } } } - public void OpenFile(string filePath) - { - _Template = new Template(); - _Template.network = new MapViewNetWork(); + + //private void 鏃х増鎵撳紑ToolStripMenuItem_Click(object sender, EventArgs e) + //{ + // // 鍒涘缓鎵撳紑鏂囦欢瀵硅瘽妗� - { - // 璇诲彇鏂囦欢鍐呭 - _Network.BuildFromInp(filePath); - _Template.filePath = filePath; - //_filePath = filePath; - SetData(_Template); - } - } - private void 鏃х増鎵撳紑ToolStripMenuItem_Click(object sender, EventArgs e) - { - // 鍒涘缓鎵撳紑鏂囦欢瀵硅瘽妗� - OpenFileDialog openFileDialog = new OpenFileDialog(); - openFileDialog.Filter = "INP Files (*.inp)|*.inp|All Files (*.*)|*.*"; - - if (openFileDialog.ShowDialog() == DialogResult.OK) - { - _Template = new Template(); - _Template.network = new MapViewNetWork(); - //_Template.network.use_old = true; - // 鑾峰彇閫変腑鏂囦欢鐨勬枃浠惰矾寰� - string filePath = openFileDialog.FileName; - { - // 璇诲彇鏂囦欢鍐呭 - _Network.BuildFromInp(filePath); - _Template.filePath = filePath; - //_filePath = filePath; - SetData(_Template); - } - } - } - - private void 鎵撳紑鏂囦欢浣嶇疆ToolStripMenuItem_Click(object sender, EventArgs e) - { - if (_filePath == null) return; - FileInfo fi = new FileInfo(_filePath); - Process.Start("explorer.exe", $"/select,\"{_filePath}\""); - //System.Diagnostics.Process.Start("explorer.exe", fi.Directory.FullName); - } - private void EPA涓墦寮�ToolStripMenuItem_Click(object sender, EventArgs e) - { - if (_filePath == null) return; - - - Process.Start(@"epanetH\Epanet2wH.exe", _filePath); - } + // _Template = new Template(); + // _Template.network = new MapViewNetWork(); + // //_Template.network.use_old = true; + // // 鑾峰彇閫変腑鏂囦欢鐨勬枃浠惰矾寰� + // string filePath = openFileDialog.FileName; + // { + // // 璇诲彇鏂囦欢鍐呭 + // _Network.BuildFromInp(filePath); + // _Template.filePath = filePath; + // //_filePath = filePath; + // SetData(_Template); + // } + + //} + private void 淇濆瓨ToolStripMenuItem_Click(object sender, EventArgs e) { if (!_IsEditMode) @@ -3694,9 +3680,11 @@ //form_EditFloors.Show(this); } - - + + #endregion + + } } \ No newline at end of file -- Gitblit v1.9.3