public PExpCemeConVM(int ID, bool update) { ObjectManager.Instance.update(DBUser.Table); ObjectManager.Instance.update(DBProjects.Table); ObjectManager.Instance.update(DBIssues.Table); ObjectManager.Instance.update(DBGlasses.Table); m_update = update; //update if (update) { m_process = ProcessManager.Instance.getProcess(ID, 33) as PExpCemeCon; WorkpieceQualityControl = new Controls.CQuality(m_process.Workpieces[0]); } //new Process else { m_process = new PExpCemeCon(); m_process.ProjectID = ObjectManager.Instance.getProjectID(ID); m_process.IssueID = ObjectManager.Instance.getIssueID(ID); m_process.Workpieces.Add(ObjectManager.Instance.getWorkpieceByReference(ID, null)); WorkpieceQualityControl = new Controls.CQuality(m_process.Workpieces[0]); //set User field if user is logged in if (UserManager.CurrentUser != null) { m_process.UserID = UserManager.CurrentUser.ID; } } ProcessQualityControl = new Controls.CProcessQuality(m_process); SaveProcess = new RelayCommand(Save, CanSave); m_issues = new ObservableCollection <Issue>(ObjectManager.Instance.Issues.FindAll(item => item.ProjectID == m_process.ProjectID)); NotifyPropertyChanged("Issues"); }
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); }