private void CloseExperiment_button_Click(object sender, RoutedEventArgs e) { if (SessionInfo.CurrentExperimentsInfo != null) { if (SessionInfo.CurrentExperimentsInfo.State == (short)ExperimentStatus.Processing) { MessageBox.Show("当前实验正在运行,请先停止!", "系统提示!"); return; } if (SessionInfo.CurrentExperimentsInfo.State == (short)ExperimentStatus.Fail || SessionInfo.CurrentExperimentsInfo.State == (short)ExperimentStatus.Create || SessionInfo.CurrentExperimentsInfo.State == (short)ExperimentStatus.Suspend) { if (MessageBox.Show("当前实验未完成,是否继续操作?", "系统提示!", MessageBoxButton.YesNo) != MessageBoxResult.Yes) { return; } WanTai.Controller.RotationInfoController rotationInfoController = new WanTai.Controller.RotationInfoController(); rotationInfoController.UpdataExperimentStatus(SessionInfo.CurrentExperimentsInfo.ExperimentID, true, ExperimentStatus.Fail); } TecanMaintain_Button.IsEnabled = true; TecanRestoration_Button.IsEnabled = true; SessionInfo.CurrentExperimentsInfo = null; SessionInfo.ExperimentID = new Guid(); SessionInfo.PraperRotation = null; SessionInfo.BatchIndex = 0; SessionInfo.NextTurnStep = -1; this.Title = "WanTag 全自动核酸提取系统"; } mainFrame.Content = null; //mainFrame = new Frame(){ Width=10000, Height=900000 }; //mainFrame.SetValue(Grid.RowProperty, 1); //mainFrame.SetValue(Grid.ColumnProperty, 2); //mainFrame.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; //mainFrame.VerticalAlignment = System.Windows.VerticalAlignment.Stretch; }
private void Main_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (SessionInfo.CurrentExperimentsInfo != null) { if (SessionInfo.CurrentExperimentsInfo.State == (short)ExperimentStatus.Processing) { MessageBox.Show("当前实验正在运行,请先停止!", "系统提示!"); e.Cancel = true; return; } if (SessionInfo.CurrentExperimentsInfo.State == (short)ExperimentStatus.Fail || SessionInfo.CurrentExperimentsInfo.State == (short)ExperimentStatus.Create || SessionInfo.CurrentExperimentsInfo.State == (short)ExperimentStatus.Suspend) { if (MessageBox.Show("当前实验未完成,是否退出?", "系统提示!", MessageBoxButton.YesNo) != MessageBoxResult.Yes) { e.Cancel = true; return; } WanTai.Controller.RotationInfoController rotationInfoController = new WanTai.Controller.RotationInfoController(); rotationInfoController.UpdataExperimentStatus(SessionInfo.CurrentExperimentsInfo.ExperimentID, true, ExperimentStatus.Fail); } } if (!ProcessorFactory.HasClosed) { IProcessor processor = ProcessorFactory.GetProcessor(); processor.Close(); } }
private void btnNewExperiment_Click(object sender, RoutedEventArgs e) { if (SessionInfo.CurrentExperimentsInfo != null) { if (SessionInfo.CurrentExperimentsInfo.State == (short)ExperimentStatus.Processing) { MessageBox.Show("当前实验正在运行,请先停止!", "系统提示!"); return; } if (SessionInfo.CurrentExperimentsInfo.State == (short)ExperimentStatus.Fail || SessionInfo.CurrentExperimentsInfo.State == (short)ExperimentStatus.Create || SessionInfo.CurrentExperimentsInfo.State == (short)ExperimentStatus.Suspend) { if (MessageBox.Show("当前实验未完成,是否继续操作?", "系统提示!", MessageBoxButton.YesNo) != MessageBoxResult.Yes) { return; } WanTai.Controller.RotationInfoController rotationInfoController = new WanTai.Controller.RotationInfoController(); rotationInfoController.UpdataExperimentStatus(SessionInfo.CurrentExperimentsInfo.ExperimentID, true, ExperimentStatus.Fail); } } TecanMaintain_Button.IsEnabled = false; SessionInfo.ExperimentID = new Guid(); SessionInfo.PraperRotation = null; SessionInfo.CurrentExperimentsInfo = null; NewExperiment newExperiment = new NewExperiment(); ribbon.IsEnabled = false; mainFrame.IsEnabled = false; newExperiment.Topmost = true; newExperiment.ShowDialog(); bool?newExperimentResult = newExperiment.DialogResult; if (newExperimentResult.HasValue && (bool)newExperimentResult) { MainPage mainPage = new MainPage(); mainPage.SetEvoRestorationStatus += new MainPage.EvoRestorationStatus(SetEvoRestorationButtonStatus); mainPage.AddEvoRestorationStatusEvent(); mainFrame.Content = mainPage; SessionInfo.BatchIndex = 0; SessionInfo.NextTurnStep = -1; WanTai.Controller.EVO.IProcessor processor = WanTai.Controller.EVO.ProcessorFactory.GetProcessor(); processor.OnNextTurnStepDispse(); // mainFrame.Navigate(mainPage); //mainFrame.Source = new Uri("MainPage.xaml", UriKind.Relative); // mainFrame.Navigate(new Uri("MainPage.xaml", UriKind.Relative)); this.Title = "WanTag 全自动核酸提取系统——实验 " + newExperiment.txtExperimentName.Text; } mainFrame.IsEnabled = true; ribbon.IsEnabled = true; }