fix(native-alarms): a 4-column CSV import keeps stored MES overrides on the CLI path too (ScadaBridge#104)
The bulk SetInstanceNativeAlarmSourceOverridesCommand handler always wrote the entry's IsMesReportableOverride, so a CLI import of a legacy 4-column CSV (no MesReportable column) reset every imported source's MES override to inherit. The Central UI avoided it only by looking up the stored flag client-side. NativeAlarmSourceOverrideEntry gains an additive trailing KeepStoredMesReportable flag: when set, the server leaves an existing row's MES override untouched (a new row inherits) and ignores IsMesReportableOverride; unset keeps the old meaning (null = clear to inherit), so older senders are unaffected. The CLI and the Central UI now build their entries through one rule (ToOverrideEntry on each row type): no MesReportable column => KeepStoredMesReportable. CLI README and Component-CentralUI updated. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -17,7 +17,17 @@ namespace ZB.MOM.WW.ScadaBridge.Commons.Types;
|
||||
/// </remarks>
|
||||
public sealed record NativeAlarmSourceOverrideCsvRow(
|
||||
string SourceName, string? Connection, string? SourceReference, string? Filter, int LineNumber,
|
||||
bool? MesReportable = null, bool HasMesColumn = false);
|
||||
bool? MesReportable = null, bool HasMesColumn = false)
|
||||
{
|
||||
/// <summary>
|
||||
/// The bulk-apply entry for this row. Without the <c>MesReportable</c> column the entry
|
||||
/// leaves the MES flag unspecified, so the server keeps each source's stored override
|
||||
/// instead of resetting it to inherit (ScadaBridge#104).
|
||||
/// </summary>
|
||||
/// <returns>The entry for <c>SetInstanceNativeAlarmSourceOverridesCommand</c>.</returns>
|
||||
public ZB.MOM.WW.ScadaBridge.Commons.Messages.Management.NativeAlarmSourceOverrideEntry ToOverrideEntry() =>
|
||||
new(SourceName, Connection, SourceReference, Filter, MesReportable, KeepStoredMesReportable: !HasMesColumn);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Outcome of parsing a native-alarm-source-override CSV: the successfully-parsed
|
||||
|
||||
Reference in New Issue
Block a user