呼梯时,到指定目标楼层,根据任务的start_floor来
This commit is contained in:
@@ -71,6 +71,6 @@ namespace Tnb.WarehouseMgr.Interfaces
|
||||
/// /// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task TaskExecuteAfter(TaskExecuteAfterUpInput input);
|
||||
Func<string,Task> AddUnExecuteTask { get; set; }
|
||||
Func<string,int,Task> AddUnExecuteTask { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ namespace Tnb.WarehouseMgr
|
||||
elevatorQueueItem = await _db.Queryable<WmsElevatorUnexecute>().FirstAsync(it => disTasks.Select(x => x.id).Contains(it.distask_id) && it.task_status == "待执行");
|
||||
if (!elevatorQueueItem?.elevator_code.IsNullOrEmpty() ?? false)
|
||||
{
|
||||
await (_wareHouseService.AddUnExecuteTask?.Invoke(elevatorQueueItem?.elevator_code!) ?? Task.CompletedTask);
|
||||
await (_wareHouseService.AddUnExecuteTask?.Invoke(elevatorQueueItem?.elevator_code!, disTask.start_floor.ParseToInt()) ?? Task.CompletedTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -272,7 +272,7 @@ namespace Tnb.WarehouseMgr
|
||||
disTaskIds = disTasks.Select(x => x.id).ToList()
|
||||
};
|
||||
await _wareHouseService.TaskComplate(taskCompleUpInput);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -33,10 +33,10 @@ namespace Tnb.WarehouseMgr
|
||||
private static Dictionary<string, Func<BackgroundService, bool>> _fetchStartedStausValue = new();
|
||||
private bool isFrontDoorBit = false; //是否到前门位
|
||||
|
||||
public ElevatorControlService(BackgroundService agvHeartbeatMonitorService)
|
||||
public ElevatorControlService()
|
||||
{
|
||||
_elevatorCtlCfg = App.Configuration.Build<ElevatorControlConfiguration>();
|
||||
_agvHeartbeatMonitor = agvHeartbeatMonitorService;
|
||||
//_agvHeartbeatMonitor = agvHeartbeatMonitorService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -107,7 +107,7 @@ namespace Tnb.WarehouseMgr
|
||||
public async Task<dynamic> ThreeFloorElevatorFlow()
|
||||
{
|
||||
//test by close door
|
||||
_agvHeartbeatMonitor.StartAsync(CancellationToken.None);
|
||||
//_agvHeartbeatMonitor.StartAsync(CancellationToken.None);
|
||||
//await SendOpenCloseCmd(4);
|
||||
//await SetAgvControlStatus(1);
|
||||
//监听电梯门是否为关闭的状态
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Tnb.WarehouseMgr
|
||||
private readonly IElevatorControlService _elevatorControlService;
|
||||
private static Dictionary<string, object> _elevatorMap = new Dictionary<string, object>();
|
||||
private readonly ElevatorControlConfiguration _eleCtlCfg = App.Configuration.Build<ElevatorControlConfiguration>();
|
||||
public Func<string, Task> AddUnExecuteTask { get; set; }
|
||||
public Func<string, int, Task> AddUnExecuteTask { get; set; }
|
||||
|
||||
public WareHouseService(ISqlSugarRepository<WmsInstockH> repository, IDictionaryDataService dictionaryDataService,
|
||||
IBillRullService billRullService, IUserManager userManager, ICacheManager cacheManager, IElevatorControlService elevatorControlService)
|
||||
@@ -60,9 +60,9 @@ namespace Tnb.WarehouseMgr
|
||||
_userManager = userManager;
|
||||
_cacheManager = cacheManager;
|
||||
_elevatorControlService = elevatorControlService;
|
||||
AddUnExecuteTask = async code =>
|
||||
AddUnExecuteTask = async (code, floor) =>
|
||||
{
|
||||
await _elevatorControlService.CallLift(code, 5, CancellationToken.None);
|
||||
await _elevatorControlService.CallLift(code, floor, CancellationToken.None);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -415,7 +415,7 @@ namespace Tnb.WarehouseMgr
|
||||
if ((elevatorQueue.IsNull() || elevatorQueue.Count < 1))
|
||||
{
|
||||
elevatorQueueItem.task_status = "执行中";
|
||||
await _elevatorControlService.CallLift(devName, 5, CancellationToken.None);
|
||||
await _elevatorControlService.CallLift(devName, floorNO.ParseToInt(), CancellationToken.None);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user