Commit 8df24709 张东亮

0804

1 个父辈 ac0f8736
......@@ -84,6 +84,8 @@ namespace BLL
Common.LogInfo("Server Stop");
}
public Dictionary<string, DateTime> readyEnterTime = new Dictionary<string, DateTime>();
public Dictionary<string, DateTime> readyLeaveTime = new Dictionary<string, DateTime>();
public bool ReadyEnter(string nodeName, string rfid = "")
{
int nodeIdx = Common.nodeInfo.FindIndex(s => s.Name == nodeName);
......@@ -96,6 +98,28 @@ namespace BLL
}
else
{
try
{
if (!readyEnterTime.ContainsKey(nodeName))
{
readyEnterTime.Add(nodeName, DateTime.Now);
}
else
{
TimeSpan timeSpan = DateTime.Now - readyEnterTime[nodeName];
if (timeSpan.TotalSeconds < 45)
{
Common.log.Debug(nodeName + " " + ip + " ReadyEnter 45秒内不重复发送");
return false;
}
else if (timeSpan.TotalMinutes > 2)
{
readyEnterTime[nodeName] = DateTime.Now;
}
}
}
catch(Exception ex) { Common.log.Debug(ex.Message +";"+ex.StackTrace); }
ClientNode node = new ClientNode(nodeName, rfid, ClientAction.ReadyEnter);
byte[] buff = Encode(node);
return Send(idx, buff);
......@@ -114,6 +138,28 @@ namespace BLL
}
else
{
try
{
if (!readyLeaveTime.ContainsKey(nodeName))
{
readyLeaveTime.Add(nodeName, DateTime.Now);
}
else
{
TimeSpan timeSpan = DateTime.Now - readyLeaveTime[nodeName];
if (timeSpan.TotalSeconds < 45)
{
Common.log.Debug(nodeName + " " + ip + " ReadyLeave 45秒内不重复发送");
return false;
}
else if (timeSpan.TotalMinutes > 3)
{
readyLeaveTime[nodeName] = DateTime.Now;
}
}
}
catch (Exception ex) { Common.log.Debug(ex.Message + ";" + ex.StackTrace); }
ClientNode node = new ClientNode(nodeName, rfid, ClientAction.ReadyLeave);
byte[] buff = Encode(node);
return Send(idx, buff);
......@@ -292,7 +338,7 @@ namespace BLL
_client.Add(client);
listen.Start(_client.Count - 1);
Common.LogInfo(string.Format("[{0}] 已连接", client.IP), false);
Common.log.Debug(string.Format("[{0}] 已连接", client.IP));
}
catch (SocketException)
{
......@@ -347,10 +393,10 @@ namespace BLL
else
{
time += sleep;
if (time > 60000)
if (time > 120000)
{
Offline(client);
Common.LogInfo("[" + client.IP + "] 超过60s没有收到数据,关闭连接", false);
Common.log.Debug("[" + client.IP + "] 超过2分钟没有收到数据,关闭连接");
}
}
}
......
......@@ -464,7 +464,7 @@ namespace AGVControl
/// <summary>
/// 任务发送
/// </summary>
public string TaskSend { set; get; }
public string TaskSend { set; get; } = "";
/// <summary>
/// 闲置等待时间,用于充电
/// </summary>
......@@ -566,11 +566,12 @@ namespace AGVControl
public void GetPlace(int value)
{
if (value < 1000)
if (value>=0 && value < 1000)
{
Place = "";
PlaceState = PlaceState.None;
TaskSend = "";
//TaskSend = "";
Common.log.Debug(Name+ " 获取小车PLC20值,PLC=" + value);
}
else
{
......
......@@ -139,7 +139,7 @@ namespace BLL
{
while (loop)
{
Thread.Sleep(1500);
Thread.Sleep(1000);
for (int i = 0; i < Common.agvInfo.Count; i++)
{
if (!loop) break;
......@@ -153,7 +153,7 @@ namespace BLL
continue;
}
//Common.log.Info(Common.agvInfo[i].Name+"," + Common.agvInfo[i].PlaceState + "," + Common.agvInfo[i].TaskSend);
Common.log.Debug(Common.agvInfo[i].Name + "," + Common.agvInfo[i].PlaceState + "," + Common.agvInfo[i].TaskSend);
switch (Common.agvInfo[i].PlaceState)
{
......@@ -250,7 +250,6 @@ namespace BLL
}
return rtn;
}
/// <summary>
/// agv空闲
/// </summary>
......@@ -259,7 +258,7 @@ namespace BLL
{
Agv_Info agv = Common.agvInfo[idx];
if (agv.TaskSend != "") return;
if (!agv.TaskSend.Equals("") && !agv.TaskSend.Equals("AutoCharge")) return;
agv.PlaceAliceName = "";
agv.Msg = "";
//空闲状态下,清空空架任务agv名字
......@@ -373,6 +372,8 @@ namespace BLL
/// <returns>充电任务结果</returns>
private bool StatusCharge(Agv_Info agv, bool isRemovePreMission = false)
{
if (agv.TaskSend != "")
return false;
bool rtn;
string log;
double sp = (DateTime.Now.Ticks - Common.chargeStatus.chargeInterval) / 10000000.0;
......@@ -485,7 +486,7 @@ namespace BLL
if (rtn)
{
//agv.TaskSend = "AutoCharge3";
agv.TaskSend = "";
agv.TaskSend = "AutoCharge";
Common.chargeStatus.charge3 = agv.Name;
Common.chargeStatus.chargeInterval = DateTime.Now.Ticks;
log = string.Format("{0} AutoCharge3", agv.Name);
......@@ -509,7 +510,7 @@ namespace BLL
if (rtn)
{
//agv.TaskSend = "AutoCharge4";
agv.TaskSend = "";
agv.TaskSend = "AutoCharge";
Common.chargeStatus.charge4 = agv.Name;
Common.chargeStatus.chargeInterval = DateTime.Now.Ticks;
log = string.Format("{0} AutoCharge4", agv.Name);
......@@ -533,7 +534,7 @@ namespace BLL
if (rtn)
{
//agv.TaskSend = "AutoCharge5";
agv.TaskSend = "";
agv.TaskSend = "AutoCharge";
Common.chargeStatus.charge5 = agv.Name;
Common.chargeStatus.chargeInterval = DateTime.Now.Ticks;
log = string.Format("{0} AutoCharge5", agv.Name);
......@@ -557,7 +558,7 @@ namespace BLL
if (rtn)
{
//agv.TaskSend = "AutoCharge6";
agv.TaskSend = "";
agv.TaskSend = "AutoCharge";
Common.chargeStatus.charge4 = agv.Name;
Common.chargeStatus.chargeInterval = DateTime.Now.Ticks;
log = string.Format("{0} AutoCharge6", agv.Name);
......@@ -592,13 +593,13 @@ namespace BLL
int index;
string RFID = "";
Thread.Sleep(3000);
if (agv.TaskSend != "")
if (!agv.TaskSend.Equals("") && !agv.TaskSend.Equals("AutoCharge"))
return false;
//A6出满料
rtn = FindA6Leave(out string nextNode);
if (rtn && !agv.IsExistShelf)
{
rtn = Common.mir.Add_Mission(agv, Common.agvMission["MoveA6"]);
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["MoveA6"]);
if (rtn)
{
agv.NextPlace = nextNode;
......@@ -610,7 +611,7 @@ namespace BLL
Common.nodeInfo[index].AgvName = agv.Name;
}
agv.Msg = string.Format("{0} A6有满料架[{1}]要出,目的地为{2}", agv.Name, RFID, nextNode);
Common.LogInfo(string.Format("{0} A6有满料架[{1}]要出,目的地为{2}[{3}]", agv.Name, RFID, nextNode,agv.PlaceState));
Common.LogInfo(string.Format("{0} A6有满料架[{1}]要出,目的地为{2}[{3}]", agv.Name, RFID, nextNode, agv.PlaceState));
agv.TaskSend = rtn ? "MoveA6" : "";
return true;
}
......@@ -627,7 +628,7 @@ namespace BLL
private bool CheckEmptyShelf(Agv_Info agv, string agvPlace, bool isAgvAtStandy = false)
{
if (agv.TaskSend != "")
if (!agv.TaskSend.Equals("") && !agv.TaskSend.Equals("AutoCharge"))
return false;
//有空架任务
//限制待机位车辆只有一台执行空架任务
......@@ -729,7 +730,7 @@ namespace BLL
}
if (Common.missionManager.missionList.Count.Equals(0).Equals(false))
{
if(EmptyTaskCnt!= Common.missionManager.missionList.Count)
if (EmptyTaskCnt != Common.missionManager.missionList.Count)
{
EmptyTaskCnt = Common.missionManager.missionList.Count;
AgvMissionChanged?.Invoke();
......@@ -748,19 +749,7 @@ namespace BLL
/// <param name="idx"></param>
private void StateMove(int idx)
{
//bool rtn;
//Agv_Info agv = Common.agvInfo[idx];
//int index = FindNode(agv.Place);
//if (index == -1) return;
//ClientNode node = Common.nodeInfo[index];
//switch (agv.Place)
//{
// case "":
// agv.TaskSend = "";
// agv.NextPlace = "";
// break;
//}
}
/// <summary>
/// agv运动完成
......@@ -783,23 +772,24 @@ namespace BLL
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]);
agv.TaskSend = rtn ? "Leave" : "";
if (rtn)
Common.LogInfo(string.Format("{0}到达{1},可以进入料架", agv.Name, agv.Place));
Common.LogInfo(string.Format("{0}到达{1},{1}可以进入料架", agv.Name, agv.Place));
}
else
{
rtn = Common.server.ReadyEnter(agv.Place);
if (!rtn) return;
Common.LogInfo(string.Format("{0}到达{1},服务器发送ReadyEnter信号", agv.Name, agv.Place));
Common.LogInfo(string.Format("{0}到达{1},服务器发送ReadyEnter信号", agv.Name, agv.Place),false);
}
break;
case "A6":
if (node.Action == ClientAction.MayEnter)
{
if (agv.TaskSend == "Leave") return;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]);
agv.TaskSend = rtn ? "Leave" : "";
if (rtn)
Common.LogInfo(string.Format("{0}到达{1},可以进入料架", agv.Name, agv.Place));
Common.LogInfo(string.Format("{0}到达{1},{1}可以进入料架", agv.Name, agv.Place));
}
else if (node.Action == ClientAction.MayLeave)
{
......@@ -807,19 +797,27 @@ namespace BLL
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Enter"]);
agv.TaskSend = rtn ? "Enter" : "";
if (rtn)
Common.LogInfo(string.Format("{0}到达{1},可以出去料架", agv.Name, agv.Place));
Common.LogInfo(string.Format("{0}到达{1},{1}可以出去料架", agv.Name, agv.Place));
}
else if (node.Action == ClientAction.NeedEnter)
{
rtn = Common.server.ReadyEnter(agv.Place);
if (!rtn) return;
Common.LogInfo(string.Format("{0}到达{1},服务器发送ReadyEnter信号", agv.Name, agv.Place));
if (agv.IsExistShelf)//车上有料架
{
rtn = Common.server.ReadyEnter(agv.Place);
if (!rtn) return;
Common.LogInfo(string.Format("{0}到达{1},服务器发送ReadyEnter信号", agv.Name, agv.Place),false);
}
}
else if (node.Action == ClientAction.NeedLeave)
{
if (agv.IsExistShelf)//车上有料架,回待机位。避免在待机位时,空架信号误感应
{
StatusCharge(agv, true);
return;
}
rtn = Common.server.ReadyLeave(agv.Place);
if (!rtn) return;
Common.LogInfo(string.Format("{0}到达{1},服务器发送ReadyLeave信号", agv.Name, agv.Place));
Common.LogInfo(string.Format("{0}到达{1},服务器发送ReadyLeave信号", agv.Name, agv.Place),false);
}
else if (node.Action == ClientAction.NeedEnterLeave)
{
......@@ -827,21 +825,36 @@ namespace BLL
{
rtn = Common.server.ReadyEnter(agv.Place);
if (!rtn) return;
Common.LogInfo(string.Format("{0}到达{1},服务器发送ReadyEnter信号", agv.Name, agv.Place));
Common.LogInfo(string.Format("{0}到达{1},服务器发送ReadyEnter信号", agv.Name, agv.Place),false);
}
else
{
rtn = Common.server.ReadyLeave(agv.Place);
if (!rtn) return;
Common.LogInfo(string.Format("{0}到达{1},服务器发送ReadyLeave信号", agv.Name, agv.Place));
Common.LogInfo(string.Format("{0}到达{1},服务器发送ReadyLeave信号", agv.Name, agv.Place),false);
}
}
break;
case "E1":
if (node.Action == ClientAction.MayEnter)
{
if (agv.TaskSend == "Leave") return;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]);
agv.TaskSend = rtn ? "Leave" : "";
if (rtn)
Common.LogInfo(string.Format("{0}到达{1},{1}可以进入料架", agv.Name, agv.Place));
}
else if (node.Action == ClientAction.MayLeave)
{
if (agv.TaskSend == "Enter") return;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Enter"]);
agv.TaskSend = rtn ? "Enter" : "";
if (rtn)
Common.LogInfo(string.Format("{0}到达{1},{1}可以出去料架", agv.Name, agv.Place));
}
//C是大料架,D是小料架
//大料架
if (agv.RFID.StartsWith("C"))
else if (agv.RFID.StartsWith("C"))
{
//获取大料架解绑状态
bool state = GetRackBy(agv.RFID, out string linename);
......@@ -878,7 +891,7 @@ namespace BLL
}
StatusCharge(agv, true);
agv.Msg = string.Format("{0} 大料架[RFID={1}]解绑,A5、A6暂无空位,运往[{2}]", agv.Name, agv.RFID,"待机位");
agv.Msg = string.Format("{0} 大料架[RFID={1}]解绑,A5、A6暂无空位,运往[{2}]", agv.Name, agv.RFID, "待机位");
Common.LogInfo(string.Format("{0} 大料架[RFID={1}]解绑,A5、A6暂无空位,运往[{2}]", agv.Name, agv.RFID, "待机位"));
}
......@@ -894,7 +907,7 @@ namespace BLL
{
rtn = Common.server.ReadyEnter(agv.Place);
if (!rtn) return;
Common.LogInfo(string.Format("{0}载小料架到达{1}[RFID={2}],服务器发送ReadyEnter信号", agv.Name, agv.Place, agv.RFID));
Common.LogInfo(string.Format("{0}载小料架到达{1}[RFID={2}],服务器发送ReadyEnter信号", agv.Name, agv.Place, agv.RFID),false);
}
else if (agv.IsExistShelf)//有负载,可能软件重启导致RFID丢失
{
......@@ -907,25 +920,9 @@ namespace BLL
{
rtn = Common.server.ReadyLeave(agv.Place);
if (!rtn) return;
Common.LogInfo(string.Format("{0}到达{1},服务器发送ReadyLeave信号", agv.Name, agv.Place));
Common.LogInfo(string.Format("{0}到达{1},服务器发送ReadyLeave信号", agv.Name, agv.Place),false);
}
if (node.Action == ClientAction.MayEnter)
{
if (agv.TaskSend == "Leave") return;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]);
agv.TaskSend = rtn ? "Leave" : "";
if (rtn)
Common.LogInfo(string.Format("{0}到达{1},可以进入料架", agv.Name, agv.Place));
}
else if (node.Action == ClientAction.MayLeave)
{
if (agv.TaskSend == "Enter") return;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Enter"]);
agv.TaskSend = rtn ? "Enter" : "";
if (rtn)
Common.LogInfo(string.Format("{0}到达{1},可以出去料架", agv.Name, agv.Place));
}
break;
case "E2":
case "E3":
......@@ -957,18 +954,6 @@ namespace BLL
case "G14":
case "G15":
case "G16":
if (agv.RFID.StartsWith("D") || agv.RFID.StartsWith("C"))//不分大小料架
{
rtn = Common.server.ReadyEnter(agv.Place);
if (!rtn) return;
Common.LogInfo(string.Format("{0}载小料架到达{1}[RFID={2}],服务器发送ReadyEnter信号", agv.Name, agv.Place, agv.RFID));
}
else//其他地方到E区域,则是空车
{
rtn = Common.server.ReadyLeave(agv.Place);
if (!rtn) return;
Common.LogInfo(string.Format("{0}到达{1},服务器发送ReadyLeave信号", agv.Name, agv.Place));
}
if (node.Action == ClientAction.MayEnter)
{
......@@ -976,7 +961,7 @@ namespace BLL
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]);
agv.TaskSend = rtn ? "Leave" : "";
if (rtn)
Common.LogInfo(string.Format("{0}到达{1},可以进入料架", agv.Name, agv.Place));
Common.LogInfo(string.Format("{0}到达{1},{1}可以进入料架", agv.Name, agv.Place));
}
else if (node.Action == ClientAction.MayLeave)
{
......@@ -984,8 +969,21 @@ namespace BLL
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Enter"]);
agv.TaskSend = rtn ? "Enter" : "";
if (rtn)
Common.LogInfo(string.Format("{0}到达{1},可以出去料架", agv.Name, agv.Place));
Common.LogInfo(string.Format("{0}到达{1},{1}可以出去料架", agv.Name, agv.Place));
}
else if (agv.RFID.StartsWith("D") || agv.RFID.StartsWith("C"))//不分大小料架
{
rtn = Common.server.ReadyEnter(agv.Place);
if (!rtn) return;
Common.LogInfo(string.Format("{0}载小料架到达{1}[RFID={2}],服务器发送ReadyEnter信号", agv.Name, agv.Place, agv.RFID),false);
}
else//其他地方到E区域,则是空车
{
rtn = Common.server.ReadyLeave(agv.Place);
if (!rtn) return;
Common.LogInfo(string.Format("{0}到达{1},服务器发送ReadyLeave信号", agv.Name, agv.Place),false);
}
break;
case "E21":
case "G21":
......@@ -998,7 +996,7 @@ namespace BLL
if (rtn)
{
Common.IsAllowLeaveOrEnter = false;
Common.LogInfo(string.Format("{0}到达{1},可以进入料架", agv.Name, agv.Place));
Common.LogInfo(string.Format("{0}到达{1},{1}可以进入料架", agv.Name, agv.Place));
}
break;
......@@ -1014,7 +1012,7 @@ namespace BLL
if (rtn)
{
Common.IsAllowLeaveOrEnter = false;
Common.LogInfo(string.Format("{0}到达{1},可以出去料架", agv.Name, agv.Place));
Common.LogInfo(string.Format("{0}到达{1},{1}可以出去料架", agv.Name, agv.Place));
}
break;
......@@ -1060,7 +1058,8 @@ namespace BLL
catch (Exception ex)
{
Common.log.Error(ex.Message);
return false; }
return false;
}
return false;
}
......@@ -1098,7 +1097,7 @@ namespace BLL
{
if (resCode.Equals(1))
{
Common.LogInfo(string.Format("{0}物料状态更新成功[{1}]", lineName, rfid));
Common.LogInfo(string.Format("产线{0} 物料状态更新成功[{1}]", lineName, rfid));
return true;
}
......@@ -1127,7 +1126,7 @@ namespace BLL
{
bool rtn;
Agv_Info agv = Common.agvInfo[idx];
if (agv.TaskSend != "") return;
if (!agv.TaskSend.Equals("") && !agv.TaskSend.Equals("AutoCharge")) return;
int index = FindNode(agv.Place);
if (index == -1) return;
ClientNode node = Common.nodeInfo[index];
......@@ -1312,7 +1311,7 @@ namespace BLL
/// <param name="agv"></param>
private void CheckA5A6State_SmallShelf(Agv_Info agv)
{
if (agv.TaskSend != "")
if (!agv.TaskSend.Equals("") && !agv.TaskSend.Equals("AutoCharge"))
return;
bool rtn = false;
int tarIdx = Common.nodeInfo.FindIndex(s => s.Name == "A5"
......@@ -1323,11 +1322,11 @@ namespace BLL
}
else
{
rtn = Common.mir.Add_Mission(agv, Common.agvMission["MoveA5"]);
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["MoveA5"]);
if (rtn)
{
agv.NextPlace = "";
agv.TaskSend = rtn ? "MoveA5" : "";
agv.TaskSend = "MoveA5";
Common.nodeInfo[tarIdx].AgvName = agv.Name;
agv.Msg = string.Format("{0} 已装载料架 {1},送往A5", agv.Name, agv.RFID);
Common.LogInfo(string.Format("{0} 已装载料架 {1},送往A5", agv.Name, agv.RFID));//小
......@@ -1344,11 +1343,11 @@ namespace BLL
}
else
{
rtn = Common.mir.Add_Mission(agv, Common.agvMission["MoveA6"]);
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["MoveA6"]);
if (rtn)
{
agv.NextPlace = "";
agv.TaskSend = rtn ? "MoveA6" : "";
agv.TaskSend = "MoveA6";
Common.nodeInfo[tarIdx].AgvName = agv.Name;
agv.Msg = string.Format("{0} 已装载料架 {1},送往A6", agv.Name, agv.RFID);
Common.LogInfo(string.Format("{0} 已装载料架 {1},送往A6", agv.Name, agv.RFID));//小
......@@ -1363,6 +1362,8 @@ namespace BLL
/// <param name="agv"></param>
private void CheckA5A6State_BigShelf(Agv_Info agv)
{
if (!agv.TaskSend.Equals("") && !agv.TaskSend.Equals("AutoCharge"))
return;
bool rtn = false;
int tarIdx = Common.nodeInfo.FindIndex(s => s.Name == "A5"
&& (s.Action == ClientAction.NeedC || s.Action == ClientAction.NeedEnter) && s.IsUse);
......@@ -1372,11 +1373,11 @@ namespace BLL
}
else
{
rtn = Common.mir.Add_Mission(agv, Common.agvMission["MoveA5"]);
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["MoveA5"]);
if (rtn)
{
agv.NextPlace = "";
agv.TaskSend = rtn ? "MoveA5" : "";
agv.TaskSend = "MoveA5";
Common.nodeInfo[tarIdx].AgvName = agv.Name;
agv.Msg = string.Format("{0} 已装载料架 {1},送往A5", agv.Name, agv.RFID);
Common.LogInfo(string.Format("{0} 已装载料架 {1},送往A5", agv.Name, agv.RFID));//小
......@@ -1393,12 +1394,12 @@ namespace BLL
}
else
{
rtn = Common.mir.Add_Mission(agv, Common.agvMission["MoveA6"]);
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["MoveA6"]);
if (rtn)
{
agv.NextPlace = "";
Common.nodeInfo[tarIdx].AgvName = agv.Name;
agv.TaskSend = rtn ? "MoveA6" : "";
agv.TaskSend = "MoveA6";
agv.Msg = string.Format("{0} 已装载料架 {1},送往A6", agv.Name, agv.RFID);
Common.LogInfo(string.Format("{0} 已装载料架 {1},送往A6", agv.Name, agv.RFID));//小
}
......@@ -1421,7 +1422,7 @@ namespace BLL
{
Agv_Info agv = Common.agvInfo[idx];
if (agv.TaskSend != "") return;
if (!agv.TaskSend.Equals("") && !agv.TaskSend.Equals("AutoCharge")) return;
int index = FindNode(agv.Place);
if (index == -1) return;
ClientNode node = Common.nodeInfo[index];
......@@ -1628,7 +1629,7 @@ namespace BLL
private bool MoveStandby(Agv_Info agv)
{
string log;
if (agv.TaskSend != "")
if (!agv.TaskSend.Equals("") && !agv.TaskSend.Equals("AutoCharge"))
return false;
//清除当前任务点
if (!agv.Place.Equals(""))
......@@ -1803,7 +1804,7 @@ namespace BLL
{
if (loc.Equals(item.NodeName))
{
Common.LogInfo("节点[" + loc + "]当前有空架任务,延迟A6出满料架任务", false);
Common.LogInfo("节点[" + loc + "]当前有空架任务,延迟A6出满料架任务[" + rfid + "]", false);
return false;
}
}
......@@ -1811,17 +1812,17 @@ namespace BLL
if (Common.nodeInfo[i].Name.StartsWith("G") && Common.nodeInfo[i].AgvName.Equals("").Equals(false))//有小车在目标任务点(限制4C车间),等待结束后再接任务
{
Common.LogInfo("节点[" + loc + "]当前有任务,延迟A6出满料架任务");
Common.LogInfo("节点[" + loc + "]当前有任务,延迟A6出满料架任务["+rfid+"]",false);
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;
}
//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("收到满料架任务[RFID=" + rfid + "]:目的地为 " + loc + " [产线名 " + res[0].location + "]");
return true;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Script.Serialization;
using AGVControl;
using RestSharp;
......@@ -188,7 +189,17 @@ namespace BLL
string s = dic["mission_id"].ToString();
if (s == mission_id)
{
try
{
var key = Common.agvMission.Where(qq => qq.Value == mission_id).Select(qq => qq.Key);
Common.LogInfo(string.Format("{0} Add_Mission [{1}]", info.Name, key.ToList()[0]));
}
catch { Common.LogInfo(string.Format("{0} Add_Mission [{1}]", info.Name, mission_id)); }
return true;
}
else
return false;
}
......@@ -225,7 +236,16 @@ namespace BLL
string s = dic["mission_id"].ToString();
if (s == mission_id)
{
try
{
var key = Common.agvMission.Where(qq => qq.Value == mission_id).Select(qq => qq.Key);
Common.LogInfo(string.Format("{0} Add_Mission_Fleet [{1}]", info.Name, key.ToList()[0]));
}
catch { Common.LogInfo(string.Format("{0} Add_Mission_Fleet [{1}]", info.Name, mission_id)); }
return true;
}
else
return false;
}
......@@ -527,7 +547,7 @@ namespace BLL
ping.Dispose();
if (result.Status != System.Net.NetworkInformation.IPStatus.Success)
{
Common.LogInfo("Ping " + ip + " 请求没有响应");
Common.log.Debug("Ping " + ip + " 请求没有响应");
return false;
}
return true;
......
......@@ -213,9 +213,9 @@ namespace AGVControl
//清除小车缓存
Common.LogInfo(string.Format("手动清除agv缓存,{0} {1}", Common.agvInfo[e.RowIndex].Name, Common.agvInfo[e.RowIndex].Place));
string place = Common.agvInfo[e.RowIndex].Place;
Common.agvInfo[e.RowIndex].Place = "";
//Common.agvInfo[e.RowIndex].Place = "";
Common.agvInfo[e.RowIndex].PlaceAliceName = "";
Common.agvInfo[e.RowIndex].RFID = "";
//Common.agvInfo[e.RowIndex].RFID = "";
Common.agvInfo[e.RowIndex].NextPlace = "";
Common.agvInfo[e.RowIndex].NextPlaceAliceName = "";
Common.agvInfo[e.RowIndex].TaskSend = "";
......
......@@ -31,20 +31,20 @@ namespace AgvClientTest
client = new AsaPL.AgvClient("10.85.199.1");
client.ReadyEnter += AGV_ReadyEnter;
client.ReadyLeave += AGV_ReadyLeave;
client.SetStatus("E1", "", AsaPL.ClientAction.None);
client.SetStatus("E2", "", AsaPL.ClientAction.None);
client.SetStatus("E3", "", AsaPL.ClientAction.None);
client.SetStatus("E4", "", AsaPL.ClientAction.None);
client.SetStatus("E5", "", AsaPL.ClientAction.None);
client.SetStatus("E6", "", AsaPL.ClientAction.None);
client.SetStatus("E8", "", AsaPL.ClientAction.None);
client.SetStatus("E9", "", AsaPL.ClientAction.None);
client.SetStatus("E10", "", AsaPL.ClientAction.None);
client.SetStatus("E11", "", AsaPL.ClientAction.None);
client.SetStatus("E12", "", AsaPL.ClientAction.None);
client.SetStatus("E14", "", AsaPL.ClientAction.None);
client.SetStatus("E15", "", AsaPL.ClientAction.None);
client.SetStatus("E16", "", AsaPL.ClientAction.None);
//client.SetStatus("E1", "", AsaPL.ClientAction.None);
//client.SetStatus("E2", "", AsaPL.ClientAction.None);
//client.SetStatus("E3", "", AsaPL.ClientAction.None);
//client.SetStatus("E4", "", AsaPL.ClientAction.None);
//client.SetStatus("E5", "", AsaPL.ClientAction.None);
//client.SetStatus("E6", "", AsaPL.ClientAction.None);
//client.SetStatus("E8", "", AsaPL.ClientAction.None);
//client.SetStatus("E9", "", AsaPL.ClientAction.None);
//client.SetStatus("E10", "", AsaPL.ClientAction.None);
//client.SetStatus("E11", "", AsaPL.ClientAction.None);
//client.SetStatus("E12", "", AsaPL.ClientAction.None);
//client.SetStatus("E14", "", AsaPL.ClientAction.None);
//client.SetStatus("E15", "", AsaPL.ClientAction.None);
//client.SetStatus("E16", "", AsaPL.ClientAction.None);
client.SetStatus("E21", "", AsaPL.ClientAction.None);
client.SetStatus("E22", "", AsaPL.ClientAction.None);
client.SetStatus("G21", "", AsaPL.ClientAction.None);
......
bdcb49d390ac20e7bf0fe235fb5519caf9b8a06d
f44608ffba7baac1680d1c1ae2f3221543f70aa3
......@@ -25,3 +25,16 @@ C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTe
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.pdb
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csproj.CoreCompileInputs.cache
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csprojAssemblyReference.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AgvClientTest.exe.config
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AgvClientTest.exe
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AgvClientTest.pdb
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AsaPL.AgvClient.dll
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\bin\Debug\AsaPL.AgvClient.pdb
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csprojAssemblyReference.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.Form1.resources
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.Properties.Resources.resources
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csproj.GenerateResource.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csproj.CoreCompileInputs.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.csproj.CopyComplete
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.exe
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClientTest\obj\Debug\AgvClientTest.pdb
......@@ -122,7 +122,7 @@ namespace WebServiceTest
private void button6_Click(object sender, EventArgs e)
{
AGVManager.UpdateStatus("C6", "D8");
AGVManager.UpdateStatus("D17", "D1");
}
}
}
9599955bfee8b9af8a27f3d3c4dd600c8ef9738f
905fd6870c9e3c585da2737659f8708e765037fb
......@@ -12,3 +12,17 @@ C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\bin\Debug\WebService
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\bin\Debug\WebService.dll.config
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\obj\Debug\WebServiceHost.csproj.CopyComplete
C:\ZDL\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\obj\Debug\WebServiceHost.csprojAssemblyReference.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\bin\Debug\WebServiceTest.exe.config
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\bin\Debug\WebServiceTest.exe
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\bin\Debug\WebServiceTest.pdb
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\bin\Debug\WebService.dll
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\bin\Debug\WebService.pdb
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\bin\Debug\WebService.dll.config
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\obj\Debug\WebServiceHost.csprojAssemblyReference.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\obj\Debug\WebServiceTest.Form1.resources
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\obj\Debug\WebServiceTest.Properties.Resources.resources
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\obj\Debug\WebServiceHost.csproj.GenerateResource.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\obj\Debug\WebServiceHost.csproj.CoreCompileInputs.cache
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\obj\Debug\WebServiceHost.csproj.CopyComplete
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\obj\Debug\WebServiceTest.exe
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\WebServiceTest\obj\Debug\WebServiceTest.pdb
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!