MVP!
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
using System;
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 初始化处理工序工步执行过程
|
||||
/// </summary>
|
||||
private void InitWorkStep(string OpName, int engineTypeID, string engineType, string engineID)
|
||||
{
|
||||
try
|
||||
{
|
||||
NextWorkStep(OpName, engineTypeID, engineType, engineID);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, err.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理工序工步执行过程下一步信息
|
||||
/// </summary>
|
||||
private void NextWorkStep(string OpName, int engineTypeID, string engineType, string engineID)
|
||||
{
|
||||
int workStepProperty = 512;
|
||||
|
||||
|
||||
if (MIS_BASE.hashtable_workStepProperty == null)
|
||||
{
|
||||
MIS_BASE.InitHashtable_MesServerCode();
|
||||
}
|
||||
//获取工步属性
|
||||
if (MIS_BASE.hashtable_workStepProperty.ContainsKey(OpName))
|
||||
{
|
||||
workStepProperty = Convert.ToInt32(MIS_BASE.hashtable_workStepProperty[OpName]);
|
||||
}
|
||||
|
||||
//16和64都表示分步保存质量数据(B6中并不是表示正常拧紧与返修拧紧的关系)
|
||||
if (workStepProperty == 16 || workStepProperty == 64)
|
||||
{
|
||||
int BoltCode = 0;
|
||||
int ProcessCode = 512;
|
||||
bool isHaveNg = false;
|
||||
|
||||
bool sn_WorkingStepIsOver = GetShaftWoringStepIsWorked_WorkGroup(OpName, engineTypeID, engineType, out ProcessCode, out BoltCode, out workStepProperty, out isHaveNg);
|
||||
|
||||
if (!sn_WorkingStepIsOver)
|
||||
{
|
||||
//发动UDP,通知MES工作站拧紧第几组
|
||||
SendInfomation("FixAllowGuid", Convert.ToString(ProcessCode) + "&" + Convert.ToString(BoltCode), OpName);//显示拧紧标志
|
||||
|
||||
//写入拧紧顺序
|
||||
MIS_BASE.Write_ProcessCode(OpName, ProcessCode);
|
||||
//写入子程序(套筒号)
|
||||
MIS_BASE.Write_BoltCode(OpName, BoltCode);
|
||||
|
||||
//通知PLC允许工作
|
||||
MIS_BASE.Write_FixAllow(OpName, true);
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", "MES允许手动拧紧!位置:" + ProcessCode.ToString() + ",套筒:" + BoltCode.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
// 是否存在拧紧不合格的
|
||||
if (!isHaveNg)
|
||||
{
|
||||
MIS_BASE.Write_ConfirmOkGo(OpName, true);
|
||||
MIS_BASE.Write_FalseGO(OpName, false);
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", "MES所有拧紧任务完成!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断是否还有需要拧紧的组号 ProcessCode=拧紧序号 BoltCode=套筒号
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="ProcessCode">拧紧序号</param>
|
||||
/// <param name="BoltCode">套筒号</param>
|
||||
/// <returns></returns>
|
||||
private bool GetShaftWoringStepIsWorked_WorkGroup(string opName, int engineTypeID, string engineType, out int ProcessCode, out int BoltCode, out int workStepProperty, out bool isHaveNg)
|
||||
{
|
||||
ProcessCode = 0;
|
||||
BoltCode = 0;
|
||||
workStepProperty = 0;
|
||||
bool sn_WorkingStepIsOver = true;//是否完成拧紧
|
||||
isHaveNg = false;//是否有拧紧不合格
|
||||
|
||||
//电子看板_工位机型_质量数据测量位置_临时表_查询_完成情况
|
||||
MisDataFun.MesServer_ShaftPosition_Select_FinishResult(opName, out ProcessCode, out BoltCode, out workStepProperty, out sn_WorkingStepIsOver, out isHaveNg);
|
||||
if (MIS_BASE.hashtable_WorkGroupIndex == null)
|
||||
{
|
||||
MIS_BASE.InitHashtable_MesServerCode();
|
||||
}
|
||||
|
||||
//记录当前拧紧序号
|
||||
if (MIS_BASE.hashtable_WorkGroupIndex.ContainsKey(opName))
|
||||
{
|
||||
MIS_BASE.hashtable_WorkGroupIndex[opName] = ProcessCode;
|
||||
}
|
||||
return sn_WorkingStepIsOver;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,258 @@
|
||||
using System;
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 分线上总线的数量
|
||||
/// </summary>
|
||||
public static int SubLineLoadPartCount = 2;
|
||||
/// <summary>
|
||||
/// 分线上总线已经匹配的数量
|
||||
/// </summary>
|
||||
public static int SubLineLoadPartCountMatch = 0;
|
||||
/// <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,string OrderForm)
|
||||
{
|
||||
int IsAllowWork;
|
||||
|
||||
//第四步,获取是否允许工作
|
||||
MisDataFun.MesServer_Judge_IsCanWork(OpName, out IsAllowWork);
|
||||
|
||||
// 暂时先定义为扫描完成才能进行压装工作,因为考虑到工作完成后,操作工未必会去扫描物料的情况
|
||||
if (IsAllowWork == 1)
|
||||
{
|
||||
//通知PLC允许工作,允许工作在保存完成时清空
|
||||
MIS_BASE.Write_FixAllow(OpName, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessageFun.AsyncSendMessage_Notice(OpName, "请扫描物料!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <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),orderForm);
|
||||
}
|
||||
/// <summary>
|
||||
/// 正常匹配分线和总线
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineID">总线工件号</param>
|
||||
/// <param name="engineTypeID">总线工件机型代码</param>
|
||||
/// <param name="engineType">总线工件机型</param>
|
||||
private void Match(string opName, string engineID, int engineTypeID, string engineType, int PartPallet_Code)
|
||||
{
|
||||
//try
|
||||
//{
|
||||
// bool m_EngineGetOver_PLC_SubLine;
|
||||
// int engineTypeID_SubLine;
|
||||
// int partPallet_Code_SubLine;
|
||||
// int PalletInfo = 1;//总线托盘状态
|
||||
|
||||
// string opName_SubLine = "";//分线工件信息
|
||||
// string engineID_SubLine;
|
||||
// string engineType_SubLine;
|
||||
// string AlarmStr;
|
||||
// if (MIS_BASE.hashtable_OpNameRepair == null)
|
||||
// {
|
||||
// MIS_BASE.InitHashtable_MesServerCode();
|
||||
// }
|
||||
// //第一步:获取分线中间交互工位号
|
||||
// if (MIS_BASE.hashtable_OpNameRepair.ContainsKey(opName))
|
||||
// {
|
||||
// opName_SubLine = MIS_BASE.hashtable_OpNameRepair[opName].ToString();
|
||||
// }
|
||||
// if (opName_SubLine == "")
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// //第二步:获取分线传递机型信号
|
||||
// MIS_BASE.Read_EngineGetOver_PLC(opName_SubLine, out m_EngineGetOver_PLC_SubLine);
|
||||
// if (!m_EngineGetOver_PLC_SubLine) return;//必须工件同时到位才能进行匹配
|
||||
|
||||
// //第三步:判断合格标志
|
||||
// MIS_BASE.Read_PalletInfo(opName_SubLine, out PalletInfo);
|
||||
// if (PalletInfo == 2) return; //若不合格则返回不进行匹配
|
||||
// string OrderForm;
|
||||
// //第四步:获取分线的信息,匹配验证
|
||||
// MIS_BASE.GetEngineTypeFromPLC(opName_SubLine, out engineTypeID_SubLine, out engineType_SubLine, out engineID_SubLine, out partPallet_Code_SubLine,out OrderForm);
|
||||
// //判断分线数据是否合格
|
||||
// //if (!BaseDataSystemMES.QulityDataVerify(opName, engineID_SubLine, out AlarmStr) && !BaseDataSystemMES.QualityVerifyStatus_Hash_Read(opName))
|
||||
// //{
|
||||
// // SendInfomation("LineoutAlert", AlarmStr, opName);
|
||||
// // return;
|
||||
// //}
|
||||
|
||||
// if (engineTypeID_SubLine == engineTypeID)
|
||||
// {
|
||||
// BaseDataSystemMES.SubLineLoadPartCountMatch_Select(opName, out SubLineLoadPartCountMatch);
|
||||
// SubLineLoadPartCountMatch = SubLineLoadPartCountMatch + 1;
|
||||
// BaseDataSystemMES.SubLineLoadPartCountMatch_Update(opName, SubLineLoadPartCountMatch);
|
||||
|
||||
|
||||
// BaseDataSystemMES.MailLineAndSubLineData_Insert(engineID, engineTypeID, engineType, engineID_SubLine);//分线上总线数据转移
|
||||
// MIS_BASE.Write_Match(opName, true);//匹配结果
|
||||
// MIS_BASE.Write_MatchingCompleted(opName, true);//匹配完成
|
||||
// if(SubLineLoadPartCountMatch== SubLineLoadPartCount)
|
||||
// {
|
||||
// MIS_BASE.Write_FixAllow(opName, true);
|
||||
// SubLineLoadPartCountMatch = 0;
|
||||
// BaseDataSystemMES.SubLineLoadPartCountMatch_Update(opName, SubLineLoadPartCountMatch);
|
||||
|
||||
// }
|
||||
|
||||
// SendMessageFun.SendInfomation("MatchSuccess", "1", opName);
|
||||
// sendmessage(opName, 1, "Match");//匹配结果
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// MIS_BASE.Write_Match(opName, false);//匹配结果
|
||||
// MIS_BASE.Write_MatchingCompleted(opName, true);//匹配完成//68:1、取消返修;2、匹配成功 自己监控发送 MES|MatchingCompleted
|
||||
|
||||
// //发送匹配完成和匹配结果信息
|
||||
// SendMessageFun.AsyncSendMessage_Notice(opName,"匹配失败,工件型号不匹配!");
|
||||
// SendMessageFun.SendInfomation("MatchSuccess", "0", opName);
|
||||
// sendmessage(opName, 0, "Match");//匹配结果
|
||||
// }
|
||||
|
||||
//}
|
||||
//catch (Exception err)
|
||||
//{
|
||||
// ////ApplicationLog.WriteLog("Match:" + err.ToString());
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 强制匹配分线和总线
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
private void ForceMatch(string opName)
|
||||
{
|
||||
//try
|
||||
//{
|
||||
// bool m_EngineGetOver_PLC_SubLine;
|
||||
// bool m_EngineGetOver_PLC;
|
||||
|
||||
// int engineTypeID_SubLine;
|
||||
// int engineTypeID;
|
||||
// int partPallet_Code_SubLine;
|
||||
// int partPallet_Code;
|
||||
|
||||
// string opName_SubLine = "";//分线工件信息
|
||||
// string engineID_SubLine;
|
||||
// string engineType_SubLine;
|
||||
// string engineID;
|
||||
// string engineType;
|
||||
// if (MIS_BASE.hashtable_OpNameRepair == null)
|
||||
// {
|
||||
// MIS_BASE.InitHashtable_MesServerCode();
|
||||
// }
|
||||
// //获取分线中间交互工位号
|
||||
// if (MIS_BASE.hashtable_OpNameRepair.ContainsKey(opName))
|
||||
// {
|
||||
// opName_SubLine = MIS_BASE.hashtable_OpNameRepair[opName].ToString();
|
||||
// }
|
||||
// if (opName_SubLine == "")
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// MIS_BASE.Read_EngineGetOver_PLC(opName_SubLine, out m_EngineGetOver_PLC_SubLine);//1:读取分线工件到位的传递机型信号。
|
||||
|
||||
// if (!m_EngineGetOver_PLC_SubLine) return;//必须工件同时到位才能进行匹配
|
||||
|
||||
// MIS_BASE.Read_EngineGetOver_PLC(opName, out m_EngineGetOver_PLC);//2:读取总线工件到位的传递机型信号。
|
||||
|
||||
// if (!m_EngineGetOver_PLC) return;//必须工件同时到位才能进行匹配
|
||||
// string OrderForm;
|
||||
// MIS_BASE.GetEngineTypeFromPLC(opName_SubLine, out engineTypeID_SubLine, out engineType_SubLine, out engineID_SubLine, out partPallet_Code_SubLine,out OrderForm);//获取分线的信息
|
||||
// MIS_BASE.GetEngineTypeFromPLC(opName, out engineTypeID, out engineType, out engineID, out partPallet_Code, out OrderForm);
|
||||
|
||||
// BaseDataSystemMES.MailLineAndSubLineData_Insert(engineID, engineTypeID, engineType, engineID_SubLine);//分线上总线数据转移
|
||||
|
||||
// MIS_BASE.Write_Match(opName, true);//匹配结果
|
||||
// MIS_BASE.Write_MatchingCompleted(opName, true);//匹配完成
|
||||
|
||||
// SendMessageFun.SendInfomation("MatchSuccess", "1", opName);//界面显示匹配成功
|
||||
|
||||
// MIS_BASE.Write_FixAllow(opName, true);//允许PLC工作
|
||||
|
||||
// //发送匹配完成和匹配结果信息
|
||||
// sendmessage(opName, 1, "MatchingComplete");//匹配完成
|
||||
// sendmessage(opName, 1, "Match");//匹配结果
|
||||
//}
|
||||
//catch
|
||||
//{
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
310
MisDataFunction/Function1051/MesServerFunction/Function1051.cs
Normal file
310
MisDataFunction/Function1051/MesServerFunction/Function1051.cs
Normal file
@@ -0,0 +1,310 @@
|
||||
|
||||
using MesServerWork;
|
||||
using MisDataSaveDate;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO.Ports;
|
||||
using System.Threading;
|
||||
using MisDataFunDll;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
public partial class FunctionMES
|
||||
{
|
||||
object lockFunWork;
|
||||
//public void FunWork(DoWhatPlc.CustomeEvetnArgs e)
|
||||
public void FunWork(string recData)
|
||||
{
|
||||
|
||||
|
||||
//lockFunWork = new object();
|
||||
//lock (lockFunWork)
|
||||
{
|
||||
List<string> dataArray = MisDataFun.GetCmdStringList(recData);
|
||||
//string[] dataArray = recData.Split('|');
|
||||
//if (dataArray.Count != 4)
|
||||
//return;
|
||||
//消息来源
|
||||
string m_Source = dataArray[0].ToString();
|
||||
//消息类型 Barcode
|
||||
string m_Command = dataArray[1].ToString();
|
||||
//工位号
|
||||
string m_OpName = dataArray[2].ToString();
|
||||
//消息参数
|
||||
string m_Value = dataArray[3].ToString();
|
||||
|
||||
var e = new DeviceDriver_BasicData.CustomeEvetnArgs();// = Newtonsoft.Json.JsonConvert.DeserializeObject<DoWhatPlc.CustomeEvetnArgs>(m_Value);
|
||||
string tagValue;
|
||||
switch (m_Source)
|
||||
{
|
||||
case "BarCode":
|
||||
e.OpName = m_OpName;
|
||||
e.TagValue = m_Value;
|
||||
fun_Barcode(e);
|
||||
|
||||
break;
|
||||
case "WEB":
|
||||
e.OpName = m_OpName;
|
||||
e.TagValue = m_Command + "|" + m_Value;
|
||||
fun_WebSubmit(e);
|
||||
break;
|
||||
case "PLC":
|
||||
e = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceDriver_BasicData.CustomeEvetnArgs>(m_Value);
|
||||
string TagID = e.TagID.ToString();
|
||||
switch (e.TagValue.ToString().ToLower())
|
||||
{
|
||||
case "false":
|
||||
tagValue = "0";
|
||||
break;
|
||||
case "true":
|
||||
tagValue = "1";
|
||||
break;
|
||||
default:
|
||||
tagValue = e.TagValue.ToString();
|
||||
break;
|
||||
}
|
||||
e.TagValue = tagValue;
|
||||
switch (e.TagTypeCodeID.ToString())
|
||||
{
|
||||
//PLC 工件到位
|
||||
case "2":
|
||||
fun_WorkStart(e);
|
||||
break;
|
||||
//PLC 允许保存质量数据
|
||||
case "19":
|
||||
fun_MesRead(e);
|
||||
break;
|
||||
//MES 保存数据完成
|
||||
case "20":
|
||||
fun_MesReadOver(e);
|
||||
break;
|
||||
//PLC 申请上线
|
||||
case "43":
|
||||
PartLoad(e);
|
||||
break;
|
||||
//PLC 传递机型
|
||||
case "44":
|
||||
fun_EngineTypeGetOverPLC(e);
|
||||
break;
|
||||
//MES 合格放行
|
||||
case "51":
|
||||
fun_ConfirmOkGo(e);
|
||||
break;
|
||||
//MES 不合格放行
|
||||
case "8":
|
||||
fun_FalseGo(e);
|
||||
break;
|
||||
// PLC 系统健康心跳
|
||||
case "14":
|
||||
fun_HeartBeatMIS(e);
|
||||
break;
|
||||
//空料握手plc
|
||||
case "49":
|
||||
fun_Handshake(e);
|
||||
break;
|
||||
//PLC 拧紧结束
|
||||
case "59":
|
||||
fun_FixOK(e);
|
||||
break;
|
||||
//MES 拧紧完成确认
|
||||
case "67":
|
||||
fun_FixOver(e);
|
||||
break;
|
||||
// 写入托盘号后通知MES
|
||||
case "48":
|
||||
string write_Pallet_res;
|
||||
MIS_BASE.Read_TagValueByTagTypeID(48, m_OpName, out write_Pallet_res);
|
||||
if (write_Pallet_res.ToLower() == "true" || write_Pallet_res.ToLower() == "1")
|
||||
{
|
||||
SendMessageFun.SendInfomation("writePallet", "1", m_OpName);
|
||||
}
|
||||
MIS_BASE.Write_TagValueByTagTypeID(70, m_OpName, false);
|
||||
break;
|
||||
//MES 设备报警复位
|
||||
case "61":
|
||||
MIS_BASE.Write_MesErrorType(m_OpName, 0);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//public void FunWork(DoWhatPlc.CustomeEvetnArgs e)
|
||||
//{
|
||||
// //lock1 = new object();
|
||||
// //lock (lock1)
|
||||
// {
|
||||
// switch (e.TagTypeCodeID.ToString())
|
||||
// {
|
||||
// //PLC 工件到位
|
||||
// case "2":
|
||||
// fun_WorkStart(e);
|
||||
// break;
|
||||
// //PLC 允许保存质量数据
|
||||
// case "19":
|
||||
// fun_MesRead(e);
|
||||
// break;
|
||||
// //MES 保存数据完成
|
||||
// case "20":
|
||||
// fun_MesReadOver(e);
|
||||
// break;
|
||||
// //PLC 传递机型
|
||||
// case "44":
|
||||
// fun_EngineTypeGetOverPLC(e);
|
||||
// break;
|
||||
// //MES 合格放行
|
||||
// case "51":
|
||||
// fun_ConfirmOkGo(e);
|
||||
// break;
|
||||
// //MES 不合格放行
|
||||
// case "8":
|
||||
// fun_FalseGo(e);
|
||||
// break;
|
||||
// //MES 扫描条码
|
||||
// case "Barcode":
|
||||
// fun_Barcode(e);
|
||||
// break;
|
||||
// //WEB 处理页面传递过来的数据
|
||||
// case "WebSubmit":
|
||||
// fun_WebSubmit(e);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
//1.工件到位后,PLC给MES传递机型(DBX0.4)(44),
|
||||
//2.MES判断是否扫描完成
|
||||
//3.若扫描完成,则MES给出合格放行(DBX2.5)(51)
|
||||
/// <summary>
|
||||
/// 扫描条码
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="barcode"></param>
|
||||
public void fun_Barcode(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(Barcode, e);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 传递机型
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
public void fun_EngineTypeGetOverPLC(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(EngineTypeGetOver_PLC, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 合格放行
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
public void fun_ConfirmOkGo(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(ConfirmOkGo, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 不合格放行
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
public void fun_FalseGo(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(FalseGO, e);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 保存完成 20
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
public void fun_MesReadOver(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(MesReadOver, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 空料握手plc
|
||||
/// </summary>
|
||||
public void fun_Handshake(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// 拧紧完成
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
public void fun_FixOK(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(FixOK, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 拧紧完成确认
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
public void fun_FixOver(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(FixOver, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存完成 19
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
public void fun_MesRead(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(MesRead, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 工件到位离开(清空所有的MES信号)
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
public void fun_WorkStart(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(WorkStart, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理WEB页面发送过来的请求(m_Command + "|" + m_Value;)
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="Content"></param>
|
||||
public void fun_WebSubmit(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(WebSubmit, e);
|
||||
}
|
||||
|
||||
public int fun_SubLineLoadPartCountMatch()
|
||||
{
|
||||
return SubLineLoadPartCountMatch;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MES系统健康心跳监测
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
public void fun_HeartBeatMIS(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(HeartBeatMES, e);
|
||||
}
|
||||
/// <summary>
|
||||
/// PLC系统健康心跳监测
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
public void fun_HeartBeatPLC(DeviceDriver_BasicData.CustomeEvetnArgs e)
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(HeartBeatPLC, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,378 @@
|
||||
using System;
|
||||
using MesServerWork;
|
||||
using System.Collections;
|
||||
using System.Data;
|
||||
using MisDataFunDll;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据组号获得拧紧数据
|
||||
/// </summary>
|
||||
/// <param name="workGroup"></param>
|
||||
private int GetTagValue(string opName, int engineTypeID, string engineType, string engineID, int ProcessCode, int PartPallet_Code)
|
||||
{
|
||||
//合格标志
|
||||
int groupValueIsOK;
|
||||
//组号
|
||||
int workGroup_Index;
|
||||
//序号
|
||||
int sn_ShaftStep;
|
||||
//工作顺序(拧紧顺序)
|
||||
int sn_WorkingStep;
|
||||
|
||||
DataTable dt_ShaftPosition_WorkingStep;
|
||||
|
||||
groupValueIsOK = 2;
|
||||
ShaftPosition.ShaftPosition_Select_WorkingStep(opName, engineTypeID, out dt_ShaftPosition_WorkingStep);
|
||||
|
||||
if (dt_ShaftPosition_WorkingStep != null)
|
||||
{
|
||||
//如果是workGroup=1,则第一次需要禁用索引
|
||||
if (ProcessCode <= 1)
|
||||
{
|
||||
//不能delete 必须用update
|
||||
MisDataFun.BaseData_tagTable_QualityData_B5A_SubTable_Delete(engineID, opName);
|
||||
}
|
||||
|
||||
for (int i = 0; i < dt_ShaftPosition_WorkingStep.Rows.Count; i++)
|
||||
{
|
||||
workGroup_Index = Convert.ToInt32(dt_ShaftPosition_WorkingStep.Rows[i]["组号"]);
|
||||
if (workGroup_Index == ProcessCode)
|
||||
{
|
||||
sn_ShaftStep = Convert.ToInt32(dt_ShaftPosition_WorkingStep.Rows[i]["序号"]);
|
||||
sn_WorkingStep = Convert.ToInt32(dt_ShaftPosition_WorkingStep.Rows[i]["工作顺序"]); //没有其他使用
|
||||
//保存拧紧数据
|
||||
if (GetTagValue_DCT(opName, engineTypeID, engineType, engineID, sn_ShaftStep, PartPallet_Code) == 1)
|
||||
{
|
||||
groupValueIsOK = 1;
|
||||
//显示绿色拧紧轴
|
||||
}
|
||||
else
|
||||
{
|
||||
groupValueIsOK = 2;
|
||||
//显示红色拧紧轴
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return groupValueIsOK;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据序号,工作顺序获得测量值;将数据保存到数据库的临时表中。
|
||||
/// </summary>
|
||||
/// <param name="opName">工位号</param>
|
||||
/// <param name="engineTypeID">发动机机型代码</param>
|
||||
/// <param name="engineTypeID">发动机机型</param>
|
||||
/// <param name="engineID">当前发动机号</param>
|
||||
/// <param name="sn_ShaftStep">拧紧序号</param>
|
||||
private int GetTagValue_DCT(string opName, int engineTypeID, string engineType, string engineID, int sn_ShaftStep, int PartPallet_Code)
|
||||
{
|
||||
int groupValueIsOK;
|
||||
string tagValue1;
|
||||
string tagValue2;
|
||||
int isOK = 1;
|
||||
//合格标志的TagID
|
||||
int tagID_isOK1;
|
||||
int tagID_isOK2;
|
||||
|
||||
//TagID
|
||||
int tagID;
|
||||
int tagID1;
|
||||
int tagID2;
|
||||
|
||||
string MaxValue1;
|
||||
string MaxValue2;
|
||||
string MinValue1;
|
||||
string MinValue2;
|
||||
|
||||
//根据工位号获取哈西表
|
||||
Hashtable valueList;
|
||||
|
||||
|
||||
MIS_BASE.ReadPLC_Sync_ValueList(opName, out valueList);
|
||||
|
||||
|
||||
GetTagIDBytagOrder(valueList, sn_ShaftStep, out tagID, out tagID1, out tagID2,
|
||||
out tagValue1, out tagValue2, out tagID_isOK1, out tagID_isOK2, out MaxValue1, out MaxValue2, out MinValue1, out MinValue2);
|
||||
|
||||
if (tagID == -1 || tagID1 == -1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GetPressData_Save(opName, engineTypeID, engineType, engineID,
|
||||
sn_ShaftStep, tagID, tagID1, tagID2, tagValue1, tagValue2, tagID_isOK1, tagID_isOK2, PartPallet_Code, MaxValue1, MaxValue2, MinValue1, MinValue2,sn_ShaftStep);
|
||||
|
||||
if (tagID_isOK1 != 1) isOK = tagID_isOK1;
|
||||
if (tagID_isOK2 != 1) isOK = tagID_isOK2;
|
||||
if (isOK == -1)
|
||||
{
|
||||
isOK = 0;
|
||||
}
|
||||
groupValueIsOK = isOK;
|
||||
return groupValueIsOK;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据列位置获取三个TagID(合格标志,扭矩,转角),以及对应的值
|
||||
/// </summary>
|
||||
/// <param name="valueList"></param>
|
||||
/// <param name="sn_ShaftStep"></param>
|
||||
/// <param name="tagID"></param>
|
||||
/// <param name="tagID1"></param>
|
||||
/// <param name="tagID2"></param>
|
||||
/// <param name="tavIDValue1"></param>
|
||||
/// <param name="tavIDValue2"></param>
|
||||
/// <param name="isGoodBad"></param>
|
||||
private void GetTagIDBytagOrder(Hashtable valueList, int sn_ShaftStep,
|
||||
out int tagID, out int tagID1, out int tagID2,
|
||||
out string tavIDValue1, out string tavIDValue2, out int isGoodBad1, out int isGoodBad2, out string MaxValue1, out string MaxValue2, out string MinValue1, out string MinValue2)
|
||||
{
|
||||
int[] boolTemp = new int[32];//int数组存储轴类合格标志
|
||||
bool IsGetgoodOrBad = false;//是否根据8203或者8209获取到合格标志
|
||||
//初始化赋值
|
||||
tagID = -1;
|
||||
tagID1 = -1;
|
||||
tagID2 = -1;
|
||||
|
||||
tavIDValue1 = "";
|
||||
tavIDValue2 = "";
|
||||
MaxValue1 = "";
|
||||
MaxValue2 = "";
|
||||
MinValue1 = "";
|
||||
MinValue2 = "";
|
||||
//合格标志的TagID
|
||||
isGoodBad1 = 0;
|
||||
isGoodBad2 = 0;
|
||||
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs qualityData;
|
||||
|
||||
int tagid;//TagID
|
||||
int tagOrderBy;//列位置
|
||||
int tagItemOrderBy;//变量排序
|
||||
int tagTypeID;//TagID特点
|
||||
int tagProperty;//变量特点(6,7)
|
||||
object tagValue;//值
|
||||
string tagValue_1 = "0";//值
|
||||
|
||||
//根据当前组号获取对应的质量数据
|
||||
foreach (DictionaryEntry valueItem in valueList) //ht为一个Hashtable实例
|
||||
{
|
||||
try
|
||||
{
|
||||
qualityData = (DeviceDriver_BasicData.CustomeEvetnArgs)valueItem.Value;
|
||||
tagProperty = Convert.ToInt32(qualityData.TagProperty);
|
||||
tagid = Convert.ToInt32(qualityData.TagID);
|
||||
tagTypeID = Convert.ToInt32(qualityData.TagTypeID);
|
||||
tagValue = qualityData.TagValue;
|
||||
tagOrderBy = Convert.ToInt32(qualityData.TagOrderBy);
|
||||
tagItemOrderBy = Convert.ToInt32(qualityData.TagItemOrderBy);
|
||||
|
||||
//若为空,则转变为0
|
||||
if (tagValue == null)
|
||||
{
|
||||
tagValue = 0;
|
||||
}
|
||||
//读取数据
|
||||
switch (tagTypeID)
|
||||
{
|
||||
//轴合格标志
|
||||
case 8209:
|
||||
|
||||
break;
|
||||
//轴合格标志
|
||||
case 8203:
|
||||
IsGetgoodOrBad = true;
|
||||
try
|
||||
{
|
||||
boolTemp = (int[])tagValue;
|
||||
tagID = tagid;
|
||||
isGoodBad1 = Convert.ToInt32(boolTemp[sn_ShaftStep - 1]);
|
||||
//转换一下
|
||||
if (isGoodBad1 == -1)
|
||||
{
|
||||
isGoodBad1 = 0;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
tagID = -1;
|
||||
isGoodBad1 = 0;
|
||||
}
|
||||
break;
|
||||
//非标准REAL
|
||||
case 8210:
|
||||
tagValue_1 = GetNoNormalReal(tagValue);
|
||||
break;
|
||||
default:
|
||||
tagValue_1 = Convert.ToString(tagValue);
|
||||
break;
|
||||
}
|
||||
//单个数据进行读取
|
||||
if (tagOrderBy == 1)
|
||||
{
|
||||
//获取到了当前的列位置(1,2,3,4)
|
||||
//依次再获取合格标志,扭矩,转角
|
||||
switch (tagItemOrderBy)
|
||||
{
|
||||
case 0://合格标志
|
||||
if (!IsGetgoodOrBad)
|
||||
{
|
||||
tagID = tagid;
|
||||
try
|
||||
{
|
||||
isGoodBad1 = Convert.ToInt32(tagValue_1);
|
||||
//转换一下
|
||||
if (isGoodBad1 == -1)
|
||||
{
|
||||
isGoodBad1 = 0;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
isGoodBad1 = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1://扭矩值
|
||||
tagID1 = tagid;
|
||||
tavIDValue1 = tagValue_1;
|
||||
break;
|
||||
case 2://上限值1
|
||||
MaxValue1 = tagValue_1;
|
||||
break;
|
||||
case 3://下限值1
|
||||
MinValue1 = tagValue_1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (tagOrderBy == 2)
|
||||
{
|
||||
//获取到了当前的列位置(1,2,3,4)
|
||||
//依次再获取合格标志,扭矩,转角
|
||||
switch (tagItemOrderBy)
|
||||
{
|
||||
case 0://合格标志
|
||||
if (!IsGetgoodOrBad)
|
||||
{
|
||||
tagID = tagid;
|
||||
try
|
||||
{
|
||||
isGoodBad2 = Convert.ToInt32(tagValue_1);
|
||||
//转换一下
|
||||
if (isGoodBad2 == -1)
|
||||
{
|
||||
isGoodBad2 = 0;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
isGoodBad2 = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1://角度值
|
||||
tagID2 = tagid;
|
||||
tavIDValue2 = tagValue_1;
|
||||
break;
|
||||
case 2://上限值2
|
||||
MaxValue2 = tagValue_1;
|
||||
break;
|
||||
case 3://下限值2
|
||||
MinValue2 = tagValue_1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
tagID = -1;
|
||||
tagID1 = -1;
|
||||
tagID2 = -1;
|
||||
|
||||
tavIDValue1 = "";
|
||||
tavIDValue2 = "";
|
||||
MaxValue1 = "";
|
||||
MaxValue2 = "";
|
||||
MinValue1 = "";
|
||||
MinValue2 = "";
|
||||
//合格标志的TagID
|
||||
isGoodBad1 = 0;
|
||||
isGoodBad2 = 0;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 列位置(序号)对应的数据
|
||||
/// 保存数据到数据库
|
||||
/// </summary>
|
||||
/// <param name="opName"></param>
|
||||
/// <param name="engineTypeID"></param>
|
||||
/// <param name="engineType"></param>
|
||||
/// <param name="engineID"></param>
|
||||
/// <param name="tagOrderBy"></param>
|
||||
/// <param name="tagID"></param>
|
||||
/// <param name="tagID1"></param>
|
||||
/// <param name="tagID2"></param>
|
||||
/// <param name="tavIDValue1"></param>
|
||||
/// <param name="tavIDValue2"></param>
|
||||
/// <param name="isGoodBad"></param>
|
||||
private void GetPressData_Save(string opName, int engineTypeID, string engineType, string engineID,
|
||||
int tagOrderBy, int tagID, int tagID1, int tagID2, string tavIDValue1, string tavIDValue2, int isGoodBad1, int isGoodBad2, int PartPallet_Code, string MaxValue1, string MaxValue2, string MinValue1, string MinValue2,int sn_ShaftStep)
|
||||
{
|
||||
//保存数据到数据库
|
||||
//测量数据合格_手动拧紧_增加
|
||||
MisDataFun.BaseData_tagTable_QualityData_B5A_Insert
|
||||
(engineTypeID, engineType, engineID,
|
||||
tavIDValue1, isGoodBad1,
|
||||
opName, PartPallet_Code.ToString(), tagID1, tagID1, MaxValue1, MinValue1, sn_ShaftStep,1);
|
||||
//保存数据到数据库
|
||||
//测量数据合格_手动拧紧_增加
|
||||
MisDataFun.BaseData_tagTable_QualityData_B5A_Insert
|
||||
(engineTypeID, engineType, engineID,
|
||||
tavIDValue2, isGoodBad2,
|
||||
opName, PartPallet_Code.ToString(), tagID2, tagID2, MaxValue2, MinValue2, sn_ShaftStep,2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回非标准real
|
||||
/// </summary>
|
||||
/// <param name="vDataValue"></param>
|
||||
/// <returns></returns>
|
||||
static private string GetNoNormalReal(object vDataValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
string real_a;
|
||||
string real_b;
|
||||
string groupValueString;
|
||||
int length;
|
||||
|
||||
//int real_b_Int;
|
||||
|
||||
length = ((System.Array)(vDataValue)).Length;
|
||||
groupValueString = "";
|
||||
if (length != 2)
|
||||
return "0.0";
|
||||
|
||||
real_a = Convert.ToUInt16((((System.Array)(vDataValue)).GetValue(0))).ToString();
|
||||
real_b = Convert.ToUInt16((((System.Array)(vDataValue)).GetValue(1))).ToString("00");
|
||||
groupValueString = real_a + "." + real_b;
|
||||
return groupValueString;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "0.0";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
126
MisDataFunction/Function1051/MesServerFunction/SubmitToMisweb.cs
Normal file
126
MisDataFunction/Function1051/MesServerFunction/SubmitToMisweb.cs
Normal file
@@ -0,0 +1,126 @@
|
||||
using System;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 此类用于向WEB发送各种类型消息
|
||||
/// </summary>
|
||||
partial class FunctionMES
|
||||
{
|
||||
|
||||
/// <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>
|
||||
string Sendmessage(char Num,string Value, string OpName)
|
||||
{
|
||||
string SendMessage;
|
||||
string result = "";
|
||||
switch (Num)
|
||||
{
|
||||
case '1':
|
||||
//1(直接在界面通过选择机型确认工序内容)
|
||||
SendMessage = "MES|ProcessList|" + OpName + "|" + Value;
|
||||
result = AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case '2':
|
||||
//2显示物料
|
||||
SendMessage = "MES|MaterialList|" + OpName + "|" + Value;
|
||||
result = AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case '3':
|
||||
//3显示操作指导图片
|
||||
SendMessage = "MES|PicShow|" + OpName + "|" + Value;
|
||||
result = AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case '4':
|
||||
//4订单完工模块刷新完成数量
|
||||
SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
|
||||
AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case '5':
|
||||
SendMessage = "MES|ShowMoby|" + OpName + "|" + Value;
|
||||
result = AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case '6':
|
||||
SendMessage = "MES|MaterialCheckPosition|" + OpName + "|" +Value;
|
||||
result = AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case '7':
|
||||
SendMessage = "MES|WorkStart|" + OpName + "|" + Value;
|
||||
result = AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case '8'://清除MES生成编号
|
||||
|
||||
break;
|
||||
case '9':
|
||||
SendMessage = "MES|ConfirmOkGo|" + OpName + "|" + Value;
|
||||
result = AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case 'a':
|
||||
SendMessage = "MES|FixAllow|" + OpName + "|" + Value;
|
||||
result = AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 向WEB发送信息(value为字符串)
|
||||
/// </summary>
|
||||
/// <param name="Command">消息种类</param>
|
||||
/// <param name="Value">消息内容</param>
|
||||
/// <param name="OpName">工位号</param>
|
||||
string SendInfomation(string Command, string Value, string OpName)
|
||||
{
|
||||
string SendMessage = "MES|" + Command + "|" + OpName + "|" + Value;
|
||||
return 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, "Function02:SendActuallyCount");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
52
MisDataFunction/Function1051/MesServerFunction/UDP.Send.cs
Normal file
52
MisDataFunction/Function1051/MesServerFunction/UDP.Send.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
//using SystemFramework;
|
||||
using MesServerWork;
|
||||
using DataLinkMesWork1;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <summary>
|
||||
/// 发送信息到MES通讯服务器或者其他的
|
||||
/// </summary>
|
||||
/// <param name="Message"></param>
|
||||
private string AsyncSendMessage(string Message)
|
||||
{
|
||||
return MIS_SendMessage.asyncSendMessage(Message);
|
||||
}
|
||||
|
||||
/// <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_SendMessage.asyncSendMessage(SendMessage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送信息到打印机
|
||||
/// </summary>
|
||||
/// <param name="Message"></param>
|
||||
private void asyncSendMessageToMark(string Message)
|
||||
{
|
||||
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
MisDataFunction/Function1051/MesServerFunction/vssver2.scc
Normal file
BIN
MisDataFunction/Function1051/MesServerFunction/vssver2.scc
Normal file
Binary file not shown.
Reference in New Issue
Block a user