using Sunny.UI; 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 HRT_Measure.Windows { public partial class FrmWeight : Form { public FrmWeight() { InitializeComponent(); } private Thread thMonitor = null; private bool 配方enable = false; private bool 称重enable = false; private bool 设备enable = false; private void FrmWeight_Load(object sender, EventArgs e) { thMonitor = new Thread(new ThreadStart(ThMonitor)); thMonitor.IsBackground = true; thMonitor.Start(); ClsWeightHelp.is主界面Show = true; } private void ThMonitor() { while (true) { if (!ProgramHelp.Instance.commPLC_M01M02.isPLCConnected) { Thread.Sleep(1000); continue; } if (配方enable) { Thread.Sleep(1000); continue; } try { if (ClsWeightHelp.is主界面Show) { txt净重1.BeginInvoke(new Action(() => { txt净重1.Text = ClsWeightHelp.clsWeight.f净重[0].ToString("f2"); })); txt完成1.BeginInvoke(new Action(() => { txt完成1.Text = ClsWeightHelp.clsWeight.f完成[0].ToString("f2"); })); txt实时1.BeginInvoke(new Action(() => { txt实时1.Text = ClsWeightHelp.clsWeight.f实时[0].ToString("f2"); })); txt数量1.BeginInvoke(new Action(() => { txt数量1.Text = ClsWeightHelp.clsWeight.i数量[0].ToString(); })); txt净重2.BeginInvoke(new Action(() => { txt净重2.Text = ClsWeightHelp.clsWeight.f净重[1].ToString("f2"); })); txt完成1.BeginInvoke(new Action(() => { txt完成2.Text = ClsWeightHelp.clsWeight.f完成[1].ToString("f2"); })); txt实时2.BeginInvoke(new Action(() => { txt实时2.Text = ClsWeightHelp.clsWeight.f实时[1].ToString("f2"); })); txt数量2.BeginInvoke(new Action(() => { txt数量2.Text = ClsWeightHelp.clsWeight.i数量[1].ToString(); })); txt净重3.BeginInvoke(new Action(() => { txt净重3.Text = ClsWeightHelp.clsWeight.f净重[2].ToString("f2"); })); txt完成3.BeginInvoke(new Action(() => { txt完成3.Text = ClsWeightHelp.clsWeight.f完成[2].ToString("f2"); })); txt实时3.BeginInvoke(new Action(() => { txt实时3.Text = ClsWeightHelp.clsWeight.f实时[2].ToString("f2"); })); txt数量3.BeginInvoke(new Action(() => { txt数量3.Text = ClsWeightHelp.clsWeight.i数量[2].ToString(); })); txt净重4.BeginInvoke(new Action(() => { txt净重4.Text = ClsWeightHelp.clsWeight.f净重[3].ToString("f2"); })); txt完成4.BeginInvoke(new Action(() => { txt完成4.Text = ClsWeightHelp.clsWeight.f完成[3].ToString("f2"); })); txt实时4.BeginInvoke(new Action(() => { txt实时4.Text = ClsWeightHelp.clsWeight.f实时[3].ToString("f2"); })); txt数量4.BeginInvoke(new Action(() => { txt数量4.Text = ClsWeightHelp.clsWeight.i数量[3].ToString(); })); txt净重5.BeginInvoke(new Action(() => { txt净重5.Text = ClsWeightHelp.clsWeight.f净重[4].ToString("f2"); })); txt完成5.BeginInvoke(new Action(() => { txt完成5.Text = ClsWeightHelp.clsWeight.f完成[4].ToString("f2"); })); txt实时5.BeginInvoke(new Action(() => { txt实时5.Text = ClsWeightHelp.clsWeight.f实时[4].ToString("f2"); })); txt数量5.BeginInvoke(new Action(() => { txt数量5.Text = ClsWeightHelp.clsWeight.i数量[4].ToString(); })); txt净重6.BeginInvoke(new Action(() => { txt净重6.Text = ClsWeightHelp.clsWeight.f净重[5].ToString("f2"); })); txt完成6.BeginInvoke(new Action(() => { txt完成6.Text = ClsWeightHelp.clsWeight.f完成[5].ToString("f2"); })); txt实时6.BeginInvoke(new Action(() => { txt实时6.Text = ClsWeightHelp.clsWeight.f实时[5].ToString("f2"); })); txt数量6.BeginInvoke(new Action(() => { txt数量6.Text = ClsWeightHelp.clsWeight.i数量[5].ToString(); })); txt净重7.BeginInvoke(new Action(() => { txt净重7.Text = ClsWeightHelp.clsWeight.f净重[6].ToString("f2"); })); txt完成7.BeginInvoke(new Action(() => { txt完成7.Text = ClsWeightHelp.clsWeight.f完成[6].ToString("f2"); })); txt实时7.BeginInvoke(new Action(() => { txt实时7.Text = ClsWeightHelp.clsWeight.f实时[6].ToString("f2"); })); txt数量7.BeginInvoke(new Action(() => { txt数量7.Text = ClsWeightHelp.clsWeight.i数量[6].ToString(); })); txt净重8.BeginInvoke(new Action(() => { txt净重8.Text = ClsWeightHelp.clsWeight.f净重[7].ToString("f2"); })); txt完成8.BeginInvoke(new Action(() => { txt完成8.Text = ClsWeightHelp.clsWeight.f完成[7].ToString("f2"); })); txt实时8.BeginInvoke(new Action(() => { txt实时8.Text = ClsWeightHelp.clsWeight.f实时[7].ToString("f2"); })); txt数量8.BeginInvoke(new Action(() => { txt数量8.Text = ClsWeightHelp.clsWeight.i数量[7].ToString(); })); txt净重9.BeginInvoke(new Action(() => { txt净重9.Text = ClsWeightHelp.clsWeight.f净重[8].ToString("f2"); })); txt完成9.BeginInvoke(new Action(() => { txt完成9.Text = ClsWeightHelp.clsWeight.f完成[8].ToString("f2"); })); txt实时9.BeginInvoke(new Action(() => { txt实时9.Text = ClsWeightHelp.clsWeight.f实时[8].ToString("f2"); })); txt数量9.BeginInvoke(new Action(() => { txt数量9.Text = ClsWeightHelp.clsWeight.i数量[8].ToString(); })); txt净重10.BeginInvoke(new Action(() => { txt净重10.Text = ClsWeightHelp.clsWeight.f净重[9].ToString("f2"); })); txt完成10.BeginInvoke(new Action(() => { txt完成10.Text = ClsWeightHelp.clsWeight.f完成[9].ToString("f2"); })); txt实时10.BeginInvoke(new Action(() => { txt实时10.Text = ClsWeightHelp.clsWeight.f实时[9].ToString("f2"); })); txt数量10.BeginInvoke(new Action(() => { txt数量10.Text = ClsWeightHelp.clsWeight.i数量[9].ToString(); })); } if (ClsWeightHelp.is配方Show) { txt目标重量1.BeginInvoke(new Action(() => { txt目标重量1.Text = ClsWeightHelp.clsWeight.f目标重量[0].ToString("f2"); })); txt正偏差1.BeginInvoke(new Action(() => { txt正偏差1.Text = ClsWeightHelp.clsWeight.f正偏差[0].ToString("f2"); })); txt负偏差1.BeginInvoke(new Action(() => { txt负偏差1.Text = ClsWeightHelp.clsWeight.f负偏差[0].ToString("f2"); })); txt目标重量2.BeginInvoke(new Action(() => { txt目标重量2.Text = ClsWeightHelp.clsWeight.f目标重量[1].ToString("f2"); })); txt正偏差2.BeginInvoke(new Action(() => { txt正偏差2.Text = ClsWeightHelp.clsWeight.f正偏差[1].ToString("f2"); })); txt负偏差2.BeginInvoke(new Action(() => { txt负偏差2.Text = ClsWeightHelp.clsWeight.f负偏差[1].ToString("f2"); })); txt目标重量3.BeginInvoke(new Action(() => { txt目标重量3.Text = ClsWeightHelp.clsWeight.f目标重量[2].ToString("f2"); })); txt正偏差3.BeginInvoke(new Action(() => { txt正偏差3.Text = ClsWeightHelp.clsWeight.f正偏差[2].ToString("f2"); })); txt负偏差3.BeginInvoke(new Action(() => { txt负偏差3.Text = ClsWeightHelp.clsWeight.f负偏差[2].ToString("f2"); })); txt目标重量4.BeginInvoke(new Action(() => { txt目标重量4.Text = ClsWeightHelp.clsWeight.f目标重量[3].ToString("f2"); })); txt正偏差4.BeginInvoke(new Action(() => { txt正偏差4.Text = ClsWeightHelp.clsWeight.f正偏差[3].ToString("f2"); })); txt负偏差4.BeginInvoke(new Action(() => { txt负偏差4.Text = ClsWeightHelp.clsWeight.f负偏差[3].ToString("f2"); })); txt目标重量5.BeginInvoke(new Action(() => { txt目标重量5.Text = ClsWeightHelp.clsWeight.f目标重量[4].ToString("f2"); })); txt正偏差5.BeginInvoke(new Action(() => { txt正偏差5.Text = ClsWeightHelp.clsWeight.f正偏差[4].ToString("f2"); })); txt负偏差5.BeginInvoke(new Action(()=>{txt负偏差5.Text = ClsWeightHelp.clsWeight.f负偏差[4].ToString("f2"); })); txt目标重量6.BeginInvoke(new Action(() => { txt目标重量6.Text = ClsWeightHelp.clsWeight.f目标重量[5].ToString("f2"); })); txt正偏差6.BeginInvoke(new Action(() => { txt正偏差6.Text = ClsWeightHelp.clsWeight.f正偏差[5].ToString("f2"); })); txt负偏差6.BeginInvoke(new Action(() => { txt负偏差6.Text = ClsWeightHelp.clsWeight.f负偏差[5].ToString("f2"); })); txt目标重量7.BeginInvoke(new Action(() => { txt目标重量7.Text = ClsWeightHelp.clsWeight.f目标重量[6].ToString("f2"); })); txt正偏差7.BeginInvoke(new Action(() => { txt正偏差7.Text = ClsWeightHelp.clsWeight.f正偏差[6].ToString("f2"); })); txt负偏差7.BeginInvoke(new Action(() => { txt负偏差7.Text = ClsWeightHelp.clsWeight.f负偏差[6].ToString("f2"); })); txt目标重量8.BeginInvoke(new Action(() => { txt目标重量8.Text = ClsWeightHelp.clsWeight.f目标重量[7].ToString("f2"); })); txt正偏差8.BeginInvoke(new Action(() => { txt正偏差8.Text = ClsWeightHelp.clsWeight.f正偏差[7].ToString("f2"); })); txt负偏差8.BeginInvoke(new Action(() => { txt负偏差8.Text = ClsWeightHelp.clsWeight.f负偏差[7].ToString("f2"); })); txt目标重量9.BeginInvoke(new Action(() => { txt目标重量9.Text = ClsWeightHelp.clsWeight.f目标重量[8].ToString("f2"); })); txt正偏差9.BeginInvoke(new Action(() => { txt正偏差9.Text = ClsWeightHelp.clsWeight.f正偏差[8].ToString("f2"); })); txt负偏差9.BeginInvoke(new Action(() => { txt负偏差9.Text = ClsWeightHelp.clsWeight.f负偏差[8].ToString("f2"); })); txt目标重量10.BeginInvoke(new Action(() => { txt目标重量10.Text = ClsWeightHelp.clsWeight.f目标重量[9].ToString("f2"); })); txt正偏差10.BeginInvoke(new Action(() => { txt正偏差10.Text = ClsWeightHelp.clsWeight.f正偏差[9].ToString("f2"); })); txt负偏差10.BeginInvoke(new Action(() => { txt负偏差10.Text = ClsWeightHelp.clsWeight.f负偏差[9].ToString("f2"); })); txt快加提前量1.BeginInvoke(new Action(() => { txt快加提前量1.Text = ClsWeightHelp.clsWeight.f快加提前量[0].ToString("f2"); })); txt慢加提前量1.BeginInvoke(new Action(() => { txt慢加提前量1.Text = ClsWeightHelp.clsWeight.f慢加提前量[0].ToString("f2"); })); txt阈值1.BeginInvoke(new Action(() => { txt阈值1.Text = ClsWeightHelp.clsWeight.f阈值[0].ToString("f2"); })); txt快加提前量2.BeginInvoke(new Action(() => { txt快加提前量2.Text = ClsWeightHelp.clsWeight.f快加提前量[1].ToString("f2"); })); txt慢加提前量2.BeginInvoke(new Action(() => { txt慢加提前量2.Text = ClsWeightHelp.clsWeight.f慢加提前量[1].ToString("f2"); })); txt阈值2.BeginInvoke(new Action(() => { txt阈值2.Text = ClsWeightHelp.clsWeight.f阈值[1].ToString("f2"); })); txt快加提前量3.BeginInvoke(new Action(() => { txt快加提前量3.Text = ClsWeightHelp.clsWeight.f快加提前量[2].ToString("f2"); })); txt慢加提前量3.BeginInvoke(new Action(() => { txt慢加提前量3.Text = ClsWeightHelp.clsWeight.f慢加提前量[2].ToString("f2"); })); txt阈值3.BeginInvoke(new Action(() => { txt阈值3.Text = ClsWeightHelp.clsWeight.f阈值[2].ToString("f2"); })); txt快加提前量4.BeginInvoke(new Action(() => { txt快加提前量4.Text = ClsWeightHelp.clsWeight.f快加提前量[3].ToString("f2"); })); txt慢加提前量4.BeginInvoke(new Action(() => { txt慢加提前量4.Text = ClsWeightHelp.clsWeight.f慢加提前量[3].ToString("f2"); })); txt阈值4.BeginInvoke(new Action(() => { txt阈值4.Text = ClsWeightHelp.clsWeight.f阈值[3].ToString("f2"); })); txt快加提前量5.BeginInvoke(new Action(() => { txt快加提前量5.Text = ClsWeightHelp.clsWeight.f快加提前量[4].ToString("f2"); })); txt慢加提前量5.BeginInvoke(new Action(() => { txt慢加提前量5.Text = ClsWeightHelp.clsWeight.f慢加提前量[4].ToString("f2"); })); txt阈值5.BeginInvoke(new Action(() => { txt阈值5.Text = ClsWeightHelp.clsWeight.f阈值[4].ToString("f2"); })); txt快加提前量6.BeginInvoke(new Action(() => { txt快加提前量6.Text = ClsWeightHelp.clsWeight.f快加提前量[5].ToString("f2"); })); txt慢加提前量6.BeginInvoke(new Action(() => { txt慢加提前量6.Text = ClsWeightHelp.clsWeight.f慢加提前量[5].ToString("f2"); })); txt阈值6.BeginInvoke(new Action(() => { txt阈值6.Text = ClsWeightHelp.clsWeight.f阈值[5].ToString("f2"); })); txt快加提前量7.BeginInvoke(new Action(() => { txt快加提前量7.Text = ClsWeightHelp.clsWeight.f快加提前量[6].ToString("f2"); })); txt慢加提前量7.BeginInvoke(new Action(() => { txt慢加提前量7.Text = ClsWeightHelp.clsWeight.f慢加提前量[6].ToString("f2"); })); txt阈值7.BeginInvoke(new Action(() => { txt阈值7.Text = ClsWeightHelp.clsWeight.f阈值[6].ToString("f2"); })); txt快加提前量8.BeginInvoke(new Action(() => { txt快加提前量8.Text = ClsWeightHelp.clsWeight.f快加提前量[7].ToString("f2"); })); txt慢加提前量8.BeginInvoke(new Action(() => { txt慢加提前量8.Text = ClsWeightHelp.clsWeight.f慢加提前量[7].ToString("f2"); })); txt阈值8.BeginInvoke(new Action(() => { txt阈值8.Text = ClsWeightHelp.clsWeight.f阈值[7].ToString("f2"); })); txt快加提前量9.BeginInvoke(new Action(() => { txt快加提前量9.Text = ClsWeightHelp.clsWeight.f快加提前量[8].ToString("f2"); })); txt慢加提前量9.BeginInvoke(new Action(() => { txt慢加提前量9.Text = ClsWeightHelp.clsWeight.f慢加提前量[8].ToString("f2"); })); txt阈值9.BeginInvoke(new Action(() => { txt阈值9.Text = ClsWeightHelp.clsWeight.f阈值[8].ToString("f2"); })); txt快加提前量10.BeginInvoke(new Action(() => { txt快加提前量10.Text = ClsWeightHelp.clsWeight.f快加提前量[9].ToString("f2"); })); txt慢加提前量10.BeginInvoke(new Action(() => { txt慢加提前量10.Text = ClsWeightHelp.clsWeight.f慢加提前量[9].ToString("f2"); })); txt阈值10.BeginInvoke(new Action(() => { txt阈值10.Text = ClsWeightHelp.clsWeight.f阈值[9].ToString("f2"); })); } if (ClsWeightHelp.is设备Show) { txt快加速度1.BeginInvoke(new Action(() => { txt快加速度1.Text = ClsWeightHelp.clsWeight.i快加速度[0].ToString(); })); txt慢加速度1.BeginInvoke(new Action(() => { txt慢加速度1.Text = ClsWeightHelp.clsWeight.i慢加速度[0].ToString(); })); txt补料速度1.BeginInvoke(new Action(() => { txt补料速度1.Text = ClsWeightHelp.clsWeight.i补料速度[0].ToString(); })); txt快加速度2.BeginInvoke(new Action(() => { txt快加速度2.Text = ClsWeightHelp.clsWeight.i快加速度[1].ToString(); })); txt慢加速度2.BeginInvoke(new Action(() => { txt慢加速度2.Text = ClsWeightHelp.clsWeight.i慢加速度[1].ToString(); })); txt补料速度2.BeginInvoke(new Action(() => { txt补料速度2.Text = ClsWeightHelp.clsWeight.i补料速度[1].ToString(); })); txt快加速度3.BeginInvoke(new Action(() => { txt快加速度3.Text = ClsWeightHelp.clsWeight.i快加速度[2].ToString(); })); txt慢加速度3.BeginInvoke(new Action(() => { txt慢加速度3.Text = ClsWeightHelp.clsWeight.i慢加速度[2].ToString(); })); txt补料速度3.BeginInvoke(new Action(() => { txt补料速度3.Text = ClsWeightHelp.clsWeight.i补料速度[2].ToString(); })); txt快加速度4.BeginInvoke(new Action(() => { txt快加速度4.Text = ClsWeightHelp.clsWeight.i快加速度[3].ToString(); })); txt慢加速度4.BeginInvoke(new Action(() => { txt慢加速度4.Text = ClsWeightHelp.clsWeight.i慢加速度[3].ToString(); })); txt补料速度4.BeginInvoke(new Action(() => { txt补料速度4.Text = ClsWeightHelp.clsWeight.i补料速度[3].ToString(); })); txt快加速度5.BeginInvoke(new Action(() => { txt快加速度5.Text = ClsWeightHelp.clsWeight.i快加速度[4].ToString(); })); txt慢加速度5.BeginInvoke(new Action(() => { txt慢加速度5.Text = ClsWeightHelp.clsWeight.i慢加速度[4].ToString(); })); txt补料速度5.BeginInvoke(new Action(() => { txt补料速度5.Text = ClsWeightHelp.clsWeight.i补料速度[4].ToString(); })); txt快加速度6.BeginInvoke(new Action(() => { txt快加速度6.Text = ClsWeightHelp.clsWeight.i快加速度[5].ToString(); })); txt慢加速度6.BeginInvoke(new Action(() => { txt慢加速度6.Text = ClsWeightHelp.clsWeight.i慢加速度[5].ToString(); })); txt补料速度6.BeginInvoke(new Action(() => { txt补料速度6.Text = ClsWeightHelp.clsWeight.i补料速度[5].ToString(); })); txt快加速度7.BeginInvoke(new Action(() => { txt快加速度7.Text = ClsWeightHelp.clsWeight.i快加速度[6].ToString(); })); txt慢加速度7.BeginInvoke(new Action(() => { txt慢加速度7.Text = ClsWeightHelp.clsWeight.i慢加速度[6].ToString(); })); txt补料速度7.BeginInvoke(new Action(() => { txt补料速度7.Text = ClsWeightHelp.clsWeight.i补料速度[6].ToString(); })); txt快加速度7.BeginInvoke(new Action(() => { txt快加速度8.Text = ClsWeightHelp.clsWeight.i快加速度[7].ToString(); })); txt慢加速度8.BeginInvoke(new Action(() => { txt慢加速度8.Text = ClsWeightHelp.clsWeight.i慢加速度[7].ToString(); })); txt补料速度8.BeginInvoke(new Action(() => { txt补料速度8.Text = ClsWeightHelp.clsWeight.i补料速度[7].ToString(); })); txt快加速度9.BeginInvoke(new Action(() => { txt快加速度9.Text = ClsWeightHelp.clsWeight.i快加速度[8].ToString(); })); txt慢加速度9.BeginInvoke(new Action(() => { txt慢加速度9.Text = ClsWeightHelp.clsWeight.i慢加速度[8].ToString(); })); txt补料速度9.BeginInvoke(new Action(() => { txt补料速度9.Text = ClsWeightHelp.clsWeight.i补料速度[8].ToString(); })); txt快加速度10.BeginInvoke(new Action(() => { txt快加速度10.Text = ClsWeightHelp.clsWeight.i快加速度[9].ToString(); })); txt慢加速度10.BeginInvoke(new Action(() => { txt慢加速度10.Text = ClsWeightHelp.clsWeight.i慢加速度[9].ToString(); })); txt补料速度10.BeginInvoke(new Action(() => { txt补料速度10.Text = ClsWeightHelp.clsWeight.i补料速度[9].ToString(); })); txt稳定检测时间1.BeginInvoke(new Action(() => { txt稳定检测时间1.Text = ClsWeightHelp.clsWeight.i稳定检测时间[0].ToString(); })); txt快加禁止比较时间1.BeginInvoke(new Action(() => { txt快加禁止比较时间1.Text = ClsWeightHelp.clsWeight.i快加禁止比较时间[0].ToString(); })); txt慢加禁止比较时间1.BeginInvoke(new Action(() => { txt慢加禁止比较时间1.Text = ClsWeightHelp.clsWeight.i慢加禁止比较时间[0].ToString(); })); txt稳定检测时间2.BeginInvoke(new Action(() => { txt稳定检测时间2.Text = ClsWeightHelp.clsWeight.i稳定检测时间[1].ToString(); })); txt快加禁止比较时间2.BeginInvoke(new Action(() => { txt快加禁止比较时间2.Text = ClsWeightHelp.clsWeight.i快加禁止比较时间[1].ToString(); })); txt慢加禁止比较时间2.BeginInvoke(new Action(() => { txt慢加禁止比较时间2.Text = ClsWeightHelp.clsWeight.i慢加禁止比较时间[1].ToString(); })); txt稳定检测时间3.BeginInvoke(new Action(() => { txt稳定检测时间3.Text = ClsWeightHelp.clsWeight.i稳定检测时间[2].ToString(); })); txt快加禁止比较时间3.BeginInvoke(new Action(() => { txt快加禁止比较时间3.Text = ClsWeightHelp.clsWeight.i快加禁止比较时间[2].ToString(); })); txt慢加禁止比较时间3.BeginInvoke(new Action(() => { txt慢加禁止比较时间3.Text = ClsWeightHelp.clsWeight.i慢加禁止比较时间[2].ToString(); })); txt稳定检测时间4.BeginInvoke(new Action(() => { txt稳定检测时间4.Text = ClsWeightHelp.clsWeight.i稳定检测时间[3].ToString(); })); txt快加禁止比较时间4.BeginInvoke(new Action(() => { txt快加禁止比较时间4.Text = ClsWeightHelp.clsWeight.i快加禁止比较时间[3].ToString(); })); txt慢加禁止比较时间4.BeginInvoke(new Action(() => { txt慢加禁止比较时间4.Text = ClsWeightHelp.clsWeight.i慢加禁止比较时间[3].ToString(); })); txt稳定检测时间5.BeginInvoke(new Action(() => {txt稳定检测时间5.Text = ClsWeightHelp.clsWeight.i稳定检测时间[4].ToString(); })); txt快加禁止比较时间5.BeginInvoke(new Action(() => { txt快加禁止比较时间5.Text = ClsWeightHelp.clsWeight.i快加禁止比较时间[4].ToString(); })); txt慢加禁止比较时间5.BeginInvoke(new Action(() => { txt慢加禁止比较时间5.Text = ClsWeightHelp.clsWeight.i慢加禁止比较时间[4].ToString(); })); txt稳定检测时间6.BeginInvoke(new Action(() => { txt稳定检测时间6.Text = ClsWeightHelp.clsWeight.i稳定检测时间[5].ToString(); })); txt快加禁止比较时间6.BeginInvoke(new Action(() => { txt快加禁止比较时间6.Text = ClsWeightHelp.clsWeight.i快加禁止比较时间[5].ToString(); })); txt慢加禁止比较时间6.BeginInvoke(new Action(() => { txt慢加禁止比较时间6.Text = ClsWeightHelp.clsWeight.i慢加禁止比较时间[5].ToString(); })); txt稳定检测时间7.BeginInvoke(new Action(() => { txt稳定检测时间7.Text = ClsWeightHelp.clsWeight.i稳定检测时间[6].ToString(); })); txt快加禁止比较时间7.BeginInvoke(new Action(() => { txt快加禁止比较时间7.Text = ClsWeightHelp.clsWeight.i快加禁止比较时间[6].ToString(); })); txt慢加禁止比较时间7.BeginInvoke(new Action(() => { txt慢加禁止比较时间7.Text = ClsWeightHelp.clsWeight.i慢加禁止比较时间[6].ToString(); })); txt稳定检测时间8.BeginInvoke(new Action(() => { txt稳定检测时间8.Text = ClsWeightHelp.clsWeight.i稳定检测时间[7].ToString(); })); txt快加禁止比较时间8.BeginInvoke(new Action(() => { txt快加禁止比较时间8.Text = ClsWeightHelp.clsWeight.i快加禁止比较时间[7].ToString(); })); txt慢加禁止比较时间8.BeginInvoke(new Action(() => { txt慢加禁止比较时间8.Text = ClsWeightHelp.clsWeight.i慢加禁止比较时间[7].ToString(); })); txt稳定检测时间9.BeginInvoke(new Action(() => { txt稳定检测时间9.Text = ClsWeightHelp.clsWeight.i稳定检测时间[8].ToString(); })); txt快加禁止比较时间9.BeginInvoke(new Action(() => { txt快加禁止比较时间9.Text = ClsWeightHelp.clsWeight.i快加禁止比较时间[8].ToString(); })); txt慢加禁止比较时间9.BeginInvoke(new Action(() => { txt慢加禁止比较时间9.Text = ClsWeightHelp.clsWeight.i慢加禁止比较时间[8].ToString(); })); txt稳定检测时间10.BeginInvoke(new Action(() => { txt稳定检测时间10.Text = ClsWeightHelp.clsWeight.i稳定检测时间[9].ToString(); })); txt快加禁止比较时间10.BeginInvoke(new Action(() => { txt快加禁止比较时间10.Text = ClsWeightHelp.clsWeight.i快加禁止比较时间[9].ToString(); })); txt慢加禁止比较时间10.BeginInvoke(new Action(() => { txt慢加禁止比较时间10.Text = ClsWeightHelp.clsWeight.i慢加禁止比较时间[9].ToString(); })); txt补加禁止比较时间1.BeginInvoke(new Action(() => { txt补加禁止比较时间1.Text = ClsWeightHelp.clsWeight.i补加禁止比较时间[0].ToString(); })); txt完成动作执行时间1.BeginInvoke(new Action(() => { txt完成动作执行时间1.Text = ClsWeightHelp.clsWeight.i完成动作执行时间[0].ToString(); })); txt补加禁止比较时间2.BeginInvoke(new Action(() => { txt补加禁止比较时间2.Text = ClsWeightHelp.clsWeight.i补加禁止比较时间[1].ToString(); })); txt完成动作执行时间2.BeginInvoke(new Action(() => { txt完成动作执行时间2.Text = ClsWeightHelp.clsWeight.i完成动作执行时间[1].ToString(); })); txt补加禁止比较时间3.BeginInvoke(new Action(() => { txt补加禁止比较时间3.Text = ClsWeightHelp.clsWeight.i补加禁止比较时间[2].ToString(); })); txt完成动作执行时间3.BeginInvoke(new Action(() => { txt完成动作执行时间3.Text = ClsWeightHelp.clsWeight.i完成动作执行时间[2].ToString(); })); txt补加禁止比较时间4.BeginInvoke(new Action(() => { txt补加禁止比较时间4.Text = ClsWeightHelp.clsWeight.i补加禁止比较时间[3].ToString(); })); txt完成动作执行时间4.BeginInvoke(new Action(() => { txt完成动作执行时间4.Text = ClsWeightHelp.clsWeight.i完成动作执行时间[3].ToString(); })); txt补加禁止比较时间5.BeginInvoke(new Action(() => { txt补加禁止比较时间5.Text = ClsWeightHelp.clsWeight.i补加禁止比较时间[4].ToString(); })); txt完成动作执行时间5.BeginInvoke(new Action(() => { txt完成动作执行时间5.Text = ClsWeightHelp.clsWeight.i完成动作执行时间[4].ToString(); })); txt补加禁止比较时间6.BeginInvoke(new Action(() => { txt补加禁止比较时间6.Text = ClsWeightHelp.clsWeight.i补加禁止比较时间[5].ToString(); })); txt完成动作执行时间6.BeginInvoke(new Action(() => { txt完成动作执行时间6.Text = ClsWeightHelp.clsWeight.i完成动作执行时间[5].ToString(); })); txt补加禁止比较时间7.BeginInvoke(new Action(() => { txt补加禁止比较时间7.Text = ClsWeightHelp.clsWeight.i补加禁止比较时间[6].ToString(); })); txt完成动作执行时间7.BeginInvoke(new Action(() => { txt完成动作执行时间7.Text = ClsWeightHelp.clsWeight.i完成动作执行时间[6].ToString(); })); txt补加禁止比较时间8.BeginInvoke(new Action(() => { txt补加禁止比较时间8.Text = ClsWeightHelp.clsWeight.i补加禁止比较时间[7].ToString(); })); txt完成动作执行时间8.BeginInvoke(new Action(() => { txt完成动作执行时间8.Text = ClsWeightHelp.clsWeight.i完成动作执行时间[7].ToString(); })); txt补加禁止比较时间9.BeginInvoke(new Action(() => { txt补加禁止比较时间9.Text = ClsWeightHelp.clsWeight.i补加禁止比较时间[8].ToString(); })); txt完成动作执行时间9.BeginInvoke(new Action(() => { txt完成动作执行时间9.Text = ClsWeightHelp.clsWeight.i完成动作执行时间[8].ToString(); })); txt补加禁止比较时间10.BeginInvoke(new Action(() => { txt补加禁止比较时间10.Text = ClsWeightHelp.clsWeight.i补加禁止比较时间[9].ToString(); })); txt完成动作执行时间10.BeginInvoke(new Action(() => { txt完成动作执行时间10.Text = ClsWeightHelp.clsWeight.i完成动作执行时间[9].ToString(); })); } if (ClsWeightHelp.is称重Show) { txt零点跟踪范围.BeginInvoke(new Action(() => { txt零点跟踪范围.Text = ClsWeightHelp.clsWeight.f零点跟踪范围.ToString("f2"); })); txt总稳定检测时间.BeginInvoke(new Action(() => { txt总稳定检测时间.Text = ClsWeightHelp.clsWeight.f稳定检测时间总.ToString("f2"); })); txt零点跟踪速率.BeginInvoke(new Action(() => { txt零点跟踪速率.Text = ClsWeightHelp.clsWeight.i零点跟踪速率.ToString(); })); txt稳定检测范围.BeginInvoke(new Action(() => { txt稳定检测范围.Text = ClsWeightHelp.clsWeight.i稳定检测范围.ToString(); })); txt预处理滤波强度.BeginInvoke(new Action(() => { txt预处理滤波强度.Text = ClsWeightHelp.clsWeight.i预处理滤波强度.ToString(); })); txt预处理滤波系数.BeginInvoke(new Action(() => { txt预处理滤波系数.Text = ClsWeightHelp.clsWeight.i预处理滤波系数.ToString(); })); txt静态滤波防抖动.BeginInvoke(new Action(() => { txt静态滤波防抖动.Text = ClsWeightHelp.clsWeight.i静态滤波防抖动.ToString(); })); txt静态采样频率.BeginInvoke(new Action(() => { txt静态采样频率.Text = ClsWeightHelp.clsWeight.i静态采样频率.ToString(); })); txt静态滤波强度.BeginInvoke(new Action(() => { txt静态滤波强度.Text = ClsWeightHelp.clsWeight.i静态滤波强度.ToString(); })); txt静态滤波收敛.BeginInvoke(new Action(() => { txt静态滤波收敛.Text = ClsWeightHelp.clsWeight.i静态滤波收敛.ToString(); })); } } catch (Exception) { } Thread.Sleep(100); } } private void switch配方写入开关_ValueChanged(object sender, bool value) { 配方enable = value; } private void switch称重总开关_ValueChanged(object sender, bool value) { 称重enable = value; } private void switch设备写入开关_ValueChanged(object sender, bool value) { 设备enable = value; } private void btn配方写入通道(object sender, EventArgs e) { var btn = (UISymbolButton)sender; switch(btn.Name) { case "btn配方写入通道1": break; } } private void btn称重写入_Click(object sender, EventArgs e) { } private void btn设备写入通道1_Click(object sender, EventArgs e) { var btn = (UISymbolButton)sender; switch (btn.Name) { case "btn设备写入通道1": break; } } private void uiTabControl1_SelectedIndexChanged(object sender, EventArgs e) { ClsWeightHelp.is主界面Show = false; ClsWeightHelp.is配方Show = false; ClsWeightHelp.is设备Show = false; ClsWeightHelp.is称重Show = false; switch (uiTabControl1.SelectedIndex) { case 0: ClsWeightHelp.is主界面Show = true; break; case 1: ClsWeightHelp.is配方Show = true; break; case 2: ClsWeightHelp.is设备Show = true; break; case 3: ClsWeightHelp.is称重Show = true; break; } } } }