|
|
|
|
@ -34,6 +34,7 @@ using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Timers;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
@ -78,6 +79,11 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
private object updateLock = new object();
|
|
|
|
|
private readonly List<LocationDto> locationDtos = new List<LocationDto>();
|
|
|
|
|
private ObservableCollection<SelectItemModel> itemsControlItems;
|
|
|
|
|
//消息提示弹窗
|
|
|
|
|
private MessageBoxWindow messageBoxWindow ;
|
|
|
|
|
//3楼向其他楼层输出托盘流程时,AGV把托盘放置到接驳位后,在调度界面增加“托盘入轿厢等待确认”提示信息
|
|
|
|
|
int systemRunTimerCount = 0;
|
|
|
|
|
System.Timers.Timer systemRunTimer = new System.Timers.Timer(1000 * 60);
|
|
|
|
|
|
|
|
|
|
//人工叫料选中类
|
|
|
|
|
public class SelectItemModel
|
|
|
|
|
@ -126,7 +132,72 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
InventoryMaterialWindow.RefreshInventoryListEvent += GetInvertoryData;
|
|
|
|
|
AddTask.RefreTaskListEvent += GetTask;
|
|
|
|
|
|
|
|
|
|
systemRunTimer.Elapsed += new System.Timers.ElapsedEventHandler(CalculateTaskWaitTime);
|
|
|
|
|
systemRunTimer.AutoReset = true;
|
|
|
|
|
systemRunTimer.Enabled = true;
|
|
|
|
|
systemRunTimer.Start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 3楼向其他楼层输出托盘流程时,AGV把托盘放置到接驳位后,在调度界面增加“托盘入轿厢等待确认”提示信息
|
|
|
|
|
/// 计算任务等待时长
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
private void CalculateTaskWaitTime(object? sender, ElapsedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
using var scope = _host.Services.CreateScope();
|
|
|
|
|
var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>();
|
|
|
|
|
// 给提升机已经下发入库指令,判断超时4分钟
|
|
|
|
|
var task = dbContext.WcsTask.Where(t => t.nextPointId == 6 && t.taskStatus==2).FirstOrDefault();
|
|
|
|
|
task = new WcsTask();
|
|
|
|
|
task.fromFloorNo = 3;
|
|
|
|
|
if (task != null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (systemRunTimerCount++ == 4 )
|
|
|
|
|
{
|
|
|
|
|
Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
messageBoxWindow = new MessageBoxWindow($"{task.fromFloorNo}楼下发入库指令,超过5分钟未反馈,请前往{task.fromFloorNo}楼点击蓝色确认按钮,或排查提升机故障");
|
|
|
|
|
messageBoxWindow.Show();
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
systemRunTimerCount = 0;
|
|
|
|
|
// 如果 task 为空并且窗口是可见的,关闭窗口
|
|
|
|
|
if (messageBoxWindow !=null)
|
|
|
|
|
{
|
|
|
|
|
Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
messageBoxWindow.Close();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
messageBoxWindow = null;
|
|
|
|
|
systemRunTimerCount = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
HandyControl.Controls.MessageBox.Error($"计算系统运行时长异常:{ex.Message}");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 页面加载事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
|