|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using SlnMesnac.Business;
|
|
|
|
|
using SlnMesnac.Business.@base;
|
|
|
|
|
using SlnMesnac.Model.domain;
|
|
|
|
|
using SlnMesnac.Plc;
|
|
|
|
|
using SlnMesnac.WPF.ViewModel;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
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.Data;
|
|
|
|
|
using System.Windows.Documents;
|
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
|
using System.Windows.Navigation;
|
|
|
|
|
using System.Windows.Shapes;
|
|
|
|
|
using TouchSocket.Core;
|
|
|
|
|
|
|
|
|
|
namespace SlnMesnac.WPF.Page
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// DevMonitorPage.xaml 的交互逻辑
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class RecipeManagePage : UserControl
|
|
|
|
|
{
|
|
|
|
|
private BaseBusiness baseBusiness = null;
|
|
|
|
|
private readonly ConfigInfoBusiness _configInfoBusiness;
|
|
|
|
|
PlcAbsractFactory plc = null;
|
|
|
|
|
int MachineSleep = 1000;
|
|
|
|
|
private readonly ILogger<DevMonitorPage> _logger;
|
|
|
|
|
|
|
|
|
|
System.Timers.Timer systemRunTimer = new System.Timers.Timer(1000 * 60);
|
|
|
|
|
|
|
|
|
|
public RecipeManagePage()
|
|
|
|
|
{
|
|
|
|
|
_logger = App.ServiceProvider.GetService<ILogger<DevMonitorPage>>();
|
|
|
|
|
_configInfoBusiness = App.ServiceProvider.GetService<ConfigInfoBusiness>();
|
|
|
|
|
|
|
|
|
|
baseBusiness = App.ServiceProvider.GetService<BaseBusiness>();
|
|
|
|
|
MachineSleep = Convert.ToInt32(baseBusiness.GetPlcAddressByConfigKey("设备启动间隔"));
|
|
|
|
|
plc = baseBusiness.GetPlcByKey("plc");
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
this.DataContext = new DevMonitorViewModel();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|