|
@@ -55,6 +55,7 @@ using System.Drawing;
|
|
|
using ICSharpCode.SharpZipLib.Zip;
|
|
|
using System.Text.RegularExpressions;
|
|
|
using System.Text;
|
|
|
+using SixLabors.ImageSharp;
|
|
|
|
|
|
/*
|
|
|
* 注:本源码对外提供,所以有些地方使用中文命名方法及变量
|
|
@@ -1732,7 +1733,7 @@ namespace MainForm
|
|
|
#region 测试项
|
|
|
if (GlobalContext.IsSendTestData)
|
|
|
{
|
|
|
- if (stationNameStr.Contains("OP31") || stationNameStr.Contains("OP32"))
|
|
|
+ if (stationNameStr.Contains("OP31") || stationNameStr.Contains("OP32") || stationNameStr.Contains("OP40") || stationNameStr.Contains("OP50"))
|
|
|
{
|
|
|
outRequest_Body.unitData.inspectionItemData.Add(
|
|
|
new XmStationOut_InspectionItemData()
|
|
@@ -1741,7 +1742,6 @@ namespace MainForm
|
|
|
childUnitState = inspectionItemData.childUnitState,
|
|
|
toolVersion = inspectionItemData.toolVersion,
|
|
|
dataItem = inspectionItemData.dataItem,
|
|
|
-
|
|
|
}
|
|
|
);
|
|
|
}
|
|
@@ -1770,7 +1770,9 @@ namespace MainForm
|
|
|
});
|
|
|
|
|
|
}
|
|
|
+ #endregion
|
|
|
|
|
|
+ #region 上传文件
|
|
|
if (GlobalContext.MESIsSendUpFile)
|
|
|
{
|
|
|
foreach (var item in fileUploadData.fileData)
|
|
@@ -1789,10 +1791,8 @@ namespace MainForm
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- #region 上传MES
|
|
|
- string jsonstr1 = JsonConvert.SerializeObject(outRequest_Body);
|
|
|
+ #region 上传MES
|
|
|
+ string jsonstr1 = JsonConvert.SerializeObject(outRequest_Body);
|
|
|
if (GlobalContext.IsSendProcessData)
|
|
|
{
|
|
|
XmMES_StationOutResponse response = new XmMES_StationOutResponse();
|
|
@@ -4744,7 +4744,7 @@ namespace MainForm
|
|
|
passFlag = "FAIL";
|
|
|
|
|
|
if (passFlag == "FAIL") AllpassFlag = passFlag;
|
|
|
- inspectionItemData.AddDataItem("","AB管气压", fAB_AirPressDiff.ToString(), fAB_AirPressDiffMax.ToString(), fAB_AirPressDiffMin.ToString(), passFlag);
|
|
|
+ inspectionItemData.AddDataItem("AirPressure","AB管气压", fAB_AirPressDiff.ToString(), fAB_AirPressDiffMax.ToString(), fAB_AirPressDiffMin.ToString(), passFlag);
|
|
|
}
|
|
|
|
|
|
if (fAB_AirPressMax > fAB_AirPressMin && (fAB_AirPressMax != 0 || fAB_AirPressMin != 0))
|
|
@@ -4755,7 +4755,7 @@ namespace MainForm
|
|
|
passFlag = "FAIL";
|
|
|
|
|
|
if (passFlag == "FAIL") AllpassFlag = passFlag;
|
|
|
- inspectionItemData.AddDataItem("","AB管气压差", fAB_AirPress.ToString(), fAB_AirPressMax.ToString(), fAB_AirPressMin.ToString(), passFlag);
|
|
|
+ inspectionItemData.AddDataItem("AirPressure","AB管气压差", fAB_AirPress.ToString(), fAB_AirPressMax.ToString(), fAB_AirPressMin.ToString(), passFlag);
|
|
|
}
|
|
|
|
|
|
inspectionItemData.childUnitSn = strProductBarcode;
|
|
@@ -4908,9 +4908,15 @@ namespace MainForm
|
|
|
{
|
|
|
//测试数据
|
|
|
//stPLC_MesData.mesCommFrmPLC.cmd = 2;
|
|
|
- //stPLC_MesData.BarcodeSet.strCarrierBarcode = "A235461";
|
|
|
+ stPLC_MesData.BarcodeSet.strCarrierBarcode = "A235461";
|
|
|
//stPLC_MesData.BarcodeSet.strPCBBarcode = "A1507V000239";
|
|
|
|
|
|
+ //stPLC_MesData.testData.fGlue_Areas = new float[] {12,22,16 };
|
|
|
+ //stPLC_MesData.testData.fGlue_AreasMax = 20f;
|
|
|
+ //stPLC_MesData.testData.fGlue_AreasMin = 0;
|
|
|
+ //stPLC_MesData.testData.fGlue_Heights = new float[] { 5, 8, 6.6f};
|
|
|
+ //stPLC_MesData.testData.fGlue_HeightsMax = 10f;
|
|
|
+ //stPLC_MesData.testData.fGlue_HeightsMin = 0;
|
|
|
|
|
|
//去除扫码产生的特殊字符
|
|
|
stPLC_MesData.BarcodeSet.strProductBarcode =
|
|
@@ -5255,7 +5261,55 @@ namespace MainForm
|
|
|
//}
|
|
|
//string paramJson = JsonConvert.SerializeObject(dic);
|
|
|
#endregion
|
|
|
- string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
|
+
|
|
|
+ string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);//过站生产数据
|
|
|
+
|
|
|
+ #region MAS测试项
|
|
|
+ XmMES_StationOutRequest_Body outRequest_Body = new XmMES_StationOutRequest_Body();
|
|
|
+ string passFlag = "";
|
|
|
+ string AllpassFlag = "PASS";
|
|
|
+ //胶线面积
|
|
|
+ float[] fGlue_Areas = stPLC_MesData.testData.fGlue_Areas;
|
|
|
+ float fGlue_AreasMax = stPLC_MesData.testData.fGlue_AreasMax;
|
|
|
+ float fGlue_AreasMin = stPLC_MesData.testData.fGlue_AreasMin;
|
|
|
+ //胶线高度
|
|
|
+ float[] fGlue_Heights = stPLC_MesData.testData.fGlue_Heights;
|
|
|
+ float fGlue_HeightsMax = stPLC_MesData.testData.fGlue_HeightsMax;
|
|
|
+ float fGlue_HeightsMin = stPLC_MesData.testData.fGlue_HeightsMin;
|
|
|
+
|
|
|
+ XmStationOut_InspectionItemData inspectionItemData = new XmStationOut_InspectionItemData();
|
|
|
+ if (fGlue_AreasMax > fGlue_AreasMin && (fGlue_AreasMax != 0 || fGlue_AreasMin != 0))
|
|
|
+ {
|
|
|
+ for (int i = 0; i < fGlue_Areas.Length -1 ; i++)
|
|
|
+ {
|
|
|
+ if (fGlue_Areas[i] > fGlue_AreasMin && fGlue_Areas[i] <= fGlue_AreasMax)
|
|
|
+ passFlag = "PASS";
|
|
|
+ else
|
|
|
+ passFlag = "FAIL";
|
|
|
+
|
|
|
+ if (passFlag == "FAIL") AllpassFlag = passFlag;
|
|
|
+ }
|
|
|
+ inspectionItemData.AddDataItem("GlueLine", "胶线面积", string.Join(",", fGlue_Areas), fGlue_AreasMax.ToString(), fGlue_AreasMin.ToString(), passFlag);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fGlue_HeightsMax > fGlue_HeightsMin && (fGlue_HeightsMax != 0 || fGlue_HeightsMin != 0))
|
|
|
+ {
|
|
|
+ for (int i = 0; i < fGlue_Heights.Length-1; i++)
|
|
|
+ {
|
|
|
+ if (fGlue_Heights[i] > fGlue_HeightsMin && fGlue_Heights[i] <= fGlue_HeightsMax)
|
|
|
+ passFlag = "PASS";
|
|
|
+ else
|
|
|
+ passFlag = "FAIL";
|
|
|
+
|
|
|
+ if (passFlag == "FAIL") AllpassFlag = passFlag;
|
|
|
+ }
|
|
|
+ inspectionItemData.AddDataItem("GlueLine", "胶线高度", string.Join(",", fGlue_Heights), fGlue_HeightsMax.ToString(), fGlue_HeightsMin.ToString(), passFlag);
|
|
|
+ }
|
|
|
+
|
|
|
+ inspectionItemData.childUnitSn = strProductBarcode;
|
|
|
+ inspectionItemData.childUnitState = AllpassFlag;
|
|
|
+ inspectionItemData.toolVersion = "1.0";
|
|
|
+ #endregion
|
|
|
|
|
|
int result1 = SwitctProcessData(stationNameStr, items, equipmentCode, processItem
|
|
|
, workorder_code, batch_num, mtltmrk, plcDate_YMD, supplierCode, sn, pass, CarrierBarcode,
|
|
@@ -5668,7 +5722,6 @@ namespace MainForm
|
|
|
{
|
|
|
Stopwatch stopwatch1 = new Stopwatch();
|
|
|
Stopwatch stopwatch2 = new Stopwatch();
|
|
|
-
|
|
|
|
|
|
try
|
|
|
{
|
|
@@ -5778,6 +5831,33 @@ namespace MainForm
|
|
|
#endregion
|
|
|
string paramJson = JsonConvert.SerializeObject(stPLC_MesData.mesData);
|
|
|
|
|
|
+
|
|
|
+ #region MAS测试项
|
|
|
+ XmMES_StationOutRequest_Body outRequest_Body = new XmMES_StationOutRequest_Body();
|
|
|
+ string passFlag = "";
|
|
|
+ string AllpassFlag = "PASS";
|
|
|
+ //ADD板的压力
|
|
|
+ float fForceAddPCB = stPLC_MesData.testData.fForceAddPCB;
|
|
|
+ float fForceAddPCBMax = stPLC_MesData.testData.fForceAddPCBMax;
|
|
|
+ float fForceAddPCBMin = stPLC_MesData.testData.fForceAddPCBMin;
|
|
|
+
|
|
|
+ XmStationOut_InspectionItemData inspectionItemData = new XmStationOut_InspectionItemData();
|
|
|
+ if (fForceAddPCBMax > fForceAddPCBMin && (fForceAddPCBMax != 0 || fForceAddPCBMin != 0))
|
|
|
+ {
|
|
|
+ if (fForceAddPCB > fForceAddPCBMin && fForceAddPCB <= fForceAddPCBMax)
|
|
|
+ passFlag = "PASS";
|
|
|
+ else
|
|
|
+ passFlag = "FAIL";
|
|
|
+
|
|
|
+ if (passFlag == "FAIL") AllpassFlag = passFlag;
|
|
|
+ inspectionItemData.AddDataItem("AirPressure", "ADD板压力", fForceAddPCB.ToString(), fForceAddPCBMax.ToString(), fForceAddPCBMin.ToString(), passFlag);
|
|
|
+ }
|
|
|
+
|
|
|
+ inspectionItemData.childUnitSn = strProductBarcode;
|
|
|
+ inspectionItemData.childUnitState = AllpassFlag;
|
|
|
+ inspectionItemData.toolVersion = "1.0";
|
|
|
+ #endregion
|
|
|
+
|
|
|
int result1 = 0;
|
|
|
byte mesResultFrmWeb = 0;
|
|
|
if (stPLC_MesData.mesCommFrmPLC.cmdParam == 2)
|