public PToshibaVM(PExpToshiba process) { m_process = process; plotModelT = new OxyPlot.PlotModel(); plotModelP = new OxyPlot.PlotModel(); //Inint QualityControls if (m_process.UpperWorkpiece != null) { WP_UpperControl = new Controls.CQuality(process.Workpieces.Find(item => item.ID == m_process.UpperWorkpiece)); } if (m_process.LowerWorkpiece != null) { WP_LowerControl = new Controls.CQuality(process.Workpieces.Find(item => item.ID == m_process.LowerWorkpiece)); } PV_Control = new Controls.CPVControl(m_process); ProcessQualityControl = new Controls.CProcessQuality(m_process); #region Temp LineSeries ls = new LineSeries(); foreach (var step in process.File.Steps) { ls.StrokeThickness = 0.8; ls.Smooth = true; ls.Color = OxyColors.Red; for (int i = 0; i < step.MeasuringPoints.Count; i++) { ls.Points.Add(new DataPoint(step.MeasuringPoints[i].TimePass, step.MeasuringPoints[i].LTemp1)); } } Temperature.Series.Add(ls); plotModelT.PlotMargins = new OxyThickness(3, 3, 3, 3); plotModelT.Padding = new OxyThickness(3, 3, 3, 3); plotModelT.TitleFontSize = 0; plotModelT.SubtitleFontSize = 0; plotModelT.TitlePadding = 0; plotModelT.Axes.Clear(); plotModelT.Axes.Add(new InvisibleAxis { Position = AxisPosition.Bottom }); plotModelT.Axes.Add(new InvisibleAxis { Position = AxisPosition.Left }); #endregion #region force ls = new LineSeries(); foreach (var step in process.File.Steps) { ls.StrokeThickness = 0.8; ls.Smooth = true; ls.Color = OxyColors.Blue; for (int i = 0; i < step.MeasuringPoints.Count; i += 1) { ls.Points.Add(new DataPoint(step.MeasuringPoints[i].TimePass, step.MeasuringPoints[i].PressZ)); } } Force.Series.Add(ls); plotModelP.PlotMargins = new OxyThickness(3, 3, 3, 3); plotModelP.Padding = new OxyThickness(3, 3, 3, 3); plotModelP.TitleFontSize = 0; plotModelP.SubtitleFontSize = 0; plotModelP.TitlePadding = 0; plotModelP.Axes.Clear(); plotModelP.Axes.Add(new InvisibleAxis { Position = AxisPosition.Bottom }); plotModelP.Axes.Add(new InvisibleAxis { Position = AxisPosition.Left }); #endregion m_vm = new MonFileVM(process.File); }
public PToshibaVM(int PID) { ObjectManager.Instance.update(PDCore.Database.DBGlasses.Table); SaveProcess = new RelayCommand(Save, CanSave); m_process = ProcessManager.Instance.getProcess(PID, 34) as PExpToshiba; //try getting mon-file from local directory try { m_process.File = PDCore.ToshibaImport.IO.getMonFileData(@"Data\Toshiba\" + PID + ".mon"); } catch { m_process.File = new PDCore.ToshibaImport.MonFile(); } plotModelT = new OxyPlot.PlotModel(); plotModelP = new OxyPlot.PlotModel(); //Inint QualityControls if (m_process.UpperWorkpiece != null) { UpperWorkpiece = m_process.Workpieces.Find(item => item.ID == m_process.UpperWorkpiece); } if (m_process.LowerWorkpiece != null) { LowerWorkpiece = m_process.Workpieces.Find(item => item.ID == m_process.LowerWorkpiece); } PV_Control = new Controls.CPVControl(m_process); ProcessQualityControl = new Controls.CProcessQuality(m_process); #region Temp LineSeries ls = new LineSeries(); foreach (var step in m_process.File.Steps) { ls.StrokeThickness = 0.8; ls.Smooth = true; ls.Color = OxyColors.Red; for (int i = 0; i < step.MeasuringPoints.Count; i++) { ls.Points.Add(new DataPoint(step.MeasuringPoints[i].TimePass, step.MeasuringPoints[i].LTemp1)); } } Temperature.Series.Add(ls); plotModelT.PlotMargins = new OxyThickness(3, 3, 3, 3); plotModelT.Padding = new OxyThickness(3, 3, 3, 3); plotModelT.TitleFontSize = 0; plotModelT.SubtitleFontSize = 0; plotModelT.TitlePadding = 0; plotModelT.Axes.Clear(); plotModelT.Axes.Add(new InvisibleAxis { Position = AxisPosition.Bottom }); plotModelT.Axes.Add(new InvisibleAxis { Position = AxisPosition.Left }); #endregion #region force ls = new LineSeries(); foreach (var step in m_process.File.Steps) { ls.StrokeThickness = 0.8; ls.Smooth = true; ls.Color = OxyColors.Blue; for (int i = 0; i < step.MeasuringPoints.Count; i += 1) { ls.Points.Add(new DataPoint(step.MeasuringPoints[i].TimePass, step.MeasuringPoints[i].PressZ)); } } Force.Series.Add(ls); plotModelP.PlotMargins = new OxyThickness(3, 3, 3, 3); plotModelP.Padding = new OxyThickness(3, 3, 3, 3); plotModelP.TitleFontSize = 0; plotModelP.SubtitleFontSize = 0; plotModelP.TitlePadding = 0; plotModelP.Axes.Clear(); plotModelP.Axes.Add(new InvisibleAxis { Position = AxisPosition.Bottom }); plotModelP.Axes.Add(new InvisibleAxis { Position = AxisPosition.Left }); #endregion m_vm = new MonFileVM(m_process.File); }