Commit 371a409a LN

折叠门光栅处理。

1 个父辈 e40760ab
......@@ -42,7 +42,22 @@ namespace DeviceLibrary
Resume();
LogUtil.info($"{Name},设置{High}=Low");
}
public bool NeedStop()
{
if (currentIOvalue == IO_VALUE.None)
{
return false ;
}
else if (currentIOvalue == IO_VALUE.HIGH && IOManager.IOValue(High).Equals(IO_VALUE.HIGH))
{
return false ;
}
else if (currentIOvalue == IO_VALUE.LOW && IOManager.IOValue(Low).Equals(IO_VALUE.HIGH))
{
return false ;
}
return true;
}
public void Pause()
{
LogUtil.info($"{Name},停止运行");
......
......@@ -66,6 +66,7 @@ namespace DeviceLibrary
public LineRunMonitor Line;
public CylinderManger SingleDoor;
public CylinderManger FlipDoor;
public CylinderManger CyStringDoor;
public LiftMonitor MotorFlipDoorA;
public LiftMonitor MotorFlipDoorB;
public LiftMonitor StringDoor;
......@@ -157,14 +158,17 @@ namespace DeviceLibrary
var sf = "";
if (Setting_Init.StringDoor_X08IsStringDoor_SafetyLightCurtains)
sf = IO_Type.AGV_OnPosition;
StringDoor = new LiftMonitor(IO_Type.StringDoor_Open, IO_Type.StringDoor_Close, sf, IO_Type.StringDoor_Axis_Break, new AxisBean(Config.StringDoor_Axis, Name), Config.StringDoorLength, Config.StringDoorLength_speed, 0, "折叠门",true);
StringDoor = new LiftMonitor(IO_Type.StringDoor_Open, IO_Type.StringDoor_Close, sf, IO_Type.StringDoor_Axis_Break, new AxisBean(Config.StringDoor_Axis, Name), Config.StringDoorLength, Config.StringDoorLength_speed, 0, "折叠门", true);
StringDoor.DownOverTimeMS = Setting_Init.StringDoor_DownOverTimeMS;
StringDoor.UpOverTimeMS = Setting_Init.StringDoor_UpOverTimeMS;
StringDoor.ResumeWaitTimeSec = 5;
LogUtil.info("加载料串门类型为:步进");
}
else
{
LogUtil.info("加载料串门类型为:气缸");
CyStringDoor= new CylinderManger($"折叠门", IO_Type.StringDoor_Open,IO_Type.StringDoor_Close);
}
if (!Setting_Init.StringDoor_X08IsStringDoor_SafetyLightCurtains)
{
RobotManage.Config.DIList.Remove(IO_Type.AGV_OnPosition);
......@@ -820,7 +824,8 @@ namespace DeviceLibrary
if (Setting_Init.StringDoor_X08IsStringDoor_SafetyLightCurtains)
{
//IOValue(IO_Type.StringFront_Check).Equals(IO_VALUE.LOW) &&
if (IOValue(IO_Type.AGV_OnPosition).Equals(IO_VALUE.LOW) && IOValue(IO_Type.StringDoor_Close).Equals(IO_VALUE.LOW))
if (IOValue(IO_Type.AGV_OnPosition).Equals(IO_VALUE.LOW))
//if (IOValue(IO_Type.AGV_OnPosition).Equals(IO_VALUE.LOW) && IOValue(IO_Type.StringDoor_Close).Equals(IO_VALUE.LOW))
{
Msg.add(crc.GetString(L.stringDoorSafety, "料串门光栅被遮挡"), MsgLevel.warning);
if (lastStringSafetyStatus)
......@@ -855,6 +860,10 @@ namespace DeviceLibrary
{
StringDoor.ResumeSingle();
}
else
{
CyStringDoor.Resume();
}
lastStringSafetyStatus = true;
}
}
......
......@@ -797,7 +797,8 @@ namespace DeviceLibrary
}
else
{
CylinderMove(moveInfo, IO_Type.StringDoor_Close, IO_Type.StringDoor_Open, IO_VALUE.HIGH);
//CylinderMove(moveInfo, IO_Type.StringDoor_Close, IO_Type.StringDoor_Open, IO_VALUE.HIGH);
CyStringDoor.ToHigh(moveInfo);
}
}
public void StringDoorClose(MoveInfo moveInfo)
......@@ -813,7 +814,8 @@ namespace DeviceLibrary
}
else
{
CylinderMove(moveInfo, IO_Type.StringDoor_Close, IO_Type.StringDoor_Open, IO_VALUE.LOW);
//CylinderMove(moveInfo, IO_Type.StringDoor_Close, IO_Type.StringDoor_Open, IO_VALUE.LOW);
CyStringDoor.ToLow(moveInfo);
}
}
public void StringDoorPause()
......@@ -829,9 +831,10 @@ namespace DeviceLibrary
}
else
{
IOMove(IO_Type.StringDoor_Close, IO_VALUE.LOW);
IOMove(IO_Type.StringDoor_Open, IO_VALUE.LOW);
CyStringDoor.Pause();
//IOMove(IO_Type.StringDoor_Close, IO_VALUE.LOW);
//IOMove(IO_Type.StringDoor_Open, IO_VALUE.LOW);
}
}
}
}
}
\ No newline at end of file
......@@ -33,16 +33,19 @@ namespace TheMachine
private void btn_linerun_Click(object sender, EventArgs e)
{
LogUtil.info("点击按钮:" + btn_linerun.Text);
RobotManage.mainMachine.Line.LineRun("n",false, 999);
}
private void btn_linerev_Click(object sender, EventArgs e)
{
LogUtil.info("点击按钮:" + btn_linerev.Text);
RobotManage.mainMachine.Line.LineRun("n",true, 999);
}
private void btn_linestop_Click(object sender, EventArgs e)
{
LogUtil.info("点击按钮:" + btn_linestop.Text);
RobotManage.mainMachine.Line.LineStop("n");
}
......
......@@ -6,9 +6,11 @@ using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
......@@ -29,8 +31,38 @@ namespace TheMachineNView
public IOControls()
{
InitializeComponent();
ioControllerTimer = new System.Threading.Timer(new TimerCallback(IOPRocess), null, 0, 1000);
GC.KeepAlive(ioControllerTimer);
}
private void IOPRocess(object state)
{
if (RobotManage.mainMachine != null && RobotManage.mainMachine.runStatus.Equals(RunStatus.Stop))
{
if (IOManager.IOValue(IO_Type.AGV_OnPosition).Equals(IO_VALUE.LOW))
{
//如果折叠门再打开状态
if (RobotManage.mainMachine.CyStringDoor != null &&RobotManage.mainMachine.CyStringDoor.NeedStop())
{
RobotManage.mainMachine.CyStringDoor.Pause();
}
}
if(IOManager.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.LOW))
{
if(RobotManage.mainMachine.SingleDoor != null&& RobotManage.mainMachine.SingleDoor.NeedStop())
{
RobotManage.mainMachine.SingleDoor.Pause();
}
}
}
}
System.Threading.Timer ioControllerTimer;
private void btn_linerun_Click(object sender, EventArgs e)
{
RobotManage.mainMachine.Line.LineRun("n",false, 999);
......@@ -64,23 +96,35 @@ namespace TheMachineNView
private void btn_stringdooropen_Click(object sender, EventArgs e)
{
//判断光栅是否关闭
if (IOManager.IOValue(IO_Type.AGV_OnPosition).Equals(IO_VALUE.LOW))
{
MessageBox.Show(crc.GetString("OpeartionFail", "操作失败"));
return;
}
LogUtil.info("手动控制:折叠门门打开");
RobotManage.mainMachine.StringDoorOpen(null);
}
private void btn_stringdoorclose_Click(object sender, EventArgs e)
{
//判断光栅是否关闭
if (IOManager.IOValue(IO_Type.AGV_OnPosition).Equals(IO_VALUE.LOW))
{
MessageBox.Show(crc.GetString("OpeartionFail", "操作失败"));
return;
}
LogUtil.info("手动控制:折叠门门关闭");
RobotManage.mainMachine.StringDoorClose(null);
}
private void btn_ngdooropen_Click(object sender, EventArgs e)
{
{
RobotManage.mainMachine.OpenSingleDoor(null);
}
private void btn_ngdoorclose_Click(object sender, EventArgs e)
{
{
RobotManage.mainMachine.CloseSingleDoor(null);
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!