Commit 9562c160 LN

增加界面

1 个父辈 beb326b5
......@@ -9,7 +9,9 @@
<add key="App_AutoRun" value="0"/>
<add key="App_Title" value="料架"/>
<!--服务器端口号-->
<add key="ServerPort" value="80" />
<add key="ServerPort" value="8080" />
<!--服务器地址-->
<add key="HttpServerAddr" value="http://192.168.200.22:8080/" />
<!--料架灯类型,0=单色灯料架,1=三色灯料架,2=art-net-->
<add key="DeviceLedType" value="2" />
<!--料仓库位配置文件-->
......
namespace SmartShelf
{
partial class FrmAbout
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmAbout));
this.btnNext = new System.Windows.Forms.Button();
this.lblVersion = new System.Windows.Forms.Label();
this.lblTime = new System.Windows.Forms.Label();
this.lblCodeName = new System.Windows.Forms.Label();
this.btnCopy = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btnNext
//
this.btnNext.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.btnNext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnNext.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnNext.Location = new System.Drawing.Point(210, 140);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(120, 45);
this.btnNext.TabIndex = 275;
this.btnNext.Text = "确定";
this.btnNext.UseVisualStyleBackColor = false;
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
//
// lblVersion
//
this.lblVersion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblVersion.Location = new System.Drawing.Point(12, 36);
this.lblVersion.Name = "lblVersion";
this.lblVersion.Size = new System.Drawing.Size(529, 23);
this.lblVersion.TabIndex = 276;
this.lblVersion.Text = "版本号:1.1.0000.0000";
this.lblVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblTime
//
this.lblTime.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblTime.Location = new System.Drawing.Point(81, 66);
this.lblTime.Name = "lblTime";
this.lblTime.Size = new System.Drawing.Size(379, 23);
this.lblTime.TabIndex = 277;
this.lblTime.Text = "更新时间:0000-00-00 00:00:00";
this.lblTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblCodeName
//
this.lblCodeName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblCodeName.Location = new System.Drawing.Point(12, 100);
this.lblCodeName.Name = "lblCodeName";
this.lblCodeName.Size = new System.Drawing.Size(529, 23);
this.lblCodeName.TabIndex = 278;
this.lblCodeName.Text = "软件编号:???";
this.lblCodeName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnCopy
//
this.btnCopy.Location = new System.Drawing.Point(466, 64);
this.btnCopy.Name = "btnCopy";
this.btnCopy.Size = new System.Drawing.Size(75, 25);
this.btnCopy.TabIndex = 279;
this.btnCopy.Text = "复制编号";
this.btnCopy.UseVisualStyleBackColor = true;
this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
//
// FrmAbout
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(553, 222);
this.Controls.Add(this.btnCopy);
this.Controls.Add(this.lblCodeName);
this.Controls.Add(this.lblTime);
this.Controls.Add(this.lblVersion);
this.Controls.Add(this.btnNext);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmAbout";
this.Text = "软件信息";
this.Load += new System.EventHandler(this.FrmPwd_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnNext;
private System.Windows.Forms.Label lblVersion;
private System.Windows.Forms.Label lblTime;
private System.Windows.Forms.Label lblCodeName;
private System.Windows.Forms.Button btnCopy;
}
}
\ No newline at end of file

