Пример #1
0
        public BaseRate GetFirstRate(bool activeOnly = true, bool addIfNotPresent = false)
        {
            List <SpecificCountingAnalyzerParams> l = GetBases(activeOnly);

            if (l != null && l.Count > 0)
            {
                return((BaseRate)l[0]);
            }
            else
            {
                BaseRate t = new BaseRate();
                if (addIfNotPresent)
                {
                    Add(t);
                }
                return(t);
            }
        }
Пример #2
0
        public bool Transfer(BaseRate ba, RateResult rates)
        {
            if (rates == null)
            {
                return(true);
            }
            bool res = true;

            try
            {
                RatesResultEnhanced rrm = new RatesResultEnhanced(rates.numCompletedGates, ba.gateWidthTics);
                rrm.totaltime = new TimeSpan(this.TS.Ticks);
                countresults.Add(ba, rrm);
                rrm.TransferRawResult(rates);
            }
            catch (OutOfMemoryException e)
            {
                ba.reason = "BaseRate transfer " + e.Message;
                res       = false;
                logger?.TraceEvent(LogLevels.Error, 87405, ba.reason);
            }
            return(res);
        }