Commit afe4d84f 张东亮

1222

1 个父辈 3fbe1f2e
......@@ -8,10 +8,11 @@
<OutputType>WinExe</OutputType>
<RootNamespace>AGV_3D_Line</RootNamespace>
<AssemblyName>AGV-3D-Line</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
......@@ -75,11 +76,20 @@
<Compile Include="FrmMain.Designer.cs">
<DependentUpon>FrmMain.cs</DependentUpon>
</Compile>
<Compile Include="Manual.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Manual.designer.cs">
<DependentUpon>Manual.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FrmMain.resx">
<DependentUpon>FrmMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Manual.resx">
<DependentUpon>Manual.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
......@@ -107,6 +117,19 @@
<ItemGroup>
<Content Include="line.ico" />
</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" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
<log4net>
<appender name="AgvServer" type="log4net.Appender.RollingFileAppender">
......@@ -21,17 +21,17 @@
<file value="logs/UnlockInfo.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<param name="MaxSizeRollBackups" value="10" />
<param name="MaxSizeRollBackups" value="10"/>
<!-- 切割最多文件数 -->
<param name="MaximumFileSize" value="100MB" />
<param name="MaximumFileSize" value="100MB"/>
<!-- 每个文件的大小 -->
<param name="RollingStyle" value="Size" />
<param name="StaticLogFileName" value="true" />
<param name="RollingStyle" value="Size"/>
<param name="StaticLogFileName" value="true"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date]%-5p %m%n"/>
</layout>
</appender>
<logger name ="LineWebService">
<logger name="LineWebService">
<level value="Info"/>
<appender-ref ref="LineWebService"/>
</logger>
......@@ -41,14 +41,14 @@
</root>
</log4net>
<appSettings>
<add key="ITS" value="http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMIGetBoxDestInfo?boxRFID=" />
<add key="WebService" value="http://127.0.0.1/BenQMIR/Webservice/AGVService.asmx/" />
<add key="http.server" value="http://10.85.199.25/myproject/" />
<add key="FLEET" value="10.85.199.3" />
<add key="AutoCharge" value="True" />
<add key="ChargeWait" value="1" />
<add key="ChargeThreshold" value="20,90" />
<add key="IP_4D_Light" value="10.85.196.40:8088" />
<add key="IP_4C_Light" value="10.85.197.40:8088" />
<add key="ITS" value="http://10.85.17.233/ESMTCommonInterface/CommonService.asmx/VMIGetBoxDestInfo?boxRFID="/>
<add key="WebService" value="http://127.0.0.1/BenQMIR/Webservice/AGVService.asmx/"/>
<add key="http.server" value="http://10.85.199.25/myproject/"/>
<add key="FLEET" value="10.85.199.3"/>
<add key="AutoCharge" value="True"/>
<add key="ChargeWait" value="1"/>
<add key="ChargeThreshold" value="20,90"/>
<add key="IP_4D_Light" value="10.85.196.40:8088"/>
<add key="IP_4C_Light" value="10.85.197.40:8088"/>
</appSettings>
</configuration>
\ No newline at end of file
</configuration>
......@@ -29,18 +29,6 @@
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
this.DgvAgv = new System.Windows.Forms.DataGridView();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column14 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column21 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column18 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column23 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column13 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column19 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column11 = new System.Windows.Forms.DataGridViewButtonColumn();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
......@@ -73,7 +61,7 @@
this.lblStandy1 = new System.Windows.Forms.Label();
this.lblCharge4 = new System.Windows.Forms.Label();
this.lblCharge3 = new System.Windows.Forms.Label();
this.TxtLog = new System.Windows.Forms.TextBox();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.label12 = new System.Windows.Forms.Label();
this.groupBox4 = new System.Windows.Forms.GroupBox();
......@@ -94,21 +82,9 @@
this.btnAddMission = new System.Windows.Forms.Button();
this.cmbBoxLineName = new System.Windows.Forms.ComboBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btnReSendTask = new System.Windows.Forms.Button();
this.BtnClearError = new System.Windows.Forms.Button();
this.BtnMissionReady = new System.Windows.Forms.Button();
this.BtnMissionPause = new System.Windows.Forms.Button();
this.BtnMissionAdd = new System.Windows.Forms.Button();
this.LstAgvPlace = new System.Windows.Forms.ListBox();
this.tabControlManual = new System.Windows.Forms.TabControl();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.DgvAgv)).BeginInit();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.tableLayoutPanel3.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
......@@ -131,148 +107,23 @@
this.groupBox6.SuspendLayout();
this.groupBox2.SuspendLayout();
this.tableLayoutPanel4.SuspendLayout();
this.tableLayoutPanel6.SuspendLayout();
this.SuspendLayout();
//
// DgvAgv
//
this.DgvAgv.AllowUserToAddRows = false;
this.DgvAgv.AllowUserToDeleteRows = false;
this.DgvAgv.AllowUserToResizeColumns = false;
this.DgvAgv.AllowUserToResizeRows = false;
this.DgvAgv.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.DgvAgv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.DgvAgv.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.DgvAgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.DgvAgv.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column1,
this.Column2,
this.Column4,
this.Column14,
this.Column21,
this.Column3,
this.Column18,
this.Column23,
this.Column13,
this.Column19,
this.Column11});
this.DgvAgv.Location = new System.Drawing.Point(3, 3);
this.DgvAgv.MultiSelect = false;
this.DgvAgv.Name = "DgvAgv";
this.DgvAgv.ReadOnly = true;
this.DgvAgv.RowHeadersVisible = false;
this.DgvAgv.RowHeadersWidth = 51;
this.DgvAgv.RowTemplate.Height = 23;
this.DgvAgv.Size = new System.Drawing.Size(1105, 141);
this.DgvAgv.TabIndex = 3;
this.DgvAgv.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgvAgv_CellClick);
this.DgvAgv.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgvAgv_CellContentClick);
//
// Column1
//
this.Column1.HeaderText = "名称";
this.Column1.MinimumWidth = 6;
this.Column1.Name = "Column1";
this.Column1.ReadOnly = true;
this.Column1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column2
//
this.Column2.HeaderText = "IP";
this.Column2.MinimumWidth = 6;
this.Column2.Name = "Column2";
this.Column2.ReadOnly = true;
this.Column2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column4
//
this.Column4.HeaderText = "小车状态";
this.Column4.MinimumWidth = 6;
this.Column4.Name = "Column4";
this.Column4.ReadOnly = true;
this.Column4.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column14
//
this.Column14.HeaderText = "任务ID";
this.Column14.MinimumWidth = 6;
this.Column14.Name = "Column14";
this.Column14.ReadOnly = true;
this.Column14.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column21
//
this.Column21.HeaderText = "任务名称";
this.Column21.MinimumWidth = 6;
this.Column21.Name = "Column21";
this.Column21.ReadOnly = true;
this.Column21.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column3
//
this.Column3.HeaderText = "任务状态";
this.Column3.MinimumWidth = 6;
this.Column3.Name = "Column3";
this.Column3.ReadOnly = true;
this.Column3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column18
//
this.Column18.HeaderText = "目的地";
this.Column18.MinimumWidth = 6;
this.Column18.Name = "Column18";
this.Column18.ReadOnly = true;
this.Column18.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column23
//
this.Column23.HeaderText = "负载";
this.Column23.MinimumWidth = 6;
this.Column23.Name = "Column23";
this.Column23.ReadOnly = true;
this.Column23.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column13
//
this.Column13.HeaderText = "连接";
this.Column13.MinimumWidth = 6;
this.Column13.Name = "Column13";
this.Column13.ReadOnly = true;
this.Column13.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column19
//
this.Column19.HeaderText = "电量";
this.Column19.MinimumWidth = 6;
this.Column19.Name = "Column19";
this.Column19.ReadOnly = true;
this.Column19.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column11
//
this.Column11.HeaderText = "自动";
this.Column11.MinimumWidth = 6;
this.Column11.Name = "Column11";
this.Column11.ReadOnly = true;
//
// tableLayoutPanel3
//
this.tableLayoutPanel3.ColumnCount = 1;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.Controls.Add(this.tabControl1, 0, 2);
this.tableLayoutPanel3.Controls.Add(this.DgvAgv, 0, 0);
this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 0, 1);
this.tableLayoutPanel3.Controls.Add(this.tabControl1, 0, 1);
this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 0, 0);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(2);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 3;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(1111, 735);
this.tableLayoutPanel3.RowCount = 2;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 48.43538F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 51.56462F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(1215, 735);
this.tableLayoutPanel3.TabIndex = 7;
//
// tabControl1
......@@ -281,10 +132,10 @@
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(3, 370);
this.tabControl1.Location = new System.Drawing.Point(3, 359);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(1105, 362);
this.tabControl1.Size = new System.Drawing.Size(1209, 373);
this.tabControl1.TabIndex = 7;
//
// tabPage1
......@@ -293,7 +144,7 @@
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1097, 336);
this.tabPage1.Size = new System.Drawing.Size(1201, 347);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "节点状态&产线任务";
this.tabPage1.UseVisualStyleBackColor = true;
......@@ -311,7 +162,7 @@
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 1;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(1091, 330);
this.tableLayoutPanel2.Size = new System.Drawing.Size(1195, 341);
this.tableLayoutPanel2.TabIndex = 34;
//
// DgvNode
......@@ -343,7 +194,7 @@
this.DgvNode.RowHeadersVisible = false;
this.DgvNode.RowHeadersWidth = 50;
this.DgvNode.RowTemplate.Height = 23;
this.DgvNode.Size = new System.Drawing.Size(609, 324);
this.DgvNode.Size = new System.Drawing.Size(667, 335);
this.DgvNode.TabIndex = 1;
this.DgvNode.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgvNode_CellClick);
//
......@@ -422,11 +273,11 @@
this.groupBox1.Controls.Add(this.tableLayoutPanel5);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(617, 2);
this.groupBox1.Location = new System.Drawing.Point(675, 2);
this.groupBox1.Margin = new System.Windows.Forms.Padding(2);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(2);
this.groupBox1.Size = new System.Drawing.Size(472, 326);
this.groupBox1.Size = new System.Drawing.Size(518, 337);
this.groupBox1.TabIndex = 33;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "任务信息";
......@@ -448,18 +299,18 @@
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 55F));
this.tableLayoutPanel5.Size = new System.Drawing.Size(468, 305);
this.tableLayoutPanel5.Size = new System.Drawing.Size(514, 316);
this.tableLayoutPanel5.TabIndex = 2;
//
// groupBox5
//
this.groupBox5.Controls.Add(this.lblDestInfo);
this.groupBox5.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox5.Location = new System.Drawing.Point(2, 47);
this.groupBox5.Location = new System.Drawing.Point(2, 49);
this.groupBox5.Margin = new System.Windows.Forms.Padding(2);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Padding = new System.Windows.Forms.Padding(2);
this.groupBox5.Size = new System.Drawing.Size(464, 41);
this.groupBox5.Size = new System.Drawing.Size(510, 43);
this.groupBox5.TabIndex = 2;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "出料信息";
......@@ -471,7 +322,7 @@
this.lblDestInfo.Location = new System.Drawing.Point(2, 19);
this.lblDestInfo.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblDestInfo.Name = "lblDestInfo";
this.lblDestInfo.Size = new System.Drawing.Size(460, 20);
this.lblDestInfo.Size = new System.Drawing.Size(506, 22);
this.lblDestInfo.TabIndex = 40;
this.lblDestInfo.Text = "lblDestInfo";
//
......@@ -483,7 +334,7 @@
this.groupBox3.Margin = new System.Windows.Forms.Padding(2);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Padding = new System.Windows.Forms.Padding(2);
this.groupBox3.Size = new System.Drawing.Size(464, 41);
this.groupBox3.Size = new System.Drawing.Size(510, 43);
this.groupBox3.TabIndex = 0;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "双层线工单信息";
......@@ -495,7 +346,7 @@
this.lblWO.Location = new System.Drawing.Point(2, 19);
this.lblWO.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblWO.Name = "lblWO";
this.lblWO.Size = new System.Drawing.Size(460, 20);
this.lblWO.Size = new System.Drawing.Size(506, 22);
this.lblWO.TabIndex = 40;
this.lblWO.Text = "lblWO";
//
......@@ -506,12 +357,12 @@
this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel7.Controls.Add(this.lblWarn, 0, 0);
this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel7.Location = new System.Drawing.Point(2, 92);
this.tableLayoutPanel7.Location = new System.Drawing.Point(2, 96);
this.tableLayoutPanel7.Margin = new System.Windows.Forms.Padding(2);
this.tableLayoutPanel7.Name = "tableLayoutPanel7";
this.tableLayoutPanel7.RowCount = 1;
this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel7.Size = new System.Drawing.Size(464, 41);
this.tableLayoutPanel7.Size = new System.Drawing.Size(510, 43);
this.tableLayoutPanel7.TabIndex = 3;
//
// lblWarn
......@@ -522,7 +373,7 @@
this.lblWarn.Location = new System.Drawing.Point(2, 0);
this.lblWarn.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblWarn.Name = "lblWarn";
this.lblWarn.Size = new System.Drawing.Size(460, 41);
this.lblWarn.Size = new System.Drawing.Size(506, 43);
this.lblWarn.TabIndex = 41;
this.lblWarn.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
......@@ -531,9 +382,9 @@
this.grpUnlock.Controls.Add(this.tblLayoutUnlock);
this.grpUnlock.Dock = System.Windows.Forms.DockStyle.Fill;
this.grpUnlock.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.grpUnlock.Location = new System.Drawing.Point(3, 138);
this.grpUnlock.Location = new System.Drawing.Point(3, 144);
this.grpUnlock.Name = "grpUnlock";
this.grpUnlock.Size = new System.Drawing.Size(462, 164);
this.grpUnlock.Size = new System.Drawing.Size(508, 169);
this.grpUnlock.TabIndex = 4;
this.grpUnlock.TabStop = false;
this.grpUnlock.Text = "解绑信息";
......@@ -551,7 +402,7 @@
this.tblLayoutUnlock.Name = "tblLayoutUnlock";
this.tblLayoutUnlock.RowCount = 1;
this.tblLayoutUnlock.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tblLayoutUnlock.Size = new System.Drawing.Size(456, 142);
this.tblLayoutUnlock.Size = new System.Drawing.Size(502, 147);
this.tblLayoutUnlock.TabIndex = 1;
//
// dgvUnlockDetail
......@@ -560,13 +411,13 @@
this.dgvUnlockDetail.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.dgvUnlockDetail.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvUnlockDetail.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvUnlockDetail.Location = new System.Drawing.Point(231, 3);
this.dgvUnlockDetail.Location = new System.Drawing.Point(254, 3);
this.dgvUnlockDetail.Name = "dgvUnlockDetail";
this.dgvUnlockDetail.ReadOnly = true;
this.dgvUnlockDetail.RowHeadersVisible = false;
this.dgvUnlockDetail.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
this.dgvUnlockDetail.RowTemplate.Height = 23;
this.dgvUnlockDetail.Size = new System.Drawing.Size(222, 136);
this.dgvUnlockDetail.Size = new System.Drawing.Size(245, 141);
this.dgvUnlockDetail.TabIndex = 1;
//
// dgvUnlockInfo
......@@ -580,7 +431,7 @@
this.dgvUnlockInfo.ReadOnly = true;
this.dgvUnlockInfo.RowHeadersVisible = false;
this.dgvUnlockInfo.RowTemplate.Height = 23;
this.dgvUnlockInfo.Size = new System.Drawing.Size(222, 136);
this.dgvUnlockInfo.Size = new System.Drawing.Size(245, 141);
this.dgvUnlockInfo.TabIndex = 0;
//
// tabPage2
......@@ -589,7 +440,7 @@
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1097, 336);
this.tabPage2.Size = new System.Drawing.Size(1201, 347);
this.tabPage2.TabIndex = 3;
this.tabPage2.Text = "日志";
this.tabPage2.UseVisualStyleBackColor = true;
......@@ -598,16 +449,16 @@
//
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 181F));
this.tableLayoutPanel1.Controls.Add(this.groupBox8, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.TxtLog, 0, 0);
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 239F));
this.tableLayoutPanel1.Controls.Add(this.groupBox8, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.richTextBox1, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(1091, 330);
this.tableLayoutPanel1.Size = new System.Drawing.Size(1195, 341);
this.tableLayoutPanel1.TabIndex = 6;
//
// groupBox8
......@@ -616,13 +467,12 @@
this.groupBox8.Controls.Add(this.lblStandy1);
this.groupBox8.Controls.Add(this.lblCharge4);
this.groupBox8.Controls.Add(this.lblCharge3);
this.groupBox8.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox8.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox8.Location = new System.Drawing.Point(912, 2);
this.groupBox8.Location = new System.Drawing.Point(958, 2);
this.groupBox8.Margin = new System.Windows.Forms.Padding(2);
this.groupBox8.Name = "groupBox8";
this.groupBox8.Padding = new System.Windows.Forms.Padding(2);
this.groupBox8.Size = new System.Drawing.Size(177, 326);
this.groupBox8.Size = new System.Drawing.Size(235, 132);
this.groupBox8.TabIndex = 6;
this.groupBox8.TabStop = false;
this.groupBox8.Text = "位置占用情况";
......@@ -671,15 +521,14 @@
this.lblCharge3.TabIndex = 0;
this.lblCharge3.Text = "lblCharge3";
//
// TxtLog
// richTextBox1
//
this.TxtLog.Dock = System.Windows.Forms.DockStyle.Fill;
this.TxtLog.Location = new System.Drawing.Point(3, 3);
this.TxtLog.Multiline = true;
this.TxtLog.Name = "TxtLog";
this.TxtLog.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.TxtLog.Size = new System.Drawing.Size(904, 324);
this.TxtLog.TabIndex = 5;
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Location = new System.Drawing.Point(3, 3);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(950, 335);
this.richTextBox1.TabIndex = 7;
this.richTextBox1.Text = "";
//
// tabPage3
//
......@@ -687,26 +536,23 @@
this.tabPage3.Controls.Add(this.groupBox4);
this.tabPage3.Controls.Add(this.groupBox6);
this.tabPage3.Controls.Add(this.groupBox2);
this.tabPage3.Controls.Add(this.BtnMissionAdd);
this.tabPage3.Controls.Add(this.LstAgvPlace);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(1097, 336);
this.tabPage3.Size = new System.Drawing.Size(1201, 347);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "手动";
this.tabPage3.UseVisualStyleBackColor = true;
//
// label12
//
this.label12.AutoSize = true;
this.label12.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
this.label12.Location = new System.Drawing.Point(302, 224);
this.label12.Dock = System.Windows.Forms.DockStyle.Left;
this.label12.Location = new System.Drawing.Point(3, 3);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(407, 60);
this.label12.Size = new System.Drawing.Size(250, 341);
this.label12.TabIndex = 46;
this.label12.Text = "说明:\r\n1、获取接驳台RFID:获取指定产线上的料架RFID信息\r\n2、物料状态上报:上报料车的产线信息\r\n3、清除接驳台RFID:清理指定产线的RFID信息\r" +
"\n4、清理料架的缓存信息:输入RFID,清除RFID的缓存信息,使料架可以复用\r\n";
this.label12.Text = resources.GetString("label12.Text");
//
// groupBox4
//
......@@ -720,9 +566,10 @@
this.groupBox4.Controls.Add(this.label8);
this.groupBox4.Controls.Add(this.label7);
this.groupBox4.Controls.Add(this.txtBoxRFID);
this.groupBox4.Location = new System.Drawing.Point(800, 24);
this.groupBox4.Dock = System.Windows.Forms.DockStyle.Right;
this.groupBox4.Location = new System.Drawing.Point(259, 3);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(291, 262);
this.groupBox4.Size = new System.Drawing.Size(291, 341);
this.groupBox4.TabIndex = 38;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "操作";
......@@ -752,7 +599,7 @@
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(4, 200);
this.label11.Location = new System.Drawing.Point(6, 228);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(29, 12);
this.label11.TabIndex = 45;
......@@ -825,12 +672,13 @@
this.groupBox6.Controls.Add(this.btnDeleteMission);
this.groupBox6.Controls.Add(this.btnAddMission);
this.groupBox6.Controls.Add(this.cmbBoxLineName);
this.groupBox6.Dock = System.Windows.Forms.DockStyle.Right;
this.groupBox6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.groupBox6.Location = new System.Drawing.Point(320, 21);
this.groupBox6.Location = new System.Drawing.Point(550, 3);
this.groupBox6.Margin = new System.Windows.Forms.Padding(2);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Padding = new System.Windows.Forms.Padding(2);
this.groupBox6.Size = new System.Drawing.Size(247, 180);
this.groupBox6.Size = new System.Drawing.Size(247, 341);
this.groupBox6.TabIndex = 37;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "产线手动绑定";
......@@ -894,205 +742,60 @@
// groupBox2
//
this.groupBox2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.groupBox2.Controls.Add(this.btnReSendTask);
this.groupBox2.Controls.Add(this.BtnClearError);
this.groupBox2.Controls.Add(this.BtnMissionReady);
this.groupBox2.Controls.Add(this.BtnMissionPause);
this.groupBox2.Location = new System.Drawing.Point(583, 24);
this.groupBox2.Controls.Add(this.tabControlManual);
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Right;
this.groupBox2.Location = new System.Drawing.Point(797, 3);
this.groupBox2.Margin = new System.Windows.Forms.Padding(2);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Padding = new System.Windows.Forms.Padding(2);
this.groupBox2.Size = new System.Drawing.Size(193, 177);
this.groupBox2.Size = new System.Drawing.Size(401, 341);
this.groupBox2.TabIndex = 32;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "小车操作";
//
// btnReSendTask
//
this.btnReSendTask.Location = new System.Drawing.Point(96, 102);
this.btnReSendTask.Margin = new System.Windows.Forms.Padding(2);
this.btnReSendTask.Name = "btnReSendTask";
this.btnReSendTask.Size = new System.Drawing.Size(75, 52);
this.btnReSendTask.TabIndex = 45;
this.btnReSendTask.Text = "任务重发";
this.btnReSendTask.UseVisualStyleBackColor = true;
this.btnReSendTask.Click += new System.EventHandler(this.btnReSendTask_Click);
//
// BtnClearError
//
this.BtnClearError.Location = new System.Drawing.Point(5, 102);
this.BtnClearError.Name = "BtnClearError";
this.BtnClearError.Size = new System.Drawing.Size(75, 52);
this.BtnClearError.TabIndex = 19;
this.BtnClearError.Text = "清除错误";
this.BtnClearError.UseVisualStyleBackColor = true;
this.BtnClearError.Click += new System.EventHandler(this.BtnClearError_Click);
//
// BtnMissionReady
//
this.BtnMissionReady.Location = new System.Drawing.Point(5, 23);
this.BtnMissionReady.Name = "BtnMissionReady";
this.BtnMissionReady.Size = new System.Drawing.Size(75, 52);
this.BtnMissionReady.TabIndex = 1;
this.BtnMissionReady.Text = "运行";
this.BtnMissionReady.UseVisualStyleBackColor = true;
this.BtnMissionReady.Click += new System.EventHandler(this.BtnMissionReady_Click);
//
// BtnMissionPause
//
this.BtnMissionPause.Location = new System.Drawing.Point(96, 23);
this.BtnMissionPause.Name = "BtnMissionPause";
this.BtnMissionPause.Size = new System.Drawing.Size(75, 52);
this.BtnMissionPause.TabIndex = 2;
this.BtnMissionPause.Text = "暂停";
this.BtnMissionPause.UseVisualStyleBackColor = true;
this.BtnMissionPause.Click += new System.EventHandler(this.BtnMissionPause_Click);
//
// BtnMissionAdd
//
this.BtnMissionAdd.Location = new System.Drawing.Point(170, 24);
this.BtnMissionAdd.Name = "BtnMissionAdd";
this.BtnMissionAdd.Size = new System.Drawing.Size(75, 60);
this.BtnMissionAdd.TabIndex = 3;
this.BtnMissionAdd.Text = "添加任务";
this.BtnMissionAdd.UseVisualStyleBackColor = true;
this.BtnMissionAdd.Click += new System.EventHandler(this.BtnMissionAdd_Click);
//
// LstAgvPlace
//
this.LstAgvPlace.Dock = System.Windows.Forms.DockStyle.Left;
this.LstAgvPlace.FormattingEnabled = true;
this.LstAgvPlace.IntegralHeight = false;
this.LstAgvPlace.ItemHeight = 12;
this.LstAgvPlace.Location = new System.Drawing.Point(3, 3);
this.LstAgvPlace.Name = "LstAgvPlace";
this.LstAgvPlace.Size = new System.Drawing.Size(150, 330);
this.LstAgvPlace.TabIndex = 0;
// tabControlManual
//
this.tabControlManual.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControlManual.Location = new System.Drawing.Point(2, 16);
this.tabControlManual.Name = "tabControlManual";
this.tabControlManual.SelectedIndex = 0;
this.tabControlManual.Size = new System.Drawing.Size(397, 323);
this.tabControlManual.TabIndex = 0;
//
// tableLayoutPanel4
//
this.tableLayoutPanel4.ColumnCount = 1;
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.Controls.Add(this.tableLayoutPanel6, 0, 0);
this.tableLayoutPanel4.Controls.Add(this.flowLayoutPanel1, 0, 0);
this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel4.Location = new System.Drawing.Point(2, 149);
this.tableLayoutPanel4.Location = new System.Drawing.Point(2, 2);
this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(2);
this.tableLayoutPanel4.Name = "tableLayoutPanel4";
this.tableLayoutPanel4.RowCount = 1;
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 169F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(1107, 216);
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 352F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(1211, 352);
this.tableLayoutPanel4.TabIndex = 8;
//
// tableLayoutPanel6
//
this.tableLayoutPanel6.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.OutsetPartial;
this.tableLayoutPanel6.ColumnCount = 3;
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33334F));
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33334F));
this.tableLayoutPanel6.Controls.Add(this.label6, 2, 1);
this.tableLayoutPanel6.Controls.Add(this.label5, 1, 1);
this.tableLayoutPanel6.Controls.Add(this.label4, 0, 1);
this.tableLayoutPanel6.Controls.Add(this.label3, 2, 0);
this.tableLayoutPanel6.Controls.Add(this.label2, 1, 0);
this.tableLayoutPanel6.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel6.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tableLayoutPanel6.Location = new System.Drawing.Point(2, 2);
this.tableLayoutPanel6.Margin = new System.Windows.Forms.Padding(2);
this.tableLayoutPanel6.Name = "tableLayoutPanel6";
this.tableLayoutPanel6.RowCount = 2;
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel6.Size = new System.Drawing.Size(1103, 212);
this.tableLayoutPanel6.TabIndex = 0;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Dock = System.Windows.Forms.DockStyle.Fill;
this.label6.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label6.Location = new System.Drawing.Point(737, 107);
this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(361, 102);
this.label6.TabIndex = 5;
this.label6.Text = "label6";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
this.label5.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.Location = new System.Drawing.Point(371, 107);
this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(359, 102);
this.label5.TabIndex = 4;
this.label5.Text = "label5";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
this.label4.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(5, 107);
this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(359, 102);
this.label4.TabIndex = 3;
this.label4.Text = "label4";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(737, 3);
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(361, 101);
this.label3.TabIndex = 2;
this.label3.Text = "label3";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
this.label2.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(371, 3);
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(359, 101);
this.label2.TabIndex = 1;
this.label2.Text = "label2";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(5, 3);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(359, 101);
this.label1.TabIndex = 0;
this.label1.Text = "label1";
// flowLayoutPanel1
//
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(1205, 346);
this.flowLayoutPanel1.TabIndex = 0;
//
// FrmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1111, 735);
this.ClientSize = new System.Drawing.Size(1215, 735);
this.Controls.Add(this.tableLayoutPanel3);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmMain";
this.Text = "AGV产线调度";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMain_FormClosing);
this.Load += new System.EventHandler(this.FrmMain_Load);
((System.ComponentModel.ISupportInitialize)(this.DgvAgv)).EndInit();
this.tableLayoutPanel3.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
......@@ -1110,25 +813,20 @@
((System.ComponentModel.ISupportInitialize)(this.dgvUnlockInfo)).EndInit();
this.tabPage2.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.groupBox8.ResumeLayout(false);
this.groupBox8.PerformLayout();
this.tabPage3.ResumeLayout(false);
this.tabPage3.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.tableLayoutPanel4.ResumeLayout(false);
this.tableLayoutPanel6.ResumeLayout(false);
this.tableLayoutPanel6.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView DgvAgv;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
......@@ -1137,14 +835,8 @@
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.TextBox TxtLog;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button BtnClearError;
private System.Windows.Forms.Button BtnMissionAdd;
private System.Windows.Forms.Button BtnMissionPause;
private System.Windows.Forms.Button BtnMissionReady;
private System.Windows.Forms.ListBox LstAgvPlace;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4;
private System.Windows.Forms.Label lblWO;
private System.Windows.Forms.GroupBox groupBox3;
......@@ -1156,13 +848,6 @@
private System.Windows.Forms.DataGridViewTextBoxColumn Column9;
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
private System.Windows.Forms.DataGridViewButtonColumn Column16;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.Label lblDestInfo;
......@@ -1172,18 +857,6 @@
private System.Windows.Forms.TextBox txtBoxLineName;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Button btnReSendTask;
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
private System.Windows.Forms.DataGridViewTextBoxColumn Column14;
private System.Windows.Forms.DataGridViewTextBoxColumn Column21;
private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
private System.Windows.Forms.DataGridViewTextBoxColumn Column18;
private System.Windows.Forms.DataGridViewTextBoxColumn Column23;
private System.Windows.Forms.DataGridViewTextBoxColumn Column13;
private System.Windows.Forms.DataGridViewTextBoxColumn Column19;
private System.Windows.Forms.DataGridViewButtonColumn Column11;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label9;
......@@ -1207,6 +880,9 @@
private System.Windows.Forms.Button btnClearStationRFID;
private System.Windows.Forms.Button agvRemoveRfid;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.TabControl tabControlManual;
}
}
using BLL;
using System;
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.ComponentModel;
......@@ -11,17 +10,16 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Common;
using DeviceLibrary;
namespace AGVControl
{
public partial class FrmMain : Form
{
private bool exit = false;
private bool change;
private NotifyIcon notify;
private ContextMenuStrip notifyMenu;
private System.Timers.Timer showTimer;
private Label[] agvRunInfo;
//private string[] agvRunStep;
public FrmMain()
{
......@@ -29,65 +27,46 @@ namespace AGVControl
showTimer = new System.Timers.Timer();
showTimer.Interval = 5000;
//showTimer.Enabled = true;
//showTimer.AutoReset = true;
showTimer.AutoReset = true;
showTimer.Elapsed += ShowTimer_Elapsed;
showTimer.Start();
Common.logTextBox = TxtLog;
agvRunInfo = new Label[] { label1, label2, label3, label4, label5, label6 };
LogUtil.logBox = richTextBox1;
}
private void ShowConfig()
{
int n;
//agvRunStep = new string[Common.agvInfo.Count];
for (int i = 0; i < Common.agvInfo.Count; i++)
for (int i = 0; i < AGVManager.agvInfo.Count; i++)
{
Common.mir.Get_IO_Status(Common.agvInfo[i], out bool[] input, out bool[] output);
MiR_API.Get_IO_Status(AGVManager.agvInfo[i], out bool[] input, out bool[] output);
if (input != null && input.Length == 4)
Common.agvInfo[i].IsExistShelf = input[3];
n = DgvAgv.Rows.Add(Common.agvInfo[i].ToRow());
DgvAgv.Rows[n].HeaderCell.Value = (n + 1).ToString();
if (i % 2 == 0)
DgvAgv.Rows[n].DefaultCellStyle.BackColor = Color.LightBlue;
if (!Common.agvInfo[i].IsCon)
DgvAgv.Rows[n].DefaultCellStyle.ForeColor = Color.Red;
//agvRunStep[i] = Common.agvInfo[i].Msg;
//if (i % 2 == 0)
// agvRunInfo[i].BackColor = Color.LightBlue;
//else
// agvRunInfo[i].BackColor = Color.LightGray;
AGVManager.agvInfo[i].IsExistShelf = input[3];
flowLayoutPanel1.Controls.Add(AGVManager.agvInfo[i].StateKanban);
AddForm(AGVManager.agvInfo[i].Name,new Manual(AGVManager.agvInfo[i]));
AGVManager.agvInfo[i].StateKanban.Init();
}
cmbBoxLineName.Items.Add("产线名称");
foreach (var item in Common.nodeInfo)
{
if (item.Name.StartsWith("A") || item.Name.Equals(SettingString.D4FeederIn) || item.Name.Equals(SettingString.C4FeederIn))
continue;
cmbBoxLineName.Items.Add(item.AliceName);
}
cmbBoxLineName.SelectedIndex = 0;
for (int i = 0; i < Common.nodeInfo.Count; i++)
for (int i = 0; i < AGVManager.nodeInfo.Count; i++)
{
n = DgvNode.Rows.Add(Common.nodeInfo[i].ToRow());
n = DgvNode.Rows.Add(AGVManager.nodeInfo[i].ToRow());
DgvNode.Rows[n].HeaderCell.Value = (n + 1).ToString();
if (i % 2 == 0)
DgvNode.Rows[n].DefaultCellStyle.BackColor = Color.LightBlue;
if (!Common.nodeInfo[i].Online)
if (!AGVManager.nodeInfo[i].Online)
DgvNode.Rows[n].DefaultCellStyle.ForeColor = Color.Red;
if (AGVManager.nodeInfo[i].Name.StartsWith(SettingString.DoubleLine_Name_Prefix) || AGVManager.nodeInfo[i].Name.StartsWith(SettingString.RoomDFeederIn))
continue;
cmbBoxLineName.Items.Add(AGVManager.nodeInfo[i].AliceName);
}
LstAgvPlace.Items.Clear();
LstAgvPlace.Items.AddRange(Common.showNameMissionName.Keys.ToArray());
LstAgvPlace.SelectedIndex = 0;
}
private void Server_NodeChanged(int nodeIndex)
{
Invoke(new Action(() =>
{
DgvNode.Rows[nodeIndex].DefaultCellStyle.ForeColor = Common.nodeInfo[nodeIndex].Online && Common.nodeInfo[nodeIndex].IsUse ? Color.Black : Color.Red;
DgvNode.Rows[nodeIndex].SetValues(Common.nodeInfo[nodeIndex].ToRow());
DgvNode.Rows[nodeIndex].DefaultCellStyle.ForeColor = AGVManager.nodeInfo[nodeIndex].Online && AGVManager.nodeInfo[nodeIndex].IsUse ? Color.Black : Color.Red;
DgvNode.Rows[nodeIndex].SetValues(AGVManager.nodeInfo[nodeIndex].ToRow());
}));
System.GC.Collect();
}
......@@ -96,36 +75,11 @@ namespace AGVControl
{
Invoke(new Action(() =>
{
DgvNode.Rows[nodeIndex].DefaultCellStyle.ForeColor = Common.nodeInfo[nodeIndex].Online ? Color.Black : Color.Red;
DgvNode.Rows[nodeIndex].SetValues(Common.nodeInfo[nodeIndex].ToRow());
}));
System.GC.Collect();
}
/// <summary>
/// 小车状态刷新
/// </summary>
/// <param name="agvIndex"></param>
private void Control_AgvChanged(int agvIndex)
{
Invoke(new Action(() => { DgvAgv.Rows[agvIndex].DefaultCellStyle.ForeColor = Common.agvInfo[agvIndex].StateID.Equals(eAGVState.Error) ? Color.Red : Color.Black; }));
Invoke(new Action(() =>
{
DgvAgv.Rows[agvIndex].SetValues(Common.agvInfo[agvIndex].ToRow());
DgvNode.Rows[nodeIndex].DefaultCellStyle.ForeColor = AGVManager.nodeInfo[nodeIndex].Online ? Color.Black : Color.Red;
DgvNode.Rows[nodeIndex].SetValues(AGVManager.nodeInfo[nodeIndex].ToRow());
}));
System.GC.Collect();
}
private void Control_AgvOnline(int agvIndex)
{
Invoke(new Action(() => { DgvAgv.Rows[agvIndex].DefaultCellStyle.ForeColor = Common.agvInfo[agvIndex].IsCon ? Color.Black : Color.Red; }));
Invoke(new Action(() =>
{
DgvAgv.Rows[agvIndex].SetValues(Common.agvInfo[agvIndex].ToRow());
}));
GC.Collect();
}
private void ItemShow_Click(object sender, EventArgs e)
{
......@@ -136,9 +90,9 @@ namespace AGVControl
private void ItemExit_Click(object sender, EventArgs e)
{
foreach (var item in Common.agvInfo)
foreach (var item in AGVManager.agvInfo)
{
Common.WriteIni(item.Name, SettingString.RFID, item.RFID);
AGVManager.WriteIni(item.Name, SettingString.RFID, item.RFID);
}
notify.Dispose();
exit = true;
......@@ -167,31 +121,26 @@ namespace AGVControl
notify.MouseDoubleClick += Notify_MouseDoubleClick;
ShowConfig();
change = true;
//ChkAutoCharge.Checked = Common.chargeStatus.AutoCharge;
change = false;
Common.control.AgvChanged += Control_AgvChanged;
Common.control.AgvOnline += Control_AgvOnline;
Common.server.NodeChanged += Server_NodeChanged;
Common.control.NodeChangedEvent += Server_NodeChanged;
Common.server.NodeOnline += Server_NodeOnline;
AGVManager.server.NodeChanged += Server_NodeChanged;
AGVManager.control.NodeChangedEvent += Server_NodeChanged;
AGVManager.server.NodeOnline += Server_NodeOnline;
ReadUnlockLineInfo();
}
void ReadUnlockLineInfo()
{
if (!System.IO.File.Exists(Common.CONFIG_PATH + "UnlockInfo.json"))
if (!System.IO.File.Exists(AGVManager.CONFIG_PATH + "UnlockInfo.json"))
{
File.Create(Common.CONFIG_PATH + "UnlockInfo.json");
Common.missionManager = new UnlockMissionManager(Common.nodeInfo);
Common.missionManager.MissionChanged += MissionManager_MissionChanged;
File.Create(AGVManager.CONFIG_PATH + "UnlockInfo.json");
AGVManager.unlockManager = new UnlockMissionManager(AGVManager.nodeInfo);
AGVManager.unlockManager.MissionChanged += MissionManager_MissionChanged;
return;
}
string s = File.ReadAllText(Common.CONFIG_PATH + "UnlockInfo.json");
Common.missionManager = JsonHelper.DeserializeJsonToObject<UnlockMissionManager>(s);
if (Common.missionManager == null)
Common.missionManager = new UnlockMissionManager(Common.nodeInfo);
Common.missionManager.MissionChanged += MissionManager_MissionChanged;
Common.missionManager.Init();
string s = File.ReadAllText(AGVManager.CONFIG_PATH + "UnlockInfo.json");
AGVManager.unlockManager = JsonHelper.DeserializeJsonToObject<UnlockMissionManager>(s);
if (AGVManager.unlockManager == null)
AGVManager.unlockManager = new UnlockMissionManager(AGVManager.nodeInfo);
AGVManager.unlockManager.MissionChanged += MissionManager_MissionChanged;
AGVManager.unlockManager.Init();
}
private void MissionManager_MissionChanged(Dictionary<string, UnlockInfo> pairs)
{
......@@ -224,7 +173,7 @@ namespace AGVControl
}
catch (Exception e)
{
Common.log.Error("ShowUnlockInfo", e);
LogUtil.error("ShowUnlockInfo", e);
}
}
......@@ -235,66 +184,15 @@ namespace AGVControl
e.Cancel = true;
Hide();
}
foreach (var item in Common.agvInfo)
foreach (var item in AGVManager.agvInfo)
{
Common.WriteIni(item.Name, SettingString.RFID, item.RFID);
AGVManager.WriteIni(item.Name, SettingString.RFID, item.RFID);
}
//showTimer.Enabled = false;
showTimer.Stop();
Common.control.AgvChanged -= Control_AgvChanged;
Common.control.AgvOnline -= Control_AgvOnline;
Common.server.NodeChanged -= Server_NodeChanged;
Common.server.NodeOnline -= Server_NodeOnline;
}
private void DgvAgv_CellClick(object sender, DataGridViewCellEventArgs e)
{
DgvAgv.Refresh();
if (e.RowIndex == -1) return;
if (e.ColumnIndex == 10) //调用
{
if (Common.agvInfo[e.RowIndex].IsUse.Equals(true))
{
Common.chargeStatus.ClearRandomChargeInfo(Common.agvInfo[e.RowIndex]);
Common.agvInfo[e.RowIndex].IsUse = false;
Common.agvInfo[e.RowIndex].CurJob = null;
//Common.agvInfo[e.RowIndex].RFID = "";
// }
}
else
{
//清除4c临时待机位的占用
if (Common.agvInfo[e.RowIndex].Name.Equals(Common.StandbyStation.C4_Station1))
{
Common.StandbyStation.C4_Station1 = "";
}
else if (Common.agvInfo[e.RowIndex].Name.Equals(Common.StandbyStation.C4_Station2))
{
Common.StandbyStation.C4_Station2 = "";
}
Common.LogInfo(string.Format("手动开启小车自动模式,并清除上一次的自动模式的运行信息{0} {1}", Common.agvInfo[e.RowIndex].Name, Common.agvInfo[e.RowIndex].RunInfo()));
//Common.agvInfo[e.RowIndex].CurJob = null;
Common.agvInfo[e.RowIndex].RFID = "";
if (Common.agvInfo[e.RowIndex].Place.Equals(SettingString.AutoCharge) || Common.agvInfo[e.RowIndex].Place.Equals(SettingString.Standby))
Common.agvInfo[e.RowIndex].Place = "";
Common.agvInfo[e.RowIndex].IsUse = true;
// }
//else
//{
// Common.agvInfo[e.RowIndex].IsUse = true;
// Common.LogInfo(string.Format("手动开启小车自动模式,并继续上一次的自动模式的运行信息{0} {1}", Common.agvInfo[e.RowIndex].Name, Common.agvInfo[e.RowIndex].RunInfo()));
//}
}
DgvAgv.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = Common.agvInfo[e.RowIndex].IsUse.ToString();
Common.WriteIni(Common.agvInfo[e.RowIndex].Name, SettingString.IsUse, Common.agvInfo[e.RowIndex].IsUse.ToString());
Common.appConfig.Save();
DgvAgv.Rows[e.RowIndex].SetValues(Common.agvInfo[e.RowIndex].ToRow());
}
AGVManager.server.NodeChanged -= Server_NodeChanged;
AGVManager.server.NodeOnline -= Server_NodeOnline;
}
private void DgvNode_CellClick(object sender, DataGridViewCellEventArgs e)
......@@ -303,89 +201,16 @@ namespace AGVControl
if (e.ColumnIndex == 7) //调用
{
Common.nodeInfo[e.RowIndex].IsUse = !Common.nodeInfo[e.RowIndex].IsUse;
DgvNode.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = Common.nodeInfo[e.RowIndex].IsUse.ToString();
Common.WriteIni(Common.nodeInfo[e.RowIndex].Name, SettingString.IsUse, Common.nodeInfo[e.RowIndex].IsUse.ToString());
Common.appConfig.Save();
DgvNode.Rows[e.RowIndex].SetValues(Common.nodeInfo[e.RowIndex].ToRow());
AGVManager.nodeInfo[e.RowIndex].IsUse = !AGVManager.nodeInfo[e.RowIndex].IsUse;
DgvNode.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = AGVManager.nodeInfo[e.RowIndex].IsUse.ToString();
AGVManager.WriteIni(AGVManager.nodeInfo[e.RowIndex].Name, SettingString.IsUse, AGVManager.nodeInfo[e.RowIndex].IsUse.ToString());
DgvNode.Rows[e.RowIndex].SetValues(AGVManager.nodeInfo[e.RowIndex].ToRow());
}
else if (e.ColumnIndex == 8) //清除缓存
{
//清除节点缓存
Common.LogInfo(string.Format("手动清除缓存,{0}", Common.nodeInfo[e.RowIndex].Name));
DgvNode.Rows[e.RowIndex].Cells[5].Value = "";
Common.nodeInfo[e.RowIndex].RFID = "";
DgvNode.Rows[e.RowIndex].Cells[4].Value = "";
DgvNode.Rows[e.RowIndex].SetValues(Common.nodeInfo[e.RowIndex].ToRow());
}
}
private void BtnMissionReady_Click(object sender, EventArgs e)
{
if (DgvAgv.SelectedCells.Count == 0) return;
int idx = DgvAgv.SelectedCells[0].RowIndex;
if (idx < 0) return;
if (Common.agvInfo[idx].IsCon)
Common.mir.State_Ready(Common.agvInfo[idx]);
}
private void BtnMissionPause_Click(object sender, EventArgs e)
{
if (DgvAgv.SelectedCells.Count == 0) return;
int idx = DgvAgv.SelectedCells[0].RowIndex;
if (idx < 0) return;
if (Common.agvInfo[idx].IsCon)
Common.mir.State_Pause(Common.agvInfo[idx]);
Common.LogInfo("手动暂停:[" + Common.agvInfo[idx].Name + "]");
}
private void BtnMissionAdd_Click(object sender, EventArgs e)
{
if (DgvAgv.SelectedCells.Count == 0) return;
int idx = DgvAgv.SelectedCells[0].RowIndex;
if (idx < 0) return;
if (Common.agvInfo[idx].IsCon)
{
if (!Common.agvInfo[idx].IsUse)
//{
// if (MessageBox.Show("确定在自动模式下对小车手动分配任务?", Common.agvInfo[idx].Name, MessageBoxButtons.YesNo) == DialogResult.No)
// return;
// Common.agvInfo[idx].Resend();
// //Common.agvInfo[idx].TaskSend = LstAgvPlace.Text;
// Common.LogInfo("手动添加任务:[" + Common.agvInfo[idx].Name + "][" + Common.agvInfo[idx].CurTaskName + "]");
//}
//else
{
bool rtn = Common.mir.Add_Mission_Fleet(Common.agvInfo[idx], Common.agvMission[Common.showNameMissionName[LstAgvPlace.Text]]);
if (!rtn)
return;
if (LstAgvPlace.Text.StartsWith("Move"))
Common.agvInfo[idx].Place = LstAgvPlace.Text.Substring(4);
Common.LogInfo("手动添加任务:[" + Common.agvInfo[idx].Name + "][" + Common.agvInfo[idx].CurTaskName + "]");
}
////清除4c临时待机位的占用
//if (Common.agvInfo[idx].Name.Equals(Common.StandbyStation.C4_Station1))
//{
// Common.StandbyStation.C4_Station1 = "";
//}
//else if (Common.agvInfo[idx].Name.Equals(Common.StandbyStation.C4_Station2))
//{
// Common.StandbyStation.C4_Station2 = "";
//}
DgvAgv.Rows[idx].SetValues(Common.agvInfo[idx].ToRow());
}
}
private void BtnClearError_Click(object sender, EventArgs e)
{
if (DgvAgv.SelectedCells.Count == 0) return;
int idx = DgvAgv.SelectedCells[0].RowIndex;
if (idx < 0) return;
if (Common.agvInfo[idx].IsCon)
Common.mir.Clear_Error(Common.agvInfo[idx]);
Common.LogInfo("手动清除错误:[" + Common.agvInfo[idx].Name + "]");
}
bool InShhow = false;
......@@ -398,40 +223,27 @@ namespace AGVControl
Invoke(new Action(() =>
{
for (int i = 0; i < Common.agvInfo.Count; i++)
{
try
{
agvRunInfo[i].Text = Common.agvInfo[i].RunInfo();
}
catch (Exception ex)
{
Common.log.Error("显示" + Common.agvInfo[i].Name + "运行信息异常");
}
}
Application.DoEvents();
//if (!Common.doubleLine_WO.Equals(""))
lblWO.Text = Common.doubleLine_WO;
lblWO.Text = AGVManager.doubleLine_WO;
// if (!AGVManager.A6_Target.Equals(""))
lblDestInfo.Text = AGVManager.A6_Target;
lblCharge3.Text = "充电桩3:" + Common.chargeStatus.charge3;
lblCharge4.Text = "充电桩6:" + Common.chargeStatus.charge6;
lblStandy1.Text = "4C待机位1:" + Common.StandbyStation.C4_Station1;
lblStandy2.Text = "4C待机位2:" + Common.StandbyStation.C4_Station2;
lblWarn.Text = Common.warnMsg;
lblDestInfo.Text = HttpManager.A6_Target;
lblCharge3.Text = "充电桩3:" ;
lblCharge4.Text = "充电桩6:" ;
lblStandy1.Text = "4C待机位1:" ;
lblStandy2.Text = "4C待机位2:" ;
lblWarn.Text = AGVManager.warnMsg;
}));
InShhow = false;
}
private void ChkAutoCharge_CheckedChanged(object sender, EventArgs e)
{
if (change) return;
//Common.chargeStatus.AutoCharge = ChkAutoCharge.Checked;
}
/// <summary>
/// 删除绑定
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnDeleteMission_Click(object sender, EventArgs e)
{
try
......@@ -444,16 +256,16 @@ namespace AGVControl
return;
if (txtRfid.Text.ToUpper().StartsWith("D") || txtRfid.Text.ToUpper().StartsWith("C"))
{
int idx = Common.nodeInfo.FindIndex(s => s.AliceName.Equals(cmbBoxLineName.SelectedItem.ToString()));
int idx = AGVManager.nodeInfo.FindIndex(s => s.AliceName.Equals(cmbBoxLineName.SelectedItem.ToString()));
if (idx > -1)
{
if (Common.missionManager.DelMission(Common.nodeInfo[idx].Name, txtRfid.Text.ToUpper()))
if (AGVManager.unlockManager.DelMission(AGVManager.nodeInfo[idx].Name, txtRfid.Text.ToUpper()))
{
Common.LogInfo(string.Format("手动删除任务成功:{0} {1}", cmbBoxLineName.SelectedItem.ToString(), txtRfid.Text.ToUpper()));
LogUtil.info(string.Format("手动删除任务成功:{0} {1}", cmbBoxLineName.SelectedItem.ToString(), txtRfid.Text.ToUpper()));
}
else
{
Common.LogInfo("手动删除任务失败");
LogUtil.info("手动删除任务失败");
}
}
}
......@@ -462,11 +274,15 @@ namespace AGVControl
}
catch (Exception ex)
{
Common.log.Error("手动删除任务失败:" + ex.Message);
LogUtil.error("手动删除任务失败:" + ex.Message);
}
}
/// <summary>
/// 添加解绑任务
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnAddMission_Click(object sender, EventArgs e)
{
try
......@@ -479,18 +295,18 @@ namespace AGVControl
return;
if (MessageBox.Show("确定添加产线任务[" + cmbBoxLineName.SelectedItem.ToString() + "]", "手动添加解绑", MessageBoxButtons.YesNo) == DialogResult.No)
return;
if (txtRfid.Text.ToUpper().StartsWith("D") || txtRfid.Text.ToUpper().StartsWith("C"))
if (txtRfid.Text.ToUpper().StartsWith(SettingString.SmallShelf_Prefix) || txtRfid.Text.ToUpper().StartsWith(SettingString.BigShelf_Prefix))
{
int idx = Common.nodeInfo.FindIndex(s => s.AliceName.Equals(cmbBoxLineName.SelectedItem.ToString()));
int idx = AGVManager.nodeInfo.FindIndex(s => s.AliceName.Equals(cmbBoxLineName.SelectedItem.ToString()));
if (idx > -1)
{
if (Common.missionManager.AddMission(Common.nodeInfo[idx].Name, txtRfid.Text.ToUpper()))
if (AGVManager.unlockManager.AddMission(AGVManager.nodeInfo[idx].Name, txtRfid.Text.ToUpper()))
{
Common.LogInfo(string.Format("手动添加任务成功:{0} {1}", cmbBoxLineName.SelectedItem.ToString(), txtRfid.Text.ToUpper()));
LogUtil.info(string.Format("手动添加任务成功:{0} {1}", cmbBoxLineName.SelectedItem.ToString(), txtRfid.Text.ToUpper()));
}
else
{
Common.LogInfo("手动添加任务失败");
LogUtil.info("手动添加任务失败");
}
}
......@@ -500,47 +316,11 @@ namespace AGVControl
}
catch (Exception ex)
{
Common.log.Error("手动添加任务失败:" + ex.Message);
}
}
private void button1_Click(object sender, EventArgs e)
{
if (DgvAgv.SelectedCells.Count == 0) return;
int idx = DgvAgv.SelectedCells[0].RowIndex;
if (idx < 0) return;
if (Common.agvInfo[idx].IsCon)
{
Common.agvInfo[idx].IsExistShelf = !Common.agvInfo[idx].IsExistShelf;
Common.LogInfo("手动设置 " + Common.agvInfo[idx].Name + " 负载状态=" + Common.agvInfo[idx].IsExistShelf);
}
}
private void button1_Click_1(object sender, EventArgs e)
{
if (DgvAgv.SelectedCells.Count == 0) return;
int idx = DgvAgv.SelectedCells[0].RowIndex;
if (idx < 0) return;
if (Common.agvInfo[idx].IsCon)
{
Common.agvInfo[idx].CurJob = new ChargeJob("");
return;
//Common.agvInfo[idx].TaskSend = LstAgvPlace.Text;
LogUtil.error("手动添加任务失败:" + ex.Message);
}
}
private void button2_Click(object sender, EventArgs e)
{
if (DgvAgv.SelectedCells.Count == 0) return;
int idx = DgvAgv.SelectedCells[0].RowIndex;
if (idx < 0) return;
if (Common.agvInfo[idx].IsCon)
{
Common.agvInfo[idx].CurJob = new EmptyAGVBackJob("");
return;
}
}
private void btnWO_Click(object sender, EventArgs e)
{
......@@ -548,12 +328,12 @@ namespace AGVControl
{
Task.Factory.StartNew(new Action(() =>
{
if (AGVManager.FindCurSO(out AGVManager.WOData woData))
if (HttpManager.FindCurSO(out HttpManager.WOData woData))
{
if (Common.GetNodeNameByLineName(woData.line, out string loc))
if (AGVManager.GetNodeNameByLineName(woData.line, out string loc))
{
Common.doubleLine_WO = "工单料信息:" + woData.ToTxt(loc);
Common.LogInfo(Common.doubleLine_WO);
AGVManager.doubleLine_WO = "工单料信息:" + woData.ToTxt(loc);
LogUtil.info(AGVManager.doubleLine_WO);
}
}
}));
......@@ -575,10 +355,10 @@ namespace AGVControl
{
Task.Factory.StartNew(() =>
{
int idx = Common.nodeInfo.FindIndex(s => s.Name.Equals(SettingString.A6));
int idx = AGVManager.nodeInfo.FindIndex(s => s.Name.Equals(SettingString.A6));
if (idx > -1)
{
AGVManager.FindFullShelfTarget(Common.nodeInfo[idx].RFID, out AGVManager.BoxDestInfo FullShelfDestInfo);
HttpManager.FindFullShelfTarget(AGVManager.nodeInfo[idx].RFID, out HttpManager.BoxDestInfo FullShelfDestInfo);
}
});
......@@ -589,25 +369,6 @@ namespace AGVControl
}
}
private void button9_Click(object sender, EventArgs e)
{
if (DgvAgv.SelectedCells.Count == 0) return;
int idx = DgvAgv.SelectedCells[0].RowIndex;
if (idx < 0) return;
if (Common.agvInfo[idx].IsCon)
{
Common.agvInfo[idx].CurJob = null;
}
}
private void button1_Click_2(object sender, EventArgs e)
{
if (DgvAgv.SelectedCells.Count == 0) return;
int idx = DgvAgv.SelectedCells[0].RowIndex;
if (idx < 0) return;
Common.CalculateNearNode(Common.agvInfo[idx], SettingString.D4_Name_Prefix);
}
private void btnUpdateStatus_Click(object sender, EventArgs e)
{
......@@ -615,9 +376,9 @@ namespace AGVControl
{
Task.Factory.StartNew(() =>
{
bool rtn = AGVManager.UpdateStatus(txtBoxRFID.Text.ToUpper(), txtBoxLineName.Text.ToUpper());
bool rtn = HttpManager.UpdateStatus(txtBoxRFID.Text.ToUpper(), txtBoxLineName.Text.ToUpper());
this.Invoke(new Action(() => { label11.Text = rtn ? "状态上报成功" : "状态上报失败"; }));
Common.LogInfo(string.Format("手动上报状态 产线{0} 物料状态更新成功[{1}]", txtBoxLineName.Text.ToUpper(), txtBoxRFID.Text.ToUpper()));
LogUtil.info(string.Format("手动上报状态 产线{0} 物料状态更新成功[{1}]", txtBoxLineName.Text.ToUpper(), txtBoxRFID.Text.ToUpper()));
txtBoxLineName.Text = "";
txtBoxRFID.Text = "";
});
......@@ -628,40 +389,6 @@ namespace AGVControl
}
}
private void btnClearC4StandyInfo_Click(object sender, EventArgs e)
{
Common.StandbyStation.C4_Station1 = "";
Common.StandbyStation.C4_Station2 = "";
}
private void btnReSendTask_Click(object sender, EventArgs e)
{
if (DgvAgv.SelectedCells.Count == 0) return;
int idx = DgvAgv.SelectedCells[0].RowIndex;
if (idx < 0) return;
if (Common.agvInfo[idx].IsCon)
{
if (Common.agvInfo[idx].IsUse)
{
if (MessageBox.Show("确定在自动模式下对小车重发任务?", Common.agvInfo[idx].Name, MessageBoxButtons.YesNo) == DialogResult.No)
return;
Common.agvInfo[idx].Resend();
Common.mir.State_Ready(Common.agvInfo[idx]);
//Common.agvInfo[idx].TaskSend = LstAgvPlace.Text;
Common.LogInfo("手动重发任务:[" + Common.agvInfo[idx].Name + "][" + Common.agvInfo[idx].CurTaskName + "]");
}
////清除4c临时待机位的占用
//if (Common.agvInfo[idx].Name.Equals(Common.StandbyStation.C4_Station1))
//{
// Common.StandbyStation.C4_Station1 = "";
//}
//else if (Common.agvInfo[idx].Name.Equals(Common.StandbyStation.C4_Station2))
//{
// Common.StandbyStation.C4_Station2 = "";
//}
DgvAgv.Rows[idx].SetValues(Common.agvInfo[idx].ToRow());
}
}
private void btnGetStationRfid_Click(object sender, EventArgs e)
{
......@@ -670,7 +397,7 @@ namespace AGVControl
try
{
Task.Factory.StartNew(new Action(() => {
string res = AGVManager.GetRFIDs(txtBoxLineName.Text.ToUpper());
string res = HttpManager.GetRFIDs(txtBoxLineName.Text.ToUpper());
this.Invoke(new Action(() => { label11.Text = string.Format("由里到外料架顺序:{0}", res); }));
}));
}
......@@ -684,36 +411,16 @@ namespace AGVControl
try
{
Task.Factory.StartNew(new Action(() => {
bool rtn = AGVManager.ClearRFID(txtBoxLineName.Text.ToUpper(), txtBoxRFID.Text.ToUpper());
bool rtn = HttpManager.ClearRFID(txtBoxLineName.Text.ToUpper(), txtBoxRFID.Text.ToUpper());
this.Invoke(new Action(() => { label11.Text = rtn ? "清除接驳RFID成功:" + txtBoxLineName.Text + " " + txtBoxRFID.Text : "清除接驳RFID失败:" + txtBoxLineName.Text + " " + txtBoxRFID.Text; }));
txtBoxLineName.Text = "";
txtBoxRFID.Text = "";
Common.LogInfo(rtn ? "手动清除接驳RFID成功:" + txtBoxLineName.Text + " " + txtBoxRFID.Text : "手动清除接驳RFID失败:" + txtBoxLineName.Text + " " + txtBoxRFID.Text);
LogUtil.info(rtn ? "手动清除接驳RFID成功:" + txtBoxLineName.Text + " " + txtBoxRFID.Text : "手动清除接驳RFID失败:" + txtBoxLineName.Text + " " + txtBoxRFID.Text);
}));
}
catch { }
}
}
/// <summary>
/// 点击小车状态刷新
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void DgvAgv_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
Invoke(new Action(() =>
{
try
{
for (int i = 0; i < Common.agvInfo.Count; i++)
{
DgvAgv.Rows[i].SetValues(Common.agvInfo[i].ToRow());
}
}
catch { }
}));
}
private void agvRemoveRfid_Click(object sender, EventArgs e)
{
......@@ -723,9 +430,9 @@ namespace AGVControl
{
if(txtBoxRFID.Text.StartsWith("C") || txtBoxRFID.Text.StartsWith("D"))
{
bool rtn = AGVManager.AgvRemoveRfid(txtBoxRFID.Text.ToUpper());
bool rtn = HttpManager.AgvRemoveRfid(txtBoxRFID.Text.ToUpper());
this.Invoke(new Action(() => { label11.Text = rtn ? "清理料架的缓存信息成功" : "清理料架的缓存信息失败"; }));
Common.LogInfo(string.Format("手动清理料架的缓存信息成功[{0}]", txtBoxRFID.Text.ToUpper()));
LogUtil.info(string.Format("手动清理料架的缓存信息成功[{0}]", txtBoxRFID.Text.ToUpper()));
}
txtBoxLineName.Text = "";
txtBoxRFID.Text = "";
......@@ -736,5 +443,26 @@ namespace AGVControl
}
}
private void AddForm(string text, Form form)
{
text = text.PadLeft(10, ' ');
TabPage lineTabPage = new TabPage(text);
// lineTabPage.AutoScroll = true;
// lineTabPage.Tag = lineBean;
Panel linePan = new Panel();
linePan.Dock = DockStyle.Fill;
linePan.AutoScroll = true;
lineTabPage.Controls.Add(linePan);
form.FormBorderStyle = FormBorderStyle.None;
form.TopLevel = false;
linePan.Controls.Add(form);
//form.Dock = DockStyle.Fill;
//linePan.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left)));
//form.Anchor = ((AnchorStyles)((AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Left)));
form.Show();
// tabPageList.Add(lineTabPage);
tabControlManual.Controls.Add(lineTabPage);
}
}
}
......@@ -117,39 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column14.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column21.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column18.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column23.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column13.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column19.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column11.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
......@@ -174,6 +141,22 @@
<metadata name="Column16.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="label12.Text" xml:space="preserve">
<value>说明:
·小车/任务状态:
Wait=已发送任务,还未获取到最新状态
Executing=正在执行任务
None=空闲状态
Done=任务完成
Aborted=任务中止
Unknown=软件获取小车状态失败
·获取接驳台RFID:获取指定产线上的料架RFID信息
·物料状态上报:上报料车的产线信息
·清除接驳台RFID:清理指定产线的RFID信息
·清理料架的缓存信息:输入RFID,清除RFID的缓存信息,使料架可以复用
</value>
</data>
<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>
......
namespace AGVControl
{
partial class Manual
{
/// <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(Manual));
this.panelInfo = new System.Windows.Forms.Panel();
this.lblInfo = new System.Windows.Forms.Label();
this.grpBxRunMode = new System.Windows.Forms.GroupBox();
this.chkBxAuto = new System.Windows.Forms.CheckBox();
this.btnReSendTask = new System.Windows.Forms.Button();
this.grpBxOperation = new System.Windows.Forms.GroupBox();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.btnReady = new System.Windows.Forms.Button();
this.btnPause = new System.Windows.Forms.Button();
this.btnClearErr = new System.Windows.Forms.Button();
this.grpBxMission = new System.Windows.Forms.GroupBox();
this.btnAssignTask = new System.Windows.Forms.Button();
this.cmbBxMission = new System.Windows.Forms.ComboBox();
this.panelInfo.SuspendLayout();
this.grpBxRunMode.SuspendLayout();
this.grpBxOperation.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.grpBxMission.SuspendLayout();
this.SuspendLayout();
//
// panelInfo
//
this.panelInfo.Controls.Add(this.lblInfo);
this.panelInfo.Dock = System.Windows.Forms.DockStyle.Top;
this.panelInfo.Location = new System.Drawing.Point(0, 0);
this.panelInfo.Name = "panelInfo";
this.panelInfo.Size = new System.Drawing.Size(385, 43);
this.panelInfo.TabIndex = 0;
//
// lblInfo
//
this.lblInfo.BackColor = System.Drawing.Color.LightBlue;
this.lblInfo.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblInfo.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblInfo.Location = new System.Drawing.Point(0, 0);
this.lblInfo.Name = "lblInfo";
this.lblInfo.Size = new System.Drawing.Size(385, 43);
this.lblInfo.TabIndex = 0;
this.lblInfo.Text = "#号车";
this.lblInfo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// grpBxRunMode
//
this.grpBxRunMode.Controls.Add(this.chkBxAuto);
this.grpBxRunMode.Controls.Add(this.btnReSendTask);
this.grpBxRunMode.Dock = System.Windows.Forms.DockStyle.Top;
this.grpBxRunMode.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.grpBxRunMode.Location = new System.Drawing.Point(0, 43);
this.grpBxRunMode.Name = "grpBxRunMode";
this.grpBxRunMode.Size = new System.Drawing.Size(385, 70);
this.grpBxRunMode.TabIndex = 1;
this.grpBxRunMode.TabStop = false;
this.grpBxRunMode.Text = "模式选择";
//
// chkBxAuto
//
this.chkBxAuto.AutoSize = true;
this.chkBxAuto.Location = new System.Drawing.Point(7, 21);
this.chkBxAuto.Name = "chkBxAuto";
this.chkBxAuto.Size = new System.Drawing.Size(76, 16);
this.chkBxAuto.TabIndex = 0;
this.chkBxAuto.Text = "自动模式";
this.chkBxAuto.UseVisualStyleBackColor = true;
this.chkBxAuto.CheckedChanged += new System.EventHandler(this.chkBxAuto_CheckedChanged);
//
// btnReSendTask
//
this.btnReSendTask.Location = new System.Drawing.Point(251, 11);
this.btnReSendTask.Name = "btnReSendTask";
this.btnReSendTask.Size = new System.Drawing.Size(75, 53);
this.btnReSendTask.TabIndex = 3;
this.btnReSendTask.Text = "任务重发";
this.btnReSendTask.UseVisualStyleBackColor = true;
this.btnReSendTask.Click += new System.EventHandler(this.btnReSendTask_Click);
//
// grpBxOperation
//
this.grpBxOperation.Controls.Add(this.flowLayoutPanel1);
this.grpBxOperation.Dock = System.Windows.Forms.DockStyle.Top;
this.grpBxOperation.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.grpBxOperation.Location = new System.Drawing.Point(0, 113);
this.grpBxOperation.Name = "grpBxOperation";
this.grpBxOperation.Size = new System.Drawing.Size(385, 108);
this.grpBxOperation.TabIndex = 2;
this.grpBxOperation.TabStop = false;
this.grpBxOperation.Text = "操作";
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.btnReady);
this.flowLayoutPanel1.Controls.Add(this.btnPause);
this.flowLayoutPanel1.Controls.Add(this.btnClearErr);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 17);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(379, 88);
this.flowLayoutPanel1.TabIndex = 0;
//
// btnReady
//
this.btnReady.BackColor = System.Drawing.Color.Lime;
this.btnReady.Location = new System.Drawing.Point(30, 3);
this.btnReady.Margin = new System.Windows.Forms.Padding(30, 3, 5, 3);
this.btnReady.Name = "btnReady";
this.btnReady.Size = new System.Drawing.Size(88, 61);
this.btnReady.TabIndex = 0;
this.btnReady.Text = "运行";
this.btnReady.UseVisualStyleBackColor = false;
this.btnReady.Click += new System.EventHandler(this.btnReady_Click);
//
// btnPause
//
this.btnPause.BackColor = System.Drawing.Color.Red;
this.btnPause.Location = new System.Drawing.Point(153, 3);
this.btnPause.Margin = new System.Windows.Forms.Padding(30, 3, 3, 3);
this.btnPause.Name = "btnPause";
this.btnPause.Size = new System.Drawing.Size(88, 61);
this.btnPause.TabIndex = 1;
this.btnPause.Text = "暂停";
this.btnPause.UseVisualStyleBackColor = false;
this.btnPause.Click += new System.EventHandler(this.btnPause_Click);
//
// btnClearErr
//
this.btnClearErr.BackColor = System.Drawing.Color.Yellow;
this.btnClearErr.Location = new System.Drawing.Point(274, 3);
this.btnClearErr.Margin = new System.Windows.Forms.Padding(30, 3, 3, 3);
this.btnClearErr.Name = "btnClearErr";
this.btnClearErr.Size = new System.Drawing.Size(88, 61);
this.btnClearErr.TabIndex = 2;
this.btnClearErr.Text = "清除错误";
this.btnClearErr.UseVisualStyleBackColor = false;
this.btnClearErr.Click += new System.EventHandler(this.btnClearErr_Click);
//
// grpBxMission
//
this.grpBxMission.Controls.Add(this.btnAssignTask);
this.grpBxMission.Controls.Add(this.cmbBxMission);
this.grpBxMission.Dock = System.Windows.Forms.DockStyle.Top;
this.grpBxMission.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.grpBxMission.Location = new System.Drawing.Point(0, 221);
this.grpBxMission.Name = "grpBxMission";
this.grpBxMission.Size = new System.Drawing.Size(385, 70);
this.grpBxMission.TabIndex = 3;
this.grpBxMission.TabStop = false;
this.grpBxMission.Text = "手动任务";
//
// btnAssignTask
//
this.btnAssignTask.Location = new System.Drawing.Point(216, 12);
this.btnAssignTask.Name = "btnAssignTask";
this.btnAssignTask.Size = new System.Drawing.Size(131, 35);
this.btnAssignTask.TabIndex = 1;
this.btnAssignTask.Text = "发任务";
this.btnAssignTask.UseVisualStyleBackColor = true;
this.btnAssignTask.Click += new System.EventHandler(this.btnAssignTask_Click);
//
// cmbBxMission
//
this.cmbBxMission.FormattingEnabled = true;
this.cmbBxMission.Location = new System.Drawing.Point(12, 20);
this.cmbBxMission.Name = "cmbBxMission";
this.cmbBxMission.Size = new System.Drawing.Size(159, 20);
this.cmbBxMission.TabIndex = 0;
//
// Manual
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(385, 297);
this.Controls.Add(this.grpBxMission);
this.Controls.Add(this.grpBxOperation);
this.Controls.Add(this.grpBxRunMode);
this.Controls.Add(this.panelInfo);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Manual";
this.Load += new System.EventHandler(this.Manual_Load);
this.panelInfo.ResumeLayout(false);
this.grpBxRunMode.ResumeLayout(false);
this.grpBxRunMode.PerformLayout();
this.grpBxOperation.ResumeLayout(false);
this.flowLayoutPanel1.ResumeLayout(false);
this.grpBxMission.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panelInfo;
private System.Windows.Forms.Label lblInfo;
private System.Windows.Forms.GroupBox grpBxRunMode;
private System.Windows.Forms.CheckBox chkBxAuto;
private System.Windows.Forms.GroupBox grpBxOperation;
private System.Windows.Forms.Button btnReady;
private System.Windows.Forms.Button btnPause;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.Button btnReSendTask;
private System.Windows.Forms.Button btnClearErr;
private System.Windows.Forms.GroupBox grpBxMission;
private System.Windows.Forms.Button btnAssignTask;
private System.Windows.Forms.ComboBox cmbBxMission;
}
}
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;
chkBxAuto.Checked = agv.IsUse;
btnReSendTask.Enabled = agv.IsUse;
btnAssignTask.Enabled = !agv.IsUse;
}
Agv_Info Agv;
private bool isIni = false;
private void Manual_Load(object sender, EventArgs e)
{
lblInfo.Text = string.Format("[{0}]", Agv.IP);
foreach (Mission mission in MissionSys.Missions)
{
cmbBxMission.Items.Add(mission.AliceName);
}
cmbBxMission.SelectedIndex = 0;
isIni = true;
}
private void chkBxAuto_CheckedChanged(object sender, EventArgs e)
{
if (!isIni) return;
this.Invoke(new Action(() =>
{
btnReSendTask.Enabled = chkBxAuto.Checked;
btnAssignTask.Enabled = !chkBxAuto.Checked;
Agv.IsUse = chkBxAuto.Checked;
if (!chkBxAuto.Checked)
{
Agv.CurJob = null;
//AGVManager.Standby.DelOccupyInfo(Agv);
AGVManager.Charge.DelOccupyInfo(Agv);
//添加Init任务
MissionSys.AssignMission(Agv, SettingString.Init);
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 = "";
}
}));
}
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
using BLL;
using log4net.Config;
using log4net.Config;
using log4net.Util.TypeConverters;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common;
using System.Windows.Forms;
using DeviceLibrary;
namespace AGVControl
{
static class Program
......@@ -35,107 +34,42 @@ namespace AGVControl
if (process.MainModule.FileName == current.MainModule.FileName)
{
//显示已打开的程序
API.ShowWindow(process.MainWindowHandle, API.SW_RESTORE);
API.SwitchToThisWindow(process.MainWindowHandle, true);
Window_API.ShowWindow(process.MainWindowHandle, Window_API.SW_RESTORE);
Window_API.SwitchToThisWindow(process.MainWindowHandle, true);
return;
}
}
//Common.logTextBox = new TextBox();
//Common.missionView = new DataGridView();
Common.log = log4net.LogManager.GetLogger("AgvServer");
Common.log.Info("=====程序开始=====");
ReadConfig();
//Common.ReadUnlockLineInfo();
Common.mir = new MiR_API();
Common.control = new BLL.Control();
LogUtil.info("=====程序开始=====");
AGVManager.Init();
AGVManager.control = new DeviceLibrary.Control();
//获取节点位置
Common.GetNodesPosition();
Common.control.Start();
Common.server = new AgvServer();
Common.server.Start();
Common.web = new WebService();
Common.web.Open(Common.appConfig.AppSettings.Settings["WebService"].Value);
AGVManager.GetNodesPosition();
AGVManager.control.Start();
AGVManager.server = new AgvServer();
AGVManager.server.Start();
AGVManager.web = new WebService();
AGVManager.web.Open(AppConfigHelper.GetValue("WebService"));
Application.Run(new FrmMain());
Common.control.Stop();
Common.server.Stop();
Common.web.Close();
Common.log.Info("=====程序结束=====\r\n");
AGVManager.control.Stop();
AGVManager.server.Stop();
AGVManager.web.Close();
LogUtil.info("=====程序结束=====\r\n");
}
private static void ReadConfig()
{
string path;
string[] line;
string[] temp;
bool isuse;
string rfid = "";
Common.appConfig = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.None);
Common.agvInfo = new List<Agv_Info>();
path = Common.CONFIG_PATH + SettingString.FileName_AGV;
line = System.IO.File.ReadAllLines(path, Encoding.UTF8);
for (int i = 1; i < line.Length; i++)
{
temp = line[i].Split(',');
if (temp.Length != 5) continue;
//string val = Common.appConfig.AppSettings.Settings[temp[1]].Value;
bool.TryParse(Common.ReadIni(temp[1], SettingString.IsUse), out isuse); //Convert.ToBoolean(val.Split(',')[0]);
rfid = Common.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));
}
Common.agvMission = new Dictionary<string, string>();
Common.showNameMissionName = new Dictionary<string, string>();
path = Common.CONFIG_PATH + SettingString.FileName_AgvMission;
line = System.IO.File.ReadAllLines(path, Encoding.UTF8);
for (int i = 1; i < line.Length; i++)
{
temp = line[i].Split(',');
if (temp.Length != 3) continue;
Common.agvMission.Add(temp[1], temp[2]);
Common.showNameMissionName.Add(temp[0], temp[1]);
}
Common.nodeInfo = new List<ClientNode>();
path = Common.CONFIG_PATH + SettingString.FileName_AgvProductionLine;
line = System.IO.File.ReadAllLines(path, Encoding.GetEncoding("gb2312"));
for (int i = 1; i < line.Length; i++)
{
temp = line[i].Split(',');
if (temp.Length != 6) continue;
Boolean.TryParse(Common.ReadIni(temp[1], SettingString.IsUse), out bool isUse);
Int32.TryParse(Common.ReadIni(temp[1], SettingString.EmptyShelfCnt), out int emptyShelfCnt);
if (temp[1].Equals("A5"))
{
Common.nodeInfo.Add(new DoubleLineNodeFor4C(temp[1], temp[2], temp[3], temp[0], temp[4], temp[5], isUse, emptyShelfCnt));
}
else if (temp[1].Equals("A6"))
{
Common.nodeInfo.Add(new DoubleLineNodeFor4D(temp[1], temp[2], temp[3], temp[0], temp[4], temp[5], isUse, emptyShelfCnt));
}
else
Common.nodeInfo.Add(new ClientNode(temp[1], temp[2], temp[3], temp[0], temp[4], temp[5], isUse, emptyShelfCnt));
}
Common.chargeStatus = new ChargeStatus();
Common.itsHttp = Common.appConfig.AppSettings.Settings["ITS"].Value;
}
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)
{
Common.log.Error("Application_ThreadException", e.Exception);
LogUtil.error("Application_ThreadException", e.Exception);
}
}
......
......@@ -38,7 +38,7 @@ namespace AGV_UI
{
foreach (string item in missionShow.Keys)
{
ShowInfo(item, item);
ShowInfo(item, "");
}
SetTitle();
}
......
......@@ -20,6 +20,7 @@ namespace Common
public const string AutoCharge = "AutoCharge";
public const string Leave = "Leave";
public const string Enter = "Enter";
public const string Init = "Init";
//任务状态
public const string Wait = "Wait";
public const string Done = "Done";
......
......@@ -88,12 +88,12 @@ namespace DeviceLibrary
public Dictionary<string, DateTime> readyLeaveTime = new Dictionary<string, DateTime>();
public bool ReadyEnter(string nodeName, string rfid = "")
{
int nodeIdx = Common.nodeInfo.FindIndex(s => s.Name == nodeName);
string ip = Common.nodeInfo[nodeIdx].IP;
int nodeIdx = AGVManager.nodeInfo.FindIndex(s => s.Name == nodeName);
string ip = AGVManager.nodeInfo[nodeIdx].IP;
int idx = FindClient(ip);
if (idx == -1)
{
Common.LogInfo("ReadyEnter 没有找到" + nodeName + " " + ip);
log.Error("ReadyEnter 没有找到" + nodeName + " " + ip);
return false;
}
else
......@@ -109,7 +109,7 @@ namespace DeviceLibrary
TimeSpan timeSpan = DateTime.Now - readyEnterTime[nodeName];
if (timeSpan.TotalSeconds < 45)
{
Common.log.Debug(nodeName + " " + ip + " ReadyEnter 45秒内不重复发送");
log.Debug(nodeName + " " + ip + " ReadyEnter 45秒内不重复发送");
return false;
}
else if (timeSpan.TotalMinutes > 2)
......@@ -118,7 +118,7 @@ namespace DeviceLibrary
}
}
}
catch (Exception ex) { Common.log.Debug(ex.Message + ";" + ex.StackTrace); }
catch (Exception ex) { log.Debug(ex.Message + ";" + ex.StackTrace); }
ClientNode node = new ClientNode(nodeName, rfid, eNodeStatus.ReadyEnter);
byte[] buff = Encode(node);
......@@ -128,12 +128,12 @@ namespace DeviceLibrary
public bool ReadyLeave(string nodeName, string rfid = "")
{
int nodeIdx = Common.nodeInfo.FindIndex(s => s.Name == nodeName);
string ip = Common.nodeInfo[nodeIdx].IP;
int nodeIdx = AGVManager.nodeInfo.FindIndex(s => s.Name == nodeName);
string ip = AGVManager.nodeInfo[nodeIdx].IP;
int idx = FindClient(ip);
if (idx == -1)
{
Common.LogInfo("ReadyLeave 没有找到" + nodeName + " " + ip);
log.Error("ReadyLeave 没有找到" + nodeName + " " + ip);
return false;
}
else
......@@ -149,7 +149,7 @@ namespace DeviceLibrary
TimeSpan timeSpan = DateTime.Now - readyLeaveTime[nodeName];
if (timeSpan.TotalSeconds < 45)
{
Common.log.Debug(nodeName + " " + ip + " ReadyLeave 45秒内不重复发送");
log.Debug(nodeName + " " + ip + " ReadyLeave 45秒内不重复发送");
return false;
}
else if (timeSpan.TotalMinutes > 3)
......@@ -158,7 +158,7 @@ namespace DeviceLibrary
}
}
}
catch (Exception ex) { Common.log.Debug(ex.Message + ";" + ex.StackTrace); }
catch (Exception ex) { log.Debug(ex.Message + ";" + ex.StackTrace); }
ClientNode node = new ClientNode(nodeName, rfid, eNodeStatus.ReadyLeave);
byte[] buff = Encode(node);
......@@ -168,12 +168,12 @@ namespace DeviceLibrary
public bool FinishEnter(string nodeName, string rfid = "")
{
int nodeIdx = Common.nodeInfo.FindIndex(s => s.Name == nodeName);
string ip = Common.nodeInfo[nodeIdx].IP;
int nodeIdx = AGVManager.nodeInfo.FindIndex(s => s.Name == nodeName);
string ip = AGVManager.nodeInfo[nodeIdx].IP;
int idx = FindClient(ip);
if (idx == -1)
{
Common.LogInfo("FinishEnter 没有找到" + nodeName + " " + ip);
log.Error("FinishEnter 没有找到" + nodeName + " " + ip);
return false;
}
else
......@@ -186,12 +186,12 @@ namespace DeviceLibrary
public bool FinishLeave(string nodeName, string rfid = "")
{
int nodeIdx = Common.nodeInfo.FindIndex(s => s.Name == nodeName);
string ip = Common.nodeInfo[nodeIdx].IP;
int nodeIdx = AGVManager.nodeInfo.FindIndex(s => s.Name == nodeName);
string ip = AGVManager.nodeInfo[nodeIdx].IP;
int idx = FindClient(ip);
if (idx == -1)
{
Common.LogInfo("FinishLeave 没有找到" + nodeName + " " + ip);
log.Error("FinishLeave 没有找到" + nodeName + " " + ip);
return false;
}
else
......@@ -217,7 +217,7 @@ namespace DeviceLibrary
if (!_loop) return;
}
foreach (ClientNode clientNode in Common.nodeInfo)
foreach (ClientNode clientNode in AGVManager.nodeInfo)
{
n = 0;
while (n < 300) //每条产线间隔
......@@ -230,9 +230,9 @@ namespace DeviceLibrary
int idx = FindClient(clientNode.IP);
if (idx == -1)
{
Common.log.Debug("KeepLive 没有找到" + clientNode.Name);
int index = Common.nodeInfo.IndexOf(clientNode);
Common.nodeInfo[index].Online = false;
log.Debug("KeepLive 没有找到" + clientNode.Name);
int index = AGVManager.nodeInfo.IndexOf(clientNode);
AGVManager.nodeInfo[index].Online = false;
continue;
}
else
......@@ -240,22 +240,22 @@ namespace DeviceLibrary
if (clientNode.StateEquals(eNodeStatus.None))
{
byte[] buff = new byte[] { 0X00, 0X00 };
int index = Common.nodeInfo.IndexOf(clientNode);
int index = AGVManager.nodeInfo.IndexOf(clientNode);
if (!Send(idx, buff))
{
Common.nodeInfo[index].Online = false;
Common.log.Debug(clientNode.Name + " KeepLive 发送失败");
AGVManager.nodeInfo[index].Online = false;
log.Debug(clientNode.Name + " KeepLive 发送失败");
}
else
{
Common.nodeInfo[index].Online = true;
Common.log.Debug(clientNode.Name + " KeepLive 发送成功");
AGVManager.nodeInfo[index].Online = true;
log.Debug(clientNode.Name + " KeepLive 发送成功");
}
}
}
NodeOnline?.Invoke(Common.nodeInfo.IndexOf(clientNode));
NodeChanged?.Invoke(Common.nodeInfo.IndexOf(clientNode));
NodeOnline?.Invoke(AGVManager.nodeInfo.IndexOf(clientNode));
NodeChanged?.Invoke(AGVManager.nodeInfo.IndexOf(clientNode));
}
//for (int i = 0; i < Common.nodeInfo.Count; i++)
......@@ -286,7 +286,7 @@ namespace DeviceLibrary
bool rtn = System.Text.RegularExpressions.Regex.IsMatch(ip, pattern);
if (!rtn)
{
Common.LogInfo("非法的IP地址" + ip);
log.Error("非法的IP地址" + ip);
return false;
}
......@@ -298,14 +298,14 @@ namespace DeviceLibrary
ping.Dispose();
if (result.Status != System.Net.NetworkInformation.IPStatus.Success)
{
Common.log.Debug(name + " Ping " + ip + " 请求没有响应");
log.Debug(name + " Ping " + ip + " 请求没有响应");
return false;
}
return true;
}
catch (Exception ex)
{
Common.log.Error("CheckIP", ex);
log.Error("CheckIP", ex);
return false;
}
}
......@@ -350,16 +350,16 @@ namespace DeviceLibrary
_client.Add(client);
listen.Start(_client.Count - 1);
Common.log.Debug(string.Format("[{0}] 已连接", client.IP));
log.Debug(string.Format("[{0}] 已连接", client.IP));
}
catch (SocketException)
{
//关闭连接,退出阻塞Accept
Common.LogInfo("服务端关闭连接,退出阻塞Accept");
log.Debug("服务端关闭连接,退出阻塞Accept");
}
catch (Exception ex)
{
Common.log.Error("ListenClient()", ex);
log.Error("ListenClient()", ex);
}
}
}
......@@ -391,12 +391,12 @@ namespace DeviceLibrary
ClientNode node = Decode(client, buff);
if (node == null)
{
Common.log.Debug(client.IP + " 解码失败:" + HexBuff(buff));
log.Debug(client.IP + " 解码失败:" + HexBuff(buff));
}
else
{
Common.log.Debug(client.IP + " 解码内容:" + HexBuff(buff));
Common.log.Debug("Receive[" + client.IP + "] " + node.StatetText());
log.Debug(client.IP + " 解码内容:" + HexBuff(buff));
log.Debug("Receive[" + client.IP + "] " + node.StatetText());
int idx = client.nodeName.FindIndex(s => s == node.Name);
if (idx == -1) client.nodeName.Add(node.Name);
UpdateNode(node);
......@@ -408,13 +408,13 @@ namespace DeviceLibrary
if (time > 120000)
{
Offline(client);
Common.log.Debug("[" + client.IP + "] 超过2分钟没有收到数据,关闭连接");
log.Debug("[" + client.IP + "] 超过2分钟没有收到数据,关闭连接");
}
}
}
catch (Exception ex)
{
Common.log.Error("ListenNet()", ex);
log.Error("ListenNet()", ex);
}
}
......@@ -457,10 +457,10 @@ namespace DeviceLibrary
if (buff[idx++] != 0xAD) return null;
if (buff[idx] == 0x00 && buff[idx + 1] == 0x00)//收到产线
{
int k = Common.nodeInfo.FindIndex(s => client.IP.Contains(s.IP) && !s.Name.StartsWith("A"));
int k = AGVManager.nodeInfo.FindIndex(s => client.IP.Contains(s.IP) && !s.Name.StartsWith("A"));
if (k > -1)
{
name = Common.nodeInfo[k].Name;
name = AGVManager.nodeInfo[k].Name;
rfid = "";
}
idx += 2;
......@@ -487,27 +487,27 @@ namespace DeviceLibrary
private void UpdateNode(ClientNode node)
{
int idx = Common.nodeInfo.FindIndex(s => s.Name == node.Name);
int idx = AGVManager.nodeInfo.FindIndex(s => s.Name == node.Name);
if (idx == -1)
{
Common.log.Error("UpdateNode " + node.Name + " 不存在");
log.Error("UpdateNode " + node.Name + " 不存在");
return;
}
if (!Common.nodeInfo[idx].Online)
if (!AGVManager.nodeInfo[idx].Online)
{
Common.nodeInfo[idx].Online = true;
AGVManager.nodeInfo[idx].Online = true;
NodeOnline?.Invoke(idx);
}
if (!Common.nodeInfo[idx].StateEquals(node.GetState()) ||
Common.nodeInfo[idx].RFID != node.RFID || Common.nodeInfo[idx].ClientLevel != node.ClientLevel)
if (!AGVManager.nodeInfo[idx].StateEquals(node.GetState()) ||
AGVManager.nodeInfo[idx].RFID != node.RFID || AGVManager.nodeInfo[idx].ClientLevel != node.ClientLevel)
{
Common.nodeInfo[idx].UpdateNodeStatus(node.GetState());
Common.nodeInfo[idx].ClientLevel = node.ClientLevel;
Common.nodeInfo[idx].RFID = node.RFID;
Common.LogInfo("节点更新 " + node.StatetText());
AGVManager.nodeInfo[idx].UpdateNodeStatus(node.GetState());
AGVManager.nodeInfo[idx].ClientLevel = node.ClientLevel;
AGVManager.nodeInfo[idx].RFID = node.RFID;
log.Info("节点更新 " + node.StatetText());
NodeChanged?.Invoke(idx);
}
}
......@@ -520,9 +520,9 @@ namespace DeviceLibrary
for (int i = 0; i < client.nodeName.Count; i++)
{
int idx = Common.nodeInfo.FindIndex(s => s.Name == client.nodeName[i]);
int idx = AGVManager.nodeInfo.FindIndex(s => s.Name == client.nodeName[i]);
if (idx == -1) continue;
Common.nodeInfo[idx].Offline();
AGVManager.nodeInfo[idx].Offline();
NodeChanged(idx);
NodeOnline(idx);
}
......@@ -592,7 +592,7 @@ namespace DeviceLibrary
if (!_client[idx].IsConn)
{
Common.log.Error(ip + " 没有连接");
log.Error(ip + " 没有连接");
return false;
}
......@@ -600,12 +600,12 @@ namespace DeviceLibrary
{
if (_client[idx].IsConn)
_client[idx].Socket.Send(buff);
Common.log.Debug("SendTo" + ip + ": " + HexBuff(buff));
log.Debug("SendTo" + ip + ": " + HexBuff(buff));
return true;
}
catch (Exception ex)
{
Common.log.Debug("Send Error: " + ip, ex);
log.Error("Send Error: " + ip, ex);
return false;
}
}
......
......@@ -24,33 +24,12 @@ namespace DeviceLibrary
/// </summary>
public int BatteryMin { get; set; } = 20;
/// <summary>
/// 自动充电
/// </summary>
private bool _autoCharge = true;
/// <summary>
/// 自动充电
/// </summary>
public bool AutoCharge
{
set
{
_autoCharge = value;
AppConfigHelper.SaveValue(SettingString.AutoCharge, value);
}
get
{
return _autoCharge;
}
}
public ChargeManager()
{
Station = new Dictionary<string, string>();
Station.Add(AutoCharge1, "");
Station.Add(AutoCharge2, "");
_autoCharge = AppConfigHelper.GetBoolValue(SettingString.AutoCharge);
string s = AppConfigHelper.GetValue(SettingString.ChargeThreshold);
string[] arr = s.Split(',');
BatteryMin = Convert.ToInt32(arr[0]);
......@@ -75,35 +54,11 @@ namespace DeviceLibrary
private static object loc = new object();
/// <summary>
/// 清除占用信息
/// </summary>
/// <param name="chargeName"></param>
/// <returns></returns>
public bool DelOccupyInfo(string agvName)
{
lock(loc)
{
if (Station.Values.Contains(agvName))
{
foreach (string item in Station.Keys)
{
if (Station[item].Equals(agvName))
{
Station[item] = "";
return true;
}
}
}
}
return false;
}
/// <summary>
/// 清除agv占用信息
/// </summary>
/// <param name="chargeName"></param>
/// <returns></returns>
public void DelOccupyInfoByAGV(Agv_Info agv)
public void DelOccupyInfo(Agv_Info agv)
{
lock(loc)
{
......@@ -112,6 +67,7 @@ namespace DeviceLibrary
if (Station[item].Equals(agv.Name))
{
Station[item] = "";
agv.IsInCharge = false;
break;
}
}
......@@ -132,7 +88,11 @@ namespace DeviceLibrary
}
}
/// <summary>
/// 检查充电桩是否有小车占用
/// </summary>
/// <param name="agv"></param>
/// <returns></returns>
public bool HasEmptyChargeStation(Agv_Info agv)
{
lock(loc)
......@@ -146,13 +106,6 @@ namespace DeviceLibrary
return true;
}
}
//foreach (string item in Station.Keys)
//{
// if (Station[item].Equals(""))
// {
// return true;
// }
//}
}
return false;
}
......@@ -180,6 +133,8 @@ namespace DeviceLibrary
log = string.Format("{0} {1}", agv.Name, chargeStation);
LogUtil.info(log);
MiR_API.State_Ready(agv);
agv.IsInCharge = true;
return true;
}
else
{
......@@ -187,7 +142,7 @@ namespace DeviceLibrary
log = string.Format("{0} {1}失败", agv.Name, chargeStation);
LogUtil.info(log);
}
return true;
return false;
}
}
......
任务别称,任务名称,任务GUID
移动到VMI出口,MoveA1,eec1eed4-2a04-11ea-9c84-94c691a734f1
移动到VMI入口,MoveA2,f68f18db-2f89-11ea-9ee4-94c691a734f1
移动到包装线入口,MoveA3,979d10eb-2f9d-11ea-9ee4-94c691a734f1
移动到包装线出口,MoveA4,df6d991a-2f9d-11ea-9ee4-94c691a734f1
移动到分盘线出口,MoveA7,71e01c6d-de10-11ea-a3e4-94c691a7387d
移动到分盘线入口,MoveA8,cd0544f8-de10-11ea-a3e4-94c691a7387d
移动到包装仓10-1,MoveB1,86a6ab06-261e-11ea-a30e-94c691a73861
移动到包装仓10-2,MoveB2,55fcfdc5-2623-11ea-a30e-94c691a73861
移动到包装仓11-1,MoveB3,905399c8-2623-11ea-a30e-94c691a73861
移动到包装仓11-2,MoveB4,aa33e13a-2623-11ea-a30e-94c691a73861
移动到包装仓12-2,MoveB5,2cd36cde-2624-11ea-a30e-94c691a73861
移动到包装仓12-1,MoveB6,3e713e8b-2624-11ea-a30e-94c691a73861
停靠到包装仓10-1,DockB1,339d1830-261f-11ea-a30e-94c691a73861
停靠到包装仓10-2,DockB2,a6d6f52a-2624-11ea-a30e-94c691a73861
停靠到包装仓11-1,DockB3,b66f0714-2624-11ea-a30e-94c691a73861
停靠到包装仓11-2,DockB4,d01443f2-2624-11ea-a30e-94c691a73861
停靠到包装仓12-2,DockB5,f50dd02b-2624-11ea-a30e-94c691a73861
停靠到包装仓12-1,DockB6,0e5503f2-2625-11ea-a30e-94c691a73861
移动到料串入口C1,MoveC1,a6e36b4c-2fa0-11ea-9ee4-94c691a734f1
移动到料串出口C2,MoveC2,6c6829de-2624-11ea-a30e-94c691a73861
移动到料串入口C3,MoveC3,3ffe309f-2ae6-11ea-a6cf-94c691a734f1
移动到料串出口C4,MoveC4,2ef71347-2ae7-11ea-a6cf-94c691a734f1
移动到料串入口C5,MoveC5,34ec2f1f-2ae8-11ea-a6cf-94c691a734f1
移动到料串出口C6,MoveC6,52f37677-2f96-11ea-9ee4-94c691a734f1
移动到紧急入料口,MoveC7,bcd0e389-2ab7-11ea-a6cf-94c691a734f1
移动到紧急出料口,MoveC8,8a48301d-2624-11ea-a30e-94c691a73861
移动到点料机D1口,MoveD1,931f7c6c-a97d-11ea-b91f-94c691a7387d
移动到点料机D2口,MoveD2,ae09ca1e-a97f-11ea-b91f-94c691a7387d
移动到点料机D3口,MoveD3,97b77df3-edfb-11ea-a03e-94c691a7387d
移动到点料机D4口,MoveD4,37961cd0-edfd-11ea-a03e-94c691a7387d
移动到退料线入口,MoveG23,5dc60886-ee00-11ea-a03e-94c691a7387d
移动到退料线出口,MoveG24,9a965176-ee00-11ea-a03e-94c691a7387d
移动到待机位,MoveStandby,4eb9641a-3439-11ea-984a-94c691a734f1
移动到充电位1,AutoCharge1,9e1b33c0-2886-11ea-a0d6-94c691a734f1
移动到充电位2,AutoCharge2,d756f63d-2886-11ea-a0d6-94c691a734f1
小车进料,Enter,2eadcb87-239a-11ea-8343-94c691a73861
小车出料,Leave,80943220-239a-11ea-8343-94c691a73861
小车初始化,Init,cd51e039-34eb-11ea-b4fe-94c691a734f1
任务名称,任务别名,目的地,目的地别名,任务GUID
MoveA5,移动到双层线入口,A5,双层线入口,eec1eed4-2a04-11ea-9c84-94c691a734f1
Fleet ID,agv名称,IP,授权码,IOID
1,1号车,10.85.199.67,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,007615a5-2220-11ea-99f2-94c691a73b53
2,2号车,10.85.199.68,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,007615a5-2220-11ea-99f2-94c691a73b53
3,3号车,10.85.199.69,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,007615a5-2220-11ea-99f2-94c691a73b53
4,4号车,10.85.199.70,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,007615a5-2220-11ea-99f2-94c691a73b53
\ No newline at end of file
1,5号车,10.85.199.67,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,007615a5-2220-11ea-99f2-94c691a73b53
2,6号车,10.85.199.68,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,007615a5-2220-11ea-99f2-94c691a73b53
3,7号车,10.85.199.69,Basic ZGlzdHJpYnV0b3I6NjJmMmYwZjFlZmYxMGQzMTUyYzk1ZjZmMDU5NjU3NmU0ODJiYjhlNDQ4MDY0MzNmNGNmOTI5NzkyODM0YjAxNA==,007615a5-2220-11ea-99f2-94c691a73b53
\ No newline at end of file
节点名,别名,佳世达线名
A1,A1,VMI-A1出口
A2,A2,VMI-A2入口
A7,A7,分盘线-A7出口
A8,A8,分盘线-A8入口
T1_1,T1_1,入料T1入口
T1_2,T1_2,入料T1出口
T2_1,T2_1,入料T2入口
T2_2,T2_2,入料T2出口
T3_1,T3_1,入料T3入口
T3_2,T3_2,入料T3出口
T5_1,T5_1,入料T5入口
T5_2,T5_2,入料T5出口
T4_1,T4_1,紧急料T4入口
T4_2,T4_2,紧急料T4出口
D1,D1,点料机-D1入口
D2,D2,点料机-D2出口
D3,D3,点料机-D3口
D4,D4,点料机-D4口
\ No newline at end of file
产线名,节点名,IP,产线别名,位置名称,位置guid
A5,A5,10.85.162.40,双层线入口(A5),PA5,7ed952c3-b520-11ea-b6ad-00012998f5a0
A6,A6,10.85.162.40,双层线出(A6),PA6,929eb1c2-b520-11ea-b6ad-00012998f5a0
D3,D3,10.85.199.12,3D-S3线,DL3,43855a9b-b365-11ea-a1a5-00012999830e
D4,D4,10.85.199.15,3D-S4线,DL4,73c8b98c-b368-11ea-a1a5-00012999830e
D5,D5,10.85.199.31,3D-S5线,DL5,5436efd7-b432-11ea-a1a5-00012999830e
D6,D6,10.85.199.32,3D-S6线,DL6,6b7710c1-b432-11ea-a1a5-00012999830e
D7,D7,10.85.199.36,3D-S7线,DL6,6b7710c1-b432-11ea-a1a5-00012999830e
D8,D8,10.85.199.37,3D-S8线,DL8,8f039d2e-b432-11ea-a1a5-00012999830e
D9,D9,10.85.199.43,3D-S9线,DL9,9e0b64ab-b432-11ea-a1a5-00012999830e
D10,D10,10.85.199.44,3D-S10线,DL10,aec7da80-b432-11ea-a1a5-00012999830e
D11,D11,10.85.199.14,3D-S11线,DL11,c10984c9-b432-11ea-a1a5-00012999830e
D12,D12,10.85.199.13,3D-S12线,DL12,d6e0b92a-b432-11ea-a1a5-00012999830e
FeederIn,D21,10.85.199.1,3D-备料区入口,FI,1e546c3a-8abe-11ea-ab63-000129922ca6
FeederOut,D22,10.85.199.1,3D-备料区出口,FO,431649a4-8abe-11ea-ab63-000129922ca6
......@@ -140,8 +140,6 @@ namespace DeviceLibrary
{
//上报异常
bool isAlarm = false;
//if (msglist.Count > 0)
// msglist.Clear();
try
{
if (!CheckOnline(i)) continue;
......@@ -149,7 +147,7 @@ namespace DeviceLibrary
MiR_API.Get_Task_State(AGVManager.agvInfo[i].CurTaskID, out string stateStr);
Thread.Sleep(50);
//获取AGV状态
rtn = MiR_API.Get_State(AGVManager.agvInfo[i], out eAGVState stateID, out string stateText, out int battery, out string mission_text, out Agv_Info.clsPosition position);
rtn = MiR_API.Get_State(AGVManager.agvInfo[i], out eAGVState stateID, out string stateText, out int battery, out string mission_text, out Agv_Info.MirPosition position);
Thread.Sleep(50);
if (rtn) change = AGVManager.agvInfo[i].SetState(stateID, stateStr, battery, mission_text, position);
......
......@@ -39,6 +39,7 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceModel.Activation" />
......@@ -64,6 +65,7 @@
<Compile Include="bean\job\jobType\JobForRoomC.cs" />
<Compile Include="bean\job\jobType\JobForRoomD.cs" />
<Compile Include="bean\job\SendFullShelfToLineJob.cs" />
<Compile Include="bean\job\StandyJob.cs" />
<Compile Include="bean\Mission.cs" />
<Compile Include="bean\node\ClientNode.cs" />
<Compile Include="bean\Node.cs" />
......@@ -83,6 +85,7 @@
<Compile Include="ScopeLimit.cs" />
<Compile Include="Shelf.cs" />
<Compile Include="Standby.cs" />
<Compile Include="TCPServer.cs" />
<Compile Include="unlock\LineWebService.cs" />
<Compile Include="unlock\UnlockedShelf.cs" />
<Compile Include="unlock\UnlockMissionManager.cs" />
......
......@@ -16,22 +16,65 @@ namespace DeviceLibrary
/// 任务列表
/// </summary>
public static List<Mission> Missions;
/// <summary>
/// 加载任务列表
/// </summary>
public static void Init()
{
try
{
Missions = new List<Mission>();
string path = AGVManager.CONFIG_PATH + SettingString.FileName_AgvMission;
string[] line = System.IO.File.ReadAllLines(path, Encoding.UTF8);
string[] temp;
for (int i = 1; i < line.Length; i++)
{
temp = line[i].Split(',');
if (temp.Length != 5) continue;
Missions.Add(new Mission(temp[0], temp[1], temp[2], temp[3], temp[4]));
}
LogUtil.info("加载任务成功");
}
catch (Exception ex)
{
LogUtil.error("加载任务失败", ex);
}
}
/// <summary>
/// 根据目的地名获取guid号
/// </summary>
/// <param name="taskName"></param>
/// <returns></returns>
public static string GetMissionGuidByName(string name)
{
Mission mission = Missions.Find(s => s.TargetName.Equals(name));
if (mission != null)
return mission.Guid;
else
LogUtil.error(string.Format("任务目的地{0}不存在,请检查!", name));
return "";
}
/// <summary>
/// 根据任务名获取guid号
/// </summary>
/// <param name="taskName"></param>
/// <returns></returns>
public static string GetMissionGuidByName(string taskName)
public static string GetMissionGuidByTaskName(string taskName)
{
Mission mission = Missions.Find(s => s.Name.Equals(taskName));
return mission.Guid;
if (mission != null)
return mission.Guid;
else
LogUtil.error(string.Format("任务{0}不存在,请检查!", taskName));
return "";
}
/// <summary>
/// 向小车发送任务
/// </summary>
/// <returns></returns>
public static bool AssignMission(Agv_Info agv,string missionName)
public static bool AssignMission(Agv_Info agv, string missionName)
{
bool rtn = false;
string guid = GetMissionGuidByName(missionName);
......@@ -81,7 +124,7 @@ namespace DeviceLibrary
{
MiR_API.Del_Mission(agv);
}
LogUtil.info(string.Format("{0} DelMission [{1}] OK", agv.Name, agv.CurTaskName));
LogUtil.info(string.Format("{0} DelMission [{1}] OK", agv.Name, agv.CurTarName));
}
/// <summary>
......@@ -90,7 +133,7 @@ namespace DeviceLibrary
/// <param name="taskName">任务名称</param>
/// <param name="taskGUID">任务GUID</param>
/// <returns></returns>
public static bool CheckTaskFinished(Agv_Info agv,string taskName, string curTaskState)
public static bool CheckTaskFinished(Agv_Info agv, string taskName, string curTaskState)
{
LogUtil.debug(agv.Name + " 检查当前任务是否结束: " + taskName + " " + curTaskState);
return GetMissionGuidByName(taskName).Equals(agv.CurTaskGUID) && curTaskState.Equals(SettingString.Done);
......
......@@ -6,15 +6,15 @@ using System.Threading.Tasks;
namespace DeviceLibrary
{
public class Standby
public class StandbyManager
{
/// <summary>
/// 待机位
/// </summary>
public List<string> Station;
private const int Station_CNT = 4;
private const int Station_CNT = 3;
public Standby()
public StandbyManager()
{
Station = new List<string>();
Station.AddRange(new string[Station_CNT]);
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Dolen.Communication.TCP
{
public class TCPServer
{
Thread threadWatch = null; // 负责监听客户端连接请求的线程;
Socket socketWatch = null;
int buffLength = 1024;// 定义一个1M的缓存区;
Dictionary<string, Socket> dict = new Dictionary<string, Socket>();
Dictionary<string, Thread> dictThread = new Dictionary<string, Thread>();
log4net.ILog Log;
private bool loop = false;
/// <summary>
/// 消息变化委托
/// </summary>
/// <param name="clientKey">客户端信息</param>
/// <param name="msg">客户端发送的消息</param>
public delegate void MsgEventHandler(string clientKey, string msg);
public delegate void ClientChangedEventHandler(List<string> clientKey);
public delegate void ServerStateChangedEventHandler(bool state);
/// <summary>
/// 消息接收事件 (string clientKey, string msg)
/// </summary>
public event MsgEventHandler RecvMsgEvent;
/// <summary>
/// 客户端变化事件 (List<string> clientKey)
/// </summary>
public event ClientChangedEventHandler ClientChangedEvent;
public event ServerStateChangedEventHandler ServerStateChangedEvent;
/// <summary>
/// 是否打开调试
/// </summary>
public bool IsDebug { get; set; } = false;
/// <summary>
/// 服务端IP
/// </summary>
public string IP { get; private set; }
/// <summary>
/// 服务端信息
/// </summary>
public string ServerInfo
{
get
{
return string.Format("{0}:{1}", IP, Port.ToString());
}
}
/// <summary>
/// 服务端端口
/// </summary>
public int Port { get; private set; }
/// <summary>
/// 启动状态
/// </summary>
public bool Started { get; private set; }
public TCPServer(string ip = "127.0.0.1", int port = 8888, string logName = "TCPServer")
{
Log = log4net.LogManager.GetLogger(logName);
IP = ip;
Port = port;
// 创建负责监听的套接字,注意其中的参数;
socketWatch = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
// 获得文本框中的IP对象;
IPAddress address = IPAddress.Parse(IP);
// 创建包含ip和端口号的网络节点对象;
IPEndPoint endPoint = new IPEndPoint(address, Port);
try
{
// 将负责监听的套接字绑定到唯一的ip和端口上;
socketWatch.Bind(endPoint);
}
catch (SocketException se)
{
Log.Error(string.Format("套接字绑定到服务端[{0}]出现异常", ServerInfo), se);
return;
}
// 设置监听队列的长度;
socketWatch.Listen(10);
// 创建负责监听的线程;
threadWatch = new Thread(WatchConnecting);
threadWatch.IsBackground = true;
threadWatch.Start();
}
/// <summary>
/// 设置缓存区长度
/// </summary>
public void SetBuffLength(int len)
{
buffLength = len;
}
/// <summary>
/// 开启服务
/// </summary>
public void Start()
{
if (Started)
return;
loop = true;
Started = true;
Log.Info(string.Format("TCP服务端[{0}]开启监听成功!", ServerInfo));
ServerStateChangedEvent?.Invoke(Started);
}
public void Stop()
{
loop = false;
foreach (string t in dictThread.Keys)
{
try
{
dictThread[t].Abort();
}
catch (Exception ex)
{
Log.Error(string.Format("关闭连接客户端[{0}]的线程失败", t), ex);
}
}
if (dictThread.Count > 0) dictThread.Clear();
foreach (string socket in dict.Keys)
{
try
{
dict[socket].Close();
}
catch (Exception ex)
{
Log.Error(string.Format("关闭连接客户端[{0}]Socket失败", socket), ex);
}
}
if (dict.Count > 0) dict.Clear();
Started = false;
ServerStateChangedEvent?.Invoke(Started);
ClientChangedEvent?.Invoke(dict.Keys.ToList<string>());
Log.Info(string.Format("TCP服务端[{0}]关闭监听成功!", ServerInfo));
}
/// <summary>
/// 监听客户端请求的方法;
/// </summary>
void WatchConnecting()
{
while (true) // 持续不断的监听客户端的连接请求;
{
while (loop)
{
// 开始监听客户端连接请求,Accept方法会阻断当前的线程;
Socket sokConnection = socketWatch.Accept(); // 一旦监听到一个客户端的请求,就返回一个与该客户端通信的 套接字;
// 将与客户端连接的 套接字 对象添加到集合中;
dict.Add(sokConnection.RemoteEndPoint.ToString(), sokConnection);
Log.Info(string.Format("客户端[{0}]连接服务端[{1}]成功", sokConnection.RemoteEndPoint.ToString(), ServerInfo));
Thread thr = new Thread(RecMsg);
thr.IsBackground = true;
thr.Start(sokConnection);
dictThread.Add(sokConnection.RemoteEndPoint.ToString(), thr); // 将新建的线程添加到线程的集合中去。
ClientChangedEvent?.Invoke(dict.Keys.ToList<string>());
}
}
}
void RecMsg(object sokConnectionparn)
{
Socket sokClient = sokConnectionparn as Socket;
while (loop)
{
// 定义一个缓存区;
byte[] arrMsgRec = new byte[buffLength];
// 将接收到的数据存入到输入 arrMsgRec中;
int length = -1;
if (sokClient.Poll(-1, SelectMode.SelectRead))
{
try
{
length = sokClient.Receive(arrMsgRec); // 接收数据,并返回数据的长度;
if (length == 0)//连接正常断开
{
Log.Info(string.Format("客户端[{0}]断开与服务端[{1}]的连接", sokClient.RemoteEndPoint.ToString(), ServerInfo));
// 从 通信套接字 集合中删除被中断连接的通信套接字;
dict.Remove(sokClient.RemoteEndPoint.ToString());
// 从通信线程集合中删除被中断连接的通信线程对象;
dictThread.Remove(sokClient.RemoteEndPoint.ToString());
ClientChangedEvent?.Invoke(dict.Keys.ToList<string>());
break;
}
}
catch (SocketException se)
{
Log.Error(string.Format("客户端[{0}]接收服务端[{1}]的消息出现异常", sokClient.RemoteEndPoint.ToString(), ServerInfo), se);
// 从 通信套接字 集合中删除被中断连接的通信套接字;
dict.Remove(sokClient.RemoteEndPoint.ToString());
// 从通信线程集合中删除被中断连接的通信线程对象;
dictThread.Remove(sokClient.RemoteEndPoint.ToString());
break;
}
catch (Exception e)
{
Log.Error(string.Format("客户端[{0}]接收服务端[{1}]的消息出现异常", sokClient.RemoteEndPoint.ToString(), ServerInfo), e);
// 从 通信套接字 集合中删除被中断连接的通信套接字;
dict.Remove(sokClient.RemoteEndPoint.ToString());
// 从通信线程集合中删除被中断连接的通信线程对象;
dictThread.Remove(sokClient.RemoteEndPoint.ToString());
ClientChangedEvent?.Invoke(dict.Keys.ToList<string>());
break;
}
}
if (length > 0)
{
string strMsg = System.Text.Encoding.UTF8.GetString(arrMsgRec, 0, length);// 将接收到的字节数据转化成字符串;
//if (IsDebug)
Log.Debug(string.Format("服务端[{0}]收到客户端[{1}]的消息:{2}[{3}][{4} Bytes]",
ServerInfo, sokClient.RemoteEndPoint.ToString(), strMsg, string.Join(" ", arrMsgRec.Take(length)), length));
//Log.Info(string.Format("服务端[{0}]收到客户端[{1}]的消息:{2}[{3} Bytes]", ServerInfo, sokClient.RemoteEndPoint.ToString(), strMsg,length));
RecvMsgEvent?.Invoke(sokClient.RemoteEndPoint.ToString(), strMsg);
}
}
}
/// <summary>
/// 向客户端发送信息
/// </summary>
public void SendMsg(string clientKey, string txt)
{
try
{
byte[] arrMsg = System.Text.Encoding.UTF8.GetBytes(txt); // 将要发送的字符串转换成Utf-8字节数组;
// arrSendMsg[0] = 0; // 表示发送的是消息数据
//Buffer.BlockCopy(arrMsg, 0, arrSendMsg, 1, arrMsg.Length);
int len = dict[clientKey].Send(arrMsg);
Log.Debug(string.Format("服务端[{0}]向客户端[{1}]发送消息:{2}[{3}][{4} Bytes]", ServerInfo, clientKey, txt, string .Join(" ", arrMsg),len));
}
catch (Exception e)
{
Log.Error(string.Format("服务端[{0}]向客户端[{1}]发送消息异常:{2}", ServerInfo, clientKey, txt), e);
// 从 通信套接字 集合中删除被中断连接的通信套接字;
dict.Remove(clientKey);
// 从通信线程集合中删除被中断连接的通信线程对象;
dictThread.Remove(clientKey);
ClientChangedEvent?.Invoke(dict.Keys.ToList<string>());
}
}
}
}
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
......@@ -41,6 +42,8 @@ namespace DeviceLibrary
/// 是否在线
/// </summary>
public bool IsCon { set; get; }
public bool IsInCharge { get; set; }
/// <summary>
/// 是否可用
/// </summary>
......@@ -52,6 +55,7 @@ namespace DeviceLibrary
if (!value.Equals(_IsUse))
{
_IsUse = value;
AGVManager.WriteIni(Name,SettingString.IsUse,_IsUse.ToString());
}
}
get { return _IsUse; }
......@@ -86,16 +90,16 @@ namespace DeviceLibrary
public string MissionText { set; get; }
public class clsPosition
public class MirPosition
{
public double orientation { get; set; }
public double x { get; set; }
public double y { get; set; }
public float orientation { get; set; }
public PointF Point;
}
/// <summary>
/// 当前位置
/// </summary>
public clsPosition Position;
public MirPosition Position;
/// <summary>
/// 任务内容
......@@ -112,7 +116,7 @@ namespace DeviceLibrary
/// <summary>
/// 使用Fleet发任务
/// </summary>
public bool UseFleet { get; set; } = true;
public bool UseFleet { get; set; } = false;
/// <summary>
/// 当前任务的ID号
/// </summary>
......@@ -120,9 +124,9 @@ namespace DeviceLibrary
public string CurTaskState { get; set; } = "";
/// <summary>
/// 当前任务名称
/// 当前任务目的地名
/// </summary>
public string CurTaskName { get; set; }
public string CurTarName { get; set; }
/// <summary>
/// 当前任务的GUID
......@@ -133,36 +137,6 @@ namespace DeviceLibrary
/// </summary>
public string BoxDestInfo { get; set; } = "";
public string RunInfo()
{
string curJobTaskName = "";
string curJobTaskState = "";
int curJobTaskID = -1;
if (CurJob != null)
{
curJobTaskName = CurJob.CurTaskName;
curJobTaskState = CurJob.CurTaskState;
curJobTaskID = CurJob.CurTaskID;
if (RFID.StartsWith("C"))
{
return string.Format("设备:{1}{0}RFID:{2}{0}任务信息:[任务名称={3}][任务状态:{4}]{0}当前步骤:{5}{0}执行信息:{6}",
"\r\n", Name, RFID, curJobTaskName, curJobTaskState, Msg, MissionText);
}
else if (RFID.StartsWith("D"))
{
return string.Format("设备:{1}{0}RFID:{2}{0}任务信息:[任务名称={3}][任务状态={4}]{0}当前步骤:{5}{0}执行信息:{6}",
"\r\n", Name, RFID, curJobTaskName, curJobTaskState, Msg, MissionText);
}
else
return string.Format("设备:{1}{0}RFID:{2}{0}任务信息:[任务名称={3}][任务状态={4}]{0}当前步骤:{5}{0}执行信息:{6}",
"\r\n", Name, RFID, curJobTaskName, curJobTaskState, Msg, MissionText);
}
else
return string.Format("设备:{1}{0}RFID:{2}{0}任务信息:[任务名称={3}][任务状态={4}]{0}执行信息:{5}",
"\r\n", Name, RFID, curJobTaskName, curJobTaskState, MissionText);
}
/// <summary>
/// 任务重发
/// </summary>
......@@ -178,6 +152,7 @@ namespace DeviceLibrary
/// 停在同一处超时
/// </summary>
public bool StandTimeOut { get; set; } = false;
public AGV_UI.Status StateKanban;
public Agv_Info(string id, string name, string ip, string authorization, string ioID, bool isUse, string rfid)
{
ID = id;
......@@ -190,21 +165,24 @@ namespace DeviceLibrary
_IsUse = isUse;
Place = "";
Msg = "";
Position = new Agv_Info.clsPosition();
Position = new MirPosition();
RunInfos = new List<string>() { "目的地", "RFID", "负载", "运行模式", "任务信息", "AGV运行信息" };
StateKanban = new AGV_UI.Status(name, RunInfos);
}
public List<string> RunInfos;
DateTime IoStartTime = DateTime.MaxValue;
int IoLastTime = 5000;
int StandLastTimeMinute = 5;
public DateTime StandStartTime = DateTime.MaxValue;
public bool SetState(eAGVState stateID, string stateText, int battery, string missionText, clsPosition position)
public bool SetState(eAGVState stateID, string stateText, int battery, string missionText, MirPosition position)
{
bool isChange = false;
bool preShelfState = IsExistShelf;
MiR_API.Get_IO_Status(this, out bool[] input, out bool[] output);
if (input != null && input.Length == 4)
{
bool reachIoValue = input[3].Equals(true);//input[2] &&
bool reachIoValue = input[3].Equals(true);
if (reachIoValue)
{
//满足给定的IO值,计算持续时间
......@@ -222,23 +200,55 @@ namespace DeviceLibrary
}
else
{
IsExistShelf = true;
IsExistShelf = false;
}
}
else
{
//重新计时
IoStartTime = DateTime.MinValue;
IsExistShelf = input[3];
IsExistShelf = false;
}
}
if (!StateID.Equals(stateID) || !CurTaskState.Equals(stateText) || !Battery.Equals(battery)
|| !MissionText.Equals(missionText) || !IsExistShelf.Equals(preShelfState))
isChange = true;
StateID = stateID;
CurTaskState = stateText;
Battery = battery;
MissionText = missionText;
if (!CurTaskState.Equals(stateText))
{
CurTaskState = stateText;
StateKanban.SetCurState(stateText);
}
if (!Battery.Equals(battery))
{
Battery = battery;
StateKanban.SetBattery(battery,IsInCharge);
}
//"目的地", "RFID", "负载", "运行模式","任务信息", "AGV运行信息"
if (AGVManager.nodeInfo != null && AGVManager.nodeInfo.Count != 0)
{
ClientNode node = AGVManager.nodeInfo.Find(ss => ss.Name == Place);
if (node != null)
PlaceAliceName = node.AliceName;
else
PlaceAliceName = Place;
}
StateKanban.ShowInfo("目的地", PlaceAliceName);
StateKanban.ShowInfo("RFID", RFID);
if (!IsExistShelf.Equals(preShelfState))
{
StateKanban.ShowInfo("负载", IsExistShelf ? "满载" : "空载");
}
StateKanban.ShowInfo("运行模式", IsUse ? "自动" : "手动");
StateKanban.ShowInfo("任务信息", this.CurJob.RunInfo);
if (!MissionText.Equals(missionText))
{
MissionText = missionText;
StateKanban.ShowInfo("AGV运行信息", missionText);
}
CheckStandTimeOut(position);
return isChange;
}
......@@ -247,12 +257,12 @@ namespace DeviceLibrary
/// 检查小车是否在原地停留超时
/// </summary>
/// <returns></returns>
private void CheckStandTimeOut(clsPosition position)
private void CheckStandTimeOut(MirPosition position)
{
if (IsUse && CurJob != null && !(CurJob is ChargeJob) &&
(!CurTaskName.Contains(SettingString.Standby)))//!CurTaskName.Contains(SettingString.AutoCharge) ||
(!CurTarName.Contains(SettingString.Standby)))//!CurTaskName.Contains(SettingString.AutoCharge) ||
{
if (Math.Abs(position.x - Position.x) < 1 && Math.Abs(position.y - Position.y) < 1)
if (Math.Abs(position.Point.X - Position.Point.X) < 1 && Math.Abs(position.Point.Y- Position.Point.Y) < 1)
{
//满足条件,计算持续时间
if (StandStartTime == DateTime.MaxValue)
......
......@@ -20,9 +20,9 @@ namespace DeviceLibrary
public int CurTaskID { get; set; } = -1;
/// <summary>
/// 当前的任务名称(与任务GUID对应)
/// 当前的任务目的地(与任务GUID对应)
/// </summary>
public string CurTaskName { get; set; } = "";
public string CurTarName { get; set; } = "";
/// <summary>
/// 当前任务的执行状态
/// </summary>
......@@ -36,7 +36,7 @@ namespace DeviceLibrary
protected void UpdateJobTaskInfo(string curTaskName, int curTaskId)
{
CurTaskID = curTaskId;
CurTaskName = curTaskName;
CurTarName = curTaskName;
CurTaskState = MissionSys.GetTakJobState(CurTaskID);
}
/// <summary>
......@@ -50,30 +50,30 @@ namespace DeviceLibrary
{
if (stateStr.Equals(SettingString.Aborted) || stateStr.Equals(SettingString.Invalid))
{
rtn = MissionSys.AssignMission(agv, CurTaskName);
rtn = MissionSys.AssignMission(agv, CurTarName);
if (rtn)
{
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
return true;
}
}
}
else if (!CurTaskName.Equals("") && !MissionSys.GetMissionGuidByName(CurTaskName).Equals(agv.CurTaskGUID))//Job的当前任务与agv最新任务不一致
else if (!CurTarName.Equals("") && !MissionSys.GetMissionGuidByName(CurTarName).Equals(agv.CurTaskGUID))//Job的当前任务与agv最新任务不一致
{
rtn = MissionSys.AssignMission(agv, CurTaskName);
rtn = MissionSys.AssignMission(agv, CurTarName);
if (rtn)
{
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
return true;
}
}
else if (CurTaskID.Equals(-1))//任务发送失败,重新发送
{
rtn = MissionSys.AssignMission(agv, CurTaskName);
rtn = MissionSys.AssignMission(agv, CurTarName);
if (rtn)
{
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
return true;
}
}
......
......@@ -5,6 +5,7 @@ using System.Web.Script.Serialization;
using Common;
using Microsoft.SqlServer.Server;
using RestSharp;
using static DeviceLibrary.Agv_Info;
namespace DeviceLibrary
{
......@@ -86,7 +87,7 @@ namespace DeviceLibrary
}
catch (Exception ex)
{
Common.log.Error("Get_Node_Pos", ex);
log.Error("Get_Node_Pos", ex);
mirPosition = null;
return false;
}
......@@ -224,6 +225,9 @@ namespace DeviceLibrary
{
try
{
info.CurTaskID = -1;
info.CurTaskGUID = "";
info.CurTaskState = SettingString.Wait;
log.Debug(string.Format("{0} Add_Mission [{1}]", info.Name, mission_id));
//删除上一任务
......@@ -254,7 +258,7 @@ namespace DeviceLibrary
catch
{
log.Error(string.Format("{0} Add_Mission [{1}]", info.Name, mission_id));
info.CurTaskName = "";
info.CurTarName = "";
}
return true;
......@@ -312,7 +316,7 @@ namespace DeviceLibrary
catch
{
log.Info(string.Format("{0} Add_Mission_Fleet [{1}]", info.Name, mission_id));
info.CurTaskName = "";
info.CurTarName = "";
}
return true;
}
......@@ -493,13 +497,13 @@ namespace DeviceLibrary
/// <param name="battery"></param>
/// <param name="mission_text"></param>
/// <returns></returns>
public static bool Get_State(Agv_Info info, out eAGVState stateID, out string stateText, out int battery, out string mission_text, out Agv_Info.clsPosition position)
public static bool Get_State(Agv_Info info, out eAGVState stateID, out string stateText, out int battery, out string mission_text, out MirPosition position)
{
stateID = eAGVState.UNKNOWN;
stateText = "";
battery = 0;
mission_text = "";
position = new Agv_Info.clsPosition();
position = new MirPosition();
try
{
string url = "http://" + info.IP + "/api/v2.0.0/status?whitelist=state_id,state_text,battery_percentage,mission_text,position";
......@@ -528,9 +532,9 @@ namespace DeviceLibrary
battery = Convert.ToInt32(f);
Dictionary<string, object> posDic = (Dictionary<string, object>)dic["position"];
if (posDic == null) return false;
position.orientation = Convert.ToDouble(posDic["orientation"].ToString());
position.x = Convert.ToDouble(posDic["x"]);
position.y = Convert.ToDouble(posDic["y"]);
position.orientation = Convert.ToSingle(posDic["orientation"].ToString());
position.Point.X = Convert.ToSingle(posDic["x"]);
position.Point.Y = Convert.ToSingle(posDic["y"]);
return true;
}
catch (Exception ex)
......
......@@ -22,15 +22,28 @@ namespace DeviceLibrary
/// </summary>
public string TargetName { private set; get; }
/// <summary>
/// 目的地别名(与节点名对应)
/// </summary>
public string TargetAliceName { private set; get; }
/// <summary>
/// 任务guid
/// </summary>
public string Guid { private set; get; }
public Mission(string name,string aliceName,string targetName,string guid)
/// <summary>
/// 任务
/// </summary>
/// <param name="name">任务名称</param>
/// <param name="aliceName">任务别名</param>
/// <param name="targetName">目的地名</param>
/// <param name="targetAliceName">目的地别名</param>
/// <param name="guid">任务guid</param>
public Mission(string name,string aliceName,string targetName,string targetAliceName,string guid)
{
Name = name;
AliceName = aliceName;
TargetName = targetName;
TargetAliceName = targetAliceName;
Guid = guid;
}
}
......
......@@ -28,7 +28,7 @@ namespace DeviceLibrary
/// </summary>
public override string RunInfo
{
get { return string.Format("充电任务:{0} ", runInfo);}
get { return string.Format("充电任务[{0}][{1}]:{2} ", CurTaskID, CurTaskState, runInfo);}
}
private JobStep<CHARGE_STEP> jobStep = new JobStep<CHARGE_STEP>(CHARGE_STEP.NONE);
......@@ -53,7 +53,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv,SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if (agvPlace.StartsWith(SettingString.RoomC_Name_Prefix) && AGVManager.CheckIsInAirDoor(agvPlace))
{
......@@ -62,7 +62,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv,SettingString.DoorAirOut);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if (agvPlace.StartsWith(SettingString.RoomC_Name_Prefix))
{
......@@ -71,7 +71,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv,SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -81,7 +81,7 @@ namespace DeviceLibrary
jobStep.Msg = msg;
MissionSys.AssignMission(agv,SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
else
......@@ -94,7 +94,7 @@ namespace DeviceLibrary
jobStep.Msg = msg;
MissionSys.AssignMission(agv,SettingString.DoorAirOut);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if (agvPlace.StartsWith(SettingString.RoomC_Name_Prefix))
{
......@@ -104,7 +104,7 @@ namespace DeviceLibrary
jobStep.Msg = msg;
MissionSys.AssignMission(agv,SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -116,7 +116,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv,SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -124,7 +124,7 @@ namespace DeviceLibrary
runInfo = "电量" + agv.Battery + "%小于最大电量" + AGVManager.Charge.BatteryMax + "%,从当前位置" + agvPlace + "去充电位";
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
}
......@@ -139,7 +139,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
else if (jobStep.IsStep(CHARGE_STEP.WAIT_AGV_REACH_ROOMD_DOOR))
......@@ -153,7 +153,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -165,7 +165,7 @@ namespace DeviceLibrary
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -173,7 +173,7 @@ namespace DeviceLibrary
runInfo = "电量" + agv.Battery + "%小于最大电量" + AGVManager.Charge.BatteryMax + "%,从当前位置" + agvPlace + "回到充电位";
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
......@@ -181,7 +181,7 @@ namespace DeviceLibrary
}
else if (jobStep.IsStep(CHARGE_STEP.WAIT_REACH_CHARGE_STATION))
{
if (MissionSys.CheckTaskIsOK(agv, CurTaskName,CurTaskState))
if (MissionSys.CheckTaskIsOK(agv, CurTarName,CurTaskState))
{
jobStep.ToNextStep(CHARGE_STEP.WAIT_REACH_CHARGE_OK);
runInfo = "开始充电任务";
......@@ -199,16 +199,16 @@ namespace DeviceLibrary
runInfo = "电量充足,回待机位";
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
AGVManager.Charge.DelOccupyInfoByAGV(agv);
AGVManager.Charge.DelOccupyInfo(agv);
MissionSys.AssignMission(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if (agv.Battery >= AGVManager.Charge.BatteryMin)
{
Job job = AGVManager.control.GetJob(agv);
if (job != null && !(job is ChargeJob))
{
AGVManager.Charge.DelOccupyInfoByAGV(agv);
AGVManager.Charge.DelOccupyInfo(agv);
runInfo = "充电过程检测到任务,电量" + agv.Battery + "%大于最小电量" + AGVManager.Charge.BatteryMin + "%,中断充电执行任务";
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
......@@ -234,7 +234,7 @@ namespace DeviceLibrary
runInfo = "充电过程中检测到任务,电量" + agv.Battery + "%大于最小电量" + AGVManager.Charge.BatteryMin + "%,中断充电执行任务";
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
AGVManager.Charge.DelOccupyInfoByAGV(agv);
AGVManager.Charge.DelOccupyInfo(agv);
return job;
}
}
......@@ -261,7 +261,7 @@ namespace DeviceLibrary
runInfo = "在待机位检测到任务,执行任务";
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
AGVManager.Charge.DelOccupyInfoByAGV(agv);
AGVManager.Charge.DelOccupyInfo(agv);
return job;
}
else if (job == null && agv.Battery < AGVManager.Charge.BatteryMax / 2)
......@@ -270,7 +270,7 @@ namespace DeviceLibrary
runInfo = "在待机位暂无任务,且当前电量小于" + AGVManager.Charge.BatteryMax / 2 + "%,去充电位";
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
AGVManager.Charge.DelOccupyInfoByAGV(agv);
AGVManager.Charge.DelOccupyInfo(agv);
}
}
return this;
......
......@@ -36,7 +36,7 @@ namespace DeviceLibrary
/// </summary>
public override string RunInfo
{
get { return string.Format("返回任务:{0}", runInfo); }
get { return string.Format("返回任务[{0}][{1}]:{2}", CurTaskID,CurTaskState,runInfo); }
}
......@@ -75,7 +75,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorAirOut);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if (agvPlace.StartsWith(SettingString.RoomC_Name_Prefix))
{
......@@ -84,7 +84,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -93,7 +93,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
}
......@@ -106,7 +106,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorAirOut);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if (agvPlace.StartsWith(SettingString.RoomC_Name_Prefix))
{
......@@ -115,7 +115,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -124,7 +124,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
......@@ -138,7 +138,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorAirOut);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if (agvPlace.StartsWith(SettingString.RoomC_Name_Prefix))
{
......@@ -147,7 +147,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -156,7 +156,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
}
......@@ -204,7 +204,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
else if (jobStep.IsStep(EMPTY_AGV_BACK_STEP.WAIT_AGV_REACH_RoomD_DOOR))
......
......@@ -42,7 +42,7 @@ namespace DeviceLibrary
/// </summary>
public override string RunInfo
{
get { return string.Format("空料架[{0}]返回:{1} ",shelfType.ToString(),runInfo); }
get { return string.Format("空料架[{0}][{1}][{2}]返回:{3} ",shelfType.ToString(), CurTaskID, CurTaskState, runInfo); }
}
......@@ -66,7 +66,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorAirOut);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if (EmptyShelfPlace.StartsWith(SettingString.RoomC_Name_Prefix))//C车间
{
......@@ -75,7 +75,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -89,7 +89,7 @@ namespace DeviceLibrary
if (!EmptyShelfTargetPlace.Equals(""))
{
MissionSys.AssignMission(agv, EmptyShelfTargetPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
......@@ -100,7 +100,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
}
......@@ -114,7 +114,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
else if (jobStep.IsStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_DOOR))
......@@ -130,7 +130,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, EmptyShelfTargetPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -140,7 +140,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
}
......@@ -155,7 +155,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, EmptyShelfTargetPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
else if (jobStep.IsStep(EMPTY_SHELF_BACK_STEP.WAIT_AGV_REACH_A5A6))
......@@ -176,14 +176,14 @@ namespace DeviceLibrary
ClientNode node = AGVManager.nodeInfo[id];
if (node.StateEquals(eNodeStatus.MayEnter))
{
if (!agv.CurTaskName.Equals(SettingString.Leave))
if (!agv.CurTarName.Equals(SettingString.Leave))
{
jobStep.ToNextStep(EMPTY_SHELF_BACK_STEP.WAIT__EMPTY_SHELF_IN_DOUBLE_LINE);
runInfo = "收到双层线入料架请求[ReadyEnter]的响应 " + EmptyShelfTargetPlace + "入料架,小车链条运行";
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Leave);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
......@@ -198,7 +198,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
else if (jobStep.IsStep(EMPTY_SHELF_BACK_STEP.WAIT__EMPTY_SHELF_IN_DOUBLE_LINE))
......
......@@ -75,7 +75,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Leave);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if(ActionType.Equals(eEnterLeaveType.Enter))
{
......@@ -88,7 +88,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Enter);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
else if (jobStep.IsStep(ENTER_LEAVE_SHELF_STEP.WAIT_LINE_ReadyEnter_RESPONSE))
......@@ -102,7 +102,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Leave);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if (jobStep.IsTimeOut(15000, out double timeOutValue))
{
......@@ -123,7 +123,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Enter);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if (jobStep.IsTimeOut(15000, out double timeOutValue))
{
......
......@@ -36,7 +36,7 @@ namespace DeviceLibrary
/// </summary>
public override string RunInfo
{
get { return string.Format("回收空料架[RFID={0}]:{1}",RFID,runInfo); }
get { return string.Format("回收空料架[RFID={0}][{1}][{2}]:{3}",RFID, CurTaskID, CurTaskState, runInfo); }
}
......@@ -60,7 +60,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorAirOut);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if (!AGVManager.CheckIsInAirDoor(agvPlae) && AGVManager.CheckIsInAirDoor(EmptyShelfPlace))//4C风淋门外->风淋门内
{
......@@ -73,7 +73,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
AGVManager.MoveToRoomCStandy(agv);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -82,7 +82,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorAirIn);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
else if ((agvPlae.StartsWith(SettingString.RoomD_Name_Prefix) || agvPlae.StartsWith(SettingString.DoubleLine_Name_Prefix) || agvPlae.Equals(SettingString.Standby) ||
......@@ -94,7 +94,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorDToC);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
else//起始与目的地在风淋门同一侧
......@@ -108,7 +108,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorAirOut);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -129,7 +129,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
AGVManager.MoveToRoomCStandy(agv);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -146,7 +146,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if ((agvPlae.StartsWith(SettingString.RoomD_Name_Prefix) || agvPlae.StartsWith(SettingString.DoubleLine_Name_Prefix) || agvPlae.Equals(SettingString.Standby) ||
agvPlae.Equals(SettingString.AutoCharge))
......@@ -157,7 +157,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorDToC);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else//4D->4D
......@@ -187,7 +187,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
AGVManager.MoveToRoomCStandy(agv);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -204,7 +204,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
//都在风淋门内,到达风淋门外
else
......@@ -214,7 +214,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
AGVManager.MoveToRoomCStandy(agv);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
}
......@@ -242,7 +242,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
AGVManager.MoveToRoomCStandy(agv);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -253,7 +253,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorAirIn);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -301,7 +301,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, EmptyShelfPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -366,7 +366,7 @@ namespace DeviceLibrary
agv.RFID = node.RFID;
if (node.StateEquals(eNodeStatus.MayLeave))
{
if (!agv.CurTaskName.Equals("Enter"))
if (!agv.CurTarName.Equals("Enter"))
{
jobStep.ToNextStep(TAKE_EMPTY_STEP.WAIT_TAKE_EMPTY_SHELF);
runInfo = "收到产线出料请求[ReadyLeave]的响应 " + EmptyShelfPlace + "出料架,小车链条运行" + "[RFID=" + RFID + "]";
......@@ -374,7 +374,7 @@ namespace DeviceLibrary
jobStep.Msg = msg;
//agv.RFID = node.RFID;
MissionSys.AssignMission(agv, SettingString.Enter);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
......
......@@ -32,7 +32,7 @@ namespace DeviceLibrary
/// </summary>
public override string RunInfo
{
get { return string.Format("接满料任务:{0}", runInfo); }
get { return string.Format("接满料任务[{0}][{1}]:{2}", CurTaskID, CurTaskState, runInfo); }
}
/// <summary>
......@@ -55,7 +55,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.CheckShelf);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if (jobStep.IsStep(GO_FULL_SHELF_STATION_STEP.WAIT_CHECK_RESULT))
{
......@@ -79,7 +79,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, FullShelfStationPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if (AGVManager.CheckIsInAirDoor(agvPlace))
{
......@@ -88,7 +88,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorAirOut);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else if (agvPlace.StartsWith(SettingString.RoomC_Name_Prefix))//4C车间
{
......@@ -97,7 +97,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -106,7 +106,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, FullShelfStationPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
......@@ -123,7 +123,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
......@@ -137,7 +137,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, FullShelfStationPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
......@@ -180,7 +180,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
}
......@@ -212,14 +212,14 @@ namespace DeviceLibrary
ClientNode node = AGVManager.nodeInfo[id];
if (node.StateEquals(eNodeStatus.MayLeave))
{
if (!agv.CurTaskName.Equals("Enter"))
if (!agv.CurTarName.Equals("Enter"))
{
jobStep.ToNextStep(GO_FULL_SHELF_STATION_STEP.WAIT__FULL_SHELF_IN_AGV);
runInfo = "收到双层线出料架请求[ReadyLeave]的响应 " + FullShelfStationPlace + "出料架,小车链条运行";
msg += string.Format("[{0}] {1}", jobStep.CurStep(), runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv,SettingString.Enter);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
......
......@@ -40,7 +40,7 @@ namespace DeviceLibrary
/// </summary>
public override string RunInfo
{
get { return string.Format("送满料任务[RFID={0}]:{1}",RFID,runInfo); }
get { return string.Format("送满料任务[RFID={0}][{1}][{2}]:{3}",RFID, CurTaskID, CurTaskState, runInfo); }
}
......@@ -61,7 +61,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorDToC);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -70,7 +70,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, FullShelfPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
......@@ -86,7 +86,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
AGVManager.MoveToRoomCStandy(agv);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -97,7 +97,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorAirIn);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -106,7 +106,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, FullShelfPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
......@@ -122,7 +122,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, FullShelfPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
else if (jobStep.IsStep(SEND_FULL_SHELF_STEP.WAIT_REACH_TEMP_PLACE))
......@@ -139,7 +139,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorAirIn);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
......@@ -148,7 +148,7 @@ namespace DeviceLibrary
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv, FullShelfPlace);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
}
......@@ -215,14 +215,14 @@ namespace DeviceLibrary
System.Threading.Thread.Sleep(50);
if (node.StateEquals(eNodeStatus.MayEnter))
{
if (!agv.CurTaskName.Equals(SettingString.Leave))
if (!agv.CurTarName.Equals(SettingString.Leave))
{
jobStep.ToNextStep(SEND_FULL_SHELF_STEP.WAIT__SHELF_IN_LINE);
runInfo = "收到产线入料架请求[ReadyEnter]的响应 " + FullShelfPlace + "入料架,小车链条运行";
msg += string.Format("[{0}] {1}", jobStep.CurStep(),runInfo);
jobStep.Msg = msg;
MissionSys.AssignMission(agv,SettingString.Leave);
UpdateJobTaskInfo(agv.CurTaskName, agv.CurTaskID);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
......
using Common;
namespace DeviceLibrary
{
/// <summary>
/// 待机任务
/// </summary>
public class StandyJob : Job
{
/// <summary>
/// 出完满料后-空车返回任务
/// </summary>
/// <param name="agvPlae">小车当前位置,空表示在待机位</param>
public StandyJob(string agvPlae)
{
this.agvPlace = agvPlae;
}
/// <summary>
/// 接收任务时,agv的位置
/// </summary>
private string agvPlace = "";
private string runInfo = "";
/// <summary>
/// 运行信息
/// </summary>
public override string RunInfo
{
get { return string.Format("待机任务[{0}][{1}]:{2}", CurTaskID, CurTaskState, runInfo); }
}
private JobStep<EXECUTE_STEP> curJobStep = new JobStep<EXECUTE_STEP>(EXECUTE_STEP.NONE);
/// <summary>
/// 空车返回执行
/// </summary>
/// <param name="agv"></param>
public override Job Execute(Agv_Info agv)
{
string msg = agv.Name + " ";
bool rtn = false;
agv.Msg = "";
CurTaskState = MissionSys.GetTakJobState(CurTaskID);
if (curJobStep.IsStep(EXECUTE_STEP.NONE))
{
if (agvPlace.Equals(SettingString.Standby))//在待机位不操作
{
curJobStep.ToNextStep(EXECUTE_STEP.END);
runInfo = "在待机位,不执行操作";
msg += runInfo;
curJobStep.Msg = msg;
}
else if (agvPlace.StartsWith(SettingString.RoomC_Name_Prefix))
{
curJobStep.ToNextStep(EXECUTE_STEP.WAIT_AGV_REACH_4D_DOOR);
runInfo = "从当前位置" + agvPlace + "回到待机位,先到"+SettingString.RoomD_Name+"门";
msg += runInfo;
curJobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.DoorCToD);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
else
{
curJobStep.ToNextStep(EXECUTE_STEP.WAIT_REACH_STANDBY);
runInfo = "从当前位置" + agvPlace + "回到待机位";
msg += runInfo;
curJobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
else if (curJobStep.IsStep(EXECUTE_STEP.WAIT_AGV_REACH_4D_DOOR))
{
if (MissionSys.CheckTaskFinished(agv, SettingString.DoorCToD, CurTaskState))
{
curJobStep.ToNextStep(EXECUTE_STEP.WAIT_REACH_STANDBY);
runInfo = "从"+SettingString.RoomD_Name+"门回到待机位";
msg += runInfo;
curJobStep.Msg = msg;
MissionSys.AssignMission(agv, SettingString.Standby);
UpdateJobTaskInfo(agv.CurTarName, agv.CurTaskID);
}
}
else if (curJobStep.IsStep(EXECUTE_STEP.WAIT_REACH_STANDBY))
{
if (MissionSys.CheckTaskFinished(agv, SettingString.Standby, CurTaskState))
{
curJobStep.ToNextStep(EXECUTE_STEP.END);
runInfo = "到达待机位";
msg += runInfo;
curJobStep.Msg = msg;
}
}
else if (curJobStep.IsStep(EXECUTE_STEP.END))
{
Job job = AGVManager.control.GetJob(agv);
if (job != null && !(job is StandyJob))
{
runInfo = "在待机位检测到任务,执行任务";
msg += runInfo;
curJobStep.Msg = msg;
return job;
}
}
return this;
}
/// <summary>
/// 执行流程
/// </summary>
private enum EXECUTE_STEP
{
/// <summary>
///
/// </summary>
NONE,
/// <summary>
/// 等待到达4D门
/// </summary>
WAIT_AGV_REACH_4D_DOOR,
/// <summary>
/// 等待到达待机位
/// </summary>
WAIT_REACH_STANDBY,
/// <summary>
///
/// </summary>
END
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
namespace DeviceLibrary
{
......@@ -48,7 +44,7 @@ namespace DeviceLibrary
/// <summary>
/// 节点位置坐标
/// </summary>
public PositionStru position;
public PointF Position;
/// <summary>
/// 料架数量信息
/// </summary>
......@@ -56,9 +52,9 @@ namespace DeviceLibrary
{
get
{
if(Common.missionManager !=null && Common.missionManager.GetUnlockInfo(Name) !=null)
if(AGVManager.unlockManager !=null && AGVManager.unlockManager.GetUnlockInfo(Name) !=null)
{
return Common.missionManager.GetUnlockCnt(Name);
return AGVManager.unlockManager.GetUnlockCnt(Name);
}
return 0;
}
......@@ -136,7 +132,7 @@ namespace DeviceLibrary
Online = false;
}
public virtual Job GetNewJob(Agv_Info agv)
public override Job GetNewJob(Agv_Info agv)
{
return null;
}
......
......@@ -3,9 +3,11 @@ using System.Collections.Generic;
using System.IO;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using Common;
using static DeviceLibrary.Agv_Info;
namespace DeviceLibrary
{
......@@ -21,17 +23,85 @@ namespace DeviceLibrary
/// 小车信息
/// </summary>
public static List<Agv_Info> agvInfo;
public static System.Windows.Forms.TextBox logTextBox;
public static System.Windows.Forms.DataGridView missionView;
public static AgvServer server;
public static Control control;
public static WebService web;
public static UnlockMissionManager unlockManager;
public static ChargeManager Charge;
//public static StandbyManager Standby;
public static List<JobType> jobTypes;
public static readonly string CONFIG_PATH = AppDomain.CurrentDomain.BaseDirectory + "Config\\";
/// <summary>
/// 初始化配置
/// </summary>
public static void Init()
{
string path;
string[] line;
string[] temp;
bool isuse;
string rfid = "";
Charge = new ChargeManager();
//Standby = new StandbyManager();
agvInfo = new List<Agv_Info>();
jobTypes = new List<JobType>();
jobTypes.Add(new JobForRoomD());
jobTypes.Add(new ChargeJobType());
path = CONFIG_PATH + SettingString.FileName_AGV;
line = File.ReadAllLines(path, Encoding.UTF8);
for (int i = 1; i < line.Length; i++)
{
temp = line[i].Split(',');
if (temp.Length != 5) continue;
bool.TryParse(ReadIni(temp[1], SettingString.IsUse), out isuse);
rfid = ReadIni(temp[1], SettingString.RFID);
agvInfo.Add(new Agv_Info(temp[0], temp[1], temp[2], temp[3], temp[4], isuse, rfid));
}
//任务加载
MissionSys.Init();
//节点加载
nodeInfo = new List<ClientNode>();
path = CONFIG_PATH + SettingString.FileName_AgvProductionLine;
line = System.IO.File.ReadAllLines(path, Encoding.GetEncoding("gb2312"));
for (int i = 1; i < line.Length; i++)
{
temp = line[i].Split(',');
if (temp.Length != 6) continue;
Boolean.TryParse(ReadIni(temp[1], SettingString.IsUse), out bool isUse);
Int32.TryParse(ReadIni(temp[1], SettingString.EmptyShelfCnt), out int emptyShelfCnt);
nodeInfo.Add(new ClientNode(temp[1], temp[2], temp[3], temp[0], temp[4], temp[5], isUse, emptyShelfCnt));
}
//读取解绑信息
AGVManager.ReadUnlockLineInfo();
}
/// <summary>
/// 读取配置
/// </summary>
/// <param name="section"></param>
/// <param name="key"></param>
/// <returns></returns>
public static string ReadIni(string section, string key)
{
return IniFileHelper.ReadValue(section, key, CONFIG_PATH + SettingString.FileName_tempData);
}
/// <summary>
/// 写入配置
/// </summary>
/// <param name="section"></param>
/// <param name="key"></param>
/// <param name="value"></param>
public static void WriteIni(string section, string key, string value)
{
IniFileHelper.WriteValue(section, key, value, CONFIG_PATH + SettingString.FileName_tempData);
}
/// <summary>
/// 根据线体名获取节点名
/// </summary>
/// <param name="lineName"></param>
......@@ -679,7 +749,7 @@ namespace DeviceLibrary
return nodeName;
foreach (var item in clientNodes)
{
double dis = Math.Sqrt(Math.Pow((agv.Position.x - item.position.X), 2) + Math.Pow((agv.Position.y - item.position.Y), 2));
double dis = Math.Sqrt(Math.Pow((agv.Position.Point.X - item.Position.X), 2) + Math.Pow((agv.Position.Point.Y - item.Position.Y), 2));
log.Debug(string.Format("{0} 距离{1}={2}", agv.Name, item.Name, dis.ToString("f2")));
if (dis < minDis)
{
......@@ -755,9 +825,9 @@ namespace DeviceLibrary
Thread.Sleep(50);
if (rtn)
{
clientNode.position.X = mirPosition.pos_x;
clientNode.position.Y = mirPosition.pos_y;
log.Debug(string.Format("软件开启:{0} 获取节点位置({1},{2})", clientNode.Name, clientNode.position.X, clientNode.position.Y));
clientNode.Position.X = mirPosition.Point.X;
clientNode.Position.Y = mirPosition.Point.Y;
log.Debug(string.Format("软件开启:{0} 获取节点位置({1},{2})", clientNode.Name, clientNode.Position.X, clientNode.Position.Y));
}
else
{
......
......@@ -2,6 +2,7 @@
using RestSharp;
using System;
using System.Collections.Generic;
using System.Drawing;
namespace DeviceLibrary
{
......@@ -134,9 +135,9 @@ namespace DeviceLibrary
tempLocation = "4CFeederIn";
}
if (Common.GetNodeNameByLineName(tempLocation, out string loc))
if (AGVManager.GetNodeNameByLineName(tempLocation, out string loc))
{
int i = Common.FindNode(loc);
int i = AGVManager.FindNode(loc);
if (i > -1)
{
#region 检查是否有空料架要出,有则先出空料架
......@@ -165,7 +166,7 @@ namespace DeviceLibrary
#endregion
res[0].location = loc;
dest = res[0];
Common.GetLineNameByNodeName(loc, out string line);
AGVManager.GetLineNameByNodeName(loc, out string line);
A6_Target = res[0].ShowInfo(line);
log.Debug("查找满料架任务[RFID=" + rfid + "]:目的地为 " + loc + " [产线名 " + line + "]");
return true;
......@@ -217,7 +218,7 @@ namespace DeviceLibrary
//GET /ESMTCommonInterface/CommonService.asmx/UpdateStatusBy?id=string&location=string HTTP/1.1
//Host: 10.85.17.233
Common.GetLineNameByNodeName(nodeName, out string lineName);
AGVManager.GetLineNameByNodeName(nodeName, out string lineName);
if (lineName.Equals("FeederIn"))
{
lineName = "Feeder";
......@@ -707,25 +708,4 @@ namespace DeviceLibrary
public Dictionary<string, string> data { get; set; }
}
/// <summary>
/// Mir位置
/// </summary>
public class MirPosition
{
/// <summary>
/// 位置名称
/// </summary>
public string name { get; set; }
/// <summary>
/// X轴方位
/// </summary>
public double orientation { set; get; }
/// <summary>
/// x轴
/// </summary>
public double pos_x { get; set; }
public double pos_y { get; set; }
}
}
using System;
using Common;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
......@@ -25,7 +26,7 @@ namespace DeviceLibrary
UnlockMissions = new Dictionary<string, UnlockInfo>();
foreach (ClientNode item in clientNodes)
{
if (item.Name.StartsWith("A") || item.Name.Equals(SettingString.D4FeederIn) || item.Name.Equals(SettingString.C4FeederIn))
if (item.Name.StartsWith("A") || item.Name.Equals(SettingString.RoomCFeederIn) || item.Name.Equals(SettingString.RoomDFeederIn))
continue;
NodeUnlockMissions.Add(item.Name, new UnlockedShelf());
UnlockMissions = new Dictionary<string, UnlockInfo>();
......@@ -75,12 +76,12 @@ namespace DeviceLibrary
{
UnlockMissions[nodeName] = new UnlockInfo(nodeName, NodeUnlockMissions[nodeName].EmptyCnt, NodeUnlockMissions[nodeName].GetRfidWithTime());
WriteUnlockLineInfo();
Common.WriteIni(nodeName, SettingString.EmptyShelfCnt, NodeUnlockMissions[nodeName].EmptyCnt.ToString());
Common.LogInfo(string.Format("{0}解绑任务添加成功:RFID={1}", nodeName, rfid));
AGVManager.WriteIni(nodeName, SettingString.EmptyShelfCnt, NodeUnlockMissions[nodeName].EmptyCnt.ToString());
LogUtil.info(string.Format("{0}解绑任务添加成功:RFID={1}", nodeName, rfid));
MissionChanged?.Invoke(UnlockMissions);
}
else
Common.LogInfo(string.Format("{0}解绑任务添加失败:RFID={1}", nodeName, rfid));
LogUtil.info(string.Format("{0}解绑任务添加失败:RFID={1}", nodeName, rfid));
return rtn;
}
public bool DelMission(string nodeName, string rfid)
......@@ -90,12 +91,12 @@ namespace DeviceLibrary
{
UnlockMissions[nodeName] = new UnlockInfo(nodeName, NodeUnlockMissions[nodeName].EmptyCnt, NodeUnlockMissions[nodeName].GetRfidWithTime());
WriteUnlockLineInfo();
Common.WriteIni(nodeName, SettingString.EmptyShelfCnt, NodeUnlockMissions[nodeName].EmptyCnt.ToString());
Common.LogInfo(string.Format("{0}解绑任务删除成功:RFID={1}", nodeName, rfid));
AGVManager.WriteIni(nodeName, SettingString.EmptyShelfCnt, NodeUnlockMissions[nodeName].EmptyCnt.ToString());
LogUtil.info(string.Format("{0}解绑任务删除成功:RFID={1}", nodeName, rfid));
MissionChanged?.Invoke(UnlockMissions);
}
else
Common.LogInfo(string.Format("{0}解绑任务删除失败:RFID={1}", nodeName, rfid));
LogUtil.info(string.Format("{0}解绑任务删除失败:RFID={1}", nodeName, rfid));
return rtn;
}
/// <summary>
......@@ -103,7 +104,7 @@ namespace DeviceLibrary
/// </summary>
void WriteUnlockLineInfo()
{
using (System.IO.StreamWriter file = new System.IO.StreamWriter(Common.CONFIG_PATH + "UnlockInfo.json"))
using (System.IO.StreamWriter file = new System.IO.StreamWriter(AGVManager.CONFIG_PATH + "UnlockInfo.json"))
{
string s = JsonHelper.SerializeObject(this);
file.WriteLine(s);
......@@ -119,7 +120,7 @@ namespace DeviceLibrary
public List<UnlockRfid> UnlockRfids { get; private set; }
public UnlockInfo(string nodeName, int count, Dictionary<string, string> rfids)
{
if (Common.GetLineNameByNodeName(nodeName, out string line))
if (AGVManager.GetLineNameByNodeName(nodeName, out string line))
{
Line = line;
}
......
......@@ -54,7 +54,7 @@ namespace DeviceLibrary
int tmp = EmptyCnt;
System.Threading.Interlocked.Increment(ref tmp);
EmptyCnt = tmp;
Rfids.Add(rfid, DateTime.Now.ToString("yyyy/MM/dd/HH:mm:ss,fff"));
Rfids.Add(rfid, DateTime.Now.ToString("MM/dd/HH:mm:ss,fff"));
return true;
}
return false;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!