cloudflight
2023-12-02 c0f9915265878e56e91ee97f7f8d925db1e12626
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using CloudWaterNetwork;
using CommonBase;
using Hydro.MapUI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace TestForm
{
    public partial class Form1 : Form
    {
        
        public Form1()
        {
            InitializeComponent();
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
            GlobalObject.PropertyForm = new PropertyForm();
            GlobalObject.PropertyForm.Dock = DockStyle.Right;
            this.Controls.Add(GlobalObject.PropertyForm);
            
            GlobalObject.map = map;
        
 
        }
 
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            //var list=map._Template.network.Calc();
            //if (_selectTemp == null) return;
            var _selectTemp = map._Template;
            map.toolStripButton_save_ButtonClick(1, null);
 
            ProgressForm_计算 progressForm = null;
            progressForm = new ProgressForm_计算();
            progressForm.StartPosition = FormStartPosition.Manual;
 
            progressForm.Location = new Point(this.Left + this.Width / 2 - progressForm.Width / 2, this.Top + this.Height / 2 - progressForm.Height / 2); // 计算新窗口的位置
            new Thread(() =>
            {
                progressForm.ShowDialog();
            }).Start();
 
            lock (GlobalProgress.Instance)
            {
                GlobalProgress.stateText = "计算中";
                GlobalProgress.MaxNum = 1;
                GlobalProgress.CurrentNum = 0;
                GlobalProgress.Hide = false;
                GlobalProgress.NeedStop = false;
                GlobalProgress.ChildMaxNum = 100;
                GlobalProgress.ChildCurrentNum = 0;
            }
 
 
 
 
 
 
            var net = _selectTemp.network;
            net.Calc(_selectTemp.FullPath);
            lock (GlobalProgress.Instance)
            {
                GlobalProgress.NeedStop = true;
            }
 
        }
    }
}