Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions FaultRecordWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public double ProgressValue
private set => Set(ref _progressValue, Math.Clamp(value, 0d, 100d));
}

public bool CanDownload => !IsBusy && Records.Any(row => row.IsSelected && row.Record.IsComplete);
public bool CanDownload => !IsBusy && Records.Any(row => row.IsSelected && row.Record.Files.Count > 0);

public string SelectionSummary
{
Expand Down Expand Up @@ -139,7 +139,7 @@ private async Task ScanAsync()

StatusText = catalog.Records.Count == 0
? "No supported fault-record files were found. Try a known remote directory such as COMTRADE or DR."
: $"{catalog.Summary} Select one or more complete records to download.";
: $"{catalog.Summary} Select one or more available records to download; partial companion sets remain downloadable.";

if (catalog.Diagnostics.Count > 0)
StatusText += $" {catalog.Diagnostics.Count} bounded browse diagnostic(s) were reported.";
Expand Down Expand Up @@ -183,11 +183,11 @@ private async void Download_Click(object sender, RoutedEventArgs e)
return;

var selected = Records
.Where(row => row.IsSelected && row.Record.IsComplete)
.Where(row => row.IsSelected && row.Record.Files.Count > 0)
.ToArray();
if (selected.Length == 0)
{
StatusText = "Select at least one complete COMTRADE record.";
StatusText = "Select at least one record that contains an available remote file.";
return;
}

Expand Down Expand Up @@ -344,7 +344,13 @@ public sealed class FaultRecordRow : INotifyPropertyChanged
public FaultRecordRow(Iec61850FaultRecordSet record)
{
Record = record ?? throw new ArgumentNullException(nameof(record));
_status = record.IsComplete ? "Ready" : "Incomplete";
_status = record.Files.Count == 0
? "Unavailable"
: record.IsComplete
? "Ready"
: "Partial";
if (!record.IsComplete && record.Files.Count > 0)
_detail = $"Available file(s) can be downloaded; COMTRADE companion coverage: {record.Completeness}.";
}

public event PropertyChangedEventHandler? PropertyChanged;
Expand All @@ -355,7 +361,10 @@ public FaultRecordRow(Iec61850FaultRecordSet record)
public string Completeness => Record.Completeness;
public string ModifiedText => Record.LastModifiedUtc?.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture) ?? "-";
public string SizeText => Record.HasUnknownSize ? "Unknown" : FormatBytes(Record.KnownSizeBytes);
public string FilesText => string.Join(", ", Record.Files.Select(file => file.Extension.TrimStart('.').ToUpperInvariant()));
public string FilesText => string.Join(", ", Record.Files.Select(file =>
string.IsNullOrWhiteSpace(file.Extension)
? "PACKAGE"
: file.Extension.TrimStart('.').ToUpperInvariant()));

public bool IsSelected
{
Expand Down
4 changes: 3 additions & 1 deletion Services/FaultRecordTransferClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ public async Task<Iec61850FaultRecordDownloadResult> DownloadAsync(
MaximumTotalBytes = 1024L * 1024L * 1024L,
MaximumFileBytes = 512L * 1024L * 1024L,
MaximumReadOperationsPerFile = 100_000,
RequireCompleteRecord = true,
// Completeness describes COMTRADE companion coverage; it must not block
// MMS FileOpen/FileRead of files that the IED actually exposes.
RequireCompleteRecord = false,
RequireDeclaredSizeMatch = false
},
progress,
Expand Down
Loading