|
|
|
|
@ -24,6 +24,7 @@
|
|
|
|
|
#endregion << 版 本 注 释 >>
|
|
|
|
|
|
|
|
|
|
using Sln.Wcs.HoistSdk.Config;
|
|
|
|
|
using Sln.Wcs.HoistSdk.Dto.GetHoistStatus;
|
|
|
|
|
using Sln.Wcs.HoistSdk.Dto.HoistControl;
|
|
|
|
|
using Sln.Wcs.HoistSdk.Dto.HoistTaskExecutor;
|
|
|
|
|
using Sln.Wcs.Plc.Service;
|
|
|
|
|
@ -72,4 +73,64 @@ public class HoistSdk:IHoistSdk
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public GetHoistStatusResultDto GetHoistStatus(GetHoistStatusDto hoistStatusDto)
|
|
|
|
|
{
|
|
|
|
|
//一号提升机
|
|
|
|
|
//反馈任务执行指令:是否可以下发任务
|
|
|
|
|
//当前楼层
|
|
|
|
|
//接驳位状态:1-5楼
|
|
|
|
|
//读写器触发状态:1-5楼
|
|
|
|
|
//自动状态:true/1-自动模式
|
|
|
|
|
//屏蔽调度:true/1-屏蔽中
|
|
|
|
|
//状态指示:0-静态;1-上升;2-下降;3-进料;4-出料
|
|
|
|
|
|
|
|
|
|
GetHoistStatusResultDto result = new GetHoistStatusResultDto();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var plc = _plcs.Where(x => x.ConfigKey.Equals(hoistStatusDto.hoistCode)).ToList().First();
|
|
|
|
|
|
|
|
|
|
result.hoistCode = hoistStatusDto.hoistCode;
|
|
|
|
|
result.canDispatchTask = plc.readInt16ByAddress(hoistStatusDto.canDispatchTask);
|
|
|
|
|
result.currentFloor = plc.readInt16ByAddress(hoistStatusDto.currentFloor);
|
|
|
|
|
|
|
|
|
|
//读取接驳位状态
|
|
|
|
|
List<int> transferStationStatus = new List<int>();
|
|
|
|
|
foreach (var item in hoistStatusDto.transferStationStatus)
|
|
|
|
|
{
|
|
|
|
|
transferStationStatus.Add(plc.readInt16ByAddress(item));
|
|
|
|
|
}
|
|
|
|
|
result.transferStationStatus = transferStationStatus.ToArray();
|
|
|
|
|
|
|
|
|
|
//读取读写器触发状态
|
|
|
|
|
List<int> readerTriggerStatus = new List<int>();
|
|
|
|
|
foreach (var item in hoistStatusDto.readerTriggerStatus)
|
|
|
|
|
{
|
|
|
|
|
readerTriggerStatus.Add(plc.readInt16ByAddress(item));
|
|
|
|
|
}
|
|
|
|
|
result.readerTriggerStatus = readerTriggerStatus.ToArray();
|
|
|
|
|
|
|
|
|
|
result.isAutoMode = plc.readInt16ByAddress(hoistStatusDto.isAutoMode);
|
|
|
|
|
result.isDispatchBlocked = plc.readInt16ByAddress(hoistStatusDto.isDispatchBlocked);
|
|
|
|
|
result.stateIndicator = plc.readInt16ByAddress(hoistStatusDto.stateIndicator);
|
|
|
|
|
|
|
|
|
|
// hoistStatusDto.hoistCode = "";
|
|
|
|
|
// hoistStatusDto.canDispatchTask = "D3101";
|
|
|
|
|
// hoistStatusDto.currentFloor = "D3102";
|
|
|
|
|
// hoistStatusDto.transferStationStatus = new List<string>(){"D3104","D3105","D3106","D3107","D3108"};
|
|
|
|
|
// hoistStatusDto.readerTriggerStatus = new List<string>(){"D3109","D3110","D3111","D3112","D3113"};
|
|
|
|
|
// hoistStatusDto.isAutoMode = "D3124";
|
|
|
|
|
// hoistStatusDto.isDispatchBlocked = "D3125";
|
|
|
|
|
// hoistStatusDto.stateIndicator = "D3127";
|
|
|
|
|
|
|
|
|
|
result.code = "0";
|
|
|
|
|
result.message = "状态更新成功";
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
result.code = "99";
|
|
|
|
|
result.message = e.Message;
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|