MeasureMsgManage.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. using MeasureThread;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Drawing;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows.Forms;
  9. namespace HOZProject
  10. {
  11. public class MeasureMsgManage
  12. {
  13. /// <summary>
  14. /// 线程消息处理,显示内容
  15. /// </summary>
  16. /// <param name="formHOZ">主窗体对象</param>
  17. /// <param name="args">消息对象</param>
  18. public static void ShowMsgContent(FormHOZMain formHOZ, ThreadStatusEventArgs args)
  19. {
  20. switch (args.Step_Code)
  21. {
  22. case "1-3":
  23. //设置图像
  24. formHOZ.pbImage.Image = null;
  25. //流程内容
  26. formHOZ.lblFlowContent.Text = "1-3";
  27. break;
  28. default:
  29. //设置图像
  30. formHOZ.pbImage.Image = null;//new Bitmap(@"C:\Users\think\Pictures\ico\001.jpg");
  31. //流程内容
  32. formHOZ.lblFlowContent.Text = "1";
  33. break;
  34. }
  35. //修改切孔中流程状态
  36. ChageCutHoleFlowNodeState(formHOZ, args);
  37. }
  38. #region 修改切孔中流程状态
  39. /// <summary>
  40. /// 修改切孔中流程状态
  41. /// </summary>
  42. /// <param name="formHOZ">主窗体对象</param>
  43. /// <param name="cutHoleName">切孔名称</param>
  44. /// <param name="Code">流程编号</param>
  45. /// <param name="state">状态</param>
  46. /// <returns></returns>
  47. public static bool ChageCutHoleFlowNodeState(FormHOZMain formHOZ, ThreadStatusEventArgs args)
  48. {
  49. if (formHOZ.plPrarInfo.Controls.Count > 0)
  50. {
  51. foreach (Control item in formHOZ.plPrarInfo.Controls)
  52. {
  53. if (item is UserControl)
  54. {
  55. if (item.Name == args.HoleName)
  56. {
  57. UControl_ParaInfo uControl_ParaInfo = (UControl_ParaInfo)item;
  58. TimeLineItem[] ParaItem = uControl_ParaInfo.TlItem;
  59. foreach (TimeLineItem tlItem in ParaItem)
  60. {
  61. if (tlItem.Code == args.Step_Code)
  62. {
  63. tlItem.State = Convert.ToInt32(args.State);
  64. break;
  65. }
  66. }
  67. //重新绘制
  68. uControl_ParaInfo.TimeLineInvalidate();
  69. return true;
  70. }
  71. }
  72. }
  73. }
  74. return false;
  75. }
  76. #endregion
  77. }
  78. }