修改项目结构

This commit is contained in:
gongxh
2022-05-05 21:20:03 +08:00
parent b6b365339f
commit 74a05e7bb3
10 changed files with 62 additions and 43 deletions

View File

@@ -14,6 +14,11 @@
<None Remove="forms\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Model\Bas_WarningMd.cs" />
<Compile Remove="Model\CleanType.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Krypton.Navigator" Version="60.22.2.32" />
<PackageReference Include="Krypton.Toolkit" Version="60.22.2.32" />
@@ -68,4 +73,8 @@
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Model\" />
</ItemGroup>
</Project>

View File

@@ -15,6 +15,7 @@ using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using CleanMachine.Model.BAS;
namespace CleanMachineHMI.FrmUserControl
{
@@ -27,7 +28,7 @@ namespace CleanMachineHMI.FrmUserControl
}
private List<BasCleanTypeMsg> basCleanTypeMsgList = new List<BasCleanTypeMsg>();
private List<CleanType> basCleanTypeMsgList = new List<CleanType>();
/// <summary>
/// 模板地址
/// </summary>
@@ -140,7 +141,7 @@ namespace CleanMachineHMI.FrmUserControl
string contaminationTypeName = item["CONTAMINATION_TYPE_NAME"] == null ? "" : item["CONTAMINATION_TYPE_NAME"].ToString();
string contaminationDtlCode = item["CONTAMINATION_DTL_CODE"] == null ? "" : item["CONTAMINATION_DTL_CODE"].ToString();
string contaminationDtlName = item["CONTAMINATION_DTL_NAME"] == null ? "" : item["CONTAMINATION_DTL_NAME"].ToString();
basCleanTypeMsgList.Add(new BasCleanTypeMsg
basCleanTypeMsgList.Add(new CleanType
{
CleanModeCode = cleanTypeCode,
CleanModeName = cleanTypeName,
@@ -328,7 +329,7 @@ namespace CleanMachineHMI.FrmUserControl
}));
//清空当前内存污染计数
foreach (BasCleanTypeMsg item in basCleanTypeMsgList)
foreach (CleanType item in basCleanTypeMsgList)
{
if (string.IsNullOrEmpty(item.ContaminationDtlCode))
{//常规清洗 清零(其他污染)
@@ -631,7 +632,7 @@ namespace CleanMachineHMI.FrmUserControl
//清空当前内存污染计数
foreach (BasCleanTypeMsg item in basCleanTypeMsgList)
foreach (CleanType item in basCleanTypeMsgList)
{
if (string.IsNullOrEmpty(item.ContaminationDtlCode))
{//常规清洗 清零(其他污染)
@@ -758,7 +759,7 @@ namespace CleanMachineHMI.FrmUserControl
}));
//清空当前内存污染计数
foreach (BasCleanTypeMsg item in basCleanTypeMsgList)
foreach (CleanType item in basCleanTypeMsgList)
{
if (string.IsNullOrEmpty(item.ContaminationDtlCode))
{//常规清洗 清零(其他污染)
@@ -833,7 +834,7 @@ namespace CleanMachineHMI.FrmUserControl
}));
foreach (BasCleanTypeMsg item in basCleanTypeMsgList)
foreach (CleanType item in basCleanTypeMsgList)
{
string sqlInsertWorkPalletDtl = $@"
INSERT INTO [CM_WORKING_PALLET_DTL] (
@@ -907,7 +908,7 @@ namespace CleanMachineHMI.FrmUserControl
}));
//清空当前内存污染计数
foreach (BasCleanTypeMsg item in basCleanTypeMsgList)
foreach (CleanType item in basCleanTypeMsgList)
{
if (string.IsNullOrEmpty(item.ContaminationDtlCode))
{//常规清洗 清零(其他污染)
@@ -1795,7 +1796,7 @@ namespace CleanMachineHMI.FrmUserControl
//curPalletid = dtWorkPalletSel.Rows[0]["WORKING_PALLET_CODE"].ToString();
curPalletid = trayCode;
foreach (BasCleanTypeMsg item in basCleanTypeMsgList)
foreach (CleanType item in basCleanTypeMsgList)
{
string sqlInsertWorkPalletDtl = $@"
INSERT INTO [CM_WORKING_PALLET_DTL] (
@@ -1887,7 +1888,7 @@ namespace CleanMachineHMI.FrmUserControl
}
KryptonButton kbtnMd = sender as KryptonButton;
BasCleanTypeMsg md = basCleanTypeMsgList.Find(x => x.ContaminationDtlCode == kbtnMd.Name.Replace("kbtn_", ""));
CleanType md = basCleanTypeMsgList.Find(x => x.ContaminationDtlCode == kbtnMd.Name.Replace("kbtn_", ""));
if (ktb_SaveIR.Enabled)
{
//KryptonMessageBox.Show("未录入板材信息和IR收货编号信息,不能进行计数处理!");
@@ -1981,7 +1982,7 @@ namespace CleanMachineHMI.FrmUserControl
kbtn_Scrap_1.Enabled = false;
//清空当前内存污染计数
foreach (BasCleanTypeMsg item in basCleanTypeMsgList)
foreach (CleanType item in basCleanTypeMsgList)
{
if (string.IsNullOrEmpty(item.ContaminationDtlCode))
{//常规清洗 清零(其他污染)
@@ -3033,7 +3034,7 @@ namespace CleanMachineHMI.FrmUserControl
return;
}
KryptonButton kbtnMd = sender as KryptonButton;
BasCleanTypeMsg md = basCleanTypeMsgList.Find(x => x.ContaminationDtlCode == kbtnMd.Name.Replace("kbtn_", "").Replace("_1", ""));
CleanType md = basCleanTypeMsgList.Find(x => x.ContaminationDtlCode == kbtnMd.Name.Replace("kbtn_", "").Replace("_1", ""));
if (ktb_SaveIR.Enabled)
{
KryptonMessageBox.Show("The plate information and IR receiving number information are not entered, so the counting process cannot be carried out!");
@@ -3218,7 +3219,7 @@ namespace CleanMachineHMI.FrmUserControl
}));
//清空当前内存污染计数
foreach (BasCleanTypeMsg item in basCleanTypeMsgList)
foreach (CleanType item in basCleanTypeMsgList)
{
if (string.IsNullOrEmpty(item.ContaminationDtlCode))
{//常规清洗 清零(其他污染)
@@ -3348,7 +3349,7 @@ namespace CleanMachineHMI.FrmUserControl
}));
//清空当前内存污染计数
foreach (BasCleanTypeMsg item in basCleanTypeMsgList)
foreach (CleanType item in basCleanTypeMsgList)
{
if (string.IsNullOrEmpty(item.ContaminationDtlCode))
{//常规清洗 清零(其他污染)

View File

@@ -1,10 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CleanMachineHMI
{
}

View File

@@ -6,12 +6,12 @@ using System.Threading.Tasks;
namespace CleanMachineHMI
{
public class Bas_WarningMd
{
public string WarningCode { get; set; }
public string WarningName { get; set; }
public string PlcItemCode { get; set; }
public string WarningType { get; set; }
public string WarningMessage { get; set; }
}
//public class Warning
//{
// public string WarningCode { get; set; }
// public string WarningName { get; set; }
// public string PlcItemCode { get; set; }
// public string WarningType { get; set; }
// public string WarningMessage { get; set; }
//}
}

View File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace CleanMachineHMI
{
public class BasCleanTypeMsg
public class CleanType
{
public string CleanModeCode { get; set; }
public string CleanModeName { get; set; }

View File

@@ -80,7 +80,7 @@ namespace CleanMachineHMI
public static List<PlcItem> PlcItemMd_Y_List { get; set; }
public static List<Bas_WarningMd> BasWarningMd_List { get; set; }
public static List<Warning> BasWarningMd_List { get; set; }
public static List<WarningLog> CmWarningLogMd_List { get; set; }

View File

@@ -298,7 +298,7 @@ namespace CleanMachineHMI
{
if (tmpCharArr[j] == '1')
{//当前报警
Bas_WarningMd tmpMd = GlobalHelper.BasWarningMd_List.Find(x => x.PlcItemCode == $"{priStr + (index + i)}" && x.WarningCode == $"{priWarnCode + j}" && x.WarningType == "1");
Warning tmpMd = GlobalHelper.BasWarningMd_List.Find(x => x.PlcItemCode == $"{priStr + (index + i)}" && x.WarningCode == $"{priWarnCode + j}" && x.WarningType == "1");
if (tmpMd != null)
{
WarningLog warnLogTmp = GlobalHelper.CmWarningLogMd_List.Find(y => y.WaringStatus == 0 && y.WarningHandleResult == 0 && y.WarningCode == tmpMd.WarningCode && y.PlcItemCode == tmpMd.PlcItemCode);
@@ -378,7 +378,7 @@ namespace CleanMachineHMI
}
else
{//当前报警项没有报警
Bas_WarningMd tmpMd = GlobalHelper.BasWarningMd_List.Find(x => x.PlcItemCode == $"{priStr + (index + i)}" && x.WarningCode == $"{priWarnCode + j}" && x.WarningType == "1");
Warning tmpMd = GlobalHelper.BasWarningMd_List.Find(x => x.PlcItemCode == $"{priStr + (index + i)}" && x.WarningCode == $"{priWarnCode + j}" && x.WarningType == "1");
if (tmpMd != null)
{//之前有报警,则结束当前报警项
WarningLog warnLogTmp = GlobalHelper.CmWarningLogMd_List.Find(y => y.WaringStatus == 0 && y.WarningHandleResult == 0 && y.WarningCode == tmpMd.WarningCode && y.PlcItemCode == tmpMd.PlcItemCode);
@@ -469,7 +469,7 @@ namespace CleanMachineHMI
}
else
{//根据报警编码,获取报警信息,根据读取顺序编号,组成PlcItemCode
Bas_WarningMd tmpMd = GlobalHelper.BasWarningMd_List.Find(x => string.IsNullOrEmpty(x.PlcItemCode) && x.WarningCode == tmpReadAlarmBytArr_D[i].ToString() && x.WarningType == "2");
Warning tmpMd = GlobalHelper.BasWarningMd_List.Find(x => string.IsNullOrEmpty(x.PlcItemCode) && x.WarningCode == tmpReadAlarmBytArr_D[i].ToString() && x.WarningType == "2");
if (tmpMd != null)
{
WarningLog warnLogTmp = GlobalHelper.CmWarningLogMd_List.Find(y => y.WaringStatus == 0 && y.WarningHandleResult == 0 && y.WarningCode == tmpMd.WarningCode && y.PlcItemCode == $"{priStr + (index + i)}");

View File

@@ -1,4 +1,5 @@
using Krypton.Toolkit;
using CleanMachine.Model.BAS;
using Krypton.Toolkit;
using NX_LogUtility;
using System;
using System.Collections.Generic;
@@ -23,7 +24,7 @@ namespace CleanMachineHMI.frmChild
}
public delegate void dlgRefreshFrmHost();
public static dlgRefreshFrmHost RefreshFrmHost;
public static List<Bas_WarningMd> warnLst = new List<Bas_WarningMd>();
public static List<Warning> warnLst = new List<Warning>();
private void frmPopupWarningMsg_Load(object sender, EventArgs e)
{
@@ -37,7 +38,7 @@ namespace CleanMachineHMI.frmChild
if (warnLst.Count > 0)
{
kryptonDataGridView1.Rows.Clear();
foreach (Bas_WarningMd item in warnLst)
foreach (Warning item in warnLst)
{
int index = kryptonDataGridView1.Rows.Add();
kryptonDataGridView1.Rows[index].Cells[0].Value = index + 1;

View File

@@ -271,13 +271,13 @@ namespace CleanMachineHMI
char[] tmpCharArr = Convert.ToString(Convert.ToInt32(item.PlcItemValue), 2).PadLeft(16, '0').Reverse().ToArray();
if (tmpCharArr.Contains('1'))
{
List<Bas_WarningMd> warnLst = new List<Bas_WarningMd>();
List<Warning> warnLst = new List<Warning>();
for (int j = 0; j < tmpCharArr.Length; j++)
{
if (tmpCharArr[j] == '1')
{
string priWarnCode = "bit";
Bas_WarningMd tmpMd = GlobalHelper.BasWarningMd_List.Find(x => x.PlcItemCode == $"D12" && x.WarningCode == $"{priWarnCode + j}" && x.WarningType == "1");
Warning tmpMd = GlobalHelper.BasWarningMd_List.Find(x => x.PlcItemCode == $"D12" && x.WarningCode == $"{priWarnCode + j}" && x.WarningType == "1");
if (tmpMd != null)
{
warnLst.Add(tmpMd);
@@ -328,11 +328,11 @@ namespace CleanMachineHMI
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
if (dt != null && dt.Rows.Count > 0)
{
GlobalHelper.BasWarningMd_List = new List<Bas_WarningMd>();
GlobalHelper.BasWarningMd_List = new List<Warning>();
GlobalHelper.CmWarningLogMd_List = new List<WarningLog>();
foreach (DataRow item in dt.Rows)
{
GlobalHelper.BasWarningMd_List.Add(new Bas_WarningMd
GlobalHelper.BasWarningMd_List.Add(new Warning
{
WarningCode = item["WARNING_CODE"].ToString(),
WarningName = item["WARNING_NAME"].ToString(),