|
|
@ -3,7 +3,9 @@ using System.Collections.Generic;
|
|
|
|
using System.Reflection;
|
|
|
|
using System.Reflection;
|
|
|
|
using System.Text;
|
|
|
|
using System.Text;
|
|
|
|
using System.IO;
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
using System.Windows.Forms;
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
using System.Xml;
|
|
|
|
using ICSharpCode.Core;
|
|
|
|
using ICSharpCode.Core;
|
|
|
|
using ICSharpCode.Core.Services;
|
|
|
|
using ICSharpCode.Core.Services;
|
|
|
|
using Mesnac.Gui.Run.Global;
|
|
|
|
using Mesnac.Gui.Run.Global;
|
|
|
@ -103,8 +105,20 @@ namespace MCRun
|
|
|
|
{
|
|
|
|
{
|
|
|
|
AppConfigHandler.Instance.InitCustomerMenuAndToolStrip(WorkbenchSingleton.Workbench.TopMenu, WorkbenchSingleton.Workbench.ToolStrip); //初始化自定义系统菜单和工具栏
|
|
|
|
AppConfigHandler.Instance.InitCustomerMenuAndToolStrip(WorkbenchSingleton.Workbench.TopMenu, WorkbenchSingleton.Workbench.ToolStrip); //初始化自定义系统菜单和工具栏
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var instance = Mesnac.Equips.Factory.Instance.ConfigFile;
|
|
|
|
|
|
|
|
XmlDocument doc = new XmlDocument();
|
|
|
|
|
|
|
|
doc.Load(instance);
|
|
|
|
|
|
|
|
var nodes = doc.ChildNodes[1].ChildNodes[0].ChildNodes[0].ChildNodes[4].ChildNodes[0];
|
|
|
|
|
|
|
|
var ip = nodes.Attributes["value"].Value;
|
|
|
|
//初始化HslCommunication 11.0.6.0
|
|
|
|
//初始化HslCommunication 11.0.6.0
|
|
|
|
PlcBusiness.Instance.InitPlcConnect(PlcType.SiemensPlc, "127.0.0.1", 12);
|
|
|
|
PlcBusiness.Instance.InitPlcConnect(PlcType.SiemensPlc,ip, 102);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception exception)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ICSharpCode.Core.LoggingService<Program>.Debug("HSLPlc读取失败");
|
|
|
|
|
|
|
|
}
|
|
|
|
//初始化连接报警器
|
|
|
|
//初始化连接报警器
|
|
|
|
DoControl.Instance.ComOn();
|
|
|
|
DoControl.Instance.ComOn();
|
|
|
|
}
|
|
|
|
}
|
|
|
|