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 MainWindow() { InitializeComponent(); Version version = Assembly.GetExecutingAssembly().GetName().Version; Title += " v" + version; listView1.ItemsSource = tm.taskStatus; wm = new WorkerManager(tm); BtnRun.IsEnabled = false; BtnMoveDown.IsEnabled = false; BtnMoveup.IsEnabled = false; BtnStop.IsEnabled = false; BtnChap.IsEnabled = false; // 初始的worker数量等于Numa数量。 int numaCount = NumaNode.NumaCount; for (int i = 0; i < numaCount; i++) { WorkerCount++; wm.AddWorker("工作单元-" + WorkerCount.ToString()); } WorkerNumber.Text = "工作单元:" + WorkerCount.ToString(); }
public MainWindow() { InitializeComponent(); listView1.ItemsSource = tm.taskStatus; wm = new WorkerManager(tm); BtnMoveDown.IsEnabled = false; BtnMoveup.IsEnabled = false; WorkerCount++; wm.AddWorker("工作单元-" + WorkerCount.ToString()); this.WorkerNumber.Text = "工作单元:" + WorkerCount.ToString(); }
public MainWindow() { InitializeComponent(); Version version = Assembly.GetExecutingAssembly().GetName().Version; Title += " v" + version; TaskList.ItemsSource = tm.taskStatus; wm = new WorkerManager(this, tm); BtnRun.IsEnabled = false; BtnMoveDown.IsEnabled = false; BtnMoveUp.IsEnabled = false; BtnMoveTop.IsEnabled = false; BtnPause.IsEnabled = false; BtnResume.IsEnabled = false; BtnChap.IsEnabled = false; BtnDelete.IsEnabled = false; BtnEmpty.IsEnabled = false; BtnCancelShutdown.IsEnabled = false; // 初始的worker数量等于Numa数量。 int numaCount = NumaNode.NumaCount; for (int i = 0; i < numaCount; i++) { WorkerCount++; wm.AddWorker("工作单元-" + WorkerCount.ToString()); } WorkerNumber.Text = "工作单元:" + WorkerCount.ToString(); // 初始化更新菜单 _systemMenu = new SystemMenu(this); _systemMenu.AddCommand("检查更新(&U)", () => { Updater.CheckUpdate(true); }, true); if (Initializer.Config.memoryTotal == WmiUtils.GetTotalPhysicalMemory()) { TxtFreeMemory.Text = Initializer.Config.memoryLimit.ToString(); } }
private void BtnNewWorker_Click(object sender, RoutedEventArgs e) { WorkerCount++; wm.AddWorker("工作单元-" + WorkerCount.ToString()); WorkerNumber.Text = "工作单元:" + WorkerCount.ToString(); }