Ejemplo n.º 1
0
        private async void DataGridProgProcess_MouseDoubleClickAsync(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (e.ChangedButton != System.Windows.Input.MouseButton.Left)
            {
                return;
            }
            DataGridCellInfo cell = (sender as DataGrid).CurrentCell;

            if (cell.Column == null)
            {
                return;
            }
            if (cell.Column.DisplayIndex == ProgViewModel.N_JLinkSN || cell.Column.DisplayIndex == ProgViewModel.N_TimeEscape)
            {
                string jlink = (cell.Item as ProgViewModel.ProgProcess).Steps[ProgViewModel.N_JLinkSN].Text;
                if (!this.progTaskStatusList.Contains(jlink))
                {
                    this.view.Running = true;
                    this.progTaskStatusList.Add(jlink);
                    this.progProcessList[jlink].Reset();
                    await this.progTaskList[jlink].Run();
                }
            }
            else
            {
                MsgWindow msgWindow = new MsgWindow();
                ProgViewModel.ProgProcess.ProgStep step = (cell.Item as ProgViewModel.ProgProcess).Steps[cell.Column.DisplayIndex];
                msgWindow.SetResult(step.Text);
                msgWindow.SetMsg(step.DetailMsg);
                msgWindow.SetTitle("J-Link SN: " + (cell.Item as ProgViewModel.ProgProcess).Steps[ProgViewModel.N_JLinkSN].Text);
                msgWindow.SetStep(this.view.ProgView.StepTitles[cell.Column.DisplayIndex]);
                msgWindow.Show();
            }
        }
Ejemplo n.º 2
0
 private void ProgTask_StepUpdated(object sender, ProgTask.ProgStepUpdatedEventArgs e)
 {
     ProgViewModel.ProgProcess.ProgStep step = this.progProcessList[(sender as ProgTask).JlinkSn].Steps[e.Step];
     if (e.Status != null)
     {
         step.CurrentStatus = (ProgViewModel.ProgProcess.ProgStep.Status)e.Status;
     }
     if (e.Text != null)
     {
         step.Text = e.Text;
     }
     if (e.DetailMsg != null)
     {
         step.DetailMsg += e.DetailMsg;
     }
 }