Commit 52a58a0b 张东亮

光栅暂停功能添加

1 个父辈 ffd8084d
...@@ -37,7 +37,6 @@ namespace OnlineStore.CarriageClient ...@@ -37,7 +37,6 @@ namespace OnlineStore.CarriageClient
} }
private void FrmStoreIOStatus_Load(object sender, EventArgs e) private void FrmStoreIOStatus_Load(object sender, EventArgs e)
{ {
chbMoveStop.Checked = robotEquip.MoveStop;
lblStoreStatus.Text = DeviceBase.GetRunStr(robotEquip.runStatus); lblStoreStatus.Text = DeviceBase.GetRunStr(robotEquip.runStatus);
lblThisSta.Text = robotEquip.WarnMsg; lblThisSta.Text = robotEquip.WarnMsg;
...@@ -203,10 +202,6 @@ namespace OnlineStore.CarriageClient ...@@ -203,10 +202,6 @@ namespace OnlineStore.CarriageClient
{ {
try try
{ {
if (!this.Visible)
{
return;
}
ReadIOList(); ReadIOList();
//ReadBtnDO(); //ReadBtnDO();
// clampJawControl1.UpdateSta(); // clampJawControl1.UpdateSta();
...@@ -217,6 +212,16 @@ namespace OnlineStore.CarriageClient ...@@ -217,6 +212,16 @@ namespace OnlineStore.CarriageClient
{ {
FormStatus(true); FormStatus(true);
} }
if (robotEquip.MoveStop)
{
btnMoveStop.Text = "恢复运动";
btnMoveStop.BackColor = Color.Green;
}
else
{
btnMoveStop.Text = "暂停运动";
btnMoveStop.BackColor = Color.Yellow;
}
} }
else else
{ {
...@@ -240,7 +245,7 @@ namespace OnlineStore.CarriageClient ...@@ -240,7 +245,7 @@ namespace OnlineStore.CarriageClient
{ {
lblInoutInfo.Text = ""; lblInoutInfo.Text = "";
} }
lblrobotTaskInfo.Text =$"{SServerManager.RobotTaskInfo}\r\n{SServerManager.BoxDoorStatus}" ; lblrobotTaskInfo.Text = $"{SServerManager.RobotTaskInfo}\r\n{SServerManager.BoxDoorStatus}";
lblMoveInfo.Text = robotEquip.GetMoveStr();//+ "料仓类型:" + (boxBean.Config.IsBigTray.Equals(1) ? "大料盘" : "小料盘"); lblMoveInfo.Text = robotEquip.GetMoveStr();//+ "料仓类型:" + (boxBean.Config.IsBigTray.Equals(1) ? "大料盘" : "小料盘");
//string canOut = boxBean.CanOutStore(boxBean.DeviceID) ? "可出库" : "不可出库"; //string canOut = boxBean.CanOutStore(boxBean.DeviceID) ? "可出库" : "不可出库";
lblStoreStatus.Text = DeviceBase.GetRunStr(robotEquip.runStatus);// + "(" + canOut + ")"; lblStoreStatus.Text = DeviceBase.GetRunStr(robotEquip.runStatus);// + "(" + canOut + ")";
...@@ -492,17 +497,6 @@ namespace OnlineStore.CarriageClient ...@@ -492,17 +497,6 @@ namespace OnlineStore.CarriageClient
tabcon.Controls.Add(lineTabPage); tabcon.Controls.Add(lineTabPage);
} }
private void chbMoveStop_CheckedChanged(object sender, EventArgs e)
{
if (!IsLoad)
{
return;
}
robotEquip.MoveStop = chbMoveStop.Checked;
LogUtil.info(robotEquip.Name + "用户切换是否暂停: " + robotEquip.MoveStop);
}
private void btnCloseAll_Click(object sender, EventArgs e) private void btnCloseAll_Click(object sender, EventArgs e)
{ {
...@@ -577,9 +571,28 @@ namespace OnlineStore.CarriageClient ...@@ -577,9 +571,28 @@ namespace OnlineStore.CarriageClient
ucRobot1.Update(jAKABean.RobotData); ucRobot1.Update(jAKABean.RobotData);
} }
} }
catch(Exception ex) catch (Exception ex)
{
LogUtil.error("chkManualRobot_CheckedChanged", ex);
}
}
private void btnMoveStop_Click(object sender, EventArgs e)
{
if (robotEquip.runStatus <= RunStatus.Wait)
{
MessageBox.Show(robotEquip.Name + "请先启动设备", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
if (robotEquip.MoveStop)
{
robotEquip.Resume();
LogUtil.info($"用户点击恢复运动按钮");
}
else
{ {
LogUtil.error("chkManualRobot_CheckedChanged",ex); robotEquip.Pause();
LogUtil.info($"用户点击暂停运动按钮");
} }
} }
......
...@@ -63,6 +63,7 @@ DI,1,13寸料盘顶升下降端,Inlet_13InchJackDownSig,9,HC,X09,,,,,,,,,,,, ...@@ -63,6 +63,7 @@ DI,1,13寸料盘顶升下降端,Inlet_13InchJackDownSig,9,HC,X09,,,,,,,,,,,,
DI,3,NG料暂存区料盘检测,NGBox_TrayCheck,10,HC,X10,,,,,,,,,,,, DI,3,NG料暂存区料盘检测,NGBox_TrayCheck,10,HC,X10,,,,,,,,,,,,
DI,3,机械臂料盘检测,RobotArm_TrayCheck,11,HC,X11,,,,,,,,,,,, DI,3,机械臂料盘检测,RobotArm_TrayCheck,11,HC,X11,,,,,,,,,,,,
DI,3,机械臂夹紧检测,RobotArm_ClampingSig,12,HC,X12,,,,,,,,,,,, DI,3,机械臂夹紧检测,RobotArm_ClampingSig,12,HC,X12,,,,,,,,,,,,
DI,3,安全光栅,SafetyLightGrids,18,HC,X18,,,,,,,,,,,,
DI,2,出料线体顶升上升端,Outlet_JackUpSig,13,HC,X13,,,,,,,,,,,, DI,2,出料线体顶升上升端,Outlet_JackUpSig,13,HC,X13,,,,,,,,,,,,
DI,2,出料线体顶升下降端,Outlet_JackDownSig,14,HC,X14,,,,,,,,,,,, DI,2,出料线体顶升下降端,Outlet_JackDownSig,14,HC,X14,,,,,,,,,,,,
DI,2,出料线体料盘检测1,Outlet_TrayCheck1,15,HC,X15,,,,,,,,,,,, DI,2,出料线体料盘检测1,Outlet_TrayCheck1,15,HC,X15,,,,,,,,,,,,
......
...@@ -75,7 +75,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -75,7 +75,6 @@ namespace OnlineStore.DeviceLibrary
return; return;
} }
if (MoveInfo.MoveType.Equals(MoveType.RHome)) if (MoveInfo.MoveType.Equals(MoveType.RHome))
{ {
ResetProcess(); ResetProcess();
......
...@@ -470,54 +470,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -470,54 +470,21 @@ namespace OnlineStore.DeviceLibrary
} }
} }
#endregion #endregion
#region 门禁 #region 门禁光栅
//门禁状态:0正常。1=安全门禁打开,已停止运动
private int CurrSecurityAccess = 0;
protected void SecurityAccessProcess() protected void SecurityAccessProcess()
{ {
try try
{ {
//if (!baseConfig.DIList.ContainsKey(IO_Type.LeftDoor_Limit)) if(!MoveStop)
//{
// return;
//}
//if (!baseConfig.DIList.ContainsKey(IO_Type.RightDoor_Limit))
//{
// return;
//}
//if (!baseConfig.DIList.ContainsKey(IO_Type.BackDoor_Limit))
//{
// return;
//}
if (CurrSecurityAccess.Equals(0))
{ {
//if (StoreManager.DisBoxSecurityAccess) if (IOValue(IO_Type.SafetyLightGrids).Equals(IO_VALUE.LOW))
//{ {
//} Pause();
//else if (IOValue(IO_Type.LeftDoor_Limit).Equals(IO_VALUE.LOW)) LogUtil.info("安全光栅触发,停止行走机构和机器人运动");
//{ }
// SecurityAccessStop("左前门门禁");
//}
//else if (IOValue(IO_Type.RightDoor_Limit).Equals(IO_VALUE.LOW))
//{
// SecurityAccessStop("右前门门禁");
//}
//else if (IOValue(IO_Type.BackDoor_Limit).Equals(IO_VALUE.LOW))
//{
// SecurityAccessStop("后门门禁");
//}
}
else if (CurrSecurityAccess.Equals(1))
{
//if (IOValue(IO_Type.LeftDoor_Limit).Equals(IO_VALUE.HIGH) &&
// IOValue(IO_Type.RightDoor_Limit).Equals(IO_VALUE.HIGH) &&
// IOValue(IO_Type.BackDoor_Limit).Equals(IO_VALUE.HIGH))
//{
// SecurityAccessReset();
//}
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -525,56 +492,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -525,56 +492,19 @@ namespace OnlineStore.DeviceLibrary
} }
} }
public void Pause()
//private void SecurityAccessStop(string doorname) {
//{ MoveStop = true;
// if (!baseConfig.DIList.ContainsKey(IO_Type.LeftDoor_Limit)) CompressAxis.SuddenStop();
// { MoveAxis.SuddenStop();
// return; RobotPause();
// } MoveInfo.CanWhileCount = 5;
// if (!baseConfig.DIList.ContainsKey(IO_Type.RightDoor_Limit)) }
// { public void Resume()
// return; {
// } MoveStop = false;
// if (!baseConfig.DIList.ContainsKey(IO_Type.BackDoor_Limit)) RobotResume();
// { }
// return;
// }
// CurrSecurityAccess = 1;
// if (alarmType > (AlarmType.IoSingleTimeOut))
// {
// return;
// }
// LogUtil.info($"{Name} {doorname}被打开,停止当前运动{MoveInfo.MoveType},MoveStop={MoveStop},报警急停");
// SetWarnMsg($"{doorname}被打开,报警急停");
// Alarm(AlarmType.SuddenStop);
//}
//private void SecurityAccessReset()
//{
// if (!baseConfig.DIList.ContainsKey(IO_Type.LeftDoor_Limit))
// {
// return;
// }
// if (!baseConfig.DIList.ContainsKey(IO_Type.RightDoor_Limit))
// {
// return;
// }
// if (!baseConfig.DIList.ContainsKey(IO_Type.BackDoor_Limit))
// {
// return;
// }
// CurrSecurityAccess = 0;
// MoveStop = false;
// if (alarmType > (AlarmType.IoSingleTimeOut))
// {
// return;
// }
// //光栅恢复处理
//}
#endregion #endregion
......
using CodeLibrary; using CodeLibrary;
using log4net.Util;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
...@@ -343,6 +344,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -343,6 +344,23 @@ namespace OnlineStore.DeviceLibrary
bean.MotionAbort(); bean.MotionAbort();
} }
} }
public bool RobotPause()
{
if (GetRobotInfo(out JAKA.JAKABean bean))
{
return bean.Pause();
}
return false;
}
public bool RobotResume()
{
if (GetRobotInfo(out JAKA.JAKABean bean))
{
return bean.Resume();
}
return false;
}
#endregion #endregion
#region 行走机构 #region 行走机构
......
...@@ -3,7 +3,7 @@ using System.Collections.Generic; ...@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
namespace OnlineStore.LoadCSVLibrary namespace OnlineStore.LoadCSVLibrary
{ {
...@@ -26,7 +26,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -26,7 +26,7 @@ namespace OnlineStore.LoadCSVLibrary
} }
return TypeList; return TypeList;
} }
/// <summary> /// <summary>
...@@ -101,7 +101,10 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -101,7 +101,10 @@ namespace OnlineStore.LoadCSVLibrary
/// DI,2,出料线体允许送料,Outlet_AllowFeedSig,17,HC,X17,,,,,,,,,,,, /// DI,2,出料线体允许送料,Outlet_AllowFeedSig,17,HC,X17,,,,,,,,,,,,
/// </summary> /// </summary>
public static string Outlet_AllowFeedSig = "Outlet_AllowFeedSig"; public static string Outlet_AllowFeedSig = "Outlet_AllowFeedSig";
/// <summary>
/// DI,3,安全光栅,SafetyLightGrids,18,HC,X18,,,,,,,,,,,,
/// </summary>
public static string SafetyLightGrids = "SafetyLightGrids";
/// <summary> /// <summary>
/// DO,1,自动绿色指示灯,RunSign_HddLed,0,HC,Y00,,,,,,,,,,,, /// DO,1,自动绿色指示灯,RunSign_HddLed,0,HC,Y00,,,,,,,,,,,,
/// </summary> /// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!