Commit fd896a82 张东亮

运行版

1 个父辈 aed2a716
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
// lblTask // lblTask
// //
this.lblTask.Dock = System.Windows.Forms.DockStyle.Left; this.lblTask.Dock = System.Windows.Forms.DockStyle.Left;
this.lblTask.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.lblTask.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblTask.Image = global::AGV_UI.Properties.Resources.task; this.lblTask.Image = global::AGV_UI.Properties.Resources.task;
this.lblTask.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.lblTask.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblTask.Location = new System.Drawing.Point(0, 0); this.lblTask.Location = new System.Drawing.Point(0, 0);
......
[]
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8"?>
<agvs> <agvs>
<agv id="12" ip="10.85.199.81"> <agv id="49" ip="10.85.199.81">
<name>10号车</name> <name>10号车</name>
<!--负责区域:D,C,Air_C--> <!--负责区域:D,C,Air_C-->
<ResponsAreas> <ResponsAreas>
<Area>D</Area> <Area>D</Area>
</ResponsAreas> </ResponsAreas>
<!--是否调用--> <!--是否调用-->
<IsUse>false</IsUse> <IsUse>False</IsUse>
<UseFleet>true</UseFleet> <UseFleet>true</UseFleet>
<Authorization>Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==</Authorization> <Authorization>Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==</Authorization>
<IO_GUID>007615a5-2220-11ea-99f2-94c691a73b53</IO_GUID> <IO_GUIDs>
</agv> <IO_GUID index="0">6ad07e3a-e0e9-11eb-a184-0001299981d4</IO_GUID>
<IO_GUID index="1">3b5c0497-e2f2-11eb-95df-000129922ca6</IO_GUID>
<IO_GUID index="2">4e49e4c8-e2f2-11eb-95df-000129922ca6</IO_GUID>
</IO_GUIDs>
</agv>
</agvs> </agvs>
\ No newline at end of file \ No newline at end of file
...@@ -382,11 +382,11 @@ ...@@ -382,11 +382,11 @@
<!--节点IP,不需要通讯的设为空--> <!--节点IP,不需要通讯的设为空-->
<ip></ip> <ip></ip>
<!--名称--> <!--名称-->
<name>storage</name> <name>治具智能仓储</name>
<!--是否调用--> <!--是否调用-->
<IsUse>true</IsUse> <IsUse>true</IsUse>
<!--别名--> <!--别名-->
<alicename>立库</alicename> <alicename>治具智能仓储</alicename>
<!--节点类型:Standby,AutoCharge,Node--> <!--节点类型:Standby,AutoCharge,Node-->
<type>Node</type> <type>Node</type>
<!--所属区域:D,C,Air_C--> <!--所属区域:D,C,Air_C-->
......
...@@ -3,224 +3,231 @@ ...@@ -3,224 +3,231 @@
<task id ="0"> <task id ="0">
<name>Init</name> <name>Init</name>
<alicename>初始化</alicename> <alicename>初始化</alicename>
<guid>219cd91a-61da-11eb-96a9-0001297a1dca</guid> <guid>2bcd29b8-e2f2-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>None</type> <type>None</type>
</task> </task>
<task id ="1"> <task id ="1">
<name>Standby</name> <name>Standby</name>
<alicename>待机位</alicename> <alicename>待机位</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>501522b3-e2f2-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>None</type> <type>None</type>
</task> </task>
<task id ="2"> <task id ="2">
<name>AutoCharge</name> <name>AutoCharge</name>
<alicename>充电位</alicename> <alicename>充电位</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>40c17cb4-e2f2-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>None</type> <type>None</type>
</task> </task>
<task id ="3"> <task id ="3">
<name>Enter</name> <name>Enter</name>
<alicename>进料</alicename> <alicename>进料</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>31a3a69e-e310-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>InOut</type> <type>InOut</type>
</task> </task>
<task id ="4"> <task id ="4">
<name>Leave</name> <name>Leave</name>
<alicename>出料</alicename> <alicename>出料</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>ba68ea32-e310-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>InOut</type> <type>InOut</type>
</task> </task>
<task id ="5"> <task id ="5">
<name>CheckShelf</name> <name>CheckShelf</name>
<alicename>负载检查</alicename> <alicename>负载检查</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>7f6edf46-e316-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>None</type> <type>None</type>
</task> </task>
<task id ="6"> <task id ="6">
<name>D1</name> <name>D1</name>
<alicename>移动到D1线</alicename> <alicename>移动到D1线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>03925a62-e2fa-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="7"> <task id ="7">
<name>D2</name> <name>D2</name>
<alicename>移动到D2线</alicename> <alicename>移动到D2线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>17419a7e-e2fa-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="8"> <task id ="8">
<name>D3</name> <name>D3</name>
<alicename>移动到D3线</alicename> <alicename>移动到D3线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>39052eb5-e2fa-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="9"> <task id ="9">
<name>D4</name> <name>D4</name>
<alicename>移动到D4线</alicename> <alicename>移动到D4线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>4cbec837-e2fa-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="10"> <task id ="10">
<name>D5</name> <name>D5</name>
<alicename>移动到D5线</alicename> <alicename>移动到D5线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>63241a92-e2fa-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="11"> <task id ="11">
<name>D6</name> <name>D6</name>
<alicename>移动到D6线</alicename> <alicename>移动到D6线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>d264a9c2-e2fb-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="12"> <task id ="12">
<name>D7</name> <name>D7</name>
<alicename>移动到D7线</alicename> <alicename>移动到D7线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>e2d00611-e2fb-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="13"> <task id ="13">
<name>D8</name> <name>D8</name>
<alicename>移动到D8线</alicename> <alicename>移动到D8线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>f636e5a8-e2fb-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="14"> <task id ="14">
<name>D9</name> <name>D9</name>
<alicename>移动到D9线</alicename> <alicename>移动到D9线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>164a436d-e2fc-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="15"> <task id ="15">
<name>D10</name> <name>D10</name>
<alicename>移动到D10线</alicename> <alicename>移动到D10线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>663d8278-e2fc-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="16"> <task id ="16">
<name>D11</name> <name>D11</name>
<alicename>移动到D11线</alicename> <alicename>移动到D11线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>7e0996dd-e2fc-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="17"> <task id ="17">
<name>D12</name> <name>D12</name>
<alicename>移动到D12线</alicename> <alicename>移动到D12线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>93bc0500-e2fc-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="18"> <task id ="18">
<name>D13</name> <name>D13</name>
<alicename>移动到D13线</alicename> <alicename>移动到D13线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>b2e5d20e-e2fc-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="19"> <task id ="19">
<name>D14</name> <name>D14</name>
<alicename>移动到D14线</alicename> <alicename>移动到D14线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>dd1da0b8-e2fc-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="20"> <task id ="20">
<name>D15</name> <name>D15</name>
<alicename>移动到D15线</alicename> <alicename>移动到D15线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>f1109e49-e2fc-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="21"> <task id ="21">
<name>D1</name> <name>D16</name>
<alicename>移动到D16线</alicename> <alicename>移动到D16线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>6e984dd1-e30a-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="22"> <task id ="22">
<name>T01</name> <name>T01</name>
<alicename>移动到T1线</alicename> <alicename>移动到T1线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>532c7cda-e2f4-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="23"> <task id ="23">
<name>T02</name> <name>T02</name>
<alicename>移动到T2线</alicename> <alicename>移动到T2线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>27dc2449-e2f9-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="24"> <task id ="24">
<name>T03</name> <name>T03</name>
<alicename>移动到T3线</alicename> <alicename>移动到T3线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>576a579b-e2f9-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="25"> <task id ="25">
<name>T04</name> <name>T04</name>
<alicename>移动到T4线</alicename> <alicename>移动到T4线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>7c474d94-e2f9-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="26"> <task id ="26">
<name>T05</name> <name>T05</name>
<alicename>移动到T5线</alicename> <alicename>移动到T5线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>9779e5bb-e2f9-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="27"> <task id ="27">
<name>T06</name> <name>T06</name>
<alicename>移动到T6线</alicename> <alicename>移动到T6线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>a6a092a2-e2f9-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="28"> <task id ="28">
<name>T07</name> <name>T07</name>
<alicename>移动到T7线</alicename> <alicename>移动到T7线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>ba68467a-e2f9-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="29"> <task id ="29">
<name>T08</name> <name>T08</name>
<alicename>移动到T8线</alicename> <alicename>移动到T8线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>d4e59d24-e2f9-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="30"> <task id ="30">
<name>T09</name> <name>T09</name>
<alicename>移动到T9线</alicename> <alicename>移动到T9线</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>ed9b0352-e2f9-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>Move</type> <type>Move</type>
</task> </task>
<task id ="31"> <task id ="31">
<name>Adjust</name> <name>Adjust</name>
<alicename>调宽</alicename> <alicename>调宽</alicename>
<guid>615cef05-61f4-11eb-96a9-0001297a1dca</guid> <guid>45f417f6-e316-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut-->
<type>None</type>
</task>
<task id ="32">
<name>治具智能仓储</name>
<alicename>治具智能仓储</alicename>
<guid>111486eb-e3b4-11eb-8a99-94c691a7387d</guid>
<!--任务类型:None,Move,Dock,InOut--> <!--任务类型:None,Move,Dock,InOut-->
<type>None</type> <type>None</type>
</task> </task>
......
...@@ -30,7 +30,7 @@ namespace DeviceLibrary ...@@ -30,7 +30,7 @@ namespace DeviceLibrary
{ {
AgvCallTimer = new System.Timers.Timer AgvCallTimer = new System.Timers.Timer
{ {
Interval = 300, Interval = 500,
AutoReset = true, AutoReset = true,
Enabled = false Enabled = false
}; };
...@@ -96,6 +96,7 @@ namespace DeviceLibrary ...@@ -96,6 +96,7 @@ namespace DeviceLibrary
bool change = false; bool change = false;
MiR_API.Get_Task_State(AGVManager.agvInfo[i]); MiR_API.Get_Task_State(AGVManager.agvInfo[i]);
Thread.Sleep(50); Thread.Sleep(50);
MiR_API.Get_IO_Status(AGVManager.agvInfo[i]);
//获取AGV状态 //获取AGV状态
rtn = MiR_API.Get_State(AGVManager.agvInfo[i], out eAGVState stateID, out string stateText, out int battery, out string mission_text, out Agv_Info.MirPosition position); rtn = MiR_API.Get_State(AGVManager.agvInfo[i], out eAGVState stateID, out string stateText, out int battery, out string mission_text, out Agv_Info.MirPosition position);
Thread.Sleep(50); Thread.Sleep(50);
......
...@@ -28,7 +28,7 @@ namespace DeviceLibrary ...@@ -28,7 +28,7 @@ namespace DeviceLibrary
/// <summary> /// <summary>
/// IO模块GUID /// IO模块GUID
/// </summary> /// </summary>
public string IOID { set; get; }
/// <summary> /// <summary>
/// 授权码 /// 授权码
/// </summary> /// </summary>
...@@ -133,8 +133,7 @@ namespace DeviceLibrary ...@@ -133,8 +133,7 @@ namespace DeviceLibrary
/// </summary> /// </summary>
public string ErrorMsg { get; set; } = ""; public string ErrorMsg { get; set; } = "";
public string ErrorLastTime { get; set; } = ""; public string ErrorLastTime { get; set; } = "";
public bool[] Input; public List<IOInfo> IOStatus;
public bool[] Output;
/// <summary> /// <summary>
/// Agv是否空闲 /// Agv是否空闲
/// </summary> /// </summary>
...@@ -201,13 +200,12 @@ namespace DeviceLibrary ...@@ -201,13 +200,12 @@ namespace DeviceLibrary
/// </summary> /// </summary>
public bool StandTimeOut { get; set; } = false; public bool StandTimeOut { get; set; } = false;
public AGV_UI.Status StateKanban; public AGV_UI.Status StateKanban;
public Agv_Info(string id, string name, string ip, string authorization, string ioID, bool isUse) public Agv_Info(string id, string name, string ip, string authorization, bool isUse)
{ {
ID = id; ID = id;
Name = name; Name = name;
IP = ip; IP = ip;
Authorization = authorization; Authorization = authorization;
IOID = ioID;
IsCon = false; IsCon = false;
_IsUse = isUse; _IsUse = isUse;
Place = new Node(); Place = new Node();
...@@ -223,6 +221,7 @@ namespace DeviceLibrary ...@@ -223,6 +221,7 @@ namespace DeviceLibrary
Position = new MirPosition(); Position = new MirPosition();
RunInfos = new List<string>() { "状态", "目的地", "RFID", "负载", "运行模式", "任务信息", "AGV运行信息" }; RunInfos = new List<string>() { "状态", "目的地", "RFID", "负载", "运行模式", "任务信息", "AGV运行信息" };
StateKanban = new AGV_UI.Status(RunInfos); StateKanban = new AGV_UI.Status(RunInfos);
IOStatus = new List<IOInfo>();
TaskRunState = new TaskRunState(); TaskRunState = new TaskRunState();
} }
public List<string> RunInfos; public List<string> RunInfos;
...@@ -234,37 +233,34 @@ namespace DeviceLibrary ...@@ -234,37 +233,34 @@ namespace DeviceLibrary
{ {
bool isChange = false; bool isChange = false;
bool preShelfState = IsExistShelf; bool preShelfState = IsExistShelf;
MiR_API.Get_IO_Status(this, out Input, out Output); bool reachIoValue = GetInput(0, 3).Equals(true);
if (Input != null && Input.Length == 4) if (reachIoValue)
{ {
bool reachIoValue = Input[3].Equals(true); //满足给定的IO值,计算持续时间
if (reachIoValue) if (IoStartTime == DateTime.MaxValue)
{ {
//满足给定的IO值,计算持续时间 IoStartTime = DateTime.Now;
if (IoStartTime == DateTime.MaxValue) }
{
IoStartTime = DateTime.Now;
}
if (IoLastTime > 0) if (IoLastTime > 0)
{ {
//持续时间 //持续时间
TimeSpan lastTimeSpan = DateTime.Now - IoStartTime; TimeSpan lastTimeSpan = DateTime.Now - IoStartTime;
IsExistShelf = (lastTimeSpan.TotalMilliseconds >= IoLastTime); IsExistShelf = (lastTimeSpan.TotalMilliseconds >= IoLastTime);
}
else
{
IsExistShelf = false;
}
} }
else else
{ {
//重新计时
IoStartTime = DateTime.MinValue;
IsExistShelf = false; IsExistShelf = false;
} }
} }
else
{
//重新计时
IoStartTime = DateTime.MinValue;
IsExistShelf = false;
}
if (!StateID.Equals(stateID) || !Battery.Equals(battery) if (!StateID.Equals(stateID) || !Battery.Equals(battery)
|| !MissionText.Equals(missionText) || !IsExistShelf.Equals(preShelfState)) || !MissionText.Equals(missionText) || !IsExistShelf.Equals(preShelfState))
isChange = true; isChange = true;
...@@ -290,7 +286,7 @@ namespace DeviceLibrary ...@@ -290,7 +286,7 @@ namespace DeviceLibrary
if (!MissionText.Equals(missionText)) if (!MissionText.Equals(missionText))
{ {
MissionText = missionText; MissionText = missionText;
StateKanban.ShowInfo("AGV行信息", missionText); StateKanban.ShowInfo("AGV行信息", missionText);
} }
CheckErrorState(); CheckErrorState();
CheckOfflineTimeOut(); CheckOfflineTimeOut();
...@@ -366,6 +362,40 @@ namespace DeviceLibrary ...@@ -366,6 +362,40 @@ namespace DeviceLibrary
offlineStartTime = DateTime.Now; offlineStartTime = DateTime.Now;
} }
} }
/// <summary>
/// 获取IO输入状态
/// </summary>
/// <param name="ioidx">IO序号</param>
/// <param name="port">IO端口</param>
/// <returns></returns>
public bool GetInput(int ioidx, int port)
{
if (ioidx >= IOStatus.Count)
return false;
if (IOStatus[ioidx] == null || IOStatus[ioidx].Inputs == null)
return false;
if (port >= IOStatus[ioidx].Inputs.Length)
return false;
return IOStatus[ioidx].Inputs[port];
}
/// <summary>
/// 获取IO输出状态
/// </summary>
/// <param name="ioidx">IO序号</param>
/// <param name="port">IO端口</param>
/// <returns></returns>
public bool GetOutput(int ioidx, int port)
{
if (ioidx >= IOStatus.Count)
return false;
if (IOStatus[ioidx] == null || IOStatus[ioidx].Outputs == null)
return false;
if (port >= IOStatus[ioidx].Outputs.Length)
return false;
return IOStatus[ioidx].Outputs[port];
}
/// <summary> /// <summary>
/// 检查小车是否在原地停留超时 /// 检查小车是否在原地停留超时
/// </summary> /// </summary>
...@@ -465,4 +495,11 @@ namespace DeviceLibrary ...@@ -465,4 +495,11 @@ namespace DeviceLibrary
} }
} }
} }
public class IOInfo
{
public string IOID { set; get; }
public bool[] Inputs;
public bool[] Outputs;
}
} }
...@@ -60,42 +60,41 @@ namespace DeviceLibrary ...@@ -60,42 +60,41 @@ namespace DeviceLibrary
/// <param name="input"></param> /// <param name="input"></param>
/// <param name="output"></param> /// <param name="output"></param>
/// <returns></returns> /// <returns></returns>
public static bool Get_IO_Status(Agv_Info info, out bool[] input, out bool[] output) public static void Get_IO_Status(Agv_Info info)
{ {
try foreach (IOInfo io in info.IOStatus)
{ {
input = null; try
output = null; {
string url = "http://" + info.IP + "/api/v2.0.0/io_modules/" + info.IOID + "/status"; io.Inputs = null;
io.Outputs = null;
string url = "http://" + info.IP + "/api/v2.0.0/io_modules/" + io.IOID + "/status";
string json = HttpGet(url, info.IP, info.Authorization); string json = HttpGet(url, info.IP, info.Authorization);
if (string.IsNullOrWhiteSpace(json)) return false; if (string.IsNullOrWhiteSpace(json)) continue;
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);
if (dic == null) if (dic == null)
{
log.Error("URL: " + url + "\n" + "Return: " + json);
}
object[] objInput = (object[])dic["input_state"];
io.Inputs = new bool[objInput.Length];
for (int i = 0; i < io.Inputs.Length; i++)
io.Inputs[i] = Convert.ToBoolean(objInput[i]);
object[] objOutput = (object[])dic["output_state"];
io.Outputs = new bool[objOutput.Length];
for (int i = 0; i < io.Outputs.Length; i++)
io.Outputs[i] = Convert.ToBoolean(objOutput[i]);
}
catch (Exception ex)
{ {
log.Error("URL: " + url + "\n" + "Return: " + json); io.Inputs = null;
return false; io.Outputs = null;
//log.Error("Get_IO_Status", ex);
} }
object[] objInput = (object[])dic["input_state"];
input = new bool[objInput.Length];
for (int i = 0; i < input.Length; i++)
input[i] = Convert.ToBoolean(objInput[i]);
object[] objOutput = (object[])dic["output_state"];
output = new bool[objOutput.Length];
for (int i = 0; i < output.Length; i++)
output[i] = Convert.ToBoolean(objOutput[i]);
return true;
}
catch (Exception ex)
{
input = null;
output = null;
//log.Error("Get_IO_Status", ex);
return false;
} }
} }
...@@ -247,10 +246,9 @@ namespace DeviceLibrary ...@@ -247,10 +246,9 @@ namespace DeviceLibrary
Dictionary<string, object> dic = (Dictionary<string, object>)serializer.DeserializeObject(json); Dictionary<string, object> dic = (Dictionary<string, object>)serializer.DeserializeObject(json);
if (dic == null) if (dic == null)
{ {
log.Error($"{info.Name} Add_Mission_Fleet Fail URL: " + url + "\n" + "Return: " + json);
return false; return false;
} }
log.Debug("URL: " + url + "\n" + "Return: " + json);
string s = dic["mission_id"].ToString(); string s = dic["mission_id"].ToString();
string id = dic["id"].ToString(); string id = dic["id"].ToString();
if (s == info.TaskRunState.Task.Guid && !string.IsNullOrEmpty(id)) if (s == info.TaskRunState.Task.Guid && !string.IsNullOrEmpty(id))
...@@ -424,7 +422,7 @@ namespace DeviceLibrary ...@@ -424,7 +422,7 @@ namespace DeviceLibrary
{ {
string url = "http://" + agv.IP + "/api/v2.0.0/mission_queue/" + agv.TaskRunState.TaskID; string url = "http://" + agv.IP + "/api/v2.0.0/mission_queue/" + agv.TaskRunState.TaskID;
string json = HttpGet(url, agv.IP, agv.Authorization); string json = HttpGet(url, agv.IP, agv.Authorization);
log.Debug("URL: " + url + "\n" + "Return: " + json); //log.Debug("URL: " + url + "\n" + "Return: " + json);
if (string.IsNullOrWhiteSpace(json)) return false; if (string.IsNullOrWhiteSpace(json)) return false;
JavaScriptSerializer serializer = new JavaScriptSerializer(); JavaScriptSerializer serializer = new JavaScriptSerializer();
...@@ -477,7 +475,7 @@ namespace DeviceLibrary ...@@ -477,7 +475,7 @@ namespace DeviceLibrary
if (dic == null) return false; if (dic == null) return false;
//state_id不存在:{"args":{},"error_code":"service_unavailable","error_human":"\u670d\u52a1\u4e0d\u53ef\u7528\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5"} //state_id不存在:{"args":{},"error_code":"service_unavailable","error_human":"\u670d\u52a1\u4e0d\u53ef\u7528\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5"}
log.Debug("Get_State URL:" + url + " Return" + json); //log.Debug("Get_State URL:" + url + " Return" + json);
try try
{ {
stateID = (eAGVState)(Convert.ToInt32(dic["state_id"].ToString())); stateID = (eAGVState)(Convert.ToInt32(dic["state_id"].ToString()));
...@@ -616,7 +614,7 @@ namespace DeviceLibrary ...@@ -616,7 +614,7 @@ namespace DeviceLibrary
ping.Dispose(); ping.Dispose();
if (result.Status != System.Net.NetworkInformation.IPStatus.Success) if (result.Status != System.Net.NetworkInformation.IPStatus.Success)
{ {
log.Debug("Ping " + ip + " 请求没有响应"); // log.Debug("Ping " + ip + " 请求没有响应");
return false; return false;
} }
return true; return true;
...@@ -652,7 +650,7 @@ namespace DeviceLibrary ...@@ -652,7 +650,7 @@ namespace DeviceLibrary
{ {
var client = new RestClient(url) { Timeout = httpTimeout }; var client = new RestClient(url) { Timeout = httpTimeout };
var request = new RestRequest(Method.POST); var request = new RestRequest(Method.POST);
request.Timeout =10000;
request.AddHeader("Host", ip); request.AddHeader("Host", ip);
request.AddHeader("Content-Type", "application/json"); request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept-Language", "zh_CN"); request.AddHeader("Accept-Language", "zh_CN");
...@@ -663,7 +661,7 @@ namespace DeviceLibrary ...@@ -663,7 +661,7 @@ namespace DeviceLibrary
string s = response.Content; string s = response.Content;
s = s.Replace("\n", ""); s = s.Replace("\n", "");
s = s.Replace(" ", ""); s = s.Replace(" ", "");
log.Debug(string.Format("HttpPost URL: {0}; Body: {1} Return: {2}", url, body, s)); log.Debug(string.Format("HttpPost URL: {0}; Body: {1} Return: {2} [StatusCode={3},ResponseStatus={4},]", url, body, s, response.StatusCode, response.ResponseStatus));
return s; return s;
} }
......
...@@ -68,6 +68,8 @@ namespace DeviceLibrary ...@@ -68,6 +68,8 @@ namespace DeviceLibrary
PropertyInfo[] info2 = task.GetType().GetProperties(); PropertyInfo[] info2 = task.GetType().GetProperties();
for (int i = 0; i < info1.Length; i++) for (int i = 0; i < info1.Length; i++)
{ {
if (info1[i].Name.Equals("Id"))
continue;
info2[i].SetValue(task, info1[i].GetValue(this)); info2[i].SetValue(task, info1[i].GetValue(this));
} }
return task; return task;
......
...@@ -89,6 +89,10 @@ namespace DeviceLibrary ...@@ -89,6 +89,10 @@ namespace DeviceLibrary
{ {
return $" [{Task.AliceName}] [{TaskID}] "; return $" [{Task.AliceName}] [{TaskID}] ";
} }
public string ToTaskShowInfo()
{
return $" [{Task.AliceName}]\r\n[{TaskID}] ";
}
public string ToTaskState() public string ToTaskState()
{ {
return $"[{Task.AliceName}] [{TaskID}] [{TaskState}]"; return $"[{Task.AliceName}] [{TaskID}] [{TaskState}]";
......
...@@ -147,7 +147,7 @@ namespace DeviceLibrary ...@@ -147,7 +147,7 @@ namespace DeviceLibrary
JobRunStep.ToNextStep(RunStep.ADJUST_WIDTH); JobRunStep.ToNextStep(RunStep.ADJUST_WIDTH);
runInfo = JobParam.TargetNode + " 有出库任务,开始调宽"; runInfo = JobParam.TargetNode + " 有出库任务,开始调宽";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
AdjustWidth(agv, JobParam.FixMissionInfo.Type); AdjustWidth(agv, WarehouseSigManager.OutStore.Type);
} }
else if (OpManager.Info.GetTransfer(out string target)) else if (OpManager.Info.GetTransfer(out string target))
{ {
...@@ -205,8 +205,9 @@ namespace DeviceLibrary ...@@ -205,8 +205,9 @@ namespace DeviceLibrary
if(!target.Equals(SettingString.Cancel)) if(!target.Equals(SettingString.Cancel))
{ {
agv.HasError = false; agv.HasError = false;
runInfo = $"收到离开信号,开始运送出库治具"; runInfo = $"收到离开信号,开始运送出库治具到"+ target;
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
JobRunStep.EndJob();
return new SendFixToLineJob(new JobParam(JobParam.TargetNode, NodeManager.GetNodeByName(target)),true); return new SendFixToLineJob(new JobParam(JobParam.TargetNode, NodeManager.GetNodeByName(target)),true);
} }
else else
......
...@@ -30,11 +30,11 @@ namespace DeviceLibrary ...@@ -30,11 +30,11 @@ namespace DeviceLibrary
JobRunStep.ToNextStep(RunStep.ADJUST_WIDTH); JobRunStep.ToNextStep(RunStep.ADJUST_WIDTH);
runInfo = "准备去" + JobParam.TargetNode + ",先调宽"; runInfo = "准备去" + JobParam.TargetNode + ",先调宽";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
AdjustWidth(agv,JobParam.FixMissionInfo.Type); AdjustWidth(agv, JobParam.FixMissionInfo.Type);
} }
else if(JobRunStep.IsStep(RunStep.ADJUST_WIDTH)) else if (JobRunStep.IsStep(RunStep.ADJUST_WIDTH))
{ {
if(agv.TaskRunState.CheckTaskFinished(agv.Name)) if (agv.TaskRunState.CheckTaskFinished(agv.Name))
{ {
if (JobParam.SrcNode.Area.Equals(Area.Air_C) && !JobParam.TargetNode.Area.Equals(Area.Air_C))//4C风淋门内->风淋门外 if (JobParam.SrcNode.Area.Equals(Area.Air_C) && !JobParam.TargetNode.Area.Equals(Area.Air_C))//4C风淋门内->风淋门外
{ {
...@@ -285,22 +285,19 @@ namespace DeviceLibrary ...@@ -285,22 +285,19 @@ namespace DeviceLibrary
{ {
if (JobParam.OpType.Equals(OpType.Mannual)) if (JobParam.OpType.Equals(OpType.Mannual))
{ {
if (agv.Input != null && agv.Input.Length == 4) if (agv.GetInput(2, 0))
{ {
if (agv.Input[0].Equals(true)) runInfo = "人员在" + JobParam.TargetNode + "操作完成";
{ JobRunStep.Msg = runInfo;
runInfo = "人员在" + JobParam.TargetNode + "操作完成"; JobRunStep.EndJob();
JobRunStep.Msg = runInfo; return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf==null?null:JobParam.Shelf.ToCopy()));
JobRunStep.EndJob();
return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf.ToCopy()));
}
} }
} }
else if (JobParam.OpType.Equals(OpType.RequestAPI)) else if (JobParam.OpType.Equals(OpType.RequestAPI))
{ {
if (OpManager.Info.GetTransfer(out string target)) if (OpManager.Info.GetTransfer(out string target))
{ {
if(target.Equals(SettingString.Cancel)) if (target.Equals(SettingString.Cancel))
{ {
JobRunStep.ToNextStep(RunStep.END); JobRunStep.ToNextStep(RunStep.END);
runInfo = "到达" + JobParam.TargetNode + ",该任务被取消"; runInfo = "到达" + JobParam.TargetNode + ",该任务被取消";
...@@ -311,22 +308,19 @@ namespace DeviceLibrary ...@@ -311,22 +308,19 @@ namespace DeviceLibrary
runInfo = "人员在" + JobParam.TargetNode + "操作完成"; runInfo = "人员在" + JobParam.TargetNode + "操作完成";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
JobRunStep.EndJob(); JobRunStep.EndJob();
return new FixToInStoreJob(new JobParam(JobParam.TargetNode, NodeManager.GetNodeByName(target), JobParam.Shelf.ToCopy())); return new FixToInStoreJob(new JobParam(JobParam.TargetNode, NodeManager.GetNodeByName(target), JobParam.Shelf==null?null:JobParam.Shelf.ToCopy()));
} }
} }
} }
else if (JobParam.OpType.Equals(OpType.MaulAndAPI)) else if (JobParam.OpType.Equals(OpType.MaulAndAPI))
{ {
if (agv.Input != null && agv.Input.Length == 4) if (agv.GetInput(2,0) || OpManager.Info.GetUnlock(JobParam.Shelf.RFID))
{ {
if (agv.Input[0].Equals(true) || OpManager.Info.GetUnlock(JobParam.Shelf.RFID)) runInfo = "人员在" + JobParam.TargetNode + "操作完成";
{ JobRunStep.Msg = runInfo;
runInfo = "人员在" + JobParam.TargetNode + "操作完成"; JobRunStep.EndJob();
JobRunStep.Msg = runInfo; return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf==null?null:JobParam.Shelf.ToCopy()));
JobRunStep.EndJob();
return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf.ToCopy()));
}
} }
} }
} }
......
...@@ -26,7 +26,7 @@ namespace DeviceLibrary ...@@ -26,7 +26,7 @@ namespace DeviceLibrary
{ {
if (adjustWidth) if (adjustWidth)
{ {
OpManager.ClientToSMDServer.RemoveRfidBufInfo(JobParam.Shelf.RFID); OpManager.ClientToSMDServer.RemoveRfidBufInfo(JobParam.Shelf==null?"":JobParam.Shelf.RFID);
if (JobParam.TargetNode.Area.Equals(Area.C) || JobParam.TargetNode.Area.Equals(Area.Air_C)) if (JobParam.TargetNode.Area.Equals(Area.C) || JobParam.TargetNode.Area.Equals(Area.Air_C))
{ {
JobRunStep.ToNextStep(RunStep.WAIT_IN_ROOM_C); JobRunStep.ToNextStep(RunStep.WAIT_IN_ROOM_C);
...@@ -162,15 +162,12 @@ namespace DeviceLibrary ...@@ -162,15 +162,12 @@ namespace DeviceLibrary
{ {
if (JobParam.OpType.Equals(OpType.Mannual)) if (JobParam.OpType.Equals(OpType.Mannual))
{ {
if (agv.Input != null && agv.Input.Length == 4) if (agv.GetInput(2, 0).Equals(true))
{ {
if (agv.Input[0].Equals(true)) runInfo = "人员在" + JobParam.TargetNode + "操作完成";
{ JobRunStep.Msg = runInfo;
runInfo = "人员在" + JobParam.TargetNode + "操作完成"; JobRunStep.EndJob();
JobRunStep.Msg = runInfo; return new EmptyAGVBackJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf==null?null:JobParam.Shelf.ToCopy()));
JobRunStep.EndJob();
return new EmptyAGVBackJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf.ToCopy()));
}
} }
} }
else if (JobParam.OpType.Equals(OpType.RequestAPI)) else if (JobParam.OpType.Equals(OpType.RequestAPI))
...@@ -180,20 +177,17 @@ namespace DeviceLibrary ...@@ -180,20 +177,17 @@ namespace DeviceLibrary
runInfo = "人员在" + JobParam.TargetNode + "操作完成"; runInfo = "人员在" + JobParam.TargetNode + "操作完成";
JobRunStep.Msg = runInfo; JobRunStep.Msg = runInfo;
JobRunStep.EndJob(); JobRunStep.EndJob();
return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf.ToCopy())); return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf==null?null:JobParam.Shelf.ToCopy()));
} }
} }
else if (JobParam.OpType.Equals(OpType.MaulAndAPI)) else if (JobParam.OpType.Equals(OpType.MaulAndAPI))
{ {
if (agv.Input != null && agv.Input.Length == 4) if (agv.GetInput(2,0) || OpManager.Info.GetUnlock(JobParam.Shelf.RFID))
{ {
if (agv.Input[0].Equals(true) || OpManager.Info.GetUnlock(JobParam.Shelf.RFID)) runInfo = "人员在" + JobParam.TargetNode + "操作完成";
{ JobRunStep.Msg = runInfo;
runInfo = "人员在" + JobParam.TargetNode + "操作完成"; JobRunStep.EndJob();
JobRunStep.Msg = runInfo; return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf.ToCopy()));
JobRunStep.EndJob();
return new FixToInStoreJob(new JobParam(JobParam.TargetNode, null, JobParam.Shelf.ToCopy()));
}
} }
} }
} }
......
...@@ -76,11 +76,11 @@ namespace DeviceLibrary ...@@ -76,11 +76,11 @@ namespace DeviceLibrary
} }
else if (JobRunStep.IsStep(RunStep.STANDBY_WAIT_REACH_STANDBY)) else if (JobRunStep.IsStep(RunStep.STANDBY_WAIT_REACH_STANDBY))
{ {
if (agv.TaskRunState.CheckTaskFinished(agv.Name)) //if (agv.TaskRunState.CheckTaskFinished(agv.Name))
{ {
JobRunStep.ToNextStep(RunStep.END); JobRunStep.ToNextStep(RunStep.END);
runInfo = "到达待机位"; // runInfo = "到达待机位";
JobRunStep.Msg = runInfo; //JobRunStep.Msg = runInfo;
} }
} }
else if (JobRunStep.IsStep(RunStep.END)) else if (JobRunStep.IsStep(RunStep.END))
......
...@@ -66,7 +66,7 @@ namespace DeviceLibrary ...@@ -66,7 +66,7 @@ namespace DeviceLibrary
{ {
AgvTask task = AgvTasks.Find(s => s.Name.Equals(name)); AgvTask task = AgvTasks.Find(s => s.Name.Equals(name));
if (task != null) if (task != null)
return task; return task.ToCopy();
else else
LogUtil.error(string.Format("任务名{0}不存在,请检查配置文件!", name)); LogUtil.error(string.Format("任务名{0}不存在,请检查配置文件!", name));
return new AgvTask(); return new AgvTask();
...@@ -127,7 +127,7 @@ namespace DeviceLibrary ...@@ -127,7 +127,7 @@ namespace DeviceLibrary
LogUtil.info(string.Format("{0} Add_Mission {1} Fail", agv.Name, agv.TaskRunState.ToTaskInfo())); LogUtil.info(string.Format("{0} Add_Mission {1} Fail", agv.Name, agv.TaskRunState.ToTaskInfo()));
} }
} }
agv.StateKanban.SetCurTask(agv.TaskRunState.ToTaskInfo()); agv.StateKanban.SetCurTask(agv.TaskRunState.ToTaskShowInfo());
if (!rtn) if (!rtn)
agv.TaskRunState.EnWaitTaskQueue(task); agv.TaskRunState.EnWaitTaskQueue(task);
} }
......
...@@ -54,6 +54,7 @@ namespace DeviceLibrary ...@@ -54,6 +54,7 @@ namespace DeviceLibrary
public static bool GetTransfer(out string target) public static bool GetTransfer(out string target)
{ {
target = ""; target = "";
Common.LogUtil.debug($"GetTransfer [name={manager.WarehouseSigManager.TargetWithFix.Name},target={manager.WarehouseSigManager.TargetWithFix.Target}]");
if (!string.IsNullOrEmpty(manager.WarehouseSigManager.TargetWithFix.Target)) if (!string.IsNullOrEmpty(manager.WarehouseSigManager.TargetWithFix.Target))
{ {
target= manager.WarehouseSigManager.TargetWithFix.Target; target= manager.WarehouseSigManager.TargetWithFix.Target;
......
...@@ -46,7 +46,14 @@ namespace DeviceLibrary.manager ...@@ -46,7 +46,14 @@ namespace DeviceLibrary.manager
agv_Info.IsUse = bool.Parse(xnl0.Item(2).InnerText); agv_Info.IsUse = bool.Parse(xnl0.Item(2).InnerText);
agv_Info.UseFleet = bool.Parse(xnl0.Item(3).InnerText); agv_Info.UseFleet = bool.Parse(xnl0.Item(3).InnerText);
agv_Info.Authorization = xnl0.Item(4).InnerText; agv_Info.Authorization = xnl0.Item(4).InnerText;
agv_Info.IOID = xnl0.Item(5).InnerText; XmlNode xnIO = xe.SelectSingleNode("IO_GUIDs");
XmlNodeList xnlios = xnIO.ChildNodes;
foreach (XmlNode item in xnlios)
{
IOInfo iOInfo = new IOInfo();
iOInfo.IOID = item.InnerText;
agv_Info.IOStatus.Add(iOInfo);
}
agv_Infos.Add(agv_Info); agv_Infos.Add(agv_Info);
} }
xmlReader.Close(); xmlReader.Close();
......
...@@ -351,6 +351,11 @@ namespace DeviceLibrary ...@@ -351,6 +351,11 @@ namespace DeviceLibrary
WarehouseSigManager.TargetWithFix.Set(name, target); WarehouseSigManager.TargetWithFix.Set(name, target);
Log.Info($"运送接口调用成功[GET]: name={name},target={target}"); Log.Info($"运送接口调用成功[GET]: name={name},target={target}");
} }
else if(!NodeManager.HasNode(target))
{
result1 = new Result1() { Succeed = false, Data = "", Msg = $"target={target} do not exist" };
Log.Info($"运送接口调用失败[GET]: : 目的地不存在, name={name},target={target},curplace={WarehouseSigManager.TargetWithFix.CurPlace}");
}
else else
{ {
result1 = new Result1() { Succeed = false, Data = "", Msg = $" AGV is in {WarehouseSigManager.TargetWithFix.CurPlace}, line {name} is not allowed to call this interface TransferByGet at this time." }; result1 = new Result1() { Succeed = false, Data = "", Msg = $" AGV is in {WarehouseSigManager.TargetWithFix.CurPlace}, line {name} is not allowed to call this interface TransferByGet at this time." };
...@@ -384,6 +389,11 @@ namespace DeviceLibrary ...@@ -384,6 +389,11 @@ namespace DeviceLibrary
WarehouseSigManager.TargetWithFix.Set(name, target); WarehouseSigManager.TargetWithFix.Set(name, target);
Log.Info($"运送接口调用成功[GET]: name={name},target={target}"); Log.Info($"运送接口调用成功[GET]: name={name},target={target}");
} }
else if (!NodeManager.HasNode(target))
{
result1 = new Result1() { Succeed = false, Data = "", Msg = $"target={target} do not exist" };
Log.Info($"运送接口调用失败[POST]: : 目的地不存在, name={name},target={target},curplace={WarehouseSigManager.TargetWithFix.CurPlace}");
}
else else
{ {
result1 = new Result1() { Succeed = false, Data = "", Msg = $" AGV is in {WarehouseSigManager.TargetWithFix.CurPlace}, line {name} is not allowed to call this interface TransferByGet at this time." }; result1 = new Result1() { Succeed = false, Data = "", Msg = $" AGV is in {WarehouseSigManager.TargetWithFix.CurPlace}, line {name} is not allowed to call this interface TransferByGet at this time." };
......
...@@ -81,7 +81,18 @@ namespace DeviceLibrary.manager ...@@ -81,7 +81,18 @@ namespace DeviceLibrary.manager
public enum FixType public enum FixType
{ {
None None = 0,
FCT = 1,
ICT = 2,
/// <summary>
/// 烧录治具
/// </summary>
BRUN = 3,
/// <summary>
/// 抓手治具
/// </summary>
HandFix = 4,
} }
public enum MissionType public enum MissionType
{ {
......
...@@ -40,9 +40,8 @@ namespace AGVControl ...@@ -40,9 +40,8 @@ namespace AGVControl
//agvRunStep = new string[Common.agvInfo.Count]; //agvRunStep = new string[Common.agvInfo.Count];
for (int i = 0; i < AGVManager.agvInfo.Count; i++) for (int i = 0; i < AGVManager.agvInfo.Count; i++)
{ {
MiR_API.Get_IO_Status(AGVManager.agvInfo[i], out bool[] input, out bool[] output); MiR_API.Get_IO_Status(AGVManager.agvInfo[i]);
if (input != null && input.Length == 4) AGVManager.agvInfo[i].IsExistShelf = AGVManager.agvInfo[i].GetInput(0,3);
AGVManager.agvInfo[i].IsExistShelf = input[3];
flowLayoutPanel1.Controls.Add(AGVManager.agvInfo[i].StateKanban); flowLayoutPanel1.Controls.Add(AGVManager.agvInfo[i].StateKanban);
AddForm(AGVManager.agvInfo[i].Name, new Manual(AGVManager.agvInfo[i])); AddForm(AGVManager.agvInfo[i].Name, new Manual(AGVManager.agvInfo[i]));
AGVManager.agvInfo[i].StateKanban.Init(AGVManager.agvInfo[i].Name); AGVManager.agvInfo[i].StateKanban.Init(AGVManager.agvInfo[i].Name);
...@@ -55,7 +54,9 @@ namespace AGVControl ...@@ -55,7 +54,9 @@ namespace AGVControl
private void FixMissionManager_MissionChangedEvent() private void FixMissionManager_MissionChangedEvent()
{ {
DeviceLibrary.manager.FixMissionManager.UpdateDataSource(dgvInfos); this.Invoke(new Action(()=> {
DeviceLibrary.manager.FixMissionManager.UpdateDataSource(dgvInfos);
}));
} }
private void Server_NodeChanged(Node node) private void Server_NodeChanged(Node node)
...@@ -144,9 +145,9 @@ namespace AGVControl ...@@ -144,9 +145,9 @@ namespace AGVControl
if (e.ColumnIndex == 6) //调用 if (e.ColumnIndex == 6) //调用
{ {
DataGridView dgv = sender as DataGridView; DataGridView dgv = sender as DataGridView;
if(dgv != null) if (dgv != null)
{ {
} }
NodeManager.nodeInfo[idx].IsUse = !NodeManager.nodeInfo[idx].IsUse; NodeManager.nodeInfo[idx].IsUse = !NodeManager.nodeInfo[idx].IsUse;
DgvNode.Rows[idx].DefaultCellStyle.ForeColor = NodeManager.nodeInfo[idx].Online && NodeManager.nodeInfo[idx].IsUse ? Color.Black : Color.Red; DgvNode.Rows[idx].DefaultCellStyle.ForeColor = NodeManager.nodeInfo[idx].Online && NodeManager.nodeInfo[idx].IsUse ? Color.Black : Color.Red;
...@@ -218,7 +219,7 @@ namespace AGVControl ...@@ -218,7 +219,7 @@ namespace AGVControl
private void dgvInfos_CellContentClick(object sender, DataGridViewCellEventArgs e) private void dgvInfos_CellContentClick(object sender, DataGridViewCellEventArgs e)
{ {
if(e.ColumnIndex==4) if (e.ColumnIndex == 4)
{ {
if (e.RowIndex == -1) if (e.RowIndex == -1)
return; return;
......
...@@ -39,14 +39,15 @@ namespace AGVControl ...@@ -39,14 +39,15 @@ namespace AGVControl
{ {
if (!IsHandleCreated) if (!IsHandleCreated)
return; return;
this.Invoke(new Action(() => { this.Invoke(new Action(() =>
{
try try
{ {
if (Agv.Input != null && Agv.Input.Length == 4) if (Agv.IOStatus[0] != null && Agv.IOStatus[0].Inputs !=null)
{ {
for (int i = 0; i < Agv.Input.Length; i++) for (int i = 0; i < Agv.IOStatus[0].Inputs.Length; i++)
{ {
if (Agv.Input[i]) if (Agv.GetInput(0,i))
{ {
InState[i].Image = AGVControl_Fixture.Properties.Resources.green1; InState[i].Image = AGVControl_Fixture.Properties.Resources.green1;
} }
...@@ -56,11 +57,11 @@ namespace AGVControl ...@@ -56,11 +57,11 @@ namespace AGVControl
} }
} }
} }
if (Agv.Output != null && Agv.Output.Length == 4) if(Agv.IOStatus[2]!=null && Agv.IOStatus[2].Inputs!=null)
{ {
for (int i = 0; i < Agv.Output.Length; i++) for (int i = 0; i < Agv.IOStatus[2].Inputs.Length; i++)
{ {
if (Agv.Output[i]) if (Agv.GetInput(2, i))
{ {
OutState[i].Image = AGVControl_Fixture.Properties.Resources.green1; OutState[i].Image = AGVControl_Fixture.Properties.Resources.green1;
} }
...@@ -70,6 +71,7 @@ namespace AGVControl ...@@ -70,6 +71,7 @@ namespace AGVControl
} }
} }
} }
} }
catch { } catch { }
})); }));
...@@ -84,14 +86,15 @@ namespace AGVControl ...@@ -84,14 +86,15 @@ namespace AGVControl
cmbBxMission.Enabled = !chkBxAuto.Checked; cmbBxMission.Enabled = !chkBxAuto.Checked;
if (!chkBxAuto.Checked) if (!chkBxAuto.Checked)
{ {
Agv.IsUse = false;
ChargePileManager.StopCharge(Agv); ChargePileManager.StopCharge(Agv);
if (Agv.IsCon) if (Agv.IsCon)
{ {
LogUtil.info($"取消自动任务,当前任务信息是:{Agv.Msg}"); LogUtil.info($"取消自动任务,当前任务信息是:{Agv.Msg}");
Agv.CurJob = null; Agv.CurJob = null;
MiR_API.Del_Mission(Agv); //MiR_API.Del_Mission(Agv);
//添加Init任务 //添加Init任务
AgvTaskManager.AssignMission(Agv,SettingString.Init); AgvTaskManager.AssignMission(Agv, SettingString.Init);
} }
} }
...@@ -100,17 +103,12 @@ namespace AGVControl ...@@ -100,17 +103,12 @@ namespace AGVControl
if (Agv.IsExistShelf) if (Agv.IsExistShelf)
{ {
chkBxAuto.Checked = false; chkBxAuto.Checked = false;
MessageBox.Show(this,string.Format("{0} 车上有负载,无法开启自动模式,请先清空小车负载!", Agv.Name), "警告"); MessageBox.Show(this, string.Format("{0} 车上有负载,无法开启自动模式,请先清空小车负载!", Agv.Name), "警告");
LogUtil.error(string.Format("{0} 车上有负载,无法开启自动模式,请先清空小车负载!", Agv.Name)); LogUtil.error(string.Format("{0} 车上有负载,无法开启自动模式,请先清空小车负载!", Agv.Name));
return; return;
} }
Agv.IsUse = true;
//if (Agv.Place.Equals(SettingString.Standby) || Agv.Place.Equals(SettingString.AutoCharge))
// Agv.Place = new Node();
if (Agv.IsCon)
MiR_API.Del_Mission(Agv);
} }
Agv.IsUse = chkBxAuto.Checked;
})); }));
} }
...@@ -174,7 +172,8 @@ namespace AGVControl ...@@ -174,7 +172,8 @@ namespace AGVControl
if (MessageBox.Show("确定对小车发送进/出任务?", Agv.Name, MessageBoxButtons.YesNo) == DialogResult.No) if (MessageBox.Show("确定对小车发送进/出任务?", Agv.Name, MessageBoxButtons.YesNo) == DialogResult.No)
return; return;
AgvTaskManager.AssignMission(Agv, task.Name); AgvTaskManager.AssignMission(Agv, task.Name);
LogUtil.info(string.Format("{0} 手动发任务 [{1}]", Agv.Name, cmbBxMission.SelectedItem.ToString())); AgvTask agvTask = cmbBxMission.SelectedItem as AgvTask;
LogUtil.info(string.Format("{0} 手动发任务 [{1}]", Agv.Name, agvTask.Name));
} }
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -64,6 +64,21 @@ ...@@ -64,6 +64,21 @@
<conversionPattern value="%m%n"/> <conversionPattern value="%m%n"/>
</layout> </layout>
</appender> </appender>
<appender name="MiR_API" type="log4net.Appender.RollingFileAppender">
<file value="logs/MiR_API/MiR_API.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<param name="MaxSizeRollBackups" value="30" />
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%m%n"/>
</layout>
</appender>
<logger name="MiR_API">
<level value="MiR_API"/>
<appender-ref ref="MiR_API"/>
</logger>
<logger name="RunLog"> <logger name="RunLog">
<level value="Info"/> <level value="Info"/>
<appender-ref ref="RunLog"/> <appender-ref ref="RunLog"/>
...@@ -81,7 +96,7 @@ ...@@ -81,7 +96,7 @@
<appender-ref ref="HttpManager"/> <appender-ref ref="HttpManager"/>
</logger> </logger>
<root name="AGV_3D_Line"> <root name="AGV_3D_Line">
<level value="Info"/> <level value="debug"/>
<appender-ref ref="AGV_3D_Line"/> <appender-ref ref="AGV_3D_Line"/>
</root> </root>
</log4net> </log4net>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!