Commit 316aad3f LN

扫码修改

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