add-引入提升机异常处理步序清0信号

master
liuwf 1 year ago
parent 35d2c077a1
commit 15dada26c1

@ -47,9 +47,13 @@ namespace Khd.Core.Wpf.WindowPage
private bool taskHandlerFlag = false;
/// <summary>
/// 提升机当前楼层
/// 提升机当前楼层
/// </summary>
private BasePlcpoint currentfloor06;
/// <summary>
/// 提升机步序清0
/// </summary>
private BasePlcpoint hoisterStepClear;
private DispatcherTimer _timer;
private int _timeRemaining = 30; // 初始时间为30秒
@ -101,6 +105,7 @@ namespace Khd.Core.Wpf.WindowPage
{
try
{
getCurrentFloor();
using var scope = _host.Services.CreateScope();
using var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>();
@ -139,8 +144,15 @@ namespace Khd.Core.Wpf.WindowPage
{
try
{
///轿厢线步序清0 等待昆明TODO
///
///轿厢线步序清0
this.hoisterStepClear = SystemData.BasePlcpoints.First(t => t.plcpointNo== "hoisterStepClear");
SystemData.PlcDic[0].Write(hoisterStepClear.plcpointAddress, 1);
Task.Run(() =>
{
Thread.Sleep(1000);
SystemData.PlcDic[0].Write(hoisterStepClear.plcpointAddress, 0);
});
this.HoistClearButton.Background = new SolidColorBrush(Colors.LimeGreen);
this.Msg.Text = DateTime.Now + " 轿厢线步序清0成功请等待30s以后提升机还未动作请点击任务处理按钮...";

Loading…
Cancel
Save