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.
89 lines
3.1 KiB
C#
89 lines
3.1 KiB
C#
using Rs.Framework;
|
|
using Rs.MotionPlat.Commom;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Rs.MotionPlat.Module
|
|
{
|
|
public static class StockModule
|
|
{
|
|
static string logInfo = string.Empty;
|
|
/// <summary>
|
|
/// 抽屉锁操作
|
|
/// </summary>
|
|
/// <param name="op"></param>
|
|
public static void DrawerLock(EIoOperate op,int stockIndex)
|
|
{
|
|
if (op == EIoOperate.Open)
|
|
{
|
|
Ops.Off($"抽屉锁{stockIndex}");
|
|
logInfo = $"抽屉锁{stockIndex} off";
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
Thread.Sleep(GlobalVar.DrawerlockOpenDelaytime);
|
|
}
|
|
else
|
|
{
|
|
Ops.On($"抽屉锁{stockIndex}");
|
|
logInfo = $"抽屉锁{stockIndex} on";
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
Thread.Sleep(GlobalVar.DrawerlockCloseDelaytime);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 抽屉拉伸气缸操作
|
|
/// </summary>
|
|
/// <param name="op"></param>
|
|
public static void DrawerPullCylinder(EIoOperate op, int stockIndex)
|
|
{
|
|
if (op == EIoOperate.Open)
|
|
{
|
|
Ops.On($"抽屉拉伸气缸{stockIndex}");
|
|
logInfo = $"抽屉拉伸气缸{stockIndex} on";
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
Thread.Sleep(GlobalVar.DrawerPullCloseDelaytime);
|
|
}
|
|
else
|
|
{
|
|
Ops.Off($"抽屉拉伸气缸{stockIndex}");
|
|
logInfo = $"抽屉拉伸气缸{stockIndex} off";
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
Thread.Sleep(GlobalVar.DrawerPullOpenDelaytime);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 料仓夹磁气缸
|
|
/// </summary>
|
|
/// <param name="op"></param>
|
|
public static void ClampTrayCylinder(EIoOperate op, int stockIndex,string className)
|
|
{
|
|
if (op == EIoOperate.Open)
|
|
{
|
|
Ops.On($"料仓夹磁气缸{stockIndex}开");
|
|
logInfo = $"{className} 料仓夹磁气缸{stockIndex}开 on";
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
Ops.Off($"料仓夹磁气缸{stockIndex}夹");
|
|
logInfo = $"{className}料仓夹磁气缸{stockIndex}夹 off";
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
Thread.Sleep(GlobalVar.StockLooseTrayDelaytime);
|
|
|
|
}
|
|
else
|
|
{
|
|
Ops.On($"料仓夹磁气缸{stockIndex}夹");
|
|
logInfo = $"{className}料仓夹磁气缸{stockIndex}夹 on";
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
Ops.Off($"料仓夹磁气缸{stockIndex}开");
|
|
logInfo = $"{className}料仓夹磁气缸{stockIndex}开 off";
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
Thread.Sleep(GlobalVar.StockClampTrayDelaytime);
|
|
}
|
|
}
|
|
}
|
|
}
|