Commit c7e73822 LN

1

1 个父辈 9c7f139d
......@@ -36,8 +36,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\SharedDLL\Asa.Camera.VisionLib.dll</HintPath>
</Reference>
<Reference Include="Asa.RFID">
<HintPath>..\..\DoubleLineClient_3D\dll\Asa.RFID.dll</HintPath>
<Reference Include="Asa.RFID.PuYue">
<HintPath>..\SharedDLL\Asa.RFID.PuYue.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary, Version=1.0.8485.20895, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
......@@ -86,7 +86,6 @@
<Compile Include="DeviceLibrary\LiftMonitor.cs" />
<Compile Include="DeviceLibrary\LineRunMonitor.cs" />
<Compile Include="DeviceLibrary\ReelParam.cs" />
<Compile Include="DeviceLibrary\RFIDManager.cs" />
<Compile Include="DeviceLibrary\ServerCommunication.cs" />
<Compile Include="DeviceLibrary\AxisBean.cs" />
<Compile Include="theMachine\ReelTransport.cs" />
......
......@@ -6,50 +6,60 @@ namespace DeviceLibrary
{
partial class MainMachine
{
public bool StartAutoInOutTest(int posindex, out string errmsg)
private bool canStartTest(out string errmsg)
{
errmsg = "";
if (!boxTransport.IgnoreX09 && IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
if (!boxTransport.IgnoreX09 && IOMonitor.IODebound(IO_Type.TrayCheck_Fixture, Config, IO_VALUE.HIGH, 5000))
{
errmsg = crc.GetString("Res0152", "收到任务,但料叉上有料,无法启动,请检查");
}
else
{
errmsg = crc.GetString("Res0152", "收到任务,但料叉上有料,无法启动,请检查");
}
return false;
}
else
{
IgnoreGratingSignal = true;
}
if (!boxTransport.IsComplateOrFree)
{
errmsg = crc.GetString("Res0151", "料仓忙碌中,无法启动");
return false;
}
return true;
}
public bool StartAutoTest(string posName, out string errmsg)
{
if (!canStartTest(out errmsg))
{
return false;
}
CurrentPosName = posName;
CurrStartPos = GetAutoStartPos(1);
AutoInOutTest = true;
StopAutoInOut = false;
CurrentPosIndex = posindex;
AIOTMoveInfo.NewMove(MoveStep.StoreIn01);
CurrentPosIndex = RobotManage.PositionNumList.IndexOf(posName);
AIOTMoveInfo.NewMove(MoveStep.A01_WaitReel);
return true;
}
public bool ManualIn(string startPos, int posindex, out string errmsg)
{
errmsg = "";
if (boxTransport.IsComplateOrFree)
{
if (!boxTransport.IgnoreX09 && IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
if (!boxTransport.IgnoreX09 && IOMonitor.IODebound(IO_Type.TrayCheck_Fixture, Config, IO_VALUE.HIGH, 5000))
{
errmsg = crc.GetString("Res0152", "收到出库任务,但料叉上有料,无法启动,请检查");
}
else
errmsg = crc.GetString("Res0152", "收到出库任务,但料叉上有料,无法启动,请检查");
return false;
}
else
boxTransport.IgnoreX09 = false;
CurrentPosIndex = posindex;
CurrStartPos = startPos;
StopAutoInOut = true;
AIOTMoveInfo.NewMove(MoveStep.StoreIn01);
AIOTMoveInfo.log($"开始入库任务:" + RobotManage.allPositionMap.Values.ToArray()[posindex].PositionNum);
}
else
}
public bool ManualTest(string startPos, string posName, out string errmsg)
{
if (!canStartTest(out errmsg))
{
errmsg = crc.GetString("Res0153", "料仓正在出入库中,无法出库");
return false;
}
CurrentPosName = posName;
CurrentPosIndex = RobotManage.PositionNumList.IndexOf(posName);
CurrStartPos = startPos;
AutoInOutTest = false;
StopAutoInOut = true;
AIOTMoveInfo.NewMove(MoveStep.A01_Ready);
AIOTMoveInfo.log($"开始放料任务:" + startPos + "->" + posName);
return true;
}
......@@ -57,13 +67,50 @@ namespace DeviceLibrary
{
StopAutoInOut = true;
}
int CurrentPosIndex = 0;
private int CurrentPosIndex = 0;
private string CurrentPosName = "";
/// <summary>
/// 自动出入库状态
/// </summary>
public bool AutoInOutTest { get; set; } = false;
bool StopAutoInOut = false;
string CurrStartPos = "IN_1";
private string GetAutoStartPos(int count=0)
{
if (count == 0)
{
if (CurrStartPos.Equals("IN_1"))
{
CurrStartPos = "IN_2";
}
else
{
CurrStartPos = "IN_1";
}
}
else
{
return CurrStartPos = "IN_" + count;
}
return CurrStartPos;
}
private ACStorePosition getPos(int index)
{
if (index <= 0)
{
return null;
}
CurrentPosName = RobotManage.PositionNumList[index];
if (!RobotManage.allPositionMap.ContainsKey(CurrentPosName))
{
return null;
}
ACStorePosition storePosition = RobotManage.allPositionMap[CurrentPosName];
return storePosition;
}
void AutoInOutTestProcess()
{
if (CheckWait(AIOTMoveInfo))
......@@ -73,55 +120,71 @@ namespace DeviceLibrary
{
case MoveStep.Wait:
break;
case MoveStep.InWaitServerCallback:
if (IOValue(IO_Type.IN_1_Reel_Check).Equals(IO_VALUE.LOW))
case MoveStep.A01_WaitReel:
if (IOValue(IO_Type.IN_1_Reel_Check).Equals(IO_VALUE.HIGH))
{
AIOTMoveInfo.NextMoveStep(MoveStep.Wait);
AIOTMoveInfo.log($"入库料盘已离开");
AIOTMoveInfo.NextMoveStep(MoveStep.A01_Ready);
AIOTMoveInfo.log($"料盘1已准备好");
}
else
{
Msg.add(crc.GetString("Res0155", "请放入测试料盘1"), MsgLevel.warning);
}
break;
case MoveStep.StoreIn01:
AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn02);
var ac = RobotManage.allPositionMap.Values.ToArray()[CurrentPosIndex];
var reel = new ReelParam("auto", ac.BagWidth, ac.BagHigh);
if (!boxTransport.Start(new BoxStorePosition(Config, ac, reel), new BoxStorePosition(Config, ac, reel), StoreMoveType.PutReel))
case MoveStep.A01_Ready:
AIOTMoveInfo.NextMoveStep(MoveStep.A02_StartPutOne);
ACStorePosition ac = null;
if (string.IsNullOrEmpty(CurrentPosName))
{
ac = RobotManage.allPositionMap[CurrentPosName];
}
else
{
ac = getPos(CurrentPosIndex);
}
var reel = new ReelParam("auto", ac.BagWidth, ac.BagHigh);
var startPos = RobotManage.allPositionMap[CurrStartPos];
if (!boxTransport.Start(new BoxStorePosition(Config, startPos, reel), new BoxStorePosition(Config, ac, reel), StoreMoveType.PutReel))
{
AIOTMoveInfo.log($"料仓周转启动失败");
AIOTMoveInfo.log($"启动运输料盘失败,StopAutoInOut");
AutoInOutTest = false;
StopAutoInOut = true;
return;
}
AIOTMoveInfo.log($"开始转运料盘第一盘");
AIOTMoveInfo.log($"开始匀速料盘第一盘");
break;
case MoveStep.StoreIn02:
case MoveStep.A02_StartPutOne:
if (boxTransport.IsTakedReel)
{
if (StopAutoInOut)
{
AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn04);
AIOTMoveInfo.NextMoveStep(MoveStep.A04_WaitOneComplate);
AIOTMoveInfo.log($"不在自动测试模式, 直接结束1");
}
AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn03);
AIOTMoveInfo.log($"第一盘料盘已取走");
else
{
AIOTMoveInfo.NextMoveStep(MoveStep.A03_WaitRee2);
AIOTMoveInfo.log($"第一盘料盘已取走");
}
}
else
{
Msg.add(crc.GetString("Res0154", "单料口等待料盘离开."), MsgLevel.info);
}
break;
case MoveStep.StoreIn03:
if (IOValue(IO_Type.IN_1_Reel_Check).Equals(IO_VALUE.HIGH))
case MoveStep.A03_WaitRee2:
if (IOValue(IO_Type.IN_2_Reel_Check).Equals(IO_VALUE.HIGH))
{
AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn04);
AIOTMoveInfo.log($"入库料盘已准备好");
AIOTMoveInfo.NextMoveStep(MoveStep.A04_WaitOneComplate);
AIOTMoveInfo.log($"测试料盘2已准备好");
}
else
{
Msg.add(crc.GetString("Res0155", "请放入第二盘料."), MsgLevel.warning);
Msg.add(crc.GetString("Res0155", "请放入测试料盘2."), MsgLevel.warning);
}
break;
case MoveStep.StoreIn04:
case MoveStep.A04_WaitOneComplate:
if (boxTransport.IsComplateOrFree)
{
if (StopAutoInOut)
......@@ -130,30 +193,32 @@ namespace DeviceLibrary
AIOTMoveInfo.EndMove();
return;
}
AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn05);
AIOTMoveInfo.NextMoveStep(MoveStep.A05_StartPutTwo);
AIOTMoveInfo.log($"第一盘料盘已到达目的地");
if (CurrentPosIndex - 1 < 0 || StopAutoInOut)
{
AIOTMoveInfo.log($"已达到最后一个库位:{CurrentPosIndex},或手动停止{StopAutoInOut},自动出入库停止,将料盘送至出口");
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut10);
AIOTMoveInfo.log($"已达到最后一个库位:{CurrentPosIndex}或手动停止{StopAutoInOut},自动出入库停止,将料盘送至出口");
AIOTMoveInfo.NextMoveStep(MoveStep.A10_LastPos);
return;
}
AIOTMoveInfo.log($"开始转运料盘第二盘");
ac = RobotManage.allPositionMap.Values.ToArray()[CurrentPosIndex - 1];
AIOTMoveInfo.log($"开始匀速料盘第二盘");
ac =getPos(CurrentPosIndex-1);
reel = new ReelParam("auto", ac.BagWidth, ac.BagHigh);
if (!boxTransport.Start(new BoxStorePosition(Config, ac, reel), new BoxStorePosition(Config, ac, reel), StoreMoveType.PutReel))
startPos = RobotManage.allPositionMap[GetAutoStartPos()];
if (!boxTransport.Start(new BoxStorePosition(Config, startPos, reel), new BoxStorePosition(Config, ac, reel), StoreMoveType.PutReel))
{
AIOTMoveInfo.log($"料仓周转启动失败");
AIOTMoveInfo.log($"启动运输料盘失败,StopAutoInOut");
AutoInOutTest = false;
StopAutoInOut = true;
return;
}
}
break;
case MoveStep.StoreIn05:
case MoveStep.A05_StartPutTwo:
if (boxTransport.IsTakedReel)
{
AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn06);
AIOTMoveInfo.NextMoveStep(MoveStep.A06_WaitTwoEnd);
AIOTMoveInfo.log($"第二盘料盘已取走");
}
else
......@@ -161,41 +226,41 @@ namespace DeviceLibrary
Msg.add(crc.GetString("Res0154", "单料口等待料盘离开."), MsgLevel.info);
}
break;
case MoveStep.StoreIn06:
case MoveStep.A06_WaitTwoEnd:
if (boxTransport.IsComplateOrFree)
{
AIOTMoveInfo.log($"第二盘料盘已到达目的地");
if (CurrentPosIndex - 1 < 0 || StopAutoInOut)
{
AIOTMoveInfo.log($"已达到最后一个库位:{CurrentPosIndex},或手动停止{StopAutoInOut},自动出入库停止,将料盘送至出口");
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut10);
AIOTMoveInfo.NextMoveStep(MoveStep.A10_LastPos);
return;
}
AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn07);
AIOTMoveInfo.NextMoveStep(MoveStep.A07_NextPos);
}
break;
case MoveStep.StoreIn07:
case MoveStep.A07_NextPos:
if (boxTransport.IsComplateOrFree)
{
AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn08);
var ac1 = RobotManage.allPositionMap.Values.ToArray()[CurrentPosIndex];
AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn08);
if (CurrentPosIndex - 2 < 0 || StopAutoInOut)
{
AIOTMoveInfo.log($"A已达到最后一个库位:{CurrentPosIndex},或手动停止{StopAutoInOut},自动出入库停止,将料盘送至出口");
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut10);
AIOTMoveInfo.NextMoveStep(MoveStep.A10_LastPos);
CurrentPosIndex++;
return;
}
var ac2 = RobotManage.allPositionMap.Values.ToArray()[CurrentPosIndex - 2];
var ac1 = getPos(CurrentPosIndex);
var ac2 =getPos(CurrentPosIndex - 2);
reel = new ReelParam("auto", ac2.BagWidth, ac2.BagHigh);
if (!boxTransport.Start(new BoxStorePosition(Config, ac1, reel), new BoxStorePosition(Config, ac2, reel), StoreMoveType.PutReel))
{
AIOTMoveInfo.log($"料仓周转启动失败");
AIOTMoveInfo.log($"启动运输料盘失败,StopAutoInOut");
AutoInOutTest = false;
StopAutoInOut = true;
return;
}
AIOTMoveInfo.log($"开始交替");
AIOTMoveInfo.log($"开始交替:【{ac1.PositionNum}】->【{ac2.PositionNum}】");
}
break;
case MoveStep.StoreIn08:
......@@ -204,27 +269,30 @@ namespace DeviceLibrary
AIOTMoveInfo.log($"料盘已到达目的地");
if (CurrentPosIndex - 1 < 0 || StopAutoInOut)
{
AIOTMoveInfo.log($"B已达到最后一个库位:{CurrentPosIndex},或手动停止{StopAutoInOut},自动出入库停止,将料盘送至出口");
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut10);
AIOTMoveInfo.log($"已达到最后一个库位:{CurrentPosIndex},或手动停止{StopAutoInOut},自动出入库停止,将料盘送至出口");
AIOTMoveInfo.NextMoveStep(MoveStep.A10_LastPos);
return;
}
CurrentPosIndex--;
AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn07);
AIOTMoveInfo.NextMoveStep(MoveStep.A07_NextPos);
AIOTMoveInfo.log($"CurrentPosIndex={CurrentPosIndex}");
}
break;
case MoveStep.StoreOut10:
case MoveStep.A10_LastPos:
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut11);
CurrentPosIndex--;
ac = RobotManage.allPositionMap.Values.ToArray()[CurrentPosIndex];
CurrStartPos = GetAutoStartPos(1);
ACStorePosition start1 = RobotManage.allPositionMap[CurrStartPos];
ac = getPos(CurrentPosIndex );
reel = new ReelParam("auto", ac.BagWidth, ac.BagHigh);
if (!boxTransport.Start(new BoxStorePosition(Config, ac, reel), new BoxStorePosition(Config, ac, reel), StoreMoveType.OutStore))
if (!boxTransport.Start(new BoxStorePosition(Config, ac, reel), new BoxStorePosition(Config, start1, reel), StoreMoveType.OutStore))
{
AIOTMoveInfo.log($"料仓周转启动失败");
AIOTMoveInfo.log($"启动运输料盘失败,StopAutoInOut");
AutoInOutTest = false;
StopAutoInOut = true;
return;
}
AIOTMoveInfo.log($"开始转运料盘");
AIOTMoveInfo.log($"开始运送料盘【{ac.PositionNum}】->【{start1.PositionNum}】");
break;
case MoveStep.StoreOut11:
if (boxTransport.IsPutOnOut)
......@@ -241,26 +309,21 @@ namespace DeviceLibrary
AIOTMoveInfo.log($"料盘已到取走");
//AutoInOutTest = false;
}
break;
break;
case MoveStep.StoreOut13:
if (IOValue(IO_Type.IN_1_Reel_Check).Equals(IO_VALUE.LOW))
{
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut14);
AIOTMoveInfo.log($"第2盘料盘已取走");
}
break;
case MoveStep.StoreOut14:
AIOTMoveInfo.NextMoveStep(MoveStep.StoreOut15);
CurrStartPos = GetAutoStartPos(2);
ACStorePosition start2 = RobotManage.allPositionMap[CurrStartPos];
ac = RobotManage.allPositionMap.Values.ToArray()[CurrentPosIndex - 1];
reel = new ReelParam("auto", ac.BagWidth, ac.BagHigh);
if (!boxTransport.Start(new BoxStorePosition(Config, ac, reel), new BoxStorePosition(Config, ac, reel), StoreMoveType.OutStore))
if (!boxTransport.Start(new BoxStorePosition(Config, ac, reel), new BoxStorePosition(Config, start2, reel), StoreMoveType.OutStore))
{
AIOTMoveInfo.log($"料仓周转启动失败");
AIOTMoveInfo.log($"启动运输料盘失败,StopAutoInOut");
AutoInOutTest = false;
StopAutoInOut = true;
return;
}
AIOTMoveInfo.log($"开始转运料盘");
AIOTMoveInfo.log($"开始运送料盘【{ac.PositionNum}】->【{start2.PositionNum}】");
break;
case MoveStep.StoreOut15:
if (boxTransport.IsPutOnOut)
......
......@@ -72,6 +72,7 @@ namespace DeviceLibrary
public Dictionary<string, ReelParam> NgPosMap = new Dictionary<string, ReelParam>();
public MainMachine(Robot_Config _config) {
Config = _config;
crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
......
......@@ -124,17 +124,17 @@ namespace DeviceLibrary
//放料:放料全部结束
PutReel05_End,
StoreIn01, //入库
StoreIn02,
StoreIn03,
StoreIn04,
StoreIn05,
StoreIn06,
StoreIn07,
A01_WaitReel,
A01_Ready, //入库
A02_StartPutOne,
A03_WaitRee2,
A04_WaitOneComplate,
A05_StartPutTwo,
A06_WaitTwoEnd,
A07_NextPos,
StoreIn08,
StoreIn09,
StoreOut10, //出库
A10_LastPos, //出库
StoreOut_NGPre,
StoreOut11,
StoreOut12,
......
......@@ -12,24 +12,17 @@ namespace DeviceLibrary
{
public class OutShelfBean
{
public string Name;
public static PuYueRFID_C2S RFID = null;
public string Name;
MoveInfo MoveInfo;
public string WarnMsg = "";
/// <summary>
/// 出料口定位气缸,high=up,low=down
/// </summary>
private CylinderManger locationCylinder;
//public string currShelfRfid;
public ShelfInfo CurrShelf;
private CylinderManger locationCylinder;
public ShelfInfo CurrShelf;
public string rfidIp;
public OutShelfBean(string name )
{
this.Name = name;
......@@ -46,6 +39,12 @@ namespace DeviceLibrary
Moto_Rwd = ioStr + Moto_Rwd;
locationCylinder = new CylinderManger(name + "出料口定位", Location_Up, Location_Down);
RFID = new PuYueRFID_C2S(rfidIp);
if (!RFID.Open())
{
LogUtil.info(name + " RFID 打开失败:" + rfidIp);
}
#endregion
}
public void Reset()
......@@ -250,22 +249,14 @@ namespace DeviceLibrary
locationCylinder.ToHigh(MoveInfo);
}
break;
case MoveStep.S05_LocationUp:
MoveInfo.NextMoveStep(MoveStep.S06_ReadRFID);
MoveInfo.log("读取RFID");
ReadShelfId();
if (CurrShelf.rfid == "")
{
S21_ShelfNeedLeave("未读取到RFID");
}
else
{
MoveInfo.NextMoveStep(MoveStep.S10_ShelfReady);
MoveInfo.log("料架已准备完成");
}
case MoveStep.S05_LocationUp:
S06_ReadRFID();
break;
case MoveStep.S06_ReadRFID:
S06_ReadRFID();
break;
case MoveStep.S10_ShelfReady:
if (CurrShelf.IsNeedLeave)
{
......@@ -343,18 +334,58 @@ namespace DeviceLibrary
return false;
}
private void S06_ReadRFID()
{
MoveInfo.NextMoveStep(MoveStep.S06_ReadRFID);
MoveInfo.log("读取RFID");
if (ReadShelfId())
{
if (CurrShelf.rfid == "")
{
S21_ShelfNeedLeave("未读取到RFID");
}
else
{
MoveInfo.NextMoveStep(MoveStep.S10_ShelfReady);
MoveInfo.log("料架已准备完成");
}
}
else
{
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
}
private void S21_ShelfNeedLeave(string leaveMsg)
{
MoveInfo.NewMove(MoveStep.S21_ShelfNeedLeave);
locationCylinder.ToLow(MoveInfo);
MoveInfo.log("料架[" + CurrShelf.ToStr() + "]需要离开:" + leaveMsg + ",定位气缸下降");
}
private string ReadShelfId()
private bool ReadShelfId()
{
string rfid = RFIDManager.ReadRFID(rfidIp).NumStr();
CurrShelf = new ShelfInfo(rfid);
LogUtil.info(Name + "读取料架号:" + CurrShelf.ToStr());
return CurrShelf.realRFID;
if (RFID.Open())
{
if (RFID.ReadByte(0x20, 16, out byte[] data))
{
string rfid = Encoding.ASCII.GetString(data).Trim();
CurrShelf = new ShelfInfo(rfid);
LogUtil.info(Name + "RFID["+rfidIp+"]读取到料架号:" + CurrShelf.ToStr());
return true;
}
else
{
//读取失败,重试之类
WarnMsg = "RFID[" + rfidIp + "]读取失败";
LogUtil.error(WarnMsg);
}
}
else
{
WarnMsg = "RFID[" + rfidIp + "]打开失败";
LogUtil.error(WarnMsg);
}
return false;
}
#region IO操作
......
......@@ -43,6 +43,19 @@ namespace DeviceLibrary
return _positionNumList;
}
}
static List<string> _allPosList = null;
public static List<string> AllPosList
{
get
{
if (_allPosList == null)
{
_allPosList = new List<string>(CSVPositionReader<ACStorePosition>.allPositionMap.Keys);
}
return _allPosList;
}
}
static string baseDir = Application.StartupPath;
static Thread mainThread;
public static bool haveFixpos=false;
......@@ -82,6 +95,9 @@ namespace DeviceLibrary
msg += crc.GetString(L.iocard_init_fail, "IO板卡初始化失败")+ "\n";
}
IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
}
......
此文件类型无法预览
<?xml version="1.0"?>
<doc>
<assembly>
<name>Asa.RFID.PuYue</name>
</assembly>
<members>
<member name="T:Asa.RFID.PuYue_FR540SP">
<summary>
HiStation RFID
</summary>
</member>
<member name="E:Asa.RFID.PuYue_FR540SP.Connected">
<summary>
已连接时触发
</summary>
</member>
<member name="E:Asa.RFID.PuYue_FR540SP.Received">
<summary>
接收到数据事件
</summary>
</member>
<member name="M:Asa.RFID.PuYue_FR540SP.#ctor(System.String)">
<summary>
HiStation RFID
</summary>
<param name="logName">日志名称</param>
</member>
<member name="P:Asa.RFID.PuYue_FR540SP.IP">
<summary>
IP地址
</summary>
</member>
<member name="P:Asa.RFID.PuYue_FR540SP.IsConn">
<summary>
是否连接
</summary>
</member>
<member name="M:Asa.RFID.PuYue_FR540SP.Open">
<summary>
打开设备
</summary>
</member>
<member name="M:Asa.RFID.PuYue_FR540SP.Close">
<summary>
关闭设备
</summary>
</member>
<member name="M:Asa.RFID.PuYue_FR540SP.Init">
<summary>
初始化(用于修改硬件参数,不用每次调用)
</summary>
</member>
<member name="M:Asa.RFID.PuYue_FR540SP.TriggerMode(System.Boolean)">
<summary>
触发模式
</summary>
<param name="auto"></param>
</member>
<member name="M:Asa.RFID.PuYue_FR540SP.Listen">
<summary>
监听网络
</summary>
</member>
<member name="M:Asa.RFID.PuYue_FR540SP.DataProcess">
<summary>
数据处理
</summary>
</member>
<member name="M:Asa.RFID.PuYue_FR540SP.CmdProcess">
<summary>
命令处理
</summary>
</member>
<member name="M:Asa.RFID.PuYue_FR540SP.Reconn">
<summary>
重连
</summary>
</member>
<member name="M:Asa.RFID.PuYue_FR540SP.Connect">
<summary>
建立Socket连接
</summary>
<returns></returns>
</member>
<member name="M:Asa.RFID.PuYue_FR540SP.CheckIP(System.String)">
<summary>
检查IP
</summary>
<param name="ip"></param>
<returns></returns>
</member>
<member name="M:Asa.RFID.PuYue_FR540SP.HexBuff(System.Byte[])">
<summary>
16进制转换
</summary>
<param name="buff"></param>
<returns></returns>
</member>
<member name="M:Asa.RFID.PuYue_FR540SP.Read(System.Int16,System.Int16)">
<summary>
读取保持寄存器,0x03功能码
</summary>
<param name="address"></param>
<param name="count"></param>
</member>
<member name="M:Asa.RFID.PuYue_FR540SP.Write(System.Int16,System.Int16)">
<summary>
写入保持寄存器,0x10功能码
</summary>
<param name="address"></param>
<param name="value"></param>
</member>
<member name="T:Asa.RFID.PuYue">
<summary>
HiStation RFID
</summary>
</member>
<member name="T:Asa.RFID.PuYue.Connected_Event">
<summary>
连接事件
</summary>
</member>
<member name="E:Asa.RFID.PuYue.Connected">
<summary>
已连接时触发
</summary>
</member>
<member name="T:Asa.RFID.PuYue.Received_Event">
<summary>
接收事件
</summary>
<param name="ip"></param>
<param name="uid"></param>
<param name="data"></param>
</member>
<member name="E:Asa.RFID.PuYue.Received">
<summary>
接收到数据事件
</summary>
</member>
<member name="M:Asa.RFID.PuYue.#ctor(System.String)">
<summary>
HiStation RFID
</summary>
<param name="logName">日志名称</param>
</member>
<member name="P:Asa.RFID.PuYue.IP">
<summary>
IP地址
</summary>
</member>
<member name="P:Asa.RFID.PuYue.IsConn">
<summary>
是否连接
</summary>
</member>
<member name="M:Asa.RFID.PuYue.Open">
<summary>
打开设备
</summary>
</member>
<member name="M:Asa.RFID.PuYue.Close">
<summary>
关闭设备
</summary>
</member>
<member name="M:Asa.RFID.PuYue.Init">
<summary>
初始化(用于修改硬件参数,不用每次调用)
</summary>
</member>
<member name="M:Asa.RFID.PuYue.TriggerMode(System.Boolean)">
<summary>
触发模式
</summary>
<param name="auto"></param>
</member>
<member name="M:Asa.RFID.PuYue.Listen">
<summary>
监听网络
</summary>
</member>
<member name="M:Asa.RFID.PuYue.DataProcess">
<summary>
数据处理
</summary>
</member>
<member name="M:Asa.RFID.PuYue.CmdProcess">
<summary>
命令处理
</summary>
</member>
<member name="M:Asa.RFID.PuYue.Reconn">
<summary>
重连
</summary>
</member>
<member name="M:Asa.RFID.PuYue.Connect">
<summary>
建立Socket连接
</summary>
<returns></returns>
</member>
<member name="M:Asa.RFID.PuYue.CheckIP(System.String)">
<summary>
检查IP
</summary>
<param name="ip"></param>
<returns></returns>
</member>
<member name="M:Asa.RFID.PuYue.HexBuff(System.Byte[])">
<summary>
16进制转换
</summary>
<param name="buff"></param>
<returns></returns>
</member>
<member name="M:Asa.RFID.PuYue.Read(System.Int16,System.Int16)">
<summary>
读取保持寄存器,0x03功能码
</summary>
<param name="address"></param>
<param name="count"></param>
</member>
<member name="M:Asa.RFID.PuYue.Write(System.Int16,System.Int16)">
<summary>
写入保持寄存器,0x10功能码
</summary>
<param name="address"></param>
<param name="value"></param>
</member>
<member name="E:PuYueRFID_FR540SP_C2S.ConnectionState_Event">
<summary>
连接状态变化, 手动连接不触发
</summary>
</member>
<member name="M:PuYueRFID_FR540SP_C2S.Finalize">
<summary>
销毁
</summary>
</member>
<member name="M:PuYueRFID_FR540SP_C2S.Open(System.String,System.Boolean)">
<summary>
打开IO
</summary>
<returns></returns>
</member>
<member name="P:PuYueRFID_FR540SP_C2S.AntennaPower">
<summary>
设置天线功率dBm
</summary>
</member>
<member name="M:PuYueRFID_FR540SP_C2S.Close">
<summary>
关闭IO
</summary>
</member>
<member name="P:PuYueRFID_FR540SP_C2S.IsConn">
<summary>
连接状态
</summary>
</member>
<member name="M:PuYueRFID_FR540SP_C2S.iomonitor">
<summary>
循环读全部IO
</summary>
</member>
<member name="M:PuYueRFID_FR540SP_C2S.WriteDO(System.Int16,System.Int16)">
<summary>
写寄存器
</summary>
<param name="address"></param>
<param name="value"></param>
<returns></returns>
</member>
<member name="M:PuYueRFID_FR540SP_C2S.ReadDO">
<summary>
读全部IO
</summary>
</member>
<member name="M:PuYueRFID_FR540SP_C2S.TryRead(System.String@,System.Double@)">
<summary>
读取rfid
</summary>
<param name="id">读取到的id</param>
<param name="ms">最后读到的时间ms</param>
<returns>读取成功状态-1读取失败,0没有读到,1读取成功</returns>
</member>
<member name="M:PuYueRFID_FR540SP_C2S.WriteByte(System.Int16,System.Byte[])">
<summary>
写入字节最大 64字
</summary>
<param name="address"></param>
<param name="data"></param>
<returns></returns>
</member>
<member name="M:PuYueRFID_FR540SP_C2S.HexBuff(System.Byte[])">
<summary>
16进制转换
</summary>
<param name="buff"></param>
<returns></returns>
</member>
<member name="E:PuYueRFID_C2S.ConnectionState_Event">
<summary>
连接状态变化, 手动连接不触发
</summary>
</member>
<member name="M:PuYueRFID_C2S.Finalize">
<summary>
销毁
</summary>
</member>
<member name="M:PuYueRFID_C2S.Open">
<summary>
打开IO
</summary>
<returns></returns>
</member>
<member name="P:PuYueRFID_C2S.AntennaPower">
<summary>
设置天线功率dBm
</summary>
</member>
<member name="M:PuYueRFID_C2S.Close">
<summary>
关闭IO
</summary>
</member>
<member name="P:PuYueRFID_C2S.IsConn">
<summary>
连接状态
</summary>
</member>
<member name="M:PuYueRFID_C2S.iomonitor">
<summary>
循环读全部IO
</summary>
</member>
<member name="M:PuYueRFID_C2S.WriteDO(System.Int16,System.Int16)">
<summary>
写寄存器
</summary>
<param name="address"></param>
<param name="value"></param>
<returns></returns>
</member>
<member name="M:PuYueRFID_C2S.ReadDO">
<summary>
读全部IO
</summary>
</member>
<member name="M:PuYueRFID_C2S.TryRead(System.String@,System.Double@)">
<summary>
读取rfid
</summary>
<param name="id">读取到的id</param>
<param name="ms">最后读到的时间ms</param>
<returns>读取成功状态-1读取失败,0没有读到,1读取成功</returns>
</member>
<member name="M:PuYueRFID_C2S.WriteByte(System.Int16,System.Byte[])">
<summary>
写入字节最大 64字
</summary>
<param name="address"></param>
<param name="data"></param>
<returns></returns>
</member>
</members>
</doc>
......@@ -92,7 +92,7 @@ namespace TheMachine
listReelInfo.View = View.Details;
AddHeader(listReelInfo, "", 0);
AddHeader(listReelInfo, "位置", 200);
AddHeader(listReelInfo, "料盘信息", listReelInfo.Width-200);
AddHeader(listReelInfo, "料盘信息", listReelInfo.Width-200-3);
listReelInfo.ColumnWidthChanging += listView_ColumnWidthChanging;
#endregion
......
......@@ -110,7 +110,7 @@ namespace TheMachine
this.ioControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ioControl1.Location = new System.Drawing.Point(0, 0);
this.ioControl1.Name = "ioControl1";
this.ioControl1.Size = new System.Drawing.Size(975, 539);
this.ioControl1.Size = new System.Drawing.Size(904, 522);
this.ioControl1.TabIndex = 0;
this.ioControl1.Tag = "not";
this.ioControl1.Load += new System.EventHandler(this.ioControl1_Load);
......@@ -168,7 +168,7 @@ namespace TheMachine
this.Controls.Add(this.ioControl1);
this.Font = new System.Drawing.Font("新宋体", 9F);
this.Name = "IOControls";
this.Size = new System.Drawing.Size(975, 539);
this.Size = new System.Drawing.Size(904, 522);
this.ResumeLayout(false);
}
......
......@@ -108,9 +108,9 @@ namespace TheMachine
void checkVerify()
{
int finish = 0;
for (int i = 0; i < RobotManage.PositionNumList.Count; i++)
for (int i = 0; i < RobotManage.AllPosList.Count; i++)
{
var posid = RobotManage.PositionNumList[i];
var posid = RobotManage.AllPosList[i];
if (htpp.ContainsKey(posid) && posState.ContainsKey(posid))
{
var pps = (PosState)posState[posid];
......@@ -120,7 +120,7 @@ namespace TheMachine
}
}
}
double s = (double)finish * 100 / RobotManage.PositionNumList.Count;
double s = (double)finish * 100 / RobotManage.AllPosList.Count;
label_verify.Text = s.ToString("0.0") + "%";
}
Hashtable htpp = new Hashtable();
......@@ -193,9 +193,9 @@ namespace TheMachine
int currentRowIndex = 0;
int currentColIndex = -1;
string lastAB = "";
for (int i = 0; i < RobotManage.PositionNumList.Count; i++)
for (int i = 0; i < RobotManage.AllPosList.Count; i++)
{
string posname = RobotManage.PositionNumList[i];
string posname = RobotManage.AllPosList[i];
string ab = posname.Substring(0, 3);
if (posname.StartsWith("Sca") || posname.StartsWith("Doo"))
......@@ -285,16 +285,16 @@ namespace TheMachine
if (RobotManage.mainMachine.runStatus == RunStatus.Running)
{
int posindex = RobotManage.PositionNumList.IndexOf(cmbPosition.Text);
LogUtil.info($"入库位:{cmbPosition.Text},index:{posindex}");
string posName = cmbPosition.Text;
LogUtil.info($"入库位:{cmbPosition.Text},posName:{posName}");
string startPosname = "IN_1";
if (radioButton2.Checked)
{
startPosname = "IN_2";
}
if (RobotManage.mainMachine.ManualIn(startPosname,posindex, out string errmsg))
if (RobotManage.mainMachine.ManualTest(startPosname, posName, out string errmsg))
{
LogUtil.info($"手动入库:{posindex}");
LogUtil.info($"手动入库:{posName}");
}
else
{
......@@ -309,22 +309,22 @@ namespace TheMachine
private void btnOutStore_Click(object sender, EventArgs e)
{
if (RobotManage.mainMachine.runStatus == RunStatus.Running)
{
int posindex = RobotManage.PositionNumList.IndexOf(cmbPosition.Text);
LogUtil.info($"出库位:{cmbPosition.Text},index:{posindex}");
if (RobotManage.mainMachine.ManualOut(posindex,out string errmsg)) {
LogUtil.info($"手动出库:{posindex}");
}
else
{
MessageBox.Show(errmsg);
}
}
else
{
MessageBox.Show(crc.GetString("Res0213","请先启动料仓!"));
}
//if (RobotManage.mainMachine.runStatus == RunStatus.Running)
//{
// int posindex = RobotManage.AllPosList.IndexOf(cmbPosition.Text);
// LogUtil.info($"出库位:{cmbPosition.Text},index:{posindex}");
// if (RobotManage.mainMachine.ManualOut(posindex,out string errmsg)) {
// LogUtil.info($"手动出库:{posindex}");
// }
// else
// {
// MessageBox.Show(errmsg);
// }
//}
//else
//{
// MessageBox.Show(crc.GetString("Res0213","请先启动料仓!"));
//}
}
bool preOpen = false;
......@@ -386,20 +386,21 @@ namespace TheMachine
}
if (RobotManage.mainMachine.runStatus == RunStatus.Running)
{
{
if (RobotManage.mainMachine.IOValue(IO_Type.IN_1_Reel_Check).Equals(IO_VALUE.LOW)|| RobotManage.mainMachine.IOValue(IO_Type.IN_2_Reel_Check).Equals(IO_VALUE.LOW))
{
MessageBox.Show(crc.GetString("Res0217","料盘没有准备好,请先点击[上料准备],无法启动"));
return;
}
}
DialogResult res = MessageBox.Show(crc.GetString("Res0218","确定开始自动库位测试?\n请确保料架库位全部为空."), crc.GetString("Res0167","提示"), MessageBoxButtons.YesNo);
if (res == DialogResult.No)
{
return;
int posindex = RobotManage.PositionNumList.IndexOf(cmbPosition.Text);
LogUtil.info($"库位:{cmbPosition.Text},index:{posindex}");
if (!RobotManage.mainMachine.StartAutoInOutTest(posindex,out string errmsg))
}
string posName = cmbPosition.Text;
//int posindex = RobotManage.AllPosList.IndexOf(cmbPosition.Text);
LogUtil.info($"库位:{cmbPosition.Text},index:{posName}");
if (!RobotManage.mainMachine.StartAutoTest(posName, out string errmsg))
{
MessageBox.Show(errmsg);
return;
......
......@@ -31,6 +31,9 @@ namespace TheMachine
{
this.components = new System.ComponentModel.Container();
this.groupInout = new System.Windows.Forms.GroupBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.cb_inoutdebugmode = new System.Windows.Forms.CheckBox();
this.btn_autoinout = new System.Windows.Forms.Button();
this.btnInStore = new System.Windows.Forms.Button();
......@@ -42,12 +45,9 @@ namespace TheMachine
this.label_verify = new System.Windows.Forms.Label();
this.cb_fixpos = new System.Windows.Forms.ComboBox();
this.storePosControl1 = new TheMachine.StorePosControl();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.groupInout.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
// groupInout
......@@ -64,6 +64,40 @@ namespace TheMachine
this.groupInout.TabStop = false;
this.groupInout.Text = "料仓操作";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.radioButton2);
this.groupBox1.Controls.Add(this.radioButton1);
this.groupBox1.Location = new System.Drawing.Point(15, 55);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(216, 52);
this.groupBox1.TabIndex = 104;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "料盘位置";
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(125, 22);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(71, 16);
this.radioButton2.TabIndex = 1;
this.radioButton2.TabStop = true;
this.radioButton2.Text = "下层料盘";
this.radioButton2.UseVisualStyleBackColor = true;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(7, 22);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(71, 16);
this.radioButton1.TabIndex = 0;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "上层料盘";
this.radioButton1.UseVisualStyleBackColor = true;
//
// cb_inoutdebugmode
//
this.cb_inoutdebugmode.AutoSize = true;
......@@ -78,7 +112,6 @@ namespace TheMachine
// btn_autoinout
//
this.btn_autoinout.BackColor = System.Drawing.SystemColors.Control;
this.btn_autoinout.Enabled = false;
this.btn_autoinout.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_autoinout.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_autoinout.Location = new System.Drawing.Point(15, 161);
......@@ -92,7 +125,6 @@ namespace TheMachine
// btnInStore
//
this.btnInStore.BackColor = System.Drawing.SystemColors.Control;
this.btnInStore.Enabled = false;
this.btnInStore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnInStore.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnInStore.Location = new System.Drawing.Point(15, 118);
......@@ -198,40 +230,6 @@ namespace TheMachine
this.storePosControl1.TabIndex = 227;
this.storePosControl1.Tag = "not";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.radioButton2);
this.groupBox1.Controls.Add(this.radioButton1);
this.groupBox1.Location = new System.Drawing.Point(15, 55);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(216, 52);
this.groupBox1.TabIndex = 104;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "料盘位置";
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(7, 22);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(71, 16);
this.radioButton1.TabIndex = 0;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "上层料盘";
this.radioButton1.UseVisualStyleBackColor = true;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(125, 22);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(71, 16);
this.radioButton2.TabIndex = 1;
this.radioButton2.TabStop = true;
this.radioButton2.Text = "下层料盘";
this.radioButton2.UseVisualStyleBackColor = true;
//
// uc_boxdebug
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......@@ -248,9 +246,9 @@ namespace TheMachine
this.Size = new System.Drawing.Size(981, 785);
this.groupInout.ResumeLayout(false);
this.groupInout.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!