| | |
| | | |
| | | #region ç³è¯·ä¸æ |
| | | |
| | | if (!Gantry_client.ReadByOrder<bool>("W_RequestUnload", number)) |
| | | var Station = stationinfoRepository.Find(x => x.area == area_code(number) && x.enable && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).OrderBy(x => x.lastUpdateTime).FirstOrDefault(); |
| | | if (Station != null) |
| | | { |
| | | var Station = stationinfoRepository.Find(x => x.area == area_code(number) && x.enable && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).OrderBy(x => x.lastUpdateTime).FirstOrDefault(); |
| | | if (Station != null) |
| | | if (!Gantry_client.ReadByOrder<bool>("W_RequestUnload", number)) |
| | | { |
| | | var SNS = Station.bindSN.Split(","); |
| | | List<string> list = new List<string>(); |
| | |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Gantry_client.WriteByOrder("W_RequestUnload", false, number); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context); |
| | | var plc = repository.FindFirst(x => x.plcinfo_name == client.PLCName); |
| | | List<string> stationCodes = new List<string>() { "S01001001", "S01001002", "W01001001", "W01001002", "W01001003" }; |
| | | dt_stationinfo EmptyStation = null; |
| | | string remark = ""; |
| | | foreach (var stationCode in stationCodes) |
| | | { |
| | |
| | | } |
| | | remark = "æ¥è¯¢ç©ºæå çä½"; |
| | | #region 空æå ç |
| | | var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.quantity < 5 && x.enable).ToList(); |
| | | var EmptyStation = EmptyStations.Where(x => x.tray_type == station.tray_type && x.location_state == LocationStateEnum.Stroge.ToString()).FirstOrDefault(); |
| | | if (EmptyStation == null) |
| | | EmptyStation = EmptyStations.Where(x => x.location_state == LocationStateEnum.Empty.ToString() && x.quantity == 0).FirstOrDefault(); |
| | | if (stationCode.Contains("S")) |
| | | { |
| | | var EmptyStations = stationinfoRepository.Find(x => x.stationCode.Contains("DD") && x.quantity < 5 && x.enable).ToList(); |
| | | EmptyStation = EmptyStations.Where(x => x.tray_type == station.tray_type && x.location_state == LocationStateEnum.Stroge.ToString()).FirstOrDefault(); |
| | | if (EmptyStation == null) |
| | | EmptyStation = EmptyStations.Where(x => x.location_state == LocationStateEnum.Empty.ToString() && x.quantity == 0 && x.enable).FirstOrDefault(); |
| | | if (EmptyStation == null) |
| | | { |
| | | EmptyStation = EmptyStations.Where(x => x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0 && x.enable).OrderByDescending(x => x.quantity).FirstOrDefault(); |
| | | if (EmptyStation != null) EmptyTray.CreateEmptyTrayIn(stationinfoRepository, EmptyStation); |
| | | } |
| | | } |
| | | #endregion |
| | | remark = "æ¥æ¾åºå
空æä½"; |
| | | if (EmptyStation == null)//æ¥æ¾åºå
空æç |
| | | else |
| | | { |
| | | remark = "æ¥æ¾åºå
空æä½"; |
| | | EmptyStation = GetStation.EmptyPalletStation(area); |
| | | } |
| | | |
| | | |
| | | if (EmptyStation != null) |
| | |
| | | if (mes_Head != null) |
| | | { |
| | | mes_Head.finishNum = mes_Head.finishNum + 1; |
| | | //freeDB.DataBase.Update<dt_mes_head>().SetSource(mes_Head).UpdateColumns(x => new { x.finishNum }).ExecuteAffrows(); |
| | | if (mes_Head.finishNum == mes_Head.quantity) mes_Head.FinishTime = DateTime.Now; |
| | | mes_HeadRepository.Update(mes_Head, true); |
| | | } |
| | | } |