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.

66 lines
2.3 KiB
C#

using Rs.Controls;
using Rs.Framework;
using Rs.MotionPlat.Commom;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Rs.MotionPlat.Flow.Space
{
enum ELongmenTestStep
{
gotoStartPos,
waitArriveStartPos,
gotoEndPos,
waitArriveEndPos
}
public class longmenTest:BaseFlow
{
private static longmenTest instance;
public static longmenTest Instance
{
get
{
if (instance == null)
instance = new longmenTest();
return instance;
}
}
ELongmenTestStep step= ELongmenTestStep.gotoStartPos;
public override void Run()
{
switch (step)
{
case ELongmenTestStep.gotoStartPos:
AxisControl.LoadX.MovePos(SysConfigParam.GetValue<double>("LoadXStartPos"), GlobalVar.WholeSpeed);
AxisControl.LoadY.MovePos(SysConfigParam.GetValue<double>("LoadYStartPos"), GlobalVar.WholeSpeed);
AxisControl.TurnoverY.MovePos(SysConfigParam.GetValue<double>("TurnoverYStartPos"), GlobalVar.WholeSpeed);
step = ELongmenTestStep.waitArriveStartPos;
break;
case ELongmenTestStep.waitArriveStartPos:
if(Ops.IsStop("LoadX", "LoadY", "TurnoverY"))
{
step = ELongmenTestStep.gotoEndPos;
}
break;
case ELongmenTestStep.gotoEndPos:
AxisControl.LoadX.MovePos(SysConfigParam.GetValue<double>("LoadXEndPos"), GlobalVar.WholeSpeed);
AxisControl.LoadY.MovePos(SysConfigParam.GetValue<double>("LoadYEndPos"), GlobalVar.WholeSpeed);
AxisControl.TurnoverY.MovePos(SysConfigParam.GetValue<double>("TurnoverYEndPos"), GlobalVar.WholeSpeed);
step = ELongmenTestStep.waitArriveEndPos;
break;
case ELongmenTestStep.waitArriveEndPos:
if (Ops.IsStop("LoadX", "LoadY", "TurnoverY"))
{
step = ELongmenTestStep.gotoStartPos;
}
break;
}
}
}
}