Files
01-Siyuan-MesProject/MisDataFunction/MesServer.Function/Function07/OpcServer/Barcode.cs
2026-05-29 10:07:05 +08:00

60 lines
1.8 KiB
C#

using System;
//using SystemFramework;
using MesServerWork;
namespace MesServerFunctions
{
partial class Functions_BASE_07
{
/// <summary>
///扫描物料条码或批次号
/// </summary>
/// <param name="OpName"></param>
/// <param name="barcode"></param>
public void Barcode(object e)
{
try
{
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
string OpName = Convert.ToString(msgEvent.OpName);
string QRcode = Convert.ToString(msgEvent.TagValue);
string barcode = "";
string EngineType = "";
bool ispartload = false;
bool select_OK = false;
MIS_BASE.Read_PartLoad(OpName, out ispartload);
if (!ispartload)
{
AsyncSendMessage_Notice(OpName, "PLC未申请上线,请确认");
return;
}
//判断是否是返修上线条码
select_OK = SelectRepairBarcode(OpName, QRcode, out barcode, out EngineType);
if (barcode.Length < 5 || !select_OK)
{
AsyncSendMessage_Notice(OpName, "条码无效,请确认");
return;
}
else
{
//显示该总成各个工位的质量数据
SendInfomation("RepairQuality", barcode, OpName);
//向前端发送查询后的barcode
SendInfomation("SelectBarcode", barcode, OpName);
}
}
catch (Exception err)
{
////ApplicationLog.WriteLog(err, "Function07:Barcode");
}
}
}
}