add-向其他楼层输出托盘流程时,AGV把托盘放置到接驳位后,在调度界面增加“托盘入轿厢等待确认”提示信息

master
liuwf 1 year ago
parent 340c408d30
commit d0a336877f

@ -34,6 +34,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Timers;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
@ -78,6 +79,11 @@ namespace Khd.Core.Wpf.Form
private object updateLock = new object(); private object updateLock = new object();
private readonly List<LocationDto> locationDtos = new List<LocationDto>(); private readonly List<LocationDto> locationDtos = new List<LocationDto>();
private ObservableCollection<SelectItemModel> itemsControlItems; 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 public class SelectItemModel
@ -126,7 +132,72 @@ namespace Khd.Core.Wpf.Form
InitializeComponent(); InitializeComponent();
InventoryMaterialWindow.RefreshInventoryListEvent += GetInvertoryData; InventoryMaterialWindow.RefreshInventoryListEvent += GetInvertoryData;
AddTask.RefreTaskListEvent += GetTask; 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>
/// 页面加载事件 /// 页面加载事件
/// </summary> /// </summary>

@ -0,0 +1,12 @@
<Window x:Class="Khd.Core.Wpf.WindowPage.MessageBoxWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Khd.Core.Wpf.WindowPage"
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
Title="MessageBoxWindow" Height="300" Width="400">
<Grid>
<TextBlock x:Name="Msg" FontSize="30" TextWrapping="Wrap" />
</Grid>
</Window>

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Khd.Core.Wpf.WindowPage
{
/// <summary>
/// MessageBoxWindow.xaml 的交互逻辑
/// </summary>
public partial class MessageBoxWindow : Window
{
public MessageBoxWindow(string msg)
{
InitializeComponent();
this.Msg.Text = msg;
}
}
}
Loading…
Cancel
Save