feat: add JoeAppEngine OPC UA nodes, fix DCL auto-reconnect and quality push

- Add JoeAppEngine folder to OPC UA nodes.json (BTCS, AlarmCntsBySeverity, Scheduler/ScanTime)
- Fix DataConnectionActor: capture Self in PreStart for use from non-actor threads,
  preventing Self.Tell failure in Disconnected event handler
- Implement InstanceActor.HandleConnectionQualityChanged to mark attributes Bad on disconnect
- Fix LmxFakeProxy TagMapper to serialize arrays as JSON instead of "System.Int32[]"
- Allow DataType and DataSourceReference updates in TemplateService.UpdateAttributeAsync
- Update test_infra_opcua.md with JoeAppEngine documentation
This commit is contained in:
Joseph Doherty
2026-03-19 13:27:54 -04:00
parent ffdda51990
commit 7740a3bcf9
70 changed files with 2684 additions and 541 deletions

View File

@@ -6,30 +6,30 @@ namespace ScadaLink.CLI.Commands;
public static class HealthCommands
{
public static Command Build(Option<string> contactPointsOption, Option<string> formatOption)
public static Command Build(Option<string> contactPointsOption, Option<string> formatOption, Option<string> usernameOption, Option<string> passwordOption)
{
var command = new Command("health") { Description = "Health monitoring" };
command.Add(BuildSummary(contactPointsOption, formatOption));
command.Add(BuildSite(contactPointsOption, formatOption));
command.Add(BuildEventLog(contactPointsOption, formatOption));
command.Add(BuildParkedMessages(contactPointsOption, formatOption));
command.Add(BuildSummary(contactPointsOption, formatOption, usernameOption, passwordOption));
command.Add(BuildSite(contactPointsOption, formatOption, usernameOption, passwordOption));
command.Add(BuildEventLog(contactPointsOption, formatOption, usernameOption, passwordOption));
command.Add(BuildParkedMessages(contactPointsOption, formatOption, usernameOption, passwordOption));
return command;
}
private static Command BuildSummary(Option<string> contactPointsOption, Option<string> formatOption)
private static Command BuildSummary(Option<string> contactPointsOption, Option<string> formatOption, Option<string> usernameOption, Option<string> passwordOption)
{
var cmd = new Command("summary") { Description = "Get system health summary" };
cmd.SetAction(async (ParseResult result) =>
{
return await CommandHelpers.ExecuteCommandAsync(
result, contactPointsOption, formatOption, new GetHealthSummaryCommand());
result, contactPointsOption, formatOption, usernameOption, passwordOption, new GetHealthSummaryCommand());
});
return cmd;
}
private static Command BuildSite(Option<string> contactPointsOption, Option<string> formatOption)
private static Command BuildSite(Option<string> contactPointsOption, Option<string> formatOption, Option<string> usernameOption, Option<string> passwordOption)
{
var identifierOption = new Option<string>("--identifier") { Description = "Site identifier", Required = true };
var cmd = new Command("site") { Description = "Get health for a specific site" };
@@ -38,12 +38,12 @@ public static class HealthCommands
{
var identifier = result.GetValue(identifierOption)!;
return await CommandHelpers.ExecuteCommandAsync(
result, contactPointsOption, formatOption, new GetSiteHealthCommand(identifier));
result, contactPointsOption, formatOption, usernameOption, passwordOption, new GetSiteHealthCommand(identifier));
});
return cmd;
}
private static Command BuildEventLog(Option<string> contactPointsOption, Option<string> formatOption)
private static Command BuildEventLog(Option<string> contactPointsOption, Option<string> formatOption, Option<string> usernameOption, Option<string> passwordOption)
{
var siteOption = new Option<string>("--site") { Description = "Site identifier", Required = true };
var eventTypeOption = new Option<string?>("--event-type") { Description = "Filter by event type" };
@@ -55,6 +55,7 @@ public static class HealthCommands
pageOption.DefaultValueFactory = _ => 1;
var pageSizeOption = new Option<int>("--page-size") { Description = "Page size" };
pageSizeOption.DefaultValueFactory = _ => 50;
var instanceNameOption = new Option<string?>("--instance-name") { Description = "Filter by instance name" };
var cmd = new Command("event-log") { Description = "Query site event logs" };
cmd.Add(siteOption);
@@ -65,10 +66,11 @@ public static class HealthCommands
cmd.Add(toOption);
cmd.Add(pageOption);
cmd.Add(pageSizeOption);
cmd.Add(instanceNameOption);
cmd.SetAction(async (ParseResult result) =>
{
return await CommandHelpers.ExecuteCommandAsync(
result, contactPointsOption, formatOption,
result, contactPointsOption, formatOption, usernameOption, passwordOption,
new QueryEventLogsCommand(
result.GetValue(siteOption)!,
result.GetValue(eventTypeOption),
@@ -77,12 +79,13 @@ public static class HealthCommands
result.GetValue(fromOption),
result.GetValue(toOption),
result.GetValue(pageOption),
result.GetValue(pageSizeOption)));
result.GetValue(pageSizeOption),
result.GetValue(instanceNameOption)));
});
return cmd;
}
private static Command BuildParkedMessages(Option<string> contactPointsOption, Option<string> formatOption)
private static Command BuildParkedMessages(Option<string> contactPointsOption, Option<string> formatOption, Option<string> usernameOption, Option<string> passwordOption)
{
var siteOption = new Option<string>("--site") { Description = "Site identifier", Required = true };
var pageOption = new Option<int>("--page") { Description = "Page number" };
@@ -97,7 +100,7 @@ public static class HealthCommands
cmd.SetAction(async (ParseResult result) =>
{
return await CommandHelpers.ExecuteCommandAsync(
result, contactPointsOption, formatOption,
result, contactPointsOption, formatOption, usernameOption, passwordOption,
new QueryParkedMessagesCommand(
result.GetValue(siteOption)!,
result.GetValue(pageOption),