Пример #1
0
        private void MakeMalformation(Phenomenon index, CurvesDataManager data, int curveIndex)
        {
            const int Y_VALUES_INDEX = 0;
            Series    series         = data.ModifiedCurves[curveIndex];
            int       pointsNo       = series.Points.Count;
            double    valuesInterval = SeriesAssist.GetValuesInterval(series, Y_VALUES_INDEX);

            switch (index)
            {
            case Phenomenon.Peek:
                SeriesAssist.OverrideValue(series, Convert.ToInt32((1.0 / 4.0) * pointsNo), -(1.0 / 2.0) * valuesInterval, Y_VALUES_INDEX);
                SeriesAssist.OverrideValue(series, Convert.ToInt32((1.0 / 3.0) * pointsNo), (1.0 / 5.0) * valuesInterval, Y_VALUES_INDEX);
                SeriesAssist.OverrideValue(series, Convert.ToInt32((1.0 / 2.0) * pointsNo), (1.0 / 2.0) * valuesInterval, Y_VALUES_INDEX);
                SeriesAssist.OverrideValue(series, Convert.ToInt32((2.0 / 3.0) * pointsNo), -(1.0 / 5.0) * valuesInterval, Y_VALUES_INDEX);
                SeriesAssist.OverrideValue(series, Convert.ToInt32((3.0 / 4.0) * pointsNo), (1.0 / 2.0) * valuesInterval, Y_VALUES_INDEX);
                break;

            case Phenomenon.Saturation:
                int leftPoint  = Convert.ToInt32((4.0 / 11.0) * pointsNo);
                int rightPoint = Convert.ToInt32((8.0 / 11.0) * pointsNo);
                SeriesAssist.OverrideValues(series, leftPoint, rightPoint, (3.0 / 11.0) * valuesInterval, Y_VALUES_INDEX);
                break;
            }

            data.AlterCurve(series, DataSetCurveType.Modified, curveIndex);
        }
Пример #2
0
        /// <summary>
        /// Returns true if any phenom collection contains selected phenom.
        /// </summary>
        /// <param name="phenom"></param>
        /// <returns></returns>
        public bool Contains(Phenomenon phenom)
        {
            bool ret = false;

            foreach (var fItem in this)
            {
                if (fItem.Contains(phenom))
                {
                    ret = true;
                    break;
                }
            } // foreach (var fItem in this)

            return(ret);
        }
Пример #3
0
        private IList <string> GetUiGridColumnsNames(Phenomenon phenomenon)
        {
            switch (phenomenon)
            {
            case Phenomenon.Peek:
                return(new List <string>()
                {
                    uiLPeekGrid_NoiseA_Col.Name, uiLPeekGrid_NoiseB_Col.Name, uiLPeekGrid_NoiseC_Col.Name, uiLPeekGrid_NoiseD_Col.Name
                });

            case Phenomenon.Saturation:
                return(new List <string>()
                {
                    uiLSatGrid_NoiseA_Col.Name, uiLSatGrid_NoiseB_Col.Name, uiLSatGrid_NoiseC_Col.Name, uiLSatGrid_NoiseD_Col.Name
                });
            }

            return(new List <string>().AsReadOnly());
        }