Commit ac0f8736 张东亮

0730

1 个父辈 7671eff8
......@@ -435,7 +435,7 @@ namespace AGVControl
/// <summary>
/// 负载
/// </summary>
public bool IsExistShelf { private set; get; } = false;
public bool IsExistShelf { private set; get; } = true;
/// <summary>
/// 小车的状态,(从小车获取)
/// </summary>
......
......@@ -142,7 +142,6 @@ namespace BLL
Thread.Sleep(1500);
for (int i = 0; i < Common.agvInfo.Count; i++)
{
Thread.Sleep(1000);
if (!loop) break;
if (!Common.agvInfo[i].IsCon) continue; //AGV网络连接
if (!Common.agvInfo[i].IsUse) continue; //AGV是否可用
......@@ -597,7 +596,7 @@ namespace BLL
return false;
//A6出满料
rtn = FindA6Leave(out string nextNode);
if (rtn)
if (rtn && !agv.IsExistShelf)
{
rtn = Common.mir.Add_Mission(agv, Common.agvMission["MoveA6"]);
if (rtn)
......@@ -877,6 +876,10 @@ namespace BLL
return;
}
}
StatusCharge(agv, true);
agv.Msg = string.Format("{0} 大料架[RFID={1}]解绑,A5、A6暂无空位,运往[{2}]", agv.Name, agv.RFID,"待机位");
Common.LogInfo(string.Format("{0} 大料架[RFID={1}]解绑,A5、A6暂无空位,运往[{2}]", agv.Name, agv.RFID, "待机位"));
}
}
......@@ -1054,7 +1057,10 @@ namespace BLL
return false;
}
}
catch { return false; }
catch (Exception ex)
{
Common.log.Error(ex.Message);
return false; }
return false;
}
......@@ -1802,11 +1808,12 @@ namespace BLL
}
}
#endregion
//if (Common.nodeInfo[i].AgvName.Equals("").Equals(false))//有小车在目标任务点,等待结束后再接任务
//{
// Common.LogInfo("节点[" + loc + "]当前有任务,延迟A6出满料架任务");
// return false;
//}
if (Common.nodeInfo[i].Name.StartsWith("G") && Common.nodeInfo[i].AgvName.Equals("").Equals(false))//有小车在目标任务点(限制4C车间),等待结束后再接任务
{
Common.LogInfo("节点[" + loc + "]当前有任务,延迟A6出满料架任务");
return false;
}
//检查是否有车接到满料架任务,有则不再重复分配
int id = Common.agvInfo.FindIndex(s => s.RFID == rfid);
......
......@@ -46,12 +46,7 @@
this.Column17 = new System.Windows.Forms.DataGridViewButtonColumn();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.cmbBoxLineName = new System.Windows.Forms.ComboBox();
this.btnDeleteMission = new System.Windows.Forms.Button();
this.dgvLineMission = new System.Windows.Forms.DataGridView();
this.Column24 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.DgvNode = new System.Windows.Forms.DataGridView();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
......@@ -62,6 +57,12 @@
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column16 = new System.Windows.Forms.DataGridViewButtonColumn();
this.Column15 = new System.Windows.Forms.DataGridViewButtonColumn();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.cmbBoxLineName = new System.Windows.Forms.ComboBox();
this.btnDeleteMission = new System.Windows.Forms.Button();
this.dgvLineMission = new System.Windows.Forms.DataGridView();
this.Column24 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.TxtLog = new System.Windows.Forms.TextBox();
......@@ -92,19 +93,19 @@
this.BtnMissionPause = new System.Windows.Forms.Button();
this.BtnMissionReady = new System.Windows.Forms.Button();
this.LstAgvPlace = new System.Windows.Forms.ListBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.btnAddMission = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.DgvAgv)).BeginInit();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.DgvNode)).BeginInit();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvLineMission)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.DgvNode)).BeginInit();
this.tabPage2.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.tabPage3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout();
this.SuspendLayout();
//
......@@ -286,67 +287,20 @@
this.tabPage1.Text = "节点状态&产线任务";
this.tabPage1.UseVisualStyleBackColor = true;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.cmbBoxLineName);
this.groupBox1.Controls.Add(this.btnDeleteMission);
this.groupBox1.Controls.Add(this.dgvLineMission);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(1207, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(512, 546);
this.groupBox1.TabIndex = 33;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "产线任务";
//
// cmbBoxLineName
//
this.cmbBoxLineName.FormattingEnabled = true;
this.cmbBoxLineName.Location = new System.Drawing.Point(399, 100);
this.cmbBoxLineName.Name = "cmbBoxLineName";
this.cmbBoxLineName.Size = new System.Drawing.Size(96, 23);
this.cmbBoxLineName.TabIndex = 38;
//
// btnDeleteMission
//
this.btnDeleteMission.Location = new System.Drawing.Point(395, 148);
this.btnDeleteMission.Name = "btnDeleteMission";
this.btnDeleteMission.Size = new System.Drawing.Size(100, 48);
this.btnDeleteMission.TabIndex = 35;
this.btnDeleteMission.Text = "删除任务";
this.btnDeleteMission.UseVisualStyleBackColor = true;
this.btnDeleteMission.Click += new System.EventHandler(this.btnDeleteMission_Click);
//
// dgvLineMission
//
this.dgvLineMission.AllowUserToAddRows = false;
this.dgvLineMission.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvLineMission.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column24,
this.Column8});
this.dgvLineMission.Dock = System.Windows.Forms.DockStyle.Left;
this.dgvLineMission.Location = new System.Drawing.Point(3, 21);
this.dgvLineMission.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.dgvLineMission.Name = "dgvLineMission";
this.dgvLineMission.RowHeadersVisible = false;
this.dgvLineMission.RowHeadersWidth = 51;
this.dgvLineMission.RowTemplate.Height = 27;
this.dgvLineMission.Size = new System.Drawing.Size(386, 522);
this.dgvLineMission.TabIndex = 28;
//
// Column24
//
this.Column24.HeaderText = "时间";
this.Column24.MinimumWidth = 6;
this.Column24.Name = "Column24";
this.Column24.Width = 180;
//
// Column8
// tableLayoutPanel2
//
this.Column8.HeaderText = "任务";
this.Column8.MinimumWidth = 6;
this.Column8.Name = "Column8";
this.Column8.Width = 80;
this.tableLayoutPanel2.ColumnCount = 2;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 69.9422F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30.0578F));
this.tableLayoutPanel2.Controls.Add(this.DgvNode, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.groupBox1, 1, 0);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(4, 4);
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(1722, 552);
this.tableLayoutPanel2.TabIndex = 34;
//
// DgvNode
//
......@@ -455,6 +409,69 @@
this.Column15.ReadOnly = true;
this.Column15.Width = 80;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.btnAddMission);
this.groupBox1.Controls.Add(this.cmbBoxLineName);
this.groupBox1.Controls.Add(this.btnDeleteMission);
this.groupBox1.Controls.Add(this.dgvLineMission);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(1207, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(512, 546);
this.groupBox1.TabIndex = 33;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "产线任务";
//
// cmbBoxLineName
//
this.cmbBoxLineName.FormattingEnabled = true;
this.cmbBoxLineName.Location = new System.Drawing.Point(390, 101);
this.cmbBoxLineName.Name = "cmbBoxLineName";
this.cmbBoxLineName.Size = new System.Drawing.Size(122, 23);
this.cmbBoxLineName.TabIndex = 38;
//
// btnDeleteMission
//
this.btnDeleteMission.Location = new System.Drawing.Point(395, 175);
this.btnDeleteMission.Name = "btnDeleteMission";
this.btnDeleteMission.Size = new System.Drawing.Size(100, 48);
this.btnDeleteMission.TabIndex = 35;
this.btnDeleteMission.Text = "删除任务";
this.btnDeleteMission.UseVisualStyleBackColor = true;
this.btnDeleteMission.Click += new System.EventHandler(this.btnDeleteMission_Click);
//
// dgvLineMission
//
this.dgvLineMission.AllowUserToAddRows = false;
this.dgvLineMission.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvLineMission.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column24,
this.Column8});
this.dgvLineMission.Dock = System.Windows.Forms.DockStyle.Left;
this.dgvLineMission.Location = new System.Drawing.Point(3, 21);
this.dgvLineMission.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.dgvLineMission.Name = "dgvLineMission";
this.dgvLineMission.RowHeadersVisible = false;
this.dgvLineMission.RowHeadersWidth = 51;
this.dgvLineMission.RowTemplate.Height = 27;
this.dgvLineMission.Size = new System.Drawing.Size(386, 522);
this.dgvLineMission.TabIndex = 28;
//
// Column24
//
this.Column24.HeaderText = "时间";
this.Column24.MinimumWidth = 6;
this.Column24.Name = "Column24";
this.Column24.Width = 180;
//
// Column8
//
this.Column8.HeaderText = "任务";
this.Column8.MinimumWidth = 6;
this.Column8.Name = "Column8";
this.Column8.Width = 80;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.tableLayoutPanel1);
......@@ -478,7 +495,7 @@
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 564F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 552F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(1722, 552);
this.tableLayoutPanel1.TabIndex = 6;
//
......@@ -795,21 +812,6 @@
this.LstAgvPlace.Size = new System.Drawing.Size(199, 544);
this.LstAgvPlace.TabIndex = 0;
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 2;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 69.9422F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30.0578F));
this.tableLayoutPanel2.Controls.Add(this.DgvNode, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.groupBox1, 1, 0);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(4, 4);
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(1722, 552);
this.tableLayoutPanel2.TabIndex = 34;
//
// tableLayoutPanel3
//
this.tableLayoutPanel3.ColumnCount = 1;
......@@ -825,6 +827,16 @@
this.tableLayoutPanel3.Size = new System.Drawing.Size(1746, 776);
this.tableLayoutPanel3.TabIndex = 7;
//
// btnAddMission
//
this.btnAddMission.Location = new System.Drawing.Point(395, 275);
this.btnAddMission.Name = "btnAddMission";
this.btnAddMission.Size = new System.Drawing.Size(100, 48);
this.btnAddMission.TabIndex = 39;
this.btnAddMission.Text = "添加任务";
this.btnAddMission.UseVisualStyleBackColor = true;
this.btnAddMission.Click += new System.EventHandler(this.btnAddMission_Click);
//
// FrmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
......@@ -841,9 +853,10 @@
((System.ComponentModel.ISupportInitialize)(this.DgvAgv)).EndInit();
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.DgvNode)).EndInit();
this.groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvLineMission)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.DgvNode)).EndInit();
this.tabPage2.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
......@@ -851,7 +864,6 @@
this.tabPage3.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel3.ResumeLayout(false);
this.ResumeLayout(false);
......@@ -923,6 +935,7 @@
private System.Windows.Forms.DataGridViewTextBoxColumn Column8;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
private System.Windows.Forms.Button btnAddMission;
}
}
......@@ -205,7 +205,7 @@ namespace AGVControl
{
Common.agvInfo[e.RowIndex].IsUse = !Common.agvInfo[e.RowIndex].IsUse;
DgvAgv.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = Common.agvInfo[e.RowIndex].IsUse.ToString();
Common.appConfig.AppSettings.Settings[Common.agvInfo[e.RowIndex].Name].Value = Common.agvInfo[e.RowIndex].IsUse.ToString()+","+ Common.agvInfo[e.RowIndex].RFID;
Common.appConfig.AppSettings.Settings[Common.agvInfo[e.RowIndex].Name].Value = Common.agvInfo[e.RowIndex].IsUse.ToString() + "," + Common.agvInfo[e.RowIndex].RFID;
Common.appConfig.Save();
}
else if (e.ColumnIndex == 13) //清除缓存
......@@ -495,7 +495,7 @@ namespace AGVControl
Task.Factory.StartNew(new Action(() =>
{
Common.IsAllowLeaveOrEnter = true;
Common.LogInfo("IsAllowLeaveOrEnter="+ Common.IsAllowLeaveOrEnter);
Common.LogInfo("IsAllowLeaveOrEnter=" + Common.IsAllowLeaveOrEnter);
Thread.Sleep(20000);
Common.IsAllowLeaveOrEnter = false;
Common.LogInfo("IsAllowLeaveOrEnter=" + Common.IsAllowLeaveOrEnter);
......@@ -512,9 +512,41 @@ namespace AGVControl
if (Common.agvInfo[idx].IsCon)
{
Common.agvInfo[idx].RFID = txtAgvRFID.Text.ToUpper();
Common.LogInfo("手动设置 " + Common.agvInfo[idx].Name +" RFID="+ txtAgvRFID.Text);
Common.LogInfo("手动设置 " + Common.agvInfo[idx].Name + " RFID=" + txtAgvRFID.Text);
}
}
private void btnAddMission_Click(object sender, EventArgs e)
{
try
{
if (cmbBoxLineName.SelectedItem == null || cmbBoxLineName.SelectedIndex == 0)
{
ShowEmptyTask();
return;
}
if (cmbBoxLineName.SelectedItem.ToString().StartsWith("A"))
return;
if (MessageBox.Show("确定添加产线任务[" + cmbBoxLineName.SelectedItem.ToString() + "]") == DialogResult.Cancel)
return;
if (Common.AddLinePlace(Common.agvProductionLine[cmbBoxLineName.SelectedItem.ToString()]))
{
ShowEmptyTask();
Common.LogInfo("手动添加任务成功:" + cmbBoxLineName.SelectedItem.ToString());
}
else
{
ShowEmptyTask();
Common.LogInfo("手动添加任务失败");
}
}
catch (Exception ex)
{
ShowEmptyTask();
Common.log.Error("手动添加任务失败:" + ex.Message);
}
}
}
}
......@@ -47,4 +47,3 @@ C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csproj.CopyComplete
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.exe
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.pdb
C:\myproject\Gitee\AGVControl-Qisda-ProductionLine\AGVControl-ProductionLine\obj\Debug\AGVControl-ProductionLine.csprojAssemblyReference.cache
......@@ -151,7 +151,6 @@ namespace BLL
catch { return false; }
return false;
}
private class Msg
{
public string msg { get; set; }
......
......@@ -126,7 +126,7 @@
//
// button6
//
this.button6.Location = new System.Drawing.Point(676, 167);
this.button6.Location = new System.Drawing.Point(735, 41);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(132, 54);
this.button6.TabIndex = 9;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!