public void WriteWorkResult(KPoint key, MapSectionWorkResult val, bool overwriteResults) { // When writing include the Area's offset. KPoint transKey = key.ToGlobal(_position); try { lock (_repoLock) { if (overwriteResults) { _countsRepo.Change(transKey, val); //WorkResultReWriteCount++; } else { _countsRepo.Add(transKey, val, saveOnWrite: false); //WorkResultWriteCount++; } } } catch { Debug.WriteLine($"Could not write data for x: {transKey.X} and y: {transKey.Y}."); } }
public void WriteWorkResult(SubJob subJob, bool overwriteResults) { KPoint key = subJob.Position; SubJobResult val = subJob.SubJobResult; // When writing, include the Area's offset. KPoint transKey = key.ToGlobal(_position); try { lock (_repoLock) { if (Closed) { return; } if (overwriteResults) { _countsRepo.Change(transKey, val); } else { _countsRepo.Add(transKey, val, saveOnWrite: true); } } } catch { Debug.WriteLine($"Could not write data for x: {key.X} and y: {key.Y}."); } }