80 lines
3.5 KiB
C#
80 lines
3.5 KiB
C#
using bizFacade;
|
||
using MesServerWork;
|
||
using System;
|
||
//using SystemFramework;
|
||
|
||
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)
|
||
{
|
||
MIS_BASE.GetEngineTypeFromPLC(OpName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out OrderForm);
|
||
|
||
//保存数据到线首表 先保存到 北汽福田变速器序列号总线上线 用于之前判断是否重号
|
||
if (Db.UpLoadOpNameInsert(EngineID, EngineTypeID, EngineType, OpName))
|
||
{
|
||
//保存质量数据
|
||
int qualityMask = MisDataSaveDateMesRead.Funtion.MesRead(OpName, tagValue.ToString(), msgEvent.TagID.ToString());
|
||
//保存物料数据
|
||
BaseDataSystemMES.Material_Insert(OpName, qualityMask);
|
||
//测量数据发动机在线状态
|
||
BaseDataSystemMES.WorkStartInsert(OpName, qualityMask);
|
||
//推送质量数据到MES的页面
|
||
SendMessageFun.SendInfomation("ShowTimelyQuality", "1&" + qualityMask.ToString(), OpName);
|
||
//统计在线产量,在线节拍
|
||
SendMessage.SendActuallyCount(OpName, tagValue);
|
||
|
||
//通知设备,MES的质量数据(和物料数据)保存完成
|
||
MIS_BASE.Write_MesReadOver(OpName, true);
|
||
//MES工作完成
|
||
MIS_BASE.Write_MaterialVerifyOver(OpName, true);
|
||
|
||
SendMessageFun.SendMessage("1235", "1111", OpName);
|
||
|
||
//清空返修工位字符串
|
||
MIS_BASE.WritePLC(4, OpName, "");
|
||
}
|
||
else
|
||
{
|
||
SendMessage.AsyncSendMessage_Notice(OpName, "保存上线数据失败!");
|
||
}
|
||
}
|
||
else
|
||
{
|
||
MIS_BASE.Write_MesReadOver(OpName, false);
|
||
}
|
||
}
|
||
|
||
}
|
||
catch (Exception err)
|
||
{
|
||
// 保存出错日志 1.申请上线 2.传递机型 3.允许保存 4.扫码
|
||
MisDataSaveDate.FuntionMesRead.Alarm_SaveFileLog4Error(4, e, "Fun1061", err);
|
||
////ApplicationLog.WriteLog(err, "Function08:MesReadOver");
|
||
}
|
||
}
|
||
|
||
}
|
||
}
|
||
}
|