FrmStraighteningResult2.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. using System;
  2. using System.Collections;
  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.Windows.Forms;
  10. using CoreFS.CA06;
  11. using Core.Mes.Client.Comm.Server;
  12. using Core.Mes.Client.Comm.Control;
  13. using Core.StlMes.Client.ZGMil;
  14. using com.steering.mes.zgmil.entity;
  15. using Infragistics.Win.UltraWinGrid;
  16. namespace Core.StlMes.Client.ZGMil.ResultConrtrol
  17. {
  18. public partial class FrmStraighteningResult2 : UserControl
  19. {
  20. private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null;
  21. public FrmStraighteningResult2()
  22. {
  23. InitializeComponent();
  24. GridHelper.InitCardGrid(StraightDataSource2, ultraGrid2);
  25. _grid = this.ultraGrid2;
  26. }
  27. private MilStraighteningResultEntity _StraighPlan = new MilStraighteningResultEntity();
  28. public MilStraighteningResultEntity Value
  29. {
  30. get { return _StraighPlan; }
  31. set
  32. {
  33. if (value != null)
  34. {
  35. _StraighPlan = value;
  36. UpdateData();
  37. }
  38. }
  39. }
  40. private bool isCellSelect = false;
  41. public bool IsCellSelect
  42. {
  43. get { return isCellSelect; }
  44. set { isCellSelect = value; }
  45. }
  46. private void ultraGrid2_CellChange(object sender, CellEventArgs e)
  47. {
  48. this.IsCellSelect = true;
  49. }
  50. public void UpdateData()
  51. {
  52. //来料支数
  53. StraightDataSource2.Rows[0]["InMatNum"] = _StraighPlan.InMatNum;
  54. //矫废支数
  55. StraightDataSource2.Rows[0]["ScrapNum"] = _StraighPlan.ScrapNum;
  56. //合格支数
  57. StraightDataSource2.Rows[0]["QualifiedNum"] = _StraighPlan.QualifiedNum;
  58. //交接班支数
  59. StraightDataSource2.Rows[0]["ChangeNum"] = _StraighPlan.ChangeNum;
  60. //备注
  61. StraightDataSource2.Rows[0]["Remark"] = _StraighPlan.Remark;
  62. //主电机速度
  63. StraightDataSource2.Rows[0]["MainMotorSpeed"] = _StraighPlan.MainMotorSpeed;
  64. //中间偏移量
  65. StraightDataSource2.Rows[0]["MiddleRollerSpace"] = _StraighPlan.MiddleRollerSpace;
  66. //2#主电机速度
  67. StraightDataSource2.Rows[0]["MainMotorSpeed2"] = _StraighPlan.MainMotorSpeed2;
  68. //2#中间偏移量
  69. StraightDataSource2.Rows[0]["MiddleRollerSpace2"] = _StraighPlan.MiddleRollerSpace2;
  70. //吹吸灰时间
  71. StraightDataSource2.Rows[0]["SootBlowingTime"] = _StraighPlan.SootBlowingTime;
  72. //开始时间
  73. StraightDataSource2.Rows[0]["StartTime"] = _StraighPlan.StartTime;
  74. //结时间
  75. StraightDataSource2.Rows[0]["EndTime"] = _StraighPlan.EndTime;
  76. //1‘1#矫直辊上角度
  77. StraightDataSource2.Rows[0]["RollerUpAngle11"] = _StraighPlan.RollerUpAngle11;
  78. //1’1#矫直辊下角度
  79. StraightDataSource2.Rows[0]["RollerDownAngle11"] = _StraighPlan.RollerDownAngle11;
  80. //1‘2#矫直辊上角度
  81. StraightDataSource2.Rows[0]["RollerUpAngle12"] = _StraighPlan.RollerUpAngle12;
  82. //1’2#矫直辊下角度
  83. StraightDataSource2.Rows[0]["RollerDownAngle12"] = _StraighPlan.RollerDownAngle12;
  84. //1‘3#矫直辊上角度
  85. StraightDataSource2.Rows[0]["RollerUpAngle13"] = _StraighPlan.RollerUpAngle13;
  86. //1’3#矫直辊下角度
  87. StraightDataSource2.Rows[0]["RollerDownAngle13"] = _StraighPlan.RollerDownAngle13;
  88. //1‘4#矫直辊上角度
  89. StraightDataSource2.Rows[0]["RollerUpAngle14"] = _StraighPlan.RollerUpAngle14;
  90. //1’4#矫直辊下角度
  91. StraightDataSource2.Rows[0]["RollerDownAngle14"] = _StraighPlan.RollerDownAngle14;
  92. //1‘5#矫直辊上角度
  93. StraightDataSource2.Rows[0]["RollerUpAngle15"] = _StraighPlan.RollerUpAngle15;
  94. //1’5#矫直辊下角度
  95. StraightDataSource2.Rows[0]["RollerDownAngle15"] = _StraighPlan.RollerDownAngle15;
  96. //1‘6#矫直辊上角度
  97. StraightDataSource2.Rows[0]["RollerUpAngle16"] = _StraighPlan.RollerUpAngle16;
  98. //1’6#矫直辊下角度
  99. StraightDataSource2.Rows[0]["RollerDownAngle16"] = _StraighPlan.RollerDownAngle16;
  100. //2‘1#矫直辊上角度
  101. StraightDataSource2.Rows[0]["RollerUpAngle21"] = _StraighPlan.RollerUpAngle21;
  102. //2’1#矫直辊下角度
  103. StraightDataSource2.Rows[0]["RollerDownAngle21"] = _StraighPlan.RollerDownAngle21;
  104. //2‘2#矫直辊上角度
  105. StraightDataSource2.Rows[0]["RollerUpAngle22"] = _StraighPlan.RollerUpAngle22;
  106. //2’2#矫直辊下角度
  107. StraightDataSource2.Rows[0]["RollerDownAngle22"] = _StraighPlan.RollerDownAngle22;
  108. //2‘3#矫直辊上角度
  109. StraightDataSource2.Rows[0]["RollerUpAngle23"] = _StraighPlan.RollerUpAngle23;
  110. //2’3#矫直辊下角度
  111. StraightDataSource2.Rows[0]["RollerDownAngle23"] = _StraighPlan.RollerDownAngle23;
  112. //2‘4#矫直辊上角度
  113. StraightDataSource2.Rows[0]["RollerUpAngle24"] = _StraighPlan.RollerUpAngle24;
  114. //2’4#矫直辊下角度
  115. StraightDataSource2.Rows[0]["RollerDownAngle24"] = _StraighPlan.RollerDownAngle24;
  116. //2‘5#矫直辊上角度
  117. StraightDataSource2.Rows[0]["RollerUpAngle25"] = _StraighPlan.RollerUpAngle25;
  118. //2’5#矫直辊下角度
  119. StraightDataSource2.Rows[0]["RollerDownAngle25"] = _StraighPlan.RollerDownAngle25;
  120. //2‘6#矫直辊上角度
  121. StraightDataSource2.Rows[0]["RollerUpAngle26"] = _StraighPlan.RollerUpAngle26;
  122. //2’6#矫直辊下角度
  123. StraightDataSource2.Rows[0]["RollerDownAngle26"] = _StraighPlan.RollerDownAngle26;
  124. //1‘1#矫直辊间距
  125. StraightDataSource2.Rows[0]["RollerSpace11"] = _StraighPlan.RollerSpace11;
  126. //1’2#矫直辊间距
  127. StraightDataSource2.Rows[0]["RollerSpace12"] = _StraighPlan.RollerSpace12;
  128. //1’3#矫直辊间距
  129. StraightDataSource2.Rows[0]["RollerSpace13"] = _StraighPlan.RollerSpace13;
  130. //2‘1#矫直辊间距
  131. StraightDataSource2.Rows[0]["RollerSpace21"] = _StraighPlan.RollerSpace21;
  132. //2‘2#矫直辊间距
  133. StraightDataSource2.Rows[0]["RollerSpace22"] = _StraighPlan.RollerSpace22;
  134. //2‘3#矫直辊间距
  135. StraightDataSource2.Rows[0]["RollerSpace23"] = _StraighPlan.RollerSpace23;
  136. //1‘操作台矫废支数
  137. StraightDataSource2.Rows[0]["ScrapNum1"] = _StraighPlan.ScrapNum1;
  138. //1‘操作台矫废支数
  139. StraightDataSource2.Rows[0]["QualifiedNum1"] = _StraighPlan.QualifiedNum1;
  140. //2‘操作台矫废支数
  141. StraightDataSource2.Rows[0]["ScrapNum2"] = _StraighPlan.ScrapNum2;
  142. //2’操作台合格支数
  143. StraightDataSource2.Rows[0]["QualifiedNum2"] = _StraighPlan.QualifiedNum2;
  144. }
  145. public void NoUsing1()
  146. {
  147. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle11"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  148. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle12"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  149. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle13"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  150. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle14"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  151. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle15"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  152. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle16"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  153. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle11"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  154. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle12"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  155. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle13"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  156. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle14"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  157. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle15"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  158. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle16"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  159. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace11"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  160. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace12"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  161. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace13"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  162. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["ScrapNum1"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  163. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["QualifiedNum1"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  164. }
  165. public void NoUsing2()
  166. {
  167. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle21"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  168. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle22"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  169. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle23"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  170. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle24"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  171. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle25"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  172. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerUpAngle26"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  173. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle21"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  174. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle22"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  175. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle23"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  176. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle24"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  177. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle25"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  178. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerDownAngle26"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  179. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace21"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  180. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace22"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  181. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["RollerSpace23"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  182. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["ScrapNum2"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  183. //this.ultraGrid2.DisplayLayout.Bands[0].Columns["QualifiedNum2"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled;
  184. }
  185. private void ultraGrid2_CellDataError(object sender, CellDataErrorEventArgs e)
  186. {
  187. e.RaiseErrorEvent = false;
  188. //e.StayInEditMode = true;
  189. bool result = false;
  190. try
  191. {
  192. DateTime.Parse(this.ultraGrid2.Rows[0].Cells["StartTime"].ToString());
  193. result = true;
  194. }
  195. catch
  196. {
  197. }
  198. if (!result)
  199. {
  200. MessageBox.Show("您输入的开始时间格式不正确,请重新输入。", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  201. }
  202. }
  203. }
  204. }