Commit 4b7b6377 张东亮

1222

1 个父辈 e98428f4
......@@ -21,6 +21,7 @@
<file value="logs/AgvServer.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<param name="MaxSizeRollBackups" value="60"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
......@@ -31,6 +32,7 @@
<file value="logs/MiR_API.log"/>
<param name="Encoding" value="UTF-8"/>
<appendToFile value="true"/>
<param name="MaxSizeRollBackups" value="30"/>
<rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout">
......@@ -42,12 +44,12 @@
<appender-ref ref="MiR_API"/>
</logger>
<logger name="AgvServer">
<level value="Debug"/>
<level value="Info"/>
<appender-ref ref="AgvServer"/>
</logger>
<root>
<level value="Info"/>
<appender-ref ref="AGVControl_SMD_BOX"/>
<appender-ref ref="AGV_3D_SMD"/>
</root>
</log4net>
<appSettings>
......
......@@ -34,7 +34,6 @@
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
......@@ -52,16 +51,16 @@
this.panelNode = new System.Windows.Forms.Panel();
this.groupBoxNode = new System.Windows.Forms.GroupBox();
this.DgvNode = new System.Windows.Forms.DataGridView();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column16 = new System.Windows.Forms.DataGridViewButtonColumn();
this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel3.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
......@@ -69,6 +68,7 @@
this.panelNode.SuspendLayout();
this.groupBoxNode.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.DgvNode)).BeginInit();
this.tableLayoutPanel2.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel3
......@@ -110,21 +110,6 @@
this.tabPage1.Text = "状态显示";
this.tabPage1.UseVisualStyleBackColor = true;
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 1;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel2.Controls.Add(this.panelNode, 0, 0);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(2);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 1;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(1170, 418);
this.tableLayoutPanel2.TabIndex = 34;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.groupBox1);
......@@ -132,7 +117,7 @@
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(1176, 402);
this.tabPage3.Size = new System.Drawing.Size(1176, 424);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "手动&日志";
this.tabPage3.UseVisualStyleBackColor = true;
......@@ -143,7 +128,7 @@
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(3, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(752, 396);
this.groupBox1.Size = new System.Drawing.Size(752, 418);
this.groupBox1.TabIndex = 33;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "日志";
......@@ -153,7 +138,7 @@
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Location = new System.Drawing.Point(3, 17);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(746, 376);
this.richTextBox1.Size = new System.Drawing.Size(746, 398);
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = "";
//
......@@ -165,7 +150,7 @@
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(418, 396);
this.groupBox2.Size = new System.Drawing.Size(418, 418);
this.groupBox2.TabIndex = 32;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "AGV手动";
......@@ -176,7 +161,7 @@
this.tabControlAGV.Location = new System.Drawing.Point(2, 16);
this.tabControlAGV.Name = "tabControlAGV";
this.tabControlAGV.SelectedIndex = 0;
this.tabControlAGV.Size = new System.Drawing.Size(414, 378);
this.tabControlAGV.Size = new System.Drawing.Size(414, 400);
this.tabControlAGV.TabIndex = 47;
//
// tableLayoutPanel4
......@@ -190,7 +175,7 @@
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, 339F));
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 373F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(1186, 373);
this.tableLayoutPanel4.TabIndex = 8;
//
......@@ -275,19 +260,17 @@
// panelNode
//
this.panelNode.Controls.Add(this.groupBoxNode);
this.panelNode.Dock = System.Windows.Forms.DockStyle.Left;
this.panelNode.Location = new System.Drawing.Point(3, 3);
this.panelNode.Name = "panelNode";
this.panelNode.Size = new System.Drawing.Size(511, 412);
this.panelNode.Size = new System.Drawing.Size(723, 412);
this.panelNode.TabIndex = 0;
//
// groupBoxNode
//
this.groupBoxNode.Controls.Add(this.DgvNode);
this.groupBoxNode.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBoxNode.Location = new System.Drawing.Point(0, 0);
this.groupBoxNode.Name = "groupBoxNode";
this.groupBoxNode.Size = new System.Drawing.Size(511, 412);
this.groupBoxNode.Size = new System.Drawing.Size(711, 412);
this.groupBoxNode.TabIndex = 0;
this.groupBoxNode.TabStop = false;
this.groupBoxNode.Text = "节点状态";
......@@ -327,27 +310,35 @@
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.DgvNode.RowsDefaultCellStyle = dataGridViewCellStyle2;
this.DgvNode.RowTemplate.Height = 23;
this.DgvNode.Size = new System.Drawing.Size(505, 392);
this.DgvNode.Size = new System.Drawing.Size(705, 392);
this.DgvNode.TabIndex = 3;
this.DgvNode.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.DgvNode_CellClick);
//
// Column6
// Column16
//
this.Column6.FillWeight = 107.563F;
this.Column6.HeaderText = "地点";
this.Column6.MinimumWidth = 6;
this.Column6.Name = "Column6";
this.Column6.ReadOnly = true;
this.Column6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column16.FillWeight = 107.563F;
this.Column16.HeaderText = "调用";
this.Column16.MinimumWidth = 6;
this.Column16.Name = "Column16";
this.Column16.ReadOnly = true;
//
// Column7
// Column5
//
this.Column7.FillWeight = 107.563F;
this.Column7.HeaderText = "动作";
this.Column7.MinimumWidth = 6;
this.Column7.Name = "Column7";
this.Column7.ReadOnly = true;
this.Column7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column5.FillWeight = 107.563F;
this.Column5.HeaderText = "连接";
this.Column5.MinimumWidth = 6;
this.Column5.Name = "Column5";
this.Column5.ReadOnly = true;
this.Column5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column9
//
this.Column9.FillWeight = 107.563F;
this.Column9.HeaderText = "RFID";
this.Column9.MinimumWidth = 6;
this.Column9.Name = "Column9";
this.Column9.ReadOnly = true;
this.Column9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column10
//
......@@ -358,31 +349,38 @@
this.Column10.ReadOnly = true;
this.Column10.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column9
// Column7
//
this.Column9.FillWeight = 107.563F;
this.Column9.HeaderText = "RFID";
this.Column9.MinimumWidth = 6;
this.Column9.Name = "Column9";
this.Column9.ReadOnly = true;
this.Column9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column7.FillWeight = 107.563F;
this.Column7.HeaderText = "动作";
this.Column7.MinimumWidth = 6;
this.Column7.Name = "Column7";
this.Column7.ReadOnly = true;
this.Column7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column5
// Column6
//
this.Column5.FillWeight = 107.563F;
this.Column5.HeaderText = "连接";
this.Column5.MinimumWidth = 6;
this.Column5.Name = "Column5";
this.Column5.ReadOnly = true;
this.Column5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.Column6.FillWeight = 107.563F;
this.Column6.HeaderText = "地点";
this.Column6.MinimumWidth = 6;
this.Column6.Name = "Column6";
this.Column6.ReadOnly = true;
this.Column6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// Column16
// tableLayoutPanel2
//
this.Column16.FillWeight = 107.563F;
this.Column16.HeaderText = "调用";
this.Column16.MinimumWidth = 6;
this.Column16.Name = "Column16";
this.Column16.ReadOnly = true;
this.tableLayoutPanel2.ColumnCount = 1;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel2.Controls.Add(this.panelNode, 0, 0);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(2);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 1;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(1170, 418);
this.tableLayoutPanel2.TabIndex = 34;
//
// FrmMain
//
......@@ -401,7 +399,6 @@
this.tableLayoutPanel3.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
......@@ -409,6 +406,7 @@
this.panelNode.ResumeLayout(false);
this.groupBoxNode.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.DgvNode)).EndInit();
this.tableLayoutPanel2.ResumeLayout(false);
this.ResumeLayout(false);
}
......@@ -417,7 +415,6 @@
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4;
private System.Windows.Forms.FlowLayoutPanel flowPanelKanBan;
private System.Windows.Forms.TabPage tabPage3;
......@@ -432,6 +429,7 @@
private System.Windows.Forms.TabControl tabControlAGV;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.Panel panelNode;
private System.Windows.Forms.GroupBox groupBoxNode;
private System.Windows.Forms.DataGridView DgvNode;
......
......@@ -72,7 +72,6 @@ namespace AGVControl
{
Invoke(new Action(() =>
{
DgvNode.Rows[nodeIndex].DefaultCellStyle.ForeColor = CommonVar.nodeInfo[nodeIndex].Online && CommonVar.nodeInfo[nodeIndex].IsUse ? Color.Black : Color.Red;
DgvNode.Rows[nodeIndex].SetValues(CommonVar.nodeInfo[nodeIndex].ToRow());
}));
System.GC.Collect();
......@@ -83,7 +82,6 @@ namespace AGVControl
Invoke(new Action(() =>
{
DgvNode.Rows[nodeIndex].DefaultCellStyle.ForeColor = CommonVar.nodeInfo[nodeIndex].Online ? Color.Black : Color.Red;
DgvNode.Rows[nodeIndex].SetValues(CommonVar.nodeInfo[nodeIndex].ToRow());
}));
System.GC.Collect();
}
......@@ -129,12 +127,10 @@ namespace AGVControl
ShowConfig();
change = true;
//ChkAutoCharge.Checked = CommonVar.chargeStatus.AutoCharge;
change = false;
// CommonVar.control.AgvChanged += Control_AgvChanged;
CommonVar.server.NodeChanged += Server_NodeChanged;
CommonVar.server.NodeOnline += Server_NodeOnline;
richTextBox1 = LogUtil.logBox;
LogUtil.logBox= richTextBox1;
}
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
......
......@@ -69,6 +69,10 @@ namespace AGV_UI
{
this.Invoke(new Action(() =>
{
if (curBattery < MinBattery)
lblBattery.ForeColor = Color.White;
else
lblBattery.ForeColor = Color.Black;
lblBattery.Text = objs[0] as string;
lblBattery.Image = objs[1] as Image;
}
......
......@@ -298,10 +298,10 @@ namespace DeviceLibrary
else
{
time += sleep;
if (time > 10000)
if (time > 60000)
{
Offline(client);
log.Info("[" + client.IP + "] 超过10s没有收到数据,关闭连接");
log.Debug("[" + client.IP + "] 超过60s没有收到数据,关闭连接");
}
}
}
......@@ -396,9 +396,8 @@ namespace DeviceLibrary
{
CommonVar.nodeInfo[idx].Online = true;
NodeOnline?.Invoke(idx);
NodeChanged?.Invoke(idx);
}
NodeChanged?.Invoke(idx);
if (CommonVar.nodeInfo[idx].CheckNodeStateChanged(node))
{
log.Info( "节点状态更新 " + node.StatetText());
......@@ -417,8 +416,7 @@ namespace DeviceLibrary
int idx = CommonVar.nodeInfo.FindIndex(s => s.Name == client.nodeName[i]);
if (idx == -1) continue;
CommonVar.nodeInfo[idx].Offline();
NodeChanged(idx);
NodeOnline(idx);
NodeOnline?.Invoke(idx);
}
client.nodeName.Clear();
}
......
......@@ -25,10 +25,6 @@ namespace DeviceLibrary
/// </summary>
public ScopeLimit limitArea;
/// <summary>
/// 获取任务打开
/// </summary>
public static bool OpenGetJob = true;
public Control()
{
AgvCallTimer = new System.Timers.Timer
......@@ -87,7 +83,6 @@ namespace DeviceLibrary
{
try
{
// if (!CheckOnline(i)) continue;
CheckOnline(i);
bool change = false;
MiR_API.Get_Task_State(CommonVar.agvInfo[i].CurTaskID, out string stateStr);
......@@ -131,7 +126,7 @@ namespace DeviceLibrary
{
Job job = null;
if (OpenGetJob)
if (agv_Info.IsUse)
{
job = find.GetNewJob(agv_Info);
......@@ -141,6 +136,10 @@ namespace DeviceLibrary
return job;
}
}
else
{
return null;
}
}
}
......@@ -207,7 +206,6 @@ namespace DeviceLibrary
CommonVar.agvInfo[idx].IsCon = true;
LogUtil.info(CommonVar.agvInfo[idx].Name + " Online");
AgvOnline?.Invoke(idx);
AgvChanged?.Invoke(idx);
}
}
else
......@@ -217,11 +215,10 @@ namespace DeviceLibrary
CommonVar.agvInfo[idx].IsCon = false;
LogUtil.info(CommonVar.agvInfo[idx].Name + " Offline");
AgvOnline?.Invoke(idx);
AgvChanged?.Invoke(idx);
}
else
{
LogUtil.info(CommonVar.agvInfo[idx].Name + " Offline");
LogUtil.debug(CommonVar.agvInfo[idx].Name + " Offline");
}
}
return rtn;
......
......@@ -36,7 +36,19 @@ namespace DeviceLibrary
/// <summary>
/// 是否在线
/// </summary>
public bool IsCon { set; get; }
public bool IsCon
{
set
{
if (!value.Equals(isCon))
{
isCon = value;
StateKanban.SetConnectState(isCon);
}
}
get { return isCon; }
}
private bool isCon = false;
/// <summary>
/// 是否可用
/// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!