Commit b988774b LN

安全门禁功能修改

1 个父辈 85534731
......@@ -100,6 +100,7 @@
this.btnMoveto = new System.Windows.Forms.Button();
this.txtSizePosition = new System.Windows.Forms.TextBox();
this.btnScan = new System.Windows.Forms.Button();
this.chbUse = new System.Windows.Forms.CheckBox();
this.panBase.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox4.SuspendLayout();
......@@ -118,6 +119,7 @@
//
// panBase
//
this.panBase.Controls.Add(this.chbUse);
this.panBase.Controls.Add(this.btnScan);
this.panBase.Size = new System.Drawing.Size(996, 50);
this.panBase.Controls.SetChildIndex(this.chbMoveStop, 0);
......@@ -130,6 +132,7 @@
this.panBase.Controls.SetChildIndex(this.lblName, 0);
this.panBase.Controls.SetChildIndex(this.btnExit, 0);
this.panBase.Controls.SetChildIndex(this.chbDebug, 0);
this.panBase.Controls.SetChildIndex(this.chbUse, 0);
//
// btnExit
//
......@@ -137,12 +140,12 @@
//
// chbDebug
//
this.chbDebug.Location = new System.Drawing.Point(461, 12);
this.chbDebug.Location = new System.Drawing.Point(461, 13);
this.chbDebug.CheckedChanged += new System.EventHandler(this.chbDebug_CheckedChanged);
//
// lblStoreStatus
//
this.lblStoreStatus.Location = new System.Drawing.Point(639, 14);
this.lblStoreStatus.Location = new System.Drawing.Point(734, 15);
//
// btnOutStore
//
......@@ -155,6 +158,7 @@
//
// btnInStore
//
this.btnInStore.Location = new System.Drawing.Point(456, 5);
this.btnInStore.Visible = false;
//
// btnStop
......@@ -163,7 +167,7 @@
//
// chbMoveStop
//
this.chbMoveStop.Location = new System.Drawing.Point(550, 12);
this.chbMoveStop.Location = new System.Drawing.Point(547, 13);
this.chbMoveStop.CheckedChanged += new System.EventHandler(this.chbMoveStop_CheckedChanged);
//
// timer1
......@@ -1276,6 +1280,17 @@
this.btnScan.UseVisualStyleBackColor = false;
this.btnScan.Click += new System.EventHandler(this.btnScan_Click);
//
// chbUse
//
this.chbUse.AutoSize = true;
this.chbUse.Location = new System.Drawing.Point(633, 15);
this.chbUse.Name = "chbUse";
this.chbUse.Size = new System.Drawing.Size(99, 21);
this.chbUse.TabIndex = 263;
this.chbUse.Text = "启用安全门禁";
this.chbUse.UseVisualStyleBackColor = true;
this.chbUse.CheckedChanged += new System.EventHandler(this.chbUse_CheckedChanged);
//
// FrmFeedingEquip
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
......@@ -1403,6 +1418,7 @@
private useControl.ClampJawControl clampJawControl1;
private System.Windows.Forms.Button btnHlhasReel;
private System.Windows.Forms.CheckBox chbPointEdit;
private System.Windows.Forms.CheckBox chbUse;
}
}
......@@ -270,6 +270,7 @@ namespace OnlineStore.AssemblyLine
lblTargetP3.Text = "目标P3:" + equipBean.Config.BatchAxisP3 ;
lblTestMsg.Text = "";
TargetP3 = equipBean.Config.BatchAxisP3;
chbUse.Checked = equipBean.UseSecurityAccess;
PointEdit(false );
IsLoad = true;
......@@ -911,6 +912,17 @@ namespace OnlineStore.AssemblyLine
}
chbPointEdit.Checked = false;
}
private void chbUse_CheckedChanged(object sender, EventArgs e)
{
if (!IsLoad)
{
return;
}
equipBean.UseSecurityAccess = chbUse.Checked;
LogUtil.info(equipBean.Name + "用户切换是否启用安全门禁: " + equipBean.UseSecurityAccess);
}
}
}
......
......@@ -13,6 +13,7 @@ namespace OnlineStore.DeviceLibrary
{
public abstract class EquipBase : KTK_Store
{
public bool UseSecurityAccess = true;
public bool OnlyProOutTray = false;
public ClampJawBean ClampJwa = null;
public bool MoveStop = false;
......@@ -852,7 +853,7 @@ namespace OnlineStore.DeviceLibrary
return;
}
if (CurrSecurityAccess.Equals(0) && LineManager.UseSecurityAccess)
if (CurrSecurityAccess.Equals(0) && LineManager.UseSecurityAccess && UseSecurityAccess)
{
if (IOValue(IO_Type.SecurityAccess).Equals(IO_VALUE.LOW))
{
......@@ -897,12 +898,21 @@ namespace OnlineStore.DeviceLibrary
{
if (MoveInfo.MoveType.Equals(LineMoveType.None))
{
LogUtil.info($"{Name }安全门禁 { di.Explain} 被打开,停止当前运动{MoveInfo.MoveType},MoveStop={MoveStop},报警急停");
SetWarnMsg("安全门禁被打开,报警急停");
Alarm(LineAlarmType.SuddenStop);
MoveStop = true;
string msg = "";
if (UseAxis)
{
UpdownAxis.SuddenStop();
msg += $"停止轴{UpdownAxis.Config.Explain};";
}
SetWarnMsg("安全门禁被打开,暂停运动");
LogUtil.info($"{Name }安全门禁 { di.Explain} 被打开,暂停运动,MoveStop={MoveStop},{msg},稍后复位");
//LogUtil.info($"{Name }安全门禁 { di.Explain} 被打开,停止当前运动{MoveInfo.MoveType},MoveStop={MoveStop},报警急停");
//SetWarnMsg("安全门禁被打开,报警急停");
//Alarm(LineAlarmType.SuddenStop);
}
else
{
{
MoveStop = true;
LogUtil.info($"{Name }安全门禁 { di.Explain} 被打开,停止当前运动{MoveInfo.MoveType},MoveStop={MoveStop},稍后复位");
SetWarnMsg("安全门禁被打开,暂停当前运动");
......@@ -920,7 +930,7 @@ namespace OnlineStore.DeviceLibrary
msg += $"停止轴{UpdownAxis.Config.Explain};";
}
LogUtil.info($"{Name }安全门禁 { di.Explain} 被打开,停止当前运动{MoveInfo.MoveType},{MoveInfo.MoveStep},{msg},稍后复位");
}
}
}
}
......@@ -941,8 +951,12 @@ namespace OnlineStore.DeviceLibrary
if (baseConfig.DType.Equals(DeviceType.MoveEquip))
{
LogUtil.info($"{Name }安全门禁 { di.Explain} 已关闭,恢复当前运动{MoveInfo.MoveType},MoveStop={MoveStop}");
if (MoveInfo.MoveType.Equals(LineMoveType.InStore) || MoveInfo.MoveType.Equals(LineMoveType.OutStore))
if (WarnMsg.Contains("安全门禁被打开,暂停"))
{
SetWarnMsg("");
}
if (!MoveInfo.MoveType.Equals(LineMoveType.None))
{
string msg = "";
Dictionary<string, IO_VALUE> values = MoveInfo.WriteDoMap;
foreach (string key in values.Keys)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!