| | |
| | | } |
| | | var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList(); |
| | | var userIds = tokenInfos?.Select(x => x.UserId).ToList(); |
| | | |
| | | string RGVAutoStatus(bool AutoStatus) => AutoStatus switch |
| | | { |
| | | true => "èæºæ¨¡å¼", |
| | | false => "åæºæ¨¡å¼", |
| | | }; |
| | | string RGVWorkStatus(bool WorkStatus) => WorkStatus switch |
| | | { |
| | | true => "è¿è¡ä¸", |
| | | false => "å¾
æº", |
| | | }; |
| | | string RGVStatus(bool Status) => Status switch |
| | | { |
| | | true => "æ
é", |
| | | false => "æ£å¸¸", |
| | | }; |
| | | object obj = new |
| | | { |
| | | Automatic = commonRGV.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Automatic), |
| | | Fault = commonRGV.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Fault), |
| | | Running = commonRGV.GetValue<StackerCraneDBName, bool>(StackerCraneDBName.Running), |
| | | //commonRGV.StackerCraneAutoStatusDes, |
| | | //commonRGV.StackerCraneWorkStatusDes, |
| | | //commonRGV.DeviceCode, |
| | | //commonRGV.DeviceName, |
| | | //commonRGV.CurrentTaskNum, |
| | | //commonRGV.LastTaskNum, |
| | | Automatic = RGVAutoStatus(commonRGV.GetValue<RGVDBName, bool>(RGVDBName.Automatic)), |
| | | Fault = RGVStatus(commonRGV.GetValue<RGVDBName, bool>(RGVDBName.Fault)), |
| | | Running = RGVWorkStatus(commonRGV.GetValue<RGVDBName, bool>(RGVDBName.Running)), |
| | | LevelPoint = commonRGV.GetValue<RGVDBName, int>(RGVDBName.LevelPoint), |
| | | CurrentTaskNum = commonRGV.GetValue<RGVDBName, short>(RGVDBName.RGVTaskNum), |
| | | commonRGV.DeviceCode, |
| | | commonRGV.DeviceName, |
| | | }; |
| | | _noticeService.StackerData(userIds?.FirstOrDefault(), userTokenIds, new { commonRGV.DeviceName, data = obj }); |
| | | _noticeService.RGVData(userIds?.FirstOrDefault(), userTokenIds, new { commonRGV.DeviceName, data = obj }); |
| | | |
| | | #endregion è°ç¨äºä»¶æ»çº¿éç¥å端 |
| | | } |
| | |
| | | { |
| | | if (commonRGV != null) |
| | | { |
| | | #region æ¥å¿è®°å½ |
| | | ConsoleHelper.WriteColorLine($"ã{commonRGV.DeviceName}ãå åæºä½ä¸ç¶æï¼ããæ¶é´ã{DateTime.Now}ã", ConsoleColor.Magenta); |
| | | |
| | | string str = $"ã{commonRGV.DeviceName}ãä»»å¡å®æ,ä»»å¡å·ï¼ã{TaskNum}ãæ¶é´ã{DateTime.Now}ã"; |
| | | WriteInfo(commonRGV.DeviceName, str); |
| | | ConsoleHelper.WriteColorLine(str, ConsoleColor.Blue); |
| | | |
| | | #endregion |
| | | |
| | | var task = _taskRepository.QueryFirst(x => x.TaskNum == TaskNum); |
| | | if (task != null) |
| | | { |
| | |
| | | if (device != null) |
| | | { |
| | | CommonConveyorLine conveyorLine = (CommonConveyorLine)device; |
| | | //var x = conveyorLine.Communicator.Read<string>("DB1103.16"); |
| | | Thread.Sleep(100); |
| | | |
| | | var Barcode = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.ConveyorLineBarcode, stationManager.stationChildCode); |
| | | |
| | | if (Barcode == null) |
| | | if (Barcode == null||Barcode=="") |
| | | { |
| | | return; |
| | | } |
| | |
| | | { |
| | | if (task.TaskState == (int)TaskOutStatusEnum.RGV_OutExecuting) |
| | | { |
| | | Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.TargetAddress&&x.stationType==7); |
| | | Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.TargetAddress && x.stationType == 7); |
| | | if (stationManager != null) |
| | | { |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManager.stationPLC); |