diff --git a/Rs.Controls/RsTray.Designer.cs b/Rs.Controls/RsTray.Designer.cs index d3bde7d..60f8db0 100644 --- a/Rs.Controls/RsTray.Designer.cs +++ b/Rs.Controls/RsTray.Designer.cs @@ -28,15 +28,17 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); this.panel2 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.lblStatus = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); - this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(); this.设置无料ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.设置有料ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.禁用ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.panel1.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -59,23 +61,52 @@ // this.panel1.BackColor = System.Drawing.SystemColors.ActiveCaption; this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panel1.Controls.Add(this.label1); + this.panel1.Controls.Add(this.tableLayoutPanel1); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(288, 38); this.panel1.TabIndex = 2; // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); + this.tableLayoutPanel1.ColumnCount = 2; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.Controls.Add(this.lblStatus, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + 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.Size = new System.Drawing.Size(286, 36); + this.tableLayoutPanel1.TabIndex = 0; + // + // lblStatus + // + this.lblStatus.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); + this.lblStatus.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblStatus.Font = new System.Drawing.Font("宋体", 13F); + this.lblStatus.ForeColor = System.Drawing.Color.White; + this.lblStatus.Location = new System.Drawing.Point(146, 0); + this.lblStatus.Name = "lblStatus"; + this.lblStatus.Size = new System.Drawing.Size(137, 36); + this.lblStatus.TabIndex = 2; + this.lblStatus.Text = "IDLE"; + this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // label1 // this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.label1.Dock = System.Windows.Forms.DockStyle.Fill; this.label1.Font = new System.Drawing.Font("宋体", 13F); this.label1.ForeColor = System.Drawing.Color.White; - this.label1.Location = new System.Drawing.Point(0, 0); + this.label1.Location = new System.Drawing.Point(3, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(286, 36); - this.label1.TabIndex = 0; + this.label1.Size = new System.Drawing.Size(137, 36); + this.label1.TabIndex = 1; this.label1.Text = "label1"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // @@ -119,6 +150,7 @@ this.Name = "RsTray"; this.Size = new System.Drawing.Size(288, 342); this.panel1.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false); this.ResumeLayout(false); @@ -128,10 +160,12 @@ private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Label label1; private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.ToolStripMenuItem 设置无料ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 设置有料ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 禁用ToolStripMenuItem; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label lblStatus; + private System.Windows.Forms.Label label1; } } diff --git a/Rs.Controls/RsTray.cs b/Rs.Controls/RsTray.cs index 717ed72..324923a 100644 --- a/Rs.Controls/RsTray.cs +++ b/Rs.Controls/RsTray.cs @@ -39,6 +39,19 @@ namespace Rs.Controls public string ItemName { get; set; } public ESortDir SortDir { get; set; } = ESortDir.Horizontal; public event Action SlotClickEvent; + + private string mStatus; + + public string Status + { + get { return mStatus; } + set { + mStatus = value; + lblStatus.Text = mStatus; + Invalidate(); + } + } + public RsTray() { InitializeComponent(); diff --git a/Rs.Motion/Ztm/ZtmCardManager.cs b/Rs.Motion/Ztm/ZtmCardManager.cs index 75a1c3c..e71e2b5 100644 --- a/Rs.Motion/Ztm/ZtmCardManager.cs +++ b/Rs.Motion/Ztm/ZtmCardManager.cs @@ -115,11 +115,11 @@ namespace Rs.Motion.GugaoEcat } } IsInitialized = true; + LogHelper.Debug("rs motion card init ok"); return ErrorCode.Ok; } public ICard GetCard(short cardID) { - ICard card; if(cardDic.ContainsKey((ushort)cardID)) return cardDic[(ushort)cardID]; if(mcDic.ContainsKey(cardID))