| | |
| | | using WIDESEA_WCS.IRepositories; |
| | | using WIDESEA_WCS.Repositories; |
| | | using WIDESEA_Core.EFDbContext; |
| | | using WIDESEA_Core.FreeDB; |
| | | using WIDESEA_Entity.DomainModels; |
| | | using WIDESEA_Comm; |
| | | using static System.Collections.Specialized.BitVector32; |
| | | using WIDESEA_Comm.TaskNo; |
| | | using WIDESEA_Entity.ToAGV; |
| | | using WIDESEA_WCS.WCSClient; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; |
| | | using WIDESEA_WMS.IRepositories; |
| | | using WIDESEA_WMS.Repositories; |
| | | using static FreeSql.Internal.GlobalFilter; |
| | | using WIDESEA_Comm.LogInfo; |
| | | |
| | | namespace WIDESEA_WCS.JobsPart.Common |
| | | { |
| | | public class StationTask |
| | | { |
| | | |
| | | static FreeDB freeDB = new FreeDB(); |
| | | /// <summary> |
| | | /// å建å
¥åºä»»å¡ |
| | | /// </summary> |
| | |
| | | { |
| | | VOLContext context = new VOLContext(); |
| | | Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context); |
| | | Idt_WorkinfoRepository workinfoRepository = new dt_WorkinfoRepository(context); |
| | | Idt_mes_headRepository mes_HeadRepository = new dt_mes_headRepository(context); |
| | | Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(context); |
| | | IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(context); |
| | | |
| | | List<dt_stationinfo> stationinfos = stationinfoRepository.Find(x => x.stationCode.Contains('X')); |
| | | var Pipeline_client = PLCClient.Clients.FirstOrDefault(t => t.PLCName == "龿¡æº"); |
| | | if (Pipeline_client == null) throw new Exception("龿¡æºè°åº¦æå¡æªå¼å¯ï¼"); |
| | | if (!Pipeline_client.IsConnected) throw new Exception("ä¸é¾æ¡æºè¿æ¥è¶
æ¶ï¼"); |
| | | |
| | | List<dt_stationinfo> stationinfos = stationinfoRepository.Find(x => x.stationCode.Contains("X") && x.enable && x.quantity > 0 && !string.IsNullOrEmpty(x.stationType) && !string.IsNullOrEmpty(x.Number)).ToList(); |
| | | |
| | | foreach (var item in stationinfos) |
| | | { |
| | | //æ ¹æ®ä¸æå£çç»å®ä¿¡æ¯æ¥è¯¢å¯¹åºå·¥åï¼æ£æµæ¤å·¥åæ¯å¦å·²å®æ 宿å³å¯å°å
¶éå
¥åº |
| | | |
| | | dt_mes_head mesinfo = freeDB.Select<dt_mes_head>().Where(x => x.jobID == item.Number).First(); |
| | | dt_geometry_data dt_Geometry_Data = freeDB.Select<dt_geometry_data>().Where(x => x.Description == mesinfo.drawingNo).First(); |
| | | int CompeletedNum = Convert.ToInt32(mesinfo.quantity) - Convert.ToInt32(mesinfo.finishNum); |
| | | |
| | | |
| | | //å¤å®ä»»å¡æ¯å¦å·²å建//å¦å·²åå¨ |
| | | if (freeDB.Select<dt_agvtask>().Where(x => x.agv_fromaddress == item.stationCode).Count() > 0) |
| | | if (agvtaskRepository.Find(x => x.agv_fromaddress == item.stationCode).Any()) |
| | | continue; |
| | | |
| | | if (item.quantity == 5 || CompeletedNum == 0) //循ç¯è¯»å车轮æ°ä¸º5æè
订å已宿æ°éçä¸æå£ âå·¥å人工å
³éçå·¥å |
| | | var PalletSignal = Pipeline_client.ReadByOrder<Int16>("R_PalletSignal", item.stationCode);//读åæçä¿¡å·:1:æ,2æ |
| | | var MaterialSignal = Pipeline_client.ReadByOrder<Int16>("R_MaterialSignal", item.stationCode);//读åè´§ç©ä¿¡å·:1:æ,2æ |
| | | if (PalletSignal != 1 || MaterialSignal != 1) continue; |
| | | |
| | | //æ ¹æ®ä¸æå£çç»å®ä¿¡æ¯æ¥è¯¢å¯¹åºå·¥åï¼æ£æµæ¤å·¥åæ¯å¦å·²å®æ 宿å³å¯å°å
¶éå
¥åº |
| | | |
| | | var work = workinfoRepository.Find(x => x.workOrder == item.Number && x.drawingNo == x.drawingNo && x.heatID == item.heatNumber && x.processCode == "17").FirstOrDefault(); |
| | | if (work == null) |
| | | { |
| | | item.remark = "触åå
¥åºä»»å¡,使ªæ¾å°å·¥åä¿¡æ¯ï¼"; |
| | | item.location_state = LocationStateEnum.Abnormal.ToString(); |
| | | stationinfoRepository.Update(item, true); |
| | | continue; |
| | | } |
| | | |
| | | dt_stationinfo TargetLocation = null; |
| | | string tasktype = ""; |
| | | if (item.quantity == 5 /*|| CompeletedNum == 0*/) |
| | | { |
| | | |
| | | |
| | | if (mesinfo.quantity <= 50 || item.stationCode.Contains("3")) //å°äº50ä»¶ç´æ¥åºåº |
| | | if (/*(mesinfo.quantity <= 50 &&*/ !string.IsNullOrEmpty(work.area) || item.stationCode.Contains("3")) |
| | | { |
| | | dt_stationinfo TargetLocation = GetEmptyLocation(stationinfoRepository); |
| | | //todo 寻æ¾å¯æ¾è´§å¤åæ¾è´§å° |
| | | if (TargetLocation != null) |
| | | { |
| | | dt_agvtask agvtask = new dt_agvtask() |
| | | { |
| | | agv_fromaddress = item.stationCode, |
| | | agv_id = Guid.NewGuid(), |
| | | agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"), |
| | | agv_grade = 1, |
| | | agv_createtime = DateTime.Now, |
| | | agv_taskstate = "Create", |
| | | agv_materielid = item.stationType, |
| | | agv_qty = item.quantity, |
| | | agv_tasktype = "TaskType_OutsourceInbound", |
| | | agv_toaddress = TargetLocation.stationCode, |
| | | agv_userid = "ç³»ç»", |
| | | bindSN = item.bindSN, |
| | | agv_worktype = Convert.ToInt32(mesinfo.processCode), |
| | | agv_materbarcode = mesinfo.materialCode, |
| | | agv_barcode=item.tray_type |
| | | }; |
| | | tasktype = "TaskType_OutsourceInbound"; |
| | | TargetLocation = GetEmptyLocation(stationinfoRepository); |
| | | |
| | | freeDB.Add(agvtask); |
| | | TargetLocation.location_state = LocationStateEnum.Busy.ToString(); |
| | | freeDB.Update(TargetLocation); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | dt_stationinfo TargetLocation = GetEmptyLocation(stationinfoRepository, mesinfo, item, CompeletedNum, dt_Geometry_Data.e); |
| | | |
| | | if (TargetLocation != null) |
| | | //todo: è°ç¨WMSæ¥å£åå»ºä»»å¡ |
| | | tasktype = "TaskType_Inbound"; |
| | | TargetLocation = GetLocation.GetEmptyLocation(stationinfoRepository, work, item); |
| | | } |
| | | if (TargetLocation != null) |
| | | { |
| | | dt_agvtask agvtask = new dt_agvtask() |
| | | { |
| | | //todo: è°ç¨WMSæ¥å£åå»ºä»»å¡ |
| | | dt_agvtask agvtask = new dt_agvtask() |
| | | { |
| | | agv_fromaddress = item.stationCode, |
| | | agv_id = Guid.NewGuid(), |
| | | agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"), |
| | | agv_grade = 1, |
| | | agv_createtime = DateTime.Now, |
| | | agv_taskstate = "Create", |
| | | agv_materielid = item.stationType, |
| | | agv_qty = item.quantity, |
| | | agv_tasktype = "TaskType_Inbound", |
| | | agv_toaddress = TargetLocation.stationCode, |
| | | agv_userid = "ç³»ç»", |
| | | bindSN = item.bindSN, |
| | | agv_worktype = Convert.ToInt32(mesinfo.processCode), |
| | | agv_materbarcode = mesinfo.materialCode, |
| | | agv_barcode=item.tray_type |
| | | }; |
| | | agv_fromaddress = item.stationCode, |
| | | agv_id = Guid.NewGuid(), |
| | | agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"), |
| | | agv_grade = 1, |
| | | agv_createtime = DateTime.Now, |
| | | agv_taskstate = "Create", |
| | | agv_materielid = item.stationType, |
| | | agv_qty = item.quantity, |
| | | agv_tasktype = tasktype, |
| | | agv_toaddress = TargetLocation.stationCode, |
| | | agv_userid = "ç³»ç»", |
| | | bindSN = item.bindSN, |
| | | agv_worktype = Convert.ToInt32(work.processCode), |
| | | agv_materbarcode = work.materialCode, |
| | | agv_Traytype = item.tray_type, |
| | | jobID = item.Number, |
| | | agv_TrayStatus = item.tray_status |
| | | }; |
| | | agvtaskRepository.Add(agvtask, true); |
| | | |
| | | freeDB.Add(agvtask); |
| | | TargetLocation.location_state = LocationStateEnum.Busy.ToString(); |
| | | freeDB.Update(TargetLocation); |
| | | } |
| | | item.location_state = LocationStateEnum.InBusy.ToString(); |
| | | stationinfoRepository.Update(item, true); |
| | | |
| | | TargetLocation.location_state = LocationStateEnum.InBusy.ToString(); |
| | | TargetLocation.stationType = agvtask.agv_materielid; |
| | | TargetLocation.heatNumber = item.heatNumber; |
| | | TargetLocation.billetID = item.billetID; |
| | | TargetLocation.Number = agvtask.jobID; |
| | | stationinfoRepository.Update(TargetLocation, true); |
| | | WriteDBLog.Success("å建å
¥åºä»»å¡", $"ä»»å¡ç¼å·ï¼{agvtask.agv_tasknum}", "PCS"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | WriteDBLog.Error("å建å
¥åºä»»å¡", $"é误信æ¯ï¼ {ex.Message}", "PCS"); |
| | | } |
| | | |
| | | } |
| | |
| | | /// <param name="workinfo">订å</param> |
| | | /// <param name="stationinfo">䏿å£ä¿¡æ¯</param> |
| | | /// <returns></returns> |
| | | private static dt_stationinfo GetEmptyLocation(Idt_stationinfoRepository stationinfoRepository, dt_mes_head mesinfo, dt_stationinfo stationinfo, int CompeletedNum, float e) |
| | | public static dt_stationinfo GetEmptyLocation(Idt_stationinfoRepository stationinfoRepository, dt_mes_head mesinfo, dt_stationinfo stationinfo, int CompeletedNum, float e) |
| | | { |
| | | //æ¾è´§ä½ |
| | | dt_stationinfo TargetLocation = null; |
| | | |
| | | #region åç±»åæ¾ä¸è¡ |
| | | //if (area1 == "1") |
| | | TargetLocation = stationinfoRepository.Find(x => x.stationType == mesinfo.drawingNo).FirstOrDefault(); |
| | | |
| | | //TargetLocation = stationinfoRepository.Find(x => x.stationType == mesinfo.drawingNo && x.area == area1).OrderByDescending(x => x.line).OrderBy(x => x.column).FirstOrDefault(); |
| | | if (TargetLocation != null) |
| | | { |
| | | #region åä¸è¡åªå
许ä¸ä¸ªä»»å¡ |
| | | //var count = stationinfoRepository.Find(x => x.line == TargetLocation.line && x.enable && x.area == TargetLocation.area && x.location_state == LocationStateEnum.Busy.ToString()).ToList(); |
| | | //if (count.Count > 0) |
| | | // return null; |
| | | #endregion |
| | | |
| | | #region åºåºä»»å¡ä¼å
,åå¨åºåºä»»å¡åä¸è½å
¥åº |
| | | bool OutTask = false; |
| | | if (TargetLocation.area == "1") |
| | | { |
| | | TargetLocation = stationinfoRepository.Find(x => x.column == TargetLocation.column && x.area == TargetLocation.area && x.enable && x.location_state == LocationStateEnum.Empty.ToString()).OrderByDescending(x => x.line).FirstOrDefault(); |
| | | if (TargetLocation != null) |
| | | OutTask = stationinfoRepository.Find(x => x.column == TargetLocation.column && x.area == TargetLocation.area && x.enable && x.location_state == LocationStateEnum.OutBusy.ToString()).Any(); |
| | | if (OutTask)//è¿ååå¨åºåºä»»å¡,寻æ¾ä¸åç©ºè´§ä½ |
| | | TargetLocation = stationinfoRepository.Find(x => x.line == 2 && x.area == TargetLocation.area && x.enable && x.location_state == LocationStateEnum.Empty.ToString()).OrderBy(x => x.column).FirstOrDefault(); |
| | | if (TargetLocation != null) return TargetLocation; |
| | | } |
| | | else |
| | | { |
| | | TargetLocation = stationinfoRepository.Find(x => x.line == TargetLocation.line && x.area == TargetLocation.area && x.enable && x.location_state == LocationStateEnum.Empty.ToString()).OrderBy(x => x.column).FirstOrDefault(); |
| | | if (TargetLocation != null) |
| | | OutTask = stationinfoRepository.Find(x => x.line == TargetLocation.line && x.area == TargetLocation.area && x.location_state == LocationStateEnum.OutBusy.ToString()).Any(); |
| | | //åºå
åå¨åºåºä»»å¡ï¼éæ°å¼ä¸è¡å
¥åº |
| | | if (OutTask) |
| | | TargetLocation = stationinfoRepository.Find(x => x.column == (TargetLocation.area == "2" ? 1 : 10) && x.area == TargetLocation.area && x.enable && x.location_state == LocationStateEnum.Empty.ToString()).OrderBy(x => x.line).FirstOrDefault(); |
| | | if (TargetLocation != null) return TargetLocation; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | //TargetLocation = stationinfoRepository.Find(x => x.line == TargetLocation.line && x.area == TargetLocation.area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.column).FirstOrDefault(); |
| | | //if (TargetLocation != null) |
| | | // return TargetLocation; |
| | | } |
| | | #endregion |
| | | |
| | | #region æ ¹æ®è®¢åæ°éæ¥å¯»æ¾å¯¹åºåºåºä¸åç©æç±»ååºä½ |
| | | //if (workinfo.PlannedQuantity < 50) //åºåº1 ç©æç±»åå¤ |
| | |
| | | //} |
| | | #endregion |
| | | |
| | | var detail = freeDB.Select<dt_mes_detail>().Where(x => x.jobID == mesinfo.jobID).First(); |
| | | VOLContext context = new VOLContext(); |
| | | Idt_mes_detailRepository mes_DetailRepository = new dt_mes_detailRepository(context); |
| | | Idt_inventoryRepository inventoryRepository = new dt_inventoryRepository(context); |
| | | var detail = mes_DetailRepository.Find(x => x.jobID == mesinfo.jobID).FirstOrDefault(); |
| | | if (detail == null) |
| | | { |
| | | stationinfo.remark = "触åå
¥åºä»»å¡,使ªæ¾å°å·¥åå表ï¼"; |
| | | stationinfo.location_state = LocationStateEnum.Abnormal.ToString(); |
| | | stationinfoRepository.Update(stationinfo, true); |
| | | return null; |
| | | } |
| | | |
| | | #region æ¥æ¾åºå |
| | | dt_inventory inventory = null; |
| | | if (detail.heatID != null) |
| | | { |
| | | inventory = freeDB.Select<dt_inventory>().Where(x => x.HeatNumber == detail.heatID && x.FigureNumber == mesinfo.drawingNo && x.jobID == mesinfo.jobID).First(); |
| | | inventory = inventoryRepository.Find(x => /*x.HeatNumber == detail.heatID &&*/ x.FigureNumber == mesinfo.drawingNo /*&& x.jobID == mesinfo.jobID*/).OrderByDescending(x => x.OnlineTime).FirstOrDefault(); |
| | | } |
| | | else |
| | | { |
| | | inventory = freeDB.Select<dt_inventory>().Where(x => x.FigureNumber == mesinfo.drawingNo && x.jobID == mesinfo.jobID).First(); |
| | | inventory = inventoryRepository.Find(x => x.FigureNumber == mesinfo.drawingNo /*&& x.jobID == mesinfo.jobID*/).OrderByDescending(x => x.OnlineTime).FirstOrDefault(); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region æ ¹æ®åºåæ¥æ¾å¯å
¥åºç©ºè´§ä½ |
| | | if (inventory != null) |
| | | { |
| | | var station = stationinfoRepository.FindFirst(x => x.stationCode == inventory.stationCode); |
| | | if (CompeletedNum <= 15 || station.area == "1") |
| | | if (/*CompeletedNum <= 15 ||*/ station.area == "1") |
| | | { |
| | | TargetLocation = stationinfoRepository.Find(x => x.column == station.column && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == inventory.area).OrderBy(x => x.line).FirstOrDefault(); |
| | | TargetLocation = stationinfoRepository.Find(x => x.column == station.column && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == inventory.area).OrderByDescending(x => x.line).FirstOrDefault(); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | if (TargetLocation != null) return TargetLocation; |
| | | } |
| | | #endregion |
| | | |
| | | if (CompeletedNum <= 15) |
| | | |
| | | |
| | | var area1 = string.IsNullOrEmpty(mesinfo.area) ? GetArea(mesinfo.quantity, e) : mesinfo.area; |
| | | |
| | | if (CompeletedNum <= 15 || area1 == "1") |
| | | { |
| | | TargetLocation = stationinfoRepository.Find(x => x.line == 1 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "1").OrderBy(x => x.column).FirstOrDefault(); |
| | | TargetLocation = stationinfoRepository.Find(x => x.line == 2 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "1").OrderBy(x => x.column).FirstOrDefault(); |
| | | } |
| | | else |
| | | { |
| | |
| | | //else if (180 < mesinfo.quantity && mesinfo.quantity <= 225 && e < 1100) |
| | | // TargetLocation = stationinfoRepository.Find(x => x.column == 1 && x.area == "3" && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).FirstOrDefault(); |
| | | //if (50 < mesinfo.quantity && e > 1100 || TargetLocation == null) |
| | | var area = GetArea(mesinfo.quantity, e); |
| | | TargetLocation = stationinfoRepository.Find(x => x.column == 1 && x.area == area && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).FirstOrDefault(); |
| | | |
| | | //var area = GetArea(mesinfo.quantity, e); |
| | | |
| | | |
| | | TargetLocation = stationinfoRepository.Find(x => x.column == (area1 == "2" ? 1 : 10) && x.area == area1 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).OrderBy(x => x.column).FirstOrDefault(); |
| | | if (TargetLocation == null) |
| | | TargetLocation = stationinfoRepository.Find(x => x.column == 1 && x.area == "4" && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).FirstOrDefault(); |
| | | { |
| | | if (area1 == "2") |
| | | area1 = "3"; |
| | | else if (area1 == "3") |
| | | area1 = "2"; |
| | | TargetLocation = stationinfoRepository.Find(x => x.column == (area1 == "2" ? 1 : 10) && x.area == area1 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).OrderBy(x => x.column).FirstOrDefault(); |
| | | if (TargetLocation == null) |
| | | { |
| | | //TargetLocation = stationinfoRepository.Find(x => x.stationType == mesinfo.drawingNo && x.area == "1").OrderByDescending(x => x.column).FirstOrDefault(); |
| | | |
| | | //if (TargetLocation != null) |
| | | // TargetLocation = stationinfoRepository.Find(x => x.column == TargetLocation.column && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "1").OrderByDescending(x => x.line).FirstOrDefault(); |
| | | //if (TargetLocation == null) |
| | | // TargetLocation = stationinfoRepository.Find(x => x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "1").OrderBy(x => x.column).OrderByDescending(x => x.line).FirstOrDefault(); |
| | | if (TargetLocation == null) |
| | | TargetLocation = stationinfoRepository.Find(x => x.line == 2 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "1").OrderBy(x => x.column).FirstOrDefault(); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | //if (TargetLocation == null) |
| | | // TargetLocation = stationinfoRepository.Find(x => x.column == 1 && x.area == "4" && x.location_state == LocationStateEnum.Empty.ToString() && x.enable).OrderBy(x => x.line).FirstOrDefault(); |
| | | } |
| | | |
| | | #region |
| | |
| | | } |
| | | return TargetLocation; |
| | | } |
| | | |
| | | private static dt_stationinfo GetEmptyLocation(Idt_stationinfoRepository stationinfoRepository) |
| | | /// <summary> |
| | | /// 临æ¶ä½¿ç¨ |
| | | /// </summary> |
| | | /// <param name="stationinfoRepository"></param> |
| | | /// <returns></returns> |
| | | public static dt_stationinfo GetEmptyLocation1(Idt_stationinfoRepository stationinfoRepository) |
| | | { |
| | | return stationinfoRepository.Find(x => x.line == 1 && x.location_state == LocationStateEnum.Empty.ToString() && x.enable && x.area == "3").OrderBy(x => x.column).FirstOrDefault();//è¡ååºåéåæ» |
| | | } |
| | | /// <summary> |
| | | /// å»å¤å |
| | | /// </summary> |
| | | /// <param name="stationinfoRepository"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public static dt_stationinfo GetEmptyLocation(Idt_stationinfoRepository stationinfoRepository) |
| | | { |
| | | dt_stationinfo TargetLocation = null; |
| | | List<string> target = new List<string>() { "W01001001", "W01001002", "W01001003" }; |
| | | List<string> target = new List<string>() { "W01001003", "W01001002", "W01001001" }; |
| | | var Pipeline_client = PLCClient.Clients.FirstOrDefault(t => t.PLCName == "龿¡æº"); |
| | | if (Pipeline_client == null) throw new Exception("龿¡æºè°åº¦æå¡æªå¼å¯ï¼"); |
| | | if (!Pipeline_client.IsConnected) throw new Exception("ä¸é¾æ¡æºè¿æ¥è¶
æ¶ï¼"); |
| | | foreach (var item in target) |
| | | { |
| | | TargetLocation = stationinfoRepository.FindFirst(x => x.stationCode == item && x.location_state == LocationStateEnum.Empty.ToString() && x.enable); |
| | | if (TargetLocation != null) continue; |
| | | TargetLocation = stationinfoRepository.Find(x => x.stationCode == item && x.location_state == "Empty" /*LocationStateEnum.Empty.ToString()*/ && x.enable).FirstOrDefault(); |
| | | |
| | | var PalletSignal = Pipeline_client.ReadByOrder<Int16>("R_PalletSignal", item);//读åæçä¿¡å·:1:æ,2æ |
| | | var MaterialSignal = Pipeline_client.ReadByOrder<Int16>("R_MaterialSignal", item);//读åè´§ç©ä¿¡å·:1:æ,2æ |
| | | if (TargetLocation != null && PalletSignal == 2 && MaterialSignal == 2) return TargetLocation; |
| | | } |
| | | |
| | | if (TargetLocation == null) |
| | |
| | | { |
| | | if (quantity <= 180) |
| | | return "2"; |
| | | else if (quantity <= 225) |
| | | else /*if (quantity <= 225)*/ |
| | | return "3"; |
| | | } |
| | | else |
| | |
| | | // return "3"; |
| | | //else if (quantity > 50 && e > 1100) |
| | | // return "4"; |
| | | return null; |
| | | //return null; |
| | | } |
| | | } |
| | | } |