Example #1
0
        public AnalysisDefs.RateResult GetResult(LMLoggers.LognLM log)
        {
            AnalysisDefs.RateResult result;
            RateAccumulator         aBlock;
            UInt32 i, j, blockOffset, index;

            result = new AnalysisDefs.RateResult(RawAnalysisProperties.ChannelCount);

            try
            {
                result.gateWidthInTics           = this.gateWidth;
                result.numCompletedGates         = this.presentDataZeroGateIndexOffset + this.presentData.numCompletedGates;
                result.neutronsPerGate           = new UInt32[result.numCompletedGates];
                result.neutronsPerGatePerChannel = new UInt32[result.numCompletedGates][];

                aBlock      = this.gateStack;
                blockOffset = 0;
                //copy data from all but the last block
                while (aBlock.next != null)
                {
                    for (i = 0; i < RawAnalysisProperties.rateGatesPerAccumulator; i++)
                    {
                        index = i + blockOffset;
                        result.neutronsPerGate[index]           = aBlock.neutronsPerGate[i];
                        result.neutronsPerGatePerChannel[index] = new UInt32[RawAnalysisProperties.ChannelCount];
                        for (j = 0; j < RawAnalysisProperties.ChannelCount; j++)
                        {
                            result.neutronsPerGatePerChannel[index][j] = aBlock.neutronsPerGatePerChannel[i][j];
                        }
                    }
                    blockOffset += RawAnalysisProperties.rateGatesPerAccumulator;
                    aBlock       = aBlock.next;
                }
                //copy data from the last block
                for (i = 0; i < aBlock.numCompletedGates; i++)
                {
                    index = i + blockOffset;
                    result.neutronsPerGate[index]           = aBlock.neutronsPerGate[i];
                    result.neutronsPerGatePerChannel[index] = new UInt32[RawAnalysisProperties.ChannelCount];
                    for (j = 0; j < RawAnalysisProperties.ChannelCount; j++)
                    {
                        result.neutronsPerGatePerChannel[index][j] = aBlock.neutronsPerGatePerChannel[i][j];
                    }
                }
            }
            catch (System.OutOfMemoryException oom)
            {
                GC.Collect();
                if (log != null)
                {
                    log.TraceException(oom);
                }
            }
            return(result);
        }
Example #2
0
        public AnalysisDefs.RateResult GetResult(LMLoggers.LognLM log)
        {
            AnalysisDefs.RateResult result;
            RateAccumulator aBlock;
            UInt32 i, j, blockOffset, index;

            result = new AnalysisDefs.RateResult(RawAnalysisProperties.ChannelCount);

            try
            {
                result.gateWidthInTics = this.gateWidth;
                result.numCompletedGates = this.presentDataZeroGateIndexOffset + this.presentData.numCompletedGates;
                result.neutronsPerGate = new UInt32[result.numCompletedGates];
                result.neutronsPerGatePerChannel = new UInt32[result.numCompletedGates][];

                aBlock = this.gateStack;
                blockOffset = 0;
                //copy data from all but the last block
                while (aBlock.next != null)
                {
                    for (i = 0; i < RawAnalysisProperties.rateGatesPerAccumulator; i++)
                    {
                        index = i + blockOffset;
                        result.neutronsPerGate[index] = aBlock.neutronsPerGate[i];
                        result.neutronsPerGatePerChannel[index] = new UInt32[RawAnalysisProperties.ChannelCount];
                        for (j = 0; j < RawAnalysisProperties.ChannelCount; j++)
                        {
                            result.neutronsPerGatePerChannel[index][j] = aBlock.neutronsPerGatePerChannel[i][j];
                        }
                    }
                    blockOffset += RawAnalysisProperties.rateGatesPerAccumulator;
                    aBlock = aBlock.next;
                }
                //copy data from the last block
                for (i = 0; i < aBlock.numCompletedGates; i++)
                {
                    index = i + blockOffset;
                    result.neutronsPerGate[index] = aBlock.neutronsPerGate[i];
                    result.neutronsPerGatePerChannel[index] = new UInt32[RawAnalysisProperties.ChannelCount];
                    for (j = 0; j < RawAnalysisProperties.ChannelCount; j++)
                    {
                        result.neutronsPerGatePerChannel[index][j] = aBlock.neutronsPerGatePerChannel[i][j];
                    }
                }
            }
            catch (System.OutOfMemoryException oom)
            {
                GC.Collect();
                if (log != null) log.TraceException(oom);
            }
            return (result);
        }