feat(native-alarms): optional MesReportable column in the native-source override CSV import (ScadaBridge#102 item 4)

CLI import no longer has to reset MES overrides to inherit; a legacy 4-column file
still parses and the Central UI import keeps the stored flag for it.

Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
Joseph Doherty
2026-11-09 15:31:11 -05:00
parent b540d8ac2c
commit 62fe1e685d
7 changed files with 126 additions and 27 deletions
@@ -688,7 +688,7 @@ public static class InstanceCommands
var importIdOption = new Option<int>("--instance-id") { Description = "Instance ID", Required = true };
var importFileOption = new Option<string>("--file")
{
Description = "Path to the override CSV file (columns: SourceName,Connection,SourceReference,Filter; blank field = inherited)",
Description = "Path to the override CSV file (columns: SourceName,Connection,SourceReference,Filter[,MesReportable]; blank field = inherited)",
Required = true
};
var importCmd = new Command("import")
@@ -723,7 +723,7 @@ public static class InstanceCommands
var overrides = parseResult.Rows
.Select(r => new NativeAlarmSourceOverrideEntry(
r.SourceName, r.Connection, r.SourceReference, r.Filter))
r.SourceName, r.Connection, r.SourceReference, r.Filter, r.MesReportable))
.ToList();
return await CommandHelpers.ExecuteCommandAsync(
result, urlOption, formatOption, usernameOption, passwordOption,
+8 -6
View File
@@ -646,8 +646,10 @@ scadabridge --url <url> instance native-alarm-source clear --instance-id <int> -
Bulk-apply native alarm source overrides for a single instance from a CSV file
(all-or-nothing — the native-source parity of `instance import-overrides`). The CSV
header is required: `SourceName,Connection,SourceReference,Filter`; a blank override
field keeps the inherited value. Every named source must resolve for the instance and
header is required: `SourceName,Connection,SourceReference,Filter`, optionally followed by
`MesReportable` (`true`, `false` or blank = inherit); a blank override field keeps the
inherited value. Without the `MesReportable` column every imported source's MES override
is reset to inherit, so include it to preserve or set MES-reportable overrides. Every named source must resolve for the instance and
be unlocked, or the whole batch is rejected before any write.
```sh
@@ -657,14 +659,14 @@ scadabridge --url <url> instance native-alarm-source import --instance-id <int>
| Option | Required | Description |
|--------|----------|-------------|
| `--instance-id` | yes | Instance ID |
| `--file` | yes | Path to the override CSV (`SourceName,Connection,SourceReference,Filter`; blank field = inherited) |
| `--file` | yes | Path to the override CSV (`SourceName,Connection,SourceReference,Filter[,MesReportable]`; blank field = inherited) |
Example CSV:
```csv
SourceName,Connection,SourceReference,Filter
Pressure,OpcB,ns=2;s=Pump.Alarm,Active
Module.Temp,,,
SourceName,Connection,SourceReference,Filter,MesReportable
Pressure,OpcB,ns=2;s=Pump.Alarm,Active,true
Module.Temp,,,,
```
#### `instance deploy`