示例#1
0
文件: Job.cs 项目: drminor/FGenQD
        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}.");
            }
        }
示例#2
0
文件: Job.cs 项目: drminor/FGenQD
        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);
            }
        }