Commit 797d7d1f 张东亮

添加重连,通过IP判断客户端

1 个父辈 7a189a4d
正在显示 30 个修改的文件 包含 42 行增加25 行删除
...@@ -160,7 +160,7 @@ namespace AGVControl.BLL ...@@ -160,7 +160,7 @@ namespace AGVControl.BLL
//获取AGV状态 //获取AGV状态
rtn = Common.mir.Get_State(Common.agvInfo[i], out eAGVState stateID, out string stateText, out int battery, out string mission_text, out Agv_Info.clsPosition position); rtn = Common.mir.Get_State(Common.agvInfo[i], out eAGVState stateID, out string stateText, out int battery, out string mission_text, out Agv_Info.clsPosition position);
Thread.Sleep(50); Thread.Sleep(50);
if (rtn) change = Common.agvInfo[i].SetState(stateID, stateStr, battery, mission_text, position); change = Common.agvInfo[i].SetState(stateID, stateStr, battery, mission_text, position);
// if (change) // if (change)
{ {
......
...@@ -81,7 +81,7 @@ namespace BLL ...@@ -81,7 +81,7 @@ namespace BLL
Log.Info(string.Format("Unlock Request(POST) [emptyStation={0},rfid={1}]", emptyStation, rfid.ToUpper())); Log.Info(string.Format("Unlock Request(POST) [emptyStation={0},rfid={1}]", emptyStation, rfid.ToUpper()));
if (!Common.missionManager.AddMission(value, rfid.ToUpper())) if (!Common.missionManager.AddMission(value, rfid.ToUpper()))
{ {
res = new Result() { Succeed = false, ResultData = null, ErrorMessage = "CreateEmptyRecycleTask failed: " + emptyStation + " rfid=" + rfid }; res = new Result() { Succeed = false, ResultData = "true", ErrorMessage = "CreateEmptyRecycleTask failed due it has been created or rfid=null: " + emptyStation + " rfid=" + rfid };
} }
else else
Common.LogInfo("任务[POST]:" + value + " 出空料架 [location=" + emptyStation + ",rfid=" + rfid.ToUpper() + "]"); Common.LogInfo("任务[POST]:" + value + " 出空料架 [location=" + emptyStation + ",rfid=" + rfid.ToUpper() + "]");
...@@ -90,8 +90,8 @@ namespace BLL ...@@ -90,8 +90,8 @@ namespace BLL
} }
else else
{ {
res = new Result() { Succeed = false, ResultData = null, ErrorMessage = "Not find " + emptyStation }; res = new Result() { Succeed = false, ResultData = null, ErrorMessage = "Not find linename=" + emptyStation };
AGVControl.Common.log.Error("Unlock POST Response false " + "Not find " + emptyStation); AGVControl.Common.log.Error("Unlock POST Response false " + "Not find linename=" + emptyStation);
} }
} }
return JsonHelper.SerializeObject(res); return JsonHelper.SerializeObject(res);
...@@ -113,7 +113,7 @@ namespace BLL ...@@ -113,7 +113,7 @@ namespace BLL
if (!Common.missionManager.AddMission(value,RFID.ToUpper())) if (!Common.missionManager.AddMission(value,RFID.ToUpper()))
{ {
res = new Result() { Succeed = false, ResultData = null, ErrorMessage = "CreateEmptyRecycleTask failed: " + line }; res = new Result() { Succeed = false, ResultData = "true", ErrorMessage = "CreateEmptyRecycleTask failed due it has been created or rfid=null: " + line +"rfid="+ RFID.ToUpper() };
} }
else else
{ {
...@@ -124,8 +124,8 @@ namespace BLL ...@@ -124,8 +124,8 @@ namespace BLL
} }
else else
{ {
res = new Result() { Succeed = false, ResultData = null, ErrorMessage = "Not find " + line }; res = new Result() { Succeed = false, ResultData = null, ErrorMessage = "Not find linename=" + line };
AGVControl.Common.LogInfo("Unlock GET Response false " + "Not find " + line); AGVControl.Common.LogInfo("Unlock GET Response false " + "Not find linename=" + line);
} }
//Log.Info(string.Format("WebService GET Request emptyStation={0},rfid={1}", line, RFID)); //Log.Info(string.Format("WebService GET Request emptyStation={0},rfid={1}", line, RFID));
return JsonHelper.SerializeObject(res); return JsonHelper.SerializeObject(res);
......
...@@ -423,10 +423,11 @@ namespace BLL ...@@ -423,10 +423,11 @@ namespace BLL
battery = 0; battery = 0;
mission_text = ""; mission_text = "";
position = new Agv_Info.clsPosition(); position = new Agv_Info.clsPosition();
string json="";
try try
{ {
string url = "http://" + info.IP + "/api/v2.0.0/status?whitelist=state_id,state_text,battery_percentage,mission_text,position"; string url = "http://" + info.IP + "/api/v2.0.0/status?whitelist=state_id,state_text,battery_percentage,mission_text,position";
string json = HttpGet(url, info.IP, info.Authorization); json = HttpGet(url, info.IP, info.Authorization);
if (string.IsNullOrWhiteSpace(json)) return false; if (string.IsNullOrWhiteSpace(json)) return false;
JavaScriptSerializer serializer = new JavaScriptSerializer(); JavaScriptSerializer serializer = new JavaScriptSerializer();
Dictionary<string, object> dic = (Dictionary<string, object>)serializer.DeserializeObject(json); Dictionary<string, object> dic = (Dictionary<string, object>)serializer.DeserializeObject(json);
...@@ -458,7 +459,7 @@ namespace BLL ...@@ -458,7 +459,7 @@ namespace BLL
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.log.Error("Get_State: ", ex); Common.log.Error("Get_State["+info.IP+"]:"+json, ex);
return false; return false;
} }
} }
......
...@@ -880,6 +880,7 @@ ...@@ -880,6 +880,7 @@
this.btnAddMission.TabIndex = 40; this.btnAddMission.TabIndex = 40;
this.btnAddMission.Text = "添加绑定任务"; this.btnAddMission.Text = "添加绑定任务";
this.btnAddMission.UseVisualStyleBackColor = true; this.btnAddMission.UseVisualStyleBackColor = true;
this.btnAddMission.Visible = false;
this.btnAddMission.Click += new System.EventHandler(this.btnAddMission_Click); this.btnAddMission.Click += new System.EventHandler(this.btnAddMission_Click);
// //
// cmbBoxLineName // cmbBoxLineName
......
...@@ -193,7 +193,7 @@ namespace AGVControl ...@@ -193,7 +193,7 @@ namespace AGVControl
if (RFID.StartsWith("C") && !agv.Place.Equals(SettingString.D4FeederIn) && !agv.Place.Equals(SettingString.C4FeederIn)) if (RFID.StartsWith("C") && !agv.Place.Equals(SettingString.D4FeederIn) && !agv.Place.Equals(SettingString.C4FeederIn))
{ {
SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_BIG_SHELF_UNLOCK); SendFullShelfStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT_BIG_SHELF_UNLOCK);
runInfo = "AGV到达 " + FullShelfPlace + ",并等待大料架[" + RFID + "]解绑"; runInfo = "AGV到达 " + FullShelfPlace + ",并等待大料架[" + RFID + "]库位转移";
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
} }
...@@ -215,7 +215,7 @@ namespace AGVControl ...@@ -215,7 +215,7 @@ namespace AGVControl
System.Threading.Thread.Sleep(50); System.Threading.Thread.Sleep(50);
if (AGVManager.GetRackBy(RFID, out string lineName) || (input != null && input[0])) if (AGVManager.GetRackBy(RFID, out string lineName) || (input != null && input[0]))
{ {
runInfo = "大料架在" + FullShelfPlace + "解绑完成 [" + RFID + "] [" + agv.BoxDestInfo + "]"; runInfo = "大料架在" + FullShelfPlace + "库位转移完成 [" + RFID + "] [" + agv.BoxDestInfo + "]";
agv.BoxDestInfo = ""; agv.BoxDestInfo = "";
msg += runInfo; msg += runInfo;
SendFullShelfStep.Msg = msg; SendFullShelfStep.Msg = msg;
......
²úÏßÃû,½ÚµãÃû,IP,²úÏß±ðÃû,λÖÃÃû³Æ,λÖÃguid ²úÏßÃû,½ÚµãÃû,IP,²úÏß±ðÃû,λÖÃÃû³Æ,λÖÃguid
A5,A5,10.85.199.20,下料区(A5),PA5,7ed952c3-b520-11ea-b6ad-00012998f5a0 A5,A5,10.85.199.20,Ë«²ãÏßÈë¿Ú(A5),PA5,7ed952c3-b520-11ea-b6ad-00012998f5a0
A6,A6,10.85.199.20,上料区(A6),PA6,929eb1c2-b520-11ea-b6ad-00012998f5a0 A6,A6,10.85.199.20,Ë«²ãÏß³ö¿Ú(A6),PA6,929eb1c2-b520-11ea-b6ad-00012998f5a0
D1,D1,10.85.199.42,4D-1Ïß,DL1,3b823fe4-b368-11ea-a1a5-00012999830e D1,D1,10.85.199.42,4D-1Ïß,DL1,3b823fe4-b368-11ea-a1a5-00012999830e
D2,D2,10.85.199.90,4D-2Ïß,DL2,ede15fcb-b367-11ea-a1a5-00012999830e D2,D2,10.85.199.90,4D-2Ïß,DL2,ede15fcb-b367-11ea-a1a5-00012999830e
D3,D3,10.85.199.91,4D-3Ïß,DL3,43855a9b-b365-11ea-a1a5-00012999830e D3,D3,10.85.199.91,4D-3Ïß,DL3,43855a9b-b365-11ea-a1a5-00012999830e
...@@ -26,8 +26,8 @@ C6,C6,10.85.199.55,4C-6线,G6,b9117881-cdac-11ea-a3e4-94c691a7387d ...@@ -26,8 +26,8 @@ C6,C6,10.85.199.55,4C-6线,G6,b9117881-cdac-11ea-a3e4-94c691a7387d
C7,C7,10.85.199.56,4C-7Ïß,G7,b3cda9db-cdac-11ea-a3e4-94c691a7387d C7,C7,10.85.199.56,4C-7Ïß,G7,b3cda9db-cdac-11ea-a3e4-94c691a7387d
C8,C8,10.85.199.57,4C-8Ïß,G8,ae09fc56-cdac-11ea-a3e4-94c691a7387d C8,C8,10.85.199.57,4C-8Ïß,G8,ae09fc56-cdac-11ea-a3e4-94c691a7387d
C9,C9,10.85.199.62,4C-9Ïß,G9,a64bdbbb-cdac-11ea-a3e4-94c691a7387d C9,C9,10.85.199.62,4C-9Ïß,G9,a64bdbbb-cdac-11ea-a3e4-94c691a7387d
C14,C14,10.85.199.61,4C-14Ïß,G14,a64bdbbb-cdac-11ea-a3e4-94c691a7387d
C15,C15,10.85.199.60,4C-15Ïß,G15,a64bdbbb-cdac-11ea-a3e4-94c691a7387d
4CFeederIn,C21,10.85.197.40,4C-FeederIn,C21,cb7f117b-ca88-11ea-9b28-0001299981d4
4CFeederOut,C22,10.85.197.40,4C-FeederOut,C22,0fcf606c-d417-11ea-9b6b-0001299981d4
C10,C10,10.85.199.59,4C-10Ïß,G10,604b1c3c-ca4e-11ea-810b-00012999830e C10,C10,10.85.199.59,4C-10Ïß,G10,604b1c3c-ca4e-11ea-810b-00012999830e
C14,C14,10.85.199.60,4C-14线,G14,07841fc6-d0d4-11ea-a3e4-94c691a7387d
C15,C15,10.85.199.61,4C-15线,G15,0efca2c6-d0d4-11ea-a3e4-94c691a7387d
4CFeederIn,C21,10.85.199.1,4C-FeederIn,G21,cb7f117b-ca88-11ea-9b28-0001299981d4
4CFeederOut,C22,10.85.199.1,4C-FeederOut,G22,0fcf606c-d417-11ea-9b6b-0001299981d4
{"NodeUnlockMissions":{"D1":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D2":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D3":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D4":{"NodeName":null,"EmptyCnt":1,"Rfids":{"C2":"2021/01/21/09:18:50,014"}},"D5":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D6":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D8":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D9":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D10":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D11":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D12":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D14":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D15":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D16":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D22":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C1":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C2":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C3":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C4":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C5":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C6":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C7":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C8":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C9":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C10":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C14":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C15":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C22":{"NodeName":null,"EmptyCnt":0,"Rfids":{}}}} {"NodeUnlockMissions":{"D1":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D2":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D3":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D4":{"NodeName":null,"EmptyCnt":1,"Rfids":{"C2":"2021/01/21/09:18:50,014"}},"D5":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D6":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D8":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D9":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D10":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D11":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D12":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D14":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D15":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D16":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"D22":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C1":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C2":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C3":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C4":{"NodeName":null,"EmptyCnt":1,"Rfids":{"D9":"2021/04/14/10:30:23,611"}},"C5":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C6":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C7":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C8":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C9":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C10":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C14":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C15":{"NodeName":null,"EmptyCnt":0,"Rfids":{}},"C22":{"NodeName":null,"EmptyCnt":0,"Rfids":{}}}}
...@@ -18,3 +18,5 @@ RFID= ...@@ -18,3 +18,5 @@ RFID=
EmptyShelfCnt=1 EmptyShelfCnt=1
[D4] [D4]
EmptyShelfCnt=1 EmptyShelfCnt=1
[C4]
EmptyShelfCnt=1

\ No newline at end of file \ No newline at end of file
[2021-04-14 10:30:48,866]INFO Unlock Request(GET) [emptyStation=C4,rfid=D9]
...@@ -71,4 +71,3 @@ E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLi ...@@ -71,4 +71,3 @@ E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLi
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csproj.CopyComplete E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csproj.CopyComplete
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.exe E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.exe
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.pdb E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.pdb
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csprojAssemblyReference.cache
...@@ -364,10 +364,17 @@ namespace AsaPL ...@@ -364,10 +364,17 @@ namespace AsaPL
int idx = 0; int idx = 0;
byte[] buff = new byte[12]; byte[] buff = new byte[12];
buff[idx++] = 0xAD; buff[idx++] = 0xAD;
buff[idx++] = (byte)node.Name[0]; try
buff[idx++] = Convert.ToByte(node.Name.Substring(1)); {
buff[idx++] = (byte)node.RFID[0]; buff[idx++] = (byte)node.Name[0];
buff[idx++] = Convert.ToByte(node.RFID.Substring(1)); buff[idx++] = Convert.ToByte(node.Name.Substring(1));
buff[idx++] = (byte)node.RFID[0];
buff[idx++] = Convert.ToByte(node.RFID.Substring(1));
}
catch(Exception ex)
{
LOG.Error("encode:",ex);
}
if (CancelState) if (CancelState)
buff[idx++] = (byte)ClientAction.None; buff[idx++] = (byte)ClientAction.None;
......
f2c4345434d8c56490cc359d0d6ac5832ab39fd4 214ddb8988ae2ab2910e039d16c36c3c63fd112e
...@@ -27,3 +27,10 @@ C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient ...@@ -27,3 +27,10 @@ C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csproj.CopyComplete C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csproj.CopyComplete
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AsaPL.AgvClient.dll C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AsaPL.AgvClient.dll
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AsaPL.AgvClient.pdb C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AsaPL.AgvClient.pdb
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\bin\Debug\AsaPL.AgvClient.dll
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\bin\Debug\AsaPL.AgvClient.pdb
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csprojAssemblyReference.cache
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csproj.CoreCompileInputs.cache
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AgvClient.csproj.CopyComplete
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AsaPL.AgvClient.dll
E:\Neotel\Projects\Gitee\AGVControl-Qisda-ProductionLine\AgvClient\obj\Debug\AsaPL.AgvClient.pdb
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!