コード例 #1
0
 public ScalableDataList(Collector col)
 {
     collector = col;
     myPED     = null;//!
     points[(int)DisplayValue.Step]    = new PointPairListPlus(null, this);
     points[(int)DisplayValue.Voltage] = new PointPairListPlus(null, this);
     points[(int)DisplayValue.Mass]    = new PointPairListPlus(null, this);
 }
コード例 #2
0
        public CyclingMeasureMode(ushort startDelay, Flavor.Common.Data.Measure.MeasureMode.Precise cycle, Action <long[][], List <PreciseEditorData>, short?> successfulExit, int iterations, int timeLimit, PreciseEditorData checkerPeak, int checkerIndex, short?initialShift, ushort allowedShift)
            : base((s, e) => {
            var ee = (Flavor.Common.Data.Measure.MeasureMode.Precise.SuccessfulExitEventArgs)e;
            successfulExit(ee.Counts, ee.Points, ee.Shift);
        }) {
            // TODO: checker peak received by index, after sort found by equality again
            //_cycle = new Flavor.Common.Data.Measure.MeasureMode.Precise(min, max, peaks, startDelay, stepDelay, exposition, forwardDelay, backwardDelay, graphUpdater, (ps, peds, shift) => OnSuccessfulExit(new Flavor.Common.Data.Measure.MeasureMode.Precise.SuccessfulExitEventArgs(ps, peds, shift)), initialShift, CheckShift);
            _cycle = cycle;
            _cycle.VoltageStepChangeRequested += Cycle_VoltageStepRequested;
            _cycle.Finalize += Cycle_Finalize;
            _cycle.Disable  += cycle_Disable;

            this.allowedShift = allowedShift;
            stopper           = new MeasureStopper(iterations, timeLimit);
            _checkerIndex     = checkerIndex;
            peak = checkerPeak;
        }
コード例 #3
0
                void CheckShift(PreciseEditorData curPeak)
                {
                    if (!cycle.shift.HasValue || curPeak == null || !curPeak.Equals(peak))
                    {
                        // do not store value here!
                        return;
                    }
                    long[] counts = cycle._counts[checkerIndex];
                    ushort width  = peak.Width;

                    if (counts.Length != 2 * width + 1)
                    {
                        // data mismatch. strange.
                        return;
                    }
                    long max   = -1;
                    int  index = -1;

                    for (int i = 0; i < counts.Length; ++i)
                    {
                        if (counts[i] > max)
                        {
                            max   = counts[i];
                            index = i;
                        }
                    }
                    if (max == counts[width])
                    {
                        index = width;
                    }
                    // delta from peak center
                    short delta = (short)(index - width);

                    if (delta > allowedShift || delta < -allowedShift)
                    {
                        cycle.shift += delta;
                        if (ignoreInvalidity)
                        {
                            return;
                        }
                        throw new ShiftException();
                    }
                }
コード例 #4
0
                public Monitor(ushort min, ushort max, List <PreciseEditorData> peaks, ushort startDelay, ushort stepDelay, ushort exposition, ushort forwardDelay, ushort backwardDelay, Action <ushort, PreciseEditorData> graphUpdater, Action <long[][], List <PreciseEditorData>, short?> successfulExit, int iterations, int timeLimit, PreciseEditorData checkerPeak, short?initialShift, ushort allowedShift)
                    : base((s, e) => {
                    var ee = (SuccessfulExitEventArgs)e;
                    successfulExit(ee.Counts, ee.Points, ee.Shift);
                }) {
                    // TODO: checker peak received by index, after sort found by equality again
                    cycle = new Precise(min, max, peaks, startDelay, stepDelay, exposition, forwardDelay, backwardDelay, graphUpdater, (ps, peds, shift) => OnSuccessfulExit(new SuccessfulExitEventArgs(ps, peds, shift)), initialShift, CheckShift);
                    cycle.VoltageStepChangeRequested += Cycle_VoltageStepRequested;
                    cycle.Finalize += Cycle_Finalize;
                    cycle.Disable  += cycle_Disable;

                    this.allowedShift = allowedShift;
                    stopper           = new MeasureStopper(iterations, timeLimit);
                    // redundant data
                    if (initialShift.HasValue && checkerPeak != null)
                    {
                        // TODO: move up to Commander. only index here
                        peak         = checkerPeak;
                        checkerIndex = peaks.FindIndex(peak.Equals);
                    }
                }
コード例 #5
0
ファイル: Service.cs プロジェクト: 15835229565/flavor-ms
 public static bool IsCarbonDioxide(this PreciseEditorData ped)
 {
     // TODO: better comment parsing
     // and/or use id+mass pair
     return(ped.Comment == "!co2");
 }
コード例 #6
0
ファイル: Service.cs プロジェクト: 15835229565/flavor-ms
 // TODO: move to more specific location (Almazov only)
 public static bool IsOxygen(this PreciseEditorData ped)
 {
     // TODO: better comment parsing
     // and/or use id+mass pair
     return(ped.Comment == "!o2");
 }
コード例 #7
0
 public ScalableDataList(Collector col, PointPairListPlus dataPoints)
 {
     collector = col;
     myPED     = dataPoints.PEDreference;
     SetRows(dataPoints);
 }
コード例 #8
0
ファイル: Graph.cs プロジェクト: 15835229565/flavor-ms
 // precise mode
 public void updateGraphDuringPreciseMeasure(ushort pnt, PreciseEditorData curped, params uint[] ys)
 {
     CurrentPeak = curped;
     // TODO: & peak
     OnNewGraphData(pnt, ys);
 }