完成S7变量启用和停用更新
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user