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;
|
}
|
|
}
|
}
|
}
|