Commit d4bc3cf4 张东亮

送满料等级middle,解析失败断开连接

1 个父辈 13dd469a
...@@ -5,10 +5,6 @@ VisualStudioVersion = 16.0.30104.148 ...@@ -5,10 +5,6 @@ VisualStudioVersion = 16.0.30104.148
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AGV_3D_SMD", "AGV_3D_SMD\AGV_3D_SMD.csproj", "{E1C3207D-C67D-4B46-A9DB-D182F2074CCB}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AGV_3D_SMD", "AGV_3D_SMD\AGV_3D_SMD.csproj", "{E1C3207D-C67D-4B46-A9DB-D182F2074CCB}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgvClientTest", "AgvClientTest\AgvClientTest.csproj", "{E1C0827A-FA12-49A9-AC71-6D3E6518754A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgvClient", "AgvClient\AgvClient.csproj", "{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceLibrary", "DeviceLibrary\DeviceLibrary.csproj", "{F9619F07-15F1-4E59-A383-3871952BBB79}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceLibrary", "DeviceLibrary\DeviceLibrary.csproj", "{F9619F07-15F1-4E59-A383-3871952BBB79}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csproj", "{BAFEAFE6-04E2-48EE-8845-BFC7EA3E3C21}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csproj", "{BAFEAFE6-04E2-48EE-8845-BFC7EA3E3C21}"
...@@ -25,14 +21,6 @@ Global ...@@ -25,14 +21,6 @@ Global
{E1C3207D-C67D-4B46-A9DB-D182F2074CCB}.Debug|Any CPU.Build.0 = Debug|Any CPU {E1C3207D-C67D-4B46-A9DB-D182F2074CCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1C3207D-C67D-4B46-A9DB-D182F2074CCB}.Release|Any CPU.ActiveCfg = Release|Any CPU {E1C3207D-C67D-4B46-A9DB-D182F2074CCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1C3207D-C67D-4B46-A9DB-D182F2074CCB}.Release|Any CPU.Build.0 = Release|Any CPU {E1C3207D-C67D-4B46-A9DB-D182F2074CCB}.Release|Any CPU.Build.0 = Release|Any CPU
{E1C0827A-FA12-49A9-AC71-6D3E6518754A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1C0827A-FA12-49A9-AC71-6D3E6518754A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1C0827A-FA12-49A9-AC71-6D3E6518754A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1C0827A-FA12-49A9-AC71-6D3E6518754A}.Release|Any CPU.Build.0 = Release|Any CPU
{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}.Release|Any CPU.Build.0 = Release|Any CPU
{F9619F07-15F1-4E59-A383-3871952BBB79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F9619F07-15F1-4E59-A383-3871952BBB79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9619F07-15F1-4E59-A383-3871952BBB79}.Debug|Any CPU.Build.0 = Debug|Any CPU {F9619F07-15F1-4E59-A383-3871952BBB79}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9619F07-15F1-4E59-A383-3871952BBB79}.Release|Any CPU.ActiveCfg = Release|Any CPU {F9619F07-15F1-4E59-A383-3871952BBB79}.Release|Any CPU.ActiveCfg = Release|Any CPU
......
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="icon.ico" /> <Content Include="icon.ico" />
<None Include="云仓AGV运行.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\AGV_UI\AGV_UI.csproj"> <ProjectReference Include="..\AGV_UI\AGV_UI.csproj">
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<appSettings> <appSettings>
<add key="http_server" value="http://10.85.162.124/myproject/"/> <add key="http_server" value="http://10.85.162.124/myproject/"/>
<add key="FLEET" value="10.85.199.3"/> <add key="FLEET" value="10.85.199.3"/>
<add key="LocalIP" value="10.85.162.40"/> <add key="LocalIP" value="127.0.0.1"/>
<add key="Use_Fleet" value="False"/> <add key="Use_Fleet" value="False"/>
<add key="ChargeThreshold" value="20,90"/> <add key="ChargeThreshold" value="20,90"/>
<add key="LimitPoints" value="0,0;0,0;0,0;0,0"/> <add key="LimitPoints" value="0,0;0,0;0,0;0,0"/>
......
...@@ -72,7 +72,10 @@ namespace AGVControl ...@@ -72,7 +72,10 @@ namespace AGVControl
{ {
Invoke(new Action(() => Invoke(new Action(() =>
{ {
DgvNode.Rows[nodeIndex].SetValues(CommonVar.nodeInfo[nodeIndex].ToRow()); for (int i=0;i<CommonVar.nodeInfo.Count;i++)
{
DgvNode.Rows[i].SetValues(CommonVar.nodeInfo[i].ToRow());
}
})); }));
System.GC.Collect(); System.GC.Collect();
} }
......
...@@ -63,6 +63,7 @@ namespace AGVControl ...@@ -63,6 +63,7 @@ namespace AGVControl
//} //}
if (MessageBox.Show(this, "是否继续上一次的任务?\r\n" + Agv.Msg, "提示", MessageBoxButtons.YesNo).Equals(DialogResult.No)) if (MessageBox.Show(this, "是否继续上一次的任务?\r\n" + Agv.Msg, "提示", MessageBoxButtons.YesNo).Equals(DialogResult.No))
{ {
LogUtil.info(string.Format("{0} 手动取消上一次任务:{1}", Agv.Name, Agv.Msg));
Agv.CurJob = null; Agv.CurJob = null;
if (Agv.Place.Equals(SettingString.Standby) || Agv.Place.Equals(SettingString.AutoCharge)) if (Agv.Place.Equals(SettingString.Standby) || Agv.Place.Equals(SettingString.AutoCharge))
Agv.Place = ""; Agv.Place = "";
...@@ -70,7 +71,6 @@ namespace AGVControl ...@@ -70,7 +71,6 @@ namespace AGVControl
{ {
MiR_API.Del_Mission(Agv); MiR_API.Del_Mission(Agv);
} }
Agv.RFID = ""; Agv.RFID = "";
} }
else else
......
...@@ -59,5 +59,15 @@ namespace AGV_3D_SMD.Properties { ...@@ -59,5 +59,15 @@ namespace AGV_3D_SMD.Properties {
resourceCulture = value; resourceCulture = value;
} }
} }
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap 云仓AGV运行 {
get {
object obj = ResourceManager.GetObject("云仓AGV运行", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
} }
} }
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
...@@ -68,9 +69,10 @@ ...@@ -68,9 +69,10 @@
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" /> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="assembly"> <xsd:element name="assembly">
...@@ -85,9 +87,10 @@ ...@@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
...@@ -109,9 +112,13 @@ ...@@ -109,9 +112,13 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="云仓AGV运行" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\云仓AGV运行.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -82,6 +82,7 @@ namespace Common ...@@ -82,6 +82,7 @@ namespace Common
public const string A3 = "A3"; public const string A3 = "A3";
public const string Enter = "Enter"; public const string Enter = "Enter";
public const string Leave = "Leave"; public const string Leave = "Leave";
public const string Turn = "Turn";
public const string A2 = "A2"; public const string A2 = "A2";
......
...@@ -286,6 +286,8 @@ namespace DeviceLibrary ...@@ -286,6 +286,8 @@ namespace DeviceLibrary
if (node == null) if (node == null)
{ {
log.Error("命令解析失败: " + HexBuff(buff)); log.Error("命令解析失败: " + HexBuff(buff));
log.Error("关闭连接,因解析失败:"+ string.Join(",",client.nodeName.ToArray()));
Offline(client);
} }
else else
{ {
......
...@@ -24,5 +24,6 @@ VMI入口,MoveA2,fa9d938e-764b-11eb-a016-0001297a1dca ...@@ -24,5 +24,6 @@ VMI入口,MoveA2,fa9d938e-764b-11eb-a016-0001297a1dca
待机位,MoveStandby,615cef05-61f4-11eb-96a9-0001297a1dca 待机位,MoveStandby,615cef05-61f4-11eb-96a9-0001297a1dca
充电位1,AutoCharge1,d90853ec-5f06-11eb-9d80-0001297a1dca 充电位1,AutoCharge1,d90853ec-5f06-11eb-9d80-0001297a1dca
充电位2,AutoCharge2,6b57174e-75a2-11eb-8565-0001297a1dca 充电位2,AutoCharge2,6b57174e-75a2-11eb-8565-0001297a1dca
转向,Turn,3f5a35ca-90a9-11eb-a19d-54b2038d1924
小车进料,Enter,ce64c188-61da-11eb-96a9-0001297a1dca 小车进料,Enter,ce64c188-61da-11eb-96a9-0001297a1dca
小车出料,Leave,65c1203c-61e1-11eb-96a9-0001297a1dca 小车出料,Leave,a7220ff0-7927-11eb-9adc-54b2038d1924
\ No newline at end of file \ No newline at end of file
[A1]
IsUse=True
[14ºÅ³µ]
IsUse=False
RFID=B112
[15ºÅ³µ]
IsUse=False
RFID=B#
[16ºÅ³µ]
IsUse=False
RFID=
[17ºÅ³µ]
IsUse=False
RFID=
[A2]
IsUse=True
[A8]
IsUse=True
[A7]
IsUse=True
[A9]
IsUse=True
[T1_1]
IsUse=True
[T1_2]
IsUse=True
[T2_1]
IsUse=True
[T2_2]
IsUse=True
[T3_1]
IsUse=True
[T3_2]
IsUse=True
[T5_1]
IsUse=True
[T5_2]
IsUse=True
[T4_1]
IsUse=True
[T4_2]
IsUse=True
[D23]
IsUse=True
[D24]
IsUse=True
[D1]
IsUse=True
[D2]
IsUse=True
[D3]
IsUse=True
[D4]
IsUse=True
...@@ -56,7 +56,7 @@ namespace DeviceLibrary ...@@ -56,7 +56,7 @@ namespace DeviceLibrary
to = CommonVar.nodeInfo[t2].AliceName; to = CommonVar.nodeInfo[t2].AliceName;
else else
to = TargetPlace; to = TargetPlace;
return string.Format("取{5}料串任务[RFID={4}]: {0}[目的地={1}][任务名称={2}][任务状态={3}]", runInfo,to, CurTaskName, CurTaskState, RFID, isFullShelf ? "满" : "空"); return string.Format("取{5}料串任务[RFID={4}]: {0}[目的地={1}][任务名称={2}][任务状态={3}]", runInfo, to, CurTaskName, CurTaskState, RFID, isFullShelf ? "满" : "空");
} }
} }
...@@ -171,7 +171,7 @@ namespace DeviceLibrary ...@@ -171,7 +171,7 @@ namespace DeviceLibrary
} }
else if (curJobStep.IsStep(EXECUTE_STEP.P4_WAIT_LINE_RESPONSE)) else if (curJobStep.IsStep(EXECUTE_STEP.P4_WAIT_LINE_RESPONSE))
{ {
int i = CommonVar.nodeInfo.FindIndex(s => s.Name.Equals(TargetPlace) );//&& s.StateEquals(eNodeStatus.MayLeave) int i = CommonVar.nodeInfo.FindIndex(s => s.Name.Equals(TargetPlace));//&& s.StateEquals(eNodeStatus.MayLeave)
if (i > -1) if (i > -1)
{ {
curJobStep.ToNextStep(EXECUTE_STEP.P5_WAIT_SHELF_IN_AGV); curJobStep.ToNextStep(EXECUTE_STEP.P5_WAIT_SHELF_IN_AGV);
...@@ -230,17 +230,6 @@ namespace DeviceLibrary ...@@ -230,17 +230,6 @@ namespace DeviceLibrary
} }
else else
{ {
if (TargetPlace.Equals(SettingString.D24_Out))
{
curJobStep.ToNextStep(EXECUTE_STEP.P7_WAIT_REACH_4D_DOOR);
runInfo = "在3C车间,去待机位先到3D门";
msg += runInfo;
curJobStep.Msg = msg;
CommonVar.DoorMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv);
}
else
{
curJobStep.ToNextStep(EXECUTE_STEP.P6_WAIT_REACH_STANDBY); curJobStep.ToNextStep(EXECUTE_STEP.P6_WAIT_REACH_STANDBY);
runInfo = "料串进入小车完成,当前无节点需要料串,去待机位"; runInfo = "料串进入小车完成,当前无节点需要料串,去待机位";
msg += runInfo; msg += runInfo;
...@@ -251,9 +240,6 @@ namespace DeviceLibrary ...@@ -251,9 +240,6 @@ namespace DeviceLibrary
} }
} }
}
else if (curJobStep.IsTimeOut(60000, out double timeOutTime)) else if (curJobStep.IsTimeOut(60000, out double timeOutTime))
{ {
runInfo = string.Format("线体[{0}]出料超时{1}秒,请检查出料情况", TargetPlace, timeOutTime.ToString("f2")); runInfo = string.Format("线体[{0}]出料超时{1}秒,请检查出料情况", TargetPlace, timeOutTime.ToString("f2"));
...@@ -262,19 +248,19 @@ namespace DeviceLibrary ...@@ -262,19 +248,19 @@ namespace DeviceLibrary
//去待机位 //去待机位
} }
} }
else if (curJobStep.IsStep(EXECUTE_STEP.P7_WAIT_REACH_4D_DOOR)) //else if (curJobStep.IsStep(EXECUTE_STEP.P7_WAIT_REACH_4D_DOOR))
{ //{
if (CommonVar.CheckTaskMoveFinished(agv, SettingString.DoorCToD, CurTaskState)) // if (CommonVar.CheckTaskMoveFinished(agv, SettingString.DoorCToD, CurTaskState))
{ // {
curJobStep.ToNextStep(EXECUTE_STEP.P6_WAIT_REACH_STANDBY); // curJobStep.ToNextStep(EXECUTE_STEP.P6_WAIT_REACH_STANDBY);
runInfo = "到达3D门,待机位"; // runInfo = "到达3D门,待机位";
msg += runInfo; // msg += runInfo;
curJobStep.Msg = msg; // curJobStep.Msg = msg;
CommonVar.MoveToNode(agv, SettingString.Standby); // CommonVar.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv); // UpdateJobTaskInfo(agv);
} // }
} //}
else if (curJobStep.IsStep(EXECUTE_STEP.P6_WAIT_REACH_STANDBY)) else if (curJobStep.IsStep(EXECUTE_STEP.P6_WAIT_REACH_STANDBY))
{ {
if (CommonVar.CheckTaskMoveFinished(agv, SettingString.Standby, CurTaskState)) if (CommonVar.CheckTaskMoveFinished(agv, SettingString.Standby, CurTaskState))
...@@ -349,6 +335,48 @@ namespace DeviceLibrary ...@@ -349,6 +335,48 @@ namespace DeviceLibrary
if (IsPlace(SettingString.D2) || IsPlace(SettingString.A1) || IsPlace(SettingString.A9)) if (IsPlace(SettingString.D2) || IsPlace(SettingString.A1) || IsPlace(SettingString.A9))
{ {
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.T5_1, ClientLevel.High,false))
{
tarPlace = SettingString.T5_1;
return true;
}
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.T3_1, ClientLevel.High, false))
{
tarPlace = SettingString.T3_1;
return true;
}
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.T2_1, ClientLevel.High, false))
{
tarPlace = SettingString.T2_1;
return true;
}
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.T1_1, ClientLevel.High, false))
{
tarPlace = SettingString.T1_1;
return true;
}
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.T5_1, ClientLevel.Middle, false))
{
tarPlace = SettingString.T5_1;
return true;
}
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.T3_1, ClientLevel.Middle, false))
{
tarPlace = SettingString.T3_1;
return true;
}
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.T2_1, ClientLevel.Middle, false))
{
tarPlace = SettingString.T2_1;
return true;
}
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.T1_1, ClientLevel.Middle, false))
{
tarPlace = SettingString.T1_1;
return true;
}
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.T5_1)) if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.T5_1))
{ {
tarPlace = SettingString.T5_1; tarPlace = SettingString.T5_1;
...@@ -369,7 +397,6 @@ namespace DeviceLibrary ...@@ -369,7 +397,6 @@ namespace DeviceLibrary
tarPlace = SettingString.T1_1; tarPlace = SettingString.T1_1;
return true; return true;
} }
} }
//退料线 //退料线
...@@ -390,11 +417,16 @@ namespace DeviceLibrary ...@@ -390,11 +417,16 @@ namespace DeviceLibrary
else//空料串 else//空料串
{ {
if (IsPlace(SettingString.A7) || IsPlace(SettingString.T5_2) || IsPlace(SettingString.T3_2)|| if (IsPlace(SettingString.A7) || IsPlace(SettingString.T5_2) || IsPlace(SettingString.T3_2) ||
IsPlace(SettingString.T2_2)|| IsPlace(SettingString.T1_2)) IsPlace(SettingString.T2_2) || IsPlace(SettingString.T1_2))
{ {
//检查紧急出料口C7需要空料串 //检查紧急出料口C7需要空料串
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.T4_1)) if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.T4_1,ClientLevel.High,false))
{
tarPlace = SettingString.T4_1;
return true;
}
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.T4_1, ClientLevel.Middle, false))
{ {
tarPlace = SettingString.T4_1; tarPlace = SettingString.T4_1;
return true; return true;
......
...@@ -153,39 +153,75 @@ namespace DeviceLibrary ...@@ -153,39 +153,75 @@ namespace DeviceLibrary
} }
else if (curJobStep.IsStep(EXECUTE_STEP.P4_WAIT_STATION_RESPONSE)) else if (curJobStep.IsStep(EXECUTE_STEP.P4_WAIT_STATION_RESPONSE))
{ {
// int i = CommonVar.nodeInfo.FindIndex(s => s.Name.Equals(TargetPlace) && s.StateEquals(eNodeStatus.MayEnter)); int i = CommonVar.nodeInfo.FindIndex(s => s.Name.Equals(TargetPlace));//&& s.StateEquals(eNodeStatus.MayEnter)
// if (i > -1) if (i > -1)
{ {
curJobStep.ToNextStep(EXECUTE_STEP.P5_WAIT_SHELF_IN_STATION); //curJobStep.ToNextStep(EXECUTE_STEP.P5_WAIT_SHELF_IN_STATION);
curJobStep.ToNextStep(EXECUTE_STEP.P6_TURN_DIRECTION);
runInfo = "收到线体允许进料信号,链条运行"; runInfo = "收到线体允许进料信号,链条运行";
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
rtn = agv.AssignTask(SettingString.Leave); rtn = agv.AssignTask(SettingString.Leave);
UpdateJobTaskInfo(agv); UpdateJobTaskInfo(agv);
} }
if (curJobStep.IsTimeOut(15000, out double timeOutTime)) // if (curJobStep.IsTimeOut(15000, out double timeOutTime))
//{
// curJobStep.ToNextStep(EXECUTE_STEP.P2_WAIT_REACH_STATION);
// runInfo = string.Format("线体[{0}]允许进料信号[{1}]超时{2}秒,重发进料请求", TargetPlace, eNodeStatus.MayEnter, timeOutTime.ToString("f2"));
// msg += string.Format("线体[{0}]允许进料信号[{1}]超时15S,重发进料请求", TargetPlace, eNodeStatus.MayEnter);
// curJobStep.Msg = msg;
//}
}
else if (curJobStep.IsStep(EXECUTE_STEP.P5_WAIT_SHELF_IN_STATION))
{ {
curJobStep.ToNextStep(EXECUTE_STEP.P2_WAIT_REACH_STATION); int idx = CommonVar.nodeInfo.FindIndex(s=>s.Name.Equals(TargetPlace) && s.StateEquals(eNodeStatus.FinishEnter));
runInfo = string.Format("线体[{0}]允许进料信号[{1}]超时{2}秒,重发进料请求", TargetPlace, eNodeStatus.MayEnter, timeOutTime.ToString("f2")); if(idx>-1)
msg += string.Format("线体[{0}]允许进料信号[{1}]超时15S,重发进料请求", TargetPlace, eNodeStatus.MayEnter); {
curJobStep.ToNextStep(EXECUTE_STEP.P6_TURN_DIRECTION);
runInfo = "料架进入" + TargetPlace + "完成";
msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
} }
else if (curJobStep.IsTimeOut(60000, out double timeOutTime))
{
runInfo = string.Format("等待线体[{0}]进料完成信号[FinishEnter]超时{1}秒", TargetPlace, timeOutTime.ToString("f2"));
msg += string.Format("等待线体[{0}]进料完成信号[FinishEnter]超时", TargetPlace);
curJobStep.Msg = msg;
} }
else if (curJobStep.IsStep(EXECUTE_STEP.P5_WAIT_SHELF_IN_STATION)) }
else if (curJobStep.IsStep(EXECUTE_STEP.P6_TURN_DIRECTION))
{ {
if (CommonVar.CheckEnterOrLeaveFinished(agv, SettingString.Leave, CurTaskState)) if (CommonVar.CheckEnterOrLeaveFinished(agv, SettingString.Leave, CurTaskState))
{ {
curJobStep.ToNextStep(EXECUTE_STEP.P7_END);
runInfo = "AGV在" + TargetPlace + "出料完成,开始转向";
msg += runInfo;
curJobStep.Msg = msg;
CommonVar.server.CloseDoor(TargetPlace); CommonVar.server.CloseDoor(TargetPlace);
//rtn = agv.AssignTask(SettingString.Turn);
//UpdateJobTaskInfo(agv);
}
else if (curJobStep.IsTimeOut(60000, out double timeOutTime))
{
runInfo = string.Format("线体[{0}]出料超时{1}秒,请检查料架情况", TargetPlace, timeOutTime.ToString("f2"));
msg += string.Format("线体[{0}]出料超时,请检查料架情况", TargetPlace);
curJobStep.Msg = msg;
}
}
else if (curJobStep.IsStep(EXECUTE_STEP.P7_END))
{
// if (CommonVar.CheckEnterOrLeaveFinished(agv, SettingString.Turn, CurTaskState))
{
if (IsPlace(SettingString.D23_In) && FindReturnShelf(agv)) if (IsPlace(SettingString.D23_In) && FindReturnShelf(agv))
{ {
runInfo = "料架进入" + TargetPlace + "完成,去退料线出口取一个料串回点料机"; runInfo = "AGV在" + TargetPlace + "转向完成,去退料线出口取一个料串回点料机";
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
return new GetShelfJob(TargetPlace, SettingString.D24_Out, "B#", true); return new GetShelfJob(TargetPlace, SettingString.D24_Out, "B#", true);
} }
else else
{ {
if(agv.IP.Equals(SettingString.SingleMission_IP1)) if (agv.IP.Equals(SettingString.SingleMission_IP1))
{ {
if (IsPlace(SettingString.A2) && !CommonVar.control.limitArea.Available) if (IsPlace(SettingString.A2) && !CommonVar.control.limitArea.Available)
{ {
...@@ -195,31 +231,21 @@ namespace DeviceLibrary ...@@ -195,31 +231,21 @@ namespace DeviceLibrary
} }
else else
{ {
curJobStep.ToNextStep(EXECUTE_STEP.P6_END); runInfo = "AGV在" + TargetPlace + "转向完成";
runInfo = "料架进入" + TargetPlace + "完成";
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
} }
} }
else else
{ {
curJobStep.ToNextStep(EXECUTE_STEP.P6_END); runInfo = "AGV在" + TargetPlace + "转向完成";
runInfo = "料架进入" + TargetPlace + "完成";
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
return null;
} }
} }
} }
else if (curJobStep.IsTimeOut(60000, out double timeOutTime))
{
runInfo = string.Format("线体[{0}]出料超时{1}秒,请检查料架情况", TargetPlace, timeOutTime.ToString("f2"));
msg += string.Format("线体[{0}]出料超时,请检查料架情况", TargetPlace);
curJobStep.Msg = msg;
}
}
else if (curJobStep.IsStep(EXECUTE_STEP.P6_END))
{
return null;
} }
return this; return this;
} }
...@@ -279,11 +305,14 @@ namespace DeviceLibrary ...@@ -279,11 +305,14 @@ namespace DeviceLibrary
/// 等待料架进入线体 /// 等待料架进入线体
/// </summary> /// </summary>
P5_WAIT_SHELF_IN_STATION, P5_WAIT_SHELF_IN_STATION,
/// <summary>
/// 转向
/// </summary>
P6_TURN_DIRECTION,
/// <summary> /// <summary>
/// 任务结束 /// 任务结束
/// </summary> /// </summary>
P6_END P7_END
} }
} }
......
...@@ -62,7 +62,7 @@ namespace DeviceLibrary ...@@ -62,7 +62,7 @@ namespace DeviceLibrary
} }
} }
//检查紧急出料入口需要空料串 //检查紧急出料入口需要空料串
if (FindNeedEnterMission(currentAgv, SettingString.T4_1)) if (FindNeedEnterMission(currentAgv, SettingString.T4_1,ClientLevel.Middle,false))
{ {
if (FindNeedLeaveMission(currentAgv, SettingString.T1_2, out rfid, SettingString.ReelString_RFID_Prefix)) if (FindNeedLeaveMission(currentAgv, SettingString.T1_2, out rfid, SettingString.ReelString_RFID_Prefix))
...@@ -160,9 +160,10 @@ namespace DeviceLibrary ...@@ -160,9 +160,10 @@ namespace DeviceLibrary
return new GetShelfJob(currentAgv.Place, SettingString.T5_2, rfid); return new GetShelfJob(currentAgv.Place, SettingString.T5_2, rfid);
} }
} }
//检查入料口需要满料,且点料机D2/A1出满料串 //检查入料口需要满料,且点料机D2/A1出满料串
if (FindNeedEnterMission(currentAgv, SettingString.T1_1) || FindNeedEnterMission(currentAgv, SettingString.T2_1) || if (FindNeedEnterMission(currentAgv, SettingString.T1_1,ClientLevel.Middle,false) || FindNeedEnterMission(currentAgv, SettingString.T2_1, ClientLevel.Middle, false) ||
FindNeedEnterMission(currentAgv, SettingString.T3_1) || FindNeedEnterMission(currentAgv, SettingString.T5_1)) FindNeedEnterMission(currentAgv, SettingString.T3_1, ClientLevel.Middle, false) || FindNeedEnterMission(currentAgv, SettingString.T5_1, ClientLevel.Middle, false))
{ {
if (FindNeedLeaveMission(currentAgv, SettingString.D2, out rfid)) if (FindNeedLeaveMission(currentAgv, SettingString.D2, out rfid))
{ {
...@@ -214,16 +215,19 @@ namespace DeviceLibrary ...@@ -214,16 +215,19 @@ namespace DeviceLibrary
} }
else else
{ {
agv.AddDisplayBoard(nodeName, "Using."+ nodeName, "调用关闭"); agv.AddDisplayBoard(nodeName, "Using." + nodeName, "调用关闭");
} }
return false; return false;
} }
public static bool FindNeedEnter(Agv_Info agv, string nodeName) public static bool FindNeedEnter(Agv_Info agv, string nodeName, ClientLevel level= ClientLevel.Low, bool ignoreLevel = true)
{ {
int nodeIdx = CommonVar.FindNode(nodeName); int nodeIdx = CommonVar.FindNode(nodeName);
if (nodeIdx > -1) if (nodeIdx > -1)
{ {
if (ignoreLevel)
nodeIdx = CommonVar.nodeInfo.FindIndex(s => s.Name.Equals(nodeName) && s.StateEquals(eNodeStatus.NeedEnter)); nodeIdx = CommonVar.nodeInfo.FindIndex(s => s.Name.Equals(nodeName) && s.StateEquals(eNodeStatus.NeedEnter));
else
nodeIdx = CommonVar.nodeInfo.FindIndex(s => s.Name.Equals(nodeName) && s.StateEquals(eNodeStatus.NeedEnter)&& s.Level.Equals(level));
if (nodeIdx > -1) if (nodeIdx > -1)
return true; return true;
} }
...@@ -240,39 +244,17 @@ namespace DeviceLibrary ...@@ -240,39 +244,17 @@ namespace DeviceLibrary
/// <param name="agv">当前agv</param> /// <param name="agv">当前agv</param>
/// <param name="nodeName">需要查询的节点</param> /// <param name="nodeName">需要查询的节点</param>
/// <returns></returns> /// <returns></returns>
public static bool FindNeedEnterMission(Agv_Info agv, string nodeName) public static bool FindNeedEnterMission(Agv_Info agv, string nodeName, ClientLevel level = ClientLevel.Low,bool ignoreLevel=true)
{ {
if (FindNeedEnter(agv, nodeName)) if (FindNeedEnter(agv, nodeName, level,ignoreLevel))
{ {
//if(agv.IP.Equals(SettingString.SingleMission_IP1))
//{ int idx = CommonVar.agvInfo.FindIndex(s => !s.IP.Equals(agv.IP) && s.CurJob != null && s.CurJob is SendShelfJob && (((SendShelfJob)s.CurJob).TargetPlace.Equals(nodeName)));
// return true;
//}
//else
{
int idx = CommonVar.agvInfo.FindIndex(s => !s.IP.Equals(agv.IP) && s.CurJob !=null && s.CurJob is SendShelfJob && (((SendShelfJob)s.CurJob).TargetPlace.Equals(nodeName)));
if (idx == -1) if (idx == -1)
{ {
LogUtil.debug(string.Format("{0} FindNeedEnterMission ", agv.Name)); LogUtil.debug(string.Format("{0} FindNeedEnterMission ", agv.Name));
return true; return true;
} }
//int idx = CommonVar.agvInfo.FindIndex(s => !s.IP.Equals(agv.IP) && (s.CurJob == null || !(s.CurJob is SendShelfJob)));
//if(idx>-1)
//{
// CommonVar.log.Debug(string.Format("{0} FindNeedEnterMission 1", agv.Name));
// return true;
//}
//else
//{
// idx = CommonVar.agvInfo.FindIndex(s => !s.IP.Equals(agv.IP) && s.CurJob is SendShelfJob && !(((SendShelfJob)s.CurJob).TargetPlace.Equals(nodeName)));
// if (idx > -1)
// {
// CommonVar.log.Debug(string.Format("{0} FindNeedEnterMission 2", agv.Name));
// return true;
// }
//}
}
} }
return false; return false;
...@@ -295,7 +277,7 @@ namespace DeviceLibrary ...@@ -295,7 +277,7 @@ namespace DeviceLibrary
//} //}
//else //else
{ {
int idx = CommonVar.agvInfo.FindIndex(s => !s.IP.Equals(agv.IP) && s.CurJob !=null && s.CurJob is GetShelfJob && (((GetShelfJob)s.CurJob).TargetPlace.Equals(nodeName))); int idx = CommonVar.agvInfo.FindIndex(s => !s.IP.Equals(agv.IP) && s.CurJob != null && s.CurJob is GetShelfJob && (((GetShelfJob)s.CurJob).TargetPlace.Equals(nodeName)));
if (idx == -1) if (idx == -1)
{ {
RFID = rfid; RFID = rfid;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!