初级的功能

This commit is contained in:
2025-12-03 15:58:17 +08:00
parent e25d344f8a
commit cd1ec78a11
8 changed files with 425 additions and 87 deletions

View File

@@ -3,6 +3,7 @@ using FATrace.HKNetLib.Hardware;
using FATrace.Model;
using System.Reflection;
using System.Runtime.InteropServices;
using System.IO;
using static FATrace.HKNetLib.Hardware.CHCNetSDK;
using System.Threading;
using System.Threading.Tasks;
@@ -445,15 +446,17 @@ namespace FATrace.HKNetLib.Wrapper
{
// 发生错误,尝试停止下载并退出
Sdk_NET_DVR_StopGetFile();
try { NVRLoadVideoCompleteEventHandler?.Invoke(this, "下载失败"); } catch { }
break;
}
try { await Task.Delay(_downloadPollIntervalMs, token); } catch { /* ignore */ }
}
}
catch
catch (Exception ex)
{
// 轮询线程异常吞掉,避免影响上层逻辑
try { NVRLoadVideoCompleteEventHandler?.Invoke(this, $"下载失败:{ex.Message}"); } catch { }
}
}, token);
}