コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: breakertt/OKEGui
        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();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: sun128764/OKEGui
        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();
            }
        }
コード例 #5
0
 private void BtnNewWorker_Click(object sender, RoutedEventArgs e)
 {
     WorkerCount++;
     wm.AddWorker("工作单元-" + WorkerCount.ToString());
     WorkerNumber.Text = "工作单元:" + WorkerCount.ToString();
 }