Пример #1
0
        // TODO: protected
        public bool Sense()
        {
            if (pState == ProgramStates.Ready)
            {
                if (SomePointsUsed)
                {
                    var g = Graph.MeasureGraph.Instance;
                    g.Reset();
                    {
                        var co   = g.CommonOptions;
                        var temp = new MeasureMode.Precise(Config.MIN_STEP, Config.MAX_STEP,
                                                           g.PreciseData.GetUsed(),
                                                           co.befTimeReal, co.iTimeReal, co.eTimeReal,
                                                           co.ForwardTimeEqualsBeforeTime ? co.befTimeReal : co.fTimeReal, co.bTimeReal,
                                                           (p, peak) => g.updateGraphDuringPreciseMeasure(p, peak, Counts),
                                                           g.updateGraphAfterPreciseMeasure);
                        temp.SaveResults += (s, e) => Config.autoSavePreciseSpectrumFile();
                        // how to unsubscribe?
                        //realizer.MeasureSend += (s, e) => temp.NextMeasure(e.Value);

                        CurrentMeasureMode = temp;
                    }
                    initMeasure(ProgramStates.Measure);
                    return(true);
                }
                else
                {
                    OnLog("No points for precise mode measure.");
                    return(false);
                }
            }
            return(false);
        }
Пример #2
0
        // TODO: protected
        public bool Sense()
        {
            if (pState == ProgramStates.Ready) {
                if (SomePointsUsed) {
                    var g = Graph.MeasureGraph.Instance;
                    g.Reset();
                    {
                        var co = g.CommonOptions;
                        var temp = new MeasureMode.Precise(Config.MIN_STEP, Config.MAX_STEP,
                            g.PreciseData.GetUsed(),
                            co.befTimeReal, co.iTimeReal, co.eTimeReal,
                            co.ForwardTimeEqualsBeforeTime ? co.befTimeReal : co.fTimeReal, co.bTimeReal,
                            (p, peak) => g.updateGraphDuringPreciseMeasure(p, peak, Counts),
                            g.updateGraphAfterPreciseMeasure);
                        temp.SaveResults += (s, e) => Config.autoSavePreciseSpectrumFile();
                        // how to unsubscribe?
                        //realizer.MeasureSend += (s, e) => temp.NextMeasure(e.Value);

                        CurrentMeasureMode = temp;
                    }
                    initMeasure(ProgramStates.Measure);
                    return true;
                } else {
                    OnLog("No points for precise mode measure.");
                    return false;
                }
            }
            return false;
        }