| | |
| | | Idt_geometry_dataRepository dataRepository = new dt_geometry_dataRepository(Context); |
| | | Idt_mes_detailRepository mes_DetailRepository = new dt_mes_detailRepository(Context); |
| | | Idt_mes_headRepository mes_HeadRepository = new dt_mes_headRepository(Context); |
| | | Idt_geometry_data_detectionlineRepository detectionlineRepository = new dt_geometry_data_detectionlineRepository(Context); |
| | | var plc = repository.FindFirst(x => x.plcinfo_name == client.PLCName); |
| | | List<string> names = new List<string>() { "1åå
è¾é䏿æ¥è¯¢è½¦è½®", "2åå
è¾é䏿æ¥è¯¢è½¦è½®", "3åå
è¾é䏿æ¥è¯¢è½¦è½®", "è¾é䏿æ¥è¯¢è½¦è½®" }; |
| | | foreach (string name in names) |
| | |
| | | client.WriteByOrder("W_i_status", (byte)2, name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | //WriteDBLog.Error(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°å·¥åä¿¡æ¯", "PCS"); |
| | | WriteLog.Write_Log(name, wp_id, "é误信æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°å·¥åä¿¡æ¯"); |
| | | #endregion |
| | | continue; |
| | | } |
| | | |
| | | #region MyRegion |
| | | //var mes_Detail = mes_DetailRepository.FindFirst(x => x.SN == wp_id); |
| | | //if (mes_Detail == null) |
| | | //{ |
| | | // client.WriteByOrder("W_i_status", (byte)2, name); |
| | | // client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | // #region æ¥å¿è®°å½ |
| | | // WriteDBLog.Error(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°å·¥å详æ
", "PCS"); |
| | | // #endregion |
| | | // continue; |
| | | //} |
| | | //var mes_Head = mes_HeadRepository.FindFirst(x => x.jobID == mes_Detail.jobID); |
| | | //if (mes_Head == null) |
| | | //{ |
| | | // client.WriteByOrder("W_i_status", (byte)2, name); |
| | | // client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | // #region æ¥å¿è®°å½ |
| | | // WriteDBLog.Error(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°å·¥å头表", "PCS"); |
| | | // #endregion |
| | | // continue; |
| | | //} |
| | | #endregion |
| | | |
| | | |
| | | if (name != "è¾é䏿æ¥è¯¢è½¦è½®") |
| | | var geometry = Pipeline.QueryMateriel(Mes_Work.drawingNo); |
| | | if (geometry == null) |
| | | { |
| | | //var geometry = dataRepository.FindFirst(x => x.TypeId == (Int32)wp_type); |
| | | var geometry = dataRepository.Find(x => x.Description == Mes_Work.drawingNo).FirstOrDefault(); |
| | | var geometry1 = detectionlineRepository.Find(x => x.Description == Mes_Work.drawingNo).FirstOrDefault(); |
| | | if (geometry == null && geometry1 == null) |
| | | { |
| | | //DBExtension.Write(details.Where(x => x.plcdetail_name == "W_i_status").First(), client, (Int16)2); |
| | | //1-æ¾å°æ°æ®ï¼2-æªæ¾å°å·¥ä»¶ç±»åæ°æ® |
| | | client.WriteByOrder("W_i_status", (byte)2, name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | //WriteDBLog.Error(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°æºå 工车轮信æ¯", "PCS"); |
| | | WriteLog.Write_Log(name, wp_id, "é误信æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°æºå 工车轮信æ¯"); |
| | | #endregion |
| | | } |
| | | else |
| | | { |
| | | //1-æ¾å°æ°æ®ï¼2-æªæ¾å°å·¥ä»¶ç±»åæ°æ® |
| | | client.WriteByOrder("W_i_status", (byte)1, name); |
| | | client.WriteByOrder("W_i_parameter_a", geometry == null ? (float)geometry1.a : (float)geometry.a, name); |
| | | client.WriteByOrder("W_i_parameter_b", geometry == null ? (float)geometry1.b : (float)geometry.b, name); |
| | | client.WriteByOrder("W_i_parameter_c", geometry == null ? (float)geometry1.c : (float)geometry.c, name); |
| | | client.WriteByOrder("W_i_parameter_d", geometry == null ? (float)geometry1.d : (float)geometry.d, name); |
| | | client.WriteByOrder("W_i_parameter_e", geometry == null ? (float)geometry1.e : (float)geometry.e, name); |
| | | client.WriteByOrder("W_i_parameter_f", geometry == null ? (float)geometry1.f : (float)geometry.f, name); |
| | | client.WriteByOrder("W_i_parameter_g", geometry == null ? (float)geometry1.g : (float)geometry.g, name); |
| | | client.WriteByOrder("W_i_parameter_h", geometry == null ? (float)geometry1.h : (float)geometry.h, name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | //WriteDBLog.Success(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼1" + $"\n" + |
| | | // $"aï¼{(geometry == null ? (float)geometry1.a : (float)geometry.a)}\n" + |
| | | // $"bï¼{(geometry == null ? (float)geometry1.b : (float)geometry.b)}\n" + |
| | | // $"cï¼{(geometry == null ? (float)geometry1.c : (float)geometry.c)}\n" + |
| | | // $"dï¼{(geometry == null ? (float)geometry1.d : (float)geometry.d)}\n" + |
| | | // $"eï¼{(geometry == null ? (float)geometry1.e : (float)geometry.e)}\n" + |
| | | // $"fï¼{(geometry == null ? (float)geometry1.f : (float)geometry.f)}\n" + |
| | | // $"gï¼{(geometry == null ? (float)geometry1.g : (float)geometry.g)}\n" + |
| | | // $"hï¼{(geometry == null ? (float)geometry1.h : (float)geometry.h)}\n" + |
| | | // $"R_oi_onï¼0", "PCS"); |
| | | WriteLog.Write_Log(name, wp_id, "åå
¥ä¿¡æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼1" + $"\n" + |
| | | $"aï¼{(geometry == null ? (float)geometry1.a : (float)geometry.a)}\n" + |
| | | $"bï¼{(geometry == null ? (float)geometry1.b : (float)geometry.b)}\n" + |
| | | $"cï¼{(geometry == null ? (float)geometry1.c : (float)geometry.c)}\n" + |
| | | $"dï¼{(geometry == null ? (float)geometry1.d : (float)geometry.d)}\n" + |
| | | $"eï¼{(geometry == null ? (float)geometry1.e : (float)geometry.e)}\n" + |
| | | $"fï¼{(geometry == null ? (float)geometry1.f : (float)geometry.f)}\n" + |
| | | $"gï¼{(geometry == null ? (float)geometry1.g : (float)geometry.g)}\n" + |
| | | $"hï¼{(geometry == null ? (float)geometry1.h : (float)geometry.h)}\n" + |
| | | $"R_oi_onï¼0"); |
| | | #endregion |
| | | } |
| | | //1-æ¾å°æ°æ®ï¼2-æªæ¾å°å·¥ä»¶ç±»åæ°æ® |
| | | client.WriteByOrder("W_i_status", (byte)2, name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | WriteLog.Write_Log(name, wp_id, "é误信æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°æºå 工车轮信æ¯"); |
| | | #endregion |
| | | } |
| | | else |
| | | { |
| | | var geometry = detectionlineRepository.Find(x => x.Description == Mes_Work.drawingNo).FirstOrDefault(); |
| | | var geometry1 = dataRepository.Find(x => x.Description == Mes_Work.drawingNo).FirstOrDefault(); |
| | | if (geometry == null && geometry1 == null) |
| | | { |
| | | client.WriteByOrder("W_i_status", (byte)2, name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | //WriteDBLog.Error(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°æ£æµçº¿è½¦è½®ä¿¡æ¯", "PCS"); |
| | | WriteLog.Write_Log(name, wp_id, "é误信æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°æ£æµçº¿è½¦è½®ä¿¡æ¯"); |
| | | #endregion |
| | | } |
| | | else |
| | | { |
| | | client.WriteByOrder("W_i_status", (byte)1, name); |
| | | client.WriteByOrder("W_i_parameter_a", geometry == null ? (float)geometry1.a : (float)geometry.a, name); |
| | | client.WriteByOrder("W_i_parameter_b", geometry == null ? (float)geometry1.b : (float)geometry.b, name); |
| | | client.WriteByOrder("W_i_parameter_c", geometry == null ? (float)geometry1.c : (float)geometry.c, name); |
| | | client.WriteByOrder("W_i_parameter_d", geometry == null ? (float)geometry1.d : (float)geometry.d, name); |
| | | client.WriteByOrder("W_i_parameter_e", geometry == null ? (float)geometry1.e : (float)geometry.e, name); |
| | | client.WriteByOrder("W_i_parameter_f", geometry == null ? (float)geometry1.f : (float)geometry.f, name); |
| | | client.WriteByOrder("W_i_parameter_g", geometry == null ? (float)geometry1.g : (float)geometry.g, name); |
| | | client.WriteByOrder("W_i_parameter_h", geometry == null ? (float)geometry1.h : (float)geometry.h, name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | //WriteDBLog.Success(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼1" + $"\n" + |
| | | // $"aï¼{(geometry == null ? (float)geometry1.a : (float)geometry.a)}\n" + |
| | | // $"bï¼{(geometry == null ? (float)geometry1.b : (float)geometry.b)}\n" + |
| | | // $"cï¼{(geometry == null ? (float)geometry1.c : (float)geometry.c)}\n" + |
| | | // $"dï¼{(geometry == null ? (float)geometry1.d : (float)geometry.d)}\n" + |
| | | // $"eï¼{(geometry == null ? (float)geometry1.e : (float)geometry.e)}\n" + |
| | | // $"fï¼{(geometry == null ? (float)geometry1.f : (float)geometry.f)}\n" + |
| | | // $"gï¼{(geometry == null ? (float)geometry1.g : (float)geometry.g)}\n" + |
| | | // $"hï¼{(geometry == null ? (float)geometry1.h : (float)geometry.h)}\n" + |
| | | // $"R_oi_onï¼0", "PCS"); |
| | | WriteLog.Write_Log(name, wp_id, "åå
¥ä¿¡æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼1" + $"\n" + |
| | | $"aï¼{(geometry == null ? (float)geometry1.a : (float)geometry.a)}\n" + |
| | | $"bï¼{(geometry == null ? (float)geometry1.b : (float)geometry.b)}\n" + |
| | | $"cï¼{(geometry == null ? (float)geometry1.c : (float)geometry.c)}\n" + |
| | | $"dï¼{(geometry == null ? (float)geometry1.d : (float)geometry.d)}\n" + |
| | | $"eï¼{(geometry == null ? (float)geometry1.e : (float)geometry.e)}\n" + |
| | | $"fï¼{(geometry == null ? (float)geometry1.f : (float)geometry.f)}\n" + |
| | | $"gï¼{(geometry == null ? (float)geometry1.g : (float)geometry.g)}\n" + |
| | | $"hï¼{(geometry == null ? (float)geometry1.h : (float)geometry.h)}\n" + |
| | | $"R_oi_onï¼0"); |
| | | #endregion |
| | | } |
| | | //1-æ¾å°æ°æ®ï¼2-æªæ¾å°å·¥ä»¶ç±»åæ°æ® |
| | | client.WriteByOrder("W_i_status", (byte)1, name); |
| | | client.WriteByOrder("W_i_parameter_a", (float)geometry.a, name); |
| | | client.WriteByOrder("W_i_parameter_b", (float)geometry.b, name); |
| | | client.WriteByOrder("W_i_parameter_c", (float)geometry.c, name); |
| | | client.WriteByOrder("W_i_parameter_d", (float)geometry.d, name); |
| | | client.WriteByOrder("W_i_parameter_e", (float)geometry.e, name); |
| | | client.WriteByOrder("W_i_parameter_f", (float)geometry.f, name); |
| | | client.WriteByOrder("W_i_parameter_g", (float)geometry.g, name); |
| | | client.WriteByOrder("W_i_parameter_h", (float)geometry.h, name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | WriteLog.Write_Log(name, wp_id, "åå
¥ä¿¡æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼1" + $"\n" + |
| | | $"aï¼{(float)geometry.a}\n" + |
| | | $"bï¼{(float)geometry.b}\n" + |
| | | $"cï¼{(float)geometry.c}\n" + |
| | | $"dï¼{(float)geometry.d}\n" + |
| | | $"eï¼{(float)geometry.e}\n" + |
| | | $"fï¼{(float)geometry.f}\n" + |
| | | $"gï¼{(float)geometry.g}\n" + |
| | | $"hï¼{(float)geometry.h}\n" + |
| | | $"R_oi_onï¼0"); |
| | | #endregion |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //WriteDBLog.Error("æ¥è¯¢è½¦è½®æ°æ®", $"é误信æ¯ï¼{ex.Message}", "PCS"); |
| | | WriteLog.Write_Log("æ¥éæ¥å¿", namea, "é误信æ¯ï¼", $"é误信æ¯ï¼{ex.Message}"); |
| | | } |
| | | } |
| | |
| | | Idt_plcinfoheadRepository repository = new dt_plcinfoheadRepository(Context); |
| | | Idt_plcinfodetailRepository plcRepository = new dt_plcinfodetailRepository(Context); |
| | | Idt_geometry_dataRepository dataRepository = new dt_geometry_dataRepository(Context); |
| | | Idt_geometry_data_detectionlineRepository detectionlineRepository = new dt_geometry_data_detectionlineRepository(Context); |
| | | Idt_mes_detailRepository mes_DetailRepository = new dt_mes_detailRepository(Context); |
| | | IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(Context); |
| | | Idt_mes_headRepository mes_HeadRepository = new dt_mes_headRepository(Context); |
| | |
| | | client.WriteByOrder("W_i_status", (byte)2, name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | //WriteDBLog.Error(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°å·¥å详æ
", "PCS"); |
| | | WriteLog.Write_Log(name, wp_id, "é误信æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°å·¥å详æ
"); |
| | | #endregion |
| | | continue; |
| | | } |
| | | #region MyRegion |
| | | //var mes_Detail = mes_DetailRepository.FindFirst(x => x.SN == wp_id); |
| | | //if (mes_Detail == null) |
| | | //{ |
| | | // client.WriteByOrder("W_i_status", (byte)2, name); |
| | | // client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | // #region æ¥å¿è®°å½ |
| | | // WriteDBLog.Error(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°å·¥å详æ
", "PCS"); |
| | | // #endregion |
| | | // continue; |
| | | //} |
| | | //var mes_Head = mes_HeadRepository.FindFirst(x => x.jobID == mes_Detail.jobID); |
| | | //if (mes_Head == null) |
| | | //{ |
| | | // client.WriteByOrder("W_i_status", (byte)2, name); |
| | | // client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | // #region æ¥å¿è®°å½ |
| | | // WriteDBLog.Error(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°å·¥å头表", "PCS"); |
| | | // #endregion |
| | | // continue; |
| | | //} |
| | | #endregion |
| | | |
| | | var mes_Head = mes_HeadRepository.FindFirst(x => x.jobID == Mes_Work.jobID); |
| | | |
| | | if (name != "è¾é䏿æ¥è¯¢è®¢å") |
| | | //éæ·»å æ¥è¯¢è½¦è½®SNå·è®¢åé»è¾ éæ·»å å
¥åºæ¨¡å¼å¤æï¼æå¨å
¥åºæ¨¡å¼é人工添å å
¥åºåºåºï¼å¦åæ¥è¦ |
| | | var pattern = patternRepository.FindFirst(x => x.pattern_name == "å
¥åºæ¨¡å¼").pattern_state; |
| | | if (pattern != 1 && string.IsNullOrEmpty(mes_Head.area)) |
| | | { |
| | | //éæ·»å æ¥è¯¢è½¦è½®SNå·è®¢åé»è¾ éæ·»å å
¥åºæ¨¡å¼å¤æï¼æå¨å
¥åºæ¨¡å¼é人工添å å
¥åºåºåºï¼å¦åæ¥è¦ |
| | | var pattern = patternRepository.FindFirst(x => x.pattern_name == "å
¥åºæ¨¡å¼").pattern_state; |
| | | if (pattern != 1 && string.IsNullOrEmpty(mes_Head.area)) |
| | | { |
| | | client.WriteByOrder("W_i_status", (byte)4, name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | //WriteDBLog.Error(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼4\nR_oi_onï¼0\n\næå¨å
¥åºæ¨¡å¼æªéæ©åºåº", "PCS"); |
| | | WriteLog.Write_Log(name, wp_id, "é误信æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼4\nR_oi_onï¼0\n\næå¨å
¥åºæ¨¡å¼æªéæ©åºåº"); |
| | | #endregion |
| | | continue; |
| | | } |
| | | //var geometry = dataRepository.FindFirst(x => x.TypeId == (Int32)wp_type); |
| | | var geometry = dataRepository.Find(x => x.Description == mes_Head.drawingNo /*&& x.TypeId == (Int32)wp_type*/).FirstOrDefault(); |
| | | var geometry1 = detectionlineRepository.Find(x => x.Description == mes_Head.drawingNo).FirstOrDefault(); |
| | | if (geometry == null && geometry1 == null) |
| | | { |
| | | //1-好,å
许å å·¥ï¼2-ä¸å¨å表ä¸ï¼3-ä¸å 工车轮类åï¼4-æå¨å
¥åºæ¨¡å¼äººå·¥æªéæ©åºåº |
| | | client.WriteByOrder("W_i_status", (byte)2, name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | //WriteDBLog.Error(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°æºå 工车轮信æ¯", "PCS"); |
| | | WriteLog.Write_Log(name, wp_id, "é误信æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°æºå 工车轮信æ¯"); |
| | | #endregion |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | //1-好,å
许å å·¥ï¼2-ä¸å¨å表ä¸ï¼3-ä¸å 工车轮类åï¼4-æå¨å
¥åºæ¨¡å¼äººå·¥æªéæ©åºåº |
| | | client.WriteByOrder("W_i_status", (byte)1, name); |
| | | client.WriteByOrder("W_i_job_id", Mes_Work.jobID, name); |
| | | client.WriteByOrder("W_i_drawing_id", Mes_Work.drawingNo, name); |
| | | client.WriteByOrder("W_i_heat_id", Mes_Work.heatID, name); |
| | | //client.WriteByOrder("W_i_sourceheat", "", name); |
| | | client.WriteByOrder("W_i_batch_id", Mes_Work.heatBatchID, name); |
| | | |
| | | //å±è½å·¥èº(å±è½è§è§æ£æµ/å±è½æ¶æ²¹) |
| | | //if (name != "è¾é䏿æ¥è¯¢è½¦è½®") |
| | | //{ |
| | | client.WriteByOrder("W_i_skip_op_SJ1", name == "3åå
è¾é䏿æ¥è¯¢è®¢å" ? true : mes_Head.skip_op_1, name);//å±è½è§è§æ£æµè®¾å¤1 |
| | | client.WriteByOrder("W_i_skip_op_SJ2", name == "3åå
è¾é䏿æ¥è¯¢è®¢å" ? true : mes_Head.skip_op_2, name);//å±è½è§è§æ£æµè®¾å¤2 |
| | | client.WriteByOrder("W_i_skip_op_LT", mes_Head.skip_op_3, name);//å±è½é¾æ¡æº |
| | | //} |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | WriteLog.Write_Log(name, wp_id, "åå
¥ä¿¡æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼1" + |
| | | $"\nW_i_job_idï¼{Mes_Work.jobID}\nW_i_drawing_idï¼{Mes_Work.drawingNo}\nW_i_heat_idï¼{Mes_Work.heatID}\nW_i_batch_idï¼{Mes_Work.heatBatchID}" + |
| | | $"\nW_i_skip_op_SJ1ï¼{(name == "3åå
è¾é䏿æ¥è¯¢è®¢å" ? true : mes_Head.skip_op_1)}\nW_i_skip_op_SJ2ï¼{(name == "3åå
è¾é䏿æ¥è¯¢è®¢å" ? true : mes_Head.skip_op_2)}" + |
| | | $"\nW_i_skip_op_LTï¼{mes_Head.skip_op_3}\nR_oi_onï¼0"); |
| | | //WriteDBLog.Success(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼1" + |
| | | // $"\nW_i_job_idï¼{Mes_Work.jobID}\nW_i_drawing_idï¼{Mes_Work.drawingNo}\nW_i_heat_idï¼{Mes_Work.heatID}\nW_i_batch_idï¼{Mes_Work.heatBatchID}" + |
| | | // $"\nW_i_skip_op_SJ1ï¼{(name == "3åå
è¾é䏿æ¥è¯¢è®¢å" ? true : mes_Head.skip_op_1)}\nW_i_skip_op_SJ2ï¼{(name == "3åå
è¾é䏿æ¥è¯¢è®¢å" ? true : mes_Head.skip_op_2)}" + |
| | | // $"\nW_i_skip_op_LTï¼{mes_Head.skip_op_3}\nR_oi_onï¼0", "PCS"); |
| | | #endregion |
| | | } |
| | | client.WriteByOrder("W_i_status", (byte)4, name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | WriteLog.Write_Log(name, wp_id, "é误信æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼4\nR_oi_onï¼0\n\næå¨å
¥åºæ¨¡å¼æªéæ©åºåº"); |
| | | #endregion |
| | | continue; |
| | | } |
| | | var geometry = Pipeline.QueryMateriel(Mes_Work.drawingNo); |
| | | if (geometry == null) |
| | | { |
| | | //1-好,å
许å å·¥ï¼2-ä¸å¨å表ä¸ï¼3-ä¸å 工车轮类åï¼4-æå¨å
¥åºæ¨¡å¼äººå·¥æªéæ©åºåº |
| | | client.WriteByOrder("W_i_status", (byte)2, name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | WriteLog.Write_Log(name, wp_id, "é误信æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°æºå 工车轮信æ¯"); |
| | | #endregion |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | var geometry = detectionlineRepository.Find(x => x.Description == mes_Head.drawingNo /*&& x.TypeId == (Int32)wp_type*/).FirstOrDefault(); |
| | | var geometry1 = dataRepository.Find(x => x.Description == mes_Head.drawingNo).FirstOrDefault(); |
| | | if (geometry == null && geometry1 == null) |
| | | { |
| | | //1-好,å
许å å·¥ï¼2-ä¸å¨å表ä¸ï¼3-ä¸å 工车轮类åï¼4-æå¨å
¥åºæ¨¡å¼äººå·¥æªéæ©åºåº |
| | | client.WriteByOrder("W_i_status", (byte)2, name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | //WriteDBLog.Error(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°æ£æµçº¿è½¦è½®ä¿¡æ¯", "PCS"); |
| | | WriteLog.Write_Log(name, wp_id, "é误信æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼2\nR_oi_onï¼0\n\næªæ¥è¯¢å°æ£æµçº¿è½¦è½®ä¿¡æ¯"); |
| | | #endregion |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | //1-好,å
许å å·¥ï¼2-ä¸å¨å表ä¸ï¼3-ä¸å 工车轮类åï¼4-æå¨å
¥åºæ¨¡å¼äººå·¥æªéæ©åºåº |
| | | client.WriteByOrder("W_i_status", (byte)1, name); |
| | | client.WriteByOrder("W_i_job_id", Mes_Work.jobID, name); |
| | | client.WriteByOrder("W_i_drawing_id", Mes_Work.drawingNo, name); |
| | | client.WriteByOrder("W_i_heat_id", Mes_Work.heatID, name); |
| | | //client.WriteByOrder("W_i_sourceheat", "", name); |
| | | client.WriteByOrder("W_i_batch_id", Mes_Work.heatBatchID, name); |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | WriteLog.Write_Log(name, wp_id, "åå
¥ä¿¡æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼1" + $"\nW_i_job_idï¼{Mes_Work.jobID}" + |
| | | $"\nW_i_drawing_idï¼{mes_Head.drawingNo}\nW_i_heat_idï¼{Mes_Work.heatID}\nW_i_batch_idï¼{Mes_Work.heatBatchID}\nR_oi_onï¼0"); |
| | | //WriteDBLog.Success(name, $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼1" + $"\nW_i_job_idï¼{Mes_Work.jobID}" + |
| | | // $"\nW_i_drawing_idï¼{mes_Head.drawingNo}\nW_i_heat_idï¼{Mes_Work.heatID}\nW_i_batch_idï¼{Mes_Work.heatBatchID}\nR_oi_onï¼0", "PCS"); |
| | | #endregion |
| | | } |
| | | //1-好,å
许å å·¥ï¼2-ä¸å¨å表ä¸ï¼3-ä¸å 工车轮类åï¼4-æå¨å
¥åºæ¨¡å¼äººå·¥æªéæ©åºåº |
| | | client.WriteByOrder("W_i_status", (byte)1, name); |
| | | client.WriteByOrder("W_i_job_id", Mes_Work.jobID, name); |
| | | client.WriteByOrder("W_i_drawing_id", Mes_Work.drawingNo, name); |
| | | client.WriteByOrder("W_i_heat_id", Mes_Work.heatID, name); |
| | | //client.WriteByOrder("W_i_sourceheat", "", name); |
| | | client.WriteByOrder("W_i_batch_id", Mes_Work.heatBatchID, name); |
| | | |
| | | //å±è½å·¥èº(å±è½è§è§æ£æµ/å±è½æ¶æ²¹) |
| | | //if (name != "è¾é䏿æ¥è¯¢è½¦è½®") |
| | | //{ |
| | | client.WriteByOrder("W_i_skip_op_SJ1", name == "3åå
è¾é䏿æ¥è¯¢è®¢å" ? true : mes_Head.skip_op_1, name);//å±è½è§è§æ£æµè®¾å¤1 |
| | | client.WriteByOrder("W_i_skip_op_SJ2", name == "3åå
è¾é䏿æ¥è¯¢è®¢å" ? true : mes_Head.skip_op_2, name);//å±è½è§è§æ£æµè®¾å¤2 |
| | | client.WriteByOrder("W_i_skip_op_LT", mes_Head.skip_op_3, name);//å±è½é¾æ¡æº |
| | | //} |
| | | client.WriteByOrder("R_oi_on", (byte)0, name); |
| | | #region æ¥å¿è®°å½ |
| | | WriteLog.Write_Log(name, wp_id, "åå
¥ä¿¡æ¯ï¼", $"è¯»åæ¡æ¶ä¿¡æ¯ï¼\n车轮SNï¼{wp_id}\nè½®åIDï¼{wp_type}\n\nåå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_i_statusï¼1" + |
| | | $"\nW_i_job_idï¼{Mes_Work.jobID}\nW_i_drawing_idï¼{Mes_Work.drawingNo}\nW_i_heat_idï¼{Mes_Work.heatID}\nW_i_batch_idï¼{Mes_Work.heatBatchID}" + |
| | | $"\nW_i_skip_op_SJ1ï¼{(name == "3åå
è¾é䏿æ¥è¯¢è®¢å" ? true : mes_Head.skip_op_1)}\nW_i_skip_op_SJ2ï¼{(name == "3åå
è¾é䏿æ¥è¯¢è®¢å" ? true : mes_Head.skip_op_2)}" + |
| | | $"\nW_i_skip_op_LTï¼{mes_Head.skip_op_3}\nR_oi_onï¼0"); |
| | | #endregion |
| | | } |
| | | } |
| | | } |
| | |
| | | Idt_plcinfodetailRepository plcRepository = new dt_plcinfodetailRepository(Context); |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context); |
| | | Idt_geometry_dataRepository dataRepository = new dt_geometry_dataRepository(Context); |
| | | Idt_geometry_data_detectionlineRepository detectionlineRepository = new dt_geometry_data_detectionlineRepository(Context); |
| | | Idt_mes_detailRepository mes_DetailRepository = new dt_mes_detailRepository(Context); |
| | | Idt_mes_headRepository mes_HeadRepository = new dt_mes_headRepository(Context); |
| | | IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(Context); |
| | |
| | | #endregion |
| | | continue; |
| | | } |
| | | |
| | | var geometry = Pipeline.QueryMateriel(Mes_Work.drawingNo); |
| | | #endregion |
| | | |
| | | var AreaNr = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "W_AreaNr").First(), client); |
| | |
| | | var station = stationinfoRepository.Find(x => x.area == areaCode && x.stationCode.Substring(x.stationCode.Length - 1, 1) == AreaNr.ToString()).FirstOrDefault(); |
| | | if (station != null) |
| | | { |
| | | if (station.quantity >= Mes_Work.stackNoRange) |
| | | //if (station.quantity >= 5) |
| | | if (station.quantity >= geometry.stackNoRange) |
| | | //if (station.quantity >= 5) |
| | | { |
| | | Pipeline_client.WriteByOrder("W_AlarmSignal", (Int16)2, name);//æ¥è¦ |
| | | WriteLog.Write_Log(name + "æ¾æå®æåºé", Wheel_SN, "车轮æ°é已满ï¼", $"åºåå·ï¼{AreaNr}ï¼\n车轮æ°ï¼{station.quantity}\né误信æ¯ï¼åºåå·è½¦è½®æ°é已满ï¼"); |
| | |
| | | #endregion |
| | | |
| | | var wheel = Pipeline.QueryMateriel(Work.drawingNo); |
| | | var wheel1 = Pipeline.QueryMateriel1(Work.drawingNo); |
| | | if (wheel == null && wheel1 == null) |
| | | //var wheel1 = Pipeline.QueryMateriel1(Work.drawingNo); |
| | | if (wheel == null /*&& wheel1 == null*/) |
| | | { |
| | | #region æ¥å¿è®°å½ |
| | | client.WriteByOrder("W_Enabl_Load", false, name);//ä¿¡å·ä¸ºfalseæ¡æ¶åæ¢è¿å
¥ |
| | |
| | | #region æçç±»åä¸ä¸è´éæ´æ¢æç |
| | | foreach (var Stationinfo in Stations) |
| | | { |
| | | if (Stationinfo.tray_type != "LargeTray" && (wheel == null ? wheel1.e : wheel.e) > 1100) |
| | | if (Stationinfo.tray_type != "LargeTray" && /*(wheel == null ? wheel1.e :)*/ wheel.e > 1100) |
| | | { |
| | | client.WriteByOrder("W_Enabl_Load", false, name);//ä¿¡å·ä¸ºfalseæ¡æ¶åæ¢è¿å
¥ |
| | | Stationinfo.location_state = LocationStateEnum.Trayswitching.ToString(); |
| | |
| | | .Where(x => x.enable |
| | | && x.stationCode != NGStation |
| | | && x.location_state == LocationStateEnum.Stroge.ToString() |
| | | && x.quantity < Work.stackNoRange |
| | | && x.quantity < wheel.stackNoRange |
| | | //&& x.quantity < 5 |
| | | && x.stationType == Work.drawingNo |
| | | && x.Number == Work.workOrder |
| | |
| | | .Where(x => x.enable |
| | | && x.stationCode != NGStation |
| | | && x.location_state == LocationStateEnum.Stroge.ToString() |
| | | && x.quantity < Work.stackNoRange |
| | | && x.quantity < wheel.stackNoRange |
| | | //&& x.quantity < 5 |
| | | && x.stationType == Work.drawingNo |
| | | && x.Number == Work.workOrder) |
| | |
| | | |
| | | #region æç车轮å å第å个æ¶ä¸åå¦å¤ä¸ä¸ªçå·çå
¥åºä»»å¡ |
| | | //if (Stationinfo.quantity + 1 >= 4) |
| | | if (Stationinfo.quantity + 1 >= Work.stackNoRange - 1) |
| | | if (Stationinfo.quantity + 1 >= wheel.stackNoRange - 1) |
| | | { |
| | | var stationinfo = Stations.Where(x => x.enable && x.stationCode != NGStation && x.stationCode != Stationinfo.stationCode && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).FirstOrDefault(); |
| | | if (stationinfo != null) |
| | |
| | | dt_stationinfo Stationinfo = Stations.Where(x => x.enable |
| | | && x.stationCode == NGStation |
| | | && x.location_state == LocationStateEnum.Stroge.ToString() |
| | | && x.quantity < Work.stackNoRange |
| | | && x.quantity < wheel.stackNoRange |
| | | //&& x.quantity < 5 |
| | | && x.stationType == Work.drawingNo).FirstOrDefault(); |
| | | |