Commit d41411c2 LN

扫码处增加过滤

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