init: 导入项目到 meswork Gitea
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using bizFacade;
|
||||
using MesServerWork;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class Functions_BASE_04
|
||||
{
|
||||
/// <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;
|
||||
if (!GetShaftWoringStepIsWorked_WorkGroup(OpName, engineTypeID, engineType, out ProcessCode, out BoltCode,out workStepProperty))
|
||||
{
|
||||
//发动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);
|
||||
}
|
||||
else
|
||||
{
|
||||
//如果合格,在线,回写“合格放行”和“工作完成”信号(注意清零)
|
||||
MIS_BASE.Write_ConfirmOkGo(OpName, true);
|
||||
MIS_BASE.Write_FalseGO(OpName, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <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)
|
||||
{
|
||||
ProcessCode = 0;
|
||||
BoltCode = 0;
|
||||
workStepProperty = 0;
|
||||
bool sn_WorkingStepIsOver = true;//是否完成拧紧
|
||||
|
||||
//电子看板_工位机型_质量数据测量位置_临时表_查询_完成情况
|
||||
BaseDataSystemMES.MesServer_ShaftPosition_Select_FinishResult(opName, out ProcessCode, out BoltCode, out workStepProperty, out sn_WorkingStepIsOver);
|
||||
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,151 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using bizFacade;
|
||||
using MesServerWork;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class Functions_BASE_04
|
||||
{
|
||||
|
||||
/// <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;
|
||||
int MES_QualityMask = 1;
|
||||
//string OrderForm = "";//订单号
|
||||
DataTable dt;
|
||||
|
||||
//第一步,查询订单号,保存机型、机型代码、总成号、托盘号、订单号到数据库
|
||||
BaseDataSystemMES.GetEngineID_Select(OpName, EngineID, out dt);
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
OrderForm = Convert.ToString(dt.Rows[0]["订单号"]);
|
||||
}
|
||||
BaseDataSystemMES.OpName_MIS_MOBY_Insert(OpName, OrderForm, EngineTypeID, EngineType, EngineID, PartPallet_Code, 0, 0, "");
|
||||
SaveMobyMessage(OpName, EngineTypeID, EngineType, EngineID, OrderForm);
|
||||
//第二步,将拧紧的信息放入到临时表里
|
||||
BaseDataSystemMES.MesServer_ShaftPosition_EngineTypeOver(OpName);
|
||||
|
||||
//第三步,将零件信息转移到零件_临时表中(本地BOM与订单BOM的选择显示关系)
|
||||
BaseDataSystemMES.MesServer_Process_EngineTypeOver(OpName);
|
||||
|
||||
//通知web显示
|
||||
Sendmessage("5123", "1111", OpName);
|
||||
|
||||
MIS_BASE.Read_PalletInfo(OpName, out MES_QualityMask);//合格标志
|
||||
MIS_BASE.Read_RepairStatus_PLC(OpName, out RepairPartStatusPLC);//返修标志
|
||||
|
||||
SendInfomation("QualityMask", Convert.ToString(MES_QualityMask), OpName);//显示合格标志
|
||||
SendInfomation("RepairPartStatusPLC", Convert.ToString(RepairPartStatusPLC), OpName);//显示返修标志
|
||||
|
||||
if (MES_QualityMask != 1)
|
||||
{
|
||||
//工作完成
|
||||
MIS_BASE.Write_MaterialVerifyOver(OpName, true);
|
||||
SendInfomation("NgGO", "1", OpName);//显示不合格标志
|
||||
return;
|
||||
}
|
||||
|
||||
//第四步,用于工件离开后完工数量统计及工件编号追溯
|
||||
BaseDataSystemMES.MaterialPush_EngineIDStatus_Insert(OpName);
|
||||
|
||||
//第五步,获取是否允许工作
|
||||
BaseDataSystemMES.MesServer_Judge_IsCanWork(OpName, out IsAllowWork);
|
||||
|
||||
//通知web显示
|
||||
SendInfomation("ShaftPosition", Convert.ToString(IsAllowWork), OpName);//显示拧紧位置
|
||||
|
||||
|
||||
//暂时先定义为扫描完成才能进行压装工作,因为考虑到工作完成后,操作工未必会去扫描物料的情况
|
||||
if (IsAllowWork == 1)
|
||||
{
|
||||
//拧紧逻辑
|
||||
InitWorkStep(OpName, EngineTypeID, EngineType, EngineID);
|
||||
}
|
||||
else
|
||||
{
|
||||
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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 允许读发动机号后,判断是工件否合格
|
||||
/// </summary>
|
||||
private bool TestEngineIDIsNG(string OpName, string EngineID)
|
||||
{
|
||||
//MES数据库中的不合格放行信息
|
||||
bool isNG = false;
|
||||
DataTable dt;
|
||||
isNG = BaseDataSystemMES.BaseData_tagTable_Engine_IsNG_Select(OpName, EngineID, out dt);
|
||||
return isNG;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,323 @@
|
||||
using System;
|
||||
using MesServerWork;
|
||||
//using BasicData;
|
||||
using System.Collections;
|
||||
using bizFacade;
|
||||
//using SystemFramework;
|
||||
using System.Data;
|
||||
using DoWhatPlc;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class Functions_BASE_04
|
||||
{
|
||||
/// <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
|
||||
BaseDataSystemMES.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;
|
||||
//合格标志的TagID
|
||||
int tagID_isOK;
|
||||
|
||||
//TagID
|
||||
int tagID;
|
||||
int tagID1;
|
||||
int tagID2;
|
||||
|
||||
//根据工位号获取哈西表
|
||||
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_isOK);
|
||||
|
||||
if (tagID == -1 || tagID1 == -1 || tagID2 == -1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GetPressData_Save(opName, engineTypeID, engineType, engineID,
|
||||
sn_ShaftStep, tagID, tagID1, tagID2, tagValue1, tagValue2, tagID_isOK, PartPallet_Code);
|
||||
|
||||
isOK = tagID_isOK;
|
||||
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 isGoodBad)
|
||||
{
|
||||
int[] boolTemp = new int[32];//int数组存储轴类合格标志
|
||||
bool IsGetgoodOrBad = false;//是否根据8203或者8209获取到合格标志
|
||||
//初始化赋值
|
||||
tagID = -1;
|
||||
tagID1 = -1;
|
||||
tagID2 = -1;
|
||||
|
||||
tavIDValue1 = "";
|
||||
tavIDValue2 = "";
|
||||
//合格标志的TagID
|
||||
isGoodBad = 0;
|
||||
|
||||
QualityDataType 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 = (QualityDataType)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;
|
||||
isGoodBad = Convert.ToInt32(boolTemp[sn_ShaftStep - 1]);
|
||||
//转换一下
|
||||
if (isGoodBad == -1)
|
||||
{
|
||||
isGoodBad = 0;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
tagID = -1;
|
||||
isGoodBad = 0;
|
||||
}
|
||||
break;
|
||||
//非标准REAL
|
||||
case 8210:
|
||||
tagValue_1 = GetNoNormalReal(tagValue);
|
||||
break;
|
||||
default:
|
||||
tagValue_1 = Convert.ToString(tagValue);
|
||||
break;
|
||||
}
|
||||
//单个数据进行读取
|
||||
if (tagOrderBy == sn_ShaftStep)
|
||||
{
|
||||
//获取到了当前的列位置(1,2,3,4)
|
||||
//依次再获取合格标志,扭矩,转角
|
||||
switch (tagItemOrderBy)
|
||||
{
|
||||
case 0://合格标志
|
||||
if (!IsGetgoodOrBad)
|
||||
{
|
||||
tagID = tagid;
|
||||
try
|
||||
{
|
||||
isGoodBad = Convert.ToInt32(tagValue_1);
|
||||
//转换一下
|
||||
if (isGoodBad == -1)
|
||||
{
|
||||
isGoodBad = 0;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
isGoodBad = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
tagID1 = tagid;
|
||||
tavIDValue1 = tagValue_1;
|
||||
break;//扭矩值
|
||||
case 2://转角值
|
||||
tagID2 = tagid;
|
||||
tavIDValue2 = tagValue_1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
tagID = -1;
|
||||
tagID1 = -1;
|
||||
tagID2 = -1;
|
||||
|
||||
tavIDValue1 = "";
|
||||
tavIDValue2 = "";
|
||||
//合格标志的TagID
|
||||
isGoodBad = 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 isGoodBad, int PartPallet_Code)
|
||||
{
|
||||
|
||||
//保存数据到数据库
|
||||
//测量数据合格_手动拧紧_增加
|
||||
BaseDataSystemMES.BaseData_tagTable_QualityData_B5A_Insert
|
||||
(engineTypeID, engineType, engineID,
|
||||
tavIDValue1, isGoodBad,
|
||||
opName, PartPallet_Code.ToString(), tagID1, tagID);
|
||||
//保存数据到数据库
|
||||
//测量数据合格_手动拧紧_增加
|
||||
BaseDataSystemMES.BaseData_tagTable_QualityData_B5A_Insert
|
||||
(engineTypeID, engineType, engineID,
|
||||
tavIDValue2, isGoodBad,
|
||||
opName, PartPallet_Code.ToString(), tagID2, tagID);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <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";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
using System;
|
||||
using bizFacade;
|
||||
//using SystemFramework;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 此类用于向WEB发送各种类型消息
|
||||
/// </summary>
|
||||
partial class Functions_BASE_04
|
||||
{
|
||||
|
||||
/// <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':
|
||||
//3显示操作指导图片
|
||||
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':
|
||||
SendMessage = "MES|OrderFormList|" + OpName + "|" + Value;
|
||||
AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case '9':
|
||||
SendMessage = "MES|ConfirmOkGo|" + OpName + "|" + Value;
|
||||
AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
case 'a':
|
||||
SendMessage = "MES|FixAllow|" + OpName + "|" + Value;
|
||||
AsyncSendMessage(SendMessage);
|
||||
break;
|
||||
default:
|
||||
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, "Function04:SendActuallyCount");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using bizFacade;
|
||||
//using SystemFramework;
|
||||
using MesServerWork;
|
||||
|
||||
namespace MesServerFunctions
|
||||
{
|
||||
partial class Functions_BASE_04
|
||||
{
|
||||
/// <summary>
|
||||
/// 发送信息到MES通讯服务器或者其他的
|
||||
/// </summary>
|
||||
/// <param name="Message"></param>
|
||||
private void AsyncSendMessage(string Message)
|
||||
{
|
||||
MIS_BASE.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_BASE.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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user