From 5afc21e054575cb475b02a4906007c0554ff1635 Mon Sep 17 00:00:00 2001 From: dathlin Date: Sun, 2 Jul 2017 18:48:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=A7=E8=83=BD=E7=BB=84=E4=BB=B6=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E5=88=B0=E5=85=AC=E5=85=B1=E7=BB=84=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=EF=BC=8C=E5=9C=A8=E6=9C=8D=E5=8A=A1=E5=99=A8=E7=AB=AF=E5=92=8C?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E6=8F=90=E4=BE=9B=E4=B8=80=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E5=91=88=E7=8E=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BasicSupport}/FormSuper.Designer.cs | 12 ++++----- .../BasicSupport}/FormSuper.cs | 26 +++++++++---------- .../BasicSupport}/FormSuper.resx | 0 CommonLibrary/CommonLibrary.csproj | 9 +++++++ 软件系统客户端模版/FormMainWindow.cs | 20 +++++++++++++- 软件系统客户端模版/软件系统客户端模版.csproj | 9 ------- .../FormServerWindow.Designer.cs | 2 ++ 软件系统服务端模版/FormServerWindow.cs | 16 +++++++++++- 8 files changed, 63 insertions(+), 31 deletions(-) rename {软件系统客户端模版 => CommonLibrary/BasicSupport}/FormSuper.Designer.cs (90%) rename {软件系统客户端模版 => CommonLibrary/BasicSupport}/FormSuper.cs (56%) rename {软件系统客户端模版 => CommonLibrary/BasicSupport}/FormSuper.resx (100%) diff --git a/软件系统客户端模版/FormSuper.Designer.cs b/CommonLibrary/BasicSupport/FormSuper.Designer.cs similarity index 90% rename from 软件系统客户端模版/FormSuper.Designer.cs rename to CommonLibrary/BasicSupport/FormSuper.Designer.cs index 546f574..f38b07c 100644 --- a/软件系统客户端模版/FormSuper.Designer.cs +++ b/CommonLibrary/BasicSupport/FormSuper.Designer.cs @@ -1,4 +1,4 @@ -namespace 软件系统客户端模版 +namespace CommonLibrary { partial class FormSuper { @@ -36,18 +36,18 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(298, 18); + this.label1.Location = new System.Drawing.Point(12, 11); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(80, 17); + this.label1.Size = new System.Drawing.Size(92, 17); this.label1.TabIndex = 0; - this.label1.Text = "对象内存图形"; + this.label1.Text = "对象内存图形:"; // // pictureBox1 // this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.pictureBox1.Location = new System.Drawing.Point(301, 38); + this.pictureBox1.Location = new System.Drawing.Point(15, 38); this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(503, 380); + this.pictureBox1.Size = new System.Drawing.Size(789, 380); this.pictureBox1.TabIndex = 1; this.pictureBox1.TabStop = false; // diff --git a/软件系统客户端模版/FormSuper.cs b/CommonLibrary/BasicSupport/FormSuper.cs similarity index 56% rename from 软件系统客户端模版/FormSuper.cs rename to CommonLibrary/BasicSupport/FormSuper.cs index ff700ca..349a7e7 100644 --- a/软件系统客户端模版/FormSuper.cs +++ b/CommonLibrary/BasicSupport/FormSuper.cs @@ -7,13 +7,14 @@ using System.Linq; using System.Text; using System.Windows.Forms; -namespace 软件系统客户端模版 +namespace CommonLibrary { public partial class FormSuper : Form { - public FormSuper() + public FormSuper(Func getDataFunction) { InitializeComponent(); + GetDataFunction = getDataFunction; } private void FormSuper_Load(object sender, EventArgs e) @@ -37,25 +38,22 @@ namespace 软件系统客户端模版 IsWindowShow = false; } - + private Func GetDataFunction = null; private bool IsWindowShow { get; set; } private void Timer_Tick(object sender, EventArgs e) { - HslCommunication.OperateResultBytes result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode.性能计数, new byte[0]); - //解析 - if (result.IsSuccess) + if (GetDataFunction != null) { - int[] data = new int[result.Content.Length / 4]; - for (int i = 0; i < data.Length; i++) + int[] data = GetDataFunction(); + if (data != null) { - data[i] = BitConverter.ToInt32(result.Content, i * 4); - } - if (IsWindowShow) - { - pictureBox1.Image?.Dispose(); - pictureBox1.Image = HslCommunication.BasicFramework.SoftPainting.GetGraphicFromArray(data, pictureBox1.Width - 2, pictureBox1.Height - 2, 7, Color.Blue); + if (IsWindowShow) + { + pictureBox1.Image?.Dispose(); + pictureBox1.Image = HslCommunication.BasicFramework.SoftPainting.GetGraphicFromArray(data, pictureBox1.Width - 2, pictureBox1.Height - 2, 7, Color.Blue); + } } } } diff --git a/软件系统客户端模版/FormSuper.resx b/CommonLibrary/BasicSupport/FormSuper.resx similarity index 100% rename from 软件系统客户端模版/FormSuper.resx rename to CommonLibrary/BasicSupport/FormSuper.resx diff --git a/CommonLibrary/CommonLibrary.csproj b/CommonLibrary/CommonLibrary.csproj index d601976..3d9b6df 100644 --- a/CommonLibrary/CommonLibrary.csproj +++ b/CommonLibrary/CommonLibrary.csproj @@ -67,6 +67,12 @@ + + Form + + + FormSuper.cs + Form @@ -97,6 +103,9 @@ FormPasswordModify.cs + + FormSuper.cs + FormUpdateLog.cs diff --git a/软件系统客户端模版/FormMainWindow.cs b/软件系统客户端模版/FormMainWindow.cs index 7d9b368..d9075bb 100644 --- a/软件系统客户端模版/FormMainWindow.cs +++ b/软件系统客户端模版/FormMainWindow.cs @@ -270,7 +270,25 @@ namespace 软件系统客户端模版 private void 开发中心ToolStripMenuItem_Click(object sender, EventArgs e) { - using (FormSuper fs = new FormSuper()) + using (FormSuper fs = new FormSuper(() => + { + OperateResultBytes result = UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.性能计数, new byte[0]); + //解析 + if (result.IsSuccess) + { + int[] data = new int[result.Content.Length / 4]; + for (int i = 0; i < data.Length; i++) + { + data[i] = BitConverter.ToInt32(result.Content, i * 4); + } + return data; + } + else + { + return null; + } + + })) { fs.ShowDialog(); } diff --git a/软件系统客户端模版/软件系统客户端模版.csproj b/软件系统客户端模版/软件系统客户端模版.csproj index 351a697..139da9d 100644 --- a/软件系统客户端模版/软件系统客户端模版.csproj +++ b/软件系统客户端模版/软件系统客户端模版.csproj @@ -83,12 +83,6 @@ FormRegisterAccount.cs - - Form - - - FormSuper.cs - Form @@ -125,9 +119,6 @@ FormRegisterAccount.cs - - FormSuper.cs - FormUpdateRemote.cs diff --git a/软件系统服务端模版/FormServerWindow.Designer.cs b/软件系统服务端模版/FormServerWindow.Designer.cs index bd697ce..2ccacb9 100644 --- a/软件系统服务端模版/FormServerWindow.Designer.cs +++ b/软件系统服务端模版/FormServerWindow.Designer.cs @@ -304,12 +304,14 @@ // this.label_GC_Memery.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label_GC_Memery.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.label_GC_Memery.Cursor = System.Windows.Forms.Cursors.Hand; this.label_GC_Memery.Location = new System.Drawing.Point(629, 37); this.label_GC_Memery.Name = "label_GC_Memery"; this.label_GC_Memery.Size = new System.Drawing.Size(125, 17); this.label_GC_Memery.TabIndex = 16; this.label_GC_Memery.Text = "0"; this.label_GC_Memery.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.label_GC_Memery.Click += new System.EventHandler(this.label_GC_Memery_Click); // // label_Pm_Memery // diff --git a/软件系统服务端模版/FormServerWindow.cs b/软件系统服务端模版/FormServerWindow.cs index 3b65815..fdfa898 100644 --- a/软件系统服务端模版/FormServerWindow.cs +++ b/软件系统服务端模版/FormServerWindow.cs @@ -316,6 +316,18 @@ namespace 软件系统服务端模版 } + private void label_GC_Memery_Click(object sender, EventArgs e) + { + //点击了性能组件 + using (FormSuper fs = new FormSuper(() => + { + return SoftCachePerfomance.GetIntArray(); + })) + { + fs.ShowDialog(); + } + } + #endregion #region 软件更新服务引擎 @@ -890,7 +902,7 @@ namespace 软件系统服务端模版 #region 服务器内存性能缓存小模块 - private SoftCacheArrayInt SoftCachePerfomance = new SoftCacheArrayInt(400, 0); + private SoftCacheArrayInt SoftCachePerfomance = new SoftCacheArrayInt(500, 0); private void AddPerfomace(long value) { @@ -1196,5 +1208,7 @@ namespace 软件系统服务端模版 } #endregion + + } }