Commit 2e3bc5cc 张东亮

0727

1 个父辈 4f2ed27e
正在显示 29 个修改的文件 包含 143 行增加26 行删除
......@@ -155,7 +155,7 @@ namespace AGVControl
if (rtn)
{
agv.GetPlace(regValue);
Common.LogInfo(string.Format("软件开启:{0} Get_Register PLC{1}={2} Place={3} PlaceState={4}", agv.Name, 20, regValue, agv.Place, agv.PlaceState));
Common.log.Debug(string.Format("软件开启:{0} Get_Register PLC{1}={2} Place={3} PlaceState={4}", agv.Name, 20, regValue, agv.Place, agv.PlaceState));
if (!agv.Place.Equals(""))
{
int idx = nodeInfo.FindIndex(s => s.Name == agv.Place);
......@@ -183,7 +183,7 @@ namespace AGVControl
{
clientNode.position.X = mirPosition.pos_x;
clientNode.position.Y = mirPosition.pos_y;
Common.LogInfo(string.Format("软件开启:{0} 获取节点位置({1},{2})", clientNode.Name, clientNode.position.X, clientNode.position.Y));
Common.log.Debug(string.Format("软件开启:{0} 获取节点位置({1},{2})", clientNode.Name, clientNode.position.X, clientNode.position.Y));
}
else
{
......@@ -511,13 +511,41 @@ namespace AGVControl
Position = new Agv_Info.clsPosition();
}
DateTime IoStartTime = DateTime.MaxValue;
int IoLastTime = 5000;
public bool SetState(int stateID, string stateText, int battery, string missionText, clsPosition position, bool[] input, bool[] output)
{
bool isChange = false;
bool preShelfState = IsExistShelf;
if (input != null && input.Length == 4)
{
IsExistShelf = input[3];//input[2] &&
bool reachIoValue = input[3].Equals(true);//input[2] &&
if (reachIoValue)
{
//满足给定的IO值,计算持续时间
if (IoStartTime == DateTime.MaxValue)
{
IoStartTime = DateTime.Now;
}
if (IoLastTime > 0)
{
//持续时间
TimeSpan lastTimeSpan = DateTime.Now - IoStartTime;
IsExistShelf = (lastTimeSpan.TotalMilliseconds >= IoLastTime);
}
else
{
IsExistShelf = true;
}
}
else
{
//重新计时
IoStartTime = DateTime.MinValue;
IsExistShelf = input[3];
}
}
if (!StateID.Equals(stateID) || !StateText.Equals(stateText)
|| !MissionText.Equals(missionText) || !IsExistShelf.Equals(preShelfState)) //!Battery.Equals(battery)
......
......@@ -137,9 +137,10 @@ namespace BLL
{
while (loop)
{
Thread.Sleep(1000);
Thread.Sleep(1500);
for (int i = 0; i < Common.agvInfo.Count; i++)
{
Thread.Sleep(1000);
if (!loop) break;
if (!Common.agvInfo[i].IsCon) continue; //AGV网络连接
if (!Common.agvInfo[i].IsUse) continue; //AGV是否可用
......@@ -614,6 +615,8 @@ namespace BLL
private bool CheckEmptyShelf(Agv_Info agv, string agvPlace, bool isAgvAtStandy = false)
{
if (agv.TaskSend != "")
return false;
//有空架任务
//限制待机位车辆只有一台执行空架任务
if (isAgvAtStandy)
......@@ -824,7 +827,7 @@ namespace BLL
}
else
{
Common.LogInfo(string.Format("{0}载大料架到达{1}[RFID={2}],等待料架解绑。。。", agv.Name, agv.Place, agv.RFID));
Common.LogInfo(string.Format("{0}载大料架到达{1}[RFID={2}],等待料架解绑...", agv.Name, agv.Place, agv.RFID));
return;
}
}
......@@ -879,8 +882,22 @@ namespace BLL
case "E14":
case "E15":
case "E16":
case "G1":
case "G2":
case "G3":
case "G4":
case "G5":
case "G6":
case "G7":
case "G8":
case "G9":
case "G10":
case "G11":
case "G12":
case "G13":
case "G14":
case "G15":
case "G16":
if (agv.RFID.StartsWith("D") || agv.RFID.StartsWith("C"))//不分大小料架
{
rtn = Common.server.ReadyEnter(agv.Place);
......@@ -972,7 +989,7 @@ namespace BLL
int.TryParse(msgs[0].msg.Substring(0, 1), out int resCode);
string resStr = msgs[0].msg.Substring(1, 2);
lineName = msgs[0].msg.Substring(3);
Common.LogInfo(string.Format("resCode={0},resStr={1},lineName={2}", resCode, resStr, lineName));
Common.LogInfo(string.Format("[{0}] [{1}]", addr, result),false);
if (lineName.Equals("").Equals(true))
return false;
if (resStr.Equals("OK") || resCode.Equals(1))
......@@ -995,11 +1012,20 @@ namespace BLL
{
//GET /ESMTCommonInterface/CommonService.asmx/UpdateStatusBy?id=string&location=string HTTP/1.1
//Host: 10.85.17.233
if (lineName.Equals("FeederIn"))
{
lineName = "Feeder";
}
else if (lineName.Equals("4CFeederIn"))
{
lineName = "4CFeeder";
}
string addr = "http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/UpdateStatusBy?id=" + rfid + "&location=" + lineName;
//[{"msg":"1更新成功"}]
try
{
string result = HttpHelper.Get(addr);
Common.LogInfo(string.Format("[{0}] [{1}]", addr, result),false);
if (!result.Equals(""))
{
List<Msg> msgs = JsonHelper.DeserializeJsonToList<Msg>(result);
......@@ -1049,6 +1075,7 @@ namespace BLL
case "A6":
// if (node.Action == ClientAction.FinishLeave)
// {
Common.LogInfo(string.Format("节点名:{0},节点动作:{1}", node.Name, node.Action));
string nextPlace = agv.NextPlace;
if (nextPlace.Equals(""))
return;
......@@ -1095,7 +1122,22 @@ namespace BLL
ResetNodeState(node, agv);
CheckA5A6State_SmallShelf(agv, node);
break;
case "G1":
case "G2":
case "G3":
case "G4":
case "G5":
case "G6":
case "G7":
case "G8":
case "G9":
case "G10":
case "G11":
case "G12":
case "G13":
case "G14":
case "G15":
case "G16":
case "G21":
case "G22":
//产线客户端不发FinishLeave
......@@ -1389,7 +1431,22 @@ namespace BLL
StatusCharge(agv);
//MoveStandby(agv);
break;
case "G1":
case "G2":
case "G3":
case "G4":
case "G5":
case "G6":
case "G7":
case "G8":
case "G9":
case "G10":
case "G11":
case "G12":
case "G13":
case "G14":
case "G15":
case "G16":
case "G21":
case "G22":
/// agv.RFID = "";
......@@ -1647,8 +1704,16 @@ namespace BLL
// Common.LogInfo("节点[" + loc + "]当前有任务,延迟A6出满料架任务");
// return false;
//}
//检查是否有车接到满料架任务,有则不再重复分配
int id = Common.agvInfo.FindIndex(s => s.RFID == rfid);
if (id>-1)
{
Common.LogInfo(Common.agvInfo[i].Name + " 正在执行满料架任务:目的地为 " + loc + " [产线名 " + res[0].location + "],不可重复分配小车");
return false;
}
dest = loc;
Common.LogInfo("出满料架任务:目的地为 " + loc + " [产线名 " + res[0].location + "]");
Common.LogInfo("收到满料架任务[RFID="+rfid+"]:目的地为 " + loc + " [产线名 " + res[0].location + "]");
return true;
}
else
......
......@@ -17,16 +17,25 @@
4D-16线,MoveE16,5ec0f64a-b51a-11ea-b6ad-00012998f5a0
4D-FeedeerIn,MoveE21,37401585-b51b-11ea-b6ad-00012998f5a0
4D-FeederOut,MoveE22,a4846723-b51b-11ea-b6ad-00012998f5a0
4C-4D门,MoveDoorCToD,d67f31c8-ca7e-11ea-9a66-94c691a7387d
4D-4C门,MoveDoorDToC,fd6e26ac-c1bf-11ea-9a66-94c691a7387d
4C-4D门,MoveDoorCToD,d67f31c8-ca7e-11ea-9a66-94c691a7387d
4C-1线,MoveG1,94a15e2c-cda7-11ea-a3e4-94c691a7387d
4C-2线,MoveG2,cece230b-cda7-11ea-a3e4-94c691a7387d
4C-3线,MoveG3,e393e846-cda7-11ea-a3e4-94c691a7387d
4C-4线,MoveG4,0b297e08-cda8-11ea-a3e4-94c691a7387d
4C-5线,MoveG5,1d3512ae-cda8-11ea-a3e4-94c691a7387d
4C-6线,MoveG6,33c8d629-cda8-11ea-a3e4-94c691a7387d
4C-7线,MoveG7,56c5a660-cda8-11ea-a3e4-94c691a7387d
4C-8线,MoveG8,6873fd7f-cda8-11ea-a3e4-94c691a7387d
4C-9线,MoveG9,8ba46b72-cda8-11ea-a3e4-94c691a7387d
4C-10线,MoveG10,c0b75c41-ca7d-11ea-9a66-94c691a7387d
4C-FeedeerIn,MoveG21,0a657afd-ca9d-11ea-9a66-94c691a7387d
4C-FeedeerOut,MoveG22,0a657afd-ca9d-11ea-9a66-94c691a7387d
小车初始化,Init,adcb7a04-b525-11ea-b6ad-00012998f5a0
4C-FeedeerOut,MoveG22,83b9ba6d-cdb2-11ea-a3e4-94c691a7387d
小车进料,Enter,51233d8c-c044-11ea-9a66-94c691a7387d
小车出料,Leave,2e433130-c045-11ea-9a66-94c691a7387d
待机位,MoveStandby,ae6e4f12-c050-11ea-9a66-94c691a7387d
1764充电桩,AutoCharge3,b7371c5f-c045-11ea-9a66-94c691a7387d
1763充电桩,AutoCharge4,1296084c-c046-11ea-9a66-94c691a7387d
1767充电桩,AutoCharge5,40c8f44e-c046-11ea-9a66-94c691a7387d
1768充电桩,AutoCharge6,56cca0a3-c046-11ea-9a66-94c691a7387d
小车初始化,Init,adcb7a04-b525-11ea-b6ad-00012998f5a0
待机位,MoveStandby,ae6e4f12-c050-11ea-9a66-94c691a7387d
\ No newline at end of file
......@@ -17,18 +17,18 @@ D15,E15,10.85.199.1,4D-15Ïß,DL15,fd6b1f95-b432-11ea-a1a5-00012999830e
D16,E16,10.85.199.1,4D-16线,line_16,ac6c413e-895e-11ea-9374-000129922ca6
FeederIn,E21,10.85.199.1,4D-FeedeerIn,FI,1e546c3a-8abe-11ea-ab63-000129922ca6
FeederOut,E22,10.85.199.1,4D-FeederOut,FO,431649a4-8abe-11ea-ab63-000129922ca6
C1,G1,10.85.199.1,4C-1线,G1,d402fbc2-cdac-11ea-a3e4-94c691a7387d
C2,G2,10.85.199.1,4C-2线,G2,ce0d60e9-cdac-11ea-a3e4-94c691a7387d
C3,G3,10.85.199.1,4C-3线,G3,c768170a-cdac-11ea-a3e4-94c691a7387d
C4,G4,10.85.199.1,4C-4线,G4,c2de9745-cdac-11ea-a3e4-94c691a7387d
C5,G5,10.85.199.1,4C-5线,G5,be468ef4-cdac-11ea-a3e4-94c691a7387d
C6,G6,10.85.199.1,4C-6线,G6,b9117881-cdac-11ea-a3e4-94c691a7387d
C7,G7,10.85.199.1,4C-7线,G7,b3cda9db-cdac-11ea-a3e4-94c691a7387d
C8,G8,10.85.199.1,4C-8线,G8,ae09fc56-cdac-11ea-a3e4-94c691a7387d
C9,G9,10.85.199.1,4C-9线,G9,a64bdbbb-cdac-11ea-a3e4-94c691a7387d
C10,G10,10.85.199.1,4C-10线,G10,604b1c3c-ca4e-11ea-810b-00012999830e
4CFeederIn,G21,10.85.199.1,4C-FeederIn,tyty,cb7f117b-ca88-11ea-9b28-0001299981d4
4CFeederOut,G22,10.85.199.1,4C-FeederOut,tyty,cb7f117b-ca88-11ea-9b28-0001299981d4
C1,G1,10.85.199.1,4C-1线,PA23,
C2,G2,10.85.199.1,4C-2线,PA24,
C3,G3,10.85.199.1,4C-3线,PA25,
C4,G4,10.85.199.1,4C-4线,PA26,
C5,G5,10.85.199.1,4C-5线,PA27,
C6,G6,10.85.199.1,4C-6线,PA28,
C7,G7,10.85.199.1,4C-7线,PA29,
C8,G8,10.85.199.1,4C-8线,PA30,
C9,G9,10.85.199.1,4C-9线,PA31,
C11,G11,10.85.199.1,4C-11线,PA33,
C12,G12,10.85.199.1,4C-12线,PA34,
C13,G13,10.85.199.1,4C-13线,PA35,
......
此文件类型无法预览
......@@ -38,7 +38,8 @@ namespace AsaPL
/// </summary>
public event ActionEvent ReadyLeave;
public event ActionEvent AGVFinishEnter;
public event ActionEvent AGVFinishLeave;
/// <summary>
/// AGV客户端,对接双层线、生产线
/// </summary>
......@@ -281,6 +282,16 @@ namespace AsaPL
LOG.Info("Trigger ReadyLeave Event");
ReadyLeave?.Invoke(result.Name);
}
else if(result.Action == ClientAction.FinishEnter)
{
LOG.Info("Trigger FinishEnter Event");
AGVFinishEnter?.Invoke(result.Name);
}
else if(result.Action == ClientAction.FinishLeave)
{
LOG.Info("Trigger FinishLeave Event");
AGVFinishLeave.Invoke(result.Name);
}
}
catch (Exception ex)
{
......
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6.1", FrameworkDisplayName = ".NET Framework 4.6.1")]
ec6aee87f9b709a7f2a5f0b83b5077dae48fc539
7f7cf6947289818288a68ab66d5fcb72219f75c1
......@@ -19,3 +19,4 @@ C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.cspro
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AsaPL.AgvClient.dll
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AsaPL.AgvClient.pdb
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csprojAssemblyReference.cache
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csproj.CoreCompileInputs.cache
......@@ -47,7 +47,6 @@ namespace AgvClientTest
client.SetStatus("E16", "", AsaPL.ClientAction.None);
client.SetStatus("E21", "", AsaPL.ClientAction.None);
client.SetStatus("E22", "", AsaPL.ClientAction.None);
client.SetStatus("G10", "", AsaPL.ClientAction.None);
client.SetStatus("G21", "", AsaPL.ClientAction.None);
client.SetStatus("G22", "", AsaPL.ClientAction.None);
client.Connect();
......@@ -58,7 +57,7 @@ namespace AgvClientTest
{
if (checkBox1.Checked)
{
if (nodeName.StartsWith("A") || nodeName.EndsWith("A"))
if (nodeName.StartsWith("A") || nodeName.EndsWith("A"))//|| nodeName.Equals("G10") || nodeName.Equals("G7")
return;
label4.Text = "收到" + nodeName + "ReadyEnter,节点状态变为MayEnter";
client.SetStatus(nodeName, "", AsaPL.ClientAction.MayEnter);
......@@ -73,7 +72,7 @@ namespace AgvClientTest
{
if (checkBox1.Checked)
{
if (nodeName.StartsWith("A") || nodeName.EndsWith("A"))
if (nodeName.StartsWith("A") || nodeName.EndsWith("A"))//|| nodeName.Equals("G10") || nodeName.Equals("G7")
return;
label4.Text = "收到" + nodeName + "ReadyLeave,节点状态变为MayLeave";
client.SetStatus(nodeName, "", AsaPL.ClientAction.MayLeave);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!