| | |
| | | if (measureBind.WorkPosition == "P1" && M141Config.StationCode == "S5" && detectResults.GetDefectDescList().Count == 0) |
| | | { |
| | | var defecttem1 = detectResults.SelectMany(u => u.AllNetResults).SelectMany(m => m.DetectDetails).Select(detail => detail.ClassName).ToList(); |
| | | |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Detail, $"{products[0].SN} S3S5检测 缺陷名称集合为{string.Join(",", defecttem1)}"); |
| | | |
| | | var defecttem = detectResults.SelectMany(u => u.AllNetResults.SelectMany(m => m.DetectDetails)).Where(u => u.ClassName == M141Config.defectname).ToList(); |
| | |
| | | |
| | | if (pList[0].Result == "OK") |
| | | { |
| | | M141Config.numpro++; |
| | | Msgreceice = Task.Run(() => mqtt.MESForProduceAsync(pList[0], M141Config.mesnum2.ToString(), M141Config.numpro)).Result; |
| | | //M141Config.numpro++; |
| | | //Msgreceice = Task.Run(() => mqtt.MESForProduceAsync(pList[0], M141Config.mesnum2.ToString(), M141Config.numpro)).Result; |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"产品{pList[0].PID}汇总OK暂时不上传"); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | if (M141Config.Isprint && !string.IsNullOrEmpty(obj.tary_label)) |
| | | { |
| | | StartPrint(obj.tary_label); |
| | | StartPrint(obj.tary_label, "Honeywell PX240S(300 dpi)"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"产品{pList[0].PID}数据上传MES异常 {Msgreceice}"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | int numplca = Convert.ToInt32(pList[0].SEQUENCE.Split('_')[0]); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"plc给出的产品序号为{numplca}"); |
| | |
| | | { |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"产品{newp.PID}关闭NG上传"); |
| | | } |
| | | //var tems = Task.Run(() => mqtt.MESForProduceAsync(newp, M141Config.mesnum2.ToString(), M141Config.numpro)).Result; |
| | | //M141Config.mesnum2++; |
| | | //LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"PlcNumForAll,前站NG排料且plc触发清零产品{newp.PID}数据上传,结果为{newp.Result}"); |
| | | |
| | | } |
| | | catch |
| | |
| | | data += "NA,"; |
| | | } |
| | | } |
| | | CSVRecordAsync($"AllDeviceProductRecord.csv", data, Head); |
| | | CSVRecordAsync($"AllDeviceProductRecord_{DateTime.Now.ToString("yyyyMMdd")}.csv", data, Head); |
| | | |
| | | } |
| | | catch (Exception exx) |
| | |
| | | PrintDocument printDocument1 = new PrintDocument(); |
| | | string Printmessage = ""; |
| | | |
| | | public void StartPrint(string str) |
| | | public void StartPrint(string str, string PrinterName) |
| | | { |
| | | try |
| | | { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //C229M2508250500002 |
| | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |