init: 导入项目到 meswork Gitea
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using MesServerWork;
|
||||
using bizFacade;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class Functions_BASE_24
|
||||
{
|
||||
/// <summary>
|
||||
///1、物料验证
|
||||
///2、MES生成总成编号
|
||||
///3、MES传递机型
|
||||
/// 处理页面扫描条码
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="barcode"></param>
|
||||
public void Barcode(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
//20161228 条码连续扫描拼接错误
|
||||
//if (!BaseDataSystemMES.BarConfirm(barcode))
|
||||
//{
|
||||
// AsyncSendMessage_Notice(OpName, "条码号存在重复数据,请重新扫描!");
|
||||
// return;
|
||||
//}
|
||||
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
string barcode = Convert.ToString(msgEvent.TagValue);
|
||||
|
||||
bool ispartload = false;
|
||||
bool IsSuccess = false;
|
||||
int IsAllowWork;
|
||||
|
||||
BaseDataSystemMES.PartMaterial_DM_Update(OpName, barcode, out IsSuccess);
|
||||
//MIS_BASE.Read_PartLoad(OpName, out ispartload);
|
||||
|
||||
if (!IsSuccess)
|
||||
{
|
||||
AsyncSendMessage_Notice(OpName,"条码无效,请确认");
|
||||
return;
|
||||
}
|
||||
|
||||
Sendmessage("2", "1", OpName);//通知WEB前端更新零件信息
|
||||
|
||||
BaseDataSystemMES.MesServer_Judge_IsCanWork(OpName, out IsAllowWork);
|
||||
if(IsAllowWork==1)
|
||||
{
|
||||
//物料数据
|
||||
BaseDataSystemMES.Material_Insert(OpName, 1);
|
||||
|
||||
Sendmessage("49", "11", OpName);//向web发送消息
|
||||
|
||||
//工作完成
|
||||
//MIS_BASE.Write_MaterialVerifyOver(OpName, true);
|
||||
|
||||
//MIS_BASE.Write_FixAllow(OpName, true);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function03:Barcode");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using MesServerWork;
|
||||
using bizFacade;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class Functions_BASE_24
|
||||
{
|
||||
/// <summary>
|
||||
/// 合格放行
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
//private void ConfirmOkGo(object e)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// return;
|
||||
// DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||||
// string OpName = Convert.ToString(msgEvent.OpName);
|
||||
// int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
// if (tagValue == 1)
|
||||
// {
|
||||
// int EngineTypeID;//机型代码
|
||||
// int PartPallet_Code;//托盘编号
|
||||
// string EngineType;//机型
|
||||
// string EngineID;//工件编号
|
||||
// MIS_BASE.GetEngineTypeFromDB(OpName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code);
|
||||
|
||||
// //线首流水号
|
||||
// BaseDataSystemMES.FirstOpName_Code_Update(OpName, EngineID, PartPallet_Code.ToString());
|
||||
|
||||
// //物料数据
|
||||
// BaseDataSystemMES.Material_Insert(OpName, 1);
|
||||
|
||||
// MIS_BASE.Write_MaterialVerifyOver(OpName, true);
|
||||
|
||||
|
||||
// Sendmessage("49", "11", OpName);//向web发送消息
|
||||
// }
|
||||
// }
|
||||
// catch (Exception err)
|
||||
// {
|
||||
// ////ApplicationLog.WriteLog(err, "Function03:ConfirmOkGo");
|
||||
// }
|
||||
//}
|
||||
|
||||
//private void ConfirmOkGo(string OpName)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// //DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||||
// //string OpName = Convert.ToString(msgEvent.OpName);
|
||||
// //int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
// //if (tagValue == 1)
|
||||
// {
|
||||
// int EngineTypeID;//机型代码
|
||||
// int PartPallet_Code;//托盘编号
|
||||
// string EngineType;//机型
|
||||
// string EngineID;//工件编号
|
||||
// MIS_BASE.GetEngineTypeFromDB(OpName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code);
|
||||
|
||||
// //线首流水号
|
||||
// BaseDataSystemMES.FirstOpName_Code_Update(OpName, EngineID, PartPallet_Code.ToString());
|
||||
|
||||
// //物料数据
|
||||
// BaseDataSystemMES.Material_Insert(OpName, 1);
|
||||
|
||||
// MIS_BASE.Write_MaterialVerifyOver(OpName, true);
|
||||
|
||||
|
||||
// Sendmessage("49", "11", OpName);//向web发送消息
|
||||
// }
|
||||
// }
|
||||
// catch (Exception err)
|
||||
// {
|
||||
// ////ApplicationLog.WriteLog(err, "Function03:ConfirmOkGo");
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
//using SystemFramework;
|
||||
using MesServerWork;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class Functions_BASE_24
|
||||
{
|
||||
/// <summary>
|
||||
/// PLC传递机型处理
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void EngineTypeGetOver_PLC(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
int EngineTypeID;//机型代码
|
||||
int PartPallet_Code;//托盘编号
|
||||
string EngineType;//机型
|
||||
string EngineID;//工件编号
|
||||
string OrderForm;
|
||||
MIS_BASE.GetEngineTypeFromPLC(OpName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code,out OrderForm);
|
||||
EngineTypeGetOver_PLC_Work(OpName, EngineTypeID, EngineType, EngineID, PartPallet_Code, OrderForm);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function03:EngineTypeGetOver_PLC");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using MesServerWork;
|
||||
using bizFacade;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class Functions_BASE_24
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 不合格放行
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void FalseGO(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
|
||||
//不合格保存物料数据
|
||||
BaseDataSystemMES.Material_Insert_NG(OpName, 2);
|
||||
|
||||
Sendmessage("4", "1", OpName);//向web发送消息
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function03:FalseGO");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
//using SystemFramework;
|
||||
using MesServerWork;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class Functions_BASE_24
|
||||
{
|
||||
/// <summary>
|
||||
/// 保存完成(针对半自动和手动压装工位)
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void MesReadOver(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
//if (tagValue == 1)
|
||||
//{
|
||||
// int qualityMask;
|
||||
// MIS_BASE.Read_QualityMask(OpName, out qualityMask);
|
||||
|
||||
// //全部OK,给出合格放行
|
||||
// if (qualityMask == 1)
|
||||
// {
|
||||
// MIS_BASE.Write_ConfirmOkGo(OpName, true);
|
||||
// MIS_BASE.Write_FalseGO(OpName, false);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// MIS_BASE.Write_ConfirmOkGo(OpName, false);
|
||||
// MIS_BASE.Write_FalseGO(OpName, true);
|
||||
// }
|
||||
|
||||
// //发给Web页面显示质量数据
|
||||
// SendInfomation("ShowTimelyQuality", "1&" + qualityMask.ToString(), OpName);
|
||||
|
||||
//}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function03:MesReadOver");
|
||||
}
|
||||
}
|
||||
|
||||
private void MesReadOver(string OpName)
|
||||
{
|
||||
try
|
||||
{
|
||||
//DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||||
//string OpName = Convert.ToString(msgEvent.OpName);
|
||||
//int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
//if (tagValue == 1)
|
||||
{
|
||||
int qualityMask;
|
||||
MIS_BASE.Read_QualityMask(OpName, out qualityMask);
|
||||
|
||||
//全部OK,给出合格放行
|
||||
if (qualityMask == 1)
|
||||
{
|
||||
MIS_BASE.Write_ConfirmOkGo(OpName, true);
|
||||
MIS_BASE.Write_FalseGO(OpName, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
MIS_BASE.Write_ConfirmOkGo(OpName, false);
|
||||
MIS_BASE.Write_FalseGO(OpName, true);
|
||||
}
|
||||
|
||||
//发给Web页面显示质量数据
|
||||
SendInfomation("ShowTimelyQuality", "1&" + qualityMask.ToString(), OpName);
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function03:MesReadOver");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Security.Cryptography;
|
||||
using bizFacade;
|
||||
using DataLinkMesWork;
|
||||
//using SystemFramework;
|
||||
using MesServerWork;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class Functions_BASE_24
|
||||
{
|
||||
/// <summary>
|
||||
/// 申请上线
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void PartLoad(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
int engineTypeID;
|
||||
string engineID;
|
||||
string orderForm;
|
||||
string engineType="";
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
// 判断上线工位过站数是否与大于等于下单数
|
||||
// 若上线数大于等于订单数则写空托盘放行标志
|
||||
DataTable dt2;
|
||||
BaseDataSystemMES.GetStartGoCount(out dt2);
|
||||
if(Convert.ToInt32(dt2.Rows[0]["未上线数"]) == 0)
|
||||
{
|
||||
MIS_BASE.Write_TagTypeID(4, OpName, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
MIS_BASE.Write_TagTypeID(4, OpName, false);
|
||||
}
|
||||
|
||||
|
||||
//机器人取件到线体,物料验证
|
||||
MIS_BASE.Read_EngineID(OpName, out engineID);
|
||||
|
||||
//******************测试时用
|
||||
string sql;
|
||||
string workType = "0";
|
||||
string desType = "0";
|
||||
DataTable dt;
|
||||
BaseDataSystemMES.GetUpLoadPart(out dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
engineID = dt.Rows[0]["壳体码"].ToString();
|
||||
workType = dt.Rows[0]["接地方式"].ToString();
|
||||
desType = dt.Rows[0]["加工方式"].ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
MIS_BASE.Write_TagTypeID(69, OpName, "0");
|
||||
return;
|
||||
}
|
||||
//******************
|
||||
|
||||
// 取消界面选择订单功能,改为自动选择订单
|
||||
string result = "2";
|
||||
BaseDataSystemMES.MesServer_Process_OrderAdd_FirstOpName(OpName, engineID, out result);
|
||||
if (result == "2")
|
||||
{
|
||||
MIS_BASE.Write_TagTypeID(69, OpName, "0");
|
||||
return;
|
||||
}
|
||||
//创建线首物料验证表
|
||||
BaseDataSystemMES.MesServer_Process_EngineTypeOver_FirstOpName(OpName);
|
||||
//第二步,将零件信息转移到零件_临时表中(本地BOM与订单BOM的选择显示关系)
|
||||
BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName,1);
|
||||
//第三步直接验证物料
|
||||
bool IsSuccess;
|
||||
BaseDataSystemMES.PartMaterial_DM_Update(OpName, engineID, out IsSuccess);
|
||||
Sendmessage("123", "111", OpName);//向前台发送显示操作指南、物料、图片的命令
|
||||
|
||||
// 1上线零件条码与订单验证
|
||||
// 取消物料验证
|
||||
// Barcode(OpName, engineID);
|
||||
// if (Barcode( OpName, barcode))
|
||||
{
|
||||
// 不创建发动机号 仅仅获得机型engineType, 机型代码engineTypeID,订单号orderForm 思源
|
||||
// 直接用机器人扫描到的物料码,唯一 当作发动机号 engineID
|
||||
// DES壳体 2302180001,8S061803AA
|
||||
CreateEngineID(OpName, engineID, out engineType, out engineTypeID, out orderForm);
|
||||
//string[]str1 = engineID.Split(',');
|
||||
//if(str1.Length > 1)
|
||||
//{
|
||||
// engineID = str1[1];
|
||||
//}
|
||||
//if (engineType == "-1" || engineType == "" || engineTypeID == -1 || engineID == "")
|
||||
//{
|
||||
// AsyncSendMessage_Notice(OpName, "未选择订单或机型,请选择后重新到位");
|
||||
// return;
|
||||
//}
|
||||
//else
|
||||
{
|
||||
//将产品信息写入PLC
|
||||
MIS_BASE.Write_EngineTypeID_MES(OpName, engineTypeID);
|
||||
MIS_BASE.Write_EngineType_MES(OpName, engineType);
|
||||
MIS_BASE.Write_EngineID_MES(OpName, engineID);
|
||||
MIS_BASE.Write_TagTypeID(116, OpName, orderForm);
|
||||
MIS_BASE.Write_TagTypeID(77, OpName, workType);
|
||||
MIS_BASE.Write_TagTypeID(88, OpName, desType);
|
||||
MIS_BASE.Write_TagTypeID(69, OpName, "1");
|
||||
// 传递机型(MES)
|
||||
MIS_BASE.Write_EngineTypeGetOver_MES(OpName, true);
|
||||
|
||||
// 更新零件申请上线状态
|
||||
BaseDataSystemMES.UpdateOrderStatus(orderForm);
|
||||
|
||||
}
|
||||
SendInfomation("ShowMobyMES", engineID + "&" + engineType, OpName);
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// MIS_BASE.Write_TagTypeID(25, OpName, false);
|
||||
// AsyncSendMessage_Notice(OpName, "机器人扫描的二维码不合适");
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function03:PartLoad");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///1、物料验证
|
||||
///2、MES生成总成编号
|
||||
///3、MES传递机型
|
||||
/// 处理页面扫描条码
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="barcode"></param>
|
||||
public bool Barcode(string OpName,string barcode)
|
||||
{
|
||||
try
|
||||
{
|
||||
//20161228 条码连续扫描拼接错误
|
||||
//if (!BaseDataSystemMES.BarConfirm(barcode))
|
||||
//{
|
||||
// AsyncSendMessage_Notice(OpName, "条码号存在重复数据,请重新扫描!");
|
||||
// return;
|
||||
|
||||
//}
|
||||
//DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||||
//string OpName = Convert.ToString(msgEvent.OpName);
|
||||
//string barcode = Convert.ToString(msgEvent.TagValue);
|
||||
|
||||
bool ispartload = false;
|
||||
bool IsSuccess = false;
|
||||
int IsAllowWork;
|
||||
|
||||
BaseDataSystemMES.PartMaterial_DM_Update(OpName, barcode, out IsSuccess);
|
||||
//MIS_BASE.Read_PartLoad(OpName, out ispartload);
|
||||
|
||||
|
||||
|
||||
|
||||
if (!IsSuccess)
|
||||
{
|
||||
AsyncSendMessage_Notice(OpName, "条码无效,请确认");
|
||||
return false;
|
||||
}
|
||||
|
||||
Sendmessage("2", "1", OpName);//通知WEB前端更新零件信息
|
||||
|
||||
BaseDataSystemMES.MesServer_Judge_IsCanWork(OpName, out IsAllowWork);
|
||||
if (IsAllowWork == 1)
|
||||
{
|
||||
//物料数据
|
||||
BaseDataSystemMES.Material_Insert(OpName, 1);
|
||||
|
||||
Sendmessage("49", "11", OpName);//向web发送消息
|
||||
|
||||
//工作完成
|
||||
//MIS_BASE.Write_MaterialVerifyOver(OpName, true);
|
||||
|
||||
//MIS_BASE.Write_FixAllow(OpName, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function03:Barcode");
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Security.Cryptography;
|
||||
using bizFacade;
|
||||
//using SystemFramework;
|
||||
using MesServerWork;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class Functions_BASE_24
|
||||
{
|
||||
/// <summary>
|
||||
/// 上线扫码
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
public void PartScanOver(DoWhatPlc.CustomeEvetnArgs msgEvent)
|
||||
{
|
||||
try
|
||||
{
|
||||
//DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
int engineTypeID;
|
||||
string engineID;
|
||||
string orderForm;
|
||||
string engineType="";
|
||||
string scanPosition="1";
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
//机器人扫描, 读取码值
|
||||
MIS_BASE.Read_PartScanCode(40, OpName, out engineID);
|
||||
//去除码值中的空格
|
||||
engineID = engineID.Replace(" ", "");
|
||||
//机器人扫描, 读取壳体在小车上的位置
|
||||
MIS_BASE.Read_PartScanCode(37, OpName, out scanPosition);
|
||||
|
||||
//MIS_BASE.Read_EngineType(OpName, out engineType);
|
||||
bool checkReult = false;
|
||||
checkReult = CheckPartCode(engineID, scanPosition);
|
||||
if (checkReult)
|
||||
{
|
||||
MIS_BASE.Write_TagTypeID(61, OpName, "1");//写入匹配结果 OK
|
||||
}
|
||||
else
|
||||
{
|
||||
MIS_BASE.Write_TagTypeID(62, OpName, "1");//写入匹配结果 NG
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MIS_BASE.Write_TagTypeID(61, OpName, "0");
|
||||
MIS_BASE.Write_TagTypeID(62, OpName, "0");
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function03:PartLoad");
|
||||
}
|
||||
}
|
||||
|
||||
public bool CheckPartCode(string partCode, string scanPosition)
|
||||
{
|
||||
|
||||
BaseDataSystemMES.CheckUpLoadPart(partCode, scanPosition, out DataTable dt);
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
if(dt.Rows[0]["result"].ToString() == "1")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,252 @@
|
||||
using System;
|
||||
using MesServerWork;
|
||||
using bizFacade;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class Functions_BASE_24
|
||||
{
|
||||
/// <summary>
|
||||
/// 处理WEB页面发送过来的请求(m_Command + "|" + m_Value;)
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="Content"></param>
|
||||
private void WebSubmit(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
string Content = Convert.ToString(msgEvent.TagValue);
|
||||
|
||||
string[] dataArray = Content.Split('|');
|
||||
if (dataArray.Length != 2)
|
||||
return;
|
||||
//消息类型
|
||||
string m_Command = dataArray[0].ToString();
|
||||
//消息参数
|
||||
string m_Value = dataArray[1].ToString();
|
||||
//消息参数数量
|
||||
string[] m_Value_array = m_Value.Split('&');
|
||||
//消息参数长度
|
||||
int m_Value_length = m_Value_array.Length;
|
||||
|
||||
//工件信息
|
||||
string engineID = "";
|
||||
if (MIS_BASE.hashtable_EngineGetOver_EngineID == null)
|
||||
{
|
||||
MIS_BASE.InitHashtable_MesServerCode();
|
||||
}
|
||||
if (MIS_BASE.hashtable_EngineGetOver_EngineID.ContainsKey(OpName))
|
||||
{
|
||||
engineID = MIS_BASE.hashtable_EngineGetOver_EngineID[OpName].ToString();
|
||||
}
|
||||
|
||||
DoWhatPlc.CustomeEvetnArgs _e = new DoWhatPlc.CustomeEvetnArgs();
|
||||
_e.OpName = OpName;
|
||||
_e.TagValue = m_Value;
|
||||
|
||||
//根据请求的命令处理逻辑
|
||||
switch (m_Command)
|
||||
{
|
||||
case "Barcode":
|
||||
if (m_Value_length > 1) return;
|
||||
fun_Barcode(_e);
|
||||
break;
|
||||
case "ConfirmOkGo"://合格放行
|
||||
//删除不合格放行记录
|
||||
//修改托盘状态
|
||||
//Update_PalletStatus(OpName, 1, false);
|
||||
BaseDataSystemMES.BaseData_tagTable_Engine_IsNG_Delete(OpName, engineID);
|
||||
MIS_BASE.Write_ConfirmOkGo(OpName, true);
|
||||
MIS_BASE.Write_FalseGO(OpName, false);
|
||||
break;
|
||||
case "FalseGO"://返修放行
|
||||
//修改托盘状态
|
||||
//Update_PalletStatus(OpName, 3, false);
|
||||
BaseDataSystemMES.BaseData_tagTable_Engine_IsNG_Delete(OpName, engineID);
|
||||
MIS_BASE.Write_FalseGO(OpName, true);
|
||||
MIS_BASE.Write_ConfirmOkGo(OpName, false);
|
||||
break;
|
||||
case "NgGO"://不合格放行
|
||||
//保存不合格信息(必须保存不合格放行信息,由于B5A的Moby没有不合格标志位)
|
||||
BaseDataSystemMES.BaseData_tagTable_Engine_IsNG_Insert(OpName, engineID, "", "");
|
||||
MIS_BASE.Write_FalseGO(OpName, true);
|
||||
MIS_BASE.Write_ConfirmOkGo(OpName, false);
|
||||
break;
|
||||
case "OnLineState"://在线0、离线1、屏蔽2
|
||||
try
|
||||
{
|
||||
if (m_Value_length > 1) return;
|
||||
int a = Convert.ToInt32(m_Value);
|
||||
if (a <= 2)
|
||||
{
|
||||
BaseDataSystemMES.IsOnLine_Update(OpName, m_Value.ToString());
|
||||
MIS_BASE.Write_OnLineState(OpName, Convert.ToInt32(m_Value));
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
case "Reset"://复位,将MES所有的信息都复位了
|
||||
SetMoby(OpName);//将MES所有信号清空
|
||||
break;
|
||||
case "FixAllow"://重新拧紧
|
||||
MIS_BASE.Write_FixAllow(OpName, false);
|
||||
MIS_BASE.Write_FixAllow(OpName, true);
|
||||
break;
|
||||
case "IsAutoGetEngineID"://自动手动申请编号(线首)
|
||||
if (m_Value_length > 1) return;
|
||||
MIS_BASE.Write_IsAutoGetEngineID(OpName, Convert.ToInt32(m_Value));
|
||||
BaseDataSystemMES.OpName_MIS_AutoOrMaunal_Insert(OpName, Convert.ToInt32(m_Value));
|
||||
break;
|
||||
case "PartPalletGoOver"://空托盘放行
|
||||
int Is_PartPalletGoOver;
|
||||
MIS_BASE.Read_PartPalletGoOver(OpName, out Is_PartPalletGoOver);
|
||||
if (Is_PartPalletGoOver == 1)
|
||||
{
|
||||
MIS_BASE.Write_PartPalletGoOver(OpName, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
MIS_BASE.Write_PartPalletGoOver(OpName, 0);
|
||||
}
|
||||
break;
|
||||
case "SetMoby"://清空托盘(线首)
|
||||
SetMoby(OpName);
|
||||
//MIS_BASE.Write_PartPalletCode_PLC(OpName, 1);
|
||||
break;
|
||||
case "RepairUplineMES"://返修上线
|
||||
MIS_BASE.Write_RepairUpline_MES(OpName, true);
|
||||
break;
|
||||
case "CancelRepair"://将返修件置为正常件
|
||||
|
||||
break;
|
||||
case "PartPalletCode"://申请写入托盘号
|
||||
//MIS_BASE.Write_PartPalletCode_PLC(OpName, 1);
|
||||
break;
|
||||
case "WritePartPalletCode"://写入托盘号
|
||||
if (m_Value_length > 1) return;
|
||||
MIS_BASE.Write_PalletCode(OpName, Convert.ToInt32(m_Value));
|
||||
break;
|
||||
case "Normal"://启用正常拧紧工位
|
||||
MIS_BASE.Write_Normal(OpName, 1);
|
||||
MIS_BASE.Write_UnNormal(OpName, 0);
|
||||
break;
|
||||
case "UnNormal"://启用备用拧紧工位
|
||||
MIS_BASE.Write_Normal(OpName, 0);
|
||||
MIS_BASE.Write_UnNormal(OpName, 1);
|
||||
break;
|
||||
case "ResetDevice"://复位设备
|
||||
MIS_BASE.Write_ResetDevice(OpName, true);
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
MIS_BASE.Write_ResetDevice(OpName, false);
|
||||
break;
|
||||
case "IsNeedRepaire"://返修上线(返修上线点)
|
||||
if (Convert.ToInt32(m_Value) == 1)
|
||||
{
|
||||
//修改托盘状态
|
||||
MIS_BASE.Write_PalletInfo(OpName, 3);
|
||||
//通知修改成功
|
||||
MIS_BASE.Write_UpdatePalletOK(OpName, true);
|
||||
IsNeedRepaire_OK(OpName);
|
||||
|
||||
}
|
||||
else if (Convert.ToInt32(m_Value) == 0)
|
||||
{
|
||||
//通知修改成功
|
||||
MIS_BASE.Write_UpdatePalletOK(OpName, true);
|
||||
//直接给出工作完成
|
||||
MIS_BASE.Write_MaterialVerifyOver(OpName, true);
|
||||
}
|
||||
else
|
||||
{ }
|
||||
|
||||
break;
|
||||
//初始化网页信号
|
||||
case "IniSingalToWeb":
|
||||
InitializeSingalToWeb(OpName);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function03:WebSubmit");
|
||||
}
|
||||
}
|
||||
private void SetMoby(string OpName)
|
||||
{
|
||||
try
|
||||
{
|
||||
//清空Moby时,需要将MES信号清空
|
||||
MIS_BASE.Write_ClearMesMoby(OpName);
|
||||
|
||||
BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
|
||||
Sendmessage("5123", "1111", OpName);
|
||||
|
||||
MIS_BASE.Write_ResetDevice(OpName, true);
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
MIS_BASE.Write_ResetDevice(OpName, false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
/// 网页重现登录,恢复关闭前的页面状态
|
||||
/// </summary>
|
||||
/// <param name="Opname">工位号</param>
|
||||
private void InitializeSingalToWeb(string OpName)
|
||||
{
|
||||
Sendmessage("5123", "1111", OpName);//向web发送消息
|
||||
//工件到位 DBX0.1
|
||||
bool S_WorkStart;
|
||||
MIS_BASE.Read_WorkStart(OpName, out S_WorkStart);
|
||||
if (S_WorkStart == true)
|
||||
{
|
||||
SendInfomation("WorkStart", Convert.ToString(Convert.ToInt32(S_WorkStart)), OpName);
|
||||
}
|
||||
bool ispartload = false;
|
||||
MIS_BASE.Read_PartLoad(OpName, out ispartload);
|
||||
if (ispartload)
|
||||
{
|
||||
SendInfomation("PartLoad", Convert.ToString(Convert.ToInt32(ispartload)), OpName);
|
||||
}
|
||||
bool isEngineTypeGetOver_MES = false;
|
||||
MIS_BASE.Read_EngineTypeGetOver_MES(OpName, out isEngineTypeGetOver_MES);
|
||||
if (isEngineTypeGetOver_MES)
|
||||
{
|
||||
SendInfomation("EngineTypeGetOverMES", Convert.ToString(Convert.ToInt32(isEngineTypeGetOver_MES)), OpName);
|
||||
}
|
||||
//传递机型 DBX0.4
|
||||
bool S_EngineGetOver;
|
||||
MIS_BASE.Read_EngineGetOver_PLC(OpName, out S_EngineGetOver);
|
||||
if (S_EngineGetOver == true)
|
||||
{
|
||||
SendInfomation("EngineTypeGetOverPLC", Convert.ToString(Convert.ToInt32(S_EngineGetOver)), OpName);
|
||||
|
||||
}
|
||||
|
||||
//允许工作 DBX3.1
|
||||
bool S_FixAllow;
|
||||
MIS_BASE.Read_FixAllow(OpName, out S_FixAllow);
|
||||
if (S_FixAllow == true)
|
||||
{
|
||||
SendInfomation("FixAllow", Convert.ToString(Convert.ToInt32(S_FixAllow)), OpName);
|
||||
//有允许工作信号,才初始化指导拧紧
|
||||
}
|
||||
|
||||
//工作完成 DBX2.3
|
||||
bool S_MaterialVerifyOver;
|
||||
MIS_BASE.Read_MaterialVerifyOver(OpName, out S_MaterialVerifyOver);
|
||||
if (S_MaterialVerifyOver == true)
|
||||
{
|
||||
SendInfomation("MaterialVerifyOver", Convert.ToString(Convert.ToInt32(S_MaterialVerifyOver)), OpName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using bizFacade;
|
||||
using MesServerWork;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class Functions_BASE_24
|
||||
{
|
||||
/// <summary>
|
||||
/// 工件到位与离开时,清空MES自身信号
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
/// <param name="tagValue"></param>
|
||||
private void WorkStart(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
//DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||||
//string OpName = Convert.ToString(msgEvent.OpName);
|
||||
//int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
PartLoad_Show(e);
|
||||
|
||||
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function23:WorkStart");
|
||||
}
|
||||
}
|
||||
private void PartLoad_Show(object e)
|
||||
{
|
||||
try
|
||||
{
|
||||
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
if (tagValue == 1)
|
||||
{
|
||||
BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
|
||||
|
||||
Sendmessage("123", "111", OpName);//向前台发送显示操作指南、物料、图片的命令
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function01:PartLoad");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user