Add Enabled flag to AlarmGroups; filter disabled groups from AlarmOperation#593
Draft
Add Enabled flag to AlarmGroups; filter disabled groups from AlarmOperation#593
Conversation
Co-authored-by: clackner-gpa <52460212+clackner-gpa@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add enabled flag to AlarmGroups and update AlarmOperation behavior
Add Enabled flag to AlarmGroups; filter disabled groups from AlarmOperation
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AlarmGroupshad no enable/disable mechanism, soAlarmOperationalways evaluated all alarms regardless of intent. This adds anEnabledflag with defaulttrue(preserving existing behavior) and filters disabled groups out of alarm evaluation at the SQL level.Data Model
Enabled BIT NOT NULL DEFAULT(1)toAlarmGrouptableAlarmGroupandAlarmGroupViewC# models updated with[DefaultValue(true)] public bool Enabled { get; set; }SQL Views
ActiveAlarmView: both UNION branches now exclude disabled groups —AlarmFactorbranch usesINNER JOIN AlarmGroup AG ON ... AND AG.Enabled = 1; synthetic-factor branch usesWHERE AlarmGroup.Enabled = 1. This is whereHIDSAlarmOperationqueries, so no C# changes are needed.AlarmGroupView: exposesEnabledcolumn for UI consumption( SELECT AF.ID, AF.Factor, AF.AlarmGroupID, AF.SeverityID FROM AlarmFactor AF INNER JOIN AlarmGroup AG ON AF.AlarmGroupID = AG.ID AND AG.Enabled = 1 UNION SELECT NULL, 1.0, AlarmGroup.ID, AlarmGroup.SeverityID FROM AlarmGroup WHERE AlarmGroup.Enabled = 1 ) AlarmFactor LEFT JOIN ...Migration
AlarmGroup-Enabled-Migration.sql: idempotentALTER TABLE(column add guarded byIF NOT EXISTS), followed by drop/recreate of both views — safe to run against existing databasesAPI / TypeScript
IAlarmGroupandIAlarmGroupViewinterfaces gainEnabled: booleanEnabled: truein Redux reset actionUI (SPCTools)
GeneralSettings.tsx:CheckBoxforEnabledin the wizard's general settings stepAlarmGroup.tsx: Status column (Enabled/Disabled badge) in the list view;Enabledadded as a searchable fieldOriginal prompt
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.