This commit is contained in:
gongxh
2022-05-14 10:46:36 +08:00
parent dfd71fe48c
commit 4a6894457d
12 changed files with 6579 additions and 67 deletions

View File

@@ -57,6 +57,9 @@
<Compile Update="FrmUserControl\frmIOMonitorAuto.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Update="FrmUserControl\frmMainDetailNew.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Update="FrmUserControl\frmShiftCountRecord.cs">
<SubType>UserControl</SubType>
</Compile>

Binary file not shown.

221
CleanMachineHMI/Device.cs Normal file
View File

@@ -0,0 +1,221 @@
using CleanMachine.Model.BAS;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CleanMachineHMI
{
public class Device
{
public int SysRuningTime
{
get
{
return (int)PlcOperationHelper.Instance.ReadPlcItem(nameof(SysRuningTime), PlcItemTypeDesc.D);
}
}
/// <summary>
/// 毛刷1状态
/// </summary>
public bool Hairbrush1Selection
{
get
{
return (bool)PlcOperationHelper.Instance.ReadPlcItem(nameof(Hairbrush1Selection), PlcItemTypeDesc.M);
}
}
/// <summary>
///
/// 毛刷2状态
/// </summary>
public bool Hairbrush2Selection
{
get
{
return (bool)PlcOperationHelper.Instance.ReadPlcItem(nameof(Hairbrush2Selection), PlcItemTypeDesc.M);
}
}
/// <summary>
///
/// 毛刷3状态
/// </summary>
public bool Hairbrush3Selection
{
get
{
return (bool)PlcOperationHelper.Instance.ReadPlcItem(nameof(Hairbrush3Selection), PlcItemTypeDesc.M);
}
}
/// <summary>
///
/// 静电棒状态
/// </summary>
public bool StaticbarsSel
{
get
{
return (bool)PlcOperationHelper.Instance.ReadPlcItem(nameof(StaticbarsSel), PlcItemTypeDesc.M);
}
}
/// <summary>
/// 当前计数
/// </summary>
public int NozzleNum
{
get
{
return (int)PlcOperationHelper.Instance.ReadPlcItem(nameof(NozzleNum), PlcItemTypeDesc.D);
}
set
{
PlcOperationHelper.Instance.WritePlcItem(nameof(NozzleNum), value.ToString(), PlcItemTypeDesc.D);
}
}
/// <summary>
/// 班次计数
/// </summary>
public int ShiftCount
{
get
{
return (int)PlcOperationHelper.Instance.ReadPlcItem(nameof(ShiftCount), PlcItemTypeDesc.D);
}
set
{
PlcOperationHelper.Instance.WritePlcItem(nameof(ShiftCount), value.ToString(), PlcItemTypeDesc.D);
}
}
/// <summary>
///打印完成 托盘保存完成
/// </summary>
public bool PrintFinish
{
set
{
PlcOperationHelper.Instance.WritePlcItem(nameof(PrintFinish), value.ToString(), PlcItemTypeDesc.M);
}
}
//if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("StopSys", PlcItemTypeDesc.M))
// && !Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("ManualOrAuto", PlcItemTypeDesc.M)))
/// <summary>
/// 系统是否运行
/// </summary>
public bool StopSys
{
get
{
return (bool)PlcOperationHelper.Instance.ReadPlcItem(nameof(StopSys), PlcItemTypeDesc.M);
}
set
{
PlcOperationHelper.Instance.WritePlcItem(nameof(StopSys), value.ToString(), PlcItemTypeDesc.M);
}
}
/// <summary>
/// 手动还是自动
/// </summary>
public bool ManualOrAuto
{
get
{
return (bool)PlcOperationHelper.Instance.ReadPlcItem(nameof(ManualOrAuto), PlcItemTypeDesc.M);
}
}
/// <summary>
/// 运行状态
/// </summary>
public bool CleanMacRunStatusNew
{
get
{
return (bool)PlcOperationHelper.Instance.ReadPlcItem(nameof(CleanMacRunStatusNew), PlcItemTypeDesc.M);
}
}
/// <summary>
/// 满料信号
/// </summary>
public bool FinishWorkingPallet
{
get
{
return (bool)PlcOperationHelper.Instance.ReadPlcItem(nameof(FinishWorkingPallet), PlcItemTypeDesc.M);
}
}
/// <summary>
/// 满料方式
/// </summary>
public bool FullPalletMode
{
get
{
return (bool)PlcOperationHelper.Instance.ReadPlcItem(nameof(FullPalletMode), PlcItemTypeDesc.M);
}
}
/// <summary>
/// 满料数量
/// </summary>
public int WorkedFullPalletNum
{
get
{
return (int)PlcOperationHelper.Instance.ReadPlcItem(nameof(WorkedFullPalletNum), PlcItemTypeDesc.D);
}
}
/// <summary>
/// 是否强制满料
/// </summary>
public bool ForceFullPallet
{
get
{
return (bool)PlcOperationHelper.Instance.ReadPlcItem(nameof(ForceFullPallet), PlcItemTypeDesc.M);
}
}
}
}

