性能组件移动到公共组件中,在服务器端和客户端提供一致的呈现。
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
namespace 软件系统客户端模版
|
namespace CommonLibrary
|
||||||
{
|
{
|
||||||
partial class FormSuper
|
partial class FormSuper
|
||||||
{
|
{
|
||||||
@@ -36,18 +36,18 @@
|
|||||||
// label1
|
// label1
|
||||||
//
|
//
|
||||||
this.label1.AutoSize = true;
|
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.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.TabIndex = 0;
|
||||||
this.label1.Text = "对象内存图形";
|
this.label1.Text = "对象内存图形:";
|
||||||
//
|
//
|
||||||
// pictureBox1
|
// pictureBox1
|
||||||
//
|
//
|
||||||
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
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.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.TabIndex = 1;
|
||||||
this.pictureBox1.TabStop = false;
|
this.pictureBox1.TabStop = false;
|
||||||
//
|
//
|
||||||
@@ -7,13 +7,14 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace 软件系统客户端模版
|
namespace CommonLibrary
|
||||||
{
|
{
|
||||||
public partial class FormSuper : Form
|
public partial class FormSuper : Form
|
||||||
{
|
{
|
||||||
public FormSuper()
|
public FormSuper(Func<int[]> getDataFunction)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
GetDataFunction = getDataFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FormSuper_Load(object sender, EventArgs e)
|
private void FormSuper_Load(object sender, EventArgs e)
|
||||||
@@ -37,25 +38,22 @@ namespace 软件系统客户端模版
|
|||||||
IsWindowShow = false;
|
IsWindowShow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Func<int[]> GetDataFunction = null;
|
||||||
|
|
||||||
private bool IsWindowShow { get; set; }
|
private bool IsWindowShow { get; set; }
|
||||||
|
|
||||||
private void Timer_Tick(object sender, EventArgs e)
|
private void Timer_Tick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
HslCommunication.OperateResultBytes result = UserClient.Net_simplify_client.ReadFromServer(CommonLibrary.CommonHeadCode.SimplifyHeadCode.性能计数, new byte[0]);
|
if (GetDataFunction != null)
|
||||||
//解析
|
|
||||||
if (result.IsSuccess)
|
|
||||||
{
|
{
|
||||||
int[] data = new int[result.Content.Length / 4];
|
int[] data = GetDataFunction();
|
||||||
for (int i = 0; i < data.Length; i++)
|
if (data != null)
|
||||||
{
|
{
|
||||||
data[i] = BitConverter.ToInt32(result.Content, i * 4);
|
if (IsWindowShow)
|
||||||
}
|
{
|
||||||
if (IsWindowShow)
|
pictureBox1.Image?.Dispose();
|
||||||
{
|
pictureBox1.Image = HslCommunication.BasicFramework.SoftPainting.GetGraphicFromArray(data, pictureBox1.Width - 2, pictureBox1.Height - 2, 7, Color.Blue);
|
||||||
pictureBox1.Image?.Dispose();
|
}
|
||||||
pictureBox1.Image = HslCommunication.BasicFramework.SoftPainting.GetGraphicFromArray(data, pictureBox1.Width - 2, pictureBox1.Height - 2, 7, Color.Blue);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,6 +67,12 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="AccountSupport\ServerAccount.cs" />
|
<Compile Include="AccountSupport\ServerAccount.cs" />
|
||||||
<Compile Include="AccountSupport\UserAccount.cs" />
|
<Compile Include="AccountSupport\UserAccount.cs" />
|
||||||
|
<Compile Include="BasicSupport\FormSuper.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="BasicSupport\FormSuper.Designer.cs">
|
||||||
|
<DependentUpon>FormSuper.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="BasicSupport\FormUpdateLog.cs">
|
<Compile Include="BasicSupport\FormUpdateLog.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -97,6 +103,9 @@
|
|||||||
<EmbeddedResource Include="AccountSupport\FormPasswordModify.resx">
|
<EmbeddedResource Include="AccountSupport\FormPasswordModify.resx">
|
||||||
<DependentUpon>FormPasswordModify.cs</DependentUpon>
|
<DependentUpon>FormPasswordModify.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="BasicSupport\FormSuper.resx">
|
||||||
|
<DependentUpon>FormSuper.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="BasicSupport\FormUpdateLog.resx">
|
<EmbeddedResource Include="BasicSupport\FormUpdateLog.resx">
|
||||||
<DependentUpon>FormUpdateLog.cs</DependentUpon>
|
<DependentUpon>FormUpdateLog.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|||||||
@@ -270,7 +270,25 @@ namespace 软件系统客户端模版
|
|||||||
|
|
||||||
private void 开发中心ToolStripMenuItem_Click(object sender, EventArgs e)
|
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();
|
fs.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,12 +83,6 @@
|
|||||||
<Compile Include="FormRegisterAccount.Designer.cs">
|
<Compile Include="FormRegisterAccount.Designer.cs">
|
||||||
<DependentUpon>FormRegisterAccount.cs</DependentUpon>
|
<DependentUpon>FormRegisterAccount.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="FormSuper.cs">
|
|
||||||
<SubType>Form</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="FormSuper.Designer.cs">
|
|
||||||
<DependentUpon>FormSuper.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="FormUpdateRemote.cs">
|
<Compile Include="FormUpdateRemote.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -125,9 +119,6 @@
|
|||||||
<EmbeddedResource Include="FormRegisterAccount.resx">
|
<EmbeddedResource Include="FormRegisterAccount.resx">
|
||||||
<DependentUpon>FormRegisterAccount.cs</DependentUpon>
|
<DependentUpon>FormRegisterAccount.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="FormSuper.resx">
|
|
||||||
<DependentUpon>FormSuper.cs</DependentUpon>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="FormUpdateRemote.resx">
|
<EmbeddedResource Include="FormUpdateRemote.resx">
|
||||||
<DependentUpon>FormUpdateRemote.cs</DependentUpon>
|
<DependentUpon>FormUpdateRemote.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|||||||
2
软件系统服务端模版/FormServerWindow.Designer.cs
generated
2
软件系统服务端模版/FormServerWindow.Designer.cs
generated
@@ -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.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.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.Location = new System.Drawing.Point(629, 37);
|
||||||
this.label_GC_Memery.Name = "label_GC_Memery";
|
this.label_GC_Memery.Name = "label_GC_Memery";
|
||||||
this.label_GC_Memery.Size = new System.Drawing.Size(125, 17);
|
this.label_GC_Memery.Size = new System.Drawing.Size(125, 17);
|
||||||
this.label_GC_Memery.TabIndex = 16;
|
this.label_GC_Memery.TabIndex = 16;
|
||||||
this.label_GC_Memery.Text = "0";
|
this.label_GC_Memery.Text = "0";
|
||||||
this.label_GC_Memery.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
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
|
// label_Pm_Memery
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -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
|
#endregion
|
||||||
|
|
||||||
#region 软件更新服务引擎
|
#region 软件更新服务引擎
|
||||||
@@ -890,7 +902,7 @@ namespace 软件系统服务端模版
|
|||||||
|
|
||||||
#region 服务器内存性能缓存小模块
|
#region 服务器内存性能缓存小模块
|
||||||
|
|
||||||
private SoftCacheArrayInt SoftCachePerfomance = new SoftCacheArrayInt(400, 0);
|
private SoftCacheArrayInt SoftCachePerfomance = new SoftCacheArrayInt(500, 0);
|
||||||
|
|
||||||
private void AddPerfomace(long value)
|
private void AddPerfomace(long value)
|
||||||
{
|
{
|
||||||
@@ -1196,5 +1208,7 @@ namespace 软件系统服务端模版
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user