コード例 #1
0
 public DoubleAxesGroup CreateRelativeGroup(AxisFormat axisFormat)
 {
     _isRelative = true;
     _parameter = new DoubleAxisParameter("%", 0, 100, axisFormat);
     return DoCreateAbsoluteGroup();
 }
コード例 #2
0
        private TimeDoubleCurve AddCurve(
			string uom,
			double min,
			double max,
			Color color,
			RedrawTime redrawTime,
			string descriptionText1,
			string descriptionText2,
			string descriptionText3,
			string descriptionText4,
			string descriptionText5,
			AxisMatchingMode axisMatchMode,
			CurveDrawingMode curveDrawingMode,
			IValueFormater valueFormater,
			IValueFetchStrategy valueFetchStrategy,
			AxisFormat axisFormat,
			double volatileFactor)
        {
            _globalCurvesCounter++;

            var curve = CurveDisplay.TimeDoublePlottingSystem.AddCurve(
                uom,
                min,
                max,
                color,
                redrawTime,
                axisMatchMode,
                curveDrawingMode,
                valueFormater,
                valueFetchStrategy,
                axisFormat,
                5000);

            curve.Description.DescriptionText1 = descriptionText1;
            curve.Description.DescriptionText2 = descriptionText2;
            curve.Description.DescriptionText3 = descriptionText3;
            curve.Description.DescriptionText4 = descriptionText4;
            curve.Description.DescriptionText5 = descriptionText5;

            if (valueFormater is FloatingCommaValueFormater)
            {
                var firstCurve = _curves.Count == 0;

                var pf = TimeDoubleEntryFactory2.Attach(
                    curve,
                    _startTime.AddMinutes(-50),
                    min,
                    max,
                    1,
                    (max - min) / 500 / volatileFactor,
                    (max - min) / 100 / volatileFactor,
                    (max - min) / 2);

                if (firstCurve)
                {
                    // Insg.: 50min
                    var first = _random.Next(5, 30);
                    var second = _random.Next(5, 50 - first - 5);
                    second = second > 15 ? 15 : second;
                    var third = 50 - first - second;
                    //pf.AppendPoints(TimeSpan.FromMinutes(100));
                    pf.AppendPoints(TimeSpan.FromMinutes(first));
                    pf.AppendGap(TimeSpan.FromMinutes(second));
                    pf.AppendPoints(TimeSpan.FromMinutes(third));
                }
                else
                {
                    pf.AppendPoints(TimeSpan.FromMinutes(50));
                }

                // Boundaries
                if (firstCurve)
                {
                    var entries = curve.DataSeries.LogicalEntries.Select(it => it.Y).Where(it => !double.IsNaN(it));
                    var maxValue = entries.Max();
                    var minValue = entries.Min();
                    var diff = max - min;

                    curve.MinMinBelt = minValue + 0.025 * diff;
                    curve.MinBelt = minValue + 0.05 * diff;
                    curve.MaxBelt = maxValue - 0.05 * diff;
                    curve.MaxMaxBelt = maxValue - 0.025 * diff;
                }

                _curves.Add(curve, pf);
            }
            else
            {
                var min1 = curve.DoubleAxis.ActualLowerBound;
                var max1 = curve.DoubleAxis.ActualUpperBound;
                var dataFactory = DataFactory.Attach(
                    curve,
                    _startTime.AddMinutes(-50),
                    min1,
                    max1,
                    0.01,
                    (max1 - min1) / 500,
                    (max1 - min1) / 100,
                    (max1 - min1) / 2);

                // all in all: 50min
                dataFactory.AppendBinary(TimeSpan.FromMinutes(50));

                //curve.MinMinBelt = -0.9 + dataFactory.Offset;
                //curve.MinBelt = -0.4 + dataFactory.Offset;
                //curve.MaxBelt = 0.3 + dataFactory.Offset;
                //curve.MaxMaxBelt = 0.7 + dataFactory.Offset;

                //_curves.Add(curve, dataFactory);
            }

            return curve;
        }