Example #1
0
 public IEnumerable <double> GetResearchValues(IResearchSet researchSet, double inpulseTime, double time)
 {
     using (var cs = new CancellationTokenSource())
     {
         _cancellationTokenSource = cs;
         try
         {
             var c = cs;
             return(researchSet.GetPoints().Select(point =>
                                                   _radiants.Sum(RadiantProcessing(inpulseTime, time, c.Token, point))));
         }
         finally
         {
             _cancellationTokenSource = null;
         }
     }
 }
Example #2
0
        public IEnumerable <Tuple <Point3D, double, IDictionary <ProcessorRadiant, double> > > GetResearchValueByRadinats(IResearchSet researchSet, double inpulseTime, double time)
        {
            using (var cs = new CancellationTokenSource())
            {
                _cancellationTokenSource = cs;
                try
                {
                    var c = cs;
                    return(researchSet.GetPoints().Select(point =>

                    {
                        var dict = _radiants.ToDictionary(it => (ProcessorRadiant)it, RadiantProcessing(inpulseTime, time, c.Token, point));
                        return new Tuple <Point3D, double, IDictionary <ProcessorRadiant, double> >(point, dict.Values.Sum(), dict);
                    }
                                                          ));
                }
                finally
                {
                    _cancellationTokenSource = null;
                }
            }
        }