Commit 8213bfe8 张东亮

门禁暂停以及回原限制

1 个父辈 bbfb0f3f
...@@ -16,6 +16,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,6 +16,9 @@ namespace OnlineStore.DeviceLibrary
public abstract class EquipBase : DeviceBase public abstract class EquipBase : DeviceBase
{ {
public bool IsDebug = false; public bool IsDebug = false;
/// <summary>
/// 暂停运动
/// </summary>
public bool MoveStop = false; public bool MoveStop = false;
protected int TimerMaxSeconds = 3; protected int TimerMaxSeconds = 3;
public bool AxisAlarmFlag = false;//轴报警异常标识 public bool AxisAlarmFlag = false;//轴报警异常标识
...@@ -529,16 +532,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -529,16 +532,7 @@ namespace OnlineStore.DeviceLibrary
{ {
yellowMove = true; yellowMove = true;
} }
if (isInSuddenDown || isNoAirpressure_Check || alarmType >= alarmRedLedType) if (isInSuddenDown || isNoAirpressure_Check || alarmType >= alarmRedLedType|| MoveStop)
{
isNeedAlarmLed = true;
}
else if (alarmType.Equals(AlarmType.None).Equals(false))
{
yellowMove = true;
}
if (isNoAirpressure_Check || isInSuddenDown || alarmType >= alarmRedLedType)
{ {
isNeedAlarmLed = true; isNeedAlarmLed = true;
} }
......
...@@ -1173,10 +1173,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -1173,10 +1173,10 @@ namespace OnlineStore.DeviceLibrary
return; return;
} }
LogUtil.info($"{Name} {doorname}被打开,停止当前运动{MoveInfo.MoveType},MoveStop={MoveStop},报警急停"); LogUtil.info($"{Name} {doorname}被打开,停止当前运动{MoveInfo.MoveType},MoveStop={MoveStop}");
SetWarnMsg($"{doorname}被打开,报警急停"); SetWarnMsg($"{doorname}被打开,暂停运动");
Alarm(AlarmType.SuddenStop); //Alarm(AlarmType.SuddenStop);
MoveStop = true;
} }
private void SecurityAccessReset() private void SecurityAccessReset()
...@@ -1194,7 +1194,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1194,7 +1194,7 @@ namespace OnlineStore.DeviceLibrary
return; return;
} }
CurrSecurityAccess = 0; CurrSecurityAccess = 0;
MoveStop = false; //MoveStop = false;
if (alarmType > (AlarmType.IoSingleTimeOut)) if (alarmType > (AlarmType.IoSingleTimeOut))
{ {
......
...@@ -219,6 +219,10 @@ namespace OnlineStore.XLRStore ...@@ -219,6 +219,10 @@ namespace OnlineStore.XLRStore
{ {
FormStatus(true); FormStatus(true);
} }
if (boxBean.MoveStop != chbMoveStop.Checked)
{
chbMoveStop.Checked = boxBean.MoveStop;
}
} }
else else
{ {
......
...@@ -124,13 +124,77 @@ namespace OnlineStore.XLRStore ...@@ -124,13 +124,77 @@ namespace OnlineStore.XLRStore
{ {
if (currSelAxis != null) if (currSelAxis != null)
{ {
if (!CanHome(currSelAxis)) return;
//int speed = FormUtil.GetIntValue(txtASpeed); //int speed = FormUtil.GetIntValue(txtASpeed);
int speed = currSelAxis.HomeHighSpeed; int speed = currSelAxis.HomeHighSpeed;
LogUtil.info(equipBase.Name + "界面点击【原点返回】,【" + PortName + "_" + SlvAddr + "】 速度【" + speed + "】"); LogUtil.info(equipBase.Name + "界面点击【原点返回】,【" + PortName + "_" + SlvAddr + "】 速度【" + speed + "】");
AxisManager.instance.HomeMove(PortName, SlvAddr, speed,currSelAxis.HomeLowSpeed,currSelAxis.HomeAddSpeed); 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) private void btnReadPosition_Click(object sender, EventArgs e)
{ {
txtAxisPosition.Text = AxisManager.instance.GetActualtPosition(PortName, SlvAddr).ToString(); txtAxisPosition.Text = AxisManager.instance.GetActualtPosition(PortName, SlvAddr).ToString();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!