123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using MeasureThread;
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace HOZProject
- {
- public class MeasureMsgManage
- {
- /// <summary>
- /// 线程消息处理,显示内容
- /// </summary>
- /// <param name="formHOZ">主窗体对象</param>
- /// <param name="args">消息对象</param>
- public static void ShowMsgContent(FormHOZMain formHOZ, ThreadStatusEventArgs args)
- {
- switch (args.Step_Code)
- {
- case "1-3":
- //设置图像
- formHOZ.pbImage.Image = null;
- //流程内容
- formHOZ.lblFlowContent.Text = "1-3";
- break;
- default:
- //设置图像
- formHOZ.pbImage.Image = null;//new Bitmap(@"C:\Users\think\Pictures\ico\001.jpg");
- //流程内容
- formHOZ.lblFlowContent.Text = "1";
- break;
- }
- //修改切孔中流程状态
- ChageCutHoleFlowNodeState(formHOZ, args);
- }
- #region 修改切孔中流程状态
- /// <summary>
- /// 修改切孔中流程状态
- /// </summary>
- /// <param name="formHOZ">主窗体对象</param>
- /// <param name="cutHoleName">切孔名称</param>
- /// <param name="Code">流程编号</param>
- /// <param name="state">状态</param>
- /// <returns></returns>
- public static bool ChageCutHoleFlowNodeState(FormHOZMain formHOZ, ThreadStatusEventArgs args)
- {
- if (formHOZ.plPrarInfo.Controls.Count > 0)
- {
- foreach (Control item in formHOZ.plPrarInfo.Controls)
- {
- if (item is UserControl)
- {
- if (item.Name == args.HoleName)
- {
- UControl_ParaInfo uControl_ParaInfo = (UControl_ParaInfo)item;
- TimeLineItem[] ParaItem = uControl_ParaInfo.TlItem;
- foreach (TimeLineItem tlItem in ParaItem)
- {
- if (tlItem.Code == args.Step_Code)
- {
- tlItem.State = Convert.ToInt32(args.State);
- break;
- }
- }
- //重新绘制
- uControl_ParaInfo.TimeLineInvalidate();
- return true;
- }
- }
- }
- }
- return false;
- }
- #endregion
- }
- }
|