@using ZB.MOM.WW.OtOpcUa.Admin.Services @using ZB.MOM.WW.OtOpcUa.Configuration.Entities @using ZB.MOM.WW.OtOpcUa.Core.Abstractions @using ZB.MOM.WW.OtOpcUa.Core.Scripting @inject ScriptService ScriptSvc @inject ScriptTestHarnessService Harness

Scripts

C# (Roslyn). Used by virtual tags + scripted alarms.
@if (_loading) {

Loading…

} else if (_scripts.Count == 0 && _editing is null) {
No scripts yet in this draft.
} else {
@foreach (var s in _scripts) { }
@if (_editing is not null) {
@(_isNew ? "New script" : _editing.Name)
@if (!_isNew) { }
@if (_dependencies is not null) {
Inferred reads @if (_dependencies.Reads.Count == 0) { none } else {
    @foreach (var r in _dependencies.Reads) {
  • @r
  • }
} Inferred writes @if (_dependencies.Writes.Count == 0) { none } else {
    @foreach (var w in _dependencies.Writes) {
  • @w
  • }
} @if (_dependencies.Rejections.Count > 0) {
Non-literal paths rejected:
    @foreach (var r in _dependencies.Rejections) {
  • @r.Message
  • }
}
} @if (_testResult is not null) {
Harness result: @_testResult.Outcome @if (_testResult.Outcome == ScriptTestOutcome.Success) {
Output: @(_testResult.Output?.ToString() ?? "null")
@if (_testResult.Writes.Count > 0) {
Writes:
    @foreach (var kv in _testResult.Writes) {
  • @kv.Key = @(kv.Value?.ToString() ?? "null")
  • }
} } @if (_testResult.Errors.Count > 0) {
@foreach (var e in _testResult.Errors) {
@e
}
} @if (_testResult.LogEvents.Count > 0) {
Script log output:
    @foreach (var e in _testResult.LogEvents) {
  • [@e.Level] @e.RenderMessage()
  • }
}
}
}
} @code { [Parameter] public long GenerationId { get; set; } [Parameter] public string ClusterId { get; set; } = string.Empty; private bool _loading = true; private bool _busy; private bool _harnessBusy; private bool _isNew; private List