This commit is contained in:
gongxh
2021-12-27 14:36:49 +08:00
parent c6260156f8
commit 59eec06d5e
3 changed files with 53 additions and 21 deletions

View File

@@ -157,6 +157,7 @@ namespace CleanMachineHMI.FrmUserControl
string sqlQuerySheetType = $@"SELECT SHEET_TYPE_CODE,SHEET_TYPE_NAME FROM BAS_SHEET_TYPE WHERE USED_FLAG = 1 and DEL_FLAG = 0 ORDER BY SHEET_TYPE_ID";
DataTable dtQuerySheetType = LeadDbHelperSQLite.Query(sqlQuerySheetType).Tables[0];
kcmb_SheetType.DisplayMember = "Text";
if (dtQuerySheetType != null && dtQuerySheetType.Rows.Count > 0)
{
kcmb_SheetType.Items.Clear();
@@ -3131,7 +3132,8 @@ namespace CleanMachineHMI.FrmUserControl
{
if (isManualStatus())
{
KryptonMessageBox.Show("The manual operation interface has been opened and is currently in manual mode.");
KryptonMessageBox.Show("The manual operation interface has been opened and is currently in manual mode.");
return;
}

View File

@@ -87,7 +87,7 @@
this.label2.ForeColor = System.Drawing.Color.Red;
this.label2.Location = new System.Drawing.Point(268, 51);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(255, 16);
this.label2.Size = new System.Drawing.Size(254, 16);
this.label2.TabIndex = 15;
this.label2.Text = "托盘即将满料,剩余数量为6!!";
this.label2.Visible = false;
@@ -261,7 +261,6 @@
this.ClientSize = new System.Drawing.Size(1008, 729);
this.Controls.Add(this.kryptonNavigator1);
this.Controls.Add(this.kryptonGroupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmMainNew";

View File

@@ -194,30 +194,36 @@ namespace CleanMachineHMI
isPlcConnStatus = true;
GlobalHelper.SysThIsRunFlag = true;
Thread th = new Thread(RefreshPlcItem_M)
Thread th = new Thread(RefreshPlcItem)
{
IsBackground = true
};
th.Start();
Thread th1 = new Thread(RefreshPlcItem_D)
{
IsBackground = true
};
th1.Start();
Thread th2 = new Thread(RefreshPlcItem_X)
{
IsBackground = true
};
th2.Start();
//Thread th = new Thread(RefreshPlcItem_M)
//{
// IsBackground = true
//};
//th.Start();
Thread th3 = new Thread(RefreshPlcItem_Y)
{
IsBackground = true
};
th3.Start();
//Thread th1 = new Thread(RefreshPlcItem_D)
//{
// IsBackground = true
//};
//th1.Start();
//Thread th2 = new Thread(RefreshPlcItem_X)
//{
// IsBackground = true
//};
//th2.Start();
//Thread th3 = new Thread(RefreshPlcItem_Y)
//{
// IsBackground = true
//};
//th3.Start();
Thread th4 = new Thread(MainThRunFunc)
{
@@ -425,6 +431,22 @@ namespace CleanMachineHMI
}
}
private void RefreshPlcItem()
{
while (GlobalHelper.SysThIsRunFlag)
{
PlcOperationHelper.Instance.RefreshPlcItem_M();
PlcOperationHelper.Instance.RefreshPlcItem_D();
PlcOperationHelper.Instance.RefreshPlcItem_X();
PlcOperationHelper.Instance.RefreshPlcItem_Y();
ShowWarningMsg();
Thread.Sleep(100);
}
}
#region 线程执行函数
private void RefreshPlcItem_M()
{
@@ -461,6 +483,9 @@ namespace CleanMachineHMI
}
private void MainThRunFunc()
{
long lastTick = DateTime.Now.Ticks;
while (GlobalHelper.SysThIsRunFlag)
{
try
@@ -517,8 +542,10 @@ namespace CleanMachineHMI
if (maintainFlag == 0)
{
bool isRun = (bool)PlcOperationHelper.Instance.ReadPlcItem("CleanMacRunStatusNew", PlcItemTypeDesc.M);
if (isRun)
{
if (timerRunNUm == 60)
{
sysRuningTimeLen++;
@@ -595,6 +622,10 @@ namespace CleanMachineHMI
}));
}
}
}
else
{
@@ -620,7 +651,7 @@ namespace CleanMachineHMI
{
LogHelper.WriteLog($"定时器运行函数发生异常:【{ex.Message}】", LogTypeEum.Err);
}
Thread.Sleep(100);
Thread.Sleep(1000);
}
}
#endregion