|
|
@ -8,6 +8,7 @@ using System.Windows.Forms;
|
|
|
|
using System.Xml;
|
|
|
|
using System.Xml;
|
|
|
|
using ICSharpCode.Core;
|
|
|
|
using ICSharpCode.Core;
|
|
|
|
using ICSharpCode.Core.Services;
|
|
|
|
using ICSharpCode.Core.Services;
|
|
|
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.FinishBatch;
|
|
|
|
using Mesnac.Gui.Run.Global;
|
|
|
|
using Mesnac.Gui.Run.Global;
|
|
|
|
namespace MCRun
|
|
|
|
namespace MCRun
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -25,6 +26,9 @@ namespace MCRun
|
|
|
|
[STAThread]
|
|
|
|
[STAThread]
|
|
|
|
static void Main(string[] args)
|
|
|
|
static void Main(string[] args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Timer timer = new Timer();
|
|
|
|
|
|
|
|
|
|
|
|
if (Mesnac.Basic.ProcessHelper.HaveRunningInstance())
|
|
|
|
if (Mesnac.Basic.ProcessHelper.HaveRunningInstance())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Mesnac.Basic.MessageBoxTimeOut.Show("The application is running, Please be patient...", "Caption", 2000);
|
|
|
|
Mesnac.Basic.MessageBoxTimeOut.Show("The application is running, Please be patient...", "Caption", 2000);
|
|
|
@ -121,6 +125,16 @@ namespace MCRun
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//初始化连接报警器
|
|
|
|
//初始化连接报警器
|
|
|
|
DoControl.Instance.ComOn();
|
|
|
|
DoControl.Instance.ComOn();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 设置触发间隔时间(以毫秒为单位)
|
|
|
|
|
|
|
|
timer.Interval = 1500; // 1000 毫秒 = 1 秒
|
|
|
|
|
|
|
|
// 绑定 Tick 事件处理程序
|
|
|
|
|
|
|
|
timer.Tick += new EventHandler(new Program().Timer_Tick);
|
|
|
|
|
|
|
|
// 启动 Timer
|
|
|
|
|
|
|
|
timer.Start();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//if (!Mesnac.Basic.InfluxDbHelper.Instance.IsStartDbServer)
|
|
|
|
//if (!Mesnac.Basic.InfluxDbHelper.Instance.IsStartDbServer)
|
|
|
@ -137,6 +151,11 @@ namespace MCRun
|
|
|
|
//Mesnac.Communication.TcpService.StartService(); //启动通信服务器
|
|
|
|
//Mesnac.Communication.TcpService.StartService(); //启动通信服务器
|
|
|
|
//Mesnac.Basic.SocketClient.Instance.Connect();
|
|
|
|
//Mesnac.Basic.SocketClient.Instance.Connect();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WorkbenchSingleton.InitializeWorkbench();
|
|
|
|
WorkbenchSingleton.InitializeWorkbench();
|
|
|
|
|
|
|
|
|
|
|
|
ICSharpCode.Core.LoggingService<Program>.Debug("starting workbench...");
|
|
|
|
ICSharpCode.Core.LoggingService<Program>.Debug("starting workbench...");
|
|
|
@ -174,5 +193,10 @@ namespace MCRun
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void Timer_Tick(object sender, EventArgs e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// 定时触发的操作
|
|
|
|
|
|
|
|
FinishBatchService.Instance.Start();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|