FrmWeight.cs 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. using Sunny.UI;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. namespace HRT_Measure.Windows
  13. {
  14. public partial class FrmWeight : Form
  15. {
  16. public FrmWeight()
  17. {
  18. InitializeComponent();
  19. }
  20. private Thread thMonitor = null;
  21. private bool 配方enable = false;
  22. private bool 称重enable = false;
  23. private bool 设备enable = false;
  24. private void FrmWeight_Load(object sender, EventArgs e)
  25. {
  26. thMonitor = new Thread(new ThreadStart(ThMonitor));
  27. thMonitor.IsBackground = true;
  28. thMonitor.Start();
  29. ClsWeightHelp.is主界面Show = true;
  30. }
  31. private void ThMonitor()
  32. {
  33. while (true)
  34. {
  35. if (!ProgramHelp.Instance.commPLC_M01M02.isPLCConnected)
  36. {
  37. Thread.Sleep(1000);
  38. continue;
  39. }
  40. if (配方enable)
  41. {
  42. Thread.Sleep(1000);
  43. continue;
  44. }
  45. try
  46. {
  47. if (ClsWeightHelp.is主界面Show)
  48. {
  49. 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(); }));
  50. 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(); }));
  51. 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(); }));
  52. 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(); }));
  53. 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(); }));
  54. 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(); }));
  55. 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(); }));
  56. 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(); }));
  57. 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(); }));
  58. 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(); }));
  59. }
  60. if (ClsWeightHelp.is配方Show)
  61. {
  62. 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"); }));
  63. 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"); }));
  64. 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"); }));
  65. 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"); }));
  66. 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"); }));
  67. 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"); }));
  68. 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"); }));
  69. 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"); }));
  70. 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"); }));
  71. 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"); }));
  72. 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"); }));
  73. 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"); }));
  74. 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"); }));
  75. 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"); }));
  76. 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"); }));
  77. 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"); }));
  78. 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"); }));
  79. 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"); }));
  80. 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"); }));
  81. 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"); }));
  82. }
  83. if (ClsWeightHelp.is设备Show)
  84. {
  85. 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(); }));
  86. 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(); }));
  87. 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(); }));
  88. 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(); }));
  89. 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(); }));
  90. 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(); }));
  91. 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(); }));
  92. 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(); }));
  93. 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(); }));
  94. 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(); }));
  95. 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(); }));
  96. 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(); }));
  97. 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(); }));
  98. 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(); }));
  99. 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(); }));
  100. 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(); }));
  101. 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(); }));
  102. 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(); }));
  103. 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(); }));
  104. 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(); }));
  105. 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(); }));
  106. 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(); }));
  107. 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(); }));
  108. 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(); }));
  109. 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(); }));
  110. 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(); }));
  111. 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(); }));
  112. 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(); }));
  113. 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(); }));
  114. 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(); }));
  115. }
  116. if (ClsWeightHelp.is称重Show)
  117. {
  118. txt零点跟踪范围.BeginInvoke(new Action(() => { txt零点跟踪范围.Text = ClsWeightHelp.clsWeight.f零点跟踪范围.ToString("f2"); })); txt总稳定检测时间.BeginInvoke(new Action(() => { txt总稳定检测时间.Text = ClsWeightHelp.clsWeight.f稳定检测时间总.ToString("f2"); }));
  119. txt零点跟踪速率.BeginInvoke(new Action(() => { txt零点跟踪速率.Text = ClsWeightHelp.clsWeight.i零点跟踪速率.ToString(); })); txt稳定检测范围.BeginInvoke(new Action(() => { txt稳定检测范围.Text = ClsWeightHelp.clsWeight.i稳定检测范围.ToString(); }));
  120. txt预处理滤波强度.BeginInvoke(new Action(() => { txt预处理滤波强度.Text = ClsWeightHelp.clsWeight.i预处理滤波强度.ToString(); })); txt预处理滤波系数.BeginInvoke(new Action(() => { txt预处理滤波系数.Text = ClsWeightHelp.clsWeight.i预处理滤波系数.ToString(); }));
  121. txt静态滤波防抖动.BeginInvoke(new Action(() => { txt静态滤波防抖动.Text = ClsWeightHelp.clsWeight.i静态滤波防抖动.ToString(); })); txt静态采样频率.BeginInvoke(new Action(() => { txt静态采样频率.Text = ClsWeightHelp.clsWeight.i静态采样频率.ToString(); }));
  122. txt静态滤波强度.BeginInvoke(new Action(() => { txt静态滤波强度.Text = ClsWeightHelp.clsWeight.i静态滤波强度.ToString(); })); txt静态滤波收敛.BeginInvoke(new Action(() => { txt静态滤波收敛.Text = ClsWeightHelp.clsWeight.i静态滤波收敛.ToString(); }));
  123. }
  124. }
  125. catch (Exception)
  126. {
  127. }
  128. Thread.Sleep(100);
  129. }
  130. }
  131. private void switch配方写入开关_ValueChanged(object sender, bool value)
  132. {
  133. 配方enable = value;
  134. }
  135. private void switch称重总开关_ValueChanged(object sender, bool value)
  136. {
  137. 称重enable = value;
  138. }
  139. private void switch设备写入开关_ValueChanged(object sender, bool value)
  140. {
  141. 设备enable = value;
  142. }
  143. private void btn配方写入通道(object sender, EventArgs e)
  144. {
  145. var btn = (UISymbolButton)sender;
  146. switch(btn.Name)
  147. {
  148. case "btn配方写入通道1":
  149. break;
  150. }
  151. }
  152. private void btn称重写入_Click(object sender, EventArgs e)
  153. {
  154. }
  155. private void btn设备写入通道1_Click(object sender, EventArgs e)
  156. {
  157. var btn = (UISymbolButton)sender;
  158. switch (btn.Name)
  159. {
  160. case "btn设备写入通道1":
  161. break;
  162. }
  163. }
  164. private void uiTabControl1_SelectedIndexChanged(object sender, EventArgs e)
  165. {
  166. ClsWeightHelp.is主界面Show = false;
  167. ClsWeightHelp.is配方Show = false;
  168. ClsWeightHelp.is设备Show = false;
  169. ClsWeightHelp.is称重Show = false;
  170. switch (uiTabControl1.SelectedIndex)
  171. {
  172. case 0:
  173. ClsWeightHelp.is主界面Show = true;
  174. break;
  175. case 1:
  176. ClsWeightHelp.is配方Show = true;
  177. break;
  178. case 2:
  179. ClsWeightHelp.is设备Show = true;
  180. break;
  181. case 3:
  182. ClsWeightHelp.is称重Show = true;
  183. break;
  184. }
  185. }
  186. }
  187. }