Commit 7223b93e 张东亮

界面更新

1 个父辈 05b1c9b2
正在显示 87 个修改的文件 包含 2165 行增加533 行删除
...@@ -9,6 +9,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgvClientTest", "AgvClientT ...@@ -9,6 +9,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgvClientTest", "AgvClientT
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgvClient", "AgvClient\AgvClient.csproj", "{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgvClient", "AgvClient\AgvClient.csproj", "{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceLibrary", "DeviceLibrary\DeviceLibrary.csproj", "{F9619F07-15F1-4E59-A383-3871952BBB79}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csproj", "{BAFEAFE6-04E2-48EE-8845-BFC7EA3E3C21}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AGV_UI", "AGV_UI\AGV_UI.csproj", "{C6D2FC09-46F7-4EC5-A877-15EA06342E4F}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -27,6 +33,18 @@ Global ...@@ -27,6 +33,18 @@ Global
{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}.Debug|Any CPU.Build.0 = 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.ActiveCfg = Release|Any CPU
{7DAD8F15-0EC9-42DF-AE0B-94B45DE0F0AC}.Release|Any CPU.Build.0 = 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.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.Build.0 = Release|Any CPU
{BAFEAFE6-04E2-48EE-8845-BFC7EA3E3C21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BAFEAFE6-04E2-48EE-8845-BFC7EA3E3C21}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BAFEAFE6-04E2-48EE-8845-BFC7EA3E3C21}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BAFEAFE6-04E2-48EE-8845-BFC7EA3E3C21}.Release|Any CPU.Build.0 = Release|Any CPU
{C6D2FC09-46F7-4EC5-A877-15EA06342E4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C6D2FC09-46F7-4EC5-A877-15EA06342E4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C6D2FC09-46F7-4EC5-A877-15EA06342E4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C6D2FC09-46F7-4EC5-A877-15EA06342E4F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
...@@ -8,10 +8,11 @@ ...@@ -8,10 +8,11 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>AGV_3D_SMD</RootNamespace> <RootNamespace>AGV_3D_SMD</RootNamespace>
<AssemblyName>AGV_3D_SMD</AssemblyName> <AssemblyName>AGV_3D_SMD</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
...@@ -67,52 +68,26 @@ ...@@ -67,52 +68,26 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="bean\Agv_Info.cs" />
<Compile Include="bean\DisplayBoard.cs" />
<Compile Include="bean\Job.cs" />
<Compile Include="bean\JobStep.cs" />
<Compile Include="bean\jobType\ChargeJobType.cs" />
<Compile Include="bean\jobType\ReturnJobType.cs" />
<Compile Include="bean\JobType.cs" />
<Compile Include="bean\job\GetShelfJob.cs" />
<Compile Include="bean\job\SendShelfJob.cs" />
<Compile Include="bean\job\PackingJob_TransferShelf.cs" />
<Compile Include="bean\job\RecycleEmptyShelf.cs" />
<Compile Include="bean\job\PackingJob_SendShelf.cs" />
<Compile Include="bean\job\PackingJob_GetShelf.cs" />
<Compile Include="bean\job\StandyJob.cs" />
<Compile Include="bean\job\ChargeJob.cs" />
<Compile Include="bean\job\EnterLeaveShelfJob.cs" />
<Compile Include="bean\node\Node.cs" />
<Compile Include="bean\node\ClientNode.cs" />
<Compile Include="bean\jobType\ReelStringJobType.cs" />
<Compile Include="bean\jobType\PackingJobType.cs" />
<Compile Include="BLL\AGVManager.cs" />
<Compile Include="BLL\AgvServer.cs" />
<Compile Include="BLL\ScopeLimit.cs" />
<Compile Include="BLL\Standby.cs" />
<Compile Include="BLL\Charge.cs" />
<Compile Include="BLL\Common.cs" />
<Compile Include="BLL\Control.cs" />
<Compile Include="BLL\HttpHelper.cs" />
<Compile Include="BLL\FileHelper.cs" />
<Compile Include="BLL\JsonHelper.cs" />
<Compile Include="BLL\MyWebClient.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="BLL\SettingString.cs" />
<Compile Include="FrmMain.cs"> <Compile Include="FrmMain.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="FrmMain.Designer.cs"> <Compile Include="FrmMain.Designer.cs">
<DependentUpon>FrmMain.cs</DependentUpon> <DependentUpon>FrmMain.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="BLL\MiR_API.cs" /> <Compile Include="Manual.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Manual.Designer.cs">
<DependentUpon>Manual.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FrmMain.resx"> <EmbeddedResource Include="FrmMain.resx">
<DependentUpon>FrmMain.cs</DependentUpon> <DependentUpon>FrmMain.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Manual.resx">
<DependentUpon>Manual.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
...@@ -149,6 +124,19 @@ ...@@ -149,6 +124,19 @@
<ItemGroup> <ItemGroup>
<Content Include="icon.ico" /> <Content Include="icon.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup>
<ProjectReference Include="..\AGV_UI\AGV_UI.csproj">
<Project>{c6d2fc09-46f7-4ec5-a877-15ea06342e4f}</Project>
<Name>AGV_UI</Name>
</ProjectReference>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{bafeafe6-04e2-48ee-8845-bfc7ea3e3c21}</Project>
<Name>Common</Name>
</ProjectReference>
<ProjectReference Include="..\DeviceLibrary\DeviceLibrary.csproj">
<Project>{f9619f07-15f1-4e59-a383-3871952bbb79}</Project>
<Name>DeviceLibrary</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ 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"?>
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections> </configSections>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup> </startup>
<log4net> <log4net>
<appender name="AGV_3D_SMD" type="log4net.Appender.RollingFileAppender"> <appender name="AGV_3D_SMD" type="log4net.Appender.RollingFileAppender">
...@@ -51,12 +51,12 @@ ...@@ -51,12 +51,12 @@
</root> </root>
</log4net> </log4net>
<appSettings> <appSettings>
<add key="http_server" value="http://10.85.199.25/myproject/" /> <add key="http_server" value="http://10.85.199.25/myproject/"/>
<add key="FLEET" value="10.85.199.3" /> <add key="FLEET" value="10.85.199.3"/>
<add key="LocalIP" value="10.85.199.20" /> <add key="LocalIP" value="10.85.199.20"/>
<add key="AutoCharge" value="True" /> <add key="AutoCharge" value="True"/>
<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"/>
</appSettings> </appSettings>
</configuration>
\ No newline at end of file \ No newline at end of file
</configuration>
节点名,别名,佳世达线名 节点名,别名,佳世达线名
B1,packing-19,包装仓10-1
B2,packing-20,包装仓10-2
B3,packing-21,包装仓11-1
B4,packing-22,包装仓11-2
B5,packing-24,包装仓12-1
B6,packing-23,包装仓12-2
A1,A1,VMI-A1出口 A1,A1,VMI-A1出口
A2,A2,VMI-A2入口 A2,A2,VMI-A2入口
A3,A3,包装线-A3入口
A4,A4,包装线-A4出口
A7,A7,分盘线-A7出口 A7,A7,分盘线-A7出口
A8,A8,分盘线-A8入口 A8,A8,分盘线-A8入口
C1,C1,入料3-C1入口 T1_1,T1_1,入料T1入口
C2,C2,入料3-C2出口 T1_2,T1_2,入料T1出口
C3,C3,入料2-C3入口 T2_1,T2_1,入料T2入口
C4,C4,入料2-C4出口 T2_2,T2_2,入料T2出口
C5,C5,入料1-C5入口 T3_1,T3_1,入料T3入口
C6,C6,入料1-C6出口 T3_2,T3_2,入料T3出口
C7,C7,紧急料-C7入口 T5_1,T5_1,入料T5入口
C8,C8,紧急料-C8出口 T5_2,T5_2,入料T5出口
T4_1,T4_1,紧急料T4入口
T4_2,T4_2,紧急料T4出口
D1,D1,点料机-D1入口 D1,D1,点料机-D1入口
D2,D2,点料机-D2出口 D2,D2,点料机-D2出口
D3,D3,点料机-D3口 D3,D3,点料机-D3口
D4,D4,点料机-D4口
G23,G23,退料线入口
G24,G24,退料线出口
\ No newline at end of file \ No newline at end of file
D4,D4,点料机-D4口
\ No newline at end of file \ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DeviceLibrary;
using Common;
namespace AGVControl
{
public partial class Manual : Form
{
public Manual(Agv_Info agv)
{
InitializeComponent();
Agv = agv;
btnReSendTask.Enabled = agv.IsUse;
btnAssignTask.Enabled = !agv.IsUse;
}
Agv_Info Agv;
private void Manual_Load(object sender, EventArgs e)
{
lblInfo.Text = string.Format("[{0}]", Agv.IP);
cmbBxMission.Items.AddRange(CommonVar.showNameMissionName.Keys.ToArray());
cmbBxMission.SelectedIndex = 0;
}
private void chkBxAuto_CheckedChanged(object sender, EventArgs e)
{
this.Invoke(new Action(() =>
{
btnReSendTask.Enabled = chkBxAuto.Checked;
btnAssignTask.Enabled = !chkBxAuto.Checked;
if (!chkBxAuto.Checked)
{
Agv.CurJob = null;
CommonVar.Standby.DelOccupyInfo(Agv.Name);
CommonVar.Charge.DelOccupyInfo(Agv.Name);
//添加Init任务
MiR_API.Add_Mission_Fleet(Agv, CommonVar.agvMission[SettingString.Init]);
MiR_API.State_Ready(Agv);
if (Agv.Place.Equals(SettingString.Standby) || Agv.Place.Equals(SettingString.AutoCharge))
Agv.Place = "";
}
else
{
if (Agv.IsExistShelf)
{
LogUtil.error(string.Format("{0} 车上有负载,无法开启自动模式,请先清空小车负载!", Agv.Name));
return;
}
Agv.CurJob = null;
MiR_API.Del_Mission_Fleet(Agv, Agv.CurTaskID.ToString());
MiR_API.Del_Mission(Agv);
Agv.RFID = "";
}
Agv.IsUse = chkBxAuto.Checked;
}));
}
private void btnReSendTask_Click(object sender, EventArgs e)
{
if (Agv.IsCon)
{
if (MessageBox.Show("确定对小车重发任务?", Agv.Name, MessageBoxButtons.YesNo) == DialogResult.No)
return;
Agv.Resend();
LogUtil.info(string.Format("{0} 手动重发任务", Agv.Name));
}
}
private void btnReady_Click(object sender, EventArgs e)
{
if (Agv.IsCon)
{
MiR_API.State_Ready(Agv);
LogUtil.info(string.Format("{0} 手动点击运行", Agv.Name));
}
}
private void btnPause_Click(object sender, EventArgs e)
{
if (Agv.IsCon)
{
MiR_API.State_Pause(Agv);
LogUtil.info(string.Format("{0} 手动点击暂停", Agv.Name));
}
}
private void btnClearErr_Click(object sender, EventArgs e)
{
if (Agv.IsCon)
{
MiR_API.Clear_Error(Agv);
LogUtil.info(string.Format("{0} 手动点击清除按钮", Agv.Name));
}
}
private void btnAssignTask_Click(object sender, EventArgs e)
{
if (Agv.IsCon)
{
Agv.AssignTask(CommonVar.showNameMissionName[cmbBxMission.SelectedItem.ToString()]);
LogUtil.info(string.Format("{0} 手动发任务 {1}", Agv.Name, cmbBxMission.SelectedItem.ToString()));
}
}
private void btnExit_Click(object sender, EventArgs e)
{
Close();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: 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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<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:sequence>
<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="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAMAQAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAD/J75P/ye9d/8nvXf/J713/ye9d/8nvXf/J713/ye9d/8nvXf/J713/ye9d/8n
vXf/J713/ye+TgAAAAD/LKwu/yyuaAAAAAAAAAAAAAAAAAAAAAD/LK1d/y2ud/8trnf/LK9cAAAAAAAA
AAAAAAAAAAAAAP8ur2n/LbAt/y2lEf8zn6D/M6Cm/zOfiP8zn4j/M5+I/zWiPwAAAAAAAAAA/zWiP/8z
n4j/M5+I/zOfiP8zoKb/M5+g/y2lEQAAAAD/OJNA/zeUcP85kqb/OJKI/ziSiP84koj/OJKI/ziSiP84
koj/OJKI/ziSiP85kqb/N5Rw/ziTQAAAAAAAAAAA/0CDQP9AhHD/QINAAAAAAAAAAAD/P4FB/0CDkP9A
grT/QINn/0OFFwAAAAD/QINA/0CEcP9Ag0AAAAAAAAAAAP9IdED/R3Rw/0h0QAAAAAAAAAAA/0Z2kf9F
dTD/QnAy/0V1Vf9FdHIAAAAA/0h0QP9HdHD/SHRAAAAAAAAAAAD/TGhA/0tmcP9MaEAAAAAA/01nav9N
aEz/Y3qx/3mM6f9LZDP/TGe1AAAAAP9MaED/S2Zw/0xoQAAAAAAAAAAA/1RYQP9UV3D/VFhAAAAAAP9R
Vy//Ulif/2lfa/9rYbX/UFUw/1NakQAAAAD/VFhA/1RXcP9UWEAAAAAAAAAAAP9YTED/V0tw/1hMQAAA
AAD/gIAC/1lJp/9YS53/V0lJ/1dKlf9XSUYAAAAA/1hMQP9XS3D/WExAAAAAAAAAAAD/YDxA/106bv9d
PkIAAAAAAAAAAAAAAAD/Xj4x/188bgAAAAAAAAAAAAAAAP9dPkL/XTpu/2A8QAAAAAAAAAAA/2IrL/9l
LXL/ZC94/2MviP9jL4j/Yy+I/2MviP9jL4j/Yy+I/2MviP9jL4j/ZS13/2Utcv9kLC4AAAAAAAAAAAAA
AAD/bCFc/2sgiP9rIIj/ayCI/2sgiP9rIIj/ayCI/2sgiP9rIIj/ayCI/2sgiP9sH1oAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA//8AAP//AAD//wAA//8AAIPBAADgBwAA/n8AAP3/AAD+XwAA/V8AAPy/AAD//wAA8A8AAOAH
AAD//wAA//8AAA==
</value>
</data>
</root>
\ No newline at end of file \ No newline at end of file
using MiR; using log4net.Config;
using log4net.Config;
using log4net.Util.TypeConverters; using log4net.Util.TypeConverters;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -8,7 +7,8 @@ using System.Linq; ...@@ -8,7 +7,8 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using AGVControl.bean.jobType; using DeviceLibrary;
using Common;
namespace AGVControl namespace AGVControl
{ {
...@@ -36,8 +36,8 @@ namespace AGVControl ...@@ -36,8 +36,8 @@ namespace AGVControl
if (process.MainModule.FileName == current.MainModule.FileName) if (process.MainModule.FileName == current.MainModule.FileName)
{ {
//显示已打开的程序 //显示已打开的程序
API.ShowWindow(process.MainWindowHandle, API.SW_RESTORE); Window_API.ShowWindow(process.MainWindowHandle, Window_API.SW_RESTORE);
API.SwitchToThisWindow(process.MainWindowHandle, true); Window_API.SwitchToThisWindow(process.MainWindowHandle, true);
return; return;
} }
} }
...@@ -49,24 +49,21 @@ namespace AGVControl ...@@ -49,24 +49,21 @@ namespace AGVControl
private static void Start() private static void Start()
{ {
Common.logTextBox = new TextBox(); LogUtil.info("=====程序开始=====");
Common.log = log4net.LogManager.GetLogger("AGVControl_SMD_BOX");
Common.log.Info("=====程序开始=====");
ReadConfig(); ReadConfig();
Common.Charge = new BLL.Charge(); CommonVar.Charge = new Charge();
Common.Standby = new BLL.Standby(); CommonVar.Standby = new Standby();
Common.mir = new MiR.API(); CommonVar.control = new DeviceLibrary.Control();
Common.control = new BLL.Control();
Common.control.Start(); CommonVar.control.Start();
Common.server = new BLL.AgvServer(); CommonVar.server = new AgvServer();
Common.server.Start(); CommonVar.server.Start();
} }
private static void Stop() private static void Stop()
{ {
Common.control.Stop(); CommonVar.control.Stop();
Common.server.Stop(); CommonVar.server.Stop();
Common.log.Info("=====程序结束=====\r\n"); LogUtil.info("=====程序结束=====\r\n");
} }
private static void ReadConfig() private static void ReadConfig()
{ {
...@@ -77,58 +74,58 @@ namespace AGVControl ...@@ -77,58 +74,58 @@ namespace AGVControl
string rfid = ""; string rfid = "";
Common.agvInfo = new List<Agv_Info>(); CommonVar.agvInfo = new List<Agv_Info>();
path = Common.CONFIG_PATH + SettingString.FileName_AGV; path = CommonVar.CONFIG_PATH + SettingString.FileName_AGV;
line = System.IO.File.ReadAllLines(path, Encoding.UTF8); line = System.IO.File.ReadAllLines(path, Encoding.UTF8);
for (int i = 1; i < line.Length; i++) for (int i = 1; i < line.Length; i++)
{ {
temp = line[i].Split(','); temp = line[i].Split(',');
if (temp.Length != 5) continue; if (temp.Length != 5) continue;
//string val = Common.appConfig.AppSettings.Settings[temp[1]].Value; //string val = CommonVar.appConfig.AppSettings.Settings[temp[1]].Value;
bool.TryParse(Common.ReadIni(temp[1], SettingString.IsUse), out isuse); //Convert.ToBoolean(val.Split(',')[0]); bool.TryParse(CommonVar.ReadIni(temp[1], SettingString.IsUse), out isuse); //Convert.ToBoolean(val.Split(',')[0]);
rfid = Common.ReadIni(temp[1], SettingString.RFID); //val.Split(',')[1]; rfid = CommonVar.ReadIni(temp[1], SettingString.RFID); //val.Split(',')[1];
Common.agvInfo.Add(new Agv_Info(temp[0], temp[1], temp[2], temp[3], temp[4], isuse, rfid)); CommonVar.agvInfo.Add(new Agv_Info(temp[0], temp[1], temp[2], temp[3], temp[4], isuse, rfid));
} }
Common.agvMission = new Dictionary<string, string>(); CommonVar.agvMission = new Dictionary<string, string>();
Common.showNameMissionName = new Dictionary<string, string>(); CommonVar.showNameMissionName = new Dictionary<string, string>();
path = Common.CONFIG_PATH + SettingString.FileName_AgvMission; path = CommonVar.CONFIG_PATH + SettingString.FileName_AgvMission;
line = System.IO.File.ReadAllLines(path, Encoding.UTF8); line = System.IO.File.ReadAllLines(path, Encoding.UTF8);
for (int i = 1; i < line.Length; i++) for (int i = 1; i < line.Length; i++)
{ {
temp = line[i].Split(','); temp = line[i].Split(',');
if (temp.Length != 3) continue; if (temp.Length != 3) continue;
Common.agvMission.Add(temp[1], temp[2]); CommonVar.agvMission.Add(temp[1], temp[2]);
Common.showNameMissionName.Add(temp[0], temp[1]); CommonVar.showNameMissionName.Add(temp[0], temp[1]);
} }
Common.nodeInfo = new List<ClientNode>(); CommonVar.nodeInfo = new List<ClientNode>();
path = Common.CONFIG_PATH + SettingString.FileName_AgvProductionLine; path = CommonVar.CONFIG_PATH + SettingString.FileName_AgvProductionLine;
line = System.IO.File.ReadAllLines(path, Encoding.GetEncoding("gb2312")); line = System.IO.File.ReadAllLines(path, Encoding.GetEncoding("gb2312"));
for (int i = 1; i < line.Length; i++) for (int i = 1; i < line.Length; i++)
{ {
temp = line[i].Split(','); temp = line[i].Split(',');
if (temp.Length != 3) continue; if (temp.Length != 3) continue;
Boolean.TryParse(Common.ReadIni(temp[0], SettingString.IsUse), out bool isUse); Boolean.TryParse(CommonVar.ReadIni(temp[0], SettingString.IsUse), out bool isUse);
Common.nodeInfo.Add(new ClientNode(temp[0], temp[1],temp[2], isUse)); CommonVar.nodeInfo.Add(new ClientNode(temp[0], temp[1],temp[2], isUse));
} }
//加载任务类型 //加载任务类型
Common.jobTypeInfo = new List<JobType>(); CommonVar.jobTypeInfo = new List<JobType>();
Common.jobTypeInfo.Add(new PackingJobType()); //CommonVar.jobTypeInfo.Add(new PackingJobType());
Common.jobTypeInfo.Add(new ReelStringJobType()); CommonVar.jobTypeInfo.Add(new ReelStringJobType());
Common.jobTypeInfo.Add(new ReturnJobType()); //CommonVar.jobTypeInfo.Add(new ReturnJobType());
Common.jobTypeInfo.Add(new ChargeJobType()); CommonVar.jobTypeInfo.Add(new ChargeJobType());
} }
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{ {
Common.log.Error("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject); LogUtil.error("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject);
} }
private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{ {
Common.log.Error("Application_ThreadException", e.Exception); LogUtil.error("Application_ThreadException", e.Exception);
} }
} }
......
此文件类型无法预览
此文件类型无法预览
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C6D2FC09-46F7-4EC5-A877-15EA06342E4F}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>AGV_UI</RootNamespace>
<AssemblyName>AGV_UI</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Status.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Status.Designer.cs">
<DependentUpon>Status.cs</DependentUpon>
</Compile>
<Compile Include="Manager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Status.resx">
<DependentUpon>Status.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="battery\charge.png" />
<None Include="state\Unknown.png" />
<None Include="state\ready.png" />
<None Include="state\pause.png" />
<None Include="state\manual.png" />
<None Include="state\Executing.png" />
<None Include="state\Error.png" />
<None Include="state\emergency.png" />
<None Include="state\Aborted.png" />
<None Include="task.png" />
<None Include="online.png" />
<None Include="battery\full.png" />
<None Include="battery\common.png" />
<None Include="battery\low.png" />
<None Include="offline.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file \ No newline at end of file
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AGV_UI
{
class Manager
{
static ImageList connImageList;
static ImageList batteryImageList;
static ImageList stateImageList;
static string OnLine = "OnLine";
static string OffLine = "OffLine";
static string LowBattery = "LowBattery";
static string CommonBattery = "CommonBattery";
static string FullBattery = "FullBattery";
static string ChargeBattery = "ChargeBattery";
static string Ready = "Ready";
static string Pause = "Pause";
static string Executing = "Executing";
static string Aborted = "Aborted";
static string EmergencyStop = "EmergencyStop";
static string ManualControl = "ManualControl";
static string Error = "Error";
static string UNKNOWN = "UNKNOWN";
static void InitconnImageList()
{
connImageList = new ImageList();
connImageList.ImageSize = new System.Drawing.Size(32, 32);
connImageList.Images.Add(OnLine, Properties.Resources.online);
connImageList.Images.Add(OffLine, Properties.Resources.offline);
}
static void InitbatteryImageList()
{
batteryImageList = new ImageList();
batteryImageList.ImageSize = new System.Drawing.Size(48, 48);
batteryImageList.Images.Add(LowBattery, Properties.Resources.low);
batteryImageList.Images.Add(CommonBattery, Properties.Resources.common);
batteryImageList.Images.Add(FullBattery, Properties.Resources.full);
batteryImageList.Images.Add(ChargeBattery, Properties.Resources.charge);
}
static void InitStateImageList()
{
stateImageList = new ImageList();
stateImageList.ImageSize = new System.Drawing.Size(48, 48);
stateImageList.Images.Add(UNKNOWN, Properties.Resources.Unknown);
stateImageList.Images.Add(Ready, Properties.Resources.ready);
stateImageList.Images.Add(Pause, Properties.Resources.pause);
stateImageList.Images.Add(ManualControl, Properties.Resources.manual);
stateImageList.Images.Add(Executing, Properties.Resources.Executing);
stateImageList.Images.Add(Error, Properties.Resources.Error);
stateImageList.Images.Add(EmergencyStop, Properties.Resources.emergency);
stateImageList.Images.Add(Aborted, Properties.Resources.Aborted);
}
/// <summary>
/// 设置连接状态
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
public static Image SetConnState(bool state = false)
{
string tmp = state ? OnLine : OffLine;
if (connImageList == null)
InitconnImageList();
return connImageList.Images[tmp];
}
/// <summary>
/// 设置电量
/// </summary>
/// <param name="min"></param>
/// <param name="max"></param>
public static object[] SetBattery(int curBattery, bool isCharge = false, int min = 20, int max = 90)
{
if (curBattery < 0) curBattery = 0;
Image image;
if (batteryImageList == null)
InitbatteryImageList();
if (isCharge)
{
image = batteryImageList.Images[ChargeBattery];
}
else
{
if (curBattery < min)
image = batteryImageList.Images[LowBattery];
else if (curBattery < max)
image = batteryImageList.Images[CommonBattery];
else
image = batteryImageList.Images[FullBattery];
}
return new object[] { string.Format("{0}%",curBattery), image };
}
/// <summary>
/// 设置小车状态
/// </summary>
/// <param name="curState"></param>
public static object[] SetAGVState(string curState)
{
Image image;
if (stateImageList == null)
InitStateImageList();
if(stateImageList.Images.ContainsKey(curState))
image = stateImageList.Images[curState];
else
image = stateImageList.Images[UNKNOWN];
return new object[] { curState, image };
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("AGVStatus")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AGVStatus")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("c6d2fc09-46f7-4ec5-a877-15ea06342e4f")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace AGV_UI.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AGV_UI.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Aborted {
get {
object obj = ResourceManager.GetObject("Aborted", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap charge {
get {
object obj = ResourceManager.GetObject("charge", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap common {
get {
object obj = ResourceManager.GetObject("common", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap emergency {
get {
object obj = ResourceManager.GetObject("emergency", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Error {
get {
object obj = ResourceManager.GetObject("Error", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Executing {
get {
object obj = ResourceManager.GetObject("Executing", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap full {
get {
object obj = ResourceManager.GetObject("full", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap low {
get {
object obj = ResourceManager.GetObject("low", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap manual {
get {
object obj = ResourceManager.GetObject("manual", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap offline {
get {
object obj = ResourceManager.GetObject("offline", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap online {
get {
object obj = ResourceManager.GetObject("online", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap pause {
get {
object obj = ResourceManager.GetObject("pause", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap ready {
get {
object obj = ResourceManager.GetObject("ready", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap task {
get {
object obj = ResourceManager.GetObject("task", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Unknown {
get {
object obj = ResourceManager.GetObject("Unknown", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: 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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<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:sequence>
<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="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="offline" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\offline.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="task" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\task.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="online" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\online.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Aborted" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\state\Aborted.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="emergency" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\state\emergency.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Error" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\state\Error.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Executing" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\state\Executing.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="manual" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\state\manual.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pause" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\state\pause.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ready" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\state\ready.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Unknown" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\state\Unknown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="charge" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\battery\charge.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="common" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\battery\common.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="full" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\battery\full.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="low" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\battery\low.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
\ No newline at end of file \ No newline at end of file
namespace AGV_UI
{
partial class Status
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Status));
this.panelTitle = new System.Windows.Forms.Panel();
this.lblBattery = new System.Windows.Forms.Label();
this.picBxConn = new System.Windows.Forms.PictureBox();
this.lblName = new System.Windows.Forms.Label();
this.panelAGVState = new System.Windows.Forms.Panel();
this.lblAGVState = new System.Windows.Forms.Label();
this.lblTask = new System.Windows.Forms.Label();
this.flowPanelMissionState = new System.Windows.Forms.FlowLayoutPanel();
this.panelTitle.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picBxConn)).BeginInit();
this.panelAGVState.SuspendLayout();
this.SuspendLayout();
//
// panelTitle
//
this.panelTitle.BackColor = System.Drawing.Color.LightBlue;
this.panelTitle.Controls.Add(this.lblBattery);
this.panelTitle.Controls.Add(this.picBxConn);
this.panelTitle.Controls.Add(this.lblName);
this.panelTitle.Dock = System.Windows.Forms.DockStyle.Top;
this.panelTitle.Location = new System.Drawing.Point(0, 0);
this.panelTitle.Name = "panelTitle";
this.panelTitle.Size = new System.Drawing.Size(287, 47);
this.panelTitle.TabIndex = 0;
//
// lblBattery
//
this.lblBattery.Dock = System.Windows.Forms.DockStyle.Right;
this.lblBattery.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblBattery.ForeColor = System.Drawing.Color.Black;
this.lblBattery.Image = ((System.Drawing.Image)(resources.GetObject("lblBattery.Image")));
this.lblBattery.Location = new System.Drawing.Point(249, 0);
this.lblBattery.Name = "lblBattery";
this.lblBattery.Size = new System.Drawing.Size(38, 47);
this.lblBattery.TabIndex = 2;
this.lblBattery.Text = "0%";
this.lblBattery.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// picBxConn
//
this.picBxConn.Dock = System.Windows.Forms.DockStyle.Left;
this.picBxConn.Image = global::AGV_UI.Properties.Resources.offline;
this.picBxConn.Location = new System.Drawing.Point(0, 0);
this.picBxConn.Name = "picBxConn";
this.picBxConn.Size = new System.Drawing.Size(51, 47);
this.picBxConn.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.picBxConn.TabIndex = 1;
this.picBxConn.TabStop = false;
//
// lblName
//
this.lblName.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblName.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblName.ForeColor = System.Drawing.Color.Black;
this.lblName.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblName.Location = new System.Drawing.Point(0, 0);
this.lblName.Name = "lblName";
this.lblName.Size = new System.Drawing.Size(287, 47);
this.lblName.TabIndex = 0;
this.lblName.Text = "#号车";
this.lblName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// panelAGVState
//
this.panelAGVState.Controls.Add(this.lblAGVState);
this.panelAGVState.Controls.Add(this.lblTask);
this.panelAGVState.Dock = System.Windows.Forms.DockStyle.Top;
this.panelAGVState.Location = new System.Drawing.Point(0, 47);
this.panelAGVState.Name = "panelAGVState";
this.panelAGVState.Size = new System.Drawing.Size(287, 50);
this.panelAGVState.TabIndex = 1;
//
// lblAGVState
//
this.lblAGVState.Dock = System.Windows.Forms.DockStyle.Right;
this.lblAGVState.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblAGVState.Image = global::AGV_UI.Properties.Resources.Unknown;
this.lblAGVState.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblAGVState.Location = new System.Drawing.Point(160, 0);
this.lblAGVState.Name = "lblAGVState";
this.lblAGVState.Size = new System.Drawing.Size(127, 50);
this.lblAGVState.TabIndex = 1;
this.lblAGVState.Text = "None";
this.lblAGVState.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblTask
//
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.Image = global::AGV_UI.Properties.Resources.task;
this.lblTask.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblTask.Location = new System.Drawing.Point(0, 0);
this.lblTask.Name = "lblTask";
this.lblTask.Size = new System.Drawing.Size(216, 50);
this.lblTask.TabIndex = 0;
this.lblTask.Text = "无任务";
this.lblTask.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// flowPanelMissionState
//
this.flowPanelMissionState.BackColor = System.Drawing.Color.LightBlue;
this.flowPanelMissionState.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowPanelMissionState.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowPanelMissionState.Location = new System.Drawing.Point(0, 97);
this.flowPanelMissionState.Name = "flowPanelMissionState";
this.flowPanelMissionState.Size = new System.Drawing.Size(287, 230);
this.flowPanelMissionState.TabIndex = 2;
//
// Status
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.flowPanelMissionState);
this.Controls.Add(this.panelAGVState);
this.Controls.Add(this.panelTitle);
this.Name = "Status";
this.Size = new System.Drawing.Size(287, 327);
this.panelTitle.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.picBxConn)).EndInit();
this.panelAGVState.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panelTitle;
private System.Windows.Forms.Label lblName;
private System.Windows.Forms.PictureBox picBxConn;
private System.Windows.Forms.Label lblBattery;
private System.Windows.Forms.Panel panelAGVState;
private System.Windows.Forms.Label lblTask;
private System.Windows.Forms.Label lblAGVState;
private System.Windows.Forms.FlowLayoutPanel flowPanelMissionState;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AGV_UI
{
public partial class Status : UserControl
{
public Status(string name, List<string> infos)
{
InitializeComponent();
AGVName = name;
missionShow = new Dictionary<string, Control>();
if (infos != null && infos.Count > 0)
{
foreach (var item in infos)
{
missionShow.Add(item, new Label() { Name = item,
Font = new Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))),
AutoSize = true
});
}
flowPanelMissionState.Controls.AddRange(missionShow.Values.ToArray());
}
}
public Status()
{
}
public void Init()
{
foreach (string item in missionShow.Keys)
{
ShowInfo(item, item);
}
SetTitle();
}
public int MaxBattery { get; set; } = 90;
public int MinBattery { get; set; } = 20;
public string AGVName { get; private set; }
#region 私有字段
private Dictionary<string, Control> missionShow;
#endregion
void SetTitle()
{
this.Invoke(new Action(() =>
{
lblName.Text = AGVName;
}
));
}
/// <summary>
/// 设置电量
/// </summary>
/// <param name="curBattery"></param>
/// <param name="isInCharge"></param>
public void SetBattery(int curBattery, bool isInCharge = false)
{
object[] objs = Manager.SetBattery(curBattery, isInCharge, MinBattery, MaxBattery);
try
{
this.Invoke(new Action(() =>
{
lblBattery.Text = objs[0] as string;
lblBattery.Image = objs[1] as Image;
}
));
}
catch { }
}
/// <summary>
/// 设置连接状态
/// </summary>
/// <param name="state"></param>
public void SetConnectState(bool state = false)
{
Image image = Manager.SetConnState(state);
this.Invoke(new Action(() =>
{
picBxConn.Image = image;
}
));
}
public void ShowInfo(string key, string info)
{
this.Invoke(new Action(() =>
{
if (missionShow.ContainsKey(key))
missionShow[key].Text = string.Format("{0}:{1}",key, info);
}
));
}
/// <summary>
/// 设置当前任务名称
/// </summary>
/// <param name="taskName"></param>
public void SetCurTask(string taskName)
{
this.Invoke(new Action(() =>
{
lblTask.Text = taskName;
}
));
}
/// <summary>
/// 设置agv当前状态
/// </summary>
/// <param name="curState"></param>
public void SetCurState(string curState)
{
object[] objs = Manager.SetAGVState(curState);
this.Invoke(new Action(() =>
{
lblAGVState.Text = objs[0] as string;
lblAGVState.Image = objs[1] as Image;
}
));
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: 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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<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:sequence>
<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="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="lblBattery.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAAOZJREFUaEPt
ziEOw1AQxNBcrCT3v1NKDA0CxmrBtzRspbfX6XTadd/382ac/1/2rI3z32QPLQfTZehyMF2GLgfTZehy
MF2GLgfTZehyMF2GLgfTZehyMF2GLgfTZehyMF2GLgfTZehyMF2GLgfTZehyMF2GLgfTZehyMF2GLgfT
ZehyMF2GLgfTZehyMF2GLgfTZehyMF2GLgfTZehyMF2GLgfTZehyMF2GLgfTZehyMF2GLgfTZehyMF2G
LgfTZehyMF2GLgfT9XyupxxMl6HLwXQZuhxMl6HLwXQZuhzM6XR61XV9AQQ5qN/xmUs6AAAAAElFTkSu
QmCC
</value>
</data>
</root>
\ No newline at end of file \ No newline at end of file
此文件类型无法预览
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BAFEAFE6-04E2-48EE-8845-BFC7EA3E3C21}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Common</RootNamespace>
<AssemblyName>Common</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>.\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath>.\RestSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="helpers\AppConfigHelper.cs" />
<Compile Include="helpers\IniFileHelper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SettingString.cs" />
<Compile Include="util\HttpHelper.cs" />
<Compile Include="util\JsonHelper.cs" />
<Compile Include="util\LogUtil.cs" />
<Compile Include="util\MyWebClient.cs">
<SubType>Component</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file \ No newline at end of file
此文件类型无法预览
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Common")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Common")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("bafeafe6-04e2-48ee-8845-bfc7ea3e3c21")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
此文件类型无法预览
此文件的差异太大,无法显示。
...@@ -5,14 +5,16 @@ using System.Text; ...@@ -5,14 +5,16 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace AGVControl namespace Common
{ {
public static class SettingString public static class SettingString
{ {
public const int AGVCNT = 4; public const int AGVCNT = 4;
//任务类型
public const string Move = "Move"; public const string Move = "Move";
public const string Dock = "Dock"; public const string Dock = "Dock";
//任务名称 //任务名称
public const string Init = "Init";
public const string Standby = "Standby"; public const string Standby = "Standby";
public const string CheckShelf = "CheckShelf"; public const string CheckShelf = "CheckShelf";
public const string DoorDToC = "DoorDToC"; public const string DoorDToC = "DoorDToC";
...@@ -109,5 +111,6 @@ namespace AGVControl ...@@ -109,5 +111,6 @@ namespace AGVControl
public const string D4 = "D4"; public const string D4 = "D4";
public const string LimitPoints = "LimitPoints"; public const string LimitPoints = "LimitPoints";
public const string LocalIP = "LocalIP";
} }
} }
using System; using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml; using System.Xml;
namespace AGVControl namespace Common
{ {
public class IniHelper
{
[DllImport("kernel32")]
//section:要读取的段落名
//key: 要读取的键点击打开链接点击打开链接
//defVal: 读取异常的情况下的缺省值
//retVal: key所对应的值,如果该key不存在则返回空值
//size: 值允许的大小
//filePath: INI文件的完整路径和文件名
private static extern int GetPrivateProfileString(string section, string key, string defVal, StringBuilder retVal, int size, string filePath);
[DllImport("kernel32")]
//section: 要写入的段落名
//key: 要写入的键,如果该key存在则覆盖写入
//val: key所对应的值
//filePath: INI文件的完整路径和文件名
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
/// <summary>
/// 读取INI文件
/// </summary>
/// <param name="section">项目名称(如 [section] )</param>
/// <param name="skey">键</param>
/// <param name="path">路径</param>
public static string ReadValue(string section, string skey, string path)
{
StringBuilder temp = new StringBuilder(500);
GetPrivateProfileString(section, skey, "", temp, 500, path);
return temp.ToString();
}
/// <summary>
/// 写入ini文件
/// </summary>
/// <param name="section">项目名称</param>
/// <param name="key">键</param>
/// <param name="value">值</param>
/// <param name="path">路径</param>
public static void WriteValue(string section, string key, string value, string path)
{
WritePrivateProfileString(section, key, value, path);
}
}
public class AppConfigHelper public class AppConfigHelper
{ {
public static System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); public static System.Configuration.Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.None);
public static string GetValue(string key) public static string GetValue(string key)
{ {
if (config.AppSettings.Settings[key] == null) if (config.AppSettings.Settings[key] == null)
{ {
Common.log.Error("未找到配置:" + key + ",请检查配置是否完整!"); LogUtil.info("未找到配置:" + key + ",请检查配置是否完整!");
return ""; return "";
} }
else else
...@@ -77,7 +27,7 @@ namespace AGVControl ...@@ -77,7 +27,7 @@ namespace AGVControl
//System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); //System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null) if (config.AppSettings.Settings[key] == null)
{ {
Common.log.Error("未找到配置:" + key + ",请检查配置是否完整!"); LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!");
return a; return a;
} }
else else
...@@ -94,7 +44,7 @@ namespace AGVControl ...@@ -94,7 +44,7 @@ namespace AGVControl
//System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); //System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null) if (config.AppSettings.Settings[key] == null)
{ {
Common.log.Error("未找到配置:" + key + ",请检查配置是否完整!"); LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!");
return a; return a;
} }
else else
...@@ -107,11 +57,11 @@ namespace AGVControl ...@@ -107,11 +57,11 @@ namespace AGVControl
} }
public static bool GetBoolValue(string key) public static bool GetBoolValue(string key)
{ {
bool a=false; bool a = false;
//System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); //System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings[key] == null) if (config.AppSettings.Settings[key] == null)
{ {
Common.log.Error("未找到配置:" + key + ",请检查配置是否完整!"); LogUtil.error("未找到配置:" + key + ",请检查配置是否完整!");
return a; return a;
} }
else else
...@@ -151,7 +101,7 @@ namespace AGVControl ...@@ -151,7 +101,7 @@ namespace AGVControl
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.log.Error("SaveValue保存配置出错:AppKey=" + key + ",AppValue=" + value + "," + ex.StackTrace); LogUtil.error("SaveValue保存配置出错:AppKey=" + key + ",AppValue=" + value + "," + ex.StackTrace);
} }
} }
...@@ -173,7 +123,7 @@ namespace AGVControl ...@@ -173,7 +123,7 @@ namespace AGVControl
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.log.Error("UpdateConfig保存配置出错:name=" + name + ",Xvalue=" + Xvalue + "," + ex.StackTrace); LogUtil.error("UpdateConfig保存配置出错:name=" + name + ",Xvalue=" + Xvalue + "," + ex.StackTrace);
} }
} }
///<summary> ///<summary>
...@@ -205,11 +155,11 @@ namespace AGVControl ...@@ -205,11 +155,11 @@ namespace AGVControl
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.log.Error("SetValue保存配置出错:AppKey=" + AppKey + ",AppValue=" + AppValue + "," + ex.StackTrace); LogUtil.error("SetValue保存配置出错:AppKey=" + AppKey + ",AppValue=" + AppValue + "," + ex.StackTrace);
} }
} }
}
}
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Common
{
public class IniFileHelper
{
[System.Runtime.InteropServices.DllImport("kernel32")]
//section:要读取的段落名
//key: 要读取的键点击打开链接点击打开链接
//defVal: 读取异常的情况下的缺省值
//retVal: key所对应的值,如果该key不存在则返回空值
//size: 值允许的大小
//filePath: INI文件的完整路径和文件名
private static extern int GetPrivateProfileString(string section, string key, string defVal, StringBuilder retVal, int size, string filePath);
[System.Runtime.InteropServices.DllImport("kernel32")]
//section: 要写入的段落名
//key: 要写入的键,如果该key存在则覆盖写入
//val: key所对应的值
//filePath: INI文件的完整路径和文件名
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
/// <summary>
/// 读取INI文件
/// </summary>
/// <param name="section">项目名称(如 [section] )</param>
/// <param name="skey">键</param>
/// <param name="path">路径</param>
public static string ReadValue(string section, string skey, string path)
{
StringBuilder temp = new StringBuilder(500);
GetPrivateProfileString(section, skey, "", temp, 500, path);
return temp.ToString();
}
/// <summary>
/// 写入ini文件
/// </summary>
/// <param name="section">项目名称</param>
/// <param name="key">键</param>
/// <param name="value">值</param>
/// <param name="path">路径</param>
public static void WriteValue(string section, string key, string value, string path)
{
WritePrivateProfileString(section, key, value, path);
}
}
}
此文件类型无法预览
...@@ -12,10 +12,8 @@ using System.Security.Cryptography; ...@@ -12,10 +12,8 @@ using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Reflection; using System.Reflection;
using System.Net.NetworkInformation; using System.Net.NetworkInformation;
using MiR;
using AGVControl;
namespace AGVControl namespace Common
{ {
public class HttpHelper public class HttpHelper
{ {
...@@ -140,11 +138,11 @@ namespace AGVControl ...@@ -140,11 +138,11 @@ namespace AGVControl
wc.Encoding = encoding; wc.Encoding = encoding;
result = wc.UploadString(url, "POST", paramData); result = wc.UploadString(url, "POST", paramData);
//Common.LogInfo(result); //LogUtil.info(result);
} }
catch (Exception e) catch (Exception e)
{ {
Common.log.Error("POST ERROR:" + e.ToString()); LogUtil.error("POST ERROR:" + e.ToString());
} }
if (!result.Contains("null") && result.Length != 0) if (!result.Contains("null") && result.Length != 0)
{ {
...@@ -166,19 +164,19 @@ namespace AGVControl ...@@ -166,19 +164,19 @@ namespace AGVControl
{ {
try try
{ {
Common.log.Debug("HTTP GET FROM: " + url); LogUtil.debug("HTTP GET FROM: " + url);
var wc = new WebClient { Encoding = encoding }; var wc = new WebClient { Encoding = encoding };
var readStream = wc.OpenRead(url); var readStream = wc.OpenRead(url);
using (var sr = new StreamReader(readStream, encoding)) using (var sr = new StreamReader(readStream, encoding))
{ {
var result = sr.ReadToEnd(); var result = sr.ReadToEnd();
Common.log.Debug("receive << " + result); LogUtil.debug("receive << " + result);
return result; return result;
} }
} }
catch (Exception e) catch (Exception e)
{ {
Common.log.Error("HTTP GET ERROR:" + e.Message); LogUtil.error("HTTP GET ERROR:" + e.Message);
} }
return ""; return "";
} }
......
using AGVControl; using Newtonsoft.Json;
using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
namespace AGVControl namespace Common
{ {
/// <summary> /// <summary>
/// Json帮助类 /// Json帮助类
...@@ -74,14 +73,14 @@ namespace AGVControl ...@@ -74,14 +73,14 @@ namespace AGVControl
{ {
try try
{ {
string path = Common.CONFIG_PATH + fileName + ".json"; string path = fileName + ".json";
string output = JsonConvert.SerializeObject(ts,Formatting.Indented); string output = JsonConvert.SerializeObject(ts,Formatting.Indented);
File.WriteAllText(path, output); File.WriteAllText(path, output);
} }
catch (Exception e) catch (Exception e)
{ {
Common.log.Error(e.Message + "/r/n" + e.StackTrace); LogUtil.error(e.Message + "/r/n" + e.StackTrace);
} }
} }
/// <summary> /// <summary>
...@@ -94,7 +93,7 @@ namespace AGVControl ...@@ -94,7 +93,7 @@ namespace AGVControl
{ {
try try
{ {
string path = Common.CONFIG_PATH + fileName + ".json"; string path =fileName + ".json";
StreamReader streamReader = new StreamReader(path); StreamReader streamReader = new StreamReader(path);
string jsonStr = streamReader.ReadToEnd(); string jsonStr = streamReader.ReadToEnd();
List<T> jsonObj = DeserializeJsonToList<T>(jsonStr); List<T> jsonObj = DeserializeJsonToList<T>(jsonStr);
...@@ -103,7 +102,7 @@ namespace AGVControl ...@@ -103,7 +102,7 @@ namespace AGVControl
} }
catch (Exception e) catch (Exception e)
{ {
Common.log.Error(e.Message + "/r/n" + e.StackTrace); LogUtil.error(e.Message + "/r/n" + e.StackTrace);
return null; return null;
} }
} }
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;
using System.Reflection;
using System.Drawing;
namespace Common
{
public class LogUtil
{
public static readonly ILog AIOLog = LogManager.GetLogger("AGV_3D_SMD");
private static LogUtil instance = new LogUtil();
public delegate void ShowLog(string msg,Color color);
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static Dictionary<int, DateTime> lastErrorLogTime = new Dictionary<int, DateTime>();
public static System.Windows.Forms.RichTextBox logBox = null;
public static int showCount = 20;
public static bool debug_opened = false;
public static void info(ILog log, string msg)
{
if (log == null)
{
return;
}
log.Info(msg);
AddToBox(msg, Color.Black);
//clear();
}
public static void info(ILog log, string msg, Color color)
{
log.Info(msg);
AddToBox(msg, color);
}
public static void debug(ILog log, string msg, Color color)
{
log.Debug(msg);
if (debug_opened)
{
AddToBox(msg, color);
}
}
public static void debug(ILog log, string msg)
{
log.Debug(msg);
if (debug_opened)
{
AddToBox(msg, Color.Gray);
}
}
public static void error(string errorMsg, int type)
{
if (lastErrorLogTime.ContainsKey(type))
{
TimeSpan span = DateTime.Now - lastErrorLogTime[type];
if (span.TotalSeconds > 10)
{
lastErrorLogTime.Remove(type);
lastErrorLogTime.Add(type, DateTime.Now);
error(LOGGER, errorMsg);
}
}
else
{
lastErrorLogTime.Add(type, DateTime.Now);
error(LOGGER, errorMsg);
}
}
public static void error(ILog log, string errorMsg, Exception ex = null)
{
if (errorMsg.Trim().Equals(""))
{
return;
}
if (ex == null)
{
log.Error(errorMsg);
}
else
{
log.Error(errorMsg, ex);
}
AddToBox(errorMsg, Color.Red);
}
private static void AddToBox(string msg, Color color)
{
try
{
ShowLogPro(msg, color);
}
catch (Exception ex)
{
LOGGER.Error("出错:", ex);
}
}
private static List<string> logList = new List<string>();
public static string LastText = "";
private static void ShowLogPro(string msg, Color color)
{
try
{
if (logList.Count > 0)
{
// logList.RemoveAt(0);
}
if (logList.Count >= showCount)
{
logList.RemoveAt(0);
}
string text = "";
foreach (string str in logList)
{
text += str;
}
System.DateTime now = System.DateTime.Now;
logList.Add(now.ToLongTimeString() + " " + msg + Environment.NewLine);
if (logBox == null)
{
return;
}
LastText = text;
if (logBox.Visible)
{
logBox.Text = text;
// logBox.Focus(); //使文本框获取焦点
logBox.AppendText(now.ToLongTimeString() + " " + msg + Environment.NewLine); //增加文本
TimeSpan span = DateTime.Now - lastTime;
if (span.TotalSeconds > 3000000)
{
lastTime = DateTime.Now;
logBox.Select(logBox.Text.Length, 0); //设置光标的位置到文本尾
logBox.ScrollToCaret(); //滚动到控件光标处
}
}
}
catch (Exception ex)
{
LOGGER.Error("出错:" + ex.ToString());
}
}
private static DateTime lastTime = DateTime.Now;
public static void UpdateLogbox()
{
if (logBox != null && logBox.Visible)
{
logBox.Text = LastText;
TimeSpan span = DateTime.Now - lastTime;
if (span.TotalSeconds > 3000000)
{
lastTime = DateTime.Now;
logBox.Select(logBox.Text.Length, 0); //设置光标的位置到文本尾
logBox.ScrollToCaret(); //滚动到控件光标处
}
}
}
public static void ClearLog()
{
if (logBox != null)
{
LastText = "";
logList.Clear();
logBox.Text = "";
}
}
public static void debug(string msg)
{
debug(LOGGER, msg);
}
public static void error(string errorMsg, Exception ex = null)
{
error(LOGGER, errorMsg, ex);
}
public static void info(string msg)
{
info(LOGGER, msg);
}
}
}
...@@ -4,7 +4,7 @@ using System.Linq; ...@@ -4,7 +4,7 @@ using System.Linq;
using System.Net; using System.Net;
using System.Text; using System.Text;
namespace MiR namespace Common
{ {
public class MyWebClient:WebClient public class MyWebClient:WebClient
{ {
......
using System; using Common;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using AGVControl;
namespace AGVControl namespace DeviceLibrary
{ {
public class AGVManager public class AGVManager
{ {
private static log4net.ILog log = log4net.LogManager.GetLogger("AGVManager");
/// <summary> /// <summary>
/// 小车从B区域离开前检查出库任务是否完成 /// 小车从B区域离开前检查出库任务是否完成
/// </summary> /// </summary>
...@@ -20,26 +20,26 @@ namespace AGVControl ...@@ -20,26 +20,26 @@ namespace AGVControl
taskCount = 0; taskCount = 0;
try try
{ {
//Common.log.Info("URL:" + Common.webService["URL"]); //CommonVar.log.Info("URL:" + CommonVar.webService["URL"]);
string url = AppConfigHelper.GetValue(SettingString.http_server) + "rest/api/qisda/device/shelfTaskCount?rfid=" + agv.RFID; string url = AppConfigHelper.GetValue(SettingString.http_server) + "rest/api/qisda/device/shelfTaskCount?rfid=" + agv.RFID;
var client = new RestSharp.RestClient(url) { Timeout = -1 }; var client = new RestSharp.RestClient(url) { Timeout = -1 };
var request = new RestSharp.RestRequest(RestSharp.Method.GET); var request = new RestSharp.RestRequest(RestSharp.Method.GET);
RestSharp.IRestResponse response = client.Execute(request); RestSharp.IRestResponse response = client.Execute(request);
string json = response.Content; string json = response.Content;
Common.log.Info(agv.Name + " [URL: " + url+"] [Return: " + json+"]"); log.Debug(agv.Name + " [URL: " + url+"] [Return: " + json+"]");
if (string.IsNullOrWhiteSpace(json)) return true; //可以离开 if (string.IsNullOrWhiteSpace(json)) return true; //可以离开
//{"code":0,"msg":"ok","data":{"taskCount":1,"rfid":"A14"}}不能搬运锁定的料架,到待机位等待 //{"code":0,"msg":"ok","data":{"taskCount":1,"rfid":"A14"}}不能搬运锁定的料架,到待机位等待
ShelfTaskCount serverResult = JsonHelper.DeserializeJsonToObject<ShelfTaskCount>(json); ShelfTaskCount serverResult = JsonHelper.DeserializeJsonToObject<ShelfTaskCount>(json);
if (serverResult == null) if (serverResult == null)
{ {
Common.log.Error(" 没有收到服务器反馈"); log.Error(" 没有收到服务器反馈");
return true; return true;
} }
if (serverResult.code != 0) return true; if (serverResult.code != 0) return true;
agv.LeftTaskCnt = serverResult.data.taskCount; agv.LeftTaskCnt = serverResult.data.taskCount;
if (serverResult.data.taskCount == 0) //该料架出库完成 if (serverResult.data.taskCount == 0) //该料架出库完成
{ {
Common.log.Info(agv.Name+" 料架【" + agv.RFID + "】 无剩余出库任务,serverResult.shelfTaskData.taskCount=" + serverResult.data.taskCount.ToString()); log.Info(agv.Name+" 料架【" + agv.RFID + "】 无剩余出库任务,serverResult.shelfTaskData.taskCount=" + serverResult.data.taskCount.ToString());
return true; return true;
} }
else //该料架的出库任务未完成 else //该料架的出库任务未完成
...@@ -47,14 +47,14 @@ namespace AGVControl ...@@ -47,14 +47,14 @@ namespace AGVControl
// foreach (ShelfLockData item in serverResult.data) // foreach (ShelfLockData item in serverResult.data)
// { // {
taskCount = serverResult.data.taskCount; taskCount = serverResult.data.taskCount;
Common.log.Info(agv.Name + " [RFID=" + serverResult.data.rfid + "] [taskCount=" + serverResult.data.taskCount + "]"); log.Info(agv.Name + " [RFID=" + serverResult.data.rfid + "] [taskCount=" + serverResult.data.taskCount + "]");
// } // }
return false; return false;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.log.Error(ex); log.Error(ex);
return true; return true;
} }
...@@ -75,20 +75,20 @@ namespace AGVControl ...@@ -75,20 +75,20 @@ namespace AGVControl
string resultStr = HttpHelper.Post(server, ""); string resultStr = HttpHelper.Post(server, "");
Common.log.Info("节点【"+name+ "】 料架锁定状态 " + " 【" + server + "】【" + resultStr + "】"); log.Info("节点【"+name+ "】 料架锁定状态 " + " 【" + server + "】【" + resultStr + "】");
ShelfLockInfo serverResult = JsonHelper.DeserializeJsonToObject<ShelfLockInfo>(resultStr); ShelfLockInfo serverResult = JsonHelper.DeserializeJsonToObject<ShelfLockInfo>(resultStr);
if (serverResult == null) if (serverResult == null)
{ {
msg = "节点【" + name + "】没有收到服务器反馈"; msg = "节点【" + name + "】没有收到服务器反馈";
Common.log.Error(msg); log.Error(msg);
return false; return false;
} }
if (serverResult.data.Count == 0) //该料架未锁定 if (serverResult.data.Count == 0) //该料架未锁定
{ {
msg = "节点【" + name + "】 料架【" + rfid + "】 没有锁定库位的料"; msg = "节点【" + name + "】 料架【" + rfid + "】 没有锁定库位的料";
Common.log.Info(msg); log.Info(msg);
return false; return false;
} }
else //该料架存在锁定库位的料 else //该料架存在锁定库位的料
...@@ -96,7 +96,7 @@ namespace AGVControl ...@@ -96,7 +96,7 @@ namespace AGVControl
string nodes=""; string nodes="";
foreach (ShelfLockData item in serverResult.data) foreach (ShelfLockData item in serverResult.data)
{ {
Common.GetNodeNameByAliceName(item.cid,out string nodeName); CommonVar.GetNodeNameByAliceName(item.cid,out string nodeName);
int resInt = shelfLockNodeNames.FindIndex(s=>s !=null && s.Equals(nodeName)); int resInt = shelfLockNodeNames.FindIndex(s=>s !=null && s.Equals(nodeName));
if(resInt==-1) if(resInt==-1)
{ {
...@@ -104,13 +104,13 @@ namespace AGVControl ...@@ -104,13 +104,13 @@ namespace AGVControl
nodes+="锁定的CID=" + item.cid + ",节点名称=" + nodeName+";"; nodes+="锁定的CID=" + item.cid + ",节点名称=" + nodeName+";";
} }
} }
Common.log.Info("节点【" + name + "】获取" + rfid+"料仓锁定信息完成:"+nodes); log.Info("节点【" + name + "】获取" + rfid+"料仓锁定信息完成:"+nodes);
return true; return true;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.log.Error(ex.Message); log.Error(ex.Message);
} }
return false; return false;
} }
...@@ -131,7 +131,7 @@ namespace AGVControl ...@@ -131,7 +131,7 @@ namespace AGVControl
string server = GetAddr(Addr_updateDeviceAlarmMsg, paramMap); string server = GetAddr(Addr_updateDeviceAlarmMsg, paramMap);
DateTime startTime = DateTime.Now; DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, ""); string resultStr = HttpHelper.Post(server, "");
Common.log.Debug("updateDeviceAlarmMsg " + " 【" + server + "】【" + resultStr + "】"); log.Debug("updateDeviceAlarmMsg " + " 【" + server + "】【" + resultStr + "】");
RfidData data = JsonHelper.DeserializeJsonToObject<RfidData>(resultStr); RfidData data = JsonHelper.DeserializeJsonToObject<RfidData>(resultStr);
...@@ -147,7 +147,7 @@ namespace AGVControl ...@@ -147,7 +147,7 @@ namespace AGVControl
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.log.Error(ex); log.Error(ex);
} }
return msg; return msg;
} }
......
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Net; using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Reflection; using Common;
using System.Threading; using System.Threading;
using AGVControl;
namespace AGVControl.BLL namespace DeviceLibrary
{ {
public class AgvServer public class AgvServer
{ {
...@@ -89,7 +88,7 @@ namespace AGVControl.BLL ...@@ -89,7 +88,7 @@ namespace AGVControl.BLL
idx = FindClient(nodeName); idx = FindClient(nodeName);
if (idx == -1) if (idx == -1)
{ {
Common.log.Error("Arrive: 没有找到" + nodeName); LogUtil.error("Arrive: 没有找到" + nodeName);
Thread.Sleep(500); Thread.Sleep(500);
n++; n++;
} }
...@@ -120,7 +119,7 @@ namespace AGVControl.BLL ...@@ -120,7 +119,7 @@ namespace AGVControl.BLL
idx = FindClient(nodeName); idx = FindClient(nodeName);
if (idx == -1) if (idx == -1)
{ {
Common.log.Error("Ready: 没有找到" + nodeName); LogUtil.error("Ready: 没有找到" + nodeName);
Thread.Sleep(500); Thread.Sleep(500);
n++; n++;
} }
...@@ -151,7 +150,7 @@ namespace AGVControl.BLL ...@@ -151,7 +150,7 @@ namespace AGVControl.BLL
idx = FindClient(nodeName); idx = FindClient(nodeName);
if (idx == -1) if (idx == -1)
{ {
Common.log.Error("CloseDoor: 没有找到" + nodeName); LogUtil.debug("CloseDoor: 没有找到" + nodeName);
Thread.Sleep(500); Thread.Sleep(500);
n++; n++;
} }
...@@ -219,7 +218,7 @@ namespace AGVControl.BLL ...@@ -219,7 +218,7 @@ namespace AGVControl.BLL
IPEndPoint ep = (IPEndPoint)socket.RemoteEndPoint; IPEndPoint ep = (IPEndPoint)socket.RemoteEndPoint;
Thread listen = new Thread(new ParameterizedThreadStart(ListenNet)); Thread listen = new Thread(new ParameterizedThreadStart(ListenNet));
string ip = ep.Address.ToString(); string ip = ep.Address.ToString();
if (ip == System.Configuration.ConfigurationManager.AppSettings["LocalIP"]) if (ip == Common.AppConfigHelper.GetValue(Common.SettingString.LocalIP))
ip += ":" + ep.Port; ip += ":" + ep.Port;
//新的客户端 //新的客户端
...@@ -290,7 +289,7 @@ namespace AGVControl.BLL ...@@ -290,7 +289,7 @@ namespace AGVControl.BLL
} }
else else
{ {
//Common.log.Info("Receive[" + client.IP + "] " + node.ToText()); //CommonVar.log.Info("Receive[" + client.IP + "] " + node.ToText());
int idx = client.nodeName.FindIndex(s => s == node.Name); int idx = client.nodeName.FindIndex(s => s == node.Name);
if (idx == -1) client.nodeName.Add(node.Name); if (idx == -1) client.nodeName.Add(node.Name);
UpdateNode(node); UpdateNode(node);
...@@ -386,21 +385,21 @@ namespace AGVControl.BLL ...@@ -386,21 +385,21 @@ namespace AGVControl.BLL
private void UpdateNode(ClientNode node) private void UpdateNode(ClientNode node)
{ {
int idx = Common.nodeInfo.FindIndex(s => s.Name == node.Name); int idx = CommonVar.nodeInfo.FindIndex(s => s.Name == node.Name);
if (idx == -1) if (idx == -1)
{ {
log.Error(node.Name + " 不存在"); log.Error(node.Name + " 不存在");
return; return;
} }
if (!Common.nodeInfo[idx].Online) if (!CommonVar.nodeInfo[idx].Online)
{ {
Common.nodeInfo[idx].Online = true; CommonVar.nodeInfo[idx].Online = true;
NodeOnline?.Invoke(idx); NodeOnline?.Invoke(idx);
NodeChanged?.Invoke(idx); NodeChanged?.Invoke(idx);
} }
if (Common.nodeInfo[idx].CheckNodeStateChanged(node)) if (CommonVar.nodeInfo[idx].CheckNodeStateChanged(node))
{ {
log.Info( "节点状态更新 " + node.StatetText()); log.Info( "节点状态更新 " + node.StatetText());
NodeChanged?.Invoke(idx); NodeChanged?.Invoke(idx);
...@@ -415,9 +414,9 @@ namespace AGVControl.BLL ...@@ -415,9 +414,9 @@ namespace AGVControl.BLL
for (int i = 0; i < client.nodeName.Count; i++) for (int i = 0; i < client.nodeName.Count; i++)
{ {
int idx = AGVControl.Common.nodeInfo.FindIndex(s => s.Name == client.nodeName[i]); int idx = CommonVar.nodeInfo.FindIndex(s => s.Name == client.nodeName[i]);
if (idx == -1) continue; if (idx == -1) continue;
AGVControl.Common.nodeInfo[idx].Offline(); CommonVar.nodeInfo[idx].Offline();
NodeChanged(idx); NodeChanged(idx);
NodeOnline(idx); NodeOnline(idx);
} }
......
using System; using Common;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace AGVControl.BLL namespace DeviceLibrary
{ {
public class Charge public class Charge
{ {
...@@ -132,17 +133,26 @@ namespace AGVControl.BLL ...@@ -132,17 +133,26 @@ namespace AGVControl.BLL
} }
public bool HasEmptyChargeStation() public bool HasEmptyChargeStation(Agv_Info agv)
{ {
lock(loc) lock(loc)
{ {
foreach (string item in Station.Keys) if (SettingString.SingleMission_IP1.Equals(agv.IP))
return true;
else
{ {
if (Station[item].Equals("")) if (Station[AutoCharge2].Equals(""))
{ {
return true; return true;
} }
} }
//foreach (string item in Station.Keys)
//{
// if (Station[item].Equals(""))
// {
// return true;
// }
//}
} }
return false; return false;
} }
...@@ -162,20 +172,20 @@ namespace AGVControl.BLL ...@@ -162,20 +172,20 @@ namespace AGVControl.BLL
{ {
if (Station[chargeStation].Equals("")) if (Station[chargeStation].Equals(""))
{ {
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[chargeStation]); rtn = MiR_API.Add_Mission_Fleet(agv, CommonVar.agvMission[chargeStation]);
if (rtn) if (rtn)
{ {
Station[chargeStation] = agv.Name; Station[chargeStation] = agv.Name;
agv.Place = SettingString.AutoCharge; agv.Place = SettingString.AutoCharge;
log = string.Format("{0} {1}", agv.Name, chargeStation); log = string.Format("{0} {1}", agv.Name, chargeStation);
Common.LogInfo(log); LogUtil.info(log);
Common.mir.State_Ready(agv); MiR_API.State_Ready(agv);
} }
else else
{ {
Station[chargeStation] = ""; Station[chargeStation] = "";
log = string.Format("{0} {1}失败", agv.Name, chargeStation); log = string.Format("{0} {1}失败", agv.Name, chargeStation);
Common.LogInfo(log); LogUtil.info(log);
} }
return true; return true;
} }
......
using AGVControl.BLL; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using System.Web.UI.WebControls;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
namespace AGVControl namespace DeviceLibrary
{ {
/// <summary> /// <summary>
/// 公共参数 /// 公共参数
/// </summary> /// </summary>
public static class Common public static class CommonVar
{ {
/// <summary> /// <summary>
/// 节点信息 /// 节点信息
...@@ -33,27 +26,23 @@ namespace AGVControl ...@@ -33,27 +26,23 @@ namespace AGVControl
/// </summary> /// </summary>
public static List<Agv_Info> agvInfo; public static List<Agv_Info> agvInfo;
public static System.Windows.Forms.TextBox logTextBox; public static AgvServer server;
public static BLL.AgvServer server;
public static MiR.API mir;
public static log4net.ILog log;
public static Dictionary<string, string> agvMission; public static Dictionary<string, string> agvMission;
public static Dictionary<string, string> showNameMissionName; public static Dictionary<string, string> showNameMissionName;
public static BLL.Control control; public static Control control;
private static List<string> msg = new List<string>(); private static List<string> msg = new List<string>();
private static string preLog = "";
public static readonly string CONFIG_PATH = AppDomain.CurrentDomain.BaseDirectory + "Config\\"; public static readonly string CONFIG_PATH = AppDomain.CurrentDomain.BaseDirectory + "Config\\";
public static Charge Charge; public static Charge Charge;
public static Standby Standby; public static Standby Standby;
public static string ReadIni(string section, string key) public static string ReadIni(string section, string key)
{ {
return IniHelper.ReadValue(section, key, CONFIG_PATH + SettingString.FileName_tempData); return IniFileHelper.ReadValue(section, key, CONFIG_PATH + SettingString.FileName_tempData);
} }
public static void WriteIni(string section, string key, string value) public static void WriteIni(string section, string key, string value)
{ {
IniHelper.WriteValue(section, key, value, CONFIG_PATH + SettingString.FileName_tempData); IniFileHelper.WriteValue(section, key, value, CONFIG_PATH + SettingString.FileName_tempData);
} }
public static bool GetNodeNameByAliceName(string aliceName, out string nodeName) public static bool GetNodeNameByAliceName(string aliceName, out string nodeName)
{ {
...@@ -91,7 +80,7 @@ namespace AGVControl ...@@ -91,7 +80,7 @@ namespace AGVControl
/// <returns></returns> /// <returns></returns>
public static int FindNode(string nodeName) public static int FindNode(string nodeName)
{ {
int idx = Common.nodeInfo.FindIndex(s => s.Name.Equals(nodeName) && s.IsUse); int idx = nodeInfo.FindIndex(s => s.Name.Equals(nodeName) && s.IsUse);
return idx; return idx;
} }
...@@ -108,21 +97,21 @@ namespace AGVControl ...@@ -108,21 +97,21 @@ namespace AGVControl
agv.Place = ""; agv.Place = "";
//执行下一个任务 //执行下一个任务
int i = FindNode(nodeName); int i = FindNode(nodeName);
bool rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[SettingString.Move + nodeName]); bool rtn = MiR_API.Add_Mission_Fleet(agv, agvMission[SettingString.Move + nodeName]);
if (rtn) if (rtn)
{ {
agv.Place = nodeName; agv.Place = nodeName;
if (i > -1) if (i > -1)
log = string.Format("{0} {1} To Node {2} {3}", agv.Name, SettingString.Move, nodeName, Common.nodeInfo[i].GetState().ToString()); log = string.Format("{0} {1} To Node {2} {3}", agv.Name, SettingString.Move, nodeName,nodeInfo[i].GetState().ToString());
else else
log = string.Format("{0} {1} To Node {2}", agv.Name, SettingString.Move, nodeName); log = string.Format("{0} {1} To Node {2}", agv.Name, SettingString.Move, nodeName);
Common.LogInfo(log); LogUtil.info(log);
Common.mir.State_Ready(agv); MiR_API.State_Ready(agv);
} }
else else
{ {
log = string.Format("{0} {1} To Node {2} 失败", agv.Name, SettingString.Move, nodeName); log = string.Format("{0} {1} To Node {2} 失败", agv.Name, SettingString.Move, nodeName);
Common.LogInfo(log); LogUtil.info(log);
} }
return rtn; return rtn;
...@@ -141,18 +130,18 @@ namespace AGVControl ...@@ -141,18 +130,18 @@ namespace AGVControl
agv.Place = ""; agv.Place = "";
//执行下一个任务 //执行下一个任务
bool rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[SettingString.Dock + nodeName]); bool rtn = MiR_API.Add_Mission_Fleet(agv, agvMission[SettingString.Dock + nodeName]);
if (rtn) if (rtn)
{ {
agv.Place = nodeName; agv.Place = nodeName;
log = string.Format("{0} {1} To Node {2}", agv.Name, SettingString.Dock, nodeName); log = string.Format("{0} {1} To Node {2}", agv.Name, SettingString.Dock, nodeName);
Common.LogInfo(log); LogUtil.info(log);
Common.mir.State_Ready(agv); MiR_API.State_Ready(agv);
} }
else else
{ {
log = string.Format("{0} {1} To Node {2} 失败", agv.Name, SettingString.Dock, nodeName); log = string.Format("{0} {1} To Node {2} 失败", agv.Name, SettingString.Dock, nodeName);
Common.LogInfo(log); LogUtil.info(log);
} }
return rtn; return rtn;
...@@ -162,7 +151,7 @@ namespace AGVControl ...@@ -162,7 +151,7 @@ namespace AGVControl
public static bool DoorMission(Agv_Info agv, string doorName) public static bool DoorMission(Agv_Info agv, string doorName)
{ {
agv.Place = doorName; agv.Place = doorName;
return Common.mir.Add_Mission_Fleet(agv, Common.agvMission[SettingString.Move + doorName]); return MiR_API.Add_Mission_Fleet(agv, agvMission[SettingString.Move + doorName]);
} }
/// <summary> /// <summary>
...@@ -173,8 +162,8 @@ namespace AGVControl ...@@ -173,8 +162,8 @@ namespace AGVControl
/// <returns></returns> /// <returns></returns>
public static bool CheckTaskMoveFinished(Agv_Info agv, string nodeName, string curTaskState) public static bool CheckTaskMoveFinished(Agv_Info agv, string nodeName, string curTaskState)
{ {
log.Debug(agv.Name + " 检查当前任务是否结束: " + SettingString.Move + nodeName + " " + curTaskState); LogUtil.debug(agv.Name + " 检查当前任务是否结束: " + SettingString.Move + nodeName + " " + curTaskState);
return Common.agvMission[SettingString.Move + nodeName].Equals(agv.CurTaskGUID) && curTaskState.Equals(SettingString.Done); return agvMission[SettingString.Move + nodeName].Equals(agv.CurTaskGUID) && curTaskState.Equals(SettingString.Done);
} }
/// <summary> /// <summary>
/// 检查当前停靠任务是否结束 /// 检查当前停靠任务是否结束
...@@ -184,8 +173,8 @@ namespace AGVControl ...@@ -184,8 +173,8 @@ namespace AGVControl
/// <returns></returns> /// <returns></returns>
public static bool CheckTaskDockFinished(Agv_Info agv, string nodeName, string curTaskState) public static bool CheckTaskDockFinished(Agv_Info agv, string nodeName, string curTaskState)
{ {
log.Debug(agv.Name + " 检查当前任务是否结束: " + SettingString.Dock + nodeName + " " + curTaskState); LogUtil.debug(agv.Name + " 检查当前任务是否结束: " + SettingString.Dock + nodeName + " " + curTaskState);
return Common.agvMission[SettingString.Dock + nodeName].Equals(agv.CurTaskGUID) && curTaskState.Equals(SettingString.Done); return agvMission[SettingString.Dock + nodeName].Equals(agv.CurTaskGUID) && curTaskState.Equals(SettingString.Done);
} }
/// <summary> /// <summary>
/// 检查充电任务是否分配完成 /// 检查充电任务是否分配完成
...@@ -199,8 +188,8 @@ namespace AGVControl ...@@ -199,8 +188,8 @@ namespace AGVControl
public static bool CheckEnterOrLeaveFinished(Agv_Info agv, string actionName, string curTaskState) public static bool CheckEnterOrLeaveFinished(Agv_Info agv, string actionName, string curTaskState)
{ {
log.Debug(agv.Name + " 检查进出料是否结束: " + actionName + " " + curTaskState); LogUtil.debug(agv.Name + " 检查进出料是否结束: " + actionName + " " + curTaskState);
return Common.agvMission[actionName].Equals(agv.CurTaskGUID) && curTaskState.Equals(SettingString.Done); return agvMission[actionName].Equals(agv.CurTaskGUID) && curTaskState.Equals(SettingString.Done);
} }
...@@ -213,7 +202,7 @@ namespace AGVControl ...@@ -213,7 +202,7 @@ namespace AGVControl
{ {
if (agv.Battery <= threshold) if (agv.Battery <= threshold)
{ {
Common.log.Debug(agv.Name + " 电量小于20%,不执行任务,等待充电"); LogUtil.debug(agv.Name + " 电量小于20%,不执行任务,等待充电");
return false; return false;
} }
...@@ -233,37 +222,6 @@ namespace AGVControl ...@@ -233,37 +222,6 @@ namespace AGVControl
return false; return false;
} }
public static void LogInfo(string text, bool isShow = true)
{
if (logTextBox == null) return;
if (logTextBox.InvokeRequired)
{
logTextBox.Invoke(new Action(() => LogInfo(text, isShow)));
return;
}
if (preLog.Equals(text))//连续重复的日志只打印一次
return;
preLog = text;
if (msg.Count > 255)
{
msg.RemoveRange(0, 10);
}
log.Info(text);
string tmpStr = "";
if (isShow)
{
msg.Add(string.Format("[{0}] {1}\r\n", DateTime.Now.ToString("HH:mm:ss"), text));
msg.ForEach(s => tmpStr += s);
logTextBox.Text = tmpStr;
//logTextBox.AppendText(string.Format("[{0}] {1}\r\n", DateTime.Now.ToString("HH:mm:ss"), text));
//logTextBox.ScrollToCaret();
}
}
/// <summary> /// <summary>
/// 获取Job任务状态 /// 获取Job任务状态
/// </summary> /// </summary>
...@@ -271,14 +229,14 @@ namespace AGVControl ...@@ -271,14 +229,14 @@ namespace AGVControl
/// <returns></returns> /// <returns></returns>
public static string GetTakJobState(int CurTaskID) public static string GetTakJobState(int CurTaskID)
{ {
if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string st)) if (!CurTaskID.Equals(-1) && MiR_API.Get_Task_State(CurTaskID, out string st))
return st; return st;
return SettingString.Wait; return SettingString.Wait;
} }
} }
public static class API public static class Window_API
{ {
[DllImport("user32.dll", EntryPoint = "ShowWindow", CharSet = CharSet.Auto)] [DllImport("user32.dll", EntryPoint = "ShowWindow", CharSet = CharSet.Auto)]
public static extern int ShowWindow(IntPtr hwnd, int nCmdShow); public static extern int ShowWindow(IntPtr hwnd, int nCmdShow);
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing.Text;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web.Script.Serialization; using System.Web.Script.Serialization;
using AGVControl; using Common;
using AGVControl.bean.jobType;
using AGVControl_SMD_BOX.BLL;
using log4net.Util; using log4net.Util;
using MiR;
using RestSharp; using RestSharp;
namespace AGVControl.BLL namespace DeviceLibrary
{ {
public class Control public class Control
{ {
...@@ -51,14 +48,14 @@ namespace AGVControl.BLL ...@@ -51,14 +48,14 @@ namespace AGVControl.BLL
AgvStateTimer.Elapsed += AgvStateTimer_Elapsed; AgvStateTimer.Elapsed += AgvStateTimer_Elapsed;
string[] limitPoints = AppConfigHelper.GetValue(SettingString.LimitPoints).Split(';'); string[] limitPoints = AppConfigHelper.GetValue(SettingString.LimitPoints).Split(';');
List<Agv_Info.clsPosition> clsPositions = new List<Agv_Info.clsPosition>(); List<Agv_Info.AgvPosition> clsPositions = new List<Agv_Info.AgvPosition>();
string[] s1; string[] s1;
for (int i = 0; i < limitPoints.Length; i++) for (int i = 0; i < limitPoints.Length; i++)
{ {
s1 = limitPoints[i].Split(','); s1 = limitPoints[i].Split(',');
clsPositions.Add(new Agv_Info.clsPosition(double.Parse(s1[0]), double.Parse(s1[1]))); clsPositions.Add(new Agv_Info.AgvPosition(double.Parse(s1[0]), double.Parse(s1[1])));
} }
limitArea = new AGVControl_SMD_BOX.BLL.ScopeLimit(clsPositions); limitArea = new ScopeLimit(clsPositions);
} }
...@@ -86,21 +83,21 @@ namespace AGVControl.BLL ...@@ -86,21 +83,21 @@ namespace AGVControl.BLL
if (AgvStateInProcess) return; if (AgvStateInProcess) return;
AgvStateInProcess = true; AgvStateInProcess = true;
for (int i = 0; i < Common.agvInfo.Count; i++) for (int i = 0; i < CommonVar.agvInfo.Count; i++)
{ {
try try
{ {
// if (!CheckOnline(i)) continue; // if (!CheckOnline(i)) continue;
CheckOnline(i); CheckOnline(i);
bool change = false; bool change = false;
Common.mir.Get_Task_State(Common.agvInfo[i].CurTaskID, out string stateStr); MiR_API.Get_Task_State(CommonVar.agvInfo[i].CurTaskID, out string stateStr);
Thread.Sleep(50); Thread.Sleep(50);
//获取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 = MiR_API.Get_State(CommonVar.agvInfo[i], out eAGVState stateID, out string stateText, out int battery, out string mission_text, out Agv_Info.AgvPosition position);
Thread.Sleep(50); Thread.Sleep(50);
rtn = Common.mir.Get_IO_Status(Common.agvInfo[i], out bool[] input, out bool[] output); rtn = MiR_API.Get_IO_Status(CommonVar.agvInfo[i], out bool[] input, out bool[] output);
Thread.Sleep(50); Thread.Sleep(50);
change = Common.agvInfo[i].SetState(stateID, stateStr, battery, mission_text, position); change = CommonVar.agvInfo[i].SetState(stateID, stateStr, battery, mission_text, position);
//更新状态stateID.Equals(eAGVState.Executing) //更新状态stateID.Equals(eAGVState.Executing)
if (change) if (change)
...@@ -111,7 +108,7 @@ namespace AGVControl.BLL ...@@ -111,7 +108,7 @@ namespace AGVControl.BLL
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.log.Error("AgvStateTimer_" + Common.agvInfo[i].Name + ex.Message + ex.StackTrace); LogUtil.error("AgvStateTimer_" + CommonVar.agvInfo[i].Name + ex.Message + ex.StackTrace);
} }
} }
...@@ -130,7 +127,7 @@ namespace AGVControl.BLL ...@@ -130,7 +127,7 @@ namespace AGVControl.BLL
{ {
lock(lockGetObj) lock(lockGetObj)
{ {
foreach (JobType find in Common.jobTypeInfo) foreach (JobType find in CommonVar.jobTypeInfo)
{ {
Job job = null; Job job = null;
...@@ -140,7 +137,7 @@ namespace AGVControl.BLL ...@@ -140,7 +137,7 @@ namespace AGVControl.BLL
if (job != null) if (job != null)
{ {
Common.log.Debug(agv_Info.Name + " GetJob OK " + job.ToString()); LogUtil.debug(agv_Info.Name + " GetJob OK " + job.ToString());
return job; return job;
} }
} }
...@@ -155,19 +152,19 @@ namespace AGVControl.BLL ...@@ -155,19 +152,19 @@ namespace AGVControl.BLL
{ {
if (AgvCallInProcess) return; if (AgvCallInProcess) return;
AgvCallInProcess = true; AgvCallInProcess = true;
for (int i = 0; i < Common.agvInfo.Count; i++) for (int i = 0; i < CommonVar.agvInfo.Count; i++)
{ {
try try
{ {
Agv_Info agv = Common.agvInfo[i]; Agv_Info agv = CommonVar.agvInfo[i];
if (!agv.IsCon) continue; //AGV网络连接 if (!agv.IsCon) continue; //AGV网络连接
if (!Common.agvInfo[i].IsUse) continue; //AGV是否可用 if (!CommonVar.agvInfo[i].IsUse) continue; //AGV是否可用
//Ready,Pause,Executing,Error //Ready,Pause,Executing,Error
if (!Common.agvInfo[i].StateID.Equals(eAGVState.Ready) && !Common.agvInfo[i].StateID.Equals(eAGVState.Pause) if (!CommonVar.agvInfo[i].StateID.Equals(eAGVState.Ready) && !CommonVar.agvInfo[i].StateID.Equals(eAGVState.Pause)
&& !Common.agvInfo[i].StateID.Equals(eAGVState.Executing) && !Common.agvInfo[i].StateID.Equals(eAGVState.Error)) && !CommonVar.agvInfo[i].StateID.Equals(eAGVState.Executing) && !CommonVar.agvInfo[i].StateID.Equals(eAGVState.Error))
{ {
Common.log.Error(Common.agvInfo[i].Name + " 不可调用 StateID=" + Common.agvInfo[i].StateID.ToString()); LogUtil.debug(CommonVar.agvInfo[i].Name + " 不可调用 StateID=" + CommonVar.agvInfo[i].StateID.ToString());
continue; continue;
} }
...@@ -187,7 +184,7 @@ namespace AGVControl.BLL ...@@ -187,7 +184,7 @@ namespace AGVControl.BLL
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.log.Error("AgvCall " + ex.Message + ex.StackTrace); LogUtil.error("AgvCall " + ex.Message + ex.StackTrace);
} }
} }
...@@ -198,33 +195,33 @@ namespace AGVControl.BLL ...@@ -198,33 +195,33 @@ namespace AGVControl.BLL
private bool CheckOnline(int idx) private bool CheckOnline(int idx)
{ {
bool rtn = Common.mir.CheckIP(Common.agvInfo[idx].IP); bool rtn = MiR_API.CheckIP(CommonVar.agvInfo[idx].IP);
if (rtn) if (rtn)
{ {
if (Common.agvInfo[idx].IsCon) if (CommonVar.agvInfo[idx].IsCon)
{ {
Common.log.Debug(Common.agvInfo[idx].Name + " Online"); LogUtil.debug(CommonVar.agvInfo[idx].Name + " Online");
} }
else else
{ {
Common.agvInfo[idx].IsCon = true; CommonVar.agvInfo[idx].IsCon = true;
Common.LogInfo(Common.agvInfo[idx].Name + " Online"); LogUtil.info(CommonVar.agvInfo[idx].Name + " Online");
AgvOnline?.Invoke(idx); AgvOnline?.Invoke(idx);
AgvChanged?.Invoke(idx); AgvChanged?.Invoke(idx);
} }
} }
else else
{ {
if (Common.agvInfo[idx].IsCon) if (CommonVar.agvInfo[idx].IsCon)
{ {
Common.agvInfo[idx].IsCon = false; CommonVar.agvInfo[idx].IsCon = false;
Common.LogInfo(Common.agvInfo[idx].Name + " Offline"); LogUtil.info(CommonVar.agvInfo[idx].Name + " Offline");
AgvOnline?.Invoke(idx); AgvOnline?.Invoke(idx);
AgvChanged?.Invoke(idx); AgvChanged?.Invoke(idx);
} }
else else
{ {
Common.log.Debug(Common.agvInfo[idx].Name + " Offline"); LogUtil.info(CommonVar.agvInfo[idx].Name + " Offline");
} }
} }
return rtn; return rtn;
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F9619F07-15F1-4E59-A383-3871952BBB79}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DeviceLibrary</RootNamespace>
<AssemblyName>DeviceLibrary</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>.\log4net.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath>.\RestSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AGVManager.cs" />
<Compile Include="AgvServer.cs" />
<Compile Include="bean\Agv_Info.cs" />
<Compile Include="bean\Job.cs" />
<Compile Include="bean\JobStep.cs" />
<Compile Include="bean\JobType.cs" />
<Compile Include="bean\jobType\ChargeJobType.cs" />
<Compile Include="bean\jobType\PackingJobType.cs" />
<Compile Include="bean\jobType\ReelStringJobType.cs" />
<Compile Include="bean\jobType\ReturnJobType.cs" />
<Compile Include="bean\job\ChargeJob.cs" />
<Compile Include="bean\job\EnterLeaveShelfJob.cs" />
<Compile Include="bean\job\GetShelfJob.cs" />
<Compile Include="bean\job\PackingJob_GetShelf.cs" />
<Compile Include="bean\job\PackingJob_SendShelf.cs" />
<Compile Include="bean\job\PackingJob_TransferShelf.cs" />
<Compile Include="bean\job\RecycleEmptyShelf.cs" />
<Compile Include="bean\job\SendShelfJob.cs" />
<Compile Include="bean\job\StandyJob.cs" />
<Compile Include="bean\node\ClientNode.cs" />
<Compile Include="bean\node\Node.cs" />
<Compile Include="Charge.cs" />
<Compile Include="CommonVar.cs" />
<Compile Include="Control.cs" />
<Compile Include="DisplayBoard.cs" />
<Compile Include="bean\MiR_API.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ScopeLimit.cs" />
<Compile Include="Standby.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AGV_UI\AGV_UI.csproj">
<Project>{c6d2fc09-46f7-4ec5-a877-15ea06342e4f}</Project>
<Name>AGV_UI</Name>
</ProjectReference>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{bafeafe6-04e2-48ee-8845-bfc7ea3e3c21}</Project>
<Name>Common</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,7 @@ using System.Linq; ...@@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace AGVControl.bean namespace DeviceLibrary
{ {
public class DisplayBoard public class DisplayBoard
{ {
......
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("DeviceLibrary")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DeviceLibrary")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("f9619f07-15f1-4e59-a383-3871952bbb79")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
此文件类型无法预览
...@@ -4,15 +4,14 @@ using System.Linq; ...@@ -4,15 +4,14 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Threading; using System.Threading;
using AGVControl;
namespace AGVControl_SMD_BOX.BLL namespace DeviceLibrary
{ {
public class ScopeLimit public class ScopeLimit
{ {
List<string> agvIPs; List<string> agvIPs;
//不规则图像坐标 //不规则图像坐标
List<Agv_Info.clsPosition> positions; List<Agv_Info.AgvPosition> positions;
Thread threadPoll;//监控线程 Thread threadPoll;//监控线程
/// <summary> /// <summary>
/// 区域是否可用 /// 区域是否可用
...@@ -20,7 +19,7 @@ namespace AGVControl_SMD_BOX.BLL ...@@ -20,7 +19,7 @@ namespace AGVControl_SMD_BOX.BLL
public bool Available { get; private set; } = true; public bool Available { get; private set; } = true;
public delegate void ScopeLimitStateChangedEventHandler(string ip, bool state); public delegate void ScopeLimitStateChangedEventHandler(string ip, bool state);
public event ScopeLimitStateChangedEventHandler ScopeLimitStateChangedEvent; public event ScopeLimitStateChangedEventHandler ScopeLimitStateChangedEvent;
public ScopeLimit(List<Agv_Info.clsPosition> positions) public ScopeLimit(List<Agv_Info.AgvPosition> positions)
{ {
agvIPs = new List<string>(); agvIPs = new List<string>();
agvIPs.AddRange(new string[] agvIPs.AddRange(new string[]
...@@ -51,7 +50,7 @@ namespace AGVControl_SMD_BOX.BLL ...@@ -51,7 +50,7 @@ namespace AGVControl_SMD_BOX.BLL
foreach (string ip in agvIPs) foreach (string ip in agvIPs)
{ {
Thread.Sleep(1000); Thread.Sleep(1000);
rtn = Common.mir.Get_Position(ip, Common.agvInfo[0].Authorization, out Agv_Info.clsPosition position); rtn = MiR_API.Get_Position(ip, CommonVar.agvInfo[0].Authorization, out Agv_Info.AgvPosition position);
if (rtn) if (rtn)
{ {
if (IsInPolygon(position, positions)) if (IsInPolygon(position, positions))
...@@ -85,11 +84,11 @@ namespace AGVControl_SMD_BOX.BLL ...@@ -85,11 +84,11 @@ namespace AGVControl_SMD_BOX.BLL
/// <param name="checkPoint">要判断的点</param> /// <param name="checkPoint">要判断的点</param>
/// <param name="polygonPoints">多边形的顶点</param> /// <param name="polygonPoints">多边形的顶点</param>
/// <returns></returns> /// <returns></returns>
bool IsInPolygon(Agv_Info.clsPosition checkPoint, List<Agv_Info.clsPosition> polygonPoints) bool IsInPolygon(Agv_Info.AgvPosition checkPoint, List<Agv_Info.AgvPosition> polygonPoints)
{ {
bool inside = false; bool inside = false;
int pointCount = polygonPoints.Count; int pointCount = polygonPoints.Count;
Agv_Info.clsPosition p1, p2; Agv_Info.AgvPosition p1, p2;
for (int i = 0, j = pointCount - 1; i < pointCount; j = i, i++)//第一个点和最后一个点作为第一条线,之后是第一个点和第二个点作为第二条线,之后是第二个点与第三个点,第三个点与第四个点... for (int i = 0, j = pointCount - 1; i < pointCount; j = i, i++)//第一个点和最后一个点作为第一条线,之后是第一个点和第二个点作为第二条线,之后是第二个点与第三个点,第三个点与第四个点...
{ {
p1 = polygonPoints[i]; p1 = polygonPoints[i];
......
...@@ -4,7 +4,7 @@ using System.Linq; ...@@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace AGVControl.BLL namespace DeviceLibrary
{ {
public class Standby public class Standby
{ {
......
using AGVControl; using Common;
using System; namespace DeviceLibrary
using System.Collections.Generic;
namespace AGVControl
{ {
public abstract class Job public abstract class Job
{ {
...@@ -41,7 +38,7 @@ namespace AGVControl ...@@ -41,7 +38,7 @@ namespace AGVControl
CurTaskID = curTaskId; CurTaskID = curTaskId;
CurTaskName = curTaskName; CurTaskName = curTaskName;
//CurTaskState = SettingString.Wait; //CurTaskState = SettingString.Wait;
CurTaskState = Common.GetTakJobState(CurTaskID); CurTaskState = CommonVar.GetTakJobState(CurTaskID);
} }
/// <summary> /// <summary>
/// 任务重发 /// 任务重发
...@@ -50,11 +47,11 @@ namespace AGVControl ...@@ -50,11 +47,11 @@ namespace AGVControl
public bool ResendTask(Agv_Info agv) public bool ResendTask(Agv_Info agv)
{ {
bool rtn = false; bool rtn = false;
if (!CurTaskID.Equals(-1) && Common.mir.Get_Task_State(CurTaskID, out string stateStr)) if (!CurTaskID.Equals(-1) && MiR_API.Get_Task_State(CurTaskID, out string stateStr))
{ {
if (stateStr.Equals(SettingString.Aborted) || stateStr.Equals(SettingString.Invalid)) if (stateStr.Equals(SettingString.Aborted) || stateStr.Equals(SettingString.Invalid))
{ {
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[CurTaskName]); rtn = MiR_API.Add_Mission_Fleet(agv, CommonVar.agvMission[CurTaskName]);
if (rtn) if (rtn)
{ {
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
...@@ -63,9 +60,9 @@ namespace AGVControl ...@@ -63,9 +60,9 @@ namespace AGVControl
} }
} }
else if (!CurTaskName.Equals("") && !Common.agvMission[CurTaskName].Equals(agv.CurTaskGUID))//Job的当前任务与agv最新任务不一致 else if (!CurTaskName.Equals("") && !CommonVar.agvMission[CurTaskName].Equals(agv.CurTaskGUID))//Job的当前任务与agv最新任务不一致
{ {
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[CurTaskName]); rtn = MiR_API.Add_Mission_Fleet(agv, CommonVar.agvMission[CurTaskName]);
if (rtn) if (rtn)
{ {
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
...@@ -74,7 +71,7 @@ namespace AGVControl ...@@ -74,7 +71,7 @@ namespace AGVControl
} }
else if (CurTaskID.Equals(-1))//任务发送失败,重新发送 else if (CurTaskID.Equals(-1))//任务发送失败,重新发送
{ {
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[CurTaskName]); rtn = MiR_API.Add_Mission_Fleet(agv, CommonVar.agvMission[CurTaskName]);
if (rtn) if (rtn)
{ {
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
......
using AGVControl; 
using Common;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace AGVControl namespace DeviceLibrary
{ {
public class JobStep<T> where T : Enum public class JobStep<T> where T : Enum
{ {
...@@ -22,7 +23,7 @@ namespace AGVControl ...@@ -22,7 +23,7 @@ namespace AGVControl
//不为空,且与上一个消息不一样才打印 //不为空,且与上一个消息不一样才打印
if (!value.Equals(msg)) if (!value.Equals(msg))
{ {
Common.LogInfo(value); LogUtil.info(value);
} }
} }
msg = value; msg = value;
......
using AGVControl.bean; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace AGVControl namespace DeviceLibrary
{ {
public class JobType public class JobType
{ {
......
 using Common;
using AGVControl;
using System; namespace DeviceLibrary
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.PeerResolvers;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AGVControl
{ {
/// <summary> /// <summary>
/// 充电任务 /// 充电任务
...@@ -51,25 +43,25 @@ namespace AGVControl ...@@ -51,25 +43,25 @@ namespace AGVControl
bool rtn = false; bool rtn = false;
agv.Msg = ""; agv.Msg = "";
CurTaskState = Common.GetTakJobState(CurTaskID); CurTaskState = CommonVar.GetTakJobState(CurTaskID);
if (ChargeStep.IsStep(CHARGE_STEP.NONE)) if (ChargeStep.IsStep(CHARGE_STEP.NONE))
{ {
if (agvPlace.StartsWith(SettingString.C4_Name_Prefix)) if (agvPlace.StartsWith(SettingString.C4_Name_Prefix))
{ {
ChargeStep.ToNextStep(CHARGE_STEP.WAIT_AGV_REACH_4D_DOOR); ChargeStep.ToNextStep(CHARGE_STEP.WAIT_AGV_REACH_4D_DOOR);
runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + Common.Charge.BatteryMax + "%],从当前位置" + agvPlace + "回到充电位,先到4D门"; runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + CommonVar.Charge.BatteryMax + "%],从当前位置" + agvPlace + "回到充电位,先到4D门";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorCToD); CommonVar.DoorMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
{ {
if (!Common.Charge.StartCharge(agv)) if (!CommonVar.Charge.StartCharge(agv))
{ {
runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + Common.Charge.BatteryMax + "%],由于充电桩有小车,从当前位置" + agvPlace + "回到待机位"; runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + CommonVar.Charge.BatteryMax + "%],由于充电桩有小车,从当前位置" + agvPlace + "回到待机位";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
return new StandyJob(agv.Place); return new StandyJob(agv.Place);
...@@ -77,7 +69,7 @@ namespace AGVControl ...@@ -77,7 +69,7 @@ namespace AGVControl
else else
{ {
ChargeStep.ToNextStep(CHARGE_STEP.WAIT_REACH_CHARGE_STATION); ChargeStep.ToNextStep(CHARGE_STEP.WAIT_REACH_CHARGE_STATION);
runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + Common.Charge.BatteryMax + "%],从当前位置" + agvPlace + "去到充电位"; runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + CommonVar.Charge.BatteryMax + "%],从当前位置" + agvPlace + "去到充电位";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
...@@ -87,9 +79,9 @@ namespace AGVControl ...@@ -87,9 +79,9 @@ namespace AGVControl
else if (ChargeStep.IsStep(CHARGE_STEP.WAIT_AGV_REACH_4D_DOOR)) else if (ChargeStep.IsStep(CHARGE_STEP.WAIT_AGV_REACH_4D_DOOR))
{ {
if (Common.CheckTaskMoveFinished(agv, SettingString.DoorCToD, CurTaskState)) if (CommonVar.CheckTaskMoveFinished(agv, SettingString.DoorCToD, CurTaskState))
{ {
if (agv.Battery > Common.Charge.BatteryMax) if (agv.Battery > CommonVar.Charge.BatteryMax)
{ {
runInfo = "电量充足[" + agv.Battery + "%],从当前位置" + agvPlace + "去到待机位"; runInfo = "电量充足[" + agv.Battery + "%],从当前位置" + agvPlace + "去到待机位";
msg += runInfo; msg += runInfo;
...@@ -98,9 +90,9 @@ namespace AGVControl ...@@ -98,9 +90,9 @@ namespace AGVControl
} }
else else
{ {
if (!Common.Charge.StartCharge(agv)) if (!CommonVar.Charge.StartCharge(agv))
{ {
runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + Common.Charge.BatteryMax + "%],充电桩有小车,从当前位置" + agvPlace + "回到待机位"; runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + CommonVar.Charge.BatteryMax + "%],充电桩有小车,从当前位置" + agvPlace + "回到待机位";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
...@@ -109,7 +101,7 @@ namespace AGVControl ...@@ -109,7 +101,7 @@ namespace AGVControl
else else
{ {
ChargeStep.ToNextStep(CHARGE_STEP.WAIT_REACH_CHARGE_STATION); ChargeStep.ToNextStep(CHARGE_STEP.WAIT_REACH_CHARGE_STATION);
runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + Common.Charge.BatteryMax + "%],从当前位置" + agvPlace + "去到充电位"; runInfo = "电量[" + agv.Battery + "%]小于最大电量[" + CommonVar.Charge.BatteryMax + "%],从当前位置" + agvPlace + "去到充电位";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
...@@ -120,7 +112,7 @@ namespace AGVControl ...@@ -120,7 +112,7 @@ namespace AGVControl
} }
else if (ChargeStep.IsStep(CHARGE_STEP.WAIT_REACH_CHARGE_STATION)) else if (ChargeStep.IsStep(CHARGE_STEP.WAIT_REACH_CHARGE_STATION))
{ {
if (Common.CheckTaskFinished(agv, CurTaskName)) if (CommonVar.CheckTaskFinished(agv, CurTaskName))
{ {
ChargeStep.ToNextStep(CHARGE_STEP.WAIT_REACH_CHARGE_OK); ChargeStep.ToNextStep(CHARGE_STEP.WAIT_REACH_CHARGE_OK);
runInfo = "充电任务分配完成,去充电且等待任务"; runInfo = "充电任务分配完成,去充电且等待任务";
...@@ -130,23 +122,23 @@ namespace AGVControl ...@@ -130,23 +122,23 @@ namespace AGVControl
} }
else if (ChargeStep.IsStep(CHARGE_STEP.WAIT_REACH_CHARGE_OK)) else if (ChargeStep.IsStep(CHARGE_STEP.WAIT_REACH_CHARGE_OK))
{ {
if (agv.Battery > Common.Charge.BatteryMax) if (agv.Battery > CommonVar.Charge.BatteryMax)
{ {
runInfo = "充电完成,回待机位"; runInfo = "充电完成,回待机位";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
Common.Charge.DelOccupyInfoByAGV(agv); CommonVar.Charge.DelOccupyInfoByAGV(agv);
return new StandyJob(agv.Place); return new StandyJob(agv.Place);
} }
else if(agv.Battery > Common.Charge.BatteryMin) else if(agv.Battery > CommonVar.Charge.BatteryMin)
{ {
Job job = Common.control.GetJob(agv); Job job = CommonVar.control.GetJob(agv);
if (job != null && !(job is ChargeJob) && !(job is StandyJob)) if (job != null && !(job is ChargeJob) && !(job is StandyJob))
{ {
runInfo = "在充电位检测到任务,电量[" + agv.Battery + " %]大于最小电量[" + Common.Charge.BatteryMin + " %],可执行任务"; runInfo = "在充电位检测到任务,电量[" + agv.Battery + " %]大于最小电量[" + CommonVar.Charge.BatteryMin + " %],可执行任务";
msg += runInfo; msg += runInfo;
ChargeStep.Msg = msg; ChargeStep.Msg = msg;
Common.Charge.DelOccupyInfoByAGV(agv); CommonVar.Charge.DelOccupyInfoByAGV(agv);
return job; return job;
} }
} }
......
 using System.Threading.Tasks;
using AGVControl;
using MiR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
namespace AGVControl namespace DeviceLibrary
{ {
/// <summary> /// <summary>
/// 小车进出料类型 /// 小车进出料类型
...@@ -79,7 +71,7 @@ namespace AGVControl ...@@ -79,7 +71,7 @@ namespace AGVControl
runInfo += "小车链条运行"; runInfo += "小车链条运行";
msg += runInfo; msg += runInfo;
EnterLeaveShelfStep.Msg = msg; EnterLeaveShelfStep.Msg = msg;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Leave"]); rtn = MiR_API.Add_Mission_Fleet(agv, CommonVar.agvMission["Leave"]);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if(ActionType.Equals(eEnterLeaveType.Enter)) else if(ActionType.Equals(eEnterLeaveType.Enter))
...@@ -88,14 +80,14 @@ namespace AGVControl ...@@ -88,14 +80,14 @@ namespace AGVControl
runInfo +="小车链条运行"; runInfo +="小车链条运行";
msg += runInfo; msg += runInfo;
EnterLeaveShelfStep.Msg = msg; EnterLeaveShelfStep.Msg = msg;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission["Enter"]); rtn = MiR_API.Add_Mission_Fleet(agv, CommonVar.agvMission["Enter"]);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
else if (EnterLeaveShelfStep.IsStep(ENTER_LEAVE_SHELF_STEP.WAIT__SHELF_IN_LINE)) else if (EnterLeaveShelfStep.IsStep(ENTER_LEAVE_SHELF_STEP.WAIT__SHELF_IN_LINE))
{ {
CurTaskState = Common.GetTakJobState(CurTaskID); CurTaskState = CommonVar.GetTakJobState(CurTaskID);
if (Common.CheckEnterOrLeaveFinished(agv, "Leave", CurTaskState)) if (CommonVar.CheckEnterOrLeaveFinished(agv, "Leave", CurTaskState))
{ {
//EnterLeaveShelfStep.ToNextStep(ENTER_LEAVE_SHELF_STEP.END); //EnterLeaveShelfStep.ToNextStep(ENTER_LEAVE_SHELF_STEP.END);
...@@ -116,8 +108,8 @@ namespace AGVControl ...@@ -116,8 +108,8 @@ namespace AGVControl
} }
else if (EnterLeaveShelfStep.IsStep(ENTER_LEAVE_SHELF_STEP.WAIT__SHELF_OUT_LINE)) else if (EnterLeaveShelfStep.IsStep(ENTER_LEAVE_SHELF_STEP.WAIT__SHELF_OUT_LINE))
{ {
CurTaskState = Common.GetTakJobState(CurTaskID); CurTaskState = CommonVar.GetTakJobState(CurTaskID);
if (Common.CheckEnterOrLeaveFinished(agv, "Enter", CurTaskState)) if (CommonVar.CheckEnterOrLeaveFinished(agv, "Enter", CurTaskState))
{ {
//EnterLeaveShelfStep.ToNextStep(ENTER_LEAVE_SHELF_STEP.END); //EnterLeaveShelfStep.ToNextStep(ENTER_LEAVE_SHELF_STEP.END);
......
 using Common;
using AGVControl;
using AGVControl.bean.jobType;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.PeerResolvers;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AGVControl namespace DeviceLibrary
{ {
/// <summary> /// <summary>
/// 包装仓任务:将包装料架送往包装仓 /// 包装仓任务:将包装料架送往包装仓
...@@ -62,16 +53,16 @@ namespace AGVControl ...@@ -62,16 +53,16 @@ namespace AGVControl
{ {
get get
{ {
int t1 = Common.nodeInfo.FindIndex(s => s.Name.Equals(agvPlace)); int t1 = CommonVar.nodeInfo.FindIndex(s => s.Name.Equals(agvPlace));
string from = ""; string from = "";
if (t1 > -1) if (t1 > -1)
from = Common.nodeInfo[t1].AliceName; from = CommonVar.nodeInfo[t1].AliceName;
else else
from = agvPlace; from = agvPlace;
int t2 = Common.nodeInfo.FindIndex(s => s.Name.Equals(TargetPlace)); int t2 = CommonVar.nodeInfo.FindIndex(s => s.Name.Equals(TargetPlace));
string to = ""; string to = "";
if (t2 > -1) if (t2 > -1)
to = Common.nodeInfo[t2].AliceName; to = CommonVar.nodeInfo[t2].AliceName;
else else
to = TargetPlace; to = TargetPlace;
return string.Format("送包装料架任务:{0} [RFID={5}][Mark={2}][目的地={1}][任务名称={3}][任务状态={4}]", runInfo, to, mark,CurTaskName,CurTaskState,RFID); return string.Format("送包装料架任务:{0} [RFID={5}][Mark={2}][目的地={1}][任务名称={3}][任务状态={4}]", runInfo, to, mark,CurTaskName,CurTaskState,RFID);
...@@ -90,7 +81,7 @@ namespace AGVControl ...@@ -90,7 +81,7 @@ namespace AGVControl
bool rtn = false; bool rtn = false;
agv.Msg = runInfo; agv.Msg = runInfo;
CurTaskState = Common.GetTakJobState(CurTaskID); CurTaskState = CommonVar.GetTakJobState(CurTaskID);
if (curJobStep.IsStep(EXECUTE_STEP.P1_NONE)) if (curJobStep.IsStep(EXECUTE_STEP.P1_NONE))
{ {
...@@ -98,13 +89,13 @@ namespace AGVControl ...@@ -98,13 +89,13 @@ namespace AGVControl
runInfo = "收到任务,向包装仓" + TargetPlace + "运行"; runInfo = "收到任务,向包装仓" + TargetPlace + "运行";
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
Common.MoveToNode(agv, TargetPlace); CommonVar.MoveToNode(agv, TargetPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if (curJobStep.IsStep(EXECUTE_STEP.P2_WAIT_REACH_PACKING_STATION)) else if (curJobStep.IsStep(EXECUTE_STEP.P2_WAIT_REACH_PACKING_STATION))
{ {
if (Common.CheckTaskMoveFinished(agv, TargetPlace, CurTaskState)) if (CommonVar.CheckTaskMoveFinished(agv, TargetPlace, CurTaskState))
{ {
if (PackingJobType.IsInStoreMark(mark)) if (PackingJobType.IsInStoreMark(mark))
{ {
...@@ -112,7 +103,7 @@ namespace AGVControl ...@@ -112,7 +103,7 @@ namespace AGVControl
runInfo = "到达包装仓" + TargetPlace + ",并发送到达信号"; runInfo = "到达包装仓" + TargetPlace + ",并发送到达信号";
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
Common.server.Arrive(TargetPlace, RFID); CommonVar.server.Arrive(TargetPlace, RFID);
} }
else else
{ {
...@@ -132,7 +123,7 @@ namespace AGVControl ...@@ -132,7 +123,7 @@ namespace AGVControl
runInfo = "到达包装仓" + TargetPlace + ",并发送到达信号"; runInfo = "到达包装仓" + TargetPlace + ",并发送到达信号";
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
Common.server.Arrive(TargetPlace, RFID); CommonVar.server.Arrive(TargetPlace, RFID);
} }
else else
{ {
...@@ -155,7 +146,7 @@ namespace AGVControl ...@@ -155,7 +146,7 @@ namespace AGVControl
} }
else if (curJobStep.IsStep(EXECUTE_STEP.P4_WAIT_PACKING_STATION_RESPONSE)) else if (curJobStep.IsStep(EXECUTE_STEP.P4_WAIT_PACKING_STATION_RESPONSE))
{ {
int i = Common.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_AGV_DOCK_FINISH); curJobStep.ToNextStep(EXECUTE_STEP.P5_WAIT_AGV_DOCK_FINISH);
...@@ -163,7 +154,7 @@ namespace AGVControl ...@@ -163,7 +154,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
Common.DockToNode(agv, TargetPlace); CommonVar.DockToNode(agv, TargetPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if (curJobStep.IsTimeOut(6000, out double timeOutTime)) else if (curJobStep.IsTimeOut(6000, out double timeOutTime))
...@@ -176,24 +167,24 @@ namespace AGVControl ...@@ -176,24 +167,24 @@ namespace AGVControl
} }
else if (curJobStep.IsStep(EXECUTE_STEP.P5_WAIT_AGV_DOCK_FINISH)) else if (curJobStep.IsStep(EXECUTE_STEP.P5_WAIT_AGV_DOCK_FINISH))
{ {
if (Common.CheckTaskDockFinished(agv, TargetPlace, CurTaskState)) if (CommonVar.CheckTaskDockFinished(agv, TargetPlace, CurTaskState))
{ {
Common.server.Ready(TargetPlace); CommonVar.server.Ready(TargetPlace);
curJobStep.ToNextStep(EXECUTE_STEP.P6_WAIT_SHELF_IN_STATION); curJobStep.ToNextStep(EXECUTE_STEP.P6_WAIT_SHELF_IN_STATION);
runInfo = "停靠包装仓完成,链条运行"; runInfo = "停靠包装仓完成,链条运行";
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[SettingString.Leave]); rtn = MiR_API.Add_Mission_Fleet(agv, CommonVar.agvMission[SettingString.Leave]);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
else if (curJobStep.IsStep(EXECUTE_STEP.P6_WAIT_SHELF_IN_STATION)) else if (curJobStep.IsStep(EXECUTE_STEP.P6_WAIT_SHELF_IN_STATION))
{ {
if (Common.CheckEnterOrLeaveFinished(agv, SettingString.Leave, CurTaskState)) if (CommonVar.CheckEnterOrLeaveFinished(agv, SettingString.Leave, CurTaskState))
{ {
Common.server.CloseDoor(TargetPlace); CommonVar.server.CloseDoor(TargetPlace);
//int i = Common.nodeInfo.FindIndex(s => s.Name.Equals(TargetPlace) && s.StateEquals(eNodeStatus.FinishEnter)); //int i = CommonVar.nodeInfo.FindIndex(s => s.Name.Equals(TargetPlace) && s.StateEquals(eNodeStatus.FinishEnter));
//if (i > -1) //if (i > -1)
{ {
curJobStep.ToNextStep(EXECUTE_STEP.P7_END); curJobStep.ToNextStep(EXECUTE_STEP.P7_END);
...@@ -205,7 +196,7 @@ namespace AGVControl ...@@ -205,7 +196,7 @@ namespace AGVControl
} }
else if (curJobStep.IsStep(EXECUTE_STEP.P7_END)) else if (curJobStep.IsStep(EXECUTE_STEP.P7_END))
{ {
//Job job = Common.control.GetJob(agv); //Job job = CommonVar.control.GetJob(agv);
//if (job != null) //if (job != null)
//{ //{
// runInfo = "送料架任务完成,检测到任务,开始执行"; // runInfo = "送料架任务完成,检测到任务,开始执行";
......
 using Common;
using AGVControl;
using AGVControl.bean.jobType;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.PeerResolvers;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AGVControl namespace DeviceLibrary
{ {
/// <summary> /// <summary>
///送料串 ///送料串
...@@ -47,16 +38,16 @@ namespace AGVControl ...@@ -47,16 +38,16 @@ namespace AGVControl
{ {
get get
{ {
int t1 = Common.nodeInfo.FindIndex(s => s.Name.Equals(agvPlace)); int t1 = CommonVar.nodeInfo.FindIndex(s => s.Name.Equals(agvPlace));
string from = ""; string from = "";
if (t1 > -1) if (t1 > -1)
from = Common.nodeInfo[t1].AliceName; from = CommonVar.nodeInfo[t1].AliceName;
else else
from = agvPlace; from = agvPlace;
int t2 = Common.nodeInfo.FindIndex(s => s.Name.Equals(TargetPlace)); int t2 = CommonVar.nodeInfo.FindIndex(s => s.Name.Equals(TargetPlace));
string to = ""; string to = "";
if (t2 > -1) if (t2 > -1)
to = Common.nodeInfo[t2].AliceName; to = CommonVar.nodeInfo[t2].AliceName;
else else
to = TargetPlace; to = TargetPlace;
return string.Format("送料串任务[RFID={4}]:{0} [目的地={1}][任务名称={2}][任务状态={3}]", runInfo, to, CurTaskName, CurTaskState, RFID); return string.Format("送料串任务[RFID={4}]:{0} [目的地={1}][任务名称={2}][任务状态={3}]", runInfo, to, CurTaskName, CurTaskState, RFID);
...@@ -67,16 +58,16 @@ namespace AGVControl ...@@ -67,16 +58,16 @@ namespace AGVControl
private string GetShowInfo() private string GetShowInfo()
{ {
int t1 = Common.nodeInfo.FindIndex(s => s.Name.Equals(agvPlace)); int t1 = CommonVar.nodeInfo.FindIndex(s => s.Name.Equals(agvPlace));
string from = ""; string from = "";
if (t1 > -1) if (t1 > -1)
from = Common.nodeInfo[t1].AliceName; from = CommonVar.nodeInfo[t1].AliceName;
else else
from = agvPlace; from = agvPlace;
int t2 = Common.nodeInfo.FindIndex(s => s.Name.Equals(TargetPlace)); int t2 = CommonVar.nodeInfo.FindIndex(s => s.Name.Equals(TargetPlace));
string to = ""; string to = "";
if (t2 > -1) if (t2 > -1)
to = Common.nodeInfo[t2].AliceName; to = CommonVar.nodeInfo[t2].AliceName;
else else
to = TargetPlace; to = TargetPlace;
return string.Format("取料串任务[RFID={3}]: {0}[{1}->{2}]", runInfo, from, to, RFID); return string.Format("取料串任务[RFID={3}]: {0}[{1}->{2}]", runInfo, from, to, RFID);
...@@ -91,7 +82,7 @@ namespace AGVControl ...@@ -91,7 +82,7 @@ namespace AGVControl
bool rtn = false; bool rtn = false;
agv.Msg = GetShowInfo(); agv.Msg = GetShowInfo();
CurTaskState = Common.GetTakJobState(CurTaskID); CurTaskState = CommonVar.GetTakJobState(CurTaskID);
if (curJobStep.IsStep(EXECUTE_STEP.P1_NONE)) if (curJobStep.IsStep(EXECUTE_STEP.P1_NONE))
{ {
if (!agvPlace.StartsWith(SettingString.C4_Name_Prefix) && TargetPlace.StartsWith(SettingString.C4_Name_Prefix))//D C if (!agvPlace.StartsWith(SettingString.C4_Name_Prefix) && TargetPlace.StartsWith(SettingString.C4_Name_Prefix))//D C
...@@ -100,7 +91,7 @@ namespace AGVControl ...@@ -100,7 +91,7 @@ namespace AGVControl
runInfo = "收到任务,在4D车间,向" + TargetPlace + "运行,先过门"; runInfo = "收到任务,在4D车间,向" + TargetPlace + "运行,先过门";
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorDToC); CommonVar.DoorMission(agv, SettingString.DoorDToC);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if (agvPlace.StartsWith(SettingString.C4_Name_Prefix) && !TargetPlace.StartsWith(SettingString.C4_Name_Prefix))//C D else if (agvPlace.StartsWith(SettingString.C4_Name_Prefix) && !TargetPlace.StartsWith(SettingString.C4_Name_Prefix))//C D
...@@ -109,7 +100,7 @@ namespace AGVControl ...@@ -109,7 +100,7 @@ namespace AGVControl
runInfo = "收到任务,在4C车间,向" + TargetPlace + "运行,先过门"; runInfo = "收到任务,在4C车间,向" + TargetPlace + "运行,先过门";
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorCToD); CommonVar.DoorMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else//DD CC else//DD CC
...@@ -118,51 +109,51 @@ namespace AGVControl ...@@ -118,51 +109,51 @@ namespace AGVControl
runInfo = "收到任务,向" + TargetPlace + "运行"; runInfo = "收到任务,向" + TargetPlace + "运行";
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
Common.MoveToNode(agv, TargetPlace); CommonVar.MoveToNode(agv, TargetPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
else if (curJobStep.IsStep(EXECUTE_STEP.P2_WAIT_REACH_STATION)) else if (curJobStep.IsStep(EXECUTE_STEP.P2_WAIT_REACH_STATION))
{ {
if (Common.CheckTaskMoveFinished(agv, TargetPlace, CurTaskState)) if (CommonVar.CheckTaskMoveFinished(agv, TargetPlace, CurTaskState))
{ {
curJobStep.ToNextStep(EXECUTE_STEP.P4_WAIT_STATION_RESPONSE); curJobStep.ToNextStep(EXECUTE_STEP.P4_WAIT_STATION_RESPONSE);
runInfo = "到达" + TargetPlace + ",并发送进料请求"; runInfo = "到达" + TargetPlace + ",并发送进料请求";
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
Common.server.Ready(TargetPlace, RFID); CommonVar.server.Ready(TargetPlace, RFID);
} }
} }
else if (curJobStep.IsStep(EXECUTE_STEP.P3_WAIT_REACH_4D_DOOR)) else if (curJobStep.IsStep(EXECUTE_STEP.P3_WAIT_REACH_4D_DOOR))
{ {
if (Common.CheckTaskMoveFinished(agv, SettingString.DoorCToD, CurTaskState)) if (CommonVar.CheckTaskMoveFinished(agv, SettingString.DoorCToD, CurTaskState))
{ {
curJobStep.ToNextStep(EXECUTE_STEP.P2_WAIT_REACH_STATION); curJobStep.ToNextStep(EXECUTE_STEP.P2_WAIT_REACH_STATION);
runInfo = "到达4D门,去料架处" + TargetPlace; runInfo = "到达4D门,去料架处" + TargetPlace;
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
Common.MoveToNode(agv, TargetPlace); CommonVar.MoveToNode(agv, TargetPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
else if (curJobStep.IsStep(EXECUTE_STEP.P3_WAIT_REACH_4C_DOOR)) else if (curJobStep.IsStep(EXECUTE_STEP.P3_WAIT_REACH_4C_DOOR))
{ {
if (Common.CheckTaskMoveFinished(agv, SettingString.DoorDToC, CurTaskState)) if (CommonVar.CheckTaskMoveFinished(agv, SettingString.DoorDToC, CurTaskState))
{ {
curJobStep.ToNextStep(EXECUTE_STEP.P2_WAIT_REACH_STATION); curJobStep.ToNextStep(EXECUTE_STEP.P2_WAIT_REACH_STATION);
runInfo = "到达4C门,去料架处" + TargetPlace; runInfo = "到达4C门,去料架处" + TargetPlace;
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
Common.MoveToNode(agv, TargetPlace); CommonVar.MoveToNode(agv, TargetPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
else if (curJobStep.IsStep(EXECUTE_STEP.P4_WAIT_STATION_RESPONSE)) else if (curJobStep.IsStep(EXECUTE_STEP.P4_WAIT_STATION_RESPONSE))
{ {
int i = Common.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);
...@@ -170,7 +161,7 @@ namespace AGVControl ...@@ -170,7 +161,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
rtn = Common.mir.Add_Mission_Fleet(agv, Common.agvMission[SettingString.Leave]); rtn = MiR_API.Add_Mission_Fleet(agv, CommonVar.agvMission[SettingString.Leave]);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else if (curJobStep.IsTimeOut(15000, out double timeOutTime)) else if (curJobStep.IsTimeOut(15000, out double timeOutTime))
...@@ -183,9 +174,9 @@ namespace AGVControl ...@@ -183,9 +174,9 @@ namespace AGVControl
} }
else if (curJobStep.IsStep(EXECUTE_STEP.P5_WAIT_SHELF_IN_STATION)) else if (curJobStep.IsStep(EXECUTE_STEP.P5_WAIT_SHELF_IN_STATION))
{ {
if (Common.CheckEnterOrLeaveFinished(agv, SettingString.Leave, CurTaskState)) if (CommonVar.CheckEnterOrLeaveFinished(agv, SettingString.Leave, CurTaskState))
{ {
Common.server.CloseDoor(TargetPlace); CommonVar.server.CloseDoor(TargetPlace);
if (IsPlace(SettingString.G23_In) && FindReturnShelf(agv)) if (IsPlace(SettingString.G23_In) && FindReturnShelf(agv))
{ {
runInfo = "料架进入" + TargetPlace + "完成,去退料线出口取一个料串回点料机"; runInfo = "料架进入" + TargetPlace + "完成,去退料线出口取一个料串回点料机";
...@@ -197,7 +188,7 @@ namespace AGVControl ...@@ -197,7 +188,7 @@ namespace AGVControl
{ {
if(agv.IP.Equals(SettingString.SingleMission_IP1)) if(agv.IP.Equals(SettingString.SingleMission_IP1))
{ {
if (IsPlace(SettingString.A2) && !Common.control.limitArea.Available) if (IsPlace(SettingString.A2) && !CommonVar.control.limitArea.Available)
{ {
runInfo = "料架进入" + TargetPlace + "完成,等待限制区域无车"; runInfo = "料架进入" + TargetPlace + "完成,等待限制区域无车";
msg += runInfo; msg += runInfo;
...@@ -246,7 +237,7 @@ namespace AGVControl ...@@ -246,7 +237,7 @@ namespace AGVControl
{ {
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.D3)) if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.D3))
{ {
Common.LogInfo(string.Format("{0} 在退料线生成任务(D3需要满料串,G24出满料串):Place={1},rfid={2}", currentAgv.Name, SettingString.D3, rfid)); LogUtil.info(string.Format("{0} 在退料线生成任务(D3需要满料串,G24出满料串):Place={1},rfid={2}", currentAgv.Name, SettingString.D3, rfid));
return true; return true;
} }
} }
...@@ -254,7 +245,7 @@ namespace AGVControl ...@@ -254,7 +245,7 @@ namespace AGVControl
{ {
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.G23_In)) if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.G23_In))
{ {
Common.LogInfo(string.Format("{0} 在退料线生成任务(D4需要满料串,G24出满料串):Place={1},rfid={2}", currentAgv.Name, SettingString.D4, rfid)); LogUtil.info(string.Format("{0} 在退料线生成任务(D4需要满料串,G24出满料串):Place={1},rfid={2}", currentAgv.Name, SettingString.D4, rfid));
return true; return true;
} }
} }
......
 using Common;
using AGVControl;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.PeerResolvers;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AGVControl namespace DeviceLibrary
{ {
/// <summary> /// <summary>
/// 待机任务 /// 待机任务
...@@ -51,7 +43,7 @@ namespace AGVControl ...@@ -51,7 +43,7 @@ namespace AGVControl
bool rtn = false; bool rtn = false;
agv.Msg = ""; agv.Msg = "";
CurTaskState = Common.GetTakJobState(CurTaskID); CurTaskState = CommonVar.GetTakJobState(CurTaskID);
if (curJobStep.IsStep(EXECUTE_STEP.NONE)) if (curJobStep.IsStep(EXECUTE_STEP.NONE))
{ {
if (agvPlace.Equals(SettingString.Standby))//在待机位不操作 if (agvPlace.Equals(SettingString.Standby))//在待机位不操作
...@@ -68,7 +60,7 @@ namespace AGVControl ...@@ -68,7 +60,7 @@ namespace AGVControl
runInfo = "从当前位置" + agvPlace + "回到待机位,先到4D门"; runInfo = "从当前位置" + agvPlace + "回到待机位,先到4D门";
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
Common.DoorMission(agv, SettingString.DoorCToD); CommonVar.DoorMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
else else
...@@ -78,7 +70,7 @@ namespace AGVControl ...@@ -78,7 +70,7 @@ namespace AGVControl
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
Common.MoveToNode(agv, SettingString.Standby); CommonVar.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
...@@ -86,20 +78,20 @@ namespace AGVControl ...@@ -86,20 +78,20 @@ namespace AGVControl
else if (curJobStep.IsStep(EXECUTE_STEP.WAIT_AGV_REACH_4D_DOOR)) else if (curJobStep.IsStep(EXECUTE_STEP.WAIT_AGV_REACH_4D_DOOR))
{ {
if (Common.CheckTaskMoveFinished(agv, SettingString.DoorCToD, CurTaskState)) if (CommonVar.CheckTaskMoveFinished(agv, SettingString.DoorCToD, CurTaskState))
{ {
curJobStep.ToNextStep(EXECUTE_STEP.WAIT_REACH_STANDBY); curJobStep.ToNextStep(EXECUTE_STEP.WAIT_REACH_STANDBY);
runInfo = "从4D门回到待机位"; runInfo = "从4D门回到待机位";
msg += runInfo; msg += runInfo;
curJobStep.Msg = msg; curJobStep.Msg = msg;
Common.MoveToNode(agv, SettingString.Standby); CommonVar.MoveToNode(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID); UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
} }
} }
else if (curJobStep.IsStep(EXECUTE_STEP.WAIT_REACH_STANDBY)) else if (curJobStep.IsStep(EXECUTE_STEP.WAIT_REACH_STANDBY))
{ {
if (Common.CheckTaskMoveFinished(agv, SettingString.Standby, CurTaskState)) if (CommonVar.CheckTaskMoveFinished(agv, SettingString.Standby, CurTaskState))
{ {
curJobStep.ToNextStep(EXECUTE_STEP.END); curJobStep.ToNextStep(EXECUTE_STEP.END);
runInfo = "到达待机位"; runInfo = "到达待机位";
...@@ -109,7 +101,7 @@ namespace AGVControl ...@@ -109,7 +101,7 @@ namespace AGVControl
} }
else if (curJobStep.IsStep(EXECUTE_STEP.END)) else if (curJobStep.IsStep(EXECUTE_STEP.END))
{ {
Job job = Common.control.GetJob(agv); Job job = CommonVar.control.GetJob(agv);
if (job != null && !(job is StandyJob)) if (job != null && !(job is StandyJob))
{ {
runInfo = "在待机位检测到任务,执行任务"; runInfo = "在待机位检测到任务,执行任务";
......
using MiR; 
using log4net.Util; namespace DeviceLibrary
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AGVControl.bean.jobType
{ {
/// <summary> /// <summary>
/// 待机任务 /// 待机任务
...@@ -21,7 +14,7 @@ namespace AGVControl.bean.jobType ...@@ -21,7 +14,7 @@ namespace AGVControl.bean.jobType
/// <returns></returns> /// <returns></returns>
public override Job GetNewJob(Agv_Info currentAgv) public override Job GetNewJob(Agv_Info currentAgv)
{ {
if (currentAgv.Battery < Common.Charge.BatteryMax - 10 && Common.Charge.HasEmptyChargeStation()) if (currentAgv.Battery < CommonVar.Charge.BatteryMax - 10 && CommonVar.Charge.HasEmptyChargeStation(currentAgv))
{ {
return new ChargeJob(currentAgv.Place); return new ChargeJob(currentAgv.Place);
} }
......
using MiR; using Common;
using log4net.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AGVControl.bean.jobType namespace DeviceLibrary
{ {
/// <summary> /// <summary>
/// 退料任务 /// 退料任务
...@@ -23,9 +17,9 @@ namespace AGVControl.bean.jobType ...@@ -23,9 +17,9 @@ namespace AGVControl.bean.jobType
{ {
if (currentAgv.IP.Equals(SettingString.SingleMission_IP1)) if (currentAgv.IP.Equals(SettingString.SingleMission_IP1))
return null; return null;
if (!Common.CheckCanExecuteMission(currentAgv)) if (!CommonVar.CheckCanExecuteMission(currentAgv))
return null; return null;
if (!Common.CheckAGVStatusNone(currentAgv)) if (!CommonVar.CheckAGVStatusNone(currentAgv))
return null; return null;
string rfid=""; string rfid="";
//查找退料线出满料架且点料机需要架子 //查找退料线出满料架且点料机需要架子
...@@ -33,26 +27,26 @@ namespace AGVControl.bean.jobType ...@@ -33,26 +27,26 @@ namespace AGVControl.bean.jobType
{ {
if (ReelStringJobType.FindNeedEnter(currentAgv, SettingString.D3) ) if (ReelStringJobType.FindNeedEnter(currentAgv, SettingString.D3) )
{ {
int idx = Common.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is SendShelfJob && (((SendShelfJob)s.CurJob).TargetPlace.Equals(SettingString.G23_In))); int idx = CommonVar.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is SendShelfJob && (((SendShelfJob)s.CurJob).TargetPlace.Equals(SettingString.G23_In)));
if (idx == -1) idx = Common.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is SendShelfJob && (((SendShelfJob)s.CurJob).TargetPlace.Equals(SettingString.D3))); if (idx == -1) idx = CommonVar.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is SendShelfJob && (((SendShelfJob)s.CurJob).TargetPlace.Equals(SettingString.D3)));
if (idx == -1) idx = Common.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is GetShelfJob && (((GetShelfJob)s.CurJob).TargetPlace.Equals(SettingString.D3))); if (idx == -1) idx = CommonVar.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is GetShelfJob && (((GetShelfJob)s.CurJob).TargetPlace.Equals(SettingString.D3)));
if (idx==-1) idx = Common.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is GetShelfJob && (((GetShelfJob)s.CurJob).TargetPlace.Equals(SettingString.G24_Out))); if (idx==-1) idx = CommonVar.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is GetShelfJob && (((GetShelfJob)s.CurJob).TargetPlace.Equals(SettingString.G24_Out)));
if (idx == -1) if (idx == -1)
{ {
Common.LogInfo(string.Format("{0} 退料任务生成(D3需要满料串,G24出满料串):Place={1},rfid={2}", currentAgv.Name, SettingString.D3, rfid)); LogUtil.info(string.Format("{0} 退料任务生成(D3需要满料串,G24出满料串):Place={1},rfid={2}", currentAgv.Name, SettingString.D3, rfid));
return new GetShelfJob(currentAgv.Place, SettingString.G24_Out, "B#",true); return new GetShelfJob(currentAgv.Place, SettingString.G24_Out, "B#",true);
} }
} }
if (ReelStringJobType.FindNeedEnter(currentAgv, SettingString.D4)) if (ReelStringJobType.FindNeedEnter(currentAgv, SettingString.D4))
{ {
int idx = Common.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is SendShelfJob && (((SendShelfJob)s.CurJob).TargetPlace.Equals(SettingString.G23_In))); int idx = CommonVar.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is SendShelfJob && (((SendShelfJob)s.CurJob).TargetPlace.Equals(SettingString.G23_In)));
if (idx == -1) idx = Common.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is SendShelfJob && (((SendShelfJob)s.CurJob).TargetPlace.Equals(SettingString.D4))); if (idx == -1) idx = CommonVar.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is SendShelfJob && (((SendShelfJob)s.CurJob).TargetPlace.Equals(SettingString.D4)));
if (idx == -1) idx = Common.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is GetShelfJob && (((GetShelfJob)s.CurJob).TargetPlace.Equals(SettingString.D4))); if (idx == -1) idx = CommonVar.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is GetShelfJob && (((GetShelfJob)s.CurJob).TargetPlace.Equals(SettingString.D4)));
if (idx == -1) idx = Common.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is GetShelfJob && (((GetShelfJob)s.CurJob).TargetPlace.Equals(SettingString.G24_Out))); if (idx == -1) idx = CommonVar.agvInfo.FindIndex(s => !s.IP.Equals(currentAgv.IP) && s.CurJob != null && s.CurJob is GetShelfJob && (((GetShelfJob)s.CurJob).TargetPlace.Equals(SettingString.G24_Out)));
if (idx == -1) if (idx == -1)
{ {
Common.LogInfo(string.Format("{0} 退料任务生成(D4需要满料串,G24出满料串):Place={1},rfid={2}", currentAgv.Name, SettingString.D3, rfid)); LogUtil.info(string.Format("{0} 退料任务生成(D4需要满料串,G24出满料串):Place={1},rfid={2}", currentAgv.Name, SettingString.D3, rfid));
return new GetShelfJob(currentAgv.Place, SettingString.G24_Out, "B#",true); return new GetShelfJob(currentAgv.Place, SettingString.G24_Out, "B#",true);
} }
...@@ -64,7 +58,7 @@ namespace AGVControl.bean.jobType ...@@ -64,7 +58,7 @@ namespace AGVControl.bean.jobType
{ {
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.G23_In)) if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.G23_In))
{ {
Common.LogInfo(string.Format("{0} 退料任务生成(D3出空料串,G23需要空料串):Place={1},rfid={2}", currentAgv.Name, SettingString.D3, rfid)); LogUtil.info(string.Format("{0} 退料任务生成(D3出空料串,G23需要空料串):Place={1},rfid={2}", currentAgv.Name, SettingString.D3, rfid));
return new GetShelfJob(currentAgv.Place, SettingString.D3, "B#"); return new GetShelfJob(currentAgv.Place, SettingString.D3, "B#");
} }
} }
...@@ -72,7 +66,7 @@ namespace AGVControl.bean.jobType ...@@ -72,7 +66,7 @@ namespace AGVControl.bean.jobType
{ {
if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.G23_In)) if (ReelStringJobType.FindNeedEnterMission(currentAgv, SettingString.G23_In))
{ {
Common.LogInfo(string.Format("{0} 退料任务生成(D4出空料串,G23需要空料串):Place={1},rfid={2}", currentAgv.Name, SettingString.D4, rfid)); LogUtil.info(string.Format("{0} 退料任务生成(D4出空料串,G23需要空料串):Place={1},rfid={2}", currentAgv.Name, SettingString.D4, rfid));
return new GetShelfJob(currentAgv.Place, SettingString.D4, "B#"); return new GetShelfJob(currentAgv.Place, SettingString.D4, "B#");
} }
} }
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AGVControl namespace DeviceLibrary
{ {
/// <summary> /// <summary>
/// 客户端的节点 /// 客户端的节点
...@@ -125,22 +122,21 @@ namespace AGVControl ...@@ -125,22 +122,21 @@ namespace AGVControl
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.log.Error(Name + "上报节点信息失败" + ex.Message + ex.StackTrace); Common.LogUtil.error(Name + "上报节点信息失败" + ex.Message + ex.StackTrace);
} }
} }
public string[] ToRow() public string[] ToRow()
{ {
//节点,IP,动作,RFID,AGV名称,在线,调用,清除AGV //节点,IP,动作,RFID,AGV名称,在线,调用,清除AGV
string[] s = new string[7]; List<string> list = new List<string>();
s[0] = LineName; list.Add(LineName);
s[1] = nodeStatus.ToString(); list.Add(nodeStatus.ToString());
s[2] = Level.ToString(); list.Add(Level.ToString());
s[3] = Mark; list.Add(RFID);
s[4] = RFID; list.Add(Online ? "在线" : "离线");
s[5] = Online ? "在线" : "离线"; list.Add(IsUse ? "是" : "否");
s[6] = IsUse ? "是" : "否"; return list.ToArray();
return s;
} }
/// <summary> /// <summary>
......
using AGVControl.bean; 
using System; namespace DeviceLibrary
using System.Collections.Generic;
using System.Windows.Forms;
namespace AGVControl
{ {
public abstract class Node public abstract class Node
{ {
......
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!