OutletEquip_OutStore.cs
3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
using Asa;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
partial class OutletEquip
{
/// <summary>
/// 等待机器人在安全位置
/// </summary>
/// <param name="moveInfo"></param>
/// <param name="wait"></param>
/// <returns></returns>
protected override bool CheckWaitResult(DeviceMoveInfo moveInfo, WaitResultInfo wait)
{
if (wait.WaitType.Equals(WaitEnum.W201_RobotMove))
{
if (StoreManager.Client.robotEquip.RobotMoveEnd(curcmd))
{
wait.IsEnd = true;
}
}
return wait.IsEnd;
}
/// <summary>
/// 当前命令
/// </summary>
private string curcmd = "";
#region 自动出料
private DateTime startInTime = DateTime.Now;
private void NextMoveStep(StepEnum step, string msg)
{
MoveInfo.NextMoveStep(step);
MoveLog($" {MoveInfo.SLog}:{msg}");
}
protected override void OutstoreProcess()
{
if (MoveInfo.IsInWait)
{
CheckWait(MoveInfo);
}
if (MoveInfo.IsInWait)
{
return;
}
if (MoveInfo.IsStep(StepEnum.Outlet_01_Wait))
{
NextMoveStep(StepEnum.Outlet_02_CheckTray, "检查是否有料盘");
SetCurCmd(RobotEquip.GetCmd_Standby());
AddWaitTime(10000);
MoveInfo.OneWaitCanEndStep=true;
}
else if (MoveInfo.IsStep(StepEnum.Outlet_02_CheckTray))
{
if (TrayCheck())
{
NextMoveStep(StepEnum.Outlet_03_CheckAllowFeedOut, "有料盘,顶升下降,准备送走");
JackUp(false);
AddWaitAllowFeedOut();
}
else//无料盘
{
NextMoveStep(StepEnum.Outlet_05_JackUp, "无料盘,顶升抬起,准备料盘放入");
JackUp(true);
AddWaitTime(5000);
}
}
else if (MoveInfo.IsStep(StepEnum.Outlet_03_CheckAllowFeedOut))
{
NextMoveStep(StepEnum.Outlet_04_WaitTrayLeave, "允许料盘离开,链条运行");
OutletRun(true);
AddWaitTrayCheck1(false);
AddWaitTrayCheck2(true);
AddWaitTrayCheck2(false);
}
else if (MoveInfo.IsStep(StepEnum.Outlet_04_WaitTrayLeave))
{
NextMoveStep(StepEnum.Outlet_05_JackUp, "料盘离开完成,链条停止,顶升抬起");
OutletRun(false);
JackUp(true);
AddWaitTrayCheck2(false);
}
else if (MoveInfo.IsStep(StepEnum.Outlet_05_JackUp))
{
curcmd = "";
MoveInfo.EndMove();
}
}
private void SetCurCmd(string cmd)
{
curcmd = cmd;
MoveInfo.WaitList.Add(WaitResultInfo.WaitRobotMove());
}
#endregion
}
}