Commit 1ae87798 LN

识别有料dll更新

1 个父辈 3708de31
...@@ -6,6 +6,7 @@ using System; ...@@ -6,6 +6,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Runtime.ExceptionServices;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
...@@ -90,6 +91,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -90,6 +91,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
/// <param name="exist"></param> /// <param name="exist"></param>
/// <returns>true=有料,false=无料</returns> /// <returns>true=有料,false=无料</returns>
[HandleProcessCorruptedStateExceptions]
public bool VisionComp(out Dictionary<string, bool> exist) public bool VisionComp(out Dictionary<string, bool> exist)
{ {
bool returnResult = false; bool returnResult = false;
...@@ -129,6 +131,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -129,6 +131,10 @@ namespace OnlineStore.DeviceLibrary
} }
} }
} }
catch (AccessViolationException e)
{
LogUtil.error(Name + "VisionLibCom 出错 AccessViolationException:" + e.ToString());
}
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "VisionLibCom 出错:" + ex.ToString()); LogUtil.error(Name + "VisionLibCom 出错:" + ex.ToString());
......
...@@ -140,6 +140,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -140,6 +140,10 @@ namespace OnlineStore.DeviceLibrary
try try
{ {
string vfile = Application.StartupPath + ConfigAppSettings.GetValue(Setting_Init.VisionConfigFile); string vfile = Application.StartupPath + ConfigAppSettings.GetValue(Setting_Init.VisionConfigFile);
if (String.IsNullOrEmpty(vfile))
{
vfile = @"\Camera.json";
}
if (!String.IsNullOrEmpty(vfile)) if (!String.IsNullOrEmpty(vfile))
{ {
vision = new Asa.Camera.VisionLib(vfile, "RollingLogFileAppender"); vision = new Asa.Camera.VisionLib(vfile, "RollingLogFileAppender");
...@@ -160,6 +164,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -160,6 +164,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (vision != null) if (vision != null)
{ {
vision.Dispose();
vision.Close(); vision.Close();
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!