2022-05-10 15:21:13 +08:00
|
|
|
|
using CleanMachine.Model.BAS;
|
|
|
|
|
|
using CleanMachineHMI.Domain.Enums;
|
2021-06-05 14:17:30 +08:00
|
|
|
|
using CleanMachineHMI.Utils;
|
2021-12-26 21:30:02 +08:00
|
|
|
|
using Krypton.Toolkit;
|
2021-06-05 14:17:30 +08:00
|
|
|
|
using NX_LogUtility;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CleanMachineHMI.FrmUserControl
|
|
|
|
|
|
{
|
|
|
|
|
|
[FormType(EnumFormType.Manual)]
|
|
|
|
|
|
public partial class frmManual : UserControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public frmManual()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
|
|
|
|
|
public delegate void dlgLoadManualFrmData();
|
|
|
|
|
|
public static dlgLoadManualFrmData LoadManualFrmData;
|
|
|
|
|
|
private Hashtable EmergencySwitchLst = Hashtable.Synchronized(new Hashtable());
|
|
|
|
|
|
private void frmManual_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
InitControlEvent();
|
2022-03-18 19:06:26 +08:00
|
|
|
|
this.SetFormControlText();
|
2021-06-05 14:17:30 +08:00
|
|
|
|
LoadManualFrmData = new dlgLoadManualFrmData(GetManualPlcItemVlaue);
|
|
|
|
|
|
GetManualPlcItemVlaue();
|
2022-05-06 12:28:16 +08:00
|
|
|
|
Global.OnSyncFinishPalletData += SyncFinishPalletData;
|
2021-06-05 14:17:30 +08:00
|
|
|
|
//InitData(false);
|
|
|
|
|
|
//Thread th = new Thread(ThRunFunc)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// IsBackground = true
|
|
|
|
|
|
//};
|
|
|
|
|
|
//th.Start();
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 20210206 孙亚龙新增 监控急停开关的代码
|
|
|
|
|
|
private bool ReadScramButtonValue()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FeedingLiftingDrumLightCurtain2_IO", PlcItemTypeDesc.X)) || Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("DischargeLiftingDrumLightCurtain_IO", PlcItemTypeDesc.X)) || Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CrashStop_IO", PlcItemTypeDesc.X));
|
|
|
|
|
|
}
|
|
|
|
|
|
private void InitData(bool isReadNew)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!isReadNew)
|
|
|
|
|
|
{
|
|
|
|
|
|
EmergencySwitchLst.Add("FeedingLiftingDrumLightCurtain2_IO", new ScramButtonControl
|
|
|
|
|
|
{
|
|
|
|
|
|
OldValue = Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FeedingLiftingDrumLightCurtain2_IO", PlcItemTypeDesc.X)),
|
|
|
|
|
|
NewValue = Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FeedingLiftingDrumLightCurtain2_IO", PlcItemTypeDesc.X))
|
|
|
|
|
|
});
|
|
|
|
|
|
EmergencySwitchLst.Add("DischargeLiftingDrumLightCurtain_IO", new ScramButtonControl
|
|
|
|
|
|
{
|
|
|
|
|
|
OldValue = !Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("DischargeLiftingDrumLightCurtain_IO", PlcItemTypeDesc.X)),
|
|
|
|
|
|
NewValue = !Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("DischargeLiftingDrumLightCurtain_IO", PlcItemTypeDesc.X))
|
|
|
|
|
|
});
|
|
|
|
|
|
EmergencySwitchLst.Add("CrashStop_IO", new ScramButtonControl
|
|
|
|
|
|
{
|
|
|
|
|
|
OldValue = Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CrashStop_IO", PlcItemTypeDesc.X)),
|
|
|
|
|
|
NewValue = Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CrashStop_IO", PlcItemTypeDesc.X))
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
((ScramButtonControl)EmergencySwitchLst["FeedingLiftingDrumLightCurtain2_IO"]).NewValue = Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FeedingLiftingDrumLightCurtain2_IO", PlcItemTypeDesc.X));
|
|
|
|
|
|
((ScramButtonControl)EmergencySwitchLst["DischargeLiftingDrumLightCurtain_IO"]).NewValue = !Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("DischargeLiftingDrumLightCurtain_IO", PlcItemTypeDesc.X));
|
|
|
|
|
|
((ScramButtonControl)EmergencySwitchLst["CrashStop_IO"]).NewValue = Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CrashStop_IO", PlcItemTypeDesc.X));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private bool GetScramButtonValue()
|
|
|
|
|
|
{
|
|
|
|
|
|
bool retVal = false;
|
|
|
|
|
|
foreach (ScramButtonControl item in EmergencySwitchLst.Values)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!item.OldValue && item.NewValue)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.OldValue = item.NewValue;
|
|
|
|
|
|
retVal = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
item.OldValue = item.NewValue;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return retVal;
|
|
|
|
|
|
}
|
|
|
|
|
|
private void ClearButtonBackColor()
|
|
|
|
|
|
{
|
|
|
|
|
|
Invoke(new Action(()=> {
|
|
|
|
|
|
#region 加载当前的手动变量状态数据
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FeedingInDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
ktb_FeedingStartMac.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
ktb_FeedingStartMac.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FeedingLiftingDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton11.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton11.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("DischargeInDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
ktb_DischargeInTrayStartMac.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
ktb_DischargeInTrayStartMac.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("DischargeOutDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton10.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton10.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("DischargeLiftingDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton12.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton12.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("BlockingSolenoidValve", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kbtn_BlockingSolenoidValve.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kbtn_BlockingSolenoidValve.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("PushingCylinderSolenoidValve", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kbt_PushPalletValve.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kbt_PushPalletValve.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMac1BrushMotor", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton2.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton2.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMac2BrushMotor", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton3.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton3.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMac3BrushMotor", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton4.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton4.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FranklinismStartOrStop", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton8.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton8.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMacInDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton5.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton5.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMacOutDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton6.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton6.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("NozzleSolenoidValve", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton7.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton7.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("VacuumingStartOrStop", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton9.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton9.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
}));
|
|
|
|
|
|
}
|
|
|
|
|
|
private void ThRunFunc()
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
while (Global.SysThIsRunFlag)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
InitData(true);
|
|
|
|
|
|
if (GetScramButtonValue())
|
|
|
|
|
|
{
|
|
|
|
|
|
ClearButtonBackColor();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
Thread.Sleep(50);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
//初始化用户参数信息
|
|
|
|
|
|
private void GetManualPlcItemVlaue()
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var item in kryptonGroupBox1.Panel.Controls)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (item is KryptonTextBox)
|
|
|
|
|
|
{
|
|
|
|
|
|
string plcItemCode = ((KryptonTextBox)item).Name.Replace("knud_", "");
|
|
|
|
|
|
if (((KryptonTextBox)item).Tag == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
((KryptonTextBox)item).Text = PlcOperationHelper.Instance.ReadPlcItem(plcItemCode, PlcItemTypeDesc.D).ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (((KryptonTextBox)item).Tag.ToString() == "time")
|
|
|
|
|
|
{
|
|
|
|
|
|
((KryptonTextBox)item).Text = (Convert.ToInt32(PlcOperationHelper.Instance.ReadPlcItem(plcItemCode, PlcItemTypeDesc.D)) / 10).ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
((KryptonTextBox)item).Text = (Convert.ToInt32(PlcOperationHelper.Instance.ReadPlcItem(plcItemCode, PlcItemTypeDesc.D)) / 100).ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region 加载当前的手动变量状态数据
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FeedingInDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
ktb_FeedingStartMac.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
ktb_FeedingStartMac.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FeedingLiftingDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton11.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton11.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("DischargeInDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
ktb_DischargeInTrayStartMac.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
ktb_DischargeInTrayStartMac.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("DischargeOutDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton10.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton10.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("DischargeLiftingDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton12.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton12.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("BlockingSolenoidValve", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kbtn_BlockingSolenoidValve.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kbtn_BlockingSolenoidValve.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("PushingCylinderSolenoidValve", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kbt_PushPalletValve.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kbt_PushPalletValve.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMac1BrushMotor", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton2.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton2.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMac2BrushMotor", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton3.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton3.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMac3BrushMotor", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton4.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton4.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FranklinismStartOrStop", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton8.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton8.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMacInDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton5.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton5.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMacOutDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton6.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton6.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("NozzleSolenoidValve", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton7.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton7.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("VacuumingStartOrStop", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton9.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
kryptonButton9.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
|
|
|
private void SyncFinishPalletData(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
Invoke(new Action(() => {
|
|
|
|
|
|
string text = sender as string;
|
|
|
|
|
|
knud_WorkedFullPalletNum.Text = text;
|
|
|
|
|
|
}));
|
|
|
|
|
|
}
|
|
|
|
|
|
//上料进滚筒频率 D412 别名:FeedingDrumFrequency
|
|
|
|
|
|
private void kbtn_FeedingDrumFrequency_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (Regex.IsMatch(ktb_FeedingDrumFrequency.Text.Trim(), "^([1-9][0-9]*)$"))
|
|
|
|
|
|
//{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FeedingDrumFrequency", (Convert.ToInt32(knud_FeedingDrumFrequency.Text) * 100).ToString(), PlcItemTypeDesc.D))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】修改上料进滚筒频率成功,修改值:【{knud_FeedingDrumFrequency.Text}】。操作模式:【手动】!", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show(" Please enter the correct number !");
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//清洁机出滚筒频率 D415 别名:CleanMacOutDrumFrequency
|
|
|
|
|
|
private void kbtn_CleanMacOutDrumFrequency_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (Regex.IsMatch(ktb_CleanMacOutDrumFrequency.Text.Trim(), "^([1-9][0-9]*)$"))
|
|
|
|
|
|
//{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("CleanMacOutDrumFrequency", (Convert.ToInt32(knud_CleanMacOutDrumFrequency.Text) * 100).ToString(), PlcItemTypeDesc.D))
|
|
|
|
|
|
{
|
|
|
|
|
|
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】修改清洁机出滚筒频率成功,修改值:【{knud_CleanMacOutDrumFrequency.Text}】!", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show(" Please enter the correct number !");
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//清洁机进滚筒频率 D414 CleanMacInDrumFrequency
|
|
|
|
|
|
private void kbtn_CleanMacInDrumFrequency_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (Regex.IsMatch(ktb_CleanMacInDrumFrequency.Text.Trim(), "^([1-9][0-9]*)$"))
|
|
|
|
|
|
//{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("CleanMacInDrumFrequency", (Convert.ToInt32(knud_CleanMacInDrumFrequency.Text) * 100).ToString(), PlcItemTypeDesc.D))
|
|
|
|
|
|
{
|
|
|
|
|
|
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】修改清洁机进滚筒频率成功,修改值:【{knud_CleanMacInDrumFrequency.Text}】。操作模式:【手动】!", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show(" Please enter the correct number !");
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//出料升降台滚筒频率 D417 别名:FrequencyOfDischargeLiftingDrum
|
|
|
|
|
|
private void kbtn_FrequencyOfDischargeLiftingDrum_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (Regex.IsMatch(ktb_FrequencyOfDischargeLiftingDrum.Text.Trim(), "^([1-9][0-9]*)$"))
|
|
|
|
|
|
//{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FrequencyOfDischargeLiftingDrum", (Convert.ToInt32(knud_FrequencyOfDischargeLiftingDrum.Text) * 100).ToString(), PlcItemTypeDesc.D))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】修改出料升降台滚筒频率成功,修改值:【{knud_FrequencyOfDischargeLiftingDrum.Text}】。操作模式:【手动】!", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show(" Please enter the correct number !");
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//上料升降台 滚筒频率 D413 别名: FrequencyOfFeedingLiftingDrum
|
|
|
|
|
|
private void kbtn_FrequencyOfFeedingLiftingDrum_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (Regex.IsMatch(ktb_FrequencyOfFeedingLiftingDrum.Text.Trim(), "^([1-9][0-9]*)$"))
|
|
|
|
|
|
//{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FrequencyOfFeedingLiftingDrum", (Convert.ToInt32(knud_FrequencyOfFeedingLiftingDrum.Text) * 100).ToString(), PlcItemTypeDesc.D))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】修改上料升降台滚筒频率成功,修改值:【{knud_FrequencyOfFeedingLiftingDrum.Text}】。操作模式:【手动】!", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show(" Please enter the correct number !");
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//出料出滚筒频率 D418 别名:DischargeOutDrumFrequency
|
|
|
|
|
|
private void kbtn_DischargeOutDrumFrequency_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (Regex.IsMatch(ktb_DischargeOutDrumFrequency.Text.Trim(), "^([1-9][0-9]*)$"))
|
|
|
|
|
|
//{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("DischargeOutDrumFrequency", (Convert.ToInt32(knud_DischargeOutDrumFrequency.Text) * 100).ToString(), PlcItemTypeDesc.D))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】修改出料出滚筒频率成功,修改值:【{knud_DischargeOutDrumFrequency.Text}】。操作模式:【手动】!", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show(" Please enter the correct number !");
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//出料进滚筒频率 D416 别名:DischargeDrumFrequency
|
|
|
|
|
|
private void kbtn_DischargeDrumFrequency_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (Regex.IsMatch(ktb_DischargeDrumFrequency.Text.Trim(), "^([1-9][0-9]*)$"))
|
|
|
|
|
|
//{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("DischargeDrumFrequency", (Convert.ToInt32(knud_DischargeDrumFrequency.Text) * 100).ToString(), PlcItemTypeDesc.D))
|
|
|
|
|
|
{
|
|
|
|
|
|
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】修改出料进滚筒频率成功,修改值:【{knud_DischargeDrumFrequency.Text}】。操作模式:【手动】!", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show(" Please enter the correct number !");
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//上料升降台上升操控 M218 按1松0 别名:FeedingLiftingDrumRise
|
|
|
|
|
|
private void kbtn_FeedingLiftingDrumRise_MouseDown(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (ReadScramButtonValue())
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show("When the emergency stop button is pressed, PLC data cannot be written at this time.");
|
|
|
|
|
|
// return;
|
|
|
|
|
|
//}
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FeedingLiftingDrumRise", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC上料升降台上升信号成功。操作模式:【手动】!", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//上料升降台上升操控 按1松0
|
|
|
|
|
|
private void kbtn_FeedingLiftingDrumRise_MouseUp(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
//if (ReadScramButtonValue())
|
|
|
|
|
|
//{
|
|
|
|
|
|
// return;
|
|
|
|
|
|
//}
|
|
|
|
|
|
PlcOperationHelper.Instance.WritePlcItem("FeedingLiftingDrumRise", "False", PlcItemTypeDesc.M);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//喷头超时参数设置 D410 别名:NozzleDelayedCloseTime
|
|
|
|
|
|
private void kbtn_NozzleDelayedCloseTime_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//try
|
|
|
|
|
|
//{
|
|
|
|
|
|
// if (!PlcOperationHelper.Instance.isConn)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
// return;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (PlcOperationHelper.Instance.WritePlcItem("NozzleDelayedCloseTime", (Convert.ToInt32(knud_NozzleDelayedCloseTime.Text) * 10).ToString(), PlcItemTypeDesc.D))
|
|
|
|
|
|
// {
|
|
|
|
|
|
// LogHelper.WriteLog($"用户:【{GlobalHelper.UserInfo.USER_NAME}】修改喷头延迟时间成功,修改值:【{knud_NozzleDelayedCloseTime.Text}】。操作模式:【手动】。操作模式:【手动】!", LogTypeEum.Run);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//}
|
|
|
|
|
|
//catch (Exception ex)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
//}
|
|
|
|
|
|
//kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//滚筒超时时间参数设置 D411 别名:DrumTimeOut
|
|
|
|
|
|
private void kbtn_DrumTimeOut_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (Regex.IsMatch(ktb_DrumTimeOut.Text.Trim(), "^([1-9][0-9]*)$"))
|
|
|
|
|
|
//{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("DrumTimeOut", (Convert.ToInt32(knud_DrumTimeOut.Text) * 10).ToString(), PlcItemTypeDesc.D))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】修改滚筒超时时间戳成功,修改值:【{knud_DrumTimeOut.Text}】。操作模式:【手动】!", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show(" Please enter the correct number !");
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//出料台滚筒超时参数设置 D424 别名:DischargeLiftingDrumTime
|
|
|
|
|
|
private void kbtn_DisChargeLiftingTime_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (Regex.IsMatch(ktb_DischargeLiftingDrumTime.Text.Trim(), "^([1-9][0-9]*)$"))
|
|
|
|
|
|
//{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("DischargeLiftingDrumTime", (Convert.ToInt32(knud_DischargeLiftingDrumTime.Text) * 10).ToString(), PlcItemTypeDesc.D))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】修改出料升降台滚筒超时时间成功,修改值:【{knud_DischargeLiftingDrumTime.Text}】。操作模式:【手动】!", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show(" Please enter the correct number !");
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//托盘满料数量参数设置 D422 别名:WorkedFullPalletNum
|
|
|
|
|
|
private void kbtn_WorkedPalletNum_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (Regex.IsMatch(ktb_WorkedFullPalletNum.Text.Trim(), "^([1-9][0-9]*)$"))
|
|
|
|
|
|
//{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("WorkedFullPalletNum", knud_WorkedFullPalletNum.Text, PlcItemTypeDesc.D))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
Global.SyncFinishPalletData(knud_WorkedFullPalletNum.Text, EventArgs.Empty);
|
|
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】修改满托数量成功,修改值:【{knud_WorkedFullPalletNum.Text}】。操作模式:【手动】!", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show(" Please enter the correct number !");
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//启动按钮操作
|
|
|
|
|
|
private void cbt_StartTran_MouseDown(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("StartSys", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
PlcOperationHelper.Instance.WritePlcItem("StartSys", "True", PlcItemTypeDesc.M);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void cbt_StartTran_MouseUp(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
PlcOperationHelper.Instance.WritePlcItem("StartSys", "False", PlcItemTypeDesc.M);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//停止按钮操作
|
|
|
|
|
|
private void cbt_StopTran_MouseDown(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("StopSys", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
PlcOperationHelper.Instance.WritePlcItem("StopSys", "True", PlcItemTypeDesc.M);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void cbt_StopTran_MouseUp(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
PlcOperationHelper.Instance.WritePlcItem("StopSys", "False", PlcItemTypeDesc.M);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//强制满料操控
|
|
|
|
|
|
private void kbtn_forceFinish_MouseDown(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void kbtn_forceFinish_MouseUp(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//上料进滚筒操控 M207 交替 别名:FeedingInDrum
|
|
|
|
|
|
private void ktb_FeedingStartMac_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (ReadScramButtonValue())
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show("When the emergency stop button is pressed, PLC data cannot be written at this time.");
|
|
|
|
|
|
// return;
|
|
|
|
|
|
//}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FeedingInDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FeedingInDrum", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC上料进滚筒正转运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
ktb_FeedingStartMac.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
kryptonButton15.Enabled = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FeedingInDrum", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC上料进滚筒正转停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
ktb_FeedingStartMac.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
kryptonButton15.Enabled = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//上料升降台滚筒操控 M208 交替 别名 FeedingLiftingDrum
|
|
|
|
|
|
private void kryptonButton11_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FeedingLiftingDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FeedingLiftingDrum", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC上料升降滚筒正转运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton11.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
kryptonButton14.Enabled = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FeedingLiftingDrum", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC上料升降滚筒正转停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton11.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
kryptonButton14.Enabled = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//出料进滚筒操控 M209 交替 别名 DischargeInDrum
|
|
|
|
|
|
private void ktb_DischargeInTrayStartMac_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("DischargeInDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("DischargeInDrum", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC出料进滚筒运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
ktb_DischargeInTrayStartMac.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("DischargeInDrum", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC出料进滚筒停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
ktb_DischargeInTrayStartMac.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//出料出滚筒操控 M210 交替 别名 DischargeOutDrum
|
|
|
|
|
|
private void kryptonButton10_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("DischargeOutDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("DischargeOutDrum", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC出料出滚筒运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton10.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("DischargeOutDrum", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC出料出滚筒停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton10.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//挡料气缸操控 M213 交替 别名:BlockingSolenoidValve
|
|
|
|
|
|
private void kbtn_BlockingSolenoidValve_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("BlockingSolenoidValve", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("BlockingSolenoidValve", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC挡料气缸运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kbtn_BlockingSolenoidValve.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("BlockingSolenoidValve", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC挡料气缸停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kbtn_BlockingSolenoidValve.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//推料气缸操控 M234 交替 别名:PushingCylinderSolenoidValve
|
|
|
|
|
|
private void kbt_PushPalletValve_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("PushingCylinderSolenoidValve", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("PushingCylinderSolenoidValve", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC推料气缸运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kbt_PushPalletValve.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("PushingCylinderSolenoidValve", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC推料气缸停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kbt_PushPalletValve.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//出料升降台滚筒操控 M211 交替 别名:DischargeLiftingDrum
|
|
|
|
|
|
private void kryptonButton12_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("DischargeLiftingDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("DischargeLiftingDrum", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC出料升降滚筒运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton12.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("DischargeLiftingDrum", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC出料升降滚筒停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton12.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//清洁头1操控 M215 交替 别名:CleanMac1BrushMotor
|
|
|
|
|
|
private void kryptonButton2_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMac1BrushMotor", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("CleanMac1BrushMotor", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC清洁机毛刷1运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton2.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("CleanMac1BrushMotor", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC清洁机毛刷1停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton2.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//清洁头2操控 M216 交替 别名:CleanMac2BrushMotor
|
|
|
|
|
|
private void kryptonButton3_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMac2BrushMotor", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("CleanMac2BrushMotor", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC清洁机毛刷2运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton3.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("CleanMac2BrushMotor", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC清洁机毛刷2停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton3.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//清洁头3操控 M217 交替 别名:CleanMac3BrushMotor
|
|
|
|
|
|
private void kryptonButton4_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMac3BrushMotor", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("CleanMac3BrushMotor", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC清洁机毛刷3运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton4.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("CleanMac3BrushMotor", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC清洁机毛刷3停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton4.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//喷头操控 M212 交替 别名:NozzleSolenoidValve
|
|
|
|
|
|
private void kryptonButton7_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("NozzleSolenoidValve", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("NozzleSolenoidValve", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC清洁喷头运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton7.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("NozzleSolenoidValve", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC清洁喷头停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton7.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//静电棒操控 M222 交替 别名:FranklinismStartOrStop
|
|
|
|
|
|
private void kryptonButton8_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FranklinismStartOrStop", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FranklinismStartOrStop", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC静电启停 运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton8.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FranklinismStartOrStop", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC静电启停 停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton8.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//吸尘操控 M214 交替 别名:VacuumingStartOrStop
|
|
|
|
|
|
private void kryptonButton9_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("VacuumingStartOrStop", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("VacuumingStartOrStop", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC吸尘电机运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton9.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("VacuumingStartOrStop", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC吸尘电机停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton9.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//清洁进料滚筒操控 M205 交替 别名:CleanMacInDrum
|
|
|
|
|
|
private void kryptonButton5_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMacInDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("CleanMacInDrum", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC清洁机进料运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton5.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("CleanMacInDrum", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC清洁机进料停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton5.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//清洁出料滚筒操控 M206 交替 别名:CleanMacOutDrum
|
|
|
|
|
|
private void kryptonButton6_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMacOutDrum", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("CleanMacOutDrum", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC清洁机出料运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton6.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("CleanMacOutDrum", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC清洁机出料停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton6.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//满料延迟时间设定 D425 别名:FullPalletDelayTime
|
|
|
|
|
|
private void kryptonButton1_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (Regex.IsMatch(ktb_WorkedFullPalletNum.Text.Trim(), "^([1-9][0-9]*)$"))
|
|
|
|
|
|
//{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FullPalletDelayTime", (Convert.ToInt32(knud_FullPalletDelayTime.Text) * 10).ToString(), PlcItemTypeDesc.D))
|
|
|
|
|
|
{
|
|
|
|
|
|
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】修改满料延时时间成功,修改值:【{knud_FullPalletDelayTime.Text}】。操作模式:【手动】!", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
//}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show(" Please enter the correct number !");
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void kbtn_forceFinish_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
PlcOperationHelper.Instance.WritePlcItem("FinishWorkingPallet", "True", PlcItemTypeDesc.M);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//B段升降台 下降操控 M220 按1松0 别名 FeedingLiftingDrumDecline
|
|
|
|
|
|
private void kbtn_FeedingLiftingDrumDecline_MouseDown(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FeedingLiftingDrumDecline", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC上料升降台下降信号成功。操作模式:【手动】!", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//B段升降台 下降操控 按1松0
|
|
|
|
|
|
private void kbtn_FeedingLiftingDrumDecline_MouseUp(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
PlcOperationHelper.Instance.WritePlcItem("FeedingLiftingDrumDecline", "False", PlcItemTypeDesc.M);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//E段 出料升降台 上升 M219 按1松0 别名 DischargeLiftingDrumRise
|
|
|
|
|
|
private void kbtn_DischargeLiftingDrumRise_MouseDown(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("DischargeLiftingDrumRise", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC出料升降台上升信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//出料台 上升 按1松0
|
|
|
|
|
|
private void kbtn_DischargeLiftingDrumRise_MouseUp(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
PlcOperationHelper.Instance.WritePlcItem("DischargeLiftingDrumRise", "False", PlcItemTypeDesc.M);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//出料台下降操控 M221 按1松0 别名 DischargeLiftingDrumDecline
|
|
|
|
|
|
private void kbtn_DischargeLiftingDrumDecline_MouseDown(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("DischargeLiftingDrumDecline", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC出料升降台下降信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//出料台下降操控 按1松0
|
|
|
|
|
|
private void kbtn_DischargeLiftingDrumDecline_MouseUp(object sender, MouseEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
PlcOperationHelper.Instance.WritePlcItem("DischargeLiftingDrumDecline", "False", PlcItemTypeDesc.M);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void kryptonButton13_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("NozzleNum", "0", PlcItemTypeDesc.D))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC计数清零信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void ktb_FeedingDrumFrequency_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//KryptonMessageBox.Show("test");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ktb_DischargeLiftingDrumTime_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
//KryptonMessageBox.Show("test");
|
|
|
|
|
|
}
|
|
|
|
|
|
private void txt_GotFocus(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
KeyboardAutoPopUp.ShowInputPanel();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void txt_LostFocus(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
KeyboardAutoPopUp.HideInputPanel();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void InitControlEvent()
|
|
|
|
|
|
{
|
|
|
|
|
|
knud_FeedingDrumFrequency.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
|
|
|
|
|
knud_FeedingDrumFrequency.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
|
|
|
|
|
|
|
|
|
|
|
knud_DischargeLiftingDrumTime.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
|
|
|
|
|
knud_DischargeLiftingDrumTime.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
|
|
|
|
|
|
|
|
|
|
|
knud_FrequencyOfFeedingLiftingDrum.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
|
|
|
|
|
knud_FrequencyOfFeedingLiftingDrum.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
|
|
|
|
|
|
|
|
|
|
|
knud_DrumTimeOut.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
|
|
|
|
|
knud_DrumTimeOut.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
|
|
|
|
|
|
|
|
|
|
|
knud_CleanMacInDrumFrequency.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
|
|
|
|
|
knud_CleanMacInDrumFrequency.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
|
|
|
|
|
|
|
|
|
|
|
knud_AlarmDelayedTime.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
|
|
|
|
|
knud_AlarmDelayedTime.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
|
|
|
|
|
|
|
|
|
|
|
knud_CleanMacOutDrumFrequency.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
|
|
|
|
|
knud_CleanMacOutDrumFrequency.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
|
|
|
|
|
|
|
|
|
|
|
knud_FullPalletDelayTime.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
|
|
|
|
|
knud_FullPalletDelayTime.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
|
|
|
|
|
|
|
|
|
|
|
knud_DischargeDrumFrequency.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
|
|
|
|
|
knud_DischargeDrumFrequency.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
|
|
|
|
|
|
|
|
|
|
|
knud_WorkedFullPalletNum.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
|
|
|
|
|
knud_WorkedFullPalletNum.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
|
|
|
|
|
|
|
|
|
|
|
knud_DischargeOutDrumFrequency.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
|
|
|
|
|
knud_DischargeOutDrumFrequency.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
|
|
|
|
|
|
|
|
|
|
|
knud_FrequencyOfDischargeLiftingDrum.GotFocus += new EventHandler(txt_GotFocus); //获取焦点前发生事件
|
|
|
|
|
|
knud_FrequencyOfDischargeLiftingDrum.LostFocus += new EventHandler(txt_LostFocus); //失去焦点后发生事件
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void knud_FrequencyOfDischargeLiftingDrum_KeyPress(object sender, KeyPressEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (e.KeyChar != '\b')//这是允许输入退格键
|
|
|
|
|
|
{
|
|
|
|
|
|
if ((e.KeyChar < '0') || (e.KeyChar > '9'))//这是允许输入0-9数字
|
|
|
|
|
|
{
|
|
|
|
|
|
e.Handled = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void kryptonButton15_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//if (ReadScramButtonValue())
|
|
|
|
|
|
//{
|
|
|
|
|
|
// KryptonMessageBox.Show("When the emergency stop button is pressed, PLC data cannot be written at this time.");
|
|
|
|
|
|
// return;
|
|
|
|
|
|
//}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FeedingDrumARollback", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FeedingDrumARollback", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC上料进滚筒反转运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton15.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
ktb_FeedingStartMac.Enabled = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FeedingDrumARollback", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC上料进滚筒反转停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton15.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
ktb_FeedingStartMac.Enabled = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void kryptonButton14_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
//根据当运行前状态,做相反的指令控制
|
|
|
|
|
|
if (!Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("FeedingLiftingDrumBRollback", PlcItemTypeDesc.M)))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FeedingLiftingDrumBRollback", "True", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC上料升降滚筒正转运行信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton14.StateCommon.Back.Color1 = Color.Lime;
|
|
|
|
|
|
kryptonButton11.Enabled = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("FeedingLiftingDrumBRollback", "False", PlcItemTypeDesc.M))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】发送PLC上料升降滚筒正转停止信号成功!操作模式:【手动】", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
kryptonButton14.StateCommon.Back.Color1 = Color.Empty;
|
|
|
|
|
|
kryptonButton11.Enabled = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void kbtn_AlarmDelayTime_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2022-05-17 09:25:44 +08:00
|
|
|
|
if (!PlcOperationHelper.Instance.IsConn)
|
2021-06-05 14:17:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show("The PLC is disconnected and unable to operate the equipment.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (PlcOperationHelper.Instance.WritePlcItem("AlarmDelayedTime", (Convert.ToInt32(knud_AlarmDelayedTime.Text) * 10).ToString(), PlcItemTypeDesc.D))
|
|
|
|
|
|
{
|
2022-05-06 12:28:16 +08:00
|
|
|
|
LogHelper.WriteLog($"用户:【{Global.UserInfo.UserName}】修改报警延迟时间成功,修改值:【{knud_AlarmDelayedTime.Text}】。操作模式:【手动】。操作模式:【手动】!", LogTypeEum.Run);
|
2021-06-05 14:17:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
KryptonMessageBox.Show(ex.Message);
|
|
|
|
|
|
}
|
|
|
|
|
|
kryptonGroupBox3.Focus();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class ScramButtonControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public bool OldValue { get; set; }
|
|
|
|
|
|
public bool NewValue { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|