public MonFileVM(PDCore.ToshibaImport.MonFile File) { plotModelT = new OxyPlot.PlotModel(); plotModelP = new OxyPlot.PlotModel(); plotModelS = new OxyPlot.PlotModel(); SetUpModel(); if (File.Steps.Count > 0) { LoadData(File); } }
public void LoadData(PDCore.ToshibaImport.MonFile File) { PlotModelT.Series.Clear(); PlotModelP.Series.Clear(); PlotModelS.Series.Clear(); var m_data = File;//.da//IO.getMonFileData(path); double[] stepPoints = new double[m_data.Steps.Count - 1]; for (int i = 0; i < m_data.Steps.Count - 1; i++) { stepPoints[i] = m_data.Steps[i].MeasuringPoints[m_data.Steps[i].MeasuringPoints.Count - 1].TimePass; } PlotModelT.Axes[0].ExtraGridlines = stepPoints; PlotModelP.Axes[0].ExtraGridlines = stepPoints; PlotModelS.Axes[0].ExtraGridlines = stepPoints; PlotModelT.Axes[0].ExtraGridlineColor = OxyColors.DeepPink; PlotModelT.Axes[0].ExtraGridlineStyle = LineStyle.Dash; PlotModelT.Axes[0].ExtraGridlineThickness = 1; PlotModelP.Axes[0].ExtraGridlineColor = OxyColors.DeepPink; PlotModelP.Axes[0].ExtraGridlineStyle = LineStyle.Dash; PlotModelP.Axes[0].ExtraGridlineThickness = 1; PlotModelS.Axes[0].ExtraGridlineColor = OxyColors.DeepPink; PlotModelS.Axes[0].ExtraGridlineStyle = LineStyle.Dash; PlotModelS.Axes[0].ExtraGridlineThickness = 1; LineSeries ls = new LineSeries(); LineSeries vertical = new LineSeries(); vertical.Color = OxyColors.DarkGray; vertical.LineStyle = LineStyle.LongDash; vertical.StrokeThickness = 1; foreach (var step in m_data.Steps) { ls.StrokeThickness = 0.5; ls.Smooth = true; ls.Color = OxyColors.Red; ls.Title = "TLower"; for (int i = 0; i < step.MeasuringPoints.Count; i++) { ls.Points.Add(new DataPoint(step.MeasuringPoints[i].TimePass, step.MeasuringPoints[i].LTemp1)); } } PlotModelT.Series.Add(ls); ls = new LineSeries(); foreach (var step in m_data.Steps) { ls.StrokeThickness = 1; ls.Smooth = true; ls.Color = OxyColors.Blue; ls.Title = "TUpper"; for (int i = 0; i < step.MeasuringPoints.Count; i++) { ls.Points.Add(new DataPoint(step.MeasuringPoints[i].TimePass, step.MeasuringPoints[i].UTemp1)); } } PlotModelT.Series.Add(ls); ls = new LineSeries(); foreach (var step in m_data.Steps) { ls.StrokeThickness = 1.5; ls.Smooth = true; ls.Color = OxyColors.Green; for (int i = 0; i < step.MeasuringPoints.Count; i++) { ls.Points.Add(new DataPoint(step.MeasuringPoints[i].TimePass, step.MeasuringPoints[i].PressZ)); } } PlotModelP.Series.Add(ls); ls = new LineSeries(); foreach (var step in m_data.Steps) { ls.StrokeThickness = 1.5; ls.Smooth = true; ls.Color = OxyColors.DarkTurquoise; for (int i = 0; i < step.MeasuringPoints.Count; i++) { ls.Points.Add(new DataPoint(step.MeasuringPoints[i].TimePass, step.MeasuringPoints[i].PosZ)); } } PlotModelS.Series.Add(ls); }