View File

@@ -44,6 +44,7 @@ namespace CleanMachineHMI.FrmUserControl
this.kryptonButton3 = new Krypton.Toolkit.KryptonButton();
this.knud_WorkedFullPalletNum = new Krypton.Toolkit.KryptonTextBox();
this.kryptonGroupBox7 = new Krypton.Toolkit.KryptonGroupBox();
this.labelNextFullStop = new System.Windows.Forms.Label();
this.kryptonLabel12 = new Krypton.Toolkit.KryptonLabel();
this.kryptonLabel11 = new Krypton.Toolkit.KryptonLabel();
this.cbt_fpalletmod = new CleanMachineHMI.CircleButton();
@@ -77,7 +78,6 @@ namespace CleanMachineHMI.FrmUserControl
this.kbtn_Scrap = new Krypton.Toolkit.KryptonButton();
this.ktb_Scrap = new Krypton.Toolkit.KryptonTextBox();
this.kdtp_RecordDate = new Krypton.Toolkit.KryptonDateTimePicker();
this.label8 = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.kryptonButton8 = new Krypton.Toolkit.KryptonButton();
this.ktb_CurrPalletCode = new Krypton.Toolkit.KryptonTextBox();
@@ -90,6 +90,7 @@ namespace CleanMachineHMI.FrmUserControl
this.ktb_ScrapNum = new Krypton.Toolkit.KryptonTextBox();
this.kryptonLabel14 = new Krypton.Toolkit.KryptonLabel();
this.ktb_CompleteNum = new Krypton.Toolkit.KryptonTextBox();
this.buttonSpecAny1 = new Krypton.Toolkit.ButtonSpecAny();
this.kryptonLabel5 = new Krypton.Toolkit.KryptonLabel();
this.kryptonLabel4 = new Krypton.Toolkit.KryptonLabel();
this.label7 = new System.Windows.Forms.Label();
@@ -195,7 +196,6 @@ namespace CleanMachineHMI.FrmUserControl
this.btnPLCConfig = new Krypton.Toolkit.KryptonButton();
this.btnIO = new Krypton.Toolkit.KryptonButton();
this.btnManual = new Krypton.Toolkit.KryptonButton();
this.labelNextFullStop = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox8)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox8.Panel)).BeginInit();
this.kryptonGroupBox8.Panel.SuspendLayout();
@@ -450,7 +450,7 @@ namespace CleanMachineHMI.FrmUserControl
//
// knud_WorkedFullPalletNum
//
this.knud_WorkedFullPalletNum.Location = new System.Drawing.Point(100, 276);
this.knud_WorkedFullPalletNum.Location = new System.Drawing.Point(91, 301);
this.knud_WorkedFullPalletNum.Name = "knud_WorkedFullPalletNum";
this.knud_WorkedFullPalletNum.Size = new System.Drawing.Size(54, 30);
this.knud_WorkedFullPalletNum.StateCommon.Content.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -497,6 +497,20 @@ namespace CleanMachineHMI.FrmUserControl
this.kryptonGroupBox7.TabIndex = 5;
this.kryptonGroupBox7.Values.Heading = "";
//
// labelNextFullStop
//
this.labelNextFullStop.AutoSize = true;
this.labelNextFullStop.BackColor = System.Drawing.Color.Transparent;
this.labelNextFullStop.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.labelNextFullStop.ForeColor = System.Drawing.Color.Red;
this.labelNextFullStop.Location = new System.Drawing.Point(17, 104);
this.labelNextFullStop.Name = "labelNextFullStop";
this.labelNextFullStop.Size = new System.Drawing.Size(203, 16);
this.labelNextFullStop.TabIndex = 52;
this.labelNextFullStop.Text = "下次满料将停止,点击取消";
this.labelNextFullStop.Visible = false;
this.labelNextFullStop.Click += new System.EventHandler(this.labelNextFullStop_Click);
//
// kryptonLabel12
//
this.kryptonLabel12.Location = new System.Drawing.Point(21, 302);
@@ -826,7 +840,6 @@ namespace CleanMachineHMI.FrmUserControl
this.kryptonGroupBox1.Panel.Controls.Add(this.kbtn_Scrap);
this.kryptonGroupBox1.Panel.Controls.Add(this.ktb_Scrap);
this.kryptonGroupBox1.Panel.Controls.Add(this.kdtp_RecordDate);
this.kryptonGroupBox1.Panel.Controls.Add(this.label8);
this.kryptonGroupBox1.Panel.Controls.Add(this.panel1);
this.kryptonGroupBox1.Panel.Controls.Add(this.label7);
this.kryptonGroupBox1.Panel.Controls.Add(this.ktb_SaveIR);
@@ -840,7 +853,7 @@ namespace CleanMachineHMI.FrmUserControl
//
// kryptonLabel13
//
this.kryptonLabel13.Location = new System.Drawing.Point(151, 279);
this.kryptonLabel13.Location = new System.Drawing.Point(142, 304);
this.kryptonLabel13.Name = "kryptonLabel13";
this.kryptonLabel13.Size = new System.Drawing.Size(55, 20);
this.kryptonLabel13.StateCommon.ShortText.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -849,7 +862,7 @@ namespace CleanMachineHMI.FrmUserControl
//
// kbtn_WorkedFullPalletNum
//
this.kbtn_WorkedFullPalletNum.Location = new System.Drawing.Point(204, 275);
this.kbtn_WorkedFullPalletNum.Location = new System.Drawing.Point(195, 300);
this.kbtn_WorkedFullPalletNum.Name = "kbtn_WorkedFullPalletNum";
this.kbtn_WorkedFullPalletNum.Size = new System.Drawing.Size(170, 30);
this.kbtn_WorkedFullPalletNum.StateCommon.Content.ShortText.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -873,9 +886,9 @@ namespace CleanMachineHMI.FrmUserControl
// kbtn_Scrap_1
//
this.kbtn_Scrap_1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.kbtn_Scrap_1.Location = new System.Drawing.Point(336, 323);
this.kbtn_Scrap_1.Location = new System.Drawing.Point(289, 341);
this.kbtn_Scrap_1.Name = "kbtn_Scrap_1";
this.kbtn_Scrap_1.Size = new System.Drawing.Size(60, 60);
this.kbtn_Scrap_1.Size = new System.Drawing.Size(107, 42);
this.kbtn_Scrap_1.StateCommon.Back.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(64)))), ((int)(((byte)(20)))));
this.kbtn_Scrap_1.StateCommon.Back.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(64)))), ((int)(((byte)(20)))));
this.kbtn_Scrap_1.StateCommon.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.Solid;
@@ -888,9 +901,9 @@ namespace CleanMachineHMI.FrmUserControl
// kbtn_Scrap
//
this.kbtn_Scrap.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.kbtn_Scrap.Location = new System.Drawing.Point(96, 323);
this.kbtn_Scrap.Location = new System.Drawing.Point(18, 341);
this.kbtn_Scrap.Name = "kbtn_Scrap";
this.kbtn_Scrap.Size = new System.Drawing.Size(60, 60);
this.kbtn_Scrap.Size = new System.Drawing.Size(82, 42);
this.kbtn_Scrap.StateCommon.Back.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(64)))), ((int)(((byte)(20)))));
this.kbtn_Scrap.StateCommon.Back.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(64)))), ((int)(((byte)(20)))));
this.kbtn_Scrap.StateCommon.Back.ColorStyle = Krypton.Toolkit.PaletteColorStyle.Solid;
@@ -903,10 +916,10 @@ namespace CleanMachineHMI.FrmUserControl
// ktb_Scrap
//
this.ktb_Scrap.AlwaysActive = false;
this.ktb_Scrap.Location = new System.Drawing.Point(184, 355);
this.ktb_Scrap.Location = new System.Drawing.Point(106, 356);
this.ktb_Scrap.Name = "ktb_Scrap";
this.ktb_Scrap.ReadOnly = true;
this.ktb_Scrap.Size = new System.Drawing.Size(121, 23);
this.ktb_Scrap.Size = new System.Drawing.Size(177, 23);
this.ktb_Scrap.TabIndex = 1;
//
// kdtp_RecordDate
@@ -921,18 +934,6 @@ namespace CleanMachineHMI.FrmUserControl
this.kdtp_RecordDate.Size = new System.Drawing.Size(184, 21);
this.kdtp_RecordDate.TabIndex = 4;
//
// label8
//
this.label8.AutoSize = true;
this.label8.BackColor = System.Drawing.Color.Transparent;
this.label8.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.ForeColor = System.Drawing.Color.Black;
this.label8.Location = new System.Drawing.Point(202, 323);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(75, 12);
this.label8.TabIndex = 8;
this.label8.Text = "Current IR";
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -952,17 +953,18 @@ namespace CleanMachineHMI.FrmUserControl
this.panel1.Controls.Add(this.kryptonLabel4);
this.panel1.Location = new System.Drawing.Point(67, 79);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(329, 190);
this.panel1.Size = new System.Drawing.Size(329, 219);
this.panel1.TabIndex = 3;
//
// kryptonButton8
//
this.kryptonButton8.Location = new System.Drawing.Point(224, 158);
this.kryptonButton8.Location = new System.Drawing.Point(224, 161);
this.kryptonButton8.Name = "kryptonButton8";
this.kryptonButton8.Size = new System.Drawing.Size(73, 26);
this.kryptonButton8.StateCommon.Content.ShortText.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.kryptonButton8.TabIndex = 49;
this.kryptonButton8.Values.Text = "reset";
this.kryptonButton8.Visible = false;
this.kryptonButton8.Click += new System.EventHandler(this.kryptonButton8_Click);
//
// ktb_CurrPalletCode
@@ -987,12 +989,19 @@ namespace CleanMachineHMI.FrmUserControl
// ktb_ShiftCount
//
this.ktb_ShiftCount.AlwaysActive = false;
this.ktb_ShiftCount.CueHint.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ktb_ShiftCount.CueHint.Padding = new System.Windows.Forms.Padding(0);
this.ktb_ShiftCount.InputControlStyle = Krypton.Toolkit.InputControlStyle.Ribbon;
this.ktb_ShiftCount.Location = new System.Drawing.Point(147, 161);
this.ktb_ShiftCount.Name = "ktb_ShiftCount";
this.ktb_ShiftCount.ReadOnly = true;
this.ktb_ShiftCount.Size = new System.Drawing.Size(71, 23);
this.ktb_ShiftCount.Size = new System.Drawing.Size(74, 26);
this.ktb_ShiftCount.StateCommon.Content.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ktb_ShiftCount.StateNormal.Content.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ktb_ShiftCount.StateNormal.Content.Padding = new System.Windows.Forms.Padding(5);
this.ktb_ShiftCount.TabIndex = 1;
this.ktb_ShiftCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.ktb_ShiftCount.WordWrap = false;
//
// ktb_FinishedPalletNum
//
@@ -1054,13 +1063,20 @@ namespace CleanMachineHMI.FrmUserControl
// ktb_CompleteNum
//
this.ktb_CompleteNum.AlwaysActive = false;
this.ktb_CompleteNum.ButtonSpecs.AddRange(new Krypton.Toolkit.ButtonSpecAny[] {
this.buttonSpecAny1});
this.ktb_CompleteNum.Location = new System.Drawing.Point(147, 6);
this.ktb_CompleteNum.Name = "ktb_CompleteNum";
this.ktb_CompleteNum.ReadOnly = true;
this.ktb_CompleteNum.Size = new System.Drawing.Size(150, 23);
this.ktb_CompleteNum.StateNormal.Content.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ktb_CompleteNum.TabIndex = 1;
this.ktb_CompleteNum.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// buttonSpecAny1
//
this.buttonSpecAny1.UniqueName = "8dcb0cfe3c3b47bfa4290fe4bbef0a3a";
//
// kryptonLabel5
//
this.kryptonLabel5.LabelStyle = Krypton.Toolkit.LabelStyle.BoldControl;
@@ -1085,11 +1101,11 @@ namespace CleanMachineHMI.FrmUserControl
this.label7.BackColor = System.Drawing.Color.Transparent;
this.label7.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label7.ForeColor = System.Drawing.Color.Black;
this.label7.Location = new System.Drawing.Point(202, 341);
this.label7.Location = new System.Drawing.Point(116, 341);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(82, 12);
this.label7.Size = new System.Drawing.Size(166, 12);
this.label7.TabIndex = 8;
this.label7.Text = "Scrap Count";
this.label7.Text = "Current IR Scrap Count";
//
// ktb_SaveIR
//
@@ -2700,20 +2716,6 @@ namespace CleanMachineHMI.FrmUserControl
this.btnManual.Values.Text = "手动控制";
this.btnManual.Click += new System.EventHandler(this.btnManual_Click);
//
// labelNextFullStop
//
this.labelNextFullStop.AutoSize = true;
this.labelNextFullStop.BackColor = System.Drawing.Color.Transparent;
this.labelNextFullStop.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.labelNextFullStop.ForeColor = System.Drawing.Color.Red;
this.labelNextFullStop.Location = new System.Drawing.Point(17, 104);
this.labelNextFullStop.Name = "labelNextFullStop";
this.labelNextFullStop.Size = new System.Drawing.Size(203, 16);
this.labelNextFullStop.TabIndex = 52;
this.labelNextFullStop.Text = "下次满料将停止,点击取消";
this.labelNextFullStop.Visible = false;
this.labelNextFullStop.Click += new System.EventHandler(this.labelNextFullStop_Click);
//
// frmMainDetail
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -2857,7 +2859,6 @@ namespace CleanMachineHMI.FrmUserControl
private Krypton.Toolkit.KryptonButton kbtn_Scrap;
private Krypton.Toolkit.KryptonTextBox ktb_Scrap;
private Krypton.Toolkit.KryptonDateTimePicker kdtp_RecordDate;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Panel panel1;
private Krypton.Toolkit.KryptonTextBox ktb_CurrPalletCode;
private Krypton.Toolkit.KryptonLabel kryptonLabel10;
@@ -2980,5 +2981,6 @@ namespace CleanMachineHMI.FrmUserControl
private Krypton.Toolkit.KryptonLabel kryptonLabel16;
private Krypton.Toolkit.KryptonButton btnShiftCount;
private System.Windows.Forms.Label labelNextFullStop;
private Krypton.Toolkit.ButtonSpecAny buttonSpecAny1;
}
}

