当前位置: 首页>>代码示例>>C#>>正文


C# Measurement.AddMessage方法代码示例

本文整理汇总了C#中Measurement.AddMessage方法的典型用法代码示例。如果您正苦于以下问题:C# Measurement.AddMessage方法的具体用法?C# Measurement.AddMessage怎么用?C# Measurement.AddMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Measurement的用法示例。


在下文中一共展示了Measurement.AddMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildMeasurement


//.........这里部分代码省略.........
            result.DeadtimeCorrectedRates.Singles.v = results.singles;
            result.DeadtimeCorrectedRates.Doubles.v = results.doubles;
            result.DeadtimeCorrectedRates.Triples.v = results.triples;
            result.rates.RawRates.Scaler1s.v = results.scaler1;
            result.rates.RawRates.Scaler2s.v = results.scaler2;
            result.rates.RawRates.Scaler1s.err = results.scaler1_err;
            result.rates.RawRates.Scaler2s.err = results.scaler2_err;
            result.S1Sum = results.scaler1_sum;
            result.S2Sum = results.scaler2_sum;
            result.ASum = results.acc_sum;
            result.RASum = results.reals_plus_acc_sum;
            result.RAMult = TransferUtils.multarrayxfer(results.mult_reals_plus_acc_sum, INCC.MULTI_ARRAY_SIZE);
            result.NormedAMult = TransferUtils.multarrayxfer(results.mult_acc_sum, INCC.MULTI_ARRAY_SIZE);
            result.MaxBins = (ulong)Math.Max(result.RAMult.Length, result.NormedAMult.Length);
            result.MinBins = (ulong)Math.Min(result.RAMult.Length, result.NormedAMult.Length);
            mcr.RawDoublesRate.v = results.uncorrected_doubles;
            mcr.RawDoublesRate.err = results.uncorrected_doubles_err;
            result.singles_multi = results.singles_multi;
            result.doubles_multi = results.doubles_multi;
            result.triples_multi = results.triples_multi;

            // hack expansion of Normed mult array to same length as Acc mult array on each cycle to accomodate TheoreticalOutlier calc array length bug
            ExpandMaxBins(MaxBins, meas.Cycles, det.MultiplicityParams);
            Bloat(MaxBins, mcr);

            List<MeasurementMsg> msgs = meas.GetMessageList(det.MultiplicityParams);

            // move the error messages
            for (int i = 0; i < INCC.NUM_ERROR_MSG_CODES; i++)
            {
                int index = i * INCC.ERR_MSG_LENGTH;
                string e = TransferUtils.str(results.error_msg_codes + index, INCC.ERR_MSG_LENGTH);
                if (e.Length > 0)
                    meas.AddMessage(msgs, LogLevels.Error, 911, e, meas.MeasurementId.MeasDateTime);
            }
            // move the warning messages
            for (int i = 0; i < INCC.NUM_WARNING_MSG_CODES; i++)
            {
                int index = i * INCC.ERR_MSG_LENGTH;
                string w = TransferUtils.str(results.warning_msg_codes + index, INCC.ERR_MSG_LENGTH);
                if (w.Length > 0)
                    meas.AddMessage(msgs, LogLevels.Warning, 411, w, meas.MeasurementId.MeasDateTime);
            }

            #region results transfer
            INCCMethodResults imr;
            bool got = meas.INCCAnalysisResults.TryGetINCCResults(det.MultiplicityParams, out imr); // only ever this single mkey for INCC5-style transfer import, (thankfully)
            if (got)
                imr.primaryMethod = OldToNewMethodId(results.primary_analysis_method);
            // check these results against the meas.MeasOption expectation => seems to always be 1 - 1 with (opt, sr) -> results, and subresults only for verif and calib choice
            //         rates -> none,
            //         bkg -> bkg, norm -> bias, init src -> init src, prec ->  prec,
            //         calib -> calib, 1 or more INCC methods on the methods submap
            //         verif -> 1 or more INCC methods on the methods submap
            foreach (iresultsbase r in itf.method_results_list)
            {
                if (r is results_init_src_rec)
                {
                    mlogger.TraceEvent(LogLevels.Verbose, 34041, ("Transferring initial source results"));

                    results_init_src_rec oldres = (results_init_src_rec)r;

                    INCCResults.results_init_src_rec newres = (INCCResults.results_init_src_rec)
                    meas.INCCAnalysisState.Lookup(new MeasOptionSelector(meas.MeasOption, det.MultiplicityParams), typeof(INCCResults.results_init_src_rec));

                    newres.mode = OldToNewBiasTestId(oldres.init_src_mode);
开发者ID:hnordquist,项目名称:INCC6,代码行数:67,代码来源:INCCKnew.cs


注:本文中的Measurement.AddMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。