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
{
///
/// 线程消息处理,显示内容
///
/// 主窗体对象
/// 消息对象
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 修改切孔中流程状态
///
/// 修改切孔中流程状态
///
/// 主窗体对象
/// 切孔名称
/// 流程编号
/// 状态
///
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
}
}