You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
2.1 KiB
C#
80 lines
2.1 KiB
C#
using Rs.Controls;
|
|
using Rs.MotionPlat.Commom;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Rs.MotionPlat.Flow
|
|
{
|
|
public class SafeControl
|
|
{
|
|
private SafeControl() { }
|
|
|
|
private static SafeControl instance;
|
|
public static SafeControl Instance
|
|
{
|
|
get
|
|
{
|
|
if (instance == null)
|
|
{
|
|
instance = new SafeControl();
|
|
}
|
|
return instance;
|
|
}
|
|
}
|
|
public void Init()
|
|
{
|
|
AxisControl.LoadX.FunSafeCheck += LoadX_FunSafeCheck;
|
|
AxisControl.LoadY.FunSafeCheck += LoadY_FunSafeCheck;
|
|
AxisControl.TurnoverY.FunSafeCheck += TurnoverY_FunSafeCheck;
|
|
}
|
|
|
|
private bool TurnoverY_FunSafeCheck()
|
|
{
|
|
if (SysConfigParam.GetValue<bool>("CheckSafeEnable"))
|
|
{
|
|
AxisControl.PressZ.GetOrgStatus(out bool bOrg);
|
|
if (!bOrg)
|
|
return false;
|
|
AxisControl.TurnoverZ.GetOrgStatus(out bOrg);
|
|
if (!bOrg)
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
private bool LoadY_FunSafeCheck()
|
|
{
|
|
if(SysConfigParam.GetValue<bool>("CheckSafeEnable"))
|
|
{
|
|
if (!Ops.IsOn("上下气缸原位"))
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
private bool LoadX_FunSafeCheck()
|
|
{
|
|
if (SysConfigParam.GetValue<bool>("CheckSafeEnable"))
|
|
{
|
|
bool bOnOrg = false;
|
|
if (!Ops.IsOn("上下气缸原位"))
|
|
{
|
|
return false;
|
|
}
|
|
for (int i = 1; i < 10; i ++)
|
|
{
|
|
AxisControl.GetAxis($"NozzleZ{i}").GetOrgStatus(out bOnOrg);
|
|
if (!bOnOrg)
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
}
|