Skip to content

Commit b92f172

Browse files
Updated file processing filters to narrow sources based on end time
1 parent 2eb5353 commit b92f172

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

Source/Tools/OHTransfer/OHTransfer.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,17 @@ private void buttonGo_Click(object sender, EventArgs e)
337337
HistorianServer server = new(archiveInfo);
338338
SnapClient client = SnapClient.Connect(server.Host);
339339
ClientDatabaseBase<HistorianKey, HistorianValue> database = client.GetDatabase<HistorianKey, HistorianValue>(InstanceName);
340-
Dictionary<Guid, ArchiveDetails> attachedFiles = database.GetAllAttachedFiles().ToDictionary(file => file.Id);
340+
Dictionary<Guid, ArchiveDetails> attachedFiles = database.GetAllAttachedFiles()
341+
.Where(file => file.EndTime > startTime && file.EndTime <= endTime)
342+
.ToDictionary(file => file.Id);
341343

342344
using ArchiveList<HistorianKey, HistorianValue> archiveList = new();
343-
archiveList.LoadFiles(attachedFiles.Values.OrderBy(file => file.EndTime).Select(file => file.FileName));
345+
346+
archiveList.LoadFiles(attachedFiles.Values
347+
.OrderBy(file => file.EndTime)
348+
.Select(file => file.FileName));
349+
350+
ShowUpdateMessage("Found {0:N0} archives in source location covering specified time range.", attachedFiles.Count);
344351

345352
SeekFilterBase<HistorianKey> timeFilter = TimestampSeekFilter.CreateFromRange<HistorianKey>(startTime, endTime);
346353
MatchFilterBase<HistorianKey, HistorianValue> pointFilter = PointIdMatchFilter.CreateFromList<HistorianKey, HistorianValue>(historianIDMapping.Keys);
@@ -366,7 +373,7 @@ void readingMonitor()
366373

367374
if (Stats.PointsReturned == 0L)
368375
{
369-
ShowUpdateMessage("\r\nScanning archives for points, processing {0:N0} cache miss retries per second...", Stats.PointsScanned / ((DateTime.UtcNow.Ticks - processStartTime) / Ticks.PerSecond));
376+
ShowUpdateMessage("\r\nScanning archives for points in specified time range, processing {0:N0} cache miss retries per second...", Stats.PointsScanned / ((DateTime.UtcNow.Ticks - processStartTime) / Ticks.PerSecond));
370377
}
371378
else
372379
{

0 commit comments

Comments
 (0)