public PExpTestStationVM(int PID) { ObjectManager.Instance.update(DBUser.Table); ObjectManager.Instance.update(DBProjects.Table); ObjectManager.Instance.update(DBIssues.Table); ObjectManager.Instance.update(DBGlasses.Table); m_update = true; m_process = ProcessManager.Instance.getProcess(PID, 32) as PExpTestStation; m_process.ProjectID = ObjectManager.Instance.getProjectID(m_process.Workpieces[0].CurrentReferenceNumber); m_process.IssueID = ObjectManager.Instance.getIssueID(m_process.Workpieces[0].CurrentReferenceNumber); ProcessQualityControl = new Controls.CProcessQuality(m_process); if (m_process.LeftWorkpieceID != null) { //LeftWorkpiece = ObjectManager.Instance.getWorkpiece(Convert.ToInt32(m_process.LeftWorkpieceID)); LeftWorkpiece = m_process.Workpieces.Find(item => item.ID == m_process.LeftWorkpieceID); } if (m_process.CenterWorkpieceID != null) { //CenterWorkpiece = ObjectManager.Instance.getWorkpiece(Convert.ToInt32(m_process.CenterWorkpieceID)); CenterWorkpiece = m_process.Workpieces.Find(item => item.ID == m_process.CenterWorkpieceID); } if (m_process.RightWorkpieceID != null) { //RightWorkpiece = ObjectManager.Instance.getWorkpiece(Convert.ToInt32(m_process.RightWorkpieceID)); RightWorkpiece = m_process.Workpieces.Find(item => item.ID == m_process.RightWorkpieceID); } m_issues = new ObservableCollection <Issue>(ObjectManager.Instance.Issues.FindAll(item => item.ProjectID == m_process.ProjectID)); NotifyPropertyChanged("Issues"); SaveProcess = new RelayCommand(Save, CanSave); }
public PExpMooreVM(int PID) { ObjectManager.Instance.update(PDCore.Database.DBUser.Table); ObjectManager.Instance.update(PDCore.Database.DBProjects.Table); ObjectManager.Instance.update(PDCore.Database.DBIssues.Table); ObjectManager.Instance.update(PDCore.Database.DBGlasses.Table); m_update = true; m_process = ProcessManager.Instance.getProcess(PID, 31) as PExpMoore; ProcessQualityControl = new Controls.CProcessQuality(m_process); m_process.ProjectID = ObjectManager.Instance.getProjectID(m_process.Workpieces[0].CurrentReferenceNumber); m_process.IssueID = ObjectManager.Instance.getIssueID(m_process.Workpieces[0].CurrentReferenceNumber); if (m_process.UpperWP != null) { //UpperWP = ObjectManager.Instance.getWorkpiece(Convert.ToInt32(m_process.UpperWP)); UpperWP = m_process.Workpieces.Find(item => item.ID == m_process.UpperWP); } if (m_process.LowerWP != null) { //LowerWP = ObjectManager.Instance.getWorkpiece(Convert.ToInt32(m_process.LowerWP)); LowerWP = m_process.Workpieces.Find(item => item.ID == m_process.LowerWP); } SaveProcess = new RelayCommand(Save, CanSave); m_issues = new ObservableCollection <Issue>(ObjectManager.Instance.Issues.FindAll(item => item.ProjectID == m_process.ProjectID)); NotifyPropertyChanged("Issues"); }
public PExpTestStationVM() { m_update = false; ObjectManager.Instance.update(DBUser.Table); ObjectManager.Instance.update(DBProjects.Table); ObjectManager.Instance.update(DBIssues.Table); ObjectManager.Instance.update(DBGlasses.Table); m_process = new PExpTestStation(); ProcessQualityControl = new Controls.CProcessQuality(m_process); SaveProcess = new RelayCommand(Save, CanSave); //set User field if user is logged in if (UserManager.CurrentUser != null) { m_process.UserID = UserManager.CurrentUser.ID; } m_issues = new ObservableCollection <Issue>(ObjectManager.Instance.Issues.FindAll(item => item.ProjectID == m_process.ProjectID)); NotifyPropertyChanged("Issues"); }
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); }
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); }