提交
This commit is contained in:
parent
8868915944
commit
5d77eebc67
@ -7,7 +7,13 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace DH.Commons.Enums
|
||||
{
|
||||
|
||||
public enum EnumStatus
|
||||
{
|
||||
未运行,
|
||||
运行中,
|
||||
警告,
|
||||
异常
|
||||
}
|
||||
public enum ModelType
|
||||
{
|
||||
图像分类 = 1,
|
||||
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DH.Commons.Base;
|
||||
using DH.Commons.Enums;
|
||||
|
||||
namespace DH.Commons.Models
|
||||
{
|
||||
@ -14,7 +15,10 @@ namespace DH.Commons.Models
|
||||
/// </summary>
|
||||
public static string CurrentScheme=string.Empty;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 当前状态
|
||||
/// </summary>
|
||||
public static EnumStatus CurrentStatus =EnumStatus.未运行;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
9
DHSoftware/MainWindow.Designer.cs
generated
9
DHSoftware/MainWindow.Designer.cs
generated
@ -37,9 +37,12 @@
|
||||
AntdUI.SegmentedItem segmentedItem9 = new AntdUI.SegmentedItem();
|
||||
AntdUI.SegmentedItem segmentedItem10 = new AntdUI.SegmentedItem();
|
||||
titlebar = new AntdUI.PageHeader();
|
||||
tabsStas=new AntdUI.Tabs();
|
||||
tabPage3=new AntdUI.TabPage();
|
||||
lbName = new AntdUI.Label();
|
||||
pageHeader1 = new AntdUI.PageHeader();
|
||||
labuph = new Label();
|
||||
tabMain=new AntdUI.TabPage();
|
||||
divider2 = new AntdUI.Divider();
|
||||
panelmain = new AntdUI.Panel();
|
||||
panel2 = new AntdUI.Panel();
|
||||
@ -256,7 +259,6 @@
|
||||
tabsStas.Name = "tabsStas";
|
||||
tabsStas.Pages.Add(tabPage3);
|
||||
tabsStas.Size = new Size(580, 176);
|
||||
tabsStas.Style = styleCard2;
|
||||
tabsStas.TabIndex = 3;
|
||||
tabsStas.Text = "tabs3";
|
||||
//
|
||||
@ -613,5 +615,10 @@
|
||||
private Label label6;
|
||||
private Label lblUPH;
|
||||
private Label label4;
|
||||
private RichTextBox richTextBox1;
|
||||
private AntdUI.TabPage tabPage3;
|
||||
private AntdUI.TabPage tabMain;
|
||||
private AntdUI.Tabs tabsStas;
|
||||
private Label label1;
|
||||
}
|
||||
}
|
@ -583,7 +583,7 @@ namespace DHSoftware
|
||||
private void StartProcess()
|
||||
{
|
||||
ProcessstartTime= DateTime.Now;
|
||||
lblstarttime.Text = ProcessstartTime.ToString("yyyy-MM-dd HH:mm:ss")
|
||||
lblstarttime.Text = ProcessstartTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
//计数清零
|
||||
PieceCount = 0;
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user