增加料盘的状态显示/增加在卡加载完成时的日志

master
lhiven 2 years ago
parent 2e04ae084a
commit f4312bcab6

@ -28,15 +28,17 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
this.panel1 = 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.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.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -59,23 +61,52 @@
// //
this.panel1.BackColor = System.Drawing.SystemColors.ActiveCaption; this.panel1.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 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.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(288, 38); this.panel1.Size = new System.Drawing.Size(288, 38);
this.panel1.TabIndex = 2; 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 // label1
// //
this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); 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.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Font = new System.Drawing.Font("宋体", 13F); this.label1.Font = new System.Drawing.Font("宋体", 13F);
this.label1.ForeColor = System.Drawing.Color.White; 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.Name = "label1";
this.label1.Size = new System.Drawing.Size(286, 36); this.label1.Size = new System.Drawing.Size(137, 36);
this.label1.TabIndex = 0; this.label1.TabIndex = 1;
this.label1.Text = "label1"; this.label1.Text = "label1";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
@ -119,6 +150,7 @@
this.Name = "RsTray"; this.Name = "RsTray";
this.Size = new System.Drawing.Size(288, 342); this.Size = new System.Drawing.Size(288, 342);
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.contextMenuStrip1.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
@ -128,10 +160,12 @@
private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; 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.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;
} }
} }

@ -39,6 +39,19 @@ namespace Rs.Controls
public string ItemName { get; set; } public string ItemName { get; set; }
public ESortDir SortDir { get; set; } = ESortDir.Horizontal; public ESortDir SortDir { get; set; } = ESortDir.Horizontal;
public event Action<TraySlot, MouseEventArgs> SlotClickEvent; public event Action<TraySlot, MouseEventArgs> SlotClickEvent;
private string mStatus;
public string Status
{
get { return mStatus; }
set {
mStatus = value;
lblStatus.Text = mStatus;
Invalidate();
}
}
public RsTray() public RsTray()
{ {
InitializeComponent(); InitializeComponent();

@ -115,11 +115,11 @@ namespace Rs.Motion.GugaoEcat
} }
} }
IsInitialized = true; IsInitialized = true;
LogHelper.Debug("rs motion card init ok");
return ErrorCode.Ok; return ErrorCode.Ok;
} }
public ICard GetCard(short cardID) public ICard GetCard(short cardID)
{ {
ICard card; ICard card;
if(cardDic.ContainsKey((ushort)cardID)) return cardDic[(ushort)cardID]; if(cardDic.ContainsKey((ushort)cardID)) return cardDic[(ushort)cardID];
if(mcDic.ContainsKey(cardID)) if(mcDic.ContainsKey(cardID))

Loading…
Cancel
Save