| | |
| | | #region << ç æ¬ 注 é >> |
| | | #region << ç æ¬ 注 é >> |
| | | /*---------------------------------------------------------------- |
| | | * å½å空é´ï¼WIDESEAWCS_TaskInfoService |
| | | * å建è
ï¼è¡ç«¥åº |
| | |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Comm.Http; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Core.Enums; |
| | | using WIDESEAWCS_DTO.Enum; |
| | |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEA_Common.Log; |
| | | |
| | | namespace WIDESEAWCS_TaskInfoService |
| | | { |
| | |
| | | private readonly IAgvStationService _gvStationService; |
| | | private readonly IServiceProvider _serviceProvider; |
| | | private static bool _isMonitoring = false; |
| | | private readonly IRepository<DeviceAlarmLog> _deviceAlarmLog; |
| | | //private static CancellationTokenSource _cancellationTokenSource; |
| | | |
| | | |
| | | // å¨ç±»çº§å«æ·»å ç¬ç«ççæ§ç¶æ |
| | | private bool _isOutboundMonitoring = false; |
| | | private bool _isInboundMonitoring = false; |
| | | private bool _isSafetyDoorMonitoring = false; |
| | | private bool _isPlatformMonitoring = false; |
| | | |
| | | // å¨ç±»çåæ®µåº |
| | | private CancellationTokenSource? _platformCancellationTokenSource; |
| | | private CancellationTokenSource _outboundCancellationTokenSource; |
| | | private CancellationTokenSource _inboundCancellationTokenSource; |
| | | private CancellationTokenSource _safetyDoorCancellationTokenSource; |
| | | public RgvoperainformService(ITask_HtyRepository BaseDal, IAgvStationService agvStationService, IServiceProvider serviceProvider) : base(BaseDal) |
| | | public RgvoperainformService(ITask_HtyRepository BaseDal, IAgvStationService agvStationService, IServiceProvider serviceProvider, IRepository<DeviceAlarmLog> deviceAlarmLog) : base(BaseDal) |
| | | { |
| | | _gvStationService = agvStationService; |
| | | _serviceProvider = serviceProvider; |
| | | _deviceAlarmLog = deviceAlarmLog; |
| | | } |
| | | |
| | | |
| | | //=================================================读å设å¤ä¿¡æ¯========================================================== |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// è·å设å¤ç¶æï¼æ¯æåºåºãå
¥åºåå®å
¨é¨ç¬ç«çæ§ï¼ |
| | | /// è·å设å¤ç¶æï¼æ¯æåºåºãå
¥åºãå®å
¨é¨åç«å°ç¬ç«çæ§ï¼ |
| | | /// </summary> |
| | | /// <param name="off">0:忢 1:å¯å¨ 2:ä»
æ¥è¯¢</param> |
| | | /// <param name="monitorType">çæ§ç±»åï¼outbound-åºåº inbound-å
¥åº safetydoor-å®å
¨é¨ all-å
¨é¨</param> |
| | | /// <param name="monitorType">çæ§ç±»åï¼outbound-åºåº inbound-å
¥åº safetydoor-å®å
¨é¨ platform-ç«å° all-å
¨é¨</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent GetDeviceStatusDto(int off, string monitorType = "outbound") |
| | | { |
| | | bool isOutbound = monitorType == "outbound" || monitorType == "all";//åºåº |
| | | bool isInbound = monitorType == "inbound" || monitorType == "all";//å
¥åº |
| | | bool isSafetyDoor = monitorType == "safetydoor" || monitorType == "all";//å®å
¨é¨ |
| | | bool isPlatform = monitorType == "platform" || monitorType == "all";//ç«å° |
| | | |
| | | if (off == 1) |
| | | { |
| | |
| | | _ = Task.Run(async () => await StartDeviceMonitoring(_safetyDoorCancellationTokenSource.Token, "safetydoor")); |
| | | } |
| | | |
| | | if (isPlatform && !_isPlatformMonitoring) |
| | | { |
| | | _isPlatformMonitoring = true; |
| | | _platformCancellationTokenSource = new CancellationTokenSource(); |
| | | _ = Task.Run(async () => await StartDeviceMonitoring(_platformCancellationTokenSource.Token, "platform")); |
| | | } |
| | | |
| | | var immediateData = GetImmediateDeviceData(monitorType); |
| | | string message = GetMonitorStatusMessage(monitorType); |
| | | return WebResponseContent.Instance.OK($"设å¤ç¶æçæ§å·²å¯å¨ - {message}", immediateData); |
| | |
| | | { |
| | | _isSafetyDoorMonitoring = false; |
| | | _safetyDoorCancellationTokenSource?.Cancel(); |
| | | } |
| | | |
| | | if (isPlatform && _isPlatformMonitoring) |
| | | { |
| | | _isPlatformMonitoring = false; |
| | | _platformCancellationTokenSource?.Cancel(); |
| | | } |
| | | |
| | | var finalData = GetImmediateDeviceData(monitorType); |
| | |
| | | case "safetydoor": |
| | | _isSafetyDoorMonitoring = false; |
| | | break; |
| | | case "platform": |
| | | _isPlatformMonitoring = false; |
| | | break; |
| | | } |
| | | } |
| | | |
| | |
| | | ["MaterialIn"] = new List<string> { "RGV101" }, |
| | | |
| | | // å®å
¨é¨è®¾å¤ |
| | | ["SafetyDoor"] = new List<string> { "HCJ2000" }, // å®å
¨é¨ |
| | | ["SafetyDoor"] = new List<string> { "HCJ2000" }, |
| | | |
| | | // ç«å°è®¾å¤ - æ ¹æ®æ¨æä¾çåè®®æ·»å ææç«å° |
| | | // ["Platform"] = new List<string> { |
| | | // "1001", "1002", "2016", "2017", "2018", "2019", "1021", "1061", "1131", "1171" |
| | | //} |
| | | ["Platform"] = new List<string> { "HCJ2000" }, |
| | | |
| | | }; |
| | | |
| | | // 设å¤ç±»å对åºçåæ°é
ç½® |
| | |
| | | ("ResetStatus", "ReadDeviceCommand", "å®å
¨é¨å¤ä½ç¶æ"), |
| | | ("AlarmSummary", "DeviceCommand", "æ¥è¦ä¿¡æ¯"), |
| | | ("OpenDoor", "DeviceCommand", "å¼é¨ä¿¡æ¯") |
| | | }, |
| | | |
| | | // ç«å°è®¾å¤åæ°é
ç½® - æ ¹æ®æ¨æä¾çå议添å |
| | | ["Platform"] = new List<(string, string, string)> |
| | | { |
| | | ("HCJ_GoodsStatus", "ReadDeviceCommand", "å
çµä¿¡å·"), |
| | | ("DoorRequest", "DeviceCommand", "ä»»å¡id") |
| | | } |
| | | }; |
| | | |
| | |
| | | { |
| | | "outbound" => group.Key == "MotherCar" || group.Key == "TransferCar" || group.Key == "MaterialOut", |
| | | "inbound" => group.Key == "MaterialIn" || group.Key == "InboundMotherCar" || group.Key == "InboundTransferCar", |
| | | "safetydoor" => group.Key == "SafetyDoor", // å®å
¨é¨çæ§ç±»å |
| | | "safetydoor" => group.Key == "SafetyDoor", |
| | | "platform" => group.Key == "Platform", // ç«å°çæ§ç±»å |
| | | "all" => true, |
| | | _ => group.Key == "MotherCar" || group.Key == "TransferCar" || group.Key == "MaterialOut" |
| | | }; |
| | | }).ToDictionary(x => x.Key, x => x.Value); |
| | | |
| | | int i = 0; |
| | | // éåçéåç设å¤ç» |
| | | foreach (var deviceGroup in filteredDeviceGroups) |
| | | { |
| | |
| | | } |
| | | else if (device is CommonConveyorLine conveyorLine) |
| | | { |
| | | // å¤çå®å
¨é¨è®¾å¤ï¼CommonConveyorLine ç±»åï¼ |
| | | // å建ä¸ä¸ªå®å
¨é¨è®¾å¤çæ°æ® |
| | | List<string> safetyDoorList = new List<string> { "AQM001", "AQM002", "AQM003" }; |
| | | |
| | | // 为æ¯ä¸ªå®å
¨é¨åå»ºæ°æ® |
| | | foreach (string safetyDoorCode in safetyDoorList) |
| | | // å¤çå®å
¨é¨è®¾å¤åç«å°è®¾å¤ï¼CommonConveyorLine ç±»åï¼ |
| | | if (deviceType == "SafetyDoor") |
| | | { |
| | | var deviceData = new Dictionary<string, int>(); |
| | | // å®å
¨é¨è®¾å¤å¤çé»è¾ï¼ä¿æä¸åï¼ |
| | | List<string> safetyDoorList = new List<string> { "AQM001", "AQM002", "AQM003" }; |
| | | |
| | | // éå该设å¤çææåæ° |
| | | foreach (var param in deviceParams) |
| | | foreach (string safetyDoorCode in safetyDoorList) |
| | | { |
| | | try |
| | | { |
| | | // 使ç¨å®å
¨é¨åç§°æ¥è¯¢å¯¹åºçåæ° |
| | | DeviceProDTO? devicePro = GetSafetyDoorDeviceProDTO( |
| | | conveyorLine, safetyDoorCode, param.DeviceProParamName, param.DeviceProParamType); |
| | | var deviceData = new Dictionary<string, int>(); |
| | | |
| | | if (devicePro != null) |
| | | { |
| | | // å¯¹äº CommonConveyorLine ç±»åï¼ä½¿ç¨éç¨çæ°æ®è¯»åæ¹æ³ |
| | | int res = ReadCommonConveyorLineData(conveyorLine, devicePro.DeviceProAddress); |
| | | deviceData[param.DeviceProRemark] = res; |
| | | } |
| | | else |
| | | { |
| | | deviceData[param.DeviceProRemark] = -1; // ä½¿ç¨ -1 表示æ¥è¯¢å¤±è´¥ |
| | | } |
| | | } |
| | | catch (Exception) |
| | | foreach (var param in deviceParams) |
| | | { |
| | | deviceData[param.DeviceProRemark] = -1; // ä½¿ç¨ -1 表示æ¥è¯¢å¼å¸¸ |
| | | try |
| | | { |
| | | DeviceProDTO? devicePro = GetSafetyDoorDeviceProDTO( |
| | | conveyorLine, safetyDoorCode, param.DeviceProParamName, param.DeviceProParamType); |
| | | |
| | | if (devicePro != null) |
| | | { |
| | | int res = ReadCommonConveyorLineData(conveyorLine, devicePro.DeviceProAddress); |
| | | deviceData[param.DeviceProRemark] = res; |
| | | } |
| | | else |
| | | { |
| | | deviceData[param.DeviceProRemark] = -1; |
| | | } |
| | | } |
| | | catch (Exception) |
| | | { |
| | | deviceData[param.DeviceProRemark] = -1; |
| | | } |
| | | } |
| | | |
| | | finalResult[safetyDoorCode] = deviceData; |
| | | } |
| | | } |
| | | |
| | | // å°å½åå®å
¨é¨è®¾å¤çæ°æ®æ·»å å°æç»ç»æä¸ï¼ä½¿ç¨å®å
¨é¨åç§°ä½ä¸ºkey |
| | | finalResult[safetyDoorCode] = deviceData; |
| | | if (deviceType == "Platform") |
| | | { |
| | | // å®å
¨é¨è®¾å¤å¤çé»è¾ï¼ä¿æä¸åï¼ |
| | | List<string> PlatformList = new List<string> { "1001", "1002", "2016", "2017", "2018", "2019", "1021", "1061", "1131", "1171" }; |
| | | |
| | | foreach (string Platform in PlatformList) |
| | | { |
| | | var deviceData = new Dictionary<string, int>(); |
| | | |
| | | foreach (var param in deviceParams) |
| | | { |
| | | try |
| | | { |
| | | DeviceProDTO? devicePro = GetSafetyDoorDeviceProDTO( |
| | | conveyorLine, Platform, param.DeviceProParamName, param.DeviceProParamType); |
| | | |
| | | if (devicePro != null) |
| | | { |
| | | int res = ReadCommonConveyorLineData(conveyorLine, devicePro.DeviceProAddress); |
| | | deviceData[param.DeviceProRemark] = res; |
| | | } |
| | | else |
| | | { |
| | | deviceData[param.DeviceProRemark] = -1; |
| | | } |
| | | } |
| | | catch (Exception) |
| | | { |
| | | deviceData[param.DeviceProRemark] = -1; |
| | | } |
| | | } |
| | | |
| | | finalResult[Platform] = deviceData; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | // å³ä½¿è®¾å¤ä¸å卿䏿¯æ¯æçç±»åï¼ä¹å建ä¸ä¸ªç©ºåå
¸ |
| | | finalResult[deviceChildCode] = new Dictionary<string, int>(); |
| | | if (device != null) |
| | | { |
| | | Console.WriteLine($"è¦åï¼è®¾å¤ {deviceChildCode} ç±»å {device.GetType().Name} 䏿¯æï¼æ æ³è¯»åæ°æ®"); |
| | | } |
| | | else |
| | | { |
| | | Console.WriteLine($"è¦åï¼è®¾å¤ {deviceChildCode} ä¸åå¨"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | "outbound" => $"åºåºçæ§: {(_isOutboundMonitoring ? "è¿è¡ä¸" : "已忢")}", |
| | | "inbound" => $"å
¥åºçæ§: {(_isInboundMonitoring ? "è¿è¡ä¸" : "已忢")}", |
| | | "safetydoor" => $"å®å
¨é¨çæ§: {(_isSafetyDoorMonitoring ? "è¿è¡ä¸" : "已忢")}", |
| | | "all" => $"åºåºçæ§: {(_isOutboundMonitoring ? "è¿è¡ä¸" : "已忢")}, å
¥åºçæ§: {(_isInboundMonitoring ? "è¿è¡ä¸" : "已忢")}, å®å
¨é¨çæ§: {(_isSafetyDoorMonitoring ? "è¿è¡ä¸" : "已忢")}", |
| | | "platform" => $"ç«å°çæ§: {(_isPlatformMonitoring ? "è¿è¡ä¸" : "已忢")}", // ç«å°çæ§ç¶æ |
| | | "all" => $"åºåºçæ§: {(_isOutboundMonitoring ? "è¿è¡ä¸" : "已忢")}, å
¥åºçæ§: {(_isInboundMonitoring ? "è¿è¡ä¸" : "已忢")}, å®å
¨é¨çæ§: {(_isSafetyDoorMonitoring ? "è¿è¡ä¸" : "已忢")}, ç«å°çæ§: {(_isPlatformMonitoring ? "è¿è¡ä¸" : "已忢")}", |
| | | _ => $"åºåºçæ§: {(_isOutboundMonitoring ? "è¿è¡ä¸" : "已忢")}" |
| | | }; |
| | | } |
| | |
| | | "outbound" => "åºåº", |
| | | "inbound" => "å
¥åº", |
| | | "safetydoor" => "å®å
¨é¨", |
| | | "platform" => "ç«å°", // ç«å°æ¾ç¤ºåç§° |
| | | "all" => "å
¨é¨", |
| | | _ => "åºåº" |
| | | }; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 读å设å¤ä¿¡æ¯ |
| | |
| | | return Commonstacker.Communicator.Read<short>(DeviceProDataBlock); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢å®å
¨é¨è®¾å¤ |
| | | /// </summary> |
| | |
| | | public static DeviceProDTO? GetSafetyDoorDeviceProDTO(CommonConveyorLine Commonstacker, string SCAddress, string DeviceProParamName, string DeviceProParamType) |
| | | { |
| | | return Commonstacker.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == SCAddress && x.DeviceProParamName == DeviceProParamName && x.DeviceProParamType == DeviceProParamType); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢ç«å°è®¾å¤ |
| | | /// </summary> |
| | | /// <param name="Commonstacker"></param> |
| | | /// <param name="PlatformCode">ç«å°ç¼å·</param> |
| | | /// <param name="DeviceProParamName">åæ°åç§°</param> |
| | | /// <param name="DeviceProParamType">åæ°ç±»å</param> |
| | | /// <returns></returns> |
| | | public static DeviceProDTO? GetPlatformDeviceProDTO(CommonConveyorLine Commonstacker, string PlatformCode, string DeviceProParamName, string DeviceProParamType) |
| | | { |
| | | return Commonstacker.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == PlatformCode && x.DeviceProParamName == DeviceProParamName && x.DeviceProParamType == DeviceProParamType); |
| | | } |
| | | |
| | | //=================================================读å设å¤ä¿¡æ¯========================================================== |
| | |
| | | DeviceProParamName = "RGV_Risingsignalplace"; |
| | | DeviceProParamType = "DeviceCommand"; |
| | | zhi = parameter; |
| | | break; |
| | | case "xj": //ä¸é |
| | | DeviceProDTO? RGV_Resetoperationss1 = RgvOperationService.GetRGVDeviceProDTO(Commonstacker, deviceName, DeviceProParamName, DeviceProParamType); //ä¸å |
| | | RgvOperationService.RgvSetLine(Commonstacker, RGV_Resetoperationss1.DeviceProAddress, (short)zhi); |
| | | //DeviceProDTO? RGV_Resetoperationss2 = RgvOperationService.GetRGVDeviceProDTO(Commonstacker, deviceName, "RGV_Risingsignalplace", "ReadDeviceCommand"); //ä¸åå°ä½ä¿¡å· |
| | | // int resss = 0; |
| | | // while (resss == 0) |
| | | // { |
| | | // Thread.Sleep(2000); |
| | | // resss = RgvOperationService.GetLine(Commonstacker, RGV_Resetoperationss2.DeviceProAddress); |
| | | // } |
| | | // DeviceProDTO? RGV_Resetoperationss3 = RgvOperationService.GetRGVDeviceProDTO(Commonstacker, deviceName, DeviceProParamName, DeviceProParamType); //ä¸å |
| | | // RgvOperationService.RgvSetLine(Commonstacker, RGV_Resetoperationss3.DeviceProAddress, 0); |
| | | return webResponse.OK(); |
| | | |
| | | case "xj": //ä¸é |
| | | DeviceProParamName = "RGV_Descentsignal"; |
| | | DeviceProParamType = "DeviceCommand"; |
| | | zhi = parameter; |
| | | break; |
| | | DeviceProDTO? RGV_Resetoperationxj1 = RgvOperationService.GetRGVDeviceProDTO(Commonstacker, deviceName, DeviceProParamName, DeviceProParamType); //ä¸é |
| | | RgvOperationService.RgvSetLine(Commonstacker, RGV_Resetoperationxj1.DeviceProAddress, (short)zhi); |
| | | //DeviceProDTO? RGV_Resetoperationxj2 = RgvOperationService.GetRGVDeviceProDTO(Commonstacker, deviceName, "RGV_Descentsignal", "ReadDeviceCommand"); //ä¸éå°ä½ä¿¡å· |
| | | //int resxj = 0; |
| | | //while (resxj == 0) |
| | | //{ |
| | | // Thread.Sleep(2000); |
| | | // resxj = RgvOperationService.GetLine(Commonstacker, RGV_Resetoperationxj2.DeviceProAddress); |
| | | //} |
| | | //DeviceProDTO? RGV_Resetoperationxj3 = RgvOperationService.GetRGVDeviceProDTO(Commonstacker, deviceName, DeviceProParamName, DeviceProParamType); //ä¸å |
| | | //RgvOperationService.RgvSetLine(Commonstacker, RGV_Resetoperationxj3.DeviceProAddress, 0); |
| | | return webResponse.OK(); |
| | | case "dz": //å°å |
| | | DeviceProParamName = "RGV_RGVTasklocationt"; |
| | | DeviceProParamType = "DeviceCommand"; |
| | |
| | | return webResponse.Error("è®¾å¤æä½å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥çæ¥è¦ |
| | | /// </summary> |
| | | public WebResponseContent LogAlarmToDatabase(string JobDeviceName) |
| | | { |
| | | // 设å¤åç±» - åå¹¶çæ¬ |
| | | var deviceCategories = new Dictionary<string, List<string>> |
| | | { |
| | | ["MotherCar"] = new List<string> { "RGV112", "RGV110", "RGV114", "RGV115", "RGV103", "RGV105", "RGV108", "RGV109" }, |
| | | ["TransferCar"] = new List<string> { "RGV116", "RGV111", "RGV104", "RGV107" }, |
| | | ["ExternalRGV"] = new List<string> { "RGV118", "RGV101" } |
| | | }; |
| | | |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | string DeviceName = JobDeviceName; //设å¤åç§° |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == DeviceName); |
| | | if (device == null) return webResponse.Error(); |
| | | SpeStackerCrane Commonstacker = (SpeStackerCrane)device; |
| | | DeviceProDTO? RGV_Resetoperation = RgvOperationService.GetRGVDeviceProDTO(Commonstacker, DeviceName, "RGV_Faultcode", "ReadDeviceCommand"); |
| | | DeviceProDTO? RGVCurrentlocation = RgvOperationService.GetRGVDeviceProDTO(Commonstacker, DeviceName, "RGVCurrentlocation", "RGVCurrentlocation"); |
| | | DeviceProDTO? RGV_Rgvtaskid = RgvOperationService.GetRGVDeviceProDTO(Commonstacker, DeviceName, "RGV_Rgvtaskid", "ReadDeviceCommand"); |
| | | |
| | | |
| | | int baoj = RgvOperationService.GetLine(Commonstacker, RGV_Resetoperation.DeviceProAddress); |
| | | |
| | | if (baoj<=0) |
| | | { |
| | | return null; |
| | | } |
| | | int Currentlocation = RgvOperationService.GetLine(Commonstacker, RGVCurrentlocation.DeviceProAddress); |
| | | int Rgvtaskid = RgvOperationService.GetLine(Commonstacker, RGV_Rgvtaskid.DeviceProAddress); |
| | | |
| | | string alarmMessage = ""; |
| | | if (deviceCategories["MotherCar"].Contains(DeviceName)) |
| | | { |
| | | // æ¯è½¦ä¸ç¨æ¥è¦å¤çé»è¾ |
| | | alarmMessage = HandleMotherCarAlarm(baoj); |
| | | } |
| | | else if (deviceCategories["TransferCar"].Contains(DeviceName)) |
| | | { |
| | | // å车ä¸ç¨æ¥è¦å¤çé»è¾ |
| | | alarmMessage = HandleTransferCarAlarm(baoj); |
| | | } |
| | | else if (deviceCategories["ExternalRGV"].Contains(DeviceName)) |
| | | { |
| | | // å¤å£RGVä¸ç¨æ¥è¦å¤çé»è¾ |
| | | alarmMessage = HandleExternalRGVAlarm(baoj); |
| | | } |
| | | |
| | | // åå
¥ææ¬æ¥å¿ï¼æè®¾å¤åç»/ææ¥ååï¼ |
| | | var logContent = $"设å¤:{DeviceName} | æ¥è¦ç :{baoj} | æ¥è¦æè¿°:{alarmMessage} | å½åä½ç½®:{Currentlocation} | ä»»å¡å·:{Rgvtaskid}"; |
| | | // groupName: Alarmï¼logName: 设å¤å |
| | | WriteLog.Write_Log("Alarm", DeviceName, logContent, new |
| | | { |
| | | DeviceCode = DeviceName, |
| | | AlarmCode = baoj, |
| | | AlarmContent = alarmMessage, |
| | | DeviceLocation = Currentlocation, |
| | | TaskNum = Rgvtaskid, |
| | | Time = DateTime.Now |
| | | }); |
| | | return webResponse.OK(); |
| | | } |
| | | |
| | | |
| | | // æ¥è¦ä»£ç æ å°æ¹æ³ |
| | | private string HandleExternalRGVAlarm(int alarmCode) |
| | | { |
| | | var alarmMessages = new Dictionary<int, string> |
| | | { |
| | | {0, "æ æ¥è¦"}, |
| | | {1, "RGVå°è½¦æ¥å被æä¸"}, |
| | | {2, "æ£è½¬é·è¾¾æ¥è¦"}, |
| | | {3, "å转é·è¾¾æ¥è¦"}, |
| | | {4, "åè¿é使¥è¦"}, |
| | | {5, "åéé使¥è¦"}, |
| | | {6, ""}, |
| | | {7, "PLCæ¸åæ
é"}, |
| | | {8, "PLCæ©å±æ¨¡åæ
é"}, |
| | | {9, "ç§°éæ¨¡åæ
é"}, |
| | | {10, "æ«ç å®ä½æ
é"}, |
| | | {11, "RGVé¿æ¶é´ç©ºè½¬æ
é"}, |
| | | {12, "ç®çå°ä¸çäºå®é
ä½ç½®æ
é"}, |
| | | {13, "䏿»æ§é讯æ
é"}, |
| | | {14, "åé·è¾¾å±è½è¦å"}, |
| | | {15, "åé·è¾¾å±è½è¦å"}, |
| | | {16, "è¡èµ°åé¢å¨æ
é"}, |
| | | {17, "伸缩ååé¢å¨æ
é"}, |
| | | {18, "æ¶²ååå
è¿è½½ä¿æ¤æ
é"}, |
| | | {19, "æ¶²åä¸åè¶
æ¶æ¥è¦"}, |
| | | {20, "æ¶²åä¸éè¶
æ¶æ¥è¦"}, |
| | | {21, "伸缩å伸åºè¶
æ¶æ¥è¦"}, |
| | | {22, "伸缩å缩åè¶
æ¶æ¥è¦"}, |
| | | {23, "å¤å½¢æ£æµæ¥è¦"}, |
| | | {24, "ç§°éè¶
鿥è¦"}, |
| | | {25, "è´§åä¼¸åºæéé使¥è¦"}, |
| | | {26, "è´§å缩åæéé使¥è¦"}, |
| | | {27, "åè´§æ¶èªèº«æè´§ç©æ¥è¦"}, |
| | | {28, "æ¾è´§æ¶èªèº«æ è´§ç©æ¥è¦"}, |
| | | {29, "è´§åæªåå°åå§ä½æ¥è¦"}, |
| | | {30, "触åä»
ç§»å¨å½ä»¤æ¶è´§åä¸å¨åå§ä½æ¥è¦"}, |
| | | {31, "è´§åå°è¾¾åå§ä½ä½ä¸ä½ä¼ æå¨æªæ£æµå°æ¥è¦"} |
| | | }; |
| | | |
| | | return alarmMessages.ContainsKey(alarmCode) ? alarmMessages[alarmCode] : "æªç¥æ¥è¦ä»£ç "; |
| | | } |
| | | |
| | | |
| | | private string HandleTransferCarAlarm(int alarmCode) |
| | | { |
| | | var alarmMessages = new Dictionary<int, string> |
| | | { |
| | | {0, "æ æ¥è¦"}, |
| | | {1, "RGVå°è½¦æ¥å被æä¸"}, |
| | | {2, "åè¿é使¥è¦"}, |
| | | {3, "åéé使¥è¦"}, |
| | | {4, "PLCæ¸åæ
é"}, |
| | | {5, "PLCæ©å±æ¨¡åæ
é"}, |
| | | {6, "æ«ç å®ä½æ
é"}, |
| | | {7, "RGVé¿æ¶é´ç©ºè½¬æ
é"}, |
| | | {8, "ç®çå°ä¸çäºå®é
ä½ç½®æ
é"}, |
| | | {9, "䏿»æ§é讯æ
é"}, |
| | | {10, "è¡èµ°åé¢å¨æ
é"}, |
| | | {11, "æ¶²ååå
è¿è½½ä¿æ¤æ
é"}, |
| | | {12, "æ¶²åä¸åè¶
æ¶æ¥è¦"}, |
| | | {13, "æ¶²åä¸éè¶
æ¶æ¥è¦"}, |
| | | {14, "åè´§æ¶èªèº«æè´§ç©æ¥è¦"}, |
| | | {15, "æ¾è´§æ¶èªèº«æ è´§ç©æ¥è¦"}, |
| | | {16, "åè´§æ£æµä¸å°è´§ç©æ¥è¦"} |
| | | }; |
| | | |
| | | return alarmMessages.ContainsKey(alarmCode) ? alarmMessages[alarmCode] : "æªç¥æ¥è¦ä»£ç "; |
| | | } |
| | | |
| | | private string HandleMotherCarAlarm(int alarmCode) |
| | | { |
| | | var alarmMessages = new Dictionary<int, string> |
| | | { |
| | | {0, "æ æ¥è¦"}, |
| | | {1, "RGVå°è½¦æ¥å被æä¸"}, |
| | | {2, "åè¿é使¥è¦"}, |
| | | {3, "åéé使¥è¦"}, |
| | | {4, "PLCæ¸åæ
é"}, |
| | | {5, "PLCæ©å±æ¨¡åæ
é"}, |
| | | {6, "RGVé¿æ¶é´ç©ºè½¬æ
é"}, |
| | | {7, "ç®çå°ä¸çäºå®é
ä½ç½®æ
é"}, |
| | | {8, "䏿»æ§é讯æ
é"}, |
| | | {9, "è¡èµ°åé¢å¨æ
é"}, |
| | | {10, "åè´§æ¶èªèº«æè´§ç©æ¥è¦"}, |
| | | {11, "æ¾è´§æ¶èªèº«æ è´§ç©æ¥è¦"}, |
| | | {12, "忢æ¶ä½ç½®è¿å²æ¥è¦"} |
| | | }; |
| | | |
| | | return alarmMessages.ContainsKey(alarmCode) ? alarmMessages[alarmCode] : "æªç¥æ¥è¦ä»£ç "; |
| | | } |
| | | } |
| | | } |
| | | |