alielie
2025-10-13 e3868d4d61ded0e76fc8fe3fdacdd9e6d9113cf1
HMI.IOMonitor/IOMonitor.xaml.cs
@@ -1,4 +1,5 @@
using HMI.Base;
using ConnectionUtil;
using HMI.Base;
using HMI.Core.Setting;
using HMI.Core.Util;
using HMI.IOMonitor.Entity;
@@ -7,11 +8,13 @@
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using OPCConnection;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Timers;
using System.Windows;
using System.Windows.Controls;
@@ -33,7 +36,7 @@
        private string DQTag = string.Empty;
        private SystemSetting systemSetting;
        private Timer MonitorTimer;
        private OpcInterface.OpcInterface lTSCADAApi = new OpcInterface.OpcInterface();
        private SCADAApi lTSCADAApi = new OPCClient();
        /// <summary>
@@ -290,12 +293,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"));
            }
        }
@@ -305,8 +308,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;
@@ -371,7 +374,7 @@
                catch (Exception ex)
                {
                    log.Error("Import Failed.", ex);
                    MsgBoxHelper.Error(this, $"导入失败!{ex.Message}");
                    MsgBoxHelper.Error(this, $"{this.lang("App.ImportFailed")}: {ex.Message}");
                }
            }
        }
@@ -416,7 +419,7 @@
            this.DataFilePath = Path.Combine(BaseFolder, "Data.xml");
        }
        public override object Active()
        public override void Active()
        {
            try
            {
@@ -452,9 +455,8 @@
            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;
        }
        private void CollectionViewSource_Filter(object sender, System.Windows.Data.FilterEventArgs e)