CarrierBarcodeCtrl.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
HeightDetection.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
M423DATA脚本/dbo.WarningConfigure-update20201117.sql | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
MainForm.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
SizeDetection.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
app.config | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
CarrierBarcodeCtrl.cs
@@ -93,8 +93,10 @@ else { if (temp.Length == 13) { CarrierBarcode = temp; temp = ""; temp = ""; } } } } HeightDetection.cs
@@ -305,11 +305,11 @@ double standardGap = opcConfig.batteryHeightLimit.Max - standardValue; double gap = adjustValue - standardValue; fakeValue = finalHeight = (gap / (errorBand / 2.0)) * standardGap + standardValue; fakeValue = finalHeight = Math.Round(((gap / (errorBand / 2.0)) * standardGap + standardValue), 5); if (finalHeight < opcConfig.batteryHeightLimit.Min || finalHeight > opcConfig.batteryHeightLimit.Max) { fakeValue = standardValue + (CommonUtil.random.NextDouble() - 0.5) * 2.0 * standardGap; fakeValue = Math.Round((standardValue + (CommonUtil.random.NextDouble() - 0.5) * 2.0 * standardGap), 5); } if (isEnableRawData) M423DATA½Å±¾/dbo.WarningConfigure-update20201117.sql
File was renamed from M423DATA½Å±¾/dbo.WarningConfigure-update20200510.sql @@ -341,3 +341,7 @@ (Val,Type,Content,Solution) values(48,1,N'䏿工使åºå 纤å¼å¸¸æ¥è¦',N'1.䏿工使¬è¯¥æäº§åï¼ä½æ¯ä¼ æå¨æ²¡ææ£æµå¾å°æè æ¯äº§å被认为åèµ°çæ åµï¼ä¼é ææ¤æ¥è¦ï¼ 2.䏿工使¬æ²¡æäº§åï¼ä½æ¯ä¼ æå¨æ£æµå°äºä¿¡å·ï¼å¯è½æ¯ä¼ æå¨è¯¯æåºæè å½åç䏿工ä½ä¸æå¼ç©æè æ¯è®¤ä¸ºæ¾ç½®äºäº§åã') insert into WarningConfigure (Val,Type,Content,Solution) values(2000,1,N'产åè¿ç»NGè¶ è¿è®¾å®æ¬¡æ°æ¥è¦',N'è¯·éæ¥ç¸å ³äººåï¼è®¾å¤å¤ä½å³å¯ç»§ç»') MainForm.cs
@@ -203,6 +203,20 @@ CommonUtil.IsRunning = true; SetControls(); opc.Write(OPCOutputTag.DetectResult_OK, false); opc.Write(OPCOutputTag.DetectResult_NG, false); CommonUtil.WriteLog(LogType.Inf, "åå§å䏿NA"); string continuousNGStr = ConfigurationManager.AppSettings["ContinuousNGThreshold"]; if (int.TryParse(continuousNGStr, out int temp)) { _continuousNGThreshold = temp; } else { _continuousNGThreshold = 999; } } public void Stop() @@ -592,6 +606,9 @@ lblEmptyQuantity.Text = measureResultTTL.EmptyQuantity.ToString(); } int _continuousNGThreshold = 999; int _continuousNG = 0; #region PLC çå¬ void OPCEventHandler(object sender, EventTool.ListenEventArgs e) { @@ -611,11 +628,12 @@ MeasureState pState = MeasureState.NA; int detectID = CommonUtil.StepControl.GetUnloadStepID(); ProductMeasureResult x = null; if (detectID > 0) { var x = (from t in productTestCollection where t.DetectID == detectID select t x = (from t in productTestCollection where t.DetectID == detectID select t ).FirstOrDefault(); if (x != default(ProductMeasureResult)) { @@ -647,18 +665,28 @@ case MeasureState.OK: opc.Write(OPCOutputTag.DetectResult_OK, true); opc.Write(OPCOutputTag.DetectResult_NG, false); CommonUtil.WriteLog(LogType.Inf, $"{x.DetectID}|{x.ProductNo}产ååºæ¾å ¥OK Tray"); _continuousNG = 0; break; case MeasureState.NG: opc.Write(OPCOutputTag.DetectResult_OK, false); opc.Write(OPCOutputTag.DetectResult_NG, true); CommonUtil.WriteLog(LogType.Inf, $"{x.DetectID}|{x.ProductNo}产ååºæ¾å ¥NG Tray"); CommonUtil.StepControl.RemoveById(detectID); _continuousNG++; break; default: opc.Write(OPCOutputTag.DetectResult_OK, false); opc.Write(OPCOutputTag.DetectResult_NG, false); CommonUtil.WriteLog(LogType.Inf, $"{x.DetectID}|{x.ProductNo}产ååºæ¾å ¥NA Tray"); CommonUtil.StepControl.RemoveById(detectID); _continuousNG = 0; break; } #endregion @@ -682,6 +710,15 @@ DisplayCycleTime((int)Math.Round(ts.TotalMilliseconds)); } unloadTime = DateTime.Now; if (_continuousNG >= _continuousNGThreshold) { //èæ¬ä¸è®¾ç½®æ¥è¦ç 2000表示è¿ç»NG次æ°å°è¾¾è®¾å®æ¥è¦ä¸é opc.Write(OPCInputTag.Alarm, 2000); CommonUtil.WriteLog(LogType.Inf, $"产åè¿ç»NG{_continuousNG}æ¬¡ï¼æ¥è¦æç¤º"); _continuousNG = 0; } // } break; @@ -878,8 +915,10 @@ if ((bool)item.value) { //opc.Write(OPCInputTag.UnloadBatteryDone, false); int batteryId = CommonUtil.StepControl.GetUnloadBatteryID(); CommonUtil.WriteLog(LogType.Inf, $"çµæ± 䏿å°ä½,Id:{batteryId}"); CommonUtil.StepControl.RemoveById(batteryId); detectionData.SaveTrayBarcode(batteryId); } SizeDetection.cs
@@ -334,6 +334,10 @@ btyLength += compL; btyWidth += compW; //éå¶ç²¾åº¦5ä½ btyLength = Math.Round(btyLength, 5); btyWidth = Math.Round(btyWidth, 5); lengthMeasureState = (btyLength >= opcConfig.batteryLengthLimit.Min && btyLength <= opcConfig.batteryLengthLimit.Max) ? MeasureState.OK : MeasureState.NG; widthMeasureState = (btyWidth >= opcConfig.batteryWidthLimit.Min && btyWidth <= opcConfig.batteryWidthLimit.Max) ? MeasureState.OK : MeasureState.NG; app.config
@@ -46,6 +46,8 @@ <add key="EnableRawData" value="false"/> <add key="HeightStandard" value="4.4"/> <add key="ErrorBand" value="2.0"/> <add key="ContiousNGThreshold" value="3"/> </appSettings> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>