| | |
| | | if (conveyorLine != null) |
| | | { |
| | | List<Dt_StationManager> stationManagers = _stationManagerService.GetAllStationByDeviceCode(conveyorLine.DeviceCode); |
| | | |
| | | ConveyorLineTaskCommand command2 = new ConveyorLineTaskCommand(); |
| | | foreach (var station in stationManagers) |
| | | { |
| | | ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(station.stationChildCode); |
| | | |
| | | |
| | | DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == station.stationChildCode && x.ProtocalDetailValue == command.ConveyorLineSingal.ToString()); |
| | | |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //WriteError("CommonConveyorLineJob", ex); |
| | | Console.Out.WriteLine(nameof(CommonConveyorLineJob) + ":" + ex.ToString()); |
| | | } |
| | | finally |
| | | { |
| | | //WriteDebug("CommonConveyorLineJob", "test"); |
| | | WriteDebug("CommonConveyorLineJob", "test"); |
| | | //Console.Out.WriteLine(DateTime.Now); |
| | | } |
| | | return; |
| | |
| | | if (task != null) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.Number, task.PalletCode, stationInfo.stationChildCode); |
| | | |
| | | if ((task.TargetAddress == "2042" || task.TargetAddress == "2032") && task.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.TargetAddress, stationInfo.stationChildCode); |
| | | } |
| | | else |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.NextAddress, stationInfo.stationChildCode); |
| | | } |
| | | |
| | | //conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.NextAddress, stationInfo.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | |
| | | else |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.Number, taskNew.PalletCode, stationInfo.stationChildCode); |
| | | |
| | | if ((taskNew.TargetAddress == "2042" || taskNew.TargetAddress == "2032") && taskNew.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taskNew.TargetAddress, stationInfo.stationChildCode); |
| | | } |
| | | else |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taskNew.NextAddress, stationInfo.stationChildCode); |
| | | } |
| | | //conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taskNew.NextAddress, stationInfo.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | |
| | | _taskService.UpdateTaskStatusToNext(taskNew); |
| | |
| | | //æ ¹æ®è½¦è½´ç¼åä½ç½® åå
¥å¯¹åºç®æ å°å |
| | | if (task.TargetAddress == stationInfo.stationChildCode) |
| | | { |
| | | WebResponseContent content = _taskService.RequestWheelsFlow(task.task_CZInfo).Result; |
| | | //WebResponseContent content = _taskService.RequestWheelsFlow(task.task_CZInfo).Result; |
| | | WebResponseContent content = _taskService.RequestWheelsFlow(task.PalletCode).Result; |
| | | if (content.Status) |
| | | { |
| | | string taraddress = content.Data.ToString(); // "2032"; |
| | | string taraddress = content.Data.ToString(); // "2032";SourceAddress |
| | | |
| | | conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taraddress, stationInfo.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | bool k1 = conveyorLine.SetValue(ConveyorLineDBName.SourceAddress, "2021", stationInfo.stationChildCode); |
| | | |
| | | bool k2= conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, taraddress, stationInfo.stationChildCode); |
| | | bool k3= conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | WebResponseContent k4 = _taskService.UpdateTaskStatusToNext(task); |
| | | |
| | | Console.Out.WriteLine($"读åå°è¾é线ç³è¯·,ç³è¯·æ¡ç ï¼{command.Number}ï¼åé¦è³è¾é线信æ¯====èµ·å§å°åï¼{k1},ç®æ å°åâ{k2},åé¦ä¿¡å·ï¼{k3},ä»»å¡ä¿®æ¹ç¶æï¼{k4.Status}ï¼)"); |
| | | } |
| | | else |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode); |
| | | |
| | | Console.Out.WriteLine($"读åå°è¾é线ç³è¯·,ç³è¯·æ¡ç ï¼{command.Number}ï¼åWMSç³è¯·å»å失败ï¼åå ï¼{content.Message},åå
¥ç³è¯ä¿¡æ
éï¼2"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.TargetAddress, stationInfo.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | bool k1= conveyorLine.SetValue(ConveyorLineDBName.SourceAddress, "2021", stationInfo.stationChildCode); |
| | | bool k2 = conveyorLine.SetValue(ConveyorLineDBName.TargetAddress, task.TargetAddress, stationInfo.stationChildCode); |
| | | bool k3 = conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | WebResponseContent k4 = _taskService.UpdateTaskStatusToNext(task); |
| | | |
| | | Console.Out.WriteLine($"读åå°è¾é线ç³è¯·,ç³è¯·æ¡ç ï¼{command.Number}ï¼åé¦è³è¾é线信æ¯====èµ·å§å°åï¼{k1},ç®æ å°åâ{k2},åé¦ä¿¡å·ï¼{k3},ä»»å¡ä¿®æ¹ç¶æï¼{k4.Status}ï¼)"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode); |
| | | Console.Out.WriteLine($"读åå°è¾é线ç³è¯·,ç³è¯·æ¡ç ï¼{command.Number}ï¼æªæ¾å°,åå
¥ç³è¯ä¿¡æ
éï¼2"); |
| | | } |
| | | //_taskService.UpdatePosition(task.TaskNum, stationInfo.stationChildCode); |
| | | } |
| | |
| | | /// <param name="ProtocalDetailValue">线ä½å½åbool读ååç§»å°å</param> |
| | | public void RequestCZInfo(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, Dt_StationManager stationInfo) |
| | | { |
| | | var task = _taskService.QueryExecutingTaskByBarcode(command.Number, stationInfo.stationChildCode); |
| | | if (task == null) |
| | | WebResponseContent content = _taskService.GetFeedbackAxleloading(); |
| | | if (content.Status) |
| | | { |
| | | //todo æ¥è¯¢WMSè½¦è½´æ°æ®è¿å |
| | | Random random = new Random(20); |
| | | string cztm = "CZ00" + random.Next(); |
| | | //conveyorLine |
| | | //conveyorLine.SetValue(ConveyorLineDBName.Number, cztm, stationInfo.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.Number, content.Data.ToString(), stationInfo.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.CarType,"001", stationInfo.stationChildCode); |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | } |
| | | else |
| | | { |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 2, stationInfo.stationChildCode); |
| | | } |
| | | } |
| | | |
| | |
| | | /// <param name="ProtocalDetailValue">线ä½å½åbool读ååç§»å°å</param> |
| | | public void RequestTakeCZ(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, Dt_StationManager stationInfo) |
| | | { |
| | | var task = _taskService.QueryExecutingTaskByBarcode(command.Number, stationInfo.stationChildCode); |
| | | if (task == null) |
| | | |
| | | WebResponseContent content = _taskService.UpdateAxleCurrentStatue(command.Number); |
| | | if (content.Status) |
| | | { |
| | | //conveyorLine |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 1, stationInfo.stationChildCode); |
| | | Console.Out.WriteLine("æåï¼ååºè½¦è½´çº¿æ«ç«¯çæagvåè´§ä»»å¡ï¼åé¦è¾é线信å·ï¼1"); |
| | | } |
| | | /*else |
| | | { |
| | | var log = $"ã{conveyorLine.DeviceName}ã,车轴æ¡ç ï¼{command.Number}ï¼æ´æ°å¤±è´¥åå ï¼{content.Message}"; |
| | | WriteInfo(conveyorLine.DeviceName, log); |
| | | conveyorLine.SetValue(ConveyorLineDBName.ResponState, 3, stationInfo.stationChildCode); |
| | | }*/ |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// agvç«å°ç³è¯·åæ |
| | | /// </summary> |
| | | /// <param name="conveyorLine">è¾é线å®ä¾å¯¹è±¡</param> |
| | | /// <param name="command">读åç请æ±ä¿¡æ¯</param> |
| | | /// <param name="childDeviceCode">å设å¤ç¼å·</param> |
| | | /// <param name="ProtocalDetailValue">线ä½å½åbool读ååç§»å°å</param> |
| | | public void RequestagvStation(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, Dt_StationManager stationInfo) |
| | | { |
| | | DeviceProDTO? deviceProDTOt = conveyorLine.DeviceProDTOs.Find(x => x.DeviceChildCode == "3022" && x.DeviceProParamName == "Number"); |
| | | string Number = conveyorLine.Communicator.Read<string>(deviceProDTOt.DeviceProAddress); |
| | | if (Number != "" && Number!=null) |
| | | { |
| | | //è°åwmsæ¥å£ç³è¯·agvä»»å¡ |
| | | WebResponseContent content = _taskService.GetAGVTaskdistribution(stationInfo.stationLocation); |
| | | |
| | | } |
| | | } |
| | | #endregion |