Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        private void btn_Save_Click(object sender, RoutedEventArgs e)
        {
            btn_Next.IsEnabled = false;
            if (SessionInfo.ExperimentID == new Guid())
            {
                NewExperiment Experiment = new NewExperiment();
                if (!(bool)Experiment.ShowDialog())
                {
                    return;
                }
                SessionInfo.BatchIndex = 1;
            }
            if (SystemFluid.IndexOf("2,") >= 0 || SystemFluid.IndexOf("3,") >= 0)
            {
                MessageBox.Show("阴阳对照物必须有!", "系统提示!");
                return;
            }
            int TotalHole = 2;

            TubeGroupList = new List <TubeGroup>();
            CurrentTubesBatch.TestingItem = new Dictionary <Guid, int>();
            bool _SystemFluid = false;

            foreach (TubeGroup Item in dg_TubesGroup.Items)
            {
                if (Item.TestingItemConfigurations.Count == 0)
                {
                    MessageBox.Show(Item.TubesGroupName + "没有选择检测项目,请选择!", "系统提示!");
                    return;
                }
                foreach (TestingItemConfiguration TestingItem in Item.TestingItemConfigurations)
                {
                    int TestintItemNumber = Item.TubesNumber / Item.PoolingRulesTubesNumber + (Item.TubesNumber % Item.PoolingRulesTubesNumber > 0 ? 1 : 0);
                    if (CurrentTubesBatch.TestingItem.ContainsKey(TestingItem.TestingItemID))
                    {
                        CurrentTubesBatch.TestingItem[TestingItem.TestingItemID] += TestintItemNumber;
                    }
                    else
                    {
                        CurrentTubesBatch.TestingItem.Add(TestingItem.TestingItemID, TestintItemNumber);
                    }
                }
                TotalHole += Item.TubesNumber / Item.PoolingRulesTubesNumber + (Item.TubesNumber % Item.PoolingRulesTubesNumber > 0 ? 1 : 0);
                TubeGroupList.Add(Item);
                if (Item.isComplement)
                {
                    _SystemFluid = true;
                }
            }
            if (TotalHole > 96)
            {
                MessageBox.Show("混样数大于96,无法进行混样!", "系统提示!");
                return;
            }
            if (_SystemFluid)
            {
                if (SystemFluid.IndexOf("1,") >= 0)
                {
                    MessageBox.Show("没有样品补充液!", "系统提示!");
                    return;
                }
            }
            string ErrMsg;
            int    ErrType;

            CurrentTubesBatch = new WanTai.Controller.TubesGroupController().SaveTubesGroup(SessionInfo.ExperimentID, CurrentTubesBatch, SessionInfo.BatchIndex, TubeGroupList, Tubes, out ErrType, out ErrMsg);
            if (ErrType == -1)
            {
                MessageBox.Show(ErrMsg, "系统提示!");

                return;
            }
            //CurrentTubesBatch.TestingItem = new Dictionary<Guid, int>();
            // MessageBox.Show("生成成功!", "系统提示!");
            btn_Next.IsEnabled = true;
        }