public override void updatechart(Dictionary <string, string> packagelist) { isRunning = true; pkglist = new Dictionary <string, string>(); clearLines(); //Rect rec = (t-20>0?t-20:0,t-20>0?t+10:30,t,chart.Viewport.Visible.YMax); datalist.Clear(); listgraph.Clear(); this.msr.Width = 30; datalist.Add("屏幕变化率", new ObservableDataSource <Point>()); MarkerPointsGraph mpg = new MarkerPointsGraph(markerPoints); XValueTextMarker ctm = new XValueTextMarker(this.chart.Viewport); mpg.Marker = ctm; this.chart.Children.Add(mpg); MarkerPointsGraph fmpg = new MarkerPointsGraph(framePoints); FrameValueTextMarker ftm = new FrameValueTextMarker(this.chart.Viewport); fmpg.Marker = ftm; this.chart.Children.Add(fmpg); listgraph.Add(chart.AddLineGraph(datalist["屏幕变化率"], Colors.Blue, 2, "屏幕变化率"));//Color.FromRgb(72, 118, 255) ts = new ThreadStart(getScreenDiff); if (getDiffThread == null) { if (!runable) { return; } getDiffThread = new Thread(ts); getDiffThread.SetApartmentState(ApartmentState.STA); getDiffThread.Start(); } else { getDiffThread.Abort(); if (!proc.HasExited) { proc.Kill(); } getDiffThread = new Thread(ts); getDiffThread.SetApartmentState(ApartmentState.STA); getDiffThread.Start(); } }
public override void updatechart(Dictionary<string, string> packagelist) { isRunning = true; pkglist = new Dictionary<string, string>(); clearLines(); //Rect rec = (t-20>0?t-20:0,t-20>0?t+10:30,t,chart.Viewport.Visible.YMax); datalist.Clear(); listgraph.Clear(); this.msr.Width = 30; datalist.Add("屏幕变化率", new ObservableDataSource<Point>()); MarkerPointsGraph mpg = new MarkerPointsGraph(markerPoints); XValueTextMarker ctm = new XValueTextMarker(this.chart.Viewport); mpg.Marker = ctm; this.chart.Children.Add(mpg); MarkerPointsGraph fmpg = new MarkerPointsGraph(framePoints); FrameValueTextMarker ftm = new FrameValueTextMarker(this.chart.Viewport); fmpg.Marker = ftm; this.chart.Children.Add(fmpg); listgraph.Add(chart.AddLineGraph(datalist["屏幕变化率"], Colors.Blue, 2, "屏幕变化率"));//Color.FromRgb(72, 118, 255) ts = new ThreadStart(getScreenDiff); if (getDiffThread == null) { if (!runable) { return; } getDiffThread = new Thread(ts); getDiffThread.SetApartmentState(ApartmentState.STA); getDiffThread.Start(); } else { getDiffThread.Abort(); if (!proc.HasExited) proc.Kill(); getDiffThread = new Thread(ts); getDiffThread.SetApartmentState(ApartmentState.STA); getDiffThread.Start(); } }