using SmartShelf.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SmartShelf
{
internal partial class FrmAbout : FrmBase
{
public FrmAbout()
{
InitializeComponent();
}
private void FrmPwd_Load(object sender, EventArgs e)
{
this.DialogResult = DialogResult.None;
lblTime.Text = "更新时间:" + GetVersion();
lblVersion.Text = "版本号:" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
lblCodeName.Text ="软件编号:"+ GetCodeNum();
}
private void btnNext_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnCopy_Click(object sender, EventArgs e)
{
Clipboard.SetDataObject(GetCodeNum(), true);
}
}
}
namespace SmartShelf
{
partial class FrmBase
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmBase));
this.SuspendLayout();
//
// FrmBase
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(300, 300);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmBase";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FrmBase";
this.Load += new System.EventHandler(this.FrmBase_Load);
this.ResumeLayout(false);
}
#endregion
}
}
\ No newline at end of file
using SmartShelf.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SmartShelf
{
internal partial class FrmBase : Form
{
internal static string GetVersion(bool IsShow=false)
{
string str = "";
string version = "";
DateTime newData = DateTime.Parse("2000-01-01");
try
{
System.Reflection.AssemblyName assemblyName= System.Reflection.Assembly.GetExecutingAssembly().GetName();
version = assemblyName.Version.ToString();
string[] strArray = version.Split('.');
if (strArray.Length.Equals(4))
{
int days = Convert.ToInt32(strArray[2]);
int seconds = Convert.ToInt32(strArray[3]);
DateTime d1 = DateTime.Parse("2000-01-01");
newData = d1.AddDays(days);
newData = newData.AddSeconds(seconds * 2);
str = newData.ToString("yyyy-MM-dd HH:mm");
}
}
catch (Exception ex)
{
str = version;
LogUtil.error("解析版本号【" + str + "】出错:" +ex.ToString());
}
if (IsShow)
{
LogUtil.info("版本号[" + version + "][" + str + "][" + GetCodeNum() + "]");
}
return str;
}
internal static string GetCodeNum(string codeName = "SmartShelf_RC1272")
{
byte[] byteArray = System.Text.Encoding.ASCII.GetBytes(codeName);
string result = "";
result = AcSerialBean.ByteToString(byteArray);
return result;
}
internal FrmBase()
{
InitializeComponent();
}
private void FrmBase_Load(object sender, EventArgs e)
{
}
}
}
此文件的差异被折叠, 点击展开。
......@@ -34,12 +34,13 @@
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.启动手动料仓ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.关闭手动料仓ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.退出程序ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.清理日志ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.chbAuto = new System.Windows.Forms.CheckBox();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
......@@ -65,6 +66,7 @@
this.关闭手动料仓ToolStripMenuItem,
this.toolStripMenuItem1,
this.退出程序ToolStripMenuItem,
this.toolStripMenuItem2,
this.清理日志ToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
......@@ -86,6 +88,13 @@
this.关闭手动料仓ToolStripMenuItem.Text = "关闭料架";
this.关闭手动料仓ToolStripMenuItem.Click += new System.EventHandler(this.关闭手动料仓ToolStripMenuItem_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(102, 25);
this.toolStripMenuItem1.Text = "控制器配置";
this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
//
// 退出程序ToolStripMenuItem
//
this.退出程序ToolStripMenuItem.Name = "退出程序ToolStripMenuItem";
......@@ -128,12 +137,12 @@
this.chbAuto.UseVisualStyleBackColor = true;
this.chbAuto.CheckedChanged += new System.EventHandler(this.chbAuto_CheckedChanged);
//
// toolStripMenuItem1
// toolStripMenuItem2
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(102, 25);
this.toolStripMenuItem1.Text = "控制器配置";
this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(86, 25);
this.toolStripMenuItem2.Text = "关于软件";
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
//
// FrmShelf
//
......@@ -171,5 +180,6 @@
public System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.CheckBox chbAuto;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
}
}
\ No newline at end of file
......@@ -177,5 +177,11 @@ namespace SmartShelf
FrmConfig frm = new FrmConfig();
frm.ShowDialog();
}
private void toolStripMenuItem2_Click(object sender, EventArgs e)
{
FrmAbout frm = new FrmAbout();
frm.ShowDialog();
}
}
}
......@@ -50,6 +50,18 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FrmAbout.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmAbout.Designer.cs">
<DependentUpon>FrmAbout.cs</DependentUpon>
</Compile>
<Compile Include="FrmBase.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmBase.Designer.cs">
<DependentUpon>FrmBase.cs</DependentUpon>
</Compile>
<Compile Include="FrmConfig.cs">
<SubType>Form</SubType>
</Compile>
......@@ -71,6 +83,12 @@
<Compile Include="ManagerUtil.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FrmAbout.resx">
<DependentUpon>FrmAbout.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmBase.resx">
<DependentUpon>FrmBase.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmConfig.resx">
<DependentUpon>FrmConfig.cs</DependentUpon>
</EmbeddedResource>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!