View File

@@ -1,5 +1,5 @@
#define NewFun
//#define NewFun
using CleanMachineHMI.Domain.Enums;
using CleanMachineHMI.Utils;
@@ -24,7 +24,7 @@ using CleanMachine.Model.BAS;
namespace CleanMachineHMI.FrmUserControl
{
[FormType(EnumFormType.MainDetail)]
public partial class frmMainDetail : UserControl
{
public frmMainDetail()
@@ -318,7 +318,7 @@ namespace CleanMachineHMI.FrmUserControl
}
}
#if NewFun
private void FinishWorkingPallet1()
{
@@ -426,7 +426,9 @@ namespace CleanMachineHMI.FrmUserControl
}
/// <summary>
/// 使用线程同步
/// </summary>
private void Instance_OnReadFinish()
{
@@ -716,7 +718,7 @@ namespace CleanMachineHMI.FrmUserControl
FinishWorkingPallet1();
}
#endif
private void SyncFinishPalletData(object sender, EventArgs e)
{
Invoke(new Action(() =>
@@ -899,7 +901,7 @@ namespace CleanMachineHMI.FrmUserControl
}
}
#if !NewFun
/// <summary>
/// 满料检查,并打印处理
/// </summary>
@@ -1011,6 +1013,7 @@ namespace CleanMachineHMI.FrmUserControl
}
#endif
}
#endif
/// <summary>
/// 虚拟下盘
@@ -1134,7 +1137,7 @@ namespace CleanMachineHMI.FrmUserControl
}
#if NewFun
/// <summary>
/// 打印托盘信息
@@ -1154,8 +1157,7 @@ namespace CleanMachineHMI.FrmUserControl
if (isForceFinish)
{
Invoke(new Action(() =>
{
//批次信息按钮可操作
ktb_SaveIR.Enabled = true;
kcmb_SheetType.Enabled = true;
@@ -1184,32 +1186,30 @@ namespace CleanMachineHMI.FrmUserControl
ktb_CurrentPalletNum.Text = "0";
ktb_FinishedPalletNum.Text = "0";
}));
//清空当前内存污染计数
foreach (CleanType item in basCleanTypeMsgList)
{
if (string.IsNullOrEmpty(item.ContaminationDtlCode))
{//常规清洗 清零(其他污染)
Invoke(new Action(() =>
{
if (this.Controls.Find("knud_" + item.CleanModeCode, true).Length > 0)
{
KryptonNumericUpDown knudmd = this.Controls.Find("knud_" + item.CleanModeCode, true)[0] as KryptonNumericUpDown;
knudmd.Value = 0;
}
}));
}
else
{//特殊清洗 清零
Invoke(new Action(() =>
{
if (this.Controls.Find("knud_" + item.ContaminationDtlCode, true).Length > 0)
{
KryptonNumericUpDown knudmd = this.Controls.Find("knud_" + item.ContaminationDtlCode, true)[0] as KryptonNumericUpDown;
knudmd.Value = 0;
}
}));
}
}
@@ -1232,7 +1232,7 @@ namespace CleanMachineHMI.FrmUserControl
}
else
{
#region 生成的新的组盘信息,等待计数作业。
#region 生成的新的组盘信息,等待计数作业。
string trayCode = Global.GetPalletCode();
string sqlInsertWorkPallet = $@" INSERT INTO [CM_WORKING_PALLET] (
[WORKING_PALLET_CODE],
@@ -1319,7 +1319,7 @@ namespace CleanMachineHMI.FrmUserControl
ktb_CurrPalletCode.Text = trayCode;
}));
LogHelper.WriteLog($"新增作业托盘:【{trayCode}】数据成功!新增板材:【{SheetTypeCode}】,IR条码:【{workingIrMsg}】的作业明细记录成功!", LogTypeEum.Run);
#endregion
#endregion
Invoke(new Action(() =>
{
@@ -1446,6 +1446,318 @@ namespace CleanMachineHMI.FrmUserControl
}
#else
/// <summary>
/// 打印托盘信息
/// </summary>
/// <param name="workingIrMsg"></param>
/// <param name="palletCodeMsg"></param>
/// <param name="isForceFinish">是否强制满料</param>
private void PrintPalletData(string workingIrMsg, string palletCodeMsg, bool isForceFinish)
{
//只有是满料了,就要清除托盘残余数量
this.lastPaltteRemain = 0;
string sqlUpdateWorkingPallet = $@"UPDATE CM_WORKING_PALLET SET WORKING_STATUS = 1,UPDATE_BY = '{Global.UserInfo.UserId}',UPDATE_TIME = datetime('now', 'localtime'),DATA_VERSION = DATA_VERSION + 1 where WORKING_PALLET_CODE = '{palletCodeMsg}';";
string sqlUpdateWorkingPalletDtl = $@"UPDATE CM_WORKING_PALLET_DTL SET WORKING_DTL_STATUS = 1,UPDATE_BY = '{Global.UserInfo.UserId}',UPDATE_TIME = datetime('now', 'localtime'),DATA_VERSION = DATA_VERSION + 1 where WORKING_PALLET_CODE = '{palletCodeMsg}';";
int row1 = LeadDbHelperSQLite.ExecuteSql(sqlUpdateWorkingPallet);
int row2 = LeadDbHelperSQLite.ExecuteSql(sqlUpdateWorkingPalletDtl);
if (isForceFinish)
{
Invoke(new Action(() =>
{
//批次信息按钮可操作
ktb_SaveIR.Enabled = true;
kcmb_SheetType.Enabled = true;
ktb_IR.Enabled = true;
kdtp_RecordDate.Enabled = true;
kbtn_forceFinish.Enabled = true;
//污染类型操作禁用
//kryptonGroupBox10.Enabled = false;
kryptonGroupBox2.Enabled = false;
kryptonGroupBox3.Enabled = false;
kryptonGroupBox4.Enabled = false;
kryptonGroupBox5.Enabled = false;
kbtn_Scrap.Enabled = false;
kbtn_Scrap_1.Enabled = false;
//清空历史批次信息
kcmb_SheetType.SelectedIndex = 0;
ktb_IR.Text = "";
kdtp_RecordDate.Text = "";
kdtp_RecordDate.Checked = false;
ktb_CompleteNum.Text = "0";
ktb_ScrapNum.Text = "0";
ktb_CurrPalletCode.Text = "";
ktb_CurrentPalletNum.Text = "0";
ktb_FinishedPalletNum.Text = "0";
}));
//清空当前内存污染计数
foreach (CleanType item in basCleanTypeMsgList)
{
if (string.IsNullOrEmpty(item.ContaminationDtlCode))
{//常规清洗 清零(其他污染)
Invoke(new Action(() =>
{
if (this.Controls.Find("knud_" + item.CleanModeCode, true).Length > 0)
{
KryptonNumericUpDown knudmd = this.Controls.Find("knud_" + item.CleanModeCode, true)[0] as KryptonNumericUpDown;
knudmd.Value = 0;
}
}));
}
else
{//特殊清洗 清零
Invoke(new Action(() =>
{
if (this.Controls.Find("knud_" + item.ContaminationDtlCode, true).Length > 0)
{
KryptonNumericUpDown knudmd = this.Controls.Find("knud_" + item.ContaminationDtlCode, true)[0] as KryptonNumericUpDown;
knudmd.Value = 0;
}
}));
}
}
LogHelper.WriteLog($"作业托盘:【{palletCodeMsg}】已强制结束,作业主页面关键信息重置完成。", LogTypeEum.Run);
string sql = $@"SELECT WORKING_PALLET_CODE from CM_WORKING_PALLET_DTL GROUP BY WORKING_PALLET_CODE HAVING SUM(CURRENT_NUMBER) = 0";
DataTable dt = LeadDbHelperSQLite.Query(sql).Tables[0];
if (dt != null && dt.Rows.Count > 0)
{
foreach (DataRow item in dt.Rows)
{
string sqlTmp = $@"delete from CM_WORKING_PALLET where WORKING_PALLET_CODE = '{item["WORKING_PALLET_CODE"].ToString()}'";
string sqlTmp1 = $@"delete from CM_WORKING_PALLET_DTL where WORKING_PALLET_CODE = '{item["WORKING_PALLET_CODE"].ToString()}'";
LeadDbHelperSQLite.ExecuteSql(sqlTmp);
LeadDbHelperSQLite.ExecuteSql(sqlTmp1);
Thread.Sleep(10);
}
}
PrintWorkedIrMsg(workingIrMsg);
}
else
{
#region 生成的新的组盘信息,等待计数作业。
string trayCode = Global.GetPalletCode();
string sqlInsertWorkPallet = $@" INSERT INTO [CM_WORKING_PALLET] (
[WORKING_PALLET_CODE],
[WORKING_PALLET_DESC],
[WORKING_STATUS],
[CREATE_BY],
[UPDATE_BY],
[DATA_VERSION]
)
VALUES
(
'{trayCode}',
'{trayCode}',
'{-1}',
'{Global.UserInfo.UserId}',
'{Global.UserInfo.UserId}',
'{0}'
);";
LeadDbHelperSQLite.ExecuteSql(sqlInsertWorkPallet);
string SheetTypeCode = "";
this.Invoke(new Action(() =>
{
SheetTypeCode = ((ListItem)kcmb_SheetType.SelectedItem).Value;
}));
foreach (CleanType item in basCleanTypeMsgList)
{
string sqlInsertWorkPalletDtl = $@"
INSERT INTO [CM_WORKING_PALLET_DTL] (
[WORKING_PALLET_CODE],
[IR_CODE],
[SHEET_TYPE_CODE],
[INPUT_TIME],
[CLEAN_MODE_CODE],
[CONTAMINATION_TYPE_CODE],
[CONTAMINATION_DTL_CODE],
[CURRENT_NUMBER],
[OPERATE_USER_ID],
[OPERATE_USER_TIME],
[WORKING_DTL_STATUS],
[CREATE_BY],
[CREATE_TIME],
[UPDATE_BY],
[UPDATE_TIME],
[DATA_VERSION],
[REMARKS1],
[REMARKS2],
[REMARKS3],
[REMARKS4],
[REMARKS5]
)
VALUES
(
'{trayCode}',
'{workingIrMsg}',
'{SheetTypeCode}',
(datetime('now','localtime')),
'{item.CleanModeCode}',
'{item.ContaminationTypeCode}',
'{item.ContaminationDtlCode}',
0,
'{Global.UserInfo.UserId}',
datetime('now', 'localtime'),
-1,
'{Global.UserInfo.UserId}',
datetime('now', 'localtime'),
'{Global.UserInfo.UserId}',
datetime('now', 'localtime'),
0,
NULL,
NULL,
NULL,
NULL,
NULL
);";
LeadDbHelperSQLite.ExecuteSql(sqlInsertWorkPalletDtl);
}
Invoke(new Action(() =>
{
ktb_CurrPalletCode.Text = trayCode;
}));
LogHelper.WriteLog($"新增作业托盘:【{trayCode}】数据成功!新增板材:【{SheetTypeCode}】,IR条码:【{workingIrMsg}】的作业明细记录成功!", LogTypeEum.Run);
#endregion
Invoke(new Action(() =>
{
//污染类型操作禁用
//kryptonGroupBox10.Enabled = false;
kryptonGroupBox2.Enabled = false;
kryptonGroupBox3.Enabled = false;
kryptonGroupBox4.Enabled = false;
kryptonGroupBox5.Enabled = false;
kbtn_Scrap.Enabled = false;
kbtn_Scrap_1.Enabled = false;
kbtn_forceFinish.Enabled = false;
}));
//清空当前内存污染计数
foreach (CleanType item in basCleanTypeMsgList)
{
if (string.IsNullOrEmpty(item.ContaminationDtlCode))
{//常规清洗 清零(其他污染)
Invoke(new Action(() =>
{
if (this.Controls.Find("knud_" + item.CleanModeCode, true).Length > 0)
{
KryptonNumericUpDown knudmd = this.Controls.Find("knud_" + item.CleanModeCode, true)[0] as KryptonNumericUpDown;
knudmd.Value = 0;
}
}));
}
else
{//特殊清洗 清零
Invoke(new Action(() =>
{
if (this.Controls.Find("knud_" + item.ContaminationDtlCode, true).Length > 0)
{
KryptonNumericUpDown knudmd = this.Controls.Find("knud_" + item.ContaminationDtlCode, true)[0] as KryptonNumericUpDown;
knudmd.Value = 0;
}
}));
}
}
}
if (row1 > 0 && row2 > 0)
{
string sqlQueryCleanNum = $@"SELECT CURRENT_NUMBER FROM CM_WORKING_PALLET_DTL WHERE WORKING_DTL_STATUS = 1 and CLEAN_MODE_CODE = 'SortedCleaned' AND WORKING_PALLET_CODE = '{palletCodeMsg}'";
DataTable dtQueryCleanNum = LeadDbHelperSQLite.Query(sqlQueryCleanNum).Tables[0];
if (dtQueryCleanNum != null && dtQueryCleanNum.Rows.Count > 0)
{
int currCleanNum = Convert.ToInt32(dtQueryCleanNum.Rows[0][0]);
string sqlUpdateParam = $@"UPDATE SYS_PARAMETER SET PARAMETER_VALUE = PARAMETER_VALUE + '{currCleanNum}',UPDATE_BY = '{Global.UserInfo.UserId}',UPDATE_TIME = datetime('now', 'localtime') WHERE PARAMETER_CODE = 'CleaningMacTotalNum';";
LeadDbHelperSQLite.ExecuteSql(sqlUpdateParam);
}
}
//清除满料信号
//if (PlcOperationHelper.Instance.WritePlcItem("FinishWorkingPallet", "False", PlcItemTypeDesc.M))
//{
// LogHelper.WriteLog($"作业托盘:【{palletCodeMsg}】已满料,发送PLC清除满料信号成功。", LogTypeEum.Run);
//}
//else
//{
// LogHelper.WriteLog($"作业托盘:【{palletCodeMsg}】已满料,发送PLC清除满料信号失败。", LogTypeEum.Err);
//}
//打印完成信号
if (PlcOperationHelper.Instance.WritePlcItem("PrintFinish", "True", PlcItemTypeDesc.M))
{
LogHelper.WriteLog($"作业托盘:【{palletCodeMsg}】已满料,发送PLC打印完成信号成功。", LogTypeEum.Run);
}
else
{
LogHelper.WriteLog($"作业托盘:【{palletCodeMsg}】已满料,发送PLC打印完成信号失败。", LogTypeEum.Err);
}
//当前托盘板材计数清零
if (PlcOperationHelper.Instance.WritePlcItem("NozzleNum", "0", PlcItemTypeDesc.D))
{
LogHelper.WriteLog($"作业托盘:【{palletCodeMsg}】已满料,发送PLC当前托盘板材计数清零信号成功。", LogTypeEum.Run);
}
else
{
LogHelper.WriteLog($"作业托盘:【{palletCodeMsg}】已满料,发送PLC当前托盘板材计数清零信号失败。", LogTypeEum.Err);
}
if (isForceFinish)
{
//保存打印数据
string sqlInsertZbkWorkingPallet = $@"INSERT INTO ZBK_WORKING_PALLET SELECT * FROM CM_WORKING_PALLET WHERE WORKING_PALLET_CODE in (select WORKING_PALLET_CODE from CM_WORKING_PALLET_DTL where IR_CODE = '{workingIrMsg}' and WORKING_DTL_STATUS = 1)";
string sqlInsertZbkWorkingPalletDtl = $@"INSERT INTO ZBK_WORKING_PALLET_DTL SELECT * FROM CM_WORKING_PALLET_DTL WHERE WORKING_DTL_STATUS = 1 and IR_CODE = '{workingIrMsg}';";
string sqlDeleteWorkingPallet = $@"delete from CM_WORKING_PALLET where WORKING_PALLET_CODE in (select WORKING_PALLET_CODE from CM_WORKING_PALLET_DTL where IR_CODE = '{workingIrMsg}' and WORKING_DTL_STATUS = 1);";
string sqlDeleteWorkingPalletDtl = $@"delete from CM_WORKING_PALLET_DTL where WORKING_DTL_STATUS = 1 and IR_CODE = '{workingIrMsg}';";
LeadDbHelperSQLite.ExecuteSql(sqlInsertZbkWorkingPalletDtl);
LeadDbHelperSQLite.ExecuteSql(sqlInsertZbkWorkingPallet);
LeadDbHelperSQLite.ExecuteSql(sqlDeleteWorkingPallet);
LeadDbHelperSQLite.ExecuteSql(sqlDeleteWorkingPalletDtl);
LogHelper.WriteLog($"作业IR:【{workingIrMsg}】已经结束,数据库信息重置完成。", LogTypeEum.Run);
}
if (this.NextFullStop)
{
this.NextFullStop = false;
//
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("StopSys", PlcItemTypeDesc.M))
&& !Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("ManualOrAuto", PlcItemTypeDesc.M)))
{
if (PlcOperationHelper.Instance.WritePlcItem("StopSys", "True", PlcItemTypeDesc.M))
{
//GlobalHelper.SysIsRunFlag = false;
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】点击停止设备按钮,停止信号发送PLC成功!", LogTypeEum.Run);
}
Thread.Sleep(200);
if (PlcOperationHelper.Instance.WritePlcItem("StopSys", "False", PlcItemTypeDesc.M))
{
}
}
}
}
#endif
private void PrintWorkedIrMsg(string workingIrCodeMsg)
{
new CleanMachine.BLL.CM.IncomingReceipt().Print(workingIrCodeMsg, Global.MacCode, this._reportFolder);
@@ -1455,6 +1767,7 @@ namespace CleanMachineHMI.FrmUserControl
/// <summary>
/// PLC 信号处理
/// </summary>
#if !NewFun
private void MainDtlRunTh()
{
while (Global.SysThIsRunFlag)
@@ -1759,6 +2072,7 @@ namespace CleanMachineHMI.FrmUserControl
Thread.Sleep(200);
}
}
#endif
private void btnPrinter_Click(object sender, EventArgs e)
{
//GlobalHelper.MainForm.navigatorMain.SetNavPage(Domain.Enums.EnumFormType.PrintMain);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -2,7 +2,7 @@
#if DEBUG
#define USE_LOCAL_TCP_DEBUG
//#define USE_LOCAL_TCP_DEBUG
#endif
//启用心跳检查