Commit d41411c2 LN

扫码处增加过滤

1 个父辈 2797984d
...@@ -12,8 +12,8 @@ using System.Windows.Forms; ...@@ -12,8 +12,8 @@ using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
public class CodeManager public class CodeManager
{ {
public static List<string> codeTypeList = new List<string>(); public static List<string> codeTypeList = new List<string>();
public static List<string> balserNameList = new List<string>(); public static List<string> balserNameList = new List<string>();
public static List<string> hikNameList = new List<string>(); public static List<string> hikNameList = new List<string>();
...@@ -22,12 +22,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -22,12 +22,12 @@ namespace OnlineStore.DeviceLibrary
/// 初始化摄像机名称和二维码类型 /// 初始化摄像机名称和二维码类型
/// </summary> /// </summary>
public static void LoadConfig() public static void LoadConfig()
{ {
string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType); string codeStr = ConfigAppSettings.GetValue(Setting_Init.CodeType);
codeTypeList = new List<string>(); codeTypeList = new List<string>();
HDLogUtil.LogName = "RollingLogFileAppender"; HDLogUtil.LogName = "RollingLogFileAppender";
try try
{ {
string[] codeArray = codeStr.Split(spiltChar); string[] codeArray = codeStr.Split(spiltChar);
foreach (string str in codeArray) foreach (string str in codeArray)
{ {
...@@ -40,11 +40,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -40,11 +40,11 @@ namespace OnlineStore.DeviceLibrary
} }
LoadCamera(false); LoadCamera(false);
CodeLibrary.HDCodeLearnHelper.LoadConfig("", codeStr); CodeLibrary.HDCodeLearnHelper.LoadConfig("", codeStr);
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("解析摄像机配置出错:" ,ex); LogUtil.error("解析摄像机配置出错:", ex);
} }
} }
private static void LoadCamera(bool isReLoad) private static void LoadCamera(bool isReLoad)
...@@ -57,7 +57,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -57,7 +57,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("加载HIK相机出错:",ex); LogUtil.error("加载HIK相机出错:", ex);
} }
try try
{ {
...@@ -65,7 +65,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -65,7 +65,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("加载Basler相机出错:",ex); LogUtil.error("加载Basler相机出错:", ex);
} }
} }
string[] names = CodeLibrary.HIKCamera.Instance.CameraName; string[] names = CodeLibrary.HIKCamera.Instance.CameraName;
...@@ -157,7 +157,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -157,7 +157,7 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("从相机【" + cameraName + "】获取图片出错:",ex); LogUtil.error("从相机【" + cameraName + "】获取图片出错:", ex);
} }
return bitm; return bitm;
} }
...@@ -208,13 +208,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -208,13 +208,14 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
cc = HDCodeHelper.DecodeCode(ho_Image, codeCount, GetCodeParamFilePath(codeType), codeType); cc = HDCodeHelper.DecodeCode(ho_Image, codeCount, GetCodeParamFilePath(codeType), codeType);
} }
foreach (CodeInfo c in cc) foreach (CodeInfo c in cc)
{ {
codeList.Add(c.CodeStr); string str = CodeManager.ReplaceCode(c.CodeStr);
r = r + "##" + c.CodeStr; codeList.Add(str);
r = r + "##" + str;
} }
LogUtil.debug(" 【" + cameraName + "】【" + codeType + "】扫码完成:" + r); LogUtil.debug(" 【" + cameraName + "】【" + codeType + "】扫码完成:" + r);
} }
LogUtil.info(" [" + cameraName + "] 扫码完成:" + r); LogUtil.info(" [" + cameraName + "] 扫码完成:" + r);
...@@ -230,8 +231,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -230,8 +231,8 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("扫码出错:",ex); LogUtil.error("扫码出错:", ex);
} }
return codeList; return codeList;
} }
...@@ -255,7 +256,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -255,7 +256,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
/// <param name="message"></param> /// <param name="message"></param>
/// <returns></returns> /// <returns></returns>
public static string ReplaceCode(string message) public static string ReplaceCode(string message)
{ {
message = message.Trim(); message = message.Trim();
message = message.Replace("\r", ""); message = message.Replace("\r", "");
...@@ -276,7 +277,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -276,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
if (!value.Equals(24)) if (!value.Equals(24))
{ {
newBytes.Add(by); newBytes.Add(by);
} }
} }
message = asciiEncoding.GetString(newBytes.ToArray()); message = asciiEncoding.GetString(newBytes.ToArray());
return message; return message;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!