PerforationResult.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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 PerforationResult : UserControl
  19. {
  20. private Infragistics.Win.UltraWinGrid.UltraGrid _grid = null;
  21. public event KeyPressEventHandler GridKeyPress;
  22. public event CellEventHandler GridCellChange;
  23. public PerforationResult()
  24. {
  25. InitializeComponent();
  26. GridHelper.InitCardGrid(PerforationDateSource, ultraGrid1);
  27. _grid = this.ultraGrid1;
  28. }
  29. private MilPerforationResultEntity _feedPlan = new MilPerforationResultEntity();
  30. [Browsable(false)]
  31. [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  32. public MilPerforationResultEntity Value
  33. {
  34. get { return _feedPlan; }
  35. set
  36. {
  37. if (value != null)
  38. {
  39. _feedPlan = value;
  40. UpdateData();
  41. }
  42. }
  43. }
  44. private bool isCellSelect = false;
  45. public bool IsCellSelect
  46. {
  47. get { return isCellSelect; }
  48. set { isCellSelect = value; }
  49. }
  50. private void ultraGrid2_CellChange(object sender, CellEventArgs e)
  51. {
  52. if (GridCellChange != null)
  53. {
  54. GridCellChange(sender, e);
  55. }
  56. this.IsCellSelect = true;
  57. }
  58. public void UpdateData()
  59. {
  60. if (_feedPlan != null)
  61. {
  62. double DbUp = 0;
  63. double DbDown = 0;
  64. double RollerUp = 0;
  65. double RollerDown = 0;
  66. if (!string.IsNullOrEmpty(_feedPlan.DbLoca.ToString()))
  67. {
  68. DbUp = double.Parse(_feedPlan.DbLoca.ToString());
  69. }
  70. if (!string.IsNullOrEmpty(_feedPlan.DbLocaDown.ToString()))
  71. {
  72. DbDown = double.Parse(_feedPlan.DbLocaDown.ToString());
  73. }
  74. if (!string.IsNullOrEmpty(_feedPlan.ZgLocaUp.ToString()))
  75. {
  76. RollerUp = double.Parse(_feedPlan.ZgLocaUp.ToString());
  77. }
  78. if (!string.IsNullOrEmpty(_feedPlan.ZgLocaDown.ToString()))
  79. {
  80. RollerDown = double.Parse(_feedPlan.ZgLocaDown.ToString());
  81. }
  82. //辊距
  83. PerforationDateSource.Rows[0]["roller_space"] = _feedPlan.RollerSpace;
  84. //导距
  85. PerforationDateSource.Rows[0]["guide_space"] = _feedPlan.GuideSpace;
  86. //单倍长度
  87. PerforationDateSource.Rows[0]["front_extending_quantity"] = _feedPlan.FrontExtendingQuantity;
  88. ////计划单倍总支数
  89. PerforationDateSource.Rows[0]["bite_angle"] = _feedPlan.BiteAngle;
  90. PerforationDateSource.Rows[0]["head_diameter"] = _feedPlan.HeadDiameter;
  91. //PerforationDateSource.Rows[0]["ScrapDBNum"] = _feedPlan.ScrapNum;
  92. PerforationDateSource.Rows[0]["roll_motor_speed"] = _feedPlan.RollMotorSpeed;
  93. PerforationDateSource.Rows[0]["guide_disc_motor_speed"] = _feedPlan.GuideDiscMotorSpeed;
  94. //PerforationDateSource.Rows[0]["borax_tank"] = _feedPlan.BoraxTank;
  95. PerforationDateSource.Rows[0]["borax_pressure"] = _feedPlan.BoraxPressure;
  96. PerforationDateSource.Rows[0]["AMOUNT_OF_BORAX"] = _feedPlan.AmountOfBorax;
  97. PerforationDateSource.Rows[0]["CapillarySize"] = _feedPlan.CapillarySize;
  98. //PerforationDateSource.Rows[0]["CAPOLLARY_DIAMETER"] = _feedPlan.CapillarySize;
  99. PerforationDateSource.Rows[0]["capollary_wall_thickness"] = _feedPlan.CapollaryWallThickness;
  100. ////开始时间
  101. //PerforationDateSource.Rows[0]["begin_rolling_temp"] = _feedPlan.BeginRollingTemp;
  102. ////结束时间
  103. //PerforationDateSource.Rows[0]["slab_diameter"] = _feedPlan.SlabDiameter;
  104. //PerforationDateSource.Rows[0]["slab_length"] = _feedPlan.SlabLength;
  105. ////单倍长度
  106. PerforationDateSource.Rows[0]["perforation_num"] = _feedPlan.PerforationNum;
  107. ////计划单倍总支数
  108. PerforationDateSource.Rows[0]["scrap_num"] = _feedPlan.ScrapNum;
  109. //PerforationDateSource.Rows[0]["scrap_reason"] = _feedPlan.ScrapReason;
  110. PerforationDateSource.Rows[0]["start_time"] = _feedPlan.StartTime;
  111. PerforationDateSource.Rows[0]["end_time"] = _feedPlan.EndTime;
  112. PerforationDateSource.Rows[0]["Remark"] = _feedPlan.Remark;
  113. PerforationDateSource.Rows[0]["JzbNum"] = _feedPlan.JzbNum;
  114. PerforationDateSource.Rows[0]["kz_temp"] = _feedPlan.KzTemp;
  115. PerforationDateSource.Rows[0]["dp_gg"] = _feedPlan.DpGg;
  116. PerforationDateSource.Rows[0]["guide_disc_motor_loca"] = _feedPlan.GuideDiscMotorLoca;
  117. PerforationDateSource.Rows[0]["db_loca_up"] = _feedPlan.DbLoca;
  118. ////开始时间
  119. PerforationDateSource.Rows[0]["roll_motor_sjb"] = _feedPlan.RollMotorSjb;
  120. ////结束时间
  121. PerforationDateSource.Rows[0]["zg_zj"] = _feedPlan.ZgZj;
  122. PerforationDateSource.Rows[0]["dt_code"] = _feedPlan.DtCode;
  123. PerforationDateSource.Rows[0]["zg_loca_up"] = _feedPlan.ZgLocaUp;
  124. ////开始时间
  125. PerforationDateSource.Rows[0]["zg_loca_down"] = _feedPlan.ZgLocaDown;
  126. //开轧温度
  127. PerforationDateSource.Rows[0]["beginRollingTemp"] = _feedPlan.BeginRollingTemp;
  128. //交班取消
  129. PerforationDateSource.Rows[0]["CHANGENUMCANCEL"] = "交班取消";
  130. }
  131. }
  132. public void UpdateDataForRack()
  133. {
  134. if (_feedPlan != null)
  135. {
  136. //单倍长度
  137. PerforationDateSource.Rows[0]["front_extending_quantity"] = _feedPlan.FrontExtendingQuantity;
  138. PerforationDateSource.Rows[0]["perforation_num"] = _feedPlan.PerforationNum;
  139. ////计划单倍总支数
  140. PerforationDateSource.Rows[0]["scrap_num"] = _feedPlan.ScrapNum;
  141. PerforationDateSource.Rows[0]["JzbNum"] = _feedPlan.JzbNum;
  142. //交班取消
  143. PerforationDateSource.Rows[0]["CHANGENUMCANCEL"] = "交班取消";
  144. }
  145. }
  146. public void UpdateDataForGuideSpace()
  147. {
  148. if (_feedPlan != null)
  149. {
  150. //导距
  151. PerforationDateSource.Rows[0]["guide_space"] = _feedPlan.GuideSpace;
  152. }
  153. }
  154. public void UpdateDataForRollerSpace()
  155. {
  156. if (_feedPlan != null)
  157. {
  158. //辊距
  159. PerforationDateSource.Rows[0]["roller_space"] = _feedPlan.RollerSpace;
  160. }
  161. }
  162. public void UpdateDateForPrama(MilPerforationResultEntity PerResultEdit)
  163. {
  164. if (PerResultEdit != null)
  165. {
  166. PerforationDateSource.Rows[0]["roller_space"] = PerResultEdit.RollerSpace;
  167. //倍尺数
  168. PerforationDateSource.Rows[0]["guide_space"] = PerResultEdit.GuideSpace;
  169. //单倍长度
  170. PerforationDateSource.Rows[0]["front_extending_quantity"] = PerResultEdit.FrontExtendingQuantity;
  171. ////计划单倍总支数
  172. PerforationDateSource.Rows[0]["bite_angle"] = PerResultEdit.BiteAngle;
  173. PerforationDateSource.Rows[0]["head_diameter"] = PerResultEdit.HeadDiameter;
  174. PerforationDateSource.Rows[0]["roll_motor_speed"] = PerResultEdit.RollMotorSpeed;
  175. PerforationDateSource.Rows[0]["guide_disc_motor_speed"] = PerResultEdit.GuideDiscMotorSpeed;
  176. //PerforationDateSource.Rows[0]["borax_tank"] = PerResultEdit.BoraxTank;
  177. PerforationDateSource.Rows[0]["borax_pressure"] = PerResultEdit.BoraxPressure;
  178. PerforationDateSource.Rows[0]["AMOUNT_OF_BORAX"] = PerResultEdit.AmountOfBorax;
  179. PerforationDateSource.Rows[0]["CapillarySize"] = PerResultEdit.CapillarySize;
  180. //PerforationDateSource.Rows[0]["CAPOLLARY_DIAMETER"] = PerResultEdit.CapillarySize;
  181. PerforationDateSource.Rows[0]["capollary_wall_thickness"] = PerResultEdit.CapollaryWallThickness;
  182. PerforationDateSource.Rows[0]["kz_temp"] = PerResultEdit.KzTemp;
  183. PerforationDateSource.Rows[0]["dp_gg"] = PerResultEdit.DpGg;
  184. PerforationDateSource.Rows[0]["guide_disc_motor_loca"] = PerResultEdit.GuideDiscMotorLoca;
  185. PerforationDateSource.Rows[0]["db_loca_up"] = PerResultEdit.DbLoca;
  186. ////开始时间
  187. PerforationDateSource.Rows[0]["roll_motor_sjb"] = PerResultEdit.RollMotorSjb;
  188. ////结束时间
  189. PerforationDateSource.Rows[0]["zg_zj"] = PerResultEdit.ZgZj;
  190. PerforationDateSource.Rows[0]["dt_code"] = PerResultEdit.DtCode;
  191. PerforationDateSource.Rows[0]["zg_loca_up"] = PerResultEdit.ZgLocaUp;
  192. ////开始时间
  193. PerforationDateSource.Rows[0]["zg_loca_down"] = PerResultEdit.ZgLocaDown;
  194. //开轧温度
  195. PerforationDateSource.Rows[0]["beginRollingTemp"] = PerResultEdit.BeginRollingTemp;
  196. }
  197. }
  198. public void DataClear()
  199. {
  200. //计划上料支数
  201. PerforationDateSource.Rows[0]["result_no"] = "";
  202. //上料支数
  203. PerforationDateSource.Rows[0]["lot_no"] = "";
  204. //上料长度
  205. PerforationDateSource.Rows[0]["stove_no"] = "";
  206. //使用长度
  207. PerforationDateSource.Rows[0]["judge_stove_no"] = "";
  208. //未使用长度
  209. PerforationDateSource.Rows[0]["pline_code"] = "";
  210. //切损去向
  211. PerforationDateSource.Rows[0]["roller_space"] = "";
  212. //倍尺数
  213. PerforationDateSource.Rows[0]["guide_space"] = "";
  214. //单倍长度
  215. PerforationDateSource.Rows[0]["front_extending_quantity"] = "";
  216. //计划单倍总支数
  217. PerforationDateSource.Rows[0]["bite_angle"] = "";
  218. PerforationDateSource.Rows[0]["head_diameter"] = "";
  219. PerforationDateSource.Rows[0]["ScrapDBNum"] = "";
  220. PerforationDateSource.Rows[0]["roll_motor_speed"] = "";
  221. PerforationDateSource.Rows[0]["guide_disc_motor_speed"] = "";
  222. PerforationDateSource.Rows[0]["borax_tank"] = "";
  223. PerforationDateSource.Rows[0]["borax_pressure"] = "";
  224. PerforationDateSource.Rows[0]["capollary_wall_thickness"] = "";
  225. //开始时间
  226. PerforationDateSource.Rows[0]["begin_rolling_temp"] = "";
  227. //结束时间
  228. PerforationDateSource.Rows[0]["slab_diameter"] = "";
  229. PerforationDateSource.Rows[0]["slab_length"] = "";
  230. //单倍长度
  231. PerforationDateSource.Rows[0]["perforation_num"] = "";
  232. //计划单倍总支数
  233. PerforationDateSource.Rows[0]["scrap_num"] = "";
  234. PerforationDateSource.Rows[0]["scrap_reason"] = "";
  235. PerforationDateSource.Rows[0]["start_time"] = "";
  236. PerforationDateSource.Rows[0]["end_time"] = "";
  237. PerforationDateSource.Rows[0]["node_fur_flag"] = "";
  238. PerforationDateSource.Rows[0]["borax_tank"] = "";
  239. PerforationDateSource.Rows[0]["executive_producer"] = "";
  240. PerforationDateSource.Rows[0]["producer_time"] = "";
  241. //开始时间
  242. PerforationDateSource.Rows[0]["producer_tel"] = "";
  243. //结束时间
  244. PerforationDateSource.Rows[0]["remark"] = "";
  245. PerforationDateSource.Rows[0]["col_mode"] = "";
  246. //单倍长度
  247. PerforationDateSource.Rows[0]["col_time"] = "";
  248. //计划单倍总支数
  249. PerforationDateSource.Rows[0]["col_user"] = "";
  250. PerforationDateSource.Rows[0]["col_shift"] = "";
  251. PerforationDateSource.Rows[0]["col_group"] = "";
  252. PerforationDateSource.Rows[0]["jzb_num"] = "";
  253. PerforationDateSource.Rows[0]["kz_temp"] = "";
  254. PerforationDateSource.Rows[0]["dp_gg"] = "";
  255. PerforationDateSource.Rows[0]["guide_disc_motor_loca"] = "";
  256. PerforationDateSource.Rows[0]["db_loca_up"] = "";
  257. //开始时间
  258. PerforationDateSource.Rows[0]["roll_motor_sjb"] = "";
  259. //结束时间
  260. PerforationDateSource.Rows[0]["zg_zj"] = "";
  261. PerforationDateSource.Rows[0]["dt_code"] = "";
  262. PerforationDateSource.Rows[0]["zg_loca_up"] = "";
  263. //开始时间
  264. PerforationDateSource.Rows[0]["zg_loca_down"] = "";
  265. //结束时间
  266. PerforationDateSource.Rows[0]["beginRollingTemp"] = "";
  267. }
  268. private void ultraGrid1_KeyDown(object sender, KeyEventArgs e)
  269. {
  270. }
  271. private void ultraGrid1_KeyPress(object sender, KeyPressEventArgs e)
  272. {
  273. if (e.KeyChar == (char)13)
  274. {
  275. ultraGrid1.PerformAction(UltraGridAction.NextCell);
  276. ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
  277. }
  278. }
  279. private void ultraGrid1_Error(object sender, ErrorEventArgs e)
  280. {
  281. e.Cancel = true;
  282. if (ultraGrid1.ActiveCell.Column.Key == "start_time" || ultraGrid1.ActiveCell.Column.Key == "end_time")
  283. {
  284. MessageBox.Show("请输入完整的时间");
  285. }
  286. }
  287. }
  288. }