Commit 8213bfe8 张东亮

门禁暂停以及回原限制

1 个父辈 bbfb0f3f
......@@ -16,6 +16,9 @@ namespace OnlineStore.DeviceLibrary
public abstract class EquipBase : DeviceBase
{
public bool IsDebug = false;
/// <summary>
/// 暂停运动
/// </summary>
public bool MoveStop = false;
protected int TimerMaxSeconds = 3;
public bool AxisAlarmFlag = false;//轴报警异常标识
......@@ -529,16 +532,7 @@ namespace OnlineStore.DeviceLibrary
{
yellowMove = true;
}
if (isInSuddenDown || isNoAirpressure_Check || alarmType >= alarmRedLedType)
{
isNeedAlarmLed = true;
}
else if (alarmType.Equals(AlarmType.None).Equals(false))
{
yellowMove = true;
}
if (isNoAirpressure_Check || isInSuddenDown || alarmType >= alarmRedLedType)
if (isInSuddenDown || isNoAirpressure_Check || alarmType >= alarmRedLedType|| MoveStop)
{
isNeedAlarmLed = true;
}
......
......@@ -1173,10 +1173,10 @@ namespace OnlineStore.DeviceLibrary
return;
}
LogUtil.info($"{Name} {doorname}被打开,停止当前运动{MoveInfo.MoveType},MoveStop={MoveStop},报警急停");
SetWarnMsg($"{doorname}被打开,报警急停");
Alarm(AlarmType.SuddenStop);
LogUtil.info($"{Name} {doorname}被打开,停止当前运动{MoveInfo.MoveType},MoveStop={MoveStop}");
SetWarnMsg($"{doorname}被打开,暂停运动");
//Alarm(AlarmType.SuddenStop);
MoveStop = true;
}
private void SecurityAccessReset()
......@@ -1194,7 +1194,7 @@ namespace OnlineStore.DeviceLibrary
return;
}
CurrSecurityAccess = 0;
MoveStop = false;
//MoveStop = false;
if (alarmType > (AlarmType.IoSingleTimeOut))
{
......
......@@ -219,6 +219,10 @@ namespace OnlineStore.XLRStore
{
FormStatus(true);
}
if (boxBean.MoveStop != chbMoveStop.Checked)
{
chbMoveStop.Checked = boxBean.MoveStop;
}
}
else
{
......
......@@ -124,13 +124,77 @@ namespace OnlineStore.XLRStore
{
if (currSelAxis != null)
{
if (!CanHome(currSelAxis)) return;
//int speed = FormUtil.GetIntValue(txtASpeed);
int speed = currSelAxis.HomeHighSpeed;
LogUtil.info(equipBase.Name + "界面点击【原点返回】,【" + PortName + "_" + SlvAddr + "】 速度【" + speed + "】");
AxisManager.instance.HomeMove(PortName, SlvAddr, speed,currSelAxis.HomeLowSpeed,currSelAxis.HomeAddSpeed);
}
}
bool CanHome(ConfigMoveAxis moveAxis)
{
switch (moveAxis.Explain)
{
case "行走机构":
if (!IsInHome(axisList[1]))
{
MessageBox.Show("料斗拉取进出轴未在原点,不允许回原");
return false;
}
if (!IsInHome(axisList[2]))
{
MessageBox.Show("移栽升降轴未在原点,不允许回原");
return false;
}
if (!IsInHome(axisList[6]))
{
MessageBox.Show("料斗拉取升降轴未在原点,不允许回原");
return false;
}
break;
case "移栽升降轴":
if(!moveAxisInSafe())
{
MessageBox.Show("行走机构未在安全位置(小于安全位置或正极限信号亮),不允许回原");
return false;
}
if (!IsInHome(axisList[6]))
{
MessageBox.Show("料斗拉取升降轴未在原点,不允许回原");
return false;
}
break;
case "料斗拉取升降轴":
if (!moveAxisInSafe())
{
MessageBox.Show("行走机构未在安全位置(小于安全位置或正极限信号亮),不允许回原");
return false;
}
if (!IsInHome(axisList[1]))
{
MessageBox.Show("料斗拉取进出轴未在原点,不允许回原");
return false;
}
break;
}
return true;
}
bool moveAxisInSafe()
{
string portName = PortName = axisList[0].Config.DeviceName;
short slvAddr = axisList[0].Config.GetAxisValue();
bool posSig=AxisManager.instance.GetLimitPositiveSingle(portName, slvAddr).Equals(1);
bool safePos=AxisManager.instance.GetActualtPosition(portName, slvAddr) >= StoreManager.XLRStore.boxEquip.Config.MoveAxis_SafePos;
if (!posSig && safePos)
return true;
return false;
}
bool IsInHome(AxisBean axisBean)
{
string portName= PortName = axisBean.Config.DeviceName;
short slvAddr = axisBean.Config.GetAxisValue();
return AxisManager.instance.GetHomeSingle(portName, slvAddr).Equals(1);
}
private void btnReadPosition_Click(object sender, EventArgs e)
{
txtAxisPosition.Text = AxisManager.instance.GetActualtPosition(PortName, SlvAddr).ToString();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!