alielie
2025-03-13 ba6207f52db76ab47cd6534de0cf1712674ff179
HMI.IOMonitor/IOMonitor.xaml.cs
@@ -1,26 +1,21 @@
using System.Collections.Generic;
using System.Configuration;
using System;
using System.Windows;
using System.Windows.Controls;
using HMI.Base;
using HMI.Core.Api;
using HMI.IOMonitor.Entity;
using log4net;
using System.Linq;
using System.IO;
using HMI.Core.Util;
using System.Collections.ObjectModel;
using HMI.Base;
using HMI.Core.Setting;
using HMI.Core.Util;
using HMI.IOMonitor.Entity;
using HMI.UI.Util;
using System.Timers;
using System.Windows.Media;
using System.Threading.Tasks;
using System.Windows.Data;
using Microsoft.Win32;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using NPOI.HSSF.UserModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Timers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
namespace HMI.IOMonitor
{
@@ -48,20 +43,14 @@
        /// <summary>The dis
        /// DI口对象
        /// </summary>
        private ObservableCollection<DIO> _dis = new ObservableCollection<DIO>() {
            new DIO(null,null,null,false),
            new DIO(null,null,null,true),
        };
        private ObservableCollection<DIO> _dis = new ObservableCollection<DIO>();
        public ObservableCollection<DIO> Dis
        {
            get => _dis;
            set { Set(ref _dis, value); }
        }
        private ObservableCollection<DIO> _dos = new ObservableCollection<DIO>() {
            new DIO(null,null,null,false),
            new DIO(null,null,null,true),
        };
        private ObservableCollection<DIO> _dos = new ObservableCollection<DIO>();
        public ObservableCollection<DIO> Dos
        {
            get => _dos;
@@ -301,12 +290,12 @@
        {
            IPManageModal modal = new IPManageModal(log)
            {
                Title = "新增",
                Title = this.lang("App.Add"),
                Owner = Window.GetWindow(this),
            };
            if (modal.Open(-1, new IPManage(), IPManages, SettingFilePath) == true)
            {
                this.Success("新增成功");
                this.Success(this.lang("App.AddSuccess"));
            }
        }
@@ -316,8 +305,8 @@
            OpenFileDialog dialog = new OpenFileDialog();
            ////该值确定是否可以选择多个文件
            dialog.Multiselect = false;
            dialog.Title = "请选择文件";
            dialog.Filter = "execl文件(*.xlsx;*.xls)|*.xlsx;*.xls";
            dialog.Title = this.lang("App.SelectFile");
            dialog.Filter = "execl(*.xlsx;*.xls)|*.xlsx;*.xls";
            if (dialog.ShowDialog() == true)
            {
                MonitorTimer.Enabled = false;
@@ -382,7 +371,7 @@
                catch (Exception ex)
                {
                    log.Error("Import Failed.", ex);
                    MsgBoxHelper.Error(this, $"导入失败!{ex.Message}");
                    MsgBoxHelper.Error(this, $"{this.lang("App.ImportFailed")}: {ex.Message}");
                }
            }
        }
@@ -463,7 +452,7 @@
            catch (Exception ex)
            {
                log.Error("Active Execute Failed.", ex);
                MsgBoxHelper.ErrorMessage(this, $"插件激活失败!{ex.Message}");
                MsgBoxHelper.ErrorMessage(this, $"{this.lang("DIO.ActivateFailed")}: {ex.Message}");
            }
            return null;
        }