ElectricClamp.cs
2.0 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
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public class ElectricClamp
{
private static int subType = 0;
public static bool needClamp = false;
public ElectricClamp(int subType)
{
//this.subType = subType;
}
public static void Clamp(StoreMoveInfo moveInfo = null)
{
needClamp = true;
if (!IsBusy)
{
IOManager.IOMove(IO_Type.Clamp_SetPos0, IO_VALUE.LOW, subType);
IOManager.IOMove(IO_Type.Clamp_SetPos1, IO_VALUE.HIGH, subType);
IOManager.IOMove(IO_Type.Clamp_DoAction, IO_VALUE.HIGH, subType);
}
if (moveInfo != null)
moveInfo.WaitList.Add(WaitResultInfo.WaitElectricClamp());
}
public static bool Release(StoreMoveInfo moveInfo = null)
{
needClamp = false;
if (!IsBusy)
{
IOManager.IOMove(IO_Type.Clamp_SetPos0, IO_VALUE.HIGH, subType);
IOManager.IOMove(IO_Type.Clamp_SetPos1, IO_VALUE.LOW, subType);
IOManager.IOMove(IO_Type.Clamp_DoAction, IO_VALUE.HIGH, subType);
moveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
return true;
}
else
{
return false;
if (moveInfo != null)
moveInfo.WaitList.Add(WaitResultInfo.WaitElectricClamp());
}
}
public static bool IsBusy {
get {
return IOManager.IOValue(IO_Type.Clamp_Busy, subType).Equals(IO_VALUE.HIGH);
}
}
public static bool IsClamp {
get
{
return IOManager.IOValue(IO_Type.Clamp_OnPosition, subType).Equals(IO_VALUE.HIGH);
}
}
}
}