Пример #1
0
        private void btnEnter_Click(object sender, RoutedEventArgs e)
        {
            btnEnter.IsEnabled = false;
            Thread thread = new Thread(new ThreadStart(delegate() {
                while (RunFalg)
                {
                    this.Dispatcher.BeginInvoke((Action) delegate()
                    {
                        if (progressBar1.Value == progressBar1.Maximum)
                        {
                            progressBar1.Maximum += 30;
                        }
                        progressBar1.Value += 1;
                    });
                    Thread.Sleep(100 * 1);
                }
                this.Dispatcher.BeginInvoke((Action) delegate()
                {
                    if (!ExitFalg)
                    {
                        btnEnter.IsEnabled = true;
                        this.DialogResult  = true;
                    }
                });
            }));

            thread.Start();
            Thread threadRunScript = new Thread(new ThreadStart(delegate()
            {
                try
                {
                    WanTai.Controller.EVO.IProcessor processor = WanTai.Controller.EVO.ProcessorFactory.GetProcessor();
                    //string scriptFileName = WanTai.Common.Configuration.GetTecanRestorationScriptName();
                    processor.StartScript(scriptFileName);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                RunFalg = false;
            }));

            threadRunScript.Start();
        }
Пример #2
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            if ((sender as Button).CommandParameter != null && (sender as Button).CommandParameter.ToString() == "ConfigRotationNext")
            {
                experimentRunView.BindView();
                return;
            }
            if (tabControl.SelectedIndex < tabControl.Items.Count)
            {
                tabControl.SelectedIndex++;
                ((TabItem)tabControl.SelectedItem).IsEnabled = true;
            }
            if (tabControl.SelectedIndex == 2)
            {
                if (SessionInfo.CurrentExperimentsInfo.State != (short)ExperimentStatus.Stop)
                {
                    DeskTop deskTop = (DeskTop)frameDeskTop.Content;
                    deskTop.InitDeskTop(900);
                }
            }
            if (tabControl.SelectedIndex == 3)
            {
                btnRun.IsEnabled = true;

                if (SessionInfo.NextTurnStep == 1)
                {
                    SessionInfo.NextTurnStep = -1;
                    server.SendMessage("NextStepRun");
                    //change the lamp and set it green
                    WanTai.Controller.EVO.IProcessor processor = WanTai.Controller.EVO.ProcessorFactory.GetProcessor();
                    processor.SetLampStatus(0);
                }
                else if (SessionInfo.NextTurnStep == 99)
                {
                    SessionInfo.NextTurnStep = -1;
                    ExperimentRun();
                }
                // btnRecover.IsEnabled = false;
                //runSelect_listBox.IsEnabled = true;
            }
        }
Пример #3
0
        private void onShowNextRotationEvent()
        {
            //WanTai.Common.CommonFunction.WriteLog("onShowNextRotationEvent");
            //
            //if (this.Dispatcher.Thread != System.Threading.Thread.CurrentThread)
            //{
            //    this.Dispatcher.Invoke(new onShowNextRotation(this.onShowNextRotationEvent), null);
            //    return;
            //}
            //else
            //{
            SessionInfo.NextTurnStep = 0;
            WanTai.Common.CommonFunction.WriteLog("onShowNextRotationEvent-----else");
            //btnRun.IsEnabled = false;
            //btnRecover.IsEnabled = false;
            ////runSelect_listBox.IsEnabled = false;
            //btnStop.IsEnabled = false;
            //btnRStart.IsEnabled = false;
            // btnStart.Content = "启动";
            // this.bindRunWithStartAction();
            List <RotationInfo> rotations = new List <RotationInfo>();

            rotations = new ConfigRotationController().GetCurrentRotationInfos(SessionInfo.ExperimentID);
            if (rotations.Count == 0)
            {
                MessageBox.Show("该实验没有建立轮次。", "系统提示");
                return;
            }

            if (SessionInfo.PraperRotation == null)
            {
                SessionInfo.PraperRotation = rotations.FirstOrDefault();
            }
            else
            {
                foreach (RotationInfo rotation in rotations)
                {
                    if (rotation.RotationSequence == SessionInfo.PraperRotation.RotationSequence + 1)
                    {
                        SessionInfo.PraperRotation = rotation;
                        break;
                    }
                }
            }

            tabControl.SelectedIndex = 0;
            ((TabItem)tabControl.Items[2]).IsEnabled = false;

            TubesView tubesView1 = new TubesView();

            tabItem1.Content           = tubesView1;
            tubesView1.onNextStepScan += new NextStepScan(NextStepScanEvent);
            tubesView1.NextStepEvent  += new NextStepHandler(Button_Click_1);

            //open the lamp and set it green flashing
            WanTai.Controller.EVO.IProcessor processor = WanTai.Controller.EVO.ProcessorFactory.GetProcessor();
            processor.SetLampStatus(2);
            tabControl.SelectedIndex = 0;
            MessageBox.Show("请为下一轮实验准备样品!", "系统提示!", MessageBoxButton.OK);
            tabControl.SelectedIndex = 0;
            //change the lamp and set it green
            processor.SetLampStatus(0);
            //}
        }