| | |
| | | { |
| | | List<Equipment> equipments = new List<Equipment>(); |
| | | List<Dt_DeviceInfo> dt_DeviceInfos = _deviceInfoRepository.QueryData(); |
| | | if(dt_DeviceInfos.Count() > 0) |
| | | if (dt_DeviceInfos.Count() > 0) |
| | | { |
| | | |
| | | foreach(var item in dt_DeviceInfos) |
| | | |
| | | foreach (var item in dt_DeviceInfos) |
| | | { |
| | | Equipment equipment = new Equipment(); |
| | | if (item.DeviceCode == "1001") continue; |
| | | if (item.DeviceCode == "TSJ2") continue; |
| | | |
| | | |
| | | equipment.DeviceCode = item.DeviceCode; |
| | | equipment.DeviceName = item.DeviceName; |
| | | equipment.DeviceType = item.DeviceType; |
| | |
| | | CommonStackerCrane? commonStackerCrane = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "SC1") as CommonStackerCrane; |
| | | foreach (var item in equipments) |
| | | { |
| | | if(item.DeviceCode == "TSJ1") |
| | | if (item.DeviceCode == "TSJ1") |
| | | { |
| | | if (commonElevator.GetValue<ElevatorDBName, short>(ElevatorDBName.ElevatorStatus) == 0) |
| | | { |
| | | item.DeviceRunStatus = "æ ç¶æ"; |
| | | } |
| | | else if(commonElevator.GetValue<ElevatorDBName, short>(ElevatorDBName.ElevatorStatus) == 1) |
| | | else if (commonElevator.GetValue<ElevatorDBName, short>(ElevatorDBName.ElevatorStatus) == 1) |
| | | { |
| | | item.DeviceRunStatus = "è¿è¡ä¸"; |
| | | } |
| | |
| | | { |
| | | item.DeviceRunStatus = "æ¥è¦"; |
| | | } |
| | | if(commonElevator.GetValue<ElevatorDBName, bool>(ElevatorDBName.ElevatorAlarm1)) { item.AlarmInformation = "æ¥å被æä¸æ¥è¦"; } |
| | | if (commonElevator.GetValue<ElevatorDBName, bool>(ElevatorDBName.ElevatorAlarm1)) { item.AlarmInformation = "æ¥å被æä¸æ¥è¦"; } |
| | | if (commonElevator.GetValue<ElevatorDBName, bool>(ElevatorDBName.ElevatorAlarm2)) { item.AlarmInformation = "çµæ¢¯å
è¾éçº¿çµæºè¿è½½æ¥è¦"; } |
| | | if (commonElevator.GetValue<ElevatorDBName, bool>(ElevatorDBName.ElevatorAlarm3)) { item.AlarmInformation = "å°é¢è¾éçº¿çµæºè¿è½½æ¥è¦"; } |
| | | if (commonElevator.GetValue<ElevatorDBName, bool>(ElevatorDBName.ElevatorAlarm4)) { item.AlarmInformation = "çµæ¢¯ç³»ç»å¼å¸¸æ¥è¦"; } |
| | |
| | | if (commonElevator.GetValue<ElevatorDBName, bool>(ElevatorDBName.ElevatorAlarm16)) { item.AlarmInformation = "çµæ¢¯ä¸å¨1楼æ¥è¦"; } |
| | | if (commonElevator.GetValue<ElevatorDBName, bool>(ElevatorDBName.ElevatorAlarm17)) { item.AlarmInformation = "çµæ¢¯ä¸å¨2楼æ¥è¦"; } |
| | | } |
| | | |
| | | |
| | | if (item.DeviceCode == "SC1") |
| | | { |
| | | var alarm = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.Alarm); |
| | | if(StackerCraneAlarm(alarm) != null) |
| | | if (StackerCraneAlarm(alarm) != null) |
| | | { |
| | | item.AlarmInformation = StackerCraneAlarm(alarm); |
| | | } |
| | | var status = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.StackerCraneWorkStatus); |
| | | if(StackerCraneStatus(status) != null) |
| | | if (StackerCraneStatus(status) != null) |
| | | { |
| | | item.DeviceRunStatus = StackerCraneStatus(status); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | content = WebResponseContent.Instance.OK(data: equipments); |
| | | } |
| | | catch(Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | return content.Error(ex.Message); |
| | | } |
| | |
| | | public string DeviceName { get; set; } |
| | | public string DeviceType { get; set; } |
| | | public string DeviceRunStatus { get; set; } |
| | | public string AlarmInformation {get; set;} |
| | | public string AlarmInformation { get; set; } |
| | | } |
| | | |
| | | #region æ¥è¦ä»£ç è½¬æ¢ææå说æ |
| | | [HttpGet] |
| | | public string StackerCraneAlarm(short alarm) => alarm switch |
| | | { |
| | | 1 => "å·¦è¶
é", |
| | |
| | | 79 => "è¡èµ°æ±é¸æ
é", |
| | | 80 => "æåæ±é¸æ
é", |
| | | 81 => "å®å
¨é¨æå¼æ
é", |
| | | _ => "" |
| | | _ => "" |
| | | }; |
| | | #endregion |
| | | #region 设å¤ç¶æè½¬æ¢ææå说æ |
| | | [HttpPost] |
| | | public string StackerCraneStatus(short status) => status switch |
| | | { |
| | | 0 => "空é²", |