| | |
| | | //ç¼åæ¶æªå¯ç¨ç¦æ¢æ¡æ¶è¿å
¥ |
| | | foreach (var station in Stations) |
| | | { |
| | | if (!station.enable) |
| | | if (!station.enable || station.location_state != LocationStateEnum.Stroge.ToString()) |
| | | Gantry_client.WriteByOrder("W_RequestUnload", false, number);//ä¿¡å·ä¸ºfalseæ¡æ¶åæ¢è¿å
¥ |
| | | } |
| | | |
| | |
| | | if (list.Count != Station.quantity) |
| | | { |
| | | Station.location_state = LocationStateEnum.Abnormal.ToString(); |
| | | Station.remark = "车轮æ°éä¸SNå·æ°éä¸ä¸è´"; |
| | | stationinfoRepository.Update(Station, true); |
| | | Gantry_client.WriteByOrder("W_RequestUnload", false, number);//ä¿¡å·ä¸ºfalseæ¡æ¶åæ¢è¿å
¥ |
| | | throw new Exception("䏿ä½è½¦è½®æ°éä¸SNå·æ°éä¸ä¸è´ï¼ä¸æä½ç¼å·ï¼" + Station.stationCode); |
| | | #region æ¥å¿è®°å½ |
| | | WriteDBLog.Error("䏿åº", $"åå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_RequestUnloadï¼false\n\n{Station.stationCode}车轮æ°éä¸SNå·æ°éä¸ä¸è´", "PCS"); |
| | | #endregion |
| | | return; |
| | | //throw new Exception("䏿ä½è½¦è½®æ°éä¸SNå·æ°éä¸ä¸è´ï¼ä¸æä½ç¼å·ï¼" + Station.stationCode); |
| | | } |
| | | var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == Station.stationCode).ToList(); |
| | | var PalletSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_PalletSignal").First(), client);//读åæçä¿¡å·:1:æ,2æ |
| | |
| | | Gantry_client.WriteByOrder("W_Wheel_Type", (Int16)Convert.ToInt16(QueryMateriel(Station.stationType).TypeId), number);//车轮类å |
| | | Gantry_client.WriteByOrder("W_Wheel_id", SNS[SNS.Length - 1], number);//车轮SNå· |
| | | Gantry_client.WriteByOrder("W_RequestUnload", true, number); |
| | | #region æ¥å¿è®°å½ |
| | | WriteDBLog.Success("䏿åºç³è¯·", $"读åæçå
çµä¿¡å·ï¼{PalletSignal}\n读å第ä¸ä¸ªè½¦è½®å
çµä¿¡å·ï¼{MaterialSignal}\n\n" + |
| | | $"åå
¥æ¡æ¶ä¿¡æ¯ï¼\nåºåè´§ä½å·ï¼{area}\næçä¸ç第å 个车轮ï¼{SNS.Length}\næçç±»åï¼{1}\n车轮类åï¼{QueryMateriel(Station.stationType).TypeId}" + |
| | | $"\n车轮SNå·ï¼{SNS[SNS.Length - 1]}\nW_RequestUnloadï¼true", "PCS"); |
| | | #endregion |
| | | } |
| | | else |
| | | { |
| | |
| | | if (!Date_Vaild)//ä¿¡æ¯æè¯¯ï¼è®°å½æ¥å¿ |
| | | { |
| | | Station.location_state = LocationStateEnum.Abnormal.ToString(); |
| | | Station.remark = $"æªæ¥è¯¢å°SNå·ï¼{SNS[SNS.Length - 1]}ç订å"; |
| | | stationinfoRepository.Update(Station, true); |
| | | Gantry_client.WriteByOrder("W_RequestUnload", false, number);//ä¿¡å·ä¸ºfalseæ¡æ¶åæ¢è¿å
¥ |
| | | throw new Exception($"æªæ¥è¯¢å°SNå·ï¼{SNS[SNS.Length - 1]}ç订åï¼ä¸æä½ç¼å·ï¼{Station.stationCode}"); |
| | | //throw new Exception($"æªæ¥è¯¢å°SNå·ï¼{SNS[SNS.Length - 1]}ç订åï¼ä¸æä½ç¼å·ï¼{Station.stationCode}"); |
| | | WriteDBLog.Error("䏿åºä¿¡æ¯æ¥è¯¢", $"åå
¥æ¡æ¶ä¿¡æ¯ï¼\nW_RequestUnloadï¼false\n\n{Station.stationCode}æªæ¥è¯¢å°SNå·ï¼{SNS[SNS.Length - 1]}ç订å", "PCS"); |
| | | return; |
| | | } |
| | | } |
| | | var finished = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_Unlod_finished").First(), Gantry_client);//夹å宿 |
| | |
| | | } |
| | | var count = stationinfoRepository.Update(Station, true); |
| | | if (count < 1) |
| | | throw new Exception($"䏿ä½ä¿¡æ¯æ´æ°å¤±è´¥ï¼ä¸æä½ç¼å·ï¼{Station.stationCode}"); |
| | | { |
| | | WriteDBLog.Error("åæå®æ", $"䏿ä½ä¿¡æ¯æ´æ°å¤±è´¥ï¼ä¸æä½ç¼å·ï¼{Station.stationCode}", "PCS"); |
| | | //throw new Exception($"䏿ä½ä¿¡æ¯æ´æ°å¤±è´¥ï¼ä¸æä½ç¼å·ï¼{Station.stationCode}"); |
| | | return; |
| | | } |
| | | Gantry_client.WriteByOrder("W_Storage_update", true, number);//è´§ä½ç¶ææ´æ° |
| | | Gantry_client.WriteByOrder("W_RequestUnload", false, number);//ä¿¡å·ä¸ºfalseæ¡æ¶åæ¢è¿å
¥ |
| | | #region æ¥å¿è®°å½ |
| | | WriteDBLog.Success("åæå®æ", $"åå
¥æ¡æ¶ä¿¡æ¯ï¼\nè´§ä½ç¶ææ´æ°ï¼{true}\nW_RequestUnloadï¼{false}", "PCS"); |
| | | #endregion |
| | | //finished = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_Unlod_finished").First(), Gantry_client); |
| | | //while (finished) |
| | | //{ |
| | |
| | | // Gantry_client.WriteByOrder("W_Storage_update", false, number);//è´§ä½ç¶ææ´æ° |
| | | |
| | | } |
| | | else |
| | | Gantry_client.WriteByOrder("W_RequestUnload", false, number);//ä¿¡å·ä¸ºfalseæ¡æ¶åæ¢è¿å
¥ |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | return Newsn; |
| | | } |
| | | public static dt_geometry_data QueryMateriel(string type) |
| | | { |
| | | { |
| | | VOLContext Context = new VOLContext(); |
| | | Idt_geometry_dataRepository dataRepository = new dt_geometry_dataRepository(Context); |
| | | var materielinfo = dataRepository.FindFirst(x => x.Description == type); |
| | | var materielinfo = dataRepository.Find(x => x.Description == type).OrderBy(x => x.TypeId).FirstOrDefault(); |
| | | return materielinfo; |
| | | } |
| | | public static string QueryMateriel(int typeId) |
| | | public static string QueryMateriel(int typeId) |
| | | { |
| | | VOLContext Context = new VOLContext(); |
| | | Idt_geometry_dataRepository dataRepository = new dt_geometry_dataRepository(Context); |