| | |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using System.Net; |
| | | using WIDESEAWCS_ISystemServices; |
| | | using System.Security.Claims; |
| | | |
| | | namespace WIDESEAWCS_TaskInfoService |
| | | { |
| | |
| | | case "1": // 工使¨¡å¼ï¼0æå¨ã1èªå¨ï¼ |
| | | //è·åå®ä¾ |
| | | DeviceProDTO? RGV_DWorkingmode = GetRGVDeviceProDTO(Commonstacker, DeviceName, "RGV_DWorkingmode", "DeviceCommand"); //ä»»å¡ç±»å |
| | | //ç¬¬ä¸æ¥åå
¥ä»»å¡ |
| | | //ç¬¬ä¸æ¥åå
¥ä»»å¡ |
| | | RgvSetLine(Commonstacker, RGV_DWorkingmode.DeviceProAddress, WriteRGVvalue); |
| | | break; |
| | | case "2": //å¤ä½æä½ï¼0ä¸å¤ä½ã1å¤ä½ï¼ |
| | | DeviceProDTO? RGV_Resetoperation = GetRGVDeviceProDTO(Commonstacker, DeviceName, "RGV_Resetoperation", "DeviceCommand"); //ä»»å¡ç±»å |
| | | //ç¬¬ä¸æ¥åå
¥ä»»å¡ |
| | | //ç¬¬ä¸æ¥åå
¥ä»»å¡ |
| | | RgvSetLine(Commonstacker, RGV_Resetoperation.DeviceProAddress, WriteRGVvalue); |
| | | break; |
| | | case "3": //ä»»å¡ç¡®è®¤å®æï¼0ä¸ç¡®å®ï¼1ç¡®å®ï¼ |
| | | DeviceProDTO? RGV_taskcomplete = GetRGVDeviceProDTO(Commonstacker, DeviceName, "RGV_taskcomplete", "RGV_taskcomplete"); //ä»»å¡ç±»å |
| | | //ç¬¬ä¸æ¥åå
¥ä»»å¡ |
| | | //ç¬¬ä¸æ¥åå
¥ä»»å¡ |
| | | RgvSetLine(Commonstacker, RGV_taskcomplete.DeviceProAddress, WriteRGVvalue); |
| | | break; |
| | | case "4": //ä»»å¡ç±»å(4æ¸
é¤) |
| | |
| | | return webResponse.OK(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¸é®æå |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent WriteOutbuttonpause(SaveModel saveModel) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | List<AGVStation> rgvdata = _gvStationService.GetOutStroller(); |
| | | foreach (AGVStation rgvstation in rgvdata) |
| | | { |
| | | string DeviceName = rgvstation.ChildPosiDeviceCode; //设å¤åç§° |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == DeviceName); |
| | | if (device == null) continue; |
| | | SpeStackerCrane Commonstacker = (SpeStackerCrane)device; |
| | | |
| | | //è·åéè¦å¤ä½çè®¾å¤ |
| | | DeviceProDTO? RGV_Resetoperation = GetRGVDeviceProDTO(Commonstacker, DeviceName, "RGV_DWorkingmode", "DeviceCommand"); //å¤ä½æ¥è¦ä¿¡æ¯ |
| | | RgvSetLine(Commonstacker, RGV_Resetoperation.DeviceProAddress, (short)0); |
| | | } |
| | | return webResponse.OK(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¸é®å¯å¨ |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent WriteOuttouchstart(SaveModel saveModel) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | List<AGVStation> rgvdata = _gvStationService.GetOutStroller(); |
| | | foreach (AGVStation rgvstation in rgvdata) |
| | | { |
| | | string DeviceName = rgvstation.ChildPosiDeviceCode; //设å¤åç§° |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == DeviceName); |
| | | if (device == null) continue; |
| | | SpeStackerCrane Commonstacker = (SpeStackerCrane)device; |
| | | |
| | | //è·åéè¦å¤ä½çè®¾å¤ |
| | | DeviceProDTO? RGV_Resetoperation = GetRGVDeviceProDTO(Commonstacker, DeviceName, "RGV_DWorkingmode", "DeviceCommand"); //å¤ä½æ¥è¦ä¿¡æ¯ |
| | | RgvSetLine(Commonstacker, RGV_Resetoperation.DeviceProAddress, (short)1); |
| | | } |
| | | return webResponse.OK(); |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="conveyorLine"></param> |
| | | /// <param name="DeviceProDataBlock"></param> |
| | | /// <returns></returns> |
| | | public static int GetLine(CommonConveyorLine Commonstacker, string DeviceProDataBlock) |
| | | public static int GetLine(SpeStackerCrane Commonstacker, string DeviceProDataBlock) |
| | | { |
| | | return Commonstacker.Communicator.Read<short>(DeviceProDataBlock); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¥çæ¥è¦ |
| | | /// </summary> |
| | | public WebResponseContent ReadAlarminformation(SaveModel saveModel) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | string DeviceName = saveModel.DelKeys[0].ToString(); //设å¤åç§° |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == DeviceName); |
| | | if (device == null) return webResponse.Error(); |
| | | SpeStackerCrane Commonstacker = (SpeStackerCrane)device; |
| | | DeviceProDTO? RGV_Resetoperation = GetRGVDeviceProDTO(Commonstacker, DeviceName, "RGV_Faultcode", "ReadDeviceCommand"); |
| | | int baoj = GetLine(Commonstacker, RGV_Resetoperation.DeviceProAddress); |
| | | string alarmMessage = ""; |
| | | if (DeviceName == "RGV118") |
| | | { |
| | | alarmMessage = GetAlarmMessage(baoj); |
| | | } |
| | | else if (DeviceName == "RGV111" || DeviceName == "RGV116") |
| | | { |
| | | alarmMessage = GetAlarmMessage2(baoj); |
| | | } |
| | | else if (DeviceName == "RGV110" || DeviceName == "RGV112" || DeviceName == "RGV114" || DeviceName == "RGV115") |
| | | { |
| | | alarmMessage = GetAlarmMessage3(baoj); |
| | | } |
| | | |
| | | |
| | | return webResponse.OK(data: alarmMessage); |
| | | } |
| | | |
| | | // æ¥è¦ä»£ç æ å°æ¹æ³ |
| | | private string GetAlarmMessage(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 GetAlarmMessage2(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 GetAlarmMessage3(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] : "æªç¥æ¥è¦ä»£ç "; |
| | | } |
| | | } |
| | | } |