示例#1
0
        // Provide a required override for the VisualChildrenCount property.

        public CurrentGraph(List <TimeParameterPair> timeParameterPair, Rect rect, DateTime startTime, DateTime finishTime, FurnacesInHandViewModel vm = null)
        {
            this.startTime  = startTime;
            this.finishTime = finishTime;
            this.vm         = vm;
            _children       = new VisualCollection(this)
            {
                CreateDrawingVisualPlot(timeParameterPair, rect)
            };
        }
示例#2
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     finhViewModel = (FurnacesInHandViewModel)parameter;
     if (finhViewModel.DrawCursorWhenMousButtonUp)
     {
         return((double)value);
     }
     else
     {
         return(finhViewModel.CursorXCoordinate);
     }
 }
示例#3
0
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            finhViewModel = (FurnacesInHandViewModel)parameter;
            finhViewModel.DrawCursorWhenMousButtonUp = true;
            PrepareTransform(finhViewModel);
            dt = (DateTime)value;
            TimeSpan ts = (TimeSpan)(dt - finhViewModel.DtFixedEdgeBegTime);

            p.X = ts.TotalMilliseconds;
            p.X = WtoD(p).X;
            finhViewModel.CursorXCoordinate = p.X;
            return(p.X);
        }
示例#4
0
 private void PrepareTransform(FurnacesInHandViewModel finhViewModel)
 {
     xmin = 0;
     xmax = finhViewModel.CanvasVoltageWidth;
     LowerLimitForTimeOnXAxis = MillisecondsSinceTheBeginning(finhViewModel.DtFixedEdgeBegTime);
     UpperLimitForTimeOnXAxis = MillisecondsSinceTheBeginning(finhViewModel.DtFixedEdgeEndTime);
     PrepareTransformations
     (
         LowerLimitForTimeOnXAxis, UpperLimitForTimeOnXAxis,
         LowerLimitOnYAxis, UpperLimitOnYAxis,
         xmin, xmax,
         ymin, ymax
     );
 }
示例#5
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            finhViewModel = (FurnacesInHandViewModel)parameter;
            finhViewModel.DrawCursorWhenMousButtonUp = false;
            if (Mouse.LeftButton == MouseButtonState.Pressed)
            {
                p.X = (double)value;
                finhViewModel.CursorXCoordinate = p.X;
                PrepareTransform(finhViewModel);
                dt = finhViewModel.DtFixedEdgeBegTime + TimeSpan.FromMilliseconds(DtoW(p).X);
            }

            return(dt);
        }
示例#6
0
 void currentPlot(List <TimeParameterPair> timeParameterPairs)
 {
     this.Dispatcher.BeginInvoke(DispatcherPriority.Background, new DispatcherOperationCallback(delegate(Object state)
     {
         if (currentGraph != null)
         {
             CurrentPlot.Children?.Remove(currentGraph);
         }
         Rect rectangular           = new Rect(0, 0, CurrentPlot.ActualWidth, CurrentPlot.ActualHeight);
         FurnacesInHandViewModel vm = (FurnacesInHandViewModel)this.DataContext;
         //Установить верхние и нижние границы значений, отображаеиых на графике
         CurrentMax.GetBindingExpression(TextBox.TextProperty).UpdateSource();
         CurrentMin.GetBindingExpression(TextBox.TextProperty).UpdateSource();
         currentGraph = new CurrentGraph(timeParameterPairs, rect: rectangular, startTime: this.startTime, finishTime: this.finishTime, vm: vm);
         CurrentPlot.Children.Add(currentGraph);
         return(null);
     }
                                                                                                ), null);
 }
示例#7
0
 public void solenoidUPlot(List <TimeParameterPair> SolenoidU_graph_pairs, DateTime startTime, DateTime finishTime, FurnacesInHandViewModel vm = null)
 {
     this.Dispatcher.BeginInvoke(DispatcherPriority.Background, new DispatcherOperationCallback(delegate(Object state)
     {
         if (solenoidUGraph != null)
         {
             SolenoidUPlot.Children?.Remove(solenoidUGraph);
         }
         Rect rectangular = new Rect(0, 0, SolenoidUPlot.ActualWidth, SolenoidUPlot.ActualHeight);
         //Установить верхние и нижние границы значений, отображаеиых на графике
         solenoidUGraph = new SolenoidUGraph(SolenoidU_graph_pairs, rect: rectangular, startTime: startTime, finishTime: finishTime, vm: vm);
         SolenoidUPlot.Children.Add(solenoidUGraph);
         return(null);
     }
                                                                                                ), null);
 }
 public EdgeTimeConverterToSource()
 {
     _application = (App)Application.Current;
     _window      = (MainWindow)_application.MainWindow;
     _datacontext = (FurnacesInHandViewModel)(_window.DataContext);
 }