Commit 16b526af LN

增加软件编号显示

1 个父辈 ed527de1
......@@ -43,7 +43,7 @@
<add key="LineServerIp" value="192.168.200.69"/>
<add key="LineServerPort" value="1234"/>
<!--解码方式,0=halcon 解码,1=西安料仓 使用zxing解码,2=成都料仓-->
<add key="DeCodeType" value="1"/>
<add key="DeCodeType" value="2"/>
<add key ="DefaultPWD" value ="123456"/>
</appSettings>
<log4net>
......
......@@ -29,8 +29,10 @@
private void InitializeComponent()
{
this.btnNext = new System.Windows.Forms.Button();
this.lblVersion = new System.Windows.Forms.Label();
this.btnCopy = new System.Windows.Forms.Button();
this.lblCodeName = new System.Windows.Forms.Label();
this.lblTime = new System.Windows.Forms.Label();
this.lblVersion = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btnNext
......@@ -38,7 +40,7 @@
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(152, 113);
this.btnNext.Location = new System.Drawing.Point(210, 175);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(120, 45);
this.btnNext.TabIndex = 275;
......@@ -46,33 +48,56 @@
this.btnNext.UseVisualStyleBackColor = false;
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
//
// lblVersion
// btnCopy
//
this.lblVersion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.btnCopy.Location = new System.Drawing.Point(465, 78);
this.btnCopy.Name = "btnCopy";
this.btnCopy.Size = new System.Drawing.Size(75, 25);
this.btnCopy.TabIndex = 283;
this.btnCopy.Text = "复制编号";
this.btnCopy.UseVisualStyleBackColor = true;
this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
//
// lblCodeName
//
this.lblCodeName.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, 33);
this.lblVersion.Name = "lblVersion";
this.lblVersion.Size = new System.Drawing.Size(413, 23);
this.lblVersion.TabIndex = 276;
this.lblVersion.Text = "版本号:1.1.0000.0000";
this.lblVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblCodeName.Location = new System.Drawing.Point(11, 114);
this.lblCodeName.Name = "lblCodeName";
this.lblCodeName.Size = new System.Drawing.Size(529, 23);
this.lblCodeName.TabIndex = 282;
this.lblCodeName.Text = "编号:43 6F 64 65 4C 69 62 72 61 72 79 50 72 6F 6A 65 63 74 ";
this.lblCodeName.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(12, 63);
this.lblTime.Location = new System.Drawing.Point(80, 80);
this.lblTime.Name = "lblTime";
this.lblTime.Size = new System.Drawing.Size(413, 23);
this.lblTime.TabIndex = 277;
this.lblTime.Size = new System.Drawing.Size(379, 23);
this.lblTime.TabIndex = 281;
this.lblTime.Text = "更新时间:0000-00-00 00:00:00";
this.lblTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// 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(11, 50);
this.lblVersion.Name = "lblVersion";
this.lblVersion.Size = new System.Drawing.Size(529, 23);
this.lblVersion.TabIndex = 280;
this.lblVersion.Text = "版本号:1.1.0000.0000";
this.lblVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// FrmAbout
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(437, 186);
this.ClientSize = new System.Drawing.Size(564, 250);
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);
......@@ -87,7 +112,9 @@
#endregion
private System.Windows.Forms.Button btnNext;
private System.Windows.Forms.Label lblVersion;
private System.Windows.Forms.Button btnCopy;
private System.Windows.Forms.Label lblCodeName;
private System.Windows.Forms.Label lblTime;
private System.Windows.Forms.Label lblVersion;
}
}
\ No newline at end of file
......@@ -24,11 +24,17 @@ namespace OnlineStore.ACSingleStore
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);
}
}
}
......@@ -13,14 +13,14 @@ namespace OnlineStore.ACSingleStore
{
public partial class FrmBase : Form
{
public static string GetVersion()
internal static string GetVersion()
{
string str = "";
string version = "";
DateTime newData = DateTime.Parse("2000-01-01");
try
{
System.Reflection.AssemblyName assemblyName= System.Reflection.Assembly.GetExecutingAssembly().GetName();
System.Reflection.AssemblyName assemblyName = System.Reflection.Assembly.GetExecutingAssembly().GetName();
version = assemblyName.Version.ToString();
string[] strArray = version.Split('.');
if (strArray.Length.Equals(4))
......@@ -38,9 +38,16 @@ namespace OnlineStore.ACSingleStore
str = version;
LogUtil.error("解析版本号【" + str + "】出错:" + ex.ToString());
}
LogUtil.info("版本号[" + version + "][" + str + "]");
LogUtil.info("版本号[" + version + "][" + str + "][" + GetCodeNum() + "]");
return str;
}
internal static string GetCodeNum(string codeName = "RC-29-32-ACSingleStore")
{
byte[] byteArray = System.Text.Encoding.ASCII.GetBytes(codeName);
string result = "";
result = AcSerialBean.ByteToString(byteArray);
return result;
}
public FrmBase()
{
InitializeComponent();
......
......@@ -166,13 +166,14 @@ namespace OnlineStore.ACSingleStore
{
groupHistory.Visible = false;
}
if (CodeManager.DeCodeType.Equals(0))
if (CodeManager.DeCodeType.Equals(1))
{
groupCode.Visible = false;
groupCode.Visible = true;
;
}
else
{
groupCode.Visible = true;
groupCode.Visible = false;
}
}
private DateTime preReadModblsTime = DateTime.Now;
......
......@@ -207,7 +207,12 @@ namespace OnlineStore.DeviceLibrary
LogUtil.debug(" 摄像机【" + cameraName + "】获取图片完成");
System.Threading.Thread.Sleep(1);
if (DeCodeType.Equals(0))
if (DeCodeType.Equals(1))
{
List<string> result = CodeLibrary.ZXingCodeHelper.DecodeQRCodes(bitmap);
return result;
}
else
{
HalconDotNet.HObject ho_Image = HDCodeHelper.Bitmap2HObjectBpp24(bitmap);
LogUtil.debug(" 摄像机【" + cameraName + "】转换图片完成,开始扫码");
......@@ -234,11 +239,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(" 【" + cameraName + "】【" + codeType + "】扫码完成:" + r);
}
}
}
else
{
List<string> result = CodeLibrary.ZXingCodeHelper.DecodeQRCodes(bitmap);
return result;
}
}
}
......@@ -347,7 +348,12 @@ namespace OnlineStore.DeviceLibrary
List<string> pCode = (from m in codeList where m.StartsWith(start) select m).ToList<string>();
if (pCode.Count > 0)
{
return pCode[0].Substring(1, pCode[0].Length - 1);
int subCount = start.Length;
if (pCode[0].Substring(start.Length, 1).Equals(":"))
{
subCount = start.Length + 1;
}
return pCode[0].Substring(subCount, pCode[0].Length - subCount);
}
return "";
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!