private void BtnRun_Click(object sender, RoutedEventArgs e) { if (tm.isCanStart) { return; } if (wm.GetWorkerCount() == 0) { WorkerCount++; wm.AddWorker("工作单元-" + WorkerCount.ToString()); this.WorkerNumber.Text = "工作单元:" + WorkerCount.ToString(); } tm.isCanStart = true; if (!wm.Start()) { tm.isCanStart = false; MessageBox.Show("无法开始任务!", "OKEGui", MessageBoxButton.OK, MessageBoxImage.Error); return; } BtnDeleteWorker.IsEnabled = false; BtnEmpty.IsEnabled = false; BtnNew.IsEnabled = false; //VideoJob vj = new VideoJob(); //tm.AddTask(); //vj.config = tm.taskStatus[0]; //JobWorker worker = new JobWorker(vj); }
public WizardWindow(WorkerManager w) { InitializeComponent(); taskWizard.BackButtonContent = "上一步"; taskWizard.CancelButtonContent = "取消"; taskWizard.FinishButtonContent = "完成"; taskWizard.HelpButtonContent = "帮助"; taskWizard.HelpButtonVisibility = Visibility.Hidden; taskWizard.NextButtonContent = "下一步"; DataContext = wizardInfo; workerManager = w; eachFreeMemory = (Initializer.Config.memoryLimit - workerManager.GetWorkerCount() * 2000) / workerManager.GetWorkerCount(); }
public WizardWindow(WorkerManager w) { InitializeComponent(); taskWizard.BackButtonContent = "上一步"; taskWizard.CancelButtonContent = "取消"; taskWizard.FinishButtonContent = "完成"; taskWizard.HelpButtonContent = "帮助"; taskWizard.HelpButtonVisibility = Visibility.Hidden; taskWizard.NextButtonContent = "下一步"; DataContext = wizardInfo; workerManager = w; eachFreeMemory = (Convert.ToInt32(workerManager.MainWindow.TxtFreeMemory.Text) - workerManager.GetWorkerCount() * 2000) / workerManager.GetWorkerCount(); }