public void RefreshValue(TimeDoubleCurve curve)
 {
     var ruler = GetRuler();
     var itemViewModel = _table.ViewModels.Single(it => it.Curve == curve);
     var dynamicColumn = itemViewModel.GetDynamnicColumn(_column.ID);
     dynamicColumn.Value = curve.GetFormattedValue(
         curve.DataSeries.GetValueAtTime(ruler.Position, GetValueMode.MiddleValue));
         //FormatDefinitions.FloatingComma);
     dynamicColumn.Background = new SolidColorBrush(Color.FromArgb(100, 255, 255, 0));
 }
        public TableLegendItemViewModel(TimeDoubleCurve curve)
        {
            _dynamicRulerValues = new IndexedObservableCollection<DynamicRulerColumn>(
                (col, key) => col.FirstOrDefault(it => it.Name == key),
                key => new DynamicRulerColumn(key));

            Curve = curve;
            _curvePropChgObservable = Observable
                .FromEventPattern(Curve, "PropertyChanged")
                .ObserveOn(SynchronizationContext.Current)
                .Sample(TimeSpan.FromMilliseconds(100))
                .Subscribe(o => RefreshView());
            Curve.IsSelectedChanged += Curve_IsSelectedChanged;
        }
        public TileLegendItemViewModel(
			TimeDoubleCurve curve,
			TimeAxis timeAxis)
        {
            _timeAxis = timeAxis;
            Curve = curve;
            //Curve.PropertyChanged += Curve_PropertyChanged;
            _curvePropChgObservable = Observable
                .FromEventPattern(Curve, "PropertyChanged")
                .Sample(TimeSpan.FromMilliseconds(100))
                .ObserveOn(SynchronizationContext.Current)
                .Subscribe(o => RefreshView());
            Curve.IsSelectedChanged += Curve_IsSelectedChanged;
        }
        private TimeDoubleEntryFactory2(
			TimeDoubleCurve curve, DateTime startTime, double minValue, double maxValue, int numberOfPointsPerSecond, double maxYStepSize, double minYStepSize, double offset)
        {
            _curve = curve;
            StartTime = startTime;
            MinValue = minValue;
            MaxValue = maxValue;
            NumberOfPointsPerSecond = numberOfPointsPerSecond;
            MinYStepSize = minYStepSize;
            Offset = offset;
            MaxYStepSize = maxYStepSize;

            _yStepSize = (_random.NextDouble() * (MaxYStepSize - MinYStepSize)) + MinYStepSize;
        }
        public BeltRegistration(
			TimeDoubleCurve curve,
			IDrawingAreaInfo drawingAreaInfo,
			BeltControl beltControl)
        {
            _curve = curve;
            _curve.BeltsChanged += (s, e) => UpdateBoundaries();
            _curve.DoubleAxis.BoundsChanged += (s, e) => UpdateBoundaries();
            _curve.IsSelectedChanged += (s, e) => UpdateBoundaries();

            _drawingAreaInfo = drawingAreaInfo;
            _drawingAreaInfo.DrawingSizeChanged += _drawingAreaInfo_DrawingSizeChanged;

            BeltControl = beltControl;
        }
示例#6
0
 private void CreateCurve()
 {
     // Create a new curve
     _curve = CurveDisplay.TimeDoublePlottingSystem.AddCurve(
         "kg", -20, 20, Colors.Yellow, RedrawTime.Ms500, AxisMatchingMode.None,
         CurveDrawingMode.SimpleLine(),
         new FloatingCommaValueFormater(),
         new InterpolationValueFetchStrategy(),
         AxisFormat.Double,
         int.MaxValue);
     // We have to set some description for the curve so that it can be displayed in the table legend!
     _curve.Description.DescriptionText1 = "R2033";
     _curve.Description.DescriptionText2 = "House 20";
     _curve.Description.DescriptionText3 = "BHKW";
     _curve.Description.DescriptionText4 = "Cur. Val.";
     _curve.Description.DescriptionText5 = "Power Calc.";
 }
        private static string GetDiffTextUom(
			TimeDoubleCurve tdCurve,
			RulerCompareInfo rulerDiffInfo)
        {
            return double.IsNaN(rulerDiffInfo.CompareValue)
                ? string.Empty
                : tdCurve.DoubleAxis.Uom;
        }
 public void RefreshValue(TimeDoubleCurve curve)
 {
     _valueColumn.RefreshValue(curve);
 }
        //private static double Sum(IEnumerable<TimeDoubleDataEntry> timeDoubleDataEntries)
        //{
        //    return timeDoubleDataEntries.Aggregate(
        //        new
        //        {
        //            LastEntry = new TimeDoubleDataEntry(new DateTime(), double.NaN),
        //            CurrentSum = 0d,
        //            IsSeed = true
        //        },
        //        (acc, entry) => new
        //        {
        //            LastEntry = entry,
        //            CurrentSum = acc.CurrentSum + (
        //                acc.IsSeed
        //                    ? 0d
        //                    : (entry.Y - acc.LastEntry.Y) * (entry.X - acc.LastEntry.X).TotalSeconds / 2),
        //            IsSeed = false
        //        },
        //        acc => acc.CurrentSum);
        //}
        public void Refresh(TimeDoubleCurve curve, bool isLastColumnCollection)
        {
            _rulerColumns.ForEachElement(it => it.RefreshValue(curve));

            _yDeltaColumn.SetIsVisible(_columnConfiguration.ShowDeltaYColumn && !isLastColumnCollection);
            _tDeltaColumn.SetIsVisible(_columnConfiguration.ShowDeltaTColumn && !isLastColumnCollection);
            _minColumn.SetIsVisible(_columnConfiguration.ShowMinColumn && !isLastColumnCollection);
            _maxColumn.SetIsVisible(_columnConfiguration.ShowMaxColumn && !isLastColumnCollection);
            _avgColumn.SetIsVisible(_columnConfiguration.ShowAvgColumn && !isLastColumnCollection);
        }
        public static TimeDoubleEntryFactory2 Attach(
			TimeDoubleCurve curve, DateTime startTime, double minValue, double maxValue, int numberOfPointsPerSecond, double minYStepSize, double maxYStepSize, double offset)
        {
            return new TimeDoubleEntryFactory2(
                curve, startTime, minValue, maxValue, numberOfPointsPerSecond, maxYStepSize, minYStepSize, offset);
        }