Commit 316aad3f LN

扫码修改

1 个父辈 62e13569
此文件类型无法预览
......@@ -35,7 +35,7 @@
<add key="Config_Pwd" value="123456"/>
<!--出库等待料盘拿走的时间,秒-->
<add key="OutStoreWaitSeconds" value="10"/>
<!--压紧轴对应1mm的脉冲-->
<!--压紧轴计量检测亮一次的脉冲-->
<add key="ComAxisChangeValue" value="2400"/>
<!--温控器类型,0=壁挂王字壳温湿度变送器,1=妙昕温湿度记录仪-->
<add key="HumitureControllerType" value="1"/>
......
......@@ -2412,6 +2412,7 @@
this.groupCode.TabIndex = 273;
this.groupCode.TabStop = false;
this.groupCode.Text = "扫码测试";
this.groupCode.Visible = false;
//
// txtCode
//
......@@ -2464,7 +2465,7 @@
this.btnCodeTest.TabIndex = 245;
this.btnCodeTest.Text = "扫码测试";
this.btnCodeTest.UseVisualStyleBackColor = true;
this.btnCodeTest.Click += new System.EventHandler(this.btnCodeTest_Click);
// this.btnCodeTest.Click += new System.EventHandler(this.btnCodeTest_Click);
//
// btnOpenFile
//
......@@ -2474,7 +2475,7 @@
this.btnOpenFile.TabIndex = 244;
this.btnOpenFile.Text = "打开本地图片";
this.btnOpenFile.UseVisualStyleBackColor = true;
this.btnOpenFile.Click += new System.EventHandler(this.btnOpenFile_Click);
// this.btnOpenFile.Click += new System.EventHandler(this.btnOpenFile_Click);
//
// groupBox7
//
......
......@@ -1501,39 +1501,39 @@ namespace OnlineStore.ACSingleStore
store.KNDIOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
}
private void btnOpenFile_Click(object sender, EventArgs e)
{
System.Windows.Forms.OpenFileDialog openDialog = new System.Windows.Forms.OpenFileDialog();
openDialog.Title = "打开本地图片";
openDialog.Filter = "All Supported Images (*.bmp;*.dib;*.rle;*.gif;*.jpg;*.png)|*.bmp;*.dib;*.rle;*.gif;*.jpg;*.png|Bitmaps (*.bmp;*.dib;*.rle)|*.bmp;*.dib;*.rle|Graphics Interchange Format (*.gif)|*.gif|Joint Photographic Experts (*.jpg)|*.jpg|Portable Network Graphics (*.png)|*.png|All Files (*.*)|*.*";
openDialog.DefaultExt = "png";
//openDialog.DefaultExt = "png";
System.Windows.Forms.DialogResult result = openDialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.Cancel)
{
return;
}
string fileName = openDialog.FileName;
txtImage.Text = fileName;
}
//private void btnOpenFile_Click(object sender, EventArgs e)
//{
// System.Windows.Forms.OpenFileDialog openDialog = new System.Windows.Forms.OpenFileDialog();
// openDialog.Title = "打开本地图片";
// openDialog.Filter = "All Supported Images (*.bmp;*.dib;*.rle;*.gif;*.jpg;*.png)|*.bmp;*.dib;*.rle;*.gif;*.jpg;*.png|Bitmaps (*.bmp;*.dib;*.rle)|*.bmp;*.dib;*.rle|Graphics Interchange Format (*.gif)|*.gif|Joint Photographic Experts (*.jpg)|*.jpg|Portable Network Graphics (*.png)|*.png|All Files (*.*)|*.*";
// openDialog.DefaultExt = "png";
// //openDialog.DefaultExt = "png";
// System.Windows.Forms.DialogResult result = openDialog.ShowDialog();
// if (result == System.Windows.Forms.DialogResult.Cancel)
// {
// return;
// }
// string fileName = openDialog.FileName;
private void btnCodeTest_Click(object sender, EventArgs e)
{
txtCode.Text = "";
string fileName = txtImage.Text.ToString();
// txtImage.Text = fileName;
//}
if (File.Exists(fileName))
{
//读取图片内容
Bitmap checkImg = (Bitmap)Image.FromFile(fileName).Clone();
string result = ZXingCodeHelper.DecodeQRCode(checkImg);
txtCode.Text = result;
}
else
{
MessageBox.Show("请先打开正确的图片!");
}
}
//private void btnCodeTest_Click(object sender, EventArgs e)
//{
// txtCode.Text = "";
// string fileName = txtImage.Text.ToString();
// if (File.Exists(fileName))
// {
// //读取图片内容
// Bitmap checkImg = (Bitmap)Image.FromFile(fileName).Clone();
// List<string> results = ZXingCodeHelper.DecodeQRCodes(checkImg);
// txtCode.Text = result;
// }
// else
// {
// MessageBox.Show("请先打开正确的图片!");
// }
//}
}
}
......@@ -1511,6 +1511,12 @@ namespace OnlineStore.DeviceLibrary
foreach (string str in codeList)
{
string code = str;
if (CodeManager.DeCodeType.Equals(1))
{
code = "=1+0x0-" + GetSize() + "x" + height + "=" + CodeManager.GetBarcode(str);
}
else
{
if (str.ToUpper().StartsWith("FA"))
{
code = "=1+0x0-7x32" + "=" + code;
......@@ -1519,6 +1525,7 @@ namespace OnlineStore.DeviceLibrary
{
code = "=1+0x0-7x" + height + "=" + code;
}
}
message = message + code + spiltStr;
}
if (!outMsg.Equals(""))
......@@ -1528,10 +1535,7 @@ namespace OnlineStore.DeviceLibrary
message = "";
}
KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
if (CodeManager.DeCodeType.Equals(1))
{
message = "=1+0x0-" + GetSize() + "x" + height + "=" + CodeManager.GetBarcode(message);
}
onCodeReceived(message);
}
......
......@@ -194,12 +194,8 @@ namespace OnlineStore.DeviceLibrary
}
else
{
string result = CodeLibrary.ZXingCodeHelper.DecodeQRCode(bitmap);
if (!String.IsNullOrEmpty(result))
{
return new List<string>() { result };
}
List<string> result = CodeLibrary.ZXingCodeHelper.DecodeQRCodes(bitmap);
return result;
}
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!