修改项目结构
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using CleanMachineHMI.Domain.Enums;
|
||||
using CleanMachineHMI.Utils;
|
||||
using ComponentFactory.Krypton.Toolkit;
|
||||
using Krypton.Toolkit;
|
||||
using FastReport;
|
||||
using LeadDataBaseUtility;
|
||||
using NX_LogUtility;
|
||||
@@ -441,7 +441,7 @@ namespace CleanMachineHMI.FrmUserControl
|
||||
//var result = KryptonMessageBox.Show("当前托盘已经有上个IR的物料是否继续", "", MessageBoxButtons.YesNo);
|
||||
//if (result == DialogResult.Yes) //在当前托盘继续
|
||||
//{
|
||||
this.lastPaltteRemain = currNum;
|
||||
this.lastPaltteRemain = currNum;
|
||||
//}
|
||||
//else if (result == DialogResult.No) //更换托盘
|
||||
//{
|
||||
@@ -559,7 +559,7 @@ namespace CleanMachineHMI.FrmUserControl
|
||||
string sql2 = $@"Update CM_WORKING_PALLET_DTL set WORKING_DTL_STATUS = 0 where WORKING_DTL_STATUS = '-1'";
|
||||
LeadDbHelperSQLite.ExecuteSql(sql1);
|
||||
LeadDbHelperSQLite.ExecuteSql(sql2);
|
||||
Invoke(new Action(() =>
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
//污染类型操作禁用
|
||||
//kryptonGroupBox10.Enabled = false;
|
||||
@@ -1267,240 +1267,260 @@ namespace CleanMachineHMI.FrmUserControl
|
||||
{
|
||||
while (GlobalHelper.SysThIsRunFlag)
|
||||
{
|
||||
try
|
||||
|
||||
if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMacRunStatusNew", PlcItemTypeDesc.M)))
|
||||
{
|
||||
if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMacRunStatusNew", PlcItemTypeDesc.M)))
|
||||
BeginInvoke(new Action(() => { cbt_RunStatusTran.BackColor = Color.Lime; }));
|
||||
}
|
||||
else
|
||||
{
|
||||
BeginInvoke(new Action(() => { cbt_RunStatusTran.BackColor = Color.Gray; }));
|
||||
}
|
||||
//毛刷1运行状态
|
||||
if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("Hairbrush1Selection", PlcItemTypeDesc.M)))
|
||||
{
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
Invoke(new Action(() => { cbt_RunStatusTran.BackColor = Color.Lime; }));
|
||||
}
|
||||
else
|
||||
cbt_Brush1StatusTran.BackColor = Color.Lime;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
Invoke(new Action(() => { cbt_RunStatusTran.BackColor = Color.Gray; }));
|
||||
}
|
||||
//毛刷1运行状态
|
||||
if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("Hairbrush1Selection", PlcItemTypeDesc.M)))
|
||||
cbt_Brush1StatusTran.BackColor = Color.Gray;
|
||||
}));
|
||||
}
|
||||
|
||||
//毛刷2启用状态
|
||||
|
||||
if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("Hairbrush2Selection", PlcItemTypeDesc.M)))
|
||||
{
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
cbt_Brush2StatusTran.BackColor = Color.Lime;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
cbt_Brush2StatusTran.BackColor = Color.Gray;
|
||||
}));
|
||||
}
|
||||
//毛刷3启用状态
|
||||
if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("Hairbrush3Selection", PlcItemTypeDesc.M)))
|
||||
{
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
cbt_Brush3StatusTran.BackColor = Color.Lime;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
cbt_Brush3StatusTran.BackColor = Color.Gray;
|
||||
}));
|
||||
}
|
||||
//喷头选择状态
|
||||
//if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("NozzleSelection", PlcItemTypeDesc.M)))
|
||||
//{
|
||||
// Invoke(new Action(() =>
|
||||
// {
|
||||
// cbt_NozzleStatusTran.BackColor = Color.Lime;
|
||||
// }));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// Invoke(new Action(() =>
|
||||
// {
|
||||
// cbt_NozzleStatusTran.BackColor = Color.Gray;
|
||||
// }));
|
||||
//}
|
||||
//静电棒选择
|
||||
|
||||
if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("StaticbarsSel", PlcItemTypeDesc.M)))
|
||||
{
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
cbt_staticbar.BackColor = Color.Lime;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
cbt_staticbar.BackColor = Color.Gray;
|
||||
}));
|
||||
}
|
||||
|
||||
//计数模式选择
|
||||
//if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FullPalletMode", PlcItemTypeDesc.M)))
|
||||
//{
|
||||
// Invoke(new Action(() =>
|
||||
// {
|
||||
// cbt_fpalletmod.BackColor = Color.Lime;
|
||||
// }));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// Invoke(new Action(() =>
|
||||
// {
|
||||
// cbt_fpalletmod.BackColor = Color.Gray;
|
||||
// }));
|
||||
//}
|
||||
|
||||
//显示托盘编号
|
||||
if (ktb_IR.Text.Trim().Length > 0)
|
||||
{
|
||||
string sqlWorkPalletSel = $@"SELECT * FROM CM_WORKING_PALLET WHERE WORKING_STATUS = 0 ORDER BY CREATE_TIME DESC";
|
||||
DataTable dtWorkPalletSel = LeadDbHelperSQLite.Query(sqlWorkPalletSel).Tables[0];
|
||||
if (dtWorkPalletSel.Rows.Count > 0)
|
||||
{
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
cbt_Brush1StatusTran.BackColor = Color.Lime;
|
||||
ktb_CurrPalletCode.Text = dtWorkPalletSel.Rows[0]["WORKING_PALLET_CODE"].ToString();
|
||||
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
cbt_Brush1StatusTran.BackColor = Color.Gray;
|
||||
}));
|
||||
}
|
||||
ktb_CurrPalletCode.Text = "";
|
||||
|
||||
//毛刷2启用状态
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("Hairbrush2Selection", PlcItemTypeDesc.M)))
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
cbt_Brush2StatusTran.BackColor = Color.Lime;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
cbt_Brush2StatusTran.BackColor = Color.Gray;
|
||||
}));
|
||||
}
|
||||
//毛刷3启用状态
|
||||
if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("Hairbrush3Selection", PlcItemTypeDesc.M)))
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
cbt_Brush3StatusTran.BackColor = Color.Lime;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
cbt_Brush3StatusTran.BackColor = Color.Gray;
|
||||
}));
|
||||
}
|
||||
//喷头选择状态
|
||||
//if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("NozzleSelection", PlcItemTypeDesc.M)))
|
||||
//{
|
||||
// Invoke(new Action(() =>
|
||||
// {
|
||||
// cbt_NozzleStatusTran.BackColor = Color.Lime;
|
||||
// }));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// Invoke(new Action(() =>
|
||||
// {
|
||||
// cbt_NozzleStatusTran.BackColor = Color.Gray;
|
||||
// }));
|
||||
//}
|
||||
//静电棒选择
|
||||
string ktb_IRTest = "";
|
||||
|
||||
if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("StaticbarsSel", PlcItemTypeDesc.M)))
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
cbt_staticbar.BackColor = Color.Lime;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
cbt_staticbar.BackColor = Color.Gray;
|
||||
}));
|
||||
}
|
||||
string kcmb_SheetTypeText = "";
|
||||
string CurrPalletCodeText = "";
|
||||
this.BeginInvoke(new Action(() =>
|
||||
{
|
||||
ktb_IRTest = this.ktb_IR.Text;
|
||||
kcmb_SheetTypeText = this.kcmb_SheetType.Text;
|
||||
|
||||
//计数模式选择
|
||||
//if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FullPalletMode", PlcItemTypeDesc.M)))
|
||||
//{
|
||||
// Invoke(new Action(() =>
|
||||
// {
|
||||
// cbt_fpalletmod.BackColor = Color.Lime;
|
||||
// }));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// Invoke(new Action(() =>
|
||||
// {
|
||||
// cbt_fpalletmod.BackColor = Color.Gray;
|
||||
// }));
|
||||
//}
|
||||
CurrPalletCodeText = ktb_CurrPalletCode.Text.Trim();
|
||||
}));
|
||||
|
||||
//显示托盘编号
|
||||
if (ktb_IR.Text.Trim().Length > 0)
|
||||
|
||||
//防止中途关闭系统产生数据丢失,因此每周期都会更新数据
|
||||
string sql = $@"SELECT SUM(CURRENT_NUMBER) FROM CM_WORKING_PALLET_DTL WHERE CLEAN_MODE_CODE = 'SortedCleaned' AND IR_CODE = '{ktb_IRTest}' AND SHEET_TYPE_CODE = '{kcmb_SheetTypeText}'";
|
||||
object obj = LeadDbHelperSQLite.GetSingle(sql);
|
||||
if (obj == null)
|
||||
{
|
||||
BeginInvoke(new Action(() => { ktb_CompleteNum.Text = "0"; }));
|
||||
}
|
||||
else
|
||||
{
|
||||
BeginInvoke(new Action(() => { ktb_CompleteNum.Text = obj.ToString(); }));
|
||||
}
|
||||
string sql1 = $@"SELECT SUM(CURRENT_NUMBER) FROM CM_WORKING_PALLET_DTL WHERE CLEAN_MODE_CODE <> 'SortedCleaned' AND IR_CODE = '{ktb_IRTest}' AND SHEET_TYPE_CODE = '{kcmb_SheetTypeText}'";
|
||||
object obj1 = LeadDbHelperSQLite.GetSingle(sql1);
|
||||
if (obj1 == null)
|
||||
{
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
string sqlWorkPalletSel = $@"SELECT * FROM CM_WORKING_PALLET WHERE WORKING_STATUS = 0 ORDER BY CREATE_TIME DESC";
|
||||
DataTable dtWorkPalletSel = LeadDbHelperSQLite.Query(sqlWorkPalletSel).Tables[0];
|
||||
if (dtWorkPalletSel.Rows.Count > 0)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
ktb_CurrPalletCode.Text = dtWorkPalletSel.Rows[0]["WORKING_PALLET_CODE"].ToString();
|
||||
ktb_ScrapNum.Text = "0";
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
ktb_ScrapNum.Text = obj1.ToString();
|
||||
}));
|
||||
}
|
||||
string sql11 = $@"SELECT SUM(CURRENT_NUMBER) FROM CM_WORKING_PALLET_DTL WHERE CLEAN_MODE_CODE = 'Scrap' AND IR_CODE = '{ktb_IRTest}' AND SHEET_TYPE_CODE = '{kcmb_SheetTypeText}' AND WORKING_PALLET_CODE = '{CurrPalletCodeText}'";
|
||||
object obj11 = LeadDbHelperSQLite.GetSingle(sql11);
|
||||
if (obj11 == null)
|
||||
{
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
ktb_Scrap.Text = "0";
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
ktb_Scrap.Text = obj11.ToString();
|
||||
}));
|
||||
}
|
||||
|
||||
}));
|
||||
string sqlPalletCount = $@"SELECT CURRENT_NUMBER,WORKING_DTL_STATUS FROM CM_WORKING_PALLET_DTL WHERE CLEAN_MODE_CODE = 'SortedCleaned' AND IR_CODE = '{ktb_IRTest}' AND SHEET_TYPE_CODE = '{kcmb_SheetTypeText}'";
|
||||
DataTable dtPalletCount = LeadDbHelperSQLite.Query(sqlPalletCount).Tables[0];
|
||||
if (dtPalletCount != null && dtPalletCount.Rows.Count > 0)
|
||||
{
|
||||
int finishedPalletNum = 0;
|
||||
int currentPalletNum = 0;
|
||||
foreach (DataRow item in dtPalletCount.Rows)
|
||||
{
|
||||
if (item["WORKING_DTL_STATUS"].ToString() == "1")
|
||||
{
|
||||
finishedPalletNum += Convert.ToInt32(item["CURRENT_NUMBER"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
ktb_CurrPalletCode.Text = "";
|
||||
|
||||
}));
|
||||
currentPalletNum += Convert.ToInt32(item["CURRENT_NUMBER"]);
|
||||
}
|
||||
}
|
||||
|
||||
//防止中途关闭系统产生数据丢失,因此每周期都会更新数据
|
||||
string sql = $@"SELECT SUM(CURRENT_NUMBER) FROM CM_WORKING_PALLET_DTL WHERE CLEAN_MODE_CODE = 'SortedCleaned' AND IR_CODE = '{ktb_IR.Text}' AND SHEET_TYPE_CODE = '{kcmb_SheetType.Text}'";
|
||||
object obj = LeadDbHelperSQLite.GetSingle(sql);
|
||||
if (obj == null)
|
||||
this.BeginInvoke(new Action(() =>
|
||||
{
|
||||
Invoke(new Action(() => { ktb_CompleteNum.Text = "0"; }));
|
||||
}
|
||||
else
|
||||
{
|
||||
Invoke(new Action(() => { ktb_CompleteNum.Text = obj.ToString(); }));
|
||||
}
|
||||
string sql1 = $@"SELECT SUM(CURRENT_NUMBER) FROM CM_WORKING_PALLET_DTL WHERE CLEAN_MODE_CODE <> 'SortedCleaned' AND IR_CODE = '{ktb_IR.Text}' AND SHEET_TYPE_CODE = '{kcmb_SheetType.Text}'";
|
||||
object obj1 = LeadDbHelperSQLite.GetSingle(sql1);
|
||||
if (obj1 == null)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
ktb_ScrapNum.Text = "0";
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
ktb_ScrapNum.Text = obj1.ToString();
|
||||
}));
|
||||
}
|
||||
string sql11 = $@"SELECT SUM(CURRENT_NUMBER) FROM CM_WORKING_PALLET_DTL WHERE CLEAN_MODE_CODE = 'Scrap' AND IR_CODE = '{ktb_IR.Text}' AND SHEET_TYPE_CODE = '{kcmb_SheetType.Text}' AND WORKING_PALLET_CODE = '{ktb_CurrPalletCode.Text}'";
|
||||
object obj11 = LeadDbHelperSQLite.GetSingle(sql11);
|
||||
if (obj11 == null)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
ktb_Scrap.Text = "0";
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
ktb_Scrap.Text = obj11.ToString();
|
||||
}));
|
||||
}
|
||||
|
||||
string sqlPalletCount = $@"SELECT CURRENT_NUMBER,WORKING_DTL_STATUS FROM CM_WORKING_PALLET_DTL WHERE CLEAN_MODE_CODE = 'SortedCleaned' AND IR_CODE = '{ktb_IR.Text}' AND SHEET_TYPE_CODE = '{kcmb_SheetType.Text}'";
|
||||
DataTable dtPalletCount = LeadDbHelperSQLite.Query(sqlPalletCount).Tables[0];
|
||||
if (dtPalletCount != null && dtPalletCount.Rows.Count > 0)
|
||||
{
|
||||
int finishedPalletNum = 0;
|
||||
int currentPalletNum = 0;
|
||||
foreach (DataRow item in dtPalletCount.Rows)
|
||||
{
|
||||
if (item["WORKING_DTL_STATUS"].ToString() == "1")
|
||||
{
|
||||
finishedPalletNum += Convert.ToInt32(item["CURRENT_NUMBER"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
currentPalletNum += Convert.ToInt32(item["CURRENT_NUMBER"]);
|
||||
}
|
||||
}
|
||||
ktb_CurrentPalletNum.Text = currentPalletNum.ToString();
|
||||
ktb_FinishedPalletNum.Text = finishedPalletNum.ToString();
|
||||
}
|
||||
else
|
||||
}));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
this.BeginInvoke(new Action(() =>
|
||||
{
|
||||
ktb_CurrentPalletNum.Text = "0";
|
||||
ktb_FinishedPalletNum.Text = "0";
|
||||
}
|
||||
//读取PLC当前值-这个值带有初始值
|
||||
int currNum = Convert.ToInt32(PlcOperationHelper.Instance.ReadPlcItem("NozzleNum", PlcItemTypeDesc.D));
|
||||
}));
|
||||
|
||||
int fullPalletNum = Convert.ToInt32(PlcOperationHelper.Instance.ReadPlcItem("WorkedFullPalletNum", PlcItemTypeDesc.D));
|
||||
//
|
||||
}
|
||||
//读取PLC当前值-这个值带有初始值
|
||||
int currNum = Convert.ToInt32(PlcOperationHelper.Instance.ReadPlcItem("NozzleNum", PlcItemTypeDesc.D));
|
||||
|
||||
if (0 < (fullPalletNum - currNum) && (fullPalletNum - currNum) <= 10 && fullPalletNum != 0)
|
||||
int fullPalletNum = Convert.ToInt32(PlcOperationHelper.Instance.ReadPlcItem("WorkedFullPalletNum", PlcItemTypeDesc.D));
|
||||
//
|
||||
|
||||
if (0 < (fullPalletNum - currNum) && (fullPalletNum - currNum) <= 10 && fullPalletNum != 0)
|
||||
{
|
||||
if ((fullPalletNum - currNum) != remainingQty)
|
||||
{
|
||||
if ((fullPalletNum - currNum) != remainingQty)
|
||||
{
|
||||
frmMainNew.RefreshFrmHost($"The tray is about to fill up and the remaining quantity is [{fullPalletNum - currNum}]!!");
|
||||
LogHelper.WriteLog($"托盘即将满料,剩余数量为【{fullPalletNum - currNum}】!!", LogTypeEum.Run);
|
||||
remainingQty = fullPalletNum - currNum;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
frmMainNew.RefreshFrmHost($"The tray is about to fill up and the remaining quantity is [{fullPalletNum - currNum}]!!");
|
||||
LogHelper.WriteLog($"托盘即将满料,剩余数量为【{fullPalletNum - currNum}】!!", LogTypeEum.Run);
|
||||
remainingQty = fullPalletNum - currNum;
|
||||
frmMainNew.RefreshFrmHost(null);
|
||||
}
|
||||
//托盘在当前IR中的数量
|
||||
currNum -= this.lastPaltteRemain;
|
||||
if (currNum > 0)
|
||||
{
|
||||
//string sqlFinishIrSheetTypeDtl = $"select sum(CURRENT_NUMBER) from CM_WORKING_PALLET_DTL where CLEAN_MODE_CODE = 'SortedCleaned' and WORKING_DTL_STATUS = 1";
|
||||
//DataTable dtFinishIrSheetTypeDtl = LeadDbHelperSQLite.Query(sqlFinishIrSheetTypeDtl).Tables[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//int finishIrSheetTypeNum = 0;
|
||||
//if (dtFinishIrSheetTypeDtl != null && dtFinishIrSheetTypeDtl.Rows.Count > 0)
|
||||
//{
|
||||
// finishIrSheetTypeNum = Convert.ToInt32(dtFinishIrSheetTypeDtl.Rows[0][0] == DBNull.Value ? 0 : dtFinishIrSheetTypeDtl.Rows[0][0]);
|
||||
//}
|
||||
//if (autoCleanNum != (currNum - finishIrSheetTypeNum))
|
||||
//{
|
||||
//防止中途关闭系统后产生内存数据丢失
|
||||
string sql12 = $@"
|
||||
remainingQty = fullPalletNum - currNum;
|
||||
frmMainNew.RefreshFrmHost(null);
|
||||
}
|
||||
//托盘在当前IR中的数量
|
||||
currNum -= this.lastPaltteRemain;
|
||||
if (currNum > 0)
|
||||
{
|
||||
//string sqlFinishIrSheetTypeDtl = $"select sum(CURRENT_NUMBER) from CM_WORKING_PALLET_DTL where CLEAN_MODE_CODE = 'SortedCleaned' and WORKING_DTL_STATUS = 1";
|
||||
//DataTable dtFinishIrSheetTypeDtl = LeadDbHelperSQLite.Query(sqlFinishIrSheetTypeDtl).Tables[0];
|
||||
|
||||
//int finishIrSheetTypeNum = 0;
|
||||
//if (dtFinishIrSheetTypeDtl != null && dtFinishIrSheetTypeDtl.Rows.Count > 0)
|
||||
//{
|
||||
// finishIrSheetTypeNum = Convert.ToInt32(dtFinishIrSheetTypeDtl.Rows[0][0] == DBNull.Value ? 0 : dtFinishIrSheetTypeDtl.Rows[0][0]);
|
||||
//}
|
||||
//if (autoCleanNum != (currNum - finishIrSheetTypeNum))
|
||||
//{
|
||||
//防止中途关闭系统后产生内存数据丢失
|
||||
string sql12 = $@"
|
||||
UPDATE CM_WORKING_PALLET_DTL
|
||||
SET CURRENT_NUMBER = '{currNum }',
|
||||
UPDATE_BY = '{GlobalHelper.UserInfo.USER_ID}',
|
||||
@@ -1508,34 +1528,31 @@ namespace CleanMachineHMI.FrmUserControl
|
||||
DATA_VERSION = DATA_VERSION + 1
|
||||
WHERE
|
||||
CLEAN_MODE_CODE = 'SortedCleaned'
|
||||
AND IR_CODE = '{ktb_IR.Text}'
|
||||
AND SHEET_TYPE_CODE = '{kcmb_SheetType.Text}'
|
||||
AND IR_CODE = '{ktb_IRTest}'
|
||||
AND SHEET_TYPE_CODE = '{kcmb_SheetTypeText}'
|
||||
AND WORKING_DTL_STATUS = 0
|
||||
AND WORKING_PALLET_CODE = '{ktb_CurrPalletCode.Text.Trim()}'
|
||||
AND WORKING_PALLET_CODE = '{CurrPalletCodeText}'
|
||||
";
|
||||
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql12);
|
||||
//autoCleanNum = currNum - finishIrSheetTypeNum;
|
||||
if (row > 0)
|
||||
{
|
||||
//LogHelper.WriteLog($"用户:【{GlobalHelper.UserInfo.USER_NAME}】作业托盘:【{ktb_CurrPalletCode.Text}】作业IR:【{ktb_IR.Text}】作业板材:【{kcmb_SheetType.Text}】顺序清洗计数+1成功,数量为:【{currNum}】。", LogTypeEum.Run);
|
||||
}
|
||||
else
|
||||
{
|
||||
//LogHelper.WriteLog($"用户:【{GlobalHelper.UserInfo.USER_NAME}】作业托盘:【{ktb_CurrPalletCode.Text}】作业IR:【{ktb_IR.Text}】作业板材:【{kcmb_SheetType.Text}】顺序清洗计数+1失败。", LogTypeEum.Run);
|
||||
}
|
||||
//}
|
||||
int row = LeadDbHelperSQLite.ExecuteSql(sql12);
|
||||
//autoCleanNum = currNum - finishIrSheetTypeNum;
|
||||
if (row > 0)
|
||||
{
|
||||
//LogHelper.WriteLog($"用户:【{GlobalHelper.UserInfo.USER_NAME}】作业托盘:【{ktb_CurrPalletCode.Text}】作业IR:【{ktb_IR.Text}】作业板材:【{kcmb_SheetType.Text}】顺序清洗计数+1成功,数量为:【{currNum}】。", LogTypeEum.Run);
|
||||
}
|
||||
else
|
||||
{
|
||||
//autoCleanNum = 0;
|
||||
//LogHelper.WriteLog($"用户:【{GlobalHelper.UserInfo.USER_NAME}】作业托盘:【{ktb_CurrPalletCode.Text}】作业IR:【{ktb_IR.Text}】作业板材:【{kcmb_SheetType.Text}】顺序清洗计数+1失败。", LogTypeEum.Run);
|
||||
}
|
||||
FinishWorkingPallet();
|
||||
//}
|
||||
}
|
||||
catch
|
||||
else
|
||||
{
|
||||
|
||||
//autoCleanNum = 0;
|
||||
}
|
||||
FinishWorkingPallet();
|
||||
|
||||
|
||||
Thread.Sleep(200);
|
||||
}
|
||||
}
|
||||
@@ -3237,7 +3254,7 @@ namespace CleanMachineHMI.FrmUserControl
|
||||
{
|
||||
//IR结束 托盘保留
|
||||
//停止设备运行.防止设备继续过料
|
||||
// cbt_StopTran_MouseDown(null, null);
|
||||
// cbt_StopTran_MouseDown(null, null);
|
||||
this.lastPaltteRemain += cleanMacNum;//设置当前托盘之前已经装载的数量
|
||||
SubPrintPalletData(ktb_IR.Text, ktb_CurrPalletCode.Text.Trim());
|
||||
// cbt_StartClean_MouseDown(null, null);
|
||||
@@ -3424,5 +3441,10 @@ namespace CleanMachineHMI.FrmUserControl
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void cbt_StartTran_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user