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 { /// /// DevMonitorPage.xaml 的交互逻辑 /// public partial class RecipeManagePage : UserControl { private BaseBusiness baseBusiness = null; private readonly ConfigInfoBusiness _configInfoBusiness; PlcAbsractFactory plc = null; int MachineSleep = 1000; private readonly ILogger _logger; System.Timers.Timer systemRunTimer = new System.Timers.Timer(1000 * 60); public RecipeManagePage() { _logger = App.ServiceProvider.GetService>(); _configInfoBusiness = App.ServiceProvider.GetService(); baseBusiness = App.ServiceProvider.GetService(); MachineSleep = Convert.ToInt32(baseBusiness.GetPlcAddressByConfigKey("设备启动间隔")); plc = baseBusiness.GetPlcByKey("plc"); InitializeComponent(); this.DataContext = new DevMonitorViewModel(); } } }