public void Construct(RawAnalyzerHandler.AnalysesCompleted f, RawAnalyzerHandler.NeutronOutOfSequenceErrorEvent f2, RawAnalyzerHandler.BlockCountMismatchErrorEvent f3, double theTicSizeInSeconds) { handler = new RawAnalyzerHandler(theTicSizeInSeconds: theTicSizeInSeconds, logger: logger); handler.OnAnalysesCompleted += f; handler.OnNeutronOutOfSequenceErrorEvent += f2; handler.OnBlockCountMismatchErrorEvent += f3; }
internal void SetupCountingAnalyzerHandler(Config cfg, double tickSizeInSeconds, RawAnalyzerHandler.AnalysesCompleted f = null, RawAnalyzerHandler.NeutronOutOfSequenceErrorEvent f2 = null, RawAnalyzerHandler.BlockCountMismatchErrorEvent f3 = null) { State.Sup.SetLogger(analogger); if (f == null) // use the local handle { State.Sup.Construct((string s) => { AssayPendingComplete(); logger.TraceEvent(LogLevels.Info, 139, "Neutron counting processing complete: '" + s + "'"); }, (string s) => { AssayPendingComplete(); logger.TraceEvent(LogLevels.Error, 138, "Neutron counting processing stopped with error: '" + s + "'"); EndAnalysisImmediately(); throw new FatalNeutronCountingException(s); // emergency exit, caught and noted in buffer handler PassToAnalysis }, (string s) => { AssayPendingComplete(); logger.TraceEvent(LogLevels.Error, 137, "Neutron counting processing [Block] stopped with error: '" + s + "'"); EndAnalysisImmediately(); throw new FatalNeutronCountingException(s); // emergency exit, caught and noted in buffer handler PassToAnalysis }, theTicSizeInSeconds: tickSizeInSeconds); // starts the threads, so watch out! } else { State.Sup.Construct(f, f2, f3, theTicSizeInSeconds: tickSizeInSeconds); // ditto } logger.TraceEvent(LogLevels.Verbose, 146, "Neutron counting task running, {0} time base", tickSizeInSeconds); }