针对界面显示的优化
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
/// <summary> 流水线的下一个处理环节 </summary>
|
||||
private IFrameProcessor? _nextStep;
|
||||
|
||||
protected readonly ProcessingConfigManager _configManager; // 基类持有
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- 构造函数 ---
|
||||
@@ -33,12 +35,13 @@
|
||||
/// </summary>
|
||||
/// <param name="workerCount">Worker 线程数量(并行度)</param>
|
||||
/// <param name="serviceName">服务名称(用于日志标识)</param>
|
||||
protected BaseFrameProcessor(int workerCount, string serviceName)
|
||||
protected BaseFrameProcessor(int workerCount, string serviceName, ProcessingConfigManager configManager)
|
||||
{
|
||||
// 校验并行度参数,避免无效配置
|
||||
if (workerCount < 1)
|
||||
throw new ArgumentOutOfRangeException(nameof(workerCount), "Worker数量必须大于0");
|
||||
|
||||
_configManager = configManager; // 先赋值配置管理器
|
||||
_workerCount = workerCount;
|
||||
|
||||
// 通过抽象工厂模式创建 Worker 实例
|
||||
@@ -218,7 +221,7 @@
|
||||
try
|
||||
{
|
||||
// 调用子类实现的具体图像处理算法
|
||||
PerformAction(frame, taskItem.Decision);
|
||||
PerformAction(taskItem.DeviceId, frame, taskItem.Decision);
|
||||
|
||||
// 通知父集群:当前帧处理完成,准备传递到下一个环节
|
||||
NotifyFinished(taskItem.DeviceId, frame, taskItem.Decision);
|
||||
@@ -252,9 +255,10 @@
|
||||
/// 子类实现:具体的图像处理算法逻辑
|
||||
/// 如:缩放、灰度转换、AI推理等
|
||||
/// </summary>
|
||||
/// <param name="deviceId">设备ID</param>
|
||||
/// <param name="frame">待处理的智能帧</param>
|
||||
/// <param name="decision">帧处理决策指令</param>
|
||||
protected abstract void PerformAction(SmartFrame frame, FrameDecision decision);
|
||||
protected abstract void PerformAction(long deviceId, SmartFrame frame, FrameDecision decision);
|
||||
|
||||
/// <summary>
|
||||
/// 子类实现:通知父集群处理完成
|
||||
|
||||
Reference in New Issue
Block a user