87 lines
4.0 KiB
C#
87 lines
4.0 KiB
C#
using System;
|
||
using bizFacade;
|
||
//using SystemFramework;
|
||
using MesServerWork;
|
||
|
||
namespace MesServerFunctions
|
||
{
|
||
partial class FunctionMES
|
||
{
|
||
/// <summary>
|
||
/// 保存完成(针对半自动和手动压装工位)
|
||
/// </summary>
|
||
/// <param name="OpName"></param>
|
||
/// <param name="tagValue"></param>
|
||
private void MesRead(object e)
|
||
{
|
||
{
|
||
try
|
||
{
|
||
int EngineTypeID;
|
||
string EngineType;
|
||
string EngineID;
|
||
int PartPallet_Code;
|
||
string OrderForm;
|
||
|
||
{
|
||
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||
string OpName = Convert.ToString(msgEvent.OpName);
|
||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||
|
||
if (tagValue == 1)
|
||
{
|
||
int qualityMask;
|
||
MyLog4Net.MyLogHelper.Error($"触发记录:", $"允许保存 工位号:{OpName}");
|
||
|
||
MIS_BASE.GetEngineTypeFromPLC(OpName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out OrderForm);
|
||
|
||
|
||
// 保存数据到线首表 先保存到 北汽福田变速器序列号总线上线 用于之前判断是否重号
|
||
// 保存质量数据
|
||
MyLog4Net.MyLogHelper.Error($"保存记录:", $"开始保存质量数据 工位号:{OpName} 工件编号:{EngineID}");
|
||
qualityMask = MisDataSaveDateMesRead.Funtion.MesRead(OpName, tagValue.ToString(), msgEvent.TagID.ToString());
|
||
// 保存物料数据
|
||
MyLog4Net.MyLogHelper.Error($"保存记录:", $"开始保存物料数据 工位号:{OpName} 工件编号:{EngineID}");
|
||
BaseDataSystemMES.Material_Insert(OpName, qualityMask);
|
||
|
||
// 测量数据发动机在线状态
|
||
MyLog4Net.MyLogHelper.Error($"保存记录:", $"开始保存过站数据 工位号:{OpName} 工件编号:{EngineID}");
|
||
BaseDataSystemMES.WorkStartInsert(OpName, qualityMask);
|
||
MyLog4Net.MyLogHelper.Error($"保存记录:", $"结束保存过站数据 工位号:{OpName} 工件编号:{EngineID}");
|
||
|
||
// 推送质量数据到MES的页面
|
||
SendMessageFun.SendInfomation("ShowTimelyQuality", "1&" + qualityMask.ToString(), OpName);
|
||
|
||
//对应手动工位的
|
||
//MIS_BASE.Write_ConfirmOkGo(OpName, true);
|
||
//通知设备,MES的质量数据(和物料数据)保存完成
|
||
MIS_BASE.Write_MesReadOver(OpName, true);
|
||
MIS_BASE.Write_MaterialVerifyOver(OpName, true);
|
||
//统计在线产量,在线节拍
|
||
SendMessage.SendActuallyCount(OpName, tagValue);
|
||
}
|
||
else
|
||
{
|
||
MyLog4Net.MyLogHelper.Error($"触发记录:", $"保存完成 工位号:{OpName}");
|
||
MIS_BASE.Write_MesReadOver(OpName, false);
|
||
MIS_BASE.Write_ConfirmOkGo(OpName, false);
|
||
MIS_BASE.Write_FixAllow(OpName, false);
|
||
MIS_BASE.Write_EngineTypeGetOver_MES(OpName, false);
|
||
//工作完成 同时清空工作完成 (防错)
|
||
MIS_BASE.Write_MaterialVerifyOver(OpName, false);
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
catch (Exception err)
|
||
{
|
||
////ApplicationLog.WriteLog(err, "Function08:MesReadOver");
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
}
|
||
}
|