chore: 初始化合力驱动桥MES采集程序
This commit is contained in:
134
SyUpLoadBak/SyUpLoad/Methods/EngineGetOverBaseWork.cs
Normal file
134
SyUpLoadBak/SyUpLoad/Methods/EngineGetOverBaseWork.cs
Normal file
@@ -0,0 +1,134 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using bizFacade;
|
||||
using MesServerWork;
|
||||
|
||||
namespace SyUpLoad
|
||||
{
|
||||
partial class PartLoad
|
||||
{
|
||||
/// <summary>
|
||||
/// 正常逻辑工作(传递机型)
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="EngineTypeID"></param>
|
||||
/// <param name="EngineType"></param>
|
||||
/// <param name="EngineID"></param>
|
||||
/// <param name="PartPallet_Code"></param>
|
||||
private void EngineTypeGetOver_PLC_Work(string OpName, int EngineTypeID, string EngineType, string EngineID, int PartPallet_Code)
|
||||
{
|
||||
int IsAllowWork;
|
||||
int IsrepairBarcode = 0;//拆解返修标志
|
||||
int RepairPartStatusPLC = 0;
|
||||
int MES_QualityMask = 1;
|
||||
|
||||
string OrderForm = "";//订单号
|
||||
string EngineID_MES;
|
||||
string repairBarcode = "";//拆解返修条码
|
||||
bool MesRead = false;
|
||||
bool MesReadOver = false;
|
||||
DataTable dt;
|
||||
|
||||
MIS_BASE.Read_EngineID_MES(OpName, out EngineID_MES);//获取MES总成号
|
||||
MIS_BASE.Read_MesReadOver(OpName, out MesReadOver); //保存完成
|
||||
MIS_BASE.Read_QualityData_Read_CF(OpName, out MesRead); //允许保存
|
||||
MIS_BASE.Read_PalletInfo(OpName, out MES_QualityMask);//合格标志
|
||||
MIS_BASE.Read_RepairStatus_PLC(OpName, out RepairPartStatusPLC);//返修标志
|
||||
|
||||
BaseDataSystemMES.GetEngineID_Select(OpName, EngineID, out dt);//查询订单信息
|
||||
|
||||
if (dt != null&&dt.Rows.Count > 0)
|
||||
{
|
||||
OrderForm = Convert.ToString(dt.Rows[0]["订单号"]);
|
||||
IsrepairBarcode = Convert.ToInt32(dt.Rows[0]["拆解标志"]);
|
||||
repairBarcode = Convert.ToString(dt.Rows[0]["拆解返修条码"]);
|
||||
}
|
||||
|
||||
BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, OrderForm, EngineTypeID, EngineType, EngineID, PartPallet_Code, 0, IsrepairBarcode, repairBarcode);
|
||||
SaveMobyMessage(OpName, EngineTypeID, EngineType, EngineID, OrderForm);
|
||||
Sendmessage("5", "1", OpName);
|
||||
SendInfomation("QualityMask", Convert.ToString(MES_QualityMask), OpName);
|
||||
SendInfomation("RepairPartStatusPLC", Convert.ToString(RepairPartStatusPLC), OpName);
|
||||
|
||||
BaseDataSystemMES.MaterialPush_EngineIDStatus_Insert(OpName);
|
||||
|
||||
if (EngineID_MES == EngineID)
|
||||
{
|
||||
string kuweiNum;
|
||||
kuweiNum = DtWebApi.ReadWritePLC.ReadPLC(warehouseLocation.ToString(), OpName).ToString();
|
||||
BaseDataSystemMES.GetUpLoadBarCode_0utUpdate(OpName, kuweiNum);
|
||||
MIS_BASE.Write_FixAllow(OpName, true);
|
||||
InitOpname01();
|
||||
}
|
||||
else
|
||||
{
|
||||
AsyncSendMessage_Notice(OpName, "PLC与MES不一致");
|
||||
}
|
||||
}
|
||||
private void InitOpname01()
|
||||
{
|
||||
BaseDataSystemMES.GetUpLoadBarCode(OPName01, out DataTable dt_OPName01);
|
||||
|
||||
dataGridView_OPA1001.Invoke(new Action(() => {
|
||||
dataGridView_OPA1001.DataSource = dt_OPName01;
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 保存MOBY信息
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineID"></param>
|
||||
private void SaveMobyMessage(string OpName, int engineTypeID, string engineType, string engineID, string orderForm)
|
||||
{
|
||||
if (MIS_BASE.hashtable_EngineGetOver_EngineTypeID == null)
|
||||
{
|
||||
MIS_BASE.InitHashtable_MesServerCode();
|
||||
}
|
||||
if (MIS_BASE.hashtable_EngineGetOver_EngineTypeID.ContainsKey(OpName))
|
||||
{
|
||||
MIS_BASE.hashtable_EngineGetOver_EngineTypeID[OpName] = engineTypeID;
|
||||
}
|
||||
if (MIS_BASE.hashtable_EngineGetOver_EngineType.ContainsKey(OpName))
|
||||
{
|
||||
MIS_BASE.hashtable_EngineGetOver_EngineType[OpName] = engineType;
|
||||
}
|
||||
if (MIS_BASE.hashtable_EngineGetOver_EngineID.ContainsKey(OpName))
|
||||
{
|
||||
MIS_BASE.hashtable_EngineGetOver_EngineID[OpName] = engineID;
|
||||
}
|
||||
if (MIS_BASE.hashtable_EngineGetOver_OrderForm.ContainsKey(OpName))
|
||||
{
|
||||
MIS_BASE.hashtable_EngineGetOver_OrderForm[OpName] = orderForm;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返修件需要工作
|
||||
/// </summary>
|
||||
/// <param name="OpName">工位号</param>
|
||||
private void IsNeedRepaire_OK(string OpName)
|
||||
{
|
||||
|
||||
int isRepair;
|
||||
int engineTypeID;
|
||||
|
||||
string engineType = "";
|
||||
string engineID = "";
|
||||
string palletCode = "";
|
||||
string orderForm = "";
|
||||
string repairCode = "";
|
||||
//从监控系统中查询出本工位信息
|
||||
BaseDataSystemMES.OpName_MIS_Moby_Select(OpName,
|
||||
out orderForm, out engineTypeID, out engineType,
|
||||
out engineID, out palletCode, out isRepair, out repairCode);
|
||||
|
||||
EngineTypeGetOver_PLC_Work(OpName, engineTypeID, engineType, engineID, Convert.ToInt32(palletCode));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
139
SyUpLoadBak/SyUpLoad/Methods/SubmitToMisweb.cs
Normal file
139
SyUpLoadBak/SyUpLoad/Methods/SubmitToMisweb.cs
Normal file
@@ -0,0 +1,139 @@
|
||||
using System;
|
||||
using bizFacade;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace SyUpLoad
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 此类用于向WEB发送各种类型消息
|
||||
/// </summary>
|
||||
partial class PartLoad
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 批量发送WEB消息(Value为BOOL值)
|
||||
/// </summary>
|
||||
/// <param name="MessageNumm">消息编号组合</param>
|
||||
/// <param name="Value">消息值组合</param>
|
||||
/// <param name="OpName">工位号</param>
|
||||
void Sendmessage(string MessageNumm, string Value, string OpName)
|
||||
{
|
||||
for (int i = 0; i < MessageNumm.Length; i++)
|
||||
{
|
||||
Sendmessage(MessageNumm[i], Value[i].ToString(), OpName);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 选择发送给WEB的消息
|
||||
/// </summary>
|
||||
/// <param name="Num">消息类型</param>
|
||||
/// <param name="OpName">消息工位</param>
|
||||
void Sendmessage(char Num, string Value, string OpName)
|
||||
{
|
||||
string SendMessage;
|
||||
switch (Num)
|
||||
{
|
||||
case '1':
|
||||
//1(直接在界面通过选择机型确认工序内容)
|
||||
SendMessage = "MES|ProcessList|" + OpName + "|" + Value;
|
||||
AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
|
||||
case '2':
|
||||
//2显示物料
|
||||
SendMessage = "MES|MaterialList|" + OpName + "|" + Value;
|
||||
AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
|
||||
case '3':
|
||||
//3显示操作指导图片
|
||||
SendMessage = "MES|PicShow|" + OpName + "|" + Value;
|
||||
AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case '4':
|
||||
//4显示订单完工数量
|
||||
SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
|
||||
AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
|
||||
case '5':
|
||||
SendMessage = "MES|ShowMoby|" + OpName + "|" + Value;
|
||||
AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case '6':
|
||||
SendMessage = "MES|MaterialCheckPosition|" + OpName + "|" + Value;
|
||||
AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case '7':
|
||||
SendMessage = "MES|WorkStart|" + OpName + "|" + Value;
|
||||
AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case '8':
|
||||
|
||||
break;
|
||||
case '9':
|
||||
SendMessage = "MES|ConfirmOkGo|" + OpName + "|" + Value;
|
||||
AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case 'a':
|
||||
SendMessage = "MES|FixAllow|" + OpName + "|" + Value;
|
||||
AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 向WEB发送信息(value为字符串)
|
||||
/// </summary>
|
||||
/// <param name="Command">消息种类</param>
|
||||
/// <param name="Value">消息内容</param>
|
||||
/// <param name="OpName">工位号</param>
|
||||
void SendInfomation(string Command, string Value, string OpName)
|
||||
{
|
||||
|
||||
string SendMessage = "MES|" + Command + "|" + OpName + "|" + Value;
|
||||
AsyncSendMessage(SendMessage);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 发送在线产量、在线节拍
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void SendActuallyCount(string OpName, int tagValue)
|
||||
{
|
||||
//当工件离开时,更新在线产量、在线节拍
|
||||
if (tagValue == 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
int opNameCount = 0;//在线产量
|
||||
int opNameCountTime = 0;//在线节拍
|
||||
//基本数据_工作日历_班次产量查询_New
|
||||
BaseDataSystemMES.OpNameCount_New(OpName, out opNameCount, out opNameCountTime);
|
||||
|
||||
string SendMessage;
|
||||
SendMessage = "MES|ActuallyCount|" + OpName + "|" + opNameCount.ToString() + "&" + opNameCountTime.ToString();
|
||||
AsyncSendMessage(SendMessage);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function03:SendActuallyCount");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
57
SyUpLoadBak/SyUpLoad/Methods/UDP.Send.cs
Normal file
57
SyUpLoadBak/SyUpLoad/Methods/UDP.Send.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using bizFacade;
|
||||
//using SystemFramework;
|
||||
using MesServerWork;
|
||||
|
||||
namespace SyUpLoad
|
||||
{
|
||||
partial class PartLoad
|
||||
{
|
||||
/// <summary>
|
||||
/// 发送信息到MES通讯服务器或者其他的
|
||||
/// </summary>
|
||||
/// <param name="Message"></param>
|
||||
private void AsyncSendMessage(string Message)
|
||||
{
|
||||
// asyncSendMessage(Message);
|
||||
MIS_BASE.asyncSendMessage(Message);
|
||||
//Thread t = new Thread(delegate() { asyncSendMessage(Message); });
|
||||
//t.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送提示消息
|
||||
/// </summary>
|
||||
/// <param name="Message"></param>
|
||||
private void AsyncSendMessage_Notice(string opname, string notice)
|
||||
{
|
||||
//通知Web界面
|
||||
BaseDataSystemMES.Web_Notice_Insert(opname, notice);
|
||||
string SendMessage = "MES|Notice|" + opname + "|" + "1";
|
||||
MIS_BASE.asyncSendMessage(SendMessage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送信息到打印机
|
||||
/// </summary>
|
||||
/// <param name="Message"></param>
|
||||
private void asyncSendMessageToMark(string Message)
|
||||
{
|
||||
//System.Threading.Thread.Sleep(10);
|
||||
string messageSend = (string)Message;
|
||||
//UDPClientSend.Send_ALL(ApplicationConfig.MES_MarkPortNum, messageSend);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送信息到LED
|
||||
/// </summary>
|
||||
/// <param name="Message"></param>
|
||||
private void asyncSendMessageLED(string OpName)
|
||||
{
|
||||
|
||||
//发送到大屏幕显示 41104
|
||||
string strMessage = "MIS|" + OpName + "|" + "0" + "|" + "1";
|
||||
//UDPClientSend.Send_ALL(ApplicationConfig.Port_ShowLED_ProductCount, strMessage);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
SyUpLoadBak/SyUpLoad/Methods/vssver2.scc
Normal file
BIN
SyUpLoadBak/SyUpLoad/Methods/vssver2.scc
Normal file
Binary file not shown.
Reference in New Issue
Block a user