提交
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using AntdUI;
|
||||
using DH.Commons.Enums;
|
||||
using DH.Commons.Helper;
|
||||
using DH.Commons.Models;
|
||||
using DHSoftware.Utils;
|
||||
@ -36,15 +38,56 @@ namespace DHSoftware
|
||||
WelcomeWindow.Instance.Show();
|
||||
UpdateStep(0, "正在初始化", true);
|
||||
UpdateStep(10, "正在加载数据库", true);
|
||||
DatabaseUtil.InitializeDatabase();
|
||||
try
|
||||
{
|
||||
DatabaseUtil.InitializeDatabase();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SystemModel.CurrentStatus = EnumStatus.异常;
|
||||
Modal.open(WelcomeWindow.Instance, "错误!", ex.ToString(), TType.Error);
|
||||
}
|
||||
|
||||
UpdateStep(30, "正在加载解决方案", true);
|
||||
MainWindow.Instance.LoadScheme();
|
||||
try
|
||||
{
|
||||
MainWindow.Instance.LoadScheme();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SystemModel.CurrentStatus = EnumStatus.异常;
|
||||
Modal.open(WelcomeWindow.Instance, "错误!", ex.ToString(), TType.Error);
|
||||
}
|
||||
UpdateStep(50, "正在连接相机", true);
|
||||
MainWindow.Instance.ConnectCamera();
|
||||
try
|
||||
{
|
||||
MainWindow.Instance.ConnectCamera();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
SystemModel.CurrentStatus = EnumStatus.异常;
|
||||
Modal.open(WelcomeWindow.Instance, "错误!", ex.ToString(), TType.Error);
|
||||
}
|
||||
UpdateStep(70, "正在连接PLC", true);
|
||||
MainWindow.Instance.ConnectPLC();
|
||||
try
|
||||
{
|
||||
MainWindow.Instance.ConnectPLC();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SystemModel.CurrentStatus = EnumStatus.异常;
|
||||
Modal.open(WelcomeWindow.Instance, "错误!", ex.ToString(), TType.Error);
|
||||
}
|
||||
UpdateStep(80, "正在加载算法模型", true);
|
||||
MainWindow.Instance.InitModel();
|
||||
try
|
||||
{
|
||||
MainWindow.Instance.InitModel();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SystemModel.CurrentStatus = EnumStatus.异常;
|
||||
Modal.open(WelcomeWindow.Instance, "错误!", ex.ToString(), TType.Error);
|
||||
}
|
||||
UpdateStep(100, "程序初始化完成", true);
|
||||
Thread.Sleep(100);
|
||||
WelcomeWindow.Instance.Close();
|
||||
|
Reference in New Issue
Block a user