MVP!
This commit is contained in:
114
MisDataFunction/Function1055/Methods/AllowTighteningStep.cs
Normal file
114
MisDataFunction/Function1055/Methods/AllowTighteningStep.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
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)
|
||||
{
|
||||
// 显示弹窗与图片 不知道为啥没有 后加读
|
||||
SendInfomation("ShaftPosition", "1", OpName);
|
||||
//发动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;
|
||||
}
|
||||
}
|
||||
}
|
||||
133
MisDataFunction/Function1055/Methods/EngineGetOverBaseWork.cs
Normal file
133
MisDataFunction/Function1055/Methods/EngineGetOverBaseWork.cs
Normal file
@@ -0,0 +1,133 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Threading;
|
||||
using MesServerWork;
|
||||
using MisDataFunDll;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class FunctionMES
|
||||
{
|
||||
/// <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;
|
||||
int RepairPartStatusPLC = 0;
|
||||
//第一步,将操作指南转移到操作指南_临时表中
|
||||
MisDataFun.MesServer_ProcessList_EngineTypeOver(OpName);
|
||||
|
||||
//第一步,将拧紧的信息放入到临时表里
|
||||
MisDataFun.MesServer_ShaftPosition_EngineTypeOver(OpName);
|
||||
|
||||
//第二步,将零件信息转移到零件_临时表中
|
||||
MisDataFun.MesServer_Process_EngineTypeOver(OpName);
|
||||
|
||||
//通知web显示
|
||||
SendMessageFun.SendMessage("5123", "1111", OpName);
|
||||
|
||||
MIS_BASE.Read_RepairStatus_PLC(OpName, out RepairPartStatusPLC);//返修标志
|
||||
// 通知web返修标志
|
||||
SendMessageFun.SendInfomation("RepairPartStatusPLC", Convert.ToString(RepairPartStatusPLC), OpName);//显示返修标志
|
||||
|
||||
//第四步,获取是否允许工作
|
||||
MisDataFun.MesServer_Judge_IsCanWork(OpName, out IsAllowWork);
|
||||
|
||||
//第五步 判断是否需要二次扫码验证Pack码
|
||||
MIS_BASE.Read_TagValueByTagTypeID(54, OpName, out string IsMatchBarcode);
|
||||
// 如果到站不需要扫托盘码的工位直接跳过
|
||||
if (!MisDataFun.GetSpecialOpExist(OpName, "到站扫托盘码")) IsMatchBarcode = "1";
|
||||
|
||||
//暂时先定义为扫描完成才能进行压装工作,因为考虑到工作完成后,操作工未必会去扫描物料的情况
|
||||
if (IsAllowWork == 1 && IsMatchBarcode == "1")
|
||||
{
|
||||
//拧紧逻辑
|
||||
InitWorkStep(OpName, EngineTypeID, EngineType, EngineID);
|
||||
}
|
||||
else
|
||||
{
|
||||
string msg = "请扫描物料!";
|
||||
if (IsMatchBarcode != "1") msg = "请扫码进行托盘比对!";
|
||||
SendMessageFun.AsyncSendMessage_Notice(OpName, msg);
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "barcode", msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 二次工作
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
private void EngineTypeGetOver_PLC_Work_two(string OpName)
|
||||
{
|
||||
MisDataFun.LogRecording_OP(OpName, "INFO", "MIS", "PLC传递机型!");
|
||||
MIS_BASE.Write_TagValueByTagTypeID(34, OpName, false); // 复位报警(MES)
|
||||
|
||||
int EngineTypeID;//机型代码
|
||||
string EngineType;//机型
|
||||
string EngineID;//工件编号
|
||||
string OrderForm; // 工单号
|
||||
int PartPallet_Code;//托盘编号
|
||||
|
||||
MIS_BASE.GetEngineTypeFromPLC(OpName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out OrderForm);
|
||||
|
||||
// 判断PLC机型是否写入
|
||||
if (EngineTypeID <= 0 || EngineID == "")
|
||||
{
|
||||
MIS_BASE.Write_TagValueByTagTypeID(34, OpName, true);// MES报警
|
||||
string msg = "【" + OpName + "】" + "PLC机型写入为空,EngineTypeID:" + EngineTypeID + ",EngineID:" + EngineID;
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MisDataFun.LogRecording_OP(OpName, "ERROR", "EngineTypeGetOver", msg);
|
||||
return;
|
||||
}
|
||||
|
||||
// PDC产线plc只写了发动机号和机型代码,其余要从数据库中读取
|
||||
MisDataFun.Moby_Select_PDC(EngineID, out OrderForm, out EngineType, out EngineTypeID);
|
||||
|
||||
MisDataFun.OpName_MIS_MOBY_Insert(OpName, EngineTypeID, EngineType, EngineID, PartPallet_Code, OrderForm, 0, 0, "");
|
||||
EngineTypeGetOver_PLC_Work(OpName, EngineTypeID, EngineType, EngineID, PartPallet_Code, OrderForm);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 跳过二次工作
|
||||
/// </summary>
|
||||
/// <param name="OpName"></param>
|
||||
private void EngineTypeGetOver_PLC_Work_Skip(string OpName)
|
||||
{
|
||||
|
||||
MIS_BASE.Write_MesWorkFinish(OpName, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返修件需要工作
|
||||
/// </summary>
|
||||
/// <param name="OpName">工位号</param>
|
||||
private void IsNeedRepaire_OK(string OpName)
|
||||
{
|
||||
//string orderForm = "";
|
||||
//int engineTypeID;
|
||||
//string engineType = "";
|
||||
//string engineID = "";
|
||||
//string palletCode = "";
|
||||
//int isRepair;
|
||||
//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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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, ProcessCode, 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 + (sn_ShaftStep * 4);
|
||||
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/Function1055/Methods/SubmitToMisweb.cs
Normal file
126
MisDataFunction/Function1055/Methods/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/Function1055/Methods/UDP.Send.cs
Normal file
52
MisDataFunction/Function1055/Methods/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/Function1055/Methods/vssver2.scc
Normal file
BIN
MisDataFunction/Function1055/Methods/vssver2.scc
Normal file
Binary file not shown.
Reference in New Issue
Block a user