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}."); } }
public bool RetrieveWorkResultFromRepo(KPoint riKey, SubJobResult workResult) { // When writing include the Area's offset. KPoint transKey = riKey.ToGlobal(_position); lock (_repoLock) { if (Closed) { return(false); } bool result = _countsRepo.ReadParts(transKey, workResult); return(result); } }