回复 2楼 shangsharon
我想点击阀,然后弹出页面,但是没有反应。
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
//using _1;
using _1.Forms;
using System.Threading;
namespace _1
{
public partial class ZH_SIMULATING : Form
{
public static ZH_SIMULATING ZHS = null;//主界面切换
public static 设定值窗口 SDZ = new 设定值窗口();
public static GQ_SIMULATING GQS = new GQ_SIMULATING();
private System.Threading.Timer mytimer;//管道流动时间-线程
System.Timers.Timer t1 = new System.Timers.Timer(1000);//流速时间
public bool loadingstart = false;
public ZH_SIMULATING()
{
InitializeComponent();
ZHS = this;////主界面切换
CheckForIllegalCrossThreadCalls = false;
mytimer = new System.Threading.Timer(new TimerCallback(PipeFlow), null, 0, 200);//设置管道流动时间
//流速时间设置
t1.Elapsed += new System.Timers.ElapsedEventHandler(T1);
t1.AutoReset = true;//设置是执行一次(false)还是一直执行(true)
t1.Enabled = true;
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
//private void button2_Click(object sender, EventArgs e)
//{
//
//SDZ.Show();
//}
private void button5_Click(object sender, EventArgs e)
{
GQ_SIMULATING.GQS.Show();
this.Hide();
}
private void button6_Click(object sender, EventArgs e)
{
}
private bool loadstart = false;
private void PipeFlow(object o)//启动每个管道流动
{
pipe1.Flow_Tick(); pipe2.Flow_Tick();
pipe3.Flow_Tick(); pipe4.Flow_Tick(); pipe5.Flow_Tick(); pipe6.Flow_Tick(); pipe7.Flow_Tick(); pipe8.Flow_Tick(); pipe9.Flow_Tick(); pipe10.Flow_Tick();
pipe11.Flow_Tick(); pipe12.Flow_Tick(); pipe13.Flow_Tick();
pipe14.Flow_Tick(); pipe15.Flow_Tick(); pipe16.Flow_Tick(); pipe17.Flow_Tick(); pipe18.Flow_Tick(); pipe19.Flow_Tick(); pipe20.Flow_Tick();
pipe21.Flow_Tick(); pipe22.Flow_Tick(); pipe23.Flow_Tick(); pipe24.Flow_Tick(); pipe25.Flow_Tick(); pipe26.Flow_Tick(); pipe27.Flow_Tick(); pipe28.Flow_Tick(); pipe29.Flow_Tick(); pipe30.Flow_Tick();
//pipe31.Flow_Tick(); pipe32.Flow_Tick(); pipe33.Flow_Tick(); pipe34.Flow_Tick(); pipe35.Flow_Tick(); pipe36.Flow_Tick(); pipe37.Flow_Tick(); pipe38.Flow_Tick(); pipe39.Flow_Tick(); pipe40.Flow_Tick();
pipe41.Flow_Tick(); pipe42.Flow_Tick(); pipe43.Flow_Tick(); pipe44.Flow_Tick(); pipe45.Flow_Tick(); pipe46.Flow_Tick(); pipe47.Flow_Tick(); pipe48.Flow_Tick(); pipe49.Flow_Tick(); pipe50.Flow_Tick();
pipe51.Flow_Tick(); pipe52.Flow_Tick(); pipe53.Flow_Tick(); pipe54.Flow_Tick(); pipe55.Flow_Tick(); pipe56.Flow_Tick(); pipe57.Flow_Tick(); pipe58.Flow_Tick(); pipe59.Flow_Tick(); pipe60.Flow_Tick();
//pipe61.Flow_Tick(); pipe62.Flow_Tick(); pipe63.Flow_Tick(); pipe64.Flow_Tick(); pipe65.Flow_Tick(); pipe66.Flow_Tick(); pipe67.Flow_Tick(); pipe68.Flow_Tick(); pipe69.Flow_Tick(); pipe70.Flow_Tick();
pipe71.Flow_Tick(); pipe72.Flow_Tick();
}
public void JudgeFlowNo1()//判断进气各个管道流动
{
if (loadstart == true)
{
//pipe2.BFlow = pipe4.BFlow = true;
if (valve14.Open)
{
pipe2.BFlow = pipe4.BFlow = true;
}
else
{
pipe2.BFlow = pipe4.BFlow = false;
}
//if (valve15.Open)
//{
//
pipe2.BFlow = pipe41.BFlow = pipe31.BFlow = pipe5.BFlow = true;
//}
//else
//{
//
pipe2.BFlow = pipe41.BFlow = pipe31.BFlow = pipe5.BFlow = false;
//}
//if (valve5.Open)
//{
//
pipe7.BFlow = pipe9.BFlow = pipe10.BFlow = pipe11.BFlow = true;
//}
//else
//{
//
pipe7.BFlow = pipe9.BFlow = pipe10.BFlow = pipe11.BFlow = false;
//}
}
else
{
pipe2.BFlow = pipe4.BFlow = false ;
}
//else
//{
//
pipe2.BFlow = pipe4.BFlow = false ;
//}
}
private void T1(object sender, System.Timers.ElapsedEventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
SDZ.StartPosition = FormStartPosition.CenterScreen;
SDZ.Show();
}
#region 判断各开关valuechange
private void valve14_valueChanged(object sender, EventArgs e)
{
JudgeFlowNo1();
//Judgev9_v12();//输液臂开关打开前提下 开度开关启用
//speed();//流速计算
}
#endregion
private void button3_Click(object sender, EventArgs e)
{
if (loadstart
== false)
{
loadstart
= true;
button3.Text = "暂停";
//t1.Enabled = true;
}
else
{
loadstart
= false;
button3.Text = "继续";
//t1.Enabled = f alse;
}
JudgeFlowNo1();
}
}
}