using HML; using JinYuan.DAL; using JinYuan.Helper; using JinYuan.MES; using JinYuan.MES.Models; using JinYuan.Models; using JinYuan.VirtualDataLibrary.Utlis; using MiniExcelLibs; using PLC; using PLC.PLCAlarm; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading; using System.Windows.Forms; using System.Xml.Linq; namespace JinYuan.VirtualDataLibrary { public class CommonMethods { public static readonly object SyncRoot = new object(); /// /// 本地数据库 /// public static ISugarHelper db = new SQLSugarService(); /// /// 远程服务段数据库 /// public static ISugarHelper dbServer = new SQLSugarService(); /// /// 全局的PLC链接 /// public static List plcDevices; /// /// plc状态 /// public static readonly Dictionary> plcStatuses = new Dictionary>(); /// /// 报警 /// public static AlarmManager alarmManager = new AlarmManager(); /// /// MES接口 /// public static IMes hbgMes = new MesDataProcess(); /// /// 参数 /// public static ProductModelParam parRange = new ProductModelParam(); /// /// 全局钩子 /// public static ScanerHook listener = new ScanerHook(); /// /// 创建个全局焊接功率队列数据存储 /// public static List> QWeldingPowerData = new List>(); /// /// 创建个全局入壳推力队列数据存储 /// public static List> QPlanenessData = new List>(); /// /// 创建全局的登录对象 /// public static SysAdmin currentAdmin = null; /// /// 创建全局的登录对象 /// public static List listNgCodeEntity = new List(); /// /// 登录是否成功 /// public static bool IsLoginOk = false; //创建一个全局的配置对象 public static SysConfig sysConfig = new SysConfig(); public static int InvadTime; /// /// 智能电表 /// public static List listElectricEnergy = new List(); /// /// 电能表 /// public static EnergyMeterHelper energyMeter = new EnergyMeterHelper(); /// ///是否开启刷新 /// public static bool isRefreshTimerWeeding = false; /// /// SQL语句 /// public static DBSQL dBSQL { get; } = new DBSQL(); public static M_DBCtrl m_DBCtrl { get; } = new M_DBCtrl(); /// /// MES配置文件类 /// public static MesConfig mesConfig = new MesConfig(); /// /// 打印模板配置文件类 /// public static BTWConfig btwConfig = new BTWConfig(); ///创建一个全局的连接状态 public static bool connectState = false; /// /// 滴答次数 /// public static int tickCount = 0; /// /// QIEHUAN /// public static int tickHomeCount = 0; /// /// 报警信息 /// public static string SlideAlarmText = "当前无报警"; /// /// 退出 /// public static bool IsExit = false; /// /// 是否登出账户 /// public static bool LoginOut = false; /// /// 是否上传MES /// public static bool IsUpMes { get; set; } /// /// 是否运行 /// public static bool IsRun { get; set; } = false; /// /// 上一次设备状态 /// public static int DeviceStatus = 0; /// /// 上一次Guid /// public static string DeviceGuid = ""; /// ///第一次读取 /// public static bool IsFirst = false; /// /// 焊接功率波形图显示条数 /// public static int ChatLineCount = 3; /// /// 员工号 /// public static string strWorker { get; set; } /// /// 是否开启智能电表 /// public static bool IsStartZNDB { get; set; } = false; /// /// 白夜班 /// public static string strClass { get; set; } = "白班"; /// /// 时间变更 /// public static string ChangeClassTime { get; set; } = "20:30:00"; /// /// 设备状态 /// public static List Statues { get; set; } /// /// 服务器链接状态 /// public static bool EMCStatues { get; set; } #region 小时产能 /// /// 上个时间点的总数 /// public static int LastTotalNum { get; set; } = 0; /// /// 上个时间点良品数 /// public static int LastOkNum { get; set; } = 0; /// /// 上一次重置计数的时间 /// public static string LastResetTime { get; set; } /// /// 上一次的小时 /// public static int LastHour { get; set; } #endregion /// /// /// public static List ListOmronGroups { get; set; } /// /// 12小时产能 /// public static List Lst_Prod12HourData = new List(); /// /// 不良选项(检测项不良) /// public static List Lst_DefectTypeQty = new List(); /// /// PLC报警前10项 /// public static List Lst_AlarmTop10_Qty = new List(); /// /// 参数项设置 /// public static List paramlists { get; set; } /// /// 线程控制 /// public static ManualResetEvent ResetEventRecv = new ManualResetEvent(true); #region 计数项 /// /// 生产总数 /// public static float TotalQty = 0; public static float ProOKQty = 0; public static float Ppm = 0; public static double JiaDL = 0.0; public static List AntiDustAirSpeed = new List(); /// /// PLC开机/运行时间 /// public static List PlcOpenAndRunTime = new List(); /// /// PLC开机/运行时间地址 /// public static List PlcOpenAndRunTimeAdress = new List { "D50", "D52", "D54", "D56", "D58", "D60" }; public static int ProdGaoRFIDNgQty = 0;//高托杯 绑定卷心码 public static int ProdDiRFIDNgQty = 0;//低托杯 绑定钢壳码 public static int ProdGangKeRFIDNgQty = 0;//钢壳托杯 绑定出站钢壳码 public static int ProdJuanBarNgQty = 0; public static int ProdGangKeBarNgQty = 0; public static int ProdRuKeTuiliNgQty = 0; public static int ProdCCDNgQty = 0; public static int ProdMesOutNGQty = 0; #endregion #region 配置信息 /// /// 错误日志路径 /// public static string strErrorLogspath = "D:\\APILog\\Logs\\ErrorLogs"; public static string strSystemLogspath = "D:\\APILog\\Logs\\SystemLogs"; public static string strAlarmLogspath = "D:\\APILog\\Logs\\AlarmLogs"; public static string strsqlLogspath = ""; /// /// 删除路径 /// public static string strDeletepath = ""; /// /// 能耗保存路径 /// public static string strWattrMeterpath = "D:\\APILog\\Logs\\智能电表数据"; /// /// MES路径日志 /// public static string strMesLogspath = "D:\\APILog\\Logs\\MesLogs"; /// /// 主界面下列表绑定数据 /// public static DropDownListPlusItemCollection DropDownItemList = new DropDownListPlusItemCollection(); /// /// 设备状态信息路径 /// public static string strDeviceStatusPath = System.Windows.Forms.Application.StartupPath + "\\Config\\DeviceStatus.cfg"; /// /// PLC读取寄存器配置文件路径 /// public static string ConfigPath = Path.Combine(System.Windows.Forms.Application.StartupPath, "ini\\PlcConfig.ini"); /// /// 系统程序配置文件路径 /// //public static string iniFilePath = Path.Combine(System.Windows.Forms.Application.StartupPath, "ini\\Configure.ini"); public static string xmlFilePath = Path.Combine(System.Windows.Forms.Application.StartupPath, "Config\\Configure.xml"); /// /// 配置文件字典 /// public static Dictionary> Configxml = new Dictionary>(); #region 读取配置文件 // 读取 XML 配置文件 public static Dictionary> ReadXmlConfig(string filePath) { var config = new Dictionary>(); if (!File.Exists(filePath)) { MessageBox.Show($"配置文件不存在:{filePath}\n请检查Config文件夹是否存在,且包含Configure.xml文件"); return config; } XDocument xmlDoc = XDocument.Load(filePath); foreach (var sectionElement in xmlDoc.Root.Elements()) { string sectionName = sectionElement.Name.LocalName; config[sectionName] = new Dictionary(); foreach (var keyElement in sectionElement.Elements()) { string key = keyElement.Name.LocalName; string value = keyElement.Value; config[sectionName][key] = value; } } return config; } // 获取配置值 public static string GetConfigValue(Dictionary> config, string section, string key, string defaultValue) { if (config.ContainsKey(section) && config[section].ContainsKey(key)) { return config[section][key]; } return defaultValue; } // 写入 XML 文件 public static void WriteXmlFile(Dictionary> config, string filePath) { XDocument xmlDoc = new XDocument(new XElement("Configuration")); foreach (var section in config) { var sectionElement = new XElement(section.Key); foreach (var keyValue in section.Value) { sectionElement.Add(new XElement(keyValue.Key, keyValue.Value)); } xmlDoc.Root.Add(sectionElement); } xmlDoc.Save(filePath); } /// /// 单个配置数据保存 /// /// /// /// public static void UpdateConfig(string INFO, string Type, string value) { // 更新 Configxml 中的 SteelshellCount CommonMethods.Configxml[INFO][Type] = value; // 将更新后的 Configxml 写入文件 CommonMethods.WriteXmlFile(CommonMethods.Configxml, CommonMethods.xmlFilePath); } /// ///读取配置文件 /// public static SysConfig GetSysConfig() { try { // 读取配置项 string line_gongwei = GetConfigValue(Configxml, "CONFIG_INFO", "EquipNo", "1-1"); // 安全拆分EquipNo string[] gongweis = !string.IsNullOrWhiteSpace(line_gongwei) ? line_gongwei.Split('-') : new string[0]; // 安全获取LineNo string lineNo = gongweis.Length >= 1 && !string.IsNullOrWhiteSpace(gongweis[0]) ? gongweis[0].Trim() : "1"; // 安全获取StationNo string stationNo = gongweis.Length >= 2 && !string.IsNullOrWhiteSpace(gongweis[1]) ? gongweis[1].Trim() : "1"; #region 系统配置文件 return sysConfig = new SysConfig { AutoStart = Convert.ToBoolean(GetConfigValue(Configxml, "CONFIG_INFO", "AutoStart", "true")), AutoLogin = Convert.ToBoolean(GetConfigValue(Configxml, "CONFIG_INFO", "AutoLogin", "true")), AutoLock = Convert.ToBoolean(GetConfigValue(Configxml, "CONFIG_INFO", "AutoLockScreen", "false")), LockPeriod = Convert.ToInt32(GetConfigValue(Configxml, "CONFIG_INFO", "LockIntervalTime", "0")), AutoQieHuanM = Convert.ToBoolean(GetConfigValue(Configxml, "CONFIG_INFO", "AutoSwitchMonitor", "false")), QieHuanMPeriod = Convert.ToInt32(GetConfigValue(Configxml, "CONFIG_INFO", "SwitchMonitorInterval", "0")), ShowSeriesCount = Convert.ToInt32(GetConfigValue(Configxml, "CONFIG_INFO", "CurveDisplayCount", "0")), SwipeCardMode = Convert.ToBoolean(GetConfigValue(Configxml, "CONFIG_INFO", "EnableCardMode", "false")), MesModeSwitching = Convert.ToBoolean(GetConfigValue(Configxml, "CONFIG_INFO", "MESModeSwitch", "false")), FinishSwitching = Convert.ToBoolean(GetConfigValue(Configxml, "CONFIG_INFO", "FinishSwitch", "false")), GetMesParam = Convert.ToBoolean(GetConfigValue(Configxml, "CONFIG_INFO", "FetchMESParams", "false")), SaveThreadTime = Convert.ToBoolean(GetConfigValue(Configxml, "CONFIG_INFO", "SaveThreadTimeLog", "false")), IsDebugMode = Convert.ToBoolean(GetConfigValue(Configxml, "CONFIG_INFO", "IsDebugMode", "true")), WuLiu = Convert.ToBoolean(GetConfigValue(Configxml, "CONFIG_INFO", "WuLiu", "false")), GongWei = string.IsNullOrWhiteSpace(line_gongwei) ? "1-1" : line_gongwei, LineNo = lineNo, StationNo = stationNo }; #endregion } catch (Exception) { return sysConfig = null; } } /// /// 获取MES配置文件 /// public static MesConfig GetMesConfig() { try { #region MES配置文件 return mesConfig = new MesConfig { siteCode = GetConfigValue(Configxml, "MES_CONFIG", "SiteCode", "57M"), lineCode = GetConfigValue(Configxml, "MES_CONFIG", "LineCode", "PW-571"), equipNum = GetConfigValue(Configxml, "MES_CONFIG", "EquipNum", "571VIM01"), CustomerPartNum = GetConfigValue(Configxml, "MES_CONFIG", "CustomerPartNum", "491VIM01"), MESURLAddressIP = GetConfigValue(Configxml, "MES_CONFIG", "MESIp", "10.100.111.81"), MESURLAddressPort = GetConfigValue(Configxml, "MES_CONFIG", "MESPort", "80"), EmployeeAuthCheck = GetConfigValue(Configxml, "MES_CONFIG", "EmployeeAuthCheck", "571VIM01"), DeviceParamRequest = GetConfigValue(Configxml, "MES_CONFIG", "DeviceParamRequest", "571VIM01"), DeviceParamChange = GetConfigValue(Configxml, "MES_CONFIG", "DeviceParamChange", "491581VIM01VIM01"), DeviceAlarm = GetConfigValue(Configxml, "MES_CONFIG", "DeviceAlarm", "581VIM01"), DeviceStatus = GetConfigValue(Configxml, "MES_CONFIG", "DeviceStatus", "581VIM01"), EnergyConsumption = GetConfigValue(Configxml, "MES_CONFIG", "EnergyConsumption", "581VIM01"), Anemometer = GetConfigValue(Configxml, "MES_CONFIG", "Anemometer", "581VIM01"), queryTrayUrl = GetConfigValue(Configxml, "MES_CONFIG", "QueryTrayUrl", ""), queryGradeUrl = GetConfigValue(Configxml, "MES_CONFIG", "QueryGradeUrl", ""), upResultParamUrl = GetConfigValue(Configxml, "MES_CONFIG", "UpResultParamUrl", ""), packLoadUrl = GetConfigValue(Configxml, "MES_CONFIG", "PackLoadUrl", ""), finishedPackUrl = GetConfigValue(Configxml, "MES_CONFIG", "finishedPackUrl", ""), unbindTrayUrl = GetConfigValue(Configxml, "MES_CONFIG", "unBindTrayUrl", ""), packLayers = int.Parse(GetConfigValue(Configxml, "MES_CONFIG", "PackLayers", "4")), rowsPerLayer = int.Parse(GetConfigValue(Configxml, "MES_CONFIG", "RowsPerLayer", "5")), colsPerLayer = int.Parse(GetConfigValue(Configxml, "MES_CONFIG", "ColsPerLayer", "12")), }; #endregion } catch (Exception) { return mesConfig = null; } } public static List fdConfigs; public static FDConfig curFdConfig; //垛位分档信息 public static List FDConfigMappings { get; set; } = new List(); public static FDConfigMapping CurrentFDConfig { get; set; } public static void LoadFDConfig() { FDConfig fdconfig = null; string FdConfigFilePath = CommonMethods.FdConfigFilePath; //Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config/FdConfig.xlsx"); if (File.Exists(FdConfigFilePath)) { using (var stream = File.OpenRead(FdConfigFilePath)) { var devices = MiniExcel.Query(stream).ToList(); CommonMethods.fdConfigs = devices.Select(device => new FDConfig { FdNum = device.FdNum, Grade1 = device.Grade1, Grade2 = device.Grade2, Grade3 = device.Grade3, IsFDActive = device.IsFDActive, }).ToList(); CommonMethods.curFdConfig = CommonMethods.fdConfigs[CommonMethods.fdConfigs.Count - 1]; } } } /// /// 加载分档配置 /// public static void LoadFDConfigMappings() { try { string fdConfigPath = CommonMethods.FdConfigMappingPath;//Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config", "fd_config.xlsx"); if (File.Exists(fdConfigPath)) { FDConfigMappings = MiniExcel.Query(fdConfigPath).ToList(); } else { FDConfigMappings = new List(); } } catch (Exception ex) { LogHelper.Instance.WriteError($"加载分档配置失败:{ex.Message}", "SysErrorLog"); FDConfigMappings = new List(); } } /// /// 根据机架号获取分档配置 /// public static string GetFDConfigByStation(int stationNo) { if (stationNo == 1) return curFdConfig.Grade1; else if(stationNo == 2) return curFdConfig.Grade2; else if (stationNo == 3) return curFdConfig.Grade3; return ""; } /// /// 将电池等级转换成下发PLC的等级编号 /// /// /// public static int GetGradeNo(string strGrade) { if (string.IsNullOrEmpty(strGrade)) return 99; if (strGrade == "NG" || strGrade == "拦截") return 99; if (strGrade == "不设置") return 90; var config = FDConfigMappings?.FirstOrDefault(x => x.FDName == strGrade); return config != null ? (short)config.FDNum : 99; } public static List FDGradeTypes = new List(); public static void LoadFDGradeTypes() { try { string fdConfigPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config", "FdConfigMapping.xlsx"); if (File.Exists(fdConfigPath)) { var configs = MiniExcel.Query(fdConfigPath).ToList(); var types = configs.Select(x => x.FDName).Distinct().ToList(); // 确保包含 "不设置" 和 "NG" if (!types.Contains("不设置")) types.Insert(0, "不设置"); if (!types.Contains("NG")) types.Add("NG"); FDGradeTypes = types; } else { FDGradeTypes = new List { "不设置", "NG" }; } } catch (Exception ex) { Console.WriteLine($"LoadFDGradeTypes error: {ex.Message}"); FDGradeTypes = new List { "不设置", "NG" }; } } public static List GetValidGrades() { List grades = new List(); if (curFdConfig != null) { if (curFdConfig.Grade1 != null && curFdConfig.Grade1 != "NG" && curFdConfig.Grade1 != "不设置") { grades.Add(curFdConfig.Grade1); } if (curFdConfig.Grade2 != null && curFdConfig.Grade2 != "NG" && curFdConfig.Grade2 != "不设置") { grades.Add(curFdConfig.Grade2); } if (curFdConfig.Grade3 != null && curFdConfig.Grade3 != "NG" && curFdConfig.Grade3 != "不设置") { grades.Add(curFdConfig.Grade3); } grades = grades.Distinct().ToList(); } return grades; } /// /// 获取BTW配置文件 /// public static BTWConfig GetBtwConfig() { try { #region 打印模板路径配置文件 return btwConfig = new BTWConfig { containerBTWPath = GetConfigValue(Configxml, "BTW_CONFIG", "ContainerBTWPath", ""), printerName = GetConfigValue(Configxml, "BTW_CONFIG", "PrinterName", ""), }; #endregion } catch (Exception) { return btwConfig = null; } } #endregion public static string deviceConfigPath = Application.StartupPath + "\\Config\\Device.xlsx"; public static string groupConfigPath = Application.StartupPath + "\\Config\\Group.xlsx"; public static string variableConfigPath = Application.StartupPath + "\\Config\\Variable.xlsx"; public static string FdConfigFilePath = Application.StartupPath + "\\Config\\FdConfig.xlsx"; public static string FdConfigMappingPath = Application.StartupPath + "\\Config\\FdConfigMapping.xlsx"; #region 保存配置文件 /// /// 保存启动自动登录 /// /// /// public static bool SaveAutoStart(bool value) { Configxml["CONFIG_INFO"]["AutoStart"] = value.ToString(); // 修改自动登录为 True WriteXmlFile(Configxml, xmlFilePath); return true; } /// /// 保存开机自动启动 /// /// /// public static bool SaveAutoLogin(bool value) { Configxml["CONFIG_INFO"]["AutoLogin"] = value.ToString(); WriteXmlFile(Configxml, xmlFilePath); return true; } /// /// 保存无操作自动锁屏 /// /// /// public static bool SaveAutoLock(bool value) { Configxml["CONFIG_INFO"]["AutoLockScreen"] = value.ToString(); WriteXmlFile(Configxml, xmlFilePath); return true; } /// /// 保存锁屏间隔时间 /// /// /// public static bool SaveLockPeriod(int value) { Configxml["CONFIG_INFO"]["LockIntervalTime"] = value.ToString(); WriteXmlFile(Configxml, xmlFilePath); return true; } /// /// 保存无操作自动切换监控界面 /// /// /// public static bool SaveAutoQieHuanM(bool value) { Configxml["CONFIG_INFO"]["AutoSwitchMonitor"] = value.ToString(); WriteXmlFile(Configxml, xmlFilePath); return true; } /// /// 保存无操作自动切换监控界面 /// /// /// public static bool SaveIsDebug(bool value) { Configxml["CONFIG_INFO"]["IsDebugMode"] = value.ToString(); WriteXmlFile(Configxml, xmlFilePath); return true; } /// /// 保存物流线分拣 /// /// /// public static bool SaveWuLiu(bool value) { Configxml["CONFIG_INFO"]["WuLiu"] = value.ToString(); WriteXmlFile(Configxml, xmlFilePath); return true; } /// /// 保存切换监控界面间隔时间 /// /// /// public static bool SaveQieHuanMPeriod(int value) { Configxml["CONFIG_INFO"]["SwitchMonitorInterval"] = value.ToString(); WriteXmlFile(Configxml, xmlFilePath); return true; } /// /// 保存曲线显示数量 /// /// /// public static bool SaveShowSeriesCount(int value) { Configxml["CONFIG_INFO"]["CurveDisplayCount"] = value.ToString(); WriteXmlFile(Configxml, xmlFilePath); return true; } /// /// 开启刷卡模式 /// /// /// public static bool SaveSwipeCardMode(bool value) { Configxml["CONFIG_INFO"]["EnableCardMode"] = value.ToString(); WriteXmlFile(Configxml, xmlFilePath); return true; } /// /// MES/非MES模式 /// /// /// public static bool SaveOpenMesModel(bool value) { Configxml["CONFIG_INFO"]["MESModeSwitch"] = value.ToString(); WriteXmlFile(Configxml, xmlFilePath); return true; } /// /// 成品/半成品切换 /// /// /// public static bool SaveFinishSwitch(bool value) { Configxml["CONFIG_INFO"]["FinishSwitch"] = value.ToString(); WriteXmlFile(Configxml, xmlFilePath); return true; } /// /// 保存机架号 /// /// /// public static bool SaveEquipNo(string value) { Configxml["CONFIG_INFO"]["EquipNo"] = value.ToString(); WriteXmlFile(Configxml, xmlFilePath); return true; } /// /// 获取MES参数 /// /// /// public static bool SaveGetMesParam(bool value) { Configxml["CONFIG_INFO"]["FetchMESParams"] = value.ToString(); WriteXmlFile(Configxml, xmlFilePath); return true; } /// /// 保存线程耗时操作 /// /// /// public static bool SaveSaveThreadTime(bool value) { Configxml["CONFIG_INFO"]["SaveThreadTimeLog"] = value.ToString(); WriteXmlFile(Configxml, xmlFilePath); return true; } #endregion #endregion #region 委托信息 //创建委托 // 数据监视委托 public static Action AddDataMonitorDelegate; /// /// 系统日志 /// public static Action AddLogDelegate; /// /// 操作日志 /// public static Action AddOPLogDelegate; /// /// 报警日志 /// public static Action AddAlarmDelegate; /// /// 显示报警信息 /// public static Action ShowAlarmDelegate; /// /// 参数更新 /// public static Action ChangeParamDelegate; /// /// /// public static Action AddHomeDelegate; /// /// 显示组盘信息 /// public static Action> ShowFeedingDelegate; /// /// 显示组盘抽检信息 /// public static Action> ShowReFeedingDelegate; /// /// 显示叠盘数据 /// public static Action> ShowBlankingDelegate; /// /// 显示底托拉板绑定信息 /// public static Action> ShowMaterialDelegate; /// /// 显示料框码进站信息 /// public static Action> ShowTrayDataDelegate; /// /// 电池状态委托 /// public static Action> ShowBatteryStatusDelegate; /// /// 满层后,展示电池二维码 /// //public static Action> ShowBatteryQRCoderDelegate; /// /// 档位NG原因委托 /// public static Action> ShowBatteryNGRsnDelegate; /// /// 显示电池替换信息 /// public static Action> ShowBatteryReplaceDelegate; /// /// 显示卡板打印信息 /// public static Action> ShowLabellingMachineDelegate; /// /// 数据监视委托 /// /// /// public static void AddDataMonitorLog(int type, string info) { //调用委托 if (AddDataMonitorDelegate != null) { AddDataMonitorDelegate(type, info); } } /// /// 写入系统日志 /// /// 是否为错误信息 /// 日志信息 public static void AddLog(bool isError, string info) { //调用委托 if (AddLogDelegate != null) { AddLogDelegate(isError, info); } } /// /// 写入操作日志 /// /// /// public static void AddOPLog(bool isError, string info) { //调用委托 if (AddLogDelegate != null) { AddOPLogDelegate(isError, info); } } public static void AddAlarmLog(SysLog sysLog) { //调用委托 if (AddAlarmDelegate != null) { AddAlarmDelegate(sysLog); } } /// /// 显示报警日志 /// /// public static void ShowAlarmLog(string info) { //调用委托 if (ShowAlarmDelegate != null) { ShowAlarmDelegate(info); } } public static void ChangeParamData() { //调用委托 if (ChangeParamDelegate != null) { ChangeParamDelegate(); } } #endregion /// /// PLC变量集合 /// KEY = VarAddress /// public static ConcurrentDictionary PLCVariable = new ConcurrentDictionary(); // 打印机 /// /// zebra /// public static BartenderPrinter containerPrint; } }