Ejemplo n.º 1
0
        /// <summary>
        /// 添加执行器(该方法未判断索引正确性)
        /// </summary>
        /// <param name="runnerState"></param>
        public void AddRunner(RunnerState runnerState)
        {
            if (runnerState != null)
            {
                ProgressBarList runerProgressBar = new ProgressBarList();
                PlayButton      runnerButton     = new PlayButton();
                ListViewItem    myAddItem        = new ListViewItem(new string[] { runnerState.RunnerName, runnerState.NowCell, runnerState.RunDetails, runnerState.Time, runnerState.CellResult, "", runnerState.State, "" });

                if (PlayStateDictionary.ContainsKey(runnerState.State))
                {
                    runnerButton.OnChangeState(PlayStateDictionary[runnerState.State]);
                }
                else
                {
                    ErrorLog.PutInLog("unkonw runnerState find in ListView_RemoteRunnerView");
                }

                if (runnerState.RunnerProgress != null)
                {
                    runerProgressBar.UpdateList((runnerState.RunnerProgress).ToList());
                }
                else
                {
                    ErrorLog.PutInLog("no RunnerProgress find in ListView_RemoteRunnerView");
                }

                this.Controls.Add(runerProgressBar);
                this.Controls.Add(runnerButton);

                myAddItem.SubItems[5].Tag = runerProgressBar;
                myAddItem.SubItems[7].Tag = runnerButton;

                this.Items.Add(myAddItem);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 添加一个空执行器
        /// </summary>
        public void AddEmptyRunner()
        {
            ProgressBarList runerProgressBar = new ProgressBarList();
            PlayButton      runnerButton     = new PlayButton();
            ListViewItem    myAddItem        = new ListViewItem(new string[] { "", "", "", "", "", "", "", "" });

            this.Controls.Add(runerProgressBar);
            this.Controls.Add(runnerButton);

            myAddItem.SubItems[5].Tag = runerProgressBar;
            myAddItem.SubItems[7].Tag = runnerButton;

            this.Items.Add(myAddItem);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// CaseRunner构造函数(用于克隆当前对象)
 /// </summary>
 /// <param name="yourNmae">用户标识名</param>
 /// <param name="yourCaseActuator">克隆需要的深度复制的新执行器</param>
 private CaseRunner(string yourNmae, CaseActionActuator yourCaseActuator)
 {
     runnerName = yourNmae;
     yourCaseActuator.MyName = yourNmae;
     runerActuator           = yourCaseActuator;
     runerActuator.OnActuatorStateChanged += runerActuator_OnActuatorStateChanged;
     runerActuator.OnExecutiveResult      += runerActuator_OnExecutiveResult;
     runerProgressBar = new ProgressBarList();
     runnerButton     = new PlayButton();
     runnerButton.ButtonSetClickEvent     += runnerButton_ButtonSetClickEvent;
     runnerButton.ButtonOutClickEvent     += runnerButton_ButtonOutClickEvent;
     runnerButton.ButtonDelClickEvent     += runnerButton_ButtonDelClickEvent;
     runnerButton.ButtonStateChangedEvent += runnerButton_ButtonStateChangedEvent;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// CaseRunner构造函数
 /// </summary>
 /// <param name="yourNmae">用户标识名</param>
 public CaseRunner(string yourNmae)
 {
     runnerName     = yourNmae;
     runnerCasePath = "";
     runerActuator  = new CaseActionActuator(yourNmae);
     runerActuator.OnActuatorStateChanged += runerActuator_OnActuatorStateChanged;
     runerActuator.OnExecutiveResult      += runerActuator_OnExecutiveResult;
     runerProgressBar = new ProgressBarList();
     runnerButton     = new PlayButton();
     runnerButton.ButtonSetClickEvent     += runnerButton_ButtonSetClickEvent;
     runnerButton.ButtonOutClickEvent     += runnerButton_ButtonOutClickEvent;
     runnerButton.ButtonDelClickEvent     += runnerButton_ButtonDelClickEvent;
     runnerButton.ButtonStateChangedEvent += runnerButton_ButtonStateChangedEvent;
 }
Ejemplo n.º 5
0
        public MainWindow()
        {
            InitializeComponent();
            IProgressBarListOperation progressBarList = new ProgressBarList();

            ProgressBarList.Children.Add((UserControl)progressBarList);
            var progressBar = progressBarList.Add(ProgressBarType.CIRCULAR_PERCENTAGE_PROGRESS_BAR, "LL1 Pumping");

            progressBar.TopicFontSize   = 18;
            progressBar.ProgressBarSize = 120;



            new Task(() => {
                Thread.Sleep(2000);
                Dispatcher.Invoke(() => progressBarList.Add(ProgressBarType.CIRCULAR_PERCENTAGE_PROGRESS_BAR, "LL1 Mapping"));
                new Task(() => {
                    Thread.Sleep(2000);
                    Dispatcher.Invoke(() => progressBarList.Add(ProgressBarType.CIRCULAR_PERCENTAGE_PROGRESS_BAR, "LL2 Mapping"));
                    new Task(() => { Thread.Sleep(5000); Dispatcher.Invoke(() => progressBarList.Remove("LL1 Mapping")); }).Start();
                }).Start();
            }).Start();
        }