refactor: rename ScadaLink → ZB.MOM.WW.ScadaBridge (code + projects + namespaces)
Solution + 23 src projects + 26 test projects renamed; folders, csproj, namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated. ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated. SQL roles/logins, LDAP domains, CLI command name, and CLI config dir (~/.scadalink → ~/.scadabridge) also renamed. Build green; 5 Host.Tests fail awaiting SQL login rename in next commit. Pre-existing StaleTagMonitor timing flakes unchanged. Rename script committed at tools/rename-to-scadabridge.sh.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances;
|
||||
|
||||
public class Area
|
||||
{
|
||||
/// <summary>Gets or sets the database primary key.</summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>Gets or sets the id of the site this area belongs to.</summary>
|
||||
public int SiteId { get; set; }
|
||||
/// <summary>Gets or sets the display name of the area.</summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>Gets or sets the id of the parent area, or null for a root area.</summary>
|
||||
public int? ParentAreaId { get; set; }
|
||||
/// <summary>Gets or sets the child areas nested under this area.</summary>
|
||||
public ICollection<Area> Children { get; set; } = new List<Area>();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="Area"/> with the given name.
|
||||
/// </summary>
|
||||
/// <param name="name">Display name for the area.</param>
|
||||
public Area(string name)
|
||||
{
|
||||
Name = name ?? throw new ArgumentNullException(nameof(name));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
|
||||
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances;
|
||||
|
||||
public class Instance
|
||||
{
|
||||
/// <summary>Primary key.</summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>Foreign key to the template this instance is based on.</summary>
|
||||
public int TemplateId { get; set; }
|
||||
/// <summary>Foreign key to the site where this instance is deployed.</summary>
|
||||
public int SiteId { get; set; }
|
||||
/// <summary>Optional foreign key to the organisational area this instance belongs to.</summary>
|
||||
public int? AreaId { get; set; }
|
||||
/// <summary>System-wide unique name that identifies this instance.</summary>
|
||||
public string UniqueName { get; set; }
|
||||
/// <summary>Current lifecycle state of the instance.</summary>
|
||||
public InstanceState State { get; set; }
|
||||
/// <summary>Per-attribute value overrides applied on top of the template defaults.</summary>
|
||||
public ICollection<InstanceAttributeOverride> AttributeOverrides { get; set; } = new List<InstanceAttributeOverride>();
|
||||
/// <summary>Per-alarm configuration overrides applied on top of the template defaults.</summary>
|
||||
public ICollection<InstanceAlarmOverride> AlarmOverrides { get; set; } = new List<InstanceAlarmOverride>();
|
||||
/// <summary>Data-connection bindings that map template tags to site data sources.</summary>
|
||||
public ICollection<InstanceConnectionBinding> ConnectionBindings { get; set; } = new List<InstanceConnectionBinding>();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance with the required unique name.
|
||||
/// </summary>
|
||||
/// <param name="uniqueName">System-wide unique name for this instance.</param>
|
||||
public Instance(string uniqueName)
|
||||
{
|
||||
UniqueName = uniqueName ?? throw new ArgumentNullException(nameof(uniqueName));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances;
|
||||
|
||||
/// <summary>
|
||||
/// Per-instance override for a template-defined alarm. Lets a deployed
|
||||
/// instance tweak setpoints, priority, or per-band messages without forking
|
||||
/// the template. Locked alarms (TemplateAlarm.IsLocked) cannot be overridden
|
||||
/// — LockEnforcer rejects the change at write time.
|
||||
///
|
||||
/// Merge semantics (applied during flattening, after template inheritance and
|
||||
/// composition):
|
||||
/// • <see cref="TriggerConfigurationOverride"/> with a HiLo trigger merges
|
||||
/// into the inherited JSON setpoint-by-setpoint (derived keys win,
|
||||
/// inherited keys survive for unset derived keys). Same logic as
|
||||
/// template-to-template HiLo override, just one layer deeper.
|
||||
/// • For ValueMatch / RangeViolation / RateOfChange, the override replaces
|
||||
/// the whole TriggerConfiguration JSON (existing whole-replace semantics).
|
||||
/// • <see cref="PriorityLevelOverride"/> replaces the alarm's PriorityLevel
|
||||
/// when set.
|
||||
/// </summary>
|
||||
public class InstanceAlarmOverride
|
||||
{
|
||||
/// <summary>Primary key.</summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>Foreign key to the instance this override belongs to.</summary>
|
||||
public int InstanceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Canonical name of the alarm being overridden — matches
|
||||
/// <c>ResolvedAlarm.CanonicalName</c> after flattening, so composed-member
|
||||
/// alarms are referenced as <c>[CompositionInstance].[AlarmName]</c>.
|
||||
/// </summary>
|
||||
public string AlarmCanonicalName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Partial JSON (for HiLo) or full JSON (for binary trigger types) to
|
||||
/// override the inherited TriggerConfiguration. <c>null</c> means
|
||||
/// "leave inherited as-is".
|
||||
/// </summary>
|
||||
public string? TriggerConfigurationOverride { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces the alarm's PriorityLevel when set. <c>null</c> = keep inherited.
|
||||
/// </summary>
|
||||
public int? PriorityLevelOverride { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new alarm override for the specified alarm.
|
||||
/// </summary>
|
||||
/// <param name="alarmCanonicalName">Canonical name of the alarm to override.</param>
|
||||
public InstanceAlarmOverride(string alarmCanonicalName)
|
||||
{
|
||||
AlarmCanonicalName = alarmCanonicalName ?? throw new ArgumentNullException(nameof(alarmCanonicalName));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances;
|
||||
|
||||
public class InstanceAttributeOverride
|
||||
{
|
||||
/// <summary>Gets or sets the primary key.</summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>Gets or sets the foreign key of the owning instance.</summary>
|
||||
public int InstanceId { get; set; }
|
||||
/// <summary>Gets or sets the attribute name this override targets.</summary>
|
||||
public string AttributeName { get; set; }
|
||||
/// <summary>Gets or sets the override value, or <c>null</c> to clear a previous override.</summary>
|
||||
public string? OverrideValue { get; set; }
|
||||
|
||||
/// <summary>Initializes a new <see cref="InstanceAttributeOverride"/> for the given attribute name.</summary>
|
||||
/// <param name="attributeName">The name of the attribute to override.</param>
|
||||
public InstanceAttributeOverride(string attributeName)
|
||||
{
|
||||
AttributeName = attributeName ?? throw new ArgumentNullException(nameof(attributeName));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances;
|
||||
|
||||
public class InstanceConnectionBinding
|
||||
{
|
||||
/// <summary>Auto-incremented primary key.</summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>Foreign key to the owning instance.</summary>
|
||||
public int InstanceId { get; set; }
|
||||
/// <summary>Name of the attribute on the instance that this binding maps to a data connection tag.</summary>
|
||||
public string AttributeName { get; set; }
|
||||
/// <summary>Foreign key to the data connection that provides values for this attribute.</summary>
|
||||
public int DataConnectionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a binding for the specified attribute name.
|
||||
/// </summary>
|
||||
/// <param name="attributeName">Name of the attribute being bound to a data connection.</param>
|
||||
public InstanceConnectionBinding(string attributeName)
|
||||
{
|
||||
AttributeName = attributeName ?? throw new ArgumentNullException(nameof(attributeName));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user