完成S7变量启用和停用更新

This commit is contained in:
2025-09-16 14:42:23 +08:00
parent 3102938f92
commit 74fde6bd8b
59 changed files with 226 additions and 454 deletions

View File

@@ -33,7 +33,7 @@ public class HistoryProcessor : IVariableProcessor, IDisposable
// 只有当数据需要保存时才记录历史
if (!context.Data.IsHistoryEnabled) // 如果数据已经被其他处理器处理过或者不需要保存,则跳过
{
_logger.LogDebug("变量 {VariableName} (ID: {VariableId}) 历史记录已禁用,跳过处理", context.Data.Name, context.Data.Id);
// _logger.LogDebug("变量 {VariableName} (ID: {VariableId}) 历史记录已禁用,跳过处理", context.Data.Name, context.Data.Id);
return;
}

View File

@@ -20,7 +20,7 @@ public class ValueConvertProcessor : IVariableProcessor
ConvertS7ValueToStringAndNumeric(context.Data, context.NewValue);
context.Data.UpdatedAt = DateTime.Now;
// 如何值没有变化则中断处理
if (context.Data.DataValue!=oldValue)
if (context.Data.DataValue==oldValue)
{
context.IsHandled = true;
}