Changeset 17062
- Timestamp:
- 07/04/19 14:45:47 (3 years ago)
- Location:
- stable
- Files:
-
- 1 deleted
- 118 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
-
stable/.editorconfig
- Property svn:mergeinfo changed
/trunk/.editorconfig merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.ALPS
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Algorithms.ALPS merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Algorithms.ALPS merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.Benchmarks/3.3/BenchmarkAlgorithm.cs
r15584 r17062 39 39 [Creatable(CreatableAttribute.Categories.TestingAndAnalysis, Priority = 130)] 40 40 [StorableClass] 41 public sealed class BenchmarkAlgorithm : IAlgorithm {41 public sealed class BenchmarkAlgorithm : IAlgorithm, IStorableContent { 42 42 private CancellationTokenSource cancellationTokenSource; 43 44 public string Filename { get; set; } 43 45 44 46 public string ItemName { -
stable/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Algorithms.DataAnalysis merged: 16071,16356,16389,16415,16430 /trunk/sources/HeuristicLab.Algorithms.DataAnalysis merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Algorithms.DataAnalysis.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Algorithms.DataAnalysis/3.4 merged: 16071,16356,16389,16415,16430 /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4 merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.MOCMAEvolutionStrategy
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Algorithms.MOCMAEvolutionStrategy merged: 16071,16356,16389,16430 /trunk/sources/HeuristicLab.Algorithms.MOCMAEvolutionStrategy merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Analysis
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Analysis merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Analysis merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Analysis.Statistics.Views/3.3/ChartAnalysisView.cs
r15584 r17062 173 173 174 174 private void addLineToChart_Click(object sender, EventArgs e) { 175 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Adding fitted lines to charts...");175 Progress.Show(this, "Adding fitted lines to charts...", ProgressMode.Indeterminate); 176 176 177 177 string resultName = (string)dataTableComboBox.SelectedItem; … … 181 181 182 182 task.ContinueWith((t) => { 183 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);183 Progress.Hide(this); 184 184 ErrorHandling.ShowErrorDialog("An error occured while adding lines to charts. ", t.Exception); 185 185 }, TaskContinuationOptions.OnlyOnFaulted); 186 186 187 187 task.ContinueWith((t) => { 188 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);188 Progress.Hide(this); 189 189 }, TaskContinuationOptions.OnlyOnRanToCompletion); 190 190 } … … 273 273 var task = Task.Factory.StartNew(() => { 274 274 sem.Wait(); 275 progress = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Calculating values...");275 progress = Progress.Show(this, "Calculating values..."); 276 276 RebuildDataTable(resultName, rowName); 277 277 }); 278 278 279 279 task.ContinueWith((t) => { 280 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);280 Progress.Hide(this); 281 281 ErrorHandling.ShowErrorDialog("An error occured while calculating values. ", t.Exception); 282 282 sem.Release(); … … 284 284 285 285 task.ContinueWith((t) => { 286 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);286 Progress.Hide(this); 287 287 sem.Release(); 288 288 }, TaskContinuationOptions.OnlyOnRanToCompletion); -
stable/HeuristicLab.Analysis.Statistics.Views/3.3/StatisticalTestsView.cs
r15584 r17062 356 356 357 357 if (data != null && data.All(x => x != null)) { 358 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>() 359 .AddOperationProgressToView(this, "Calculating..."); 358 Progress.Show(this, "Calculating...", ProgressMode.Indeterminate); 360 359 361 360 string curItem = (string)groupCompComboBox.SelectedItem; … … 369 368 CalculatePairwiseTest(groupName); 370 369 371 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);370 Progress.Hide(this); 372 371 } 373 372 … … 377 376 return; 378 377 379 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(pairwiseTestGroupBox, "Calculating...");378 Progress.ShowOnControl(pairwiseTestGroupBox, "Calculating...", ProgressMode.Indeterminate); 380 379 Task.Factory.StartNew(() => CalculatePairwiseAsync(groupName)); 381 380 } … … 384 383 CalculatePairwiseTest(groupName); 385 384 386 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(pairwiseTestGroupBox);385 Progress.HideFromControl(pairwiseTestGroupBox); 387 386 } 388 387 -
stable/HeuristicLab.Analysis.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Analysis.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Analysis.Views merged: 15581,15583,15589,15619
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Access
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Clients.Access merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Access.Administration
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Clients.Access.Administration merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Access.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Clients.Access.Views merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Access.Views/3.3/ClientViews/ClientView.cs
r15584 r17062 77 77 public void StartProgressView() { 78 78 var message = "Downloading client information. Please be patient."; 79 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, message);79 Progress.Show(this, message, ProgressMode.Indeterminate); 80 80 } 81 81 82 82 public void FinishProgressView() { 83 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);83 Progress.Hide(this); 84 84 } 85 85 } -
stable/HeuristicLab.Clients.Common
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Clients.Common merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Hive
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Clients.Hive merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Hive.Administrator
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Clients.Hive.Administrator merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectJobsView.cs
r17059 r17062 75 75 progress = new Progress(); 76 76 77 removeButton.Enabled = false; 77 removeButton.Enabled = false; 78 78 } 79 79 … … 81 81 base.RegisterContentEvents(); 82 82 matrixView.DataGridView.SelectionChanged += DataGridView_SelectionChanged; 83 MainForm Manager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, progress);83 MainForm.Progress.Show(this, progress); 84 84 } 85 85 86 86 protected override void DeregisterContentEvents() { 87 87 matrixView.DataGridView.SelectionChanged -= DataGridView_SelectionChanged; 88 MainForm Manager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this, false);88 MainForm.Progress.Hide(this, false); 89 89 base.DeregisterContentEvents(); 90 90 } … … 114 114 var jobs = GetSelectedJobs().ToList(); 115 115 if (jobs.Any()) { 116 116 117 117 startButton.Enabled = jobs.All(x => 118 118 !x.IsProgressing && HiveAdminClient.Instance.Tasks.ContainsKey(x.Id) && HiveAdminClient.Instance.Tasks[x.Id].Count > 0 … … 135 135 #region Event Handlers 136 136 private void ProjectJobsView_Load(object sender, EventArgs e) { 137 137 138 138 } 139 139 140 140 private void refreshButton_Click(object sender, EventArgs e) { 141 progress.Start("Refreshing jobs..." );141 progress.Start("Refreshing jobs...", ProgressMode.Indeterminate); 142 142 SetEnabledStateOfControls(); 143 143 var task = System.Threading.Tasks.Task.Factory.StartNew(RefreshJobsAsync); 144 144 145 145 task.ContinueWith((t) => { 146 progress.Finish(); 146 progress.Finish(); 147 147 SetEnabledStateOfControls(); 148 148 }); … … 160 160 161 161 if (result == DialogResult.Yes) { 162 progress.Start("Removing job(s)..." );162 progress.Start("Removing job(s)...", ProgressMode.Indeterminate); 163 163 SetEnabledStateOfControls(); 164 164 var task = System.Threading.Tasks.Task.Factory.StartNew(RemoveJobsAsync, jobs); … … 191 191 192 192 if (result == DialogResult.Yes) { 193 progress.Start("Resuming job(s)..." );193 progress.Start("Resuming job(s)...", ProgressMode.Indeterminate); 194 194 SetEnabledStateOfControls(); 195 195 var task = System.Threading.Tasks.Task.Factory.StartNew(ResumeJobsAsync, jobs); 196 196 197 197 task.ContinueWith((t) => { 198 RefreshJobs(); 198 RefreshJobs(); 199 199 progress.Finish(); 200 200 SetEnabledStateOfControls(); … … 227 227 228 228 task.ContinueWith((t) => { 229 RefreshJobs(); 229 RefreshJobs(); 230 230 progress.Finish(); 231 231 SetEnabledStateOfControls(); … … 253 253 254 254 if (result == DialogResult.Yes) { 255 progress.Start("Stopping job(s)..." );255 progress.Start("Stopping job(s)...", ProgressMode.Indeterminate); 256 256 SetEnabledStateOfControls(); 257 257 var task = System.Threading.Tasks.Task.Factory.StartNew(StopJobsAsync, jobs); … … 267 267 progress.Finish(); 268 268 SetEnabledStateOfControls(); 269 MessageBox.Show("An error occured stopping the job(s).", "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error); 269 MessageBox.Show("An error occured stopping the job(s).", "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error); 270 270 }, TaskContinuationOptions.OnlyOnFaulted); 271 271 } … … 284 284 private IEnumerable<RefreshableJob> GetSelectedJobs() { 285 285 if (Content == null || matrixView.DataGridView.SelectedRows == null || matrixView.DataGridView.SelectedRows.Count == 0) 286 return Enumerable.Empty<RefreshableJob>() 286 return Enumerable.Empty<RefreshableJob>(); 287 287 288 288 var jobs = new List<RefreshableJob>(); 289 289 foreach (DataGridViewRow r in matrixView.DataGridView.SelectedRows) { 290 290 if (((string)r.Cells[0].Value) == JobState.Online.ToString()) { 291 jobs.Add(HiveAdminClient.Instance.Jobs[Content.Id].FirstOrDefault(x => x.Id == Guid.Parse((string) 291 jobs.Add(HiveAdminClient.Instance.Jobs[Content.Id].FirstOrDefault(x => x.Id == Guid.Parse((string)r.Cells[11].Value))); 292 292 } 293 293 } … … 310 310 string[,] values = new string[jobs.Count, 13]; 311 311 312 for (int i = 0; i < jobs.Count; i++) {313 var job = jobs.ElementAt(i); 312 for (int i = 0; i < jobs.Count; i++) { 313 var job = jobs.ElementAt(i); 314 314 values[i, 0] = job.Job.State.ToString(); 315 315 values[i, 1] = job.ExecutionState.ToString(); … … 322 322 values[i, 8] = job.Job.CalculatingCount.ToString(); 323 323 values[i, 9] = job.Job.FinishedCount.ToString(); 324 values[i, 10] = job.Job.Description; 324 values[i, 10] = job.Job.Description; 325 325 values[i, 11] = job.Job.Id.ToString(); 326 326 values[i, 12] = job.Job.OwnerUserId.ToString(); 327 327 } 328 328 329 329 var matrix = new StringMatrix(values); 330 330 matrix.ColumnNames = new string[] { JOB_STATE, JOB_EXECUTIONSTATE, JOB_EXECUTIONTIME, JOB_DATECREATED, JOB_OWNER, JOB_NAME, JOB_TASKCOUNT, JOB_WAITINGTASKCOUNT, JOB_CALCULATINGTASKCOUNT, JOB_FINISHEDTASKCOUNT, JOB_DESCRIPTION, JOB_ID, JOB_OWNERID }; … … 332 332 return matrix; 333 333 } 334 334 335 335 private void UpdateJobs() { 336 336 if (InvokeRequired) Invoke((Action)UpdateJobs); 337 337 else { 338 if (Content != null && Content.Id != null && Content.Id != Guid.Empty) {338 if (Content != null && Content.Id != null && Content.Id != Guid.Empty) { 339 339 var matrix = CreateValueMatrix(); 340 340 matrixView.Content = matrix; 341 if (matrix != null) {341 if (matrix != null) { 342 342 foreach (DataGridViewRow row in matrixView.DataGridView.Rows) { 343 343 string val = ((string)row.Cells[0].Value); … … 355 355 matrixView.DataGridView.Columns[1].MinimumWidth = 108; 356 356 } 357 } 357 } 358 358 } 359 359 } … … 367 367 var jobList = (IEnumerable<RefreshableJob>)jobs; 368 368 foreach (var job in jobList) { 369 progress. Status= "Resuming job \"" + job.Job.Name + "\"...";369 progress.Message = "Resuming job \"" + job.Job.Name + "\"..."; 370 370 HiveAdminClient.ResumeJob(job); 371 371 } … … 375 375 var jobList = (IEnumerable<RefreshableJob>)jobs; 376 376 foreach (var job in jobList) { 377 progress. Status= "Pausing job \"" + job.Job.Name + "\"...";377 progress.Message = "Pausing job \"" + job.Job.Name + "\"..."; 378 378 HiveAdminClient.PauseJob(job); 379 379 } … … 381 381 382 382 private void StopJobsAsync(object jobs) { 383 var jobList = (IEnumerable<RefreshableJob>) 384 foreach (var job in jobList) { 385 progress. Status= "Stopping job \"" + job.Job.Name + "\"...";383 var jobList = (IEnumerable<RefreshableJob>)jobs; 384 foreach (var job in jobList) { 385 progress.Message = "Stopping job \"" + job.Job.Name + "\"..."; 386 386 HiveAdminClient.StopJob(job); 387 387 } … … 390 390 private void RemoveJobsAsync(object jobs) { 391 391 var jobList = (IEnumerable<RefreshableJob>)jobs; 392 progress.Start( );392 progress.Start("", ProgressMode.Indeterminate); 393 393 foreach (var job in jobList) { 394 progress. Status= "Removing job \"" + job.Job.Name + "\"...";394 progress.Message = "Removing job \"" + job.Job.Name + "\"..."; 395 395 HiveAdminClient.RemoveJob(job); 396 396 } -
stable/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectView.cs
r17060 r17062 126 126 bool enabled = Content != null && !Locked && !ReadOnly; 127 127 nameTextBox.Enabled = enabled; 128 descriptionTextBox.Enabled = enabled; 128 descriptionTextBox.Enabled = enabled; 129 129 ownerComboBox.Enabled = enabled; 130 130 createdTextBox.Enabled = enabled; … … 160 160 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshing, sender, e); 161 161 else { 162 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 163 mainForm.AddOperationProgressToView(this, "Refreshing ..."); 162 Progress.Show(this, "Refreshing ...", ProgressMode.Indeterminate); 164 163 SetEnabledStateOfControls(); 165 164 } … … 169 168 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshed, sender, e); 170 169 else { 171 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 172 mainForm.RemoveOperationProgressFromView(this); 170 Progress.Hide(this); 173 171 SetEnabledStateOfControls(); 174 172 } -
stable/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectsView.cs
r17059 r17062 43 43 private const string NOT_STORED_TAG = "*"; // " [not stored]"; 44 44 private const string CHANGES_NOT_STORED_TAG = "*"; // " [changes not stored]"; 45 private const string INACTIVE_TAG = " [inactive]"; 45 private const string INACTIVE_TAG = " [inactive]"; 46 46 47 47 private readonly Color selectedBackColor = Color.DodgerBlue; … … 111 111 112 112 protected override void SetEnabledStateOfControls() { 113 base.SetEnabledStateOfControls(); 114 115 bool locked = Content == null || Locked || ReadOnly; 113 base.SetEnabledStateOfControls(); 114 115 bool locked = Content == null || Locked || ReadOnly; 116 116 bool parentOwner = selectedProject != null && HiveAdminClient.Instance.CheckOwnershipOfParentProject(selectedProject, UserInformation.Instance.User.Id); 117 bool selectedProjectDisabled = selectedProject == null 117 bool selectedProjectDisabled = selectedProject == null 118 118 || selectedProject != null && selectedProject.Id == Guid.Empty; 119 119 … … 183 183 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshing, sender, e); 184 184 else { 185 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 186 mainForm.AddOperationProgressToView(this, "Refreshing ..."); 185 Progress.Show(this, "Refreshing ...", ProgressMode.Indeterminate); 187 186 SetEnabledStateOfControls(); 188 187 } … … 192 191 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshed, sender, e); 193 192 else { 194 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 195 mainForm.RemoveOperationProgressFromView(this); 193 Progress.Hide(this); 196 194 SetEnabledStateOfControls(); 197 195 } … … 201 199 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshing, sender, e); 202 200 else { 203 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 204 mainForm.AddOperationProgressToView(this, "Refreshing ..."); 201 Progress.Show(this, "Refreshing ...", ProgressMode.Indeterminate); 205 202 SetEnabledStateOfControls(); 206 203 } … … 210 207 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshed, sender, e); 211 208 else { 212 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 213 mainForm.RemoveOperationProgressFromView(this); 209 Progress.Hide(this); 214 210 SetEnabledStateOfControls(); 215 211 } … … 234 230 } 235 231 236 private void addButton_Click(object sender, EventArgs e) { 232 private void addButton_Click(object sender, EventArgs e) { 237 233 238 234 if (selectedProject == null && !IsAdmin()) { … … 244 240 return; 245 241 } 246 242 247 243 if (selectedProject != null && selectedProject.Id == Guid.Empty) { 248 244 MessageBox.Show( … … 256 252 var project = new Project { 257 253 Name = "New Project", 258 OwnerUserId = UserInformation.Instance.User.Id, 254 OwnerUserId = UserInformation.Instance.User.Id, 259 255 }; 260 if (selectedProject != null) {256 if (selectedProject != null) { 261 257 project.ParentProjectId = selectedProject.Id; 262 258 project.EndDate = selectedProject.EndDate; … … 285 281 await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions( 286 282 action: () => { 287 RemoveProject(selectedProject); 283 RemoveProject(selectedProject); 288 284 }); 289 285 } … … 304 300 foreach (var project in projectsToSave) 305 301 project.Store(); 306 302 307 303 UpdateProjects(); 308 304 }, … … 316 312 if (node == null) return; 317 313 var p = (Project)node.Tag; 318 if (!HiveAdminClient.Instance.DisabledParentProjects.Contains(p)) ChangeSelectedProjectNode(node);314 if (!HiveAdminClient.Instance.DisabledParentProjects.Contains(p)) ChangeSelectedProjectNode(node); 319 315 } 320 316 … … 357 353 if (targetNode == null) { 358 354 treeView.Nodes.Add(sourceNode); 359 } else if (targetProject.Id != Guid.Empty) {355 } else if (targetProject.Id != Guid.Empty) { 360 356 targetNode.Nodes.Add(sourceNode); 361 357 sourceProject.ParentProjectId = targetProject.Id; … … 422 418 var newNode = new TreeNode(newProject.Name) { Tag = newProject }; 423 419 StyleTreeNode(newNode, newProject); 424 420 425 421 if (selectedProject == null && !disabledParentProjects.Contains(newProject)) { 426 422 SelectedProject = newProject; … … 533 529 if (project.Id != Guid.Empty) { 534 530 SelectedProject = HiveAdminClient.Instance.GetAvailableProjectAncestors(project.Id).LastOrDefault(); 535 HiveAdminClient.Delete(project); 531 HiveAdminClient.Delete(project); 536 532 UpdateProjects(); 537 } else { 533 } else { 538 534 SelectedProject = Content.FirstOrDefault(x => x.Id == project.ParentProjectId); 539 535 Content.Remove(project); -
stable/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs
r17059 r17062 185 185 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshing, sender, e); 186 186 else { 187 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 188 mainForm.AddOperationProgressToView(this, "Refreshing ..."); 187 Progress.Show(this, "Refreshing ...", ProgressMode.Indeterminate); 189 188 SetEnabledStateOfControls(); 190 189 } … … 194 193 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshed, sender, e); 195 194 else { 196 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 197 mainForm.RemoveOperationProgressFromView(this); 195 Progress.Hide(this); 198 196 SetEnabledStateOfControls(); 199 197 } … … 203 201 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshing, sender, e); 204 202 else { 205 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 206 mainForm.AddOperationProgressToView(this, "Refreshing ..."); 203 Progress.Show(this, "Refreshing ...", ProgressMode.Indeterminate); 207 204 SetEnabledStateOfControls(); 208 205 } … … 212 209 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshed, sender, e); 213 210 else { 214 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 215 mainForm.RemoveOperationProgressFromView(this); 211 Progress.Hide(this); 216 212 SetEnabledStateOfControls(); 217 213 } … … 247 243 } 248 244 249 private async void btnRemoveGroup_Click(object sender, EventArgs e) { 245 private async void btnRemoveGroup_Click(object sender, EventArgs e) { 250 246 var nodes = GetCheckedNodes(treeView.Nodes).ToList(); 251 247 var checkedResources = nodes.Select(x => x.Tag).OfType<Resource>().ToList(); … … 574 570 foreach (var nr in newResources) Content.Remove(nr); 575 571 576 HiveAdminClient.Delete(resource); 572 HiveAdminClient.Delete(resource); 577 573 UpdateResources(); 578 574 } else { … … 588 584 if (resources == null || !resources.Any()) return; 589 585 590 var ids = resources.Select(x => x.Id).ToList(); 586 var ids = resources.Select(x => x.Id).ToList(); 591 587 try { 592 588 bool update = false; 593 foreach (var r in resources) { 594 if (r.Id != Guid.Empty) 595 if (r.Id == SelectedResource.Id)589 foreach (var r in resources) { 590 if (r.Id != Guid.Empty) { 591 if (r.Id == SelectedResource.Id) 596 592 SelectedResource = HiveAdminClient.Instance.GetAvailableResourceAncestors(r.Id).LastOrDefault(); 597 593 … … 751 747 752 748 foreach (var r in resources) { 753 if (!resourceDescendants.ContainsKey(r.Id))749 if (!resourceDescendants.ContainsKey(r.Id)) 754 750 resourceDescendants.Add(r.Id, new HashSet<Resource>()); 755 751 } -
stable/HeuristicLab.Clients.Hive.JobManager
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Clients.Hive.JobManager merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/RunInHiveMenuItem.cs
r17059 r17062 99 99 rJob.Job.ResourceIds = hiveResourceSelectorDialog.SelectedResources.Select(x => x.Id).ToList(); 100 100 101 progress = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToContent(this.content, "Uploading to Hive...");101 progress = Progress.Show(this.content, "Uploading to Hive...", ProgressMode.Indeterminate); 102 102 rJob.Progress = progress; 103 103 progress.ProgressStateChanged += progress_ProgressStateChanged; … … 110 110 private void progress_ProgressStateChanged(object sender, EventArgs e) { 111 111 if (progress.ProgressState != ProgressState.Started) { 112 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromContent(content);112 Progress.Hide(content); 113 113 progress.ProgressStateChanged -= progress_ProgressStateChanged; 114 114 } … … 116 116 117 117 private void HandleEx(Exception ex) { 118 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromContent(content);118 Progress.Hide(content); 119 119 progress.ProgressStateChanged -= progress_ProgressStateChanged; 120 120 ErrorHandling.ShowErrorDialog("Error uploading tasks", ex); -
stable/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.cs
r17059 r17062 96 96 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveClient_Instance_Refreshing, sender, e); 97 97 else { 98 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 99 mainForm.AddOperationProgressToView(this, "Refreshing ..."); 98 Progress.ShowOnControl(this, "Refreshing", ProgressMode.Indeterminate); 100 99 refreshButton.Enabled = false; 101 100 } … … 105 104 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveClient_Instance_Refreshed, sender, e); 106 105 else { 107 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 108 mainForm.RemoveOperationProgressFromView(this); 106 Progress.HideFromControl(this); 109 107 refreshButton.Enabled = true; 110 108 } … … 140 138 okButton.Enabled = hiveResourceSelector.AssignedResources.Any(); 141 139 142 if (!hiveResourceSelector.AssignedResources.Any()) {140 if (!hiveResourceSelector.AssignedResources.Any()) { 143 141 errorProvider.SetError(okButton, "Note: currently no resources are assigned"); 144 } else if (hiveResourceSelector.AssignedCores == 0) {142 } else if (hiveResourceSelector.AssignedCores == 0) { 145 143 errorProvider.SetError(okButton, "Note: currently no resources with cores are assigned"); 146 144 } else { -
stable/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs
r17059 r17062 47 47 this.itemsListView.FullRowSelect = true; 48 48 49 this.itemsListView.ListViewItemSorter = new ListViewItemComparer(new int[] { 2, 0 }, new SortOrder[] { SortOrder.Ascending, SortOrder.Ascending }); 49 this.itemsListView.ListViewItemSorter = new ListViewItemComparer(new int[] { 2, 0 }, new SortOrder[] { SortOrder.Ascending, SortOrder.Ascending }); 50 50 51 51 foreach (ColumnHeader c in this.itemsListView.Columns) { … … 53 53 int w = c.Width; 54 54 c.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 55 if (w > c.Width) {55 if (w > c.Width) { 56 56 c.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); 57 57 } … … 120 120 121 121 task.ContinueWith((t) => { 122 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);122 Progress.Hide(this); 123 123 ErrorHandling.ShowErrorDialog("An error occured while deleting the job. ", t.Exception); 124 124 }, TaskContinuationOptions.OnlyOnFaulted); … … 131 131 132 132 private void DeleteHiveJobsAsync(object items) { 133 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Deleting job...");133 Progress.Show(this, "Deleting job...", ProgressMode.Indeterminate); 134 134 foreach (RefreshableJob item in (List<RefreshableJob>)items) { 135 135 Content.Remove(item); 136 136 } 137 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);137 Progress.Hide(this); 138 138 } 139 139 … … 197 197 listViewItem.SubItems.Insert(1, new ListViewItem.ListViewSubItem(listViewItem, item.Job.Name)); 198 198 listViewItem.SubItems.Insert(2, new ListViewItem.ListViewSubItem(listViewItem, HiveClient.Instance.GetProjectAncestry(item.Job.ProjectId))); 199 199 200 200 listViewItem.Group = GetListViewGroup(item.Job.OwnerUsername); 201 201 return listViewItem; -
stable/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r17059 r17062 75 75 Content.Loaded += new EventHandler(Content_Loaded); 76 76 Content.TaskReceived += new EventHandler(Content_TaskReceived); 77 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, Content.Progress);77 Progress.Show(this, Content.Progress); 78 78 } 79 79 … … 90 90 Content.Loaded -= new EventHandler(Content_Loaded); 91 91 Content.TaskReceived -= new EventHandler(Content_TaskReceived); 92 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this, false);92 Progress.Hide(this, false); 93 93 DeregisterHiveExperimentEvents(); 94 94 DeregisterHiveTasksEvents(); … … 133 133 stateLogViewHost.Content = null; 134 134 } else { 135 if (Content.Job != null136 && Content.Job.Id != Guid.Empty 135 if (Content.Job != null 136 && Content.Job.Id != Guid.Empty 137 137 && !originalJobProjectAssignment.ContainsKey(Content.Job.Id)) { 138 138 originalJobProjectAssignment.Add(Content.Job.Id, Content.Job.ProjectId); … … 159 159 projectNameTextBox.Text = HiveClient.Instance.GetProjectAncestry(Content.Job.ProjectId); 160 160 projectNameTextBox.Text += " (" + (cores.HasValue ? cores.Value.ToString() : "0") + " cores)"; 161 } 161 } 162 162 } 163 163 } else if (Content.Job != null && Content.Job.ProjectId != Guid.Empty) { … … 167 167 } 168 168 169 if (hiveResourceSelectorDialog == null)169 if (hiveResourceSelectorDialog == null) 170 170 hiveResourceSelectorDialog = new HiveResourceSelectorDialog(Content.Job.Id, Content.Job.ProjectId); 171 171 … … 203 203 executionTimeTextBox.Text = Content.ExecutionTime.ToString(); 204 204 refreshAutomaticallyCheckBox.Checked = Content.RefreshAutomatically; 205 205 206 206 logView.Content = Content.Log; 207 207 lock (runCollectionViewLocker) { … … 408 408 if (hiveResourceSelectorDialog == null) { 409 409 hiveResourceSelectorDialog = new HiveResourceSelectorDialog(Content.Job.Id, Content.Job.ProjectId); 410 } else if (hiveResourceSelectorDialog.JobId != Content.Job.Id) {410 } else if (hiveResourceSelectorDialog.JobId != Content.Job.Id) { 411 411 hiveResourceSelectorDialog.JobId = Content.Job.Id; 412 412 hiveResourceSelectorDialog.SelectedProjectId = Content.Job.ProjectId; … … 418 418 hiveResourceSelectorDialog.ProjectId = Guid.Empty; 419 419 } 420 } else if (hiveResourceSelectorDialog.JobId == Guid.Empty && Content.Job.Id == Guid.Empty) {420 } else if (hiveResourceSelectorDialog.JobId == Guid.Empty && Content.Job.Id == Guid.Empty) { 421 421 hiveResourceSelectorDialog.JobId = Content.Job.Id; 422 422 hiveResourceSelectorDialog.ProjectId = Guid.Empty; … … 430 430 if (hiveResourceSelectorDialog.ShowDialog(this) == DialogResult.OK) { 431 431 selectedProject = hiveResourceSelectorDialog.SelectedProject; 432 if (selectedProject != null) {432 if (selectedProject != null) { 433 433 Content.Job.ProjectId = selectedProject.Id; 434 434 Content.Job.ResourceIds = hiveResourceSelectorDialog.SelectedResources.Select(x => x.Id).ToList(); … … 493 493 494 494 private void PauseJobAsync(object job) { 495 Content.Progress.Start("Pausing job..." );495 Content.Progress.Start("Pausing job...", ProgressMode.Indeterminate); 496 496 HiveClient.PauseJob((RefreshableJob)job); 497 497 Content.Progress.Finish(); … … 499 499 500 500 private void StopJobAsync(object job) { 501 Content.Progress.Start("Stopping job..." );501 Content.Progress.Start("Stopping job...", ProgressMode.Indeterminate); 502 502 HiveClient.StopJob((RefreshableJob)job); 503 503 Content.Progress.Finish(); … … 505 505 506 506 private void ResumeJobAsync(object job) { 507 Content.Progress.Start("Resuming job..." );507 Content.Progress.Start("Resuming job...", ProgressMode.Indeterminate); 508 508 HiveClient.ResumeJob((RefreshableJob)job); 509 509 Content.Progress.Finish(); … … 582 582 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = false; 583 583 } else { 584 startButton.Enabled = Content.IsControllable && Content.HiveTasks != null && Content.HiveTasks.Count > 0 585 && Content.Job.ProjectId != Guid.Empty && Content.Job.ResourceIds != null && Content.Job.ResourceIds.Any()584 startButton.Enabled = Content.IsControllable && Content.HiveTasks != null && Content.HiveTasks.Count > 0 585 && Content.Job.ProjectId != Guid.Empty && Content.Job.ResourceIds != null && Content.Job.ResourceIds.Any() 586 586 && (Content.ExecutionState == ExecutionState.Prepared || Content.ExecutionState == ExecutionState.Paused) && !Content.IsProgressing; 587 587 pauseButton.Enabled = Content.IsControllable && Content.ExecutionState == ExecutionState.Started && !Content.IsProgressing; … … 589 589 } 590 590 } 591 591 592 592 private Project GetProject(Guid projectId) { 593 593 return HiveServiceLocator.Instance.CallHiveService(s => s.GetProject(projectId)); … … 595 595 596 596 private void UpdateSelectorDialog() { 597 if (hiveResourceSelectorDialog != null) {597 if (hiveResourceSelectorDialog != null) { 598 598 hiveResourceSelectorDialog = null; 599 599 //hiveResourceSelectorDialog.JobId = Content.Job.Id; -
stable/HeuristicLab.Clients.Hive.Slave
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Clients.Hive.Slave merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Hive.Slave.WindowsService
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Clients.Hive.Slave.WindowsService merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Hive.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Clients.Hive.Views merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Hive.Views/3.3/HiveTasks/OptimizerHiveTaskView.cs
r15584 r17062 46 46 protected override void Job_ItemChanged(object sender, EventArgs e) { 47 47 if (Content != null && Content.Task != null && Content.ItemTask.Item != null) { 48 Content.ExecuteReadActionOnItemTask(new Action(delegate () {48 Content.ExecuteReadActionOnItemTask(new Action(delegate () { 49 49 runCollectionViewHost.Content = Content.ItemTask.Item.Runs; 50 50 })); … … 58 58 base.RegisterContentEvents(); 59 59 Content.IsControllableChanged += new EventHandler(Content_IsControllableChanged); 60 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, Content.Progress);60 Progress.Show(this, Content.Progress); 61 61 } 62 62 63 63 protected override void DeregisterContentEvents() { 64 64 Content.IsControllableChanged -= new EventHandler(Content_IsControllableChanged); 65 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this, false);65 Progress.Hide(this, false); 66 66 base.DeregisterContentEvents(); 67 67 } … … 99 99 100 100 private void PauseTaskAsync() { 101 Content.Progress.Start("Pausing task. Please be patient for the command to take effect." );101 Content.Progress.Start("Pausing task. Please be patient for the command to take effect.", ProgressMode.Indeterminate); 102 102 Content.Pause(); 103 103 Content.Progress.Finish(); … … 105 105 106 106 private void StopTaskAsync() { 107 Content.Progress.Start("Stopping task. Please be patient for the command to take effect." );107 Content.Progress.Start("Stopping task. Please be patient for the command to take effect.", ProgressMode.Indeterminate); 108 108 Content.Stop(); 109 109 Content.Progress.Finish(); … … 111 111 112 112 private void ResumeTaskAsync() { 113 Content.Progress.Start("Resuming task. Please be patient for the command to take effect." );113 Content.Progress.Start("Resuming task. Please be patient for the command to take effect.", ProgressMode.Indeterminate); 114 114 Content.Restart(); 115 115 Content.Progress.Finish(); -
stable/HeuristicLab.Clients.Hive/3.3/HeuristicLab.Clients.Hive-3.3.csproj
r17059 r17062 236 236 <Private>False</Private> 237 237 </ProjectReference> 238 <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj"> 239 <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project> 240 <Name>HeuristicLab.MainForm.WindowsForms-3.3</Name> 241 <Private>False</Private> 242 </ProjectReference> 238 243 <ProjectReference Include="..\..\HeuristicLab.MainForm\3.3\HeuristicLab.MainForm-3.3.csproj"> 239 244 <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project> -
stable/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r17059 r17062 167 167 RefreshDisabledParentProjects(); 168 168 RefreshDisabledParentResources(); 169 } 170 catch { 169 } catch { 171 170 jobs = null; 172 171 projects = null; 173 172 resources = null; 174 173 throw; 175 } 176 finally { 174 } finally { 177 175 OnRefreshed(); 178 176 } … … 215 213 216 214 public void RefreshAsync(Action<Exception> exceptionCallback) { 217 var call = new Func<Exception>(delegate () {215 var call = new Func<Exception>(delegate () { 218 216 try { 219 217 Refresh(); 220 } 221 catch (Exception ex) { 218 } catch (Exception ex) { 222 219 return ex; 223 220 } 224 221 return null; 225 222 }); 226 call.BeginInvoke(delegate (IAsyncResult result) {223 call.BeginInvoke(delegate (IAsyncResult result) { 227 224 Exception ex = call.EndInvoke(result); 228 225 if (ex != null) exceptionCallback(ex); … … 244 241 resourceAncestors.Keys.ToList().ForEach(k => resourceDescendants.Add(k, new HashSet<Guid>())); 245 242 foreach (var ra in resourceAncestors) { 246 foreach (var ancestor in ra.Value) {243 foreach (var ancestor in ra.Value) { 247 244 resourceDescendants[ancestor].Add(ra.Key); 248 245 } … … 263 260 // build project descendant list 264 261 projectAncestors.Keys.ToList().ForEach(k => projectDescendants.Add(k, new HashSet<Guid>())); 265 foreach (var pa in projectAncestors) {266 foreach (var ancestor in pa.Value) {262 foreach (var pa in projectAncestors) { 263 foreach (var ancestor in pa.Value) { 267 264 projectDescendants[ancestor].Add(pa.Key); 268 265 } … … 362 359 } 363 360 public static void StoreAsync(Action<Exception> exceptionCallback, IHiveItem item, CancellationToken cancellationToken) { 364 var call = new Func<Exception>(delegate () {361 var call = new Func<Exception>(delegate () { 365 362 try { 366 363 Store(item, cancellationToken); 367 } 368 catch (Exception ex) { 364 } catch (Exception ex) { 369 365 return ex; 370 366 } 371 367 return null; 372 368 }); 373 call.BeginInvoke(delegate (IAsyncResult result) {369 call.BeginInvoke(delegate (IAsyncResult result) { 374 370 Exception ex = call.EndInvoke(result); 375 371 if (ex != null) exceptionCallback(ex); … … 460 456 public static void UpdateJob(Action<Exception> exceptionCallback, RefreshableJob refreshableJob, CancellationToken cancellationToken) { 461 457 refreshableJob.IsProgressing = true; 462 refreshableJob.Progress. Status= "Saving Job...";458 refreshableJob.Progress.Message = "Saving Job..."; 463 459 HiveClient.StoreAsync( 464 460 new Action<Exception>((Exception ex) => { … … 473 469 474 470 try { 475 refreshableJob.Progress.Start("Saving Job..." );471 refreshableJob.Progress.Start("Saving Job...", ProgressMode.Indeterminate); 476 472 HiveClient.StoreAsync(new Action<Exception>((Exception ex) => { 477 473 throw new Exception("Update failed.", ex); … … 492 488 try { 493 489 refreshableJob.IsProgressing = true; 494 refreshableJob.Progress.Start("Connecting to server..." );490 refreshableJob.Progress.Start("Connecting to server...", ProgressMode.Indeterminate); 495 491 496 492 foreach (OptimizerHiveTask hiveJob in refreshableJob.HiveTasks.OfType<OptimizerHiveTask>()) { … … 499 495 500 496 // upload Job 501 refreshableJob.Progress. Status= "Uploading Job...";497 refreshableJob.Progress.Message = "Uploading Job..."; 502 498 refreshableJob.Job.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddJob(refreshableJob.Job, refreshableJob.Job.ResourceIds)); 503 499 refreshableJob.Job = HiveServiceLocator.Instance.CallHiveService((s) => s.GetJob(refreshableJob.Job.Id)); // update owner and permissions … … 509 505 510 506 // upload plugins 511 refreshableJob.Progress. Status= "Uploading plugins...";507 refreshableJob.Progress.Message = "Uploading plugins..."; 512 508 this.OnlinePlugins = HiveServiceLocator.Instance.CallHiveService((s) => s.GetPlugins()); 513 509 this.AlreadyUploadedPlugins = new List<Plugin>(); … … 517 513 518 514 // upload tasks 519 refreshableJob.Progress.Status = "Uploading tasks..."; 515 refreshableJob.Progress.Message = "Uploading tasks..."; 516 refreshableJob.Progress.ProgressMode = ProgressMode.Determinate; 517 refreshableJob.Progress.ProgressValue = 0; 520 518 521 519 var tasks = new List<TS.Task>(); … … 528 526 } 529 527 TS.Task.WaitAll(tasks.ToArray()); 530 } 531 finally { 528 } finally { 532 529 refreshableJob.Job.Modified = false; 533 530 refreshableJob.IsProgressing = false; … … 615 612 lock (jobCountLocker) { 616 613 progress.ProgressValue = (double)taskCount[0] / totalJobCount; 617 progress. Status= string.Format("Uploaded task ({0} of {1})", taskCount[0], totalJobCount);614 progress.Message = string.Format("Uploaded task ({0} of {1})", taskCount[0], totalJobCount); 618 615 } 619 616 … … 646 643 647 644 // fetch all task objects to create the full tree of tree of HiveTask objects 648 refreshableJob.Progress.Start("Downloading list of tasks..." );645 refreshableJob.Progress.Start("Downloading list of tasks...", ProgressMode.Indeterminate); 649 646 allTasks = HiveServiceLocator.Instance.CallHiveService(s => s.GetLightweightJobTasksWithoutStateLog(hiveExperiment.Id)); 650 647 totalJobCount = allTasks.Count(); 651 648 652 refreshableJob.Progress.Status = "Downloading tasks..."; 649 refreshableJob.Progress.Message = "Downloading tasks..."; 650 refreshableJob.Progress.ProgressMode = ProgressMode.Determinate; 651 refreshableJob.Progress.ProgressValue = 0.0; 653 652 downloader = new TaskDownloader(allTasks.Select(x => x.Id)); 654 653 downloader.StartAsync(); … … 656 655 while (!downloader.IsFinished) { 657 656 refreshableJob.Progress.ProgressValue = downloader.FinishedCount / (double)totalJobCount; 658 refreshableJob.Progress. Status= string.Format("Downloading/deserializing tasks... ({0}/{1} finished)", downloader.FinishedCount, totalJobCount);657 refreshableJob.Progress.Message = string.Format("Downloading/deserializing tasks... ({0}/{1} finished)", downloader.FinishedCount, totalJobCount); 659 658 Thread.Sleep(500); 660 659 … … 666 665 var parents = allHiveTasks.Values.Where(x => !x.Task.ParentTaskId.HasValue); 667 666 668 refreshableJob.Progress.Status = "Downloading/deserializing complete. Displaying tasks..."; 667 refreshableJob.Progress.Message = "Downloading/deserializing complete. Displaying tasks..."; 668 refreshableJob.Progress.ProgressMode = ProgressMode.Indeterminate; 669 669 670 // build child-task tree 670 671 foreach (HiveTask hiveTask in parents) { … … 677 678 } else if (refreshableJob.IsPaused()) { 678 679 refreshableJob.ExecutionState = Core.ExecutionState.Paused; 679 } else { 680 } else { 680 681 refreshableJob.ExecutionState = Core.ExecutionState.Started; 681 682 } 682 683 refreshableJob.OnLoaded(); 683 } 684 finally { 684 } finally { 685 685 refreshableJob.IsProgressing = false; 686 686 refreshableJob.Progress.Finish(); … … 719 719 try { 720 720 return PersistenceUtil.Deserialize<ItemTask>(taskData.Data); 721 } 722 catch { 721 } catch { 723 722 return null; 724 723 } … … 731 730 public static void TryAndRepeat(Action action, int repetitions, string errorMessage, ILog log = null) { 732 731 while (true) { 733 try { action(); return; } 734 catch (Exception e) { 732 try { action(); return; } catch (Exception e) { 735 733 if (repetitions == 0) throw new HiveException(errorMessage, e); 736 734 if (log != null) log.LogMessage(string.Format("{0}: {1} - will try again!", errorMessage, e.ToString())); -
stable/HeuristicLab.Clients.Hive/3.3/Plugin.cs.frame
r17059 r17062 37 37 [PluginDependency("HeuristicLab.Hive", "3.3")] 38 38 [PluginDependency("HeuristicLab.MainForm", "3.3")] 39 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 39 40 [PluginDependency("HeuristicLab.Optimization", "3.3")] 40 41 [PluginDependency("HeuristicLab.Persistence", "3.3")] -
stable/HeuristicLab.Clients.OKB.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Clients.OKB.Views merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBExperimentUploadView.cs
r15584 r17062 188 188 if (InvokeRequired) { Invoke((Action<object, EventArgs>)RunCreationClient_Refreshing, sender, e); return; } 189 189 var message = "Refreshing algorithms and problems..."; 190 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, message);190 Progress.Show(this, message, ProgressMode.Indeterminate); 191 191 refreshing = true; 192 192 SetEnabledStateOfControls(); … … 195 195 private void RunCreationClient_Refreshed(object sender, EventArgs e) { 196 196 if (InvokeRequired) { Invoke((Action<object, EventArgs>)RunCreationClient_Refreshed, sender, e); return; } 197 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);197 Progress.Hide(this); 198 198 refreshing = false; 199 199 SetEnabledStateOfControls(); … … 203 203 var task = System.Threading.Tasks.Task.Factory.StartNew(UploadAsync); 204 204 task.ContinueWith((t) => { 205 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);205 Progress.Hide(this); 206 206 PluginInfrastructure.ErrorHandling.ShowErrorDialog("An exception occured while uploading the runs to the OKB.", t.Exception); 207 207 }, TaskContinuationOptions.OnlyOnFaulted); … … 210 210 private void UploadAsync() { 211 211 var message = "Uploading runs to OKB..."; 212 IProgress progress = MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, message);212 IProgress progress = Progress.Show(this, message); 213 213 double count = dataGridView.Rows.Count; 214 214 int i = 0; … … 226 226 progress.ProgressValue = ((double)i) / count; 227 227 } 228 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);228 Progress.Hide(this); 229 229 ClearRuns(); 230 230 } -
stable/HeuristicLab.Core
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Core merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Core merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Core.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Core.Views merged: 15706-15707,16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Core.Views/3.3/TypeSelector.cs
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Core.Views/3.3/TypeSelector.cs merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelector.cs merged: 15583
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Data
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Data merged: 15931-15932,15934,16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Data.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Data.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Data.Views merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Data.Views/3.3
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Data.Views/3.3 merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Data.Views/3.3 merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Data/3.3
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Data/3.3 merged: 15931-15932,15934,16356,16389,16430 /trunk/sources/HeuristicLab.Data/3.3 merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.DataPreprocessing
- Property svn:mergeinfo changed
/trunk/HeuristicLab.DataPreprocessing merged: 16356,16389,16430 /trunk/sources/HeuristicLab.DataPreprocessing merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.DataPreprocessing.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.DataPreprocessing.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.DataPreprocessing.Views merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs
r15584 r17062 165 165 await Task.Run(() => { 166 166 TProblemData instance; 167 var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;168 167 // lock active view and show progress bar 169 var activeView = (IContentView)MainFormManager.MainForm.ActiveView;170 168 171 169 try { 172 var progress = mainForm.AddOperationProgressToContent(activeView.Content, "Loading problem instance."); 173 170 var progress = Progress.Show(Content, "Loading problem instance."); 174 171 instanceProvider.ProgressChanged += (o, args) => { progress.ProgressValue = args.ProgressPercentage / 100.0; }; 175 172 … … 177 174 } catch (IOException ex) { 178 175 MessageBox.Show(string.Format("There was an error parsing the file: {0}", Environment.NewLine + ex.Message), "Error while parsing", MessageBoxButtons.OK, MessageBoxIcon.Error); 179 mainForm.RemoveOperationProgressFromContent(activeView.Content);176 Progress.Hide(Content); 180 177 return; 181 178 } … … 185 182 MessageBox.Show(string.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(importDialog.Path), Environment.NewLine + ex.Message), "Cannot load instance"); 186 183 } finally { 187 mainForm.RemoveOperationProgressFromContent(activeView.Content);184 Progress.Hide(Content); 188 185 } 189 186 }); … … 222 219 var storable = itemCreator() as IStorableContent; 223 220 if (storable != null) { 224 var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;225 var activeView = (IContentView)MainFormManager.MainForm.ActiveView;226 221 try { 227 mainForm.AddOperationProgressToContent(activeView.Content, "Exporting data.");222 Progress.Show(Content, "Exporting data.", ProgressMode.Indeterminate); 228 223 ContentManager.Save(storable, saveFileDialog.FileName, compressed); 229 224 } finally { 230 mainForm.RemoveOperationProgressFromContent(activeView.Content);225 Progress.Hide(Content); 231 226 } 232 227 } … … 244 239 if (saveFileDialog.ShowDialog() == DialogResult.OK) { 245 240 Task.Run(() => { 246 var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;247 var activeView = (IContentView)MainFormManager.MainForm.ActiveView;248 241 try { 249 242 var problemData = Content.CreateNewProblemData(); 250 mainForm.AddOperationProgressToContent(activeView.Content, "Exporting data.");243 Progress.Show(Content, "Exporting data.", ProgressMode.Indeterminate); 251 244 if (problemData is TimeSeriesPrognosisProblemData) 252 245 Export(new TimeSeriesPrognosisCSVInstanceProvider(), problemData, saveFileDialog.FileName); … … 256 249 Export(new ClassificationCSVInstanceProvider(), problemData, saveFileDialog.FileName); 257 250 } finally { 258 mainForm.RemoveOperationProgressFromContent(activeView.Content);251 Progress.Hide(Content); 259 252 } 260 253 }); -
stable/HeuristicLab.DataPreprocessing/3.4
- Property svn:mergeinfo changed
/trunk/HeuristicLab.DataPreprocessing/3.4 merged: 16356,16389,16430 /trunk/sources/HeuristicLab.DataPreprocessing/3.4 merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.BinaryVectorEncoding
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Encodings.BinaryVectorEncoding merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.IntegerVectorEncoding
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Encodings.IntegerVectorEncoding merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.PermutationEncoding
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Encodings.PermutationEncoding merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Encodings.PermutationEncoding merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.RealVectorEncoding
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Encodings.RealVectorEncoding merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Encodings.RealVectorEncoding merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.ExtLibs
- Property svn:mergeinfo changed
/trunk/HeuristicLab.ExtLibs merged: 16266,16269,16274,16333-16334,16356,16389,16430 /trunk/sources/HeuristicLab.ExtLibs merged: 15581,15583
- Property svn:mergeinfo changed
-
stable/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs
r15584 r17062 25 25 namespace HeuristicLab.MainForm.WindowsForms { 26 26 internal sealed partial class ProgressView : UserControl { 27 private const int defaultControlHeight = 88;28 private const int collapsedControlHeight = 55;29 30 27 private readonly Control control; 31 28 public Control Control { … … 40 37 public ProgressView(Control control, IProgress content) 41 38 : base() { 42 if (control == null) throw new ArgumentNullException("control" , "The control is null.");43 if (content == null) throw new ArgumentNullException("content" , "The passed progress is null.");39 if (control == null) throw new ArgumentNullException("control"); 40 if (content == null) throw new ArgumentNullException("content"); 44 41 InitializeComponent(); 45 42 46 43 this.control = control; 47 44 this.content = content; 48 if (content.ProgressState == ProgressState.Started) 45 46 if (content.ProgressState != ProgressState.Finished) 49 47 ShowProgress(); 50 48 RegisterContentEvents(); 51 49 } 52 50 53 /// <summary>54 /// Clean up any resources being used.55 /// </summary>56 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>57 51 protected override void Dispose(bool disposing) { 58 52 DeregisterContentEvents(); … … 66 60 67 61 private void RegisterContentEvents() { 68 content.StatusChanged += new EventHandler(progress_StatusChanged); 69 content.ProgressValueChanged += new EventHandler(progress_ProgressValueChanged); 70 content.ProgressStateChanged += new EventHandler(Content_ProgressStateChanged); 71 content.CanBeCanceledChanged += new EventHandler(Content_CanBeCanceledChanged); 62 Content.ProgressStateChanged += new EventHandler(Content_ProgressStateChanged); 63 Content.MessageChanged += new EventHandler(Content_MessageChanged); 64 Content.ProgressBarModeChanged += new EventHandler(Content_ProgressBarModeChanged); 65 Content.ProgressValueChanged += new EventHandler(Content_ProgressValueChanged); 66 Content.CanBeStoppedChanged += new EventHandler(Content_CanBeStoppedChanged); 67 Content.CanBeCanceledChanged += new EventHandler(Content_CanBeCanceledChanged); 72 68 } 73 69 private void DeregisterContentEvents() { 74 content.StatusChanged -= new EventHandler(progress_StatusChanged); 75 content.ProgressValueChanged -= new EventHandler(progress_ProgressValueChanged); 76 content.ProgressStateChanged -= new EventHandler(Content_ProgressStateChanged); 77 content.CanBeCanceledChanged -= new EventHandler(Content_CanBeCanceledChanged); 70 Content.ProgressStateChanged -= new EventHandler(Content_ProgressStateChanged); 71 Content.MessageChanged -= new EventHandler(Content_MessageChanged); 72 Content.ProgressBarModeChanged -= new EventHandler(Content_ProgressBarModeChanged); 73 Content.ProgressValueChanged -= new EventHandler(Content_ProgressValueChanged); 74 Content.CanBeStoppedChanged -= new EventHandler(Content_CanBeStoppedChanged); 75 Content.CanBeCanceledChanged -= new EventHandler(Content_CanBeCanceledChanged); 76 } 77 78 private void Content_ProgressStateChanged(object sender, EventArgs e) { 79 UpdateProgressState(); 80 UpdateButtonsState(); 81 } 82 83 private void Content_MessageChanged(object sender, EventArgs e) { 84 UpdateProgressMessage(); 85 } 86 87 private void Content_ProgressBarModeChanged(object sender, EventArgs e) { 88 UpdateProgressValue(); 89 } 90 private void Content_ProgressValueChanged(object sender, EventArgs e) { 91 UpdateProgressValue(); 92 } 93 94 private void Content_CanBeStoppedChanged(object sender, EventArgs e) { 95 UpdateButtonsState(); 96 } 97 private void Content_CanBeCanceledChanged(object sender, EventArgs e) { 98 UpdateButtonsState(); 78 99 } 79 100 … … 83 104 return; 84 105 } 85 i nt height = Content.CanBeCanceled ? Height : collapsedControlHeight;106 if (Parent != null) return; 86 107 87 108 Left = (Control.ClientRectangle.Width / 2) - (Width / 2); 88 Top = (Control.ClientRectangle.Height / 2) - ( height / 2);109 Top = (Control.ClientRectangle.Height / 2) - (Height / 2); 89 110 Anchor = AnchorStyles.None; 90 111 91 control.Enabled = false; 112 UpdateProgressMessage(); 113 UpdateProgressValue(); 114 UpdateButtonsState(); 115 116 Control.Enabled = false; 92 117 Parent = Control.Parent; 93 118 BringToFront(); 94 95 UpdateProgressValue();96 UpdateProgressStatus();97 UpdateCancelButton();98 119 Visible = true; 99 120 } 100 121 101 122 private void HideProgress() { 102 if (InvokeRequired) Invoke((Action)HideProgress); 103 else { 104 control.Enabled = true; 105 Parent = null; 106 Visible = false; 123 if (Control.InvokeRequired) { 124 Control.Invoke((Action)HideProgress); 125 return; 126 } 127 if (Parent == null) return; 128 129 Visible = false; 130 Control.Enabled = true; 131 Parent = null; 132 } 133 134 private void UpdateProgressState() { 135 if (Control.InvokeRequired) { 136 Control.Invoke((Action)UpdateProgressState); 137 return; 138 } 139 140 if (Content.ProgressState != ProgressState.Finished) 141 ShowProgress(); 142 else 143 HideProgress(); 144 } 145 146 private void UpdateProgressMessage() { 147 if (Control.InvokeRequired) { 148 Control.Invoke((Action)UpdateProgressMessage); 149 return; 150 } 151 152 messageLabel.Text = content.Message; 153 } 154 155 private void UpdateProgressValue() { 156 if (InvokeRequired) { 157 Invoke((Action)UpdateProgressValue); 158 return; 159 } 160 161 switch (Content.ProgressMode) { 162 case ProgressMode.Determinate: 163 progressBar.Style = ProgressBarStyle.Continuous; 164 progressBar.Value = (int)Math.Round(progressBar.Minimum + content.ProgressValue * (progressBar.Maximum - progressBar.Minimum)); 165 break; 166 case ProgressMode.Indeterminate: 167 progressBar.Style = ProgressBarStyle.Marquee; 168 progressBar.Value = 0; 169 break; 170 default: 171 throw new NotImplementedException($"Invalid Progress Mode: {content.ProgressMode}"); 107 172 } 108 173 } 109 174 110 private void progress_StatusChanged(object sender, EventArgs e) { 111 UpdateProgressStatus(); 175 private void UpdateButtonsState() { 176 if (Control.InvokeRequired) { 177 Control.Invoke((Action)UpdateButtonsState); 178 return; 179 } 180 181 stopButton.Visible = Content.CanBeStopped; 182 stopButton.Enabled = Content.CanBeStopped && content.ProgressState == ProgressState.Started; 183 184 cancelButton.Visible = Content.CanBeCanceled; 185 cancelButton.Enabled = Content.CanBeCanceled && content.ProgressState == ProgressState.Started; 112 186 } 113 187 114 private void progress_ProgressValueChanged(object sender, EventArgs e) {115 UpdateProgressValue();188 private void stopButton_Click(object sender, EventArgs e) { 189 Content.Stop(); 116 190 } 117 118 private void Content_ProgressStateChanged(object sender, EventArgs e) {119 switch (content.ProgressState) {120 case ProgressState.Finished: HideProgress(); break;121 case ProgressState.Canceled: HideProgress(); break;122 case ProgressState.Started: ShowProgress(); break;123 default: throw new NotSupportedException("The progress state " + content.ProgressState + " is not supported by the ProgressView.");124 }125 }126 127 private void Content_CanBeCanceledChanged(object sender, EventArgs e) {128 UpdateCancelButton();129 }130 131 private void UpdateCancelButton() {132 cancelButton.Visible = content != null && content.CanBeCanceled;133 cancelButton.Enabled = content != null && content.CanBeCanceled;134 135 if (content != null && content.CanBeCanceled) {136 Height = defaultControlHeight;137 } else if (content != null && !content.CanBeCanceled) {138 Height = collapsedControlHeight;139 }140 }141 142 private void UpdateProgressValue() {143 // prevent problems with object disposal and invoke as suggested by http://stackoverflow.com/a/18647091144 if (!IsHandleCreated) return;145 if (InvokeRequired) {146 try {147 Invoke((Action)UpdateProgressValue);148 }149 catch (InvalidOperationException) {150 // swallow ObjectDisposedException151 // which might occur if the invoke call is executed after or while the control is disposing152 }153 } else {154 if (content != null) {155 double progressValue = content.ProgressValue;156 if (progressValue <= 0.0 || progressValue > 1.0) {157 progressBar.Style = ProgressBarStyle.Marquee;158 } else {159 progressBar.Style = ProgressBarStyle.Blocks;160 progressBar.Value =161 (int)Math.Round(progressBar.Minimum + progressValue * (progressBar.Maximum - progressBar.Minimum));162 }163 }164 }165 }166 167 private void UpdateProgressStatus() {168 if (InvokeRequired) Invoke((Action)UpdateProgressStatus);169 else if (content != null)170 statusLabel.Text = content.Status;171 }172 173 191 private void cancelButton_Click(object sender, EventArgs e) { 174 content.Cancel();192 Content.Cancel(); 175 193 } 176 194 } -
stable/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.designer.cs
r15584 r17062 27 27 private System.ComponentModel.IContainer components = null; 28 28 29 29 30 30 #region Component Designer generated code 31 31 … … 36 36 private void InitializeComponent() { 37 37 this.progressBar = new System.Windows.Forms.ProgressBar(); 38 this.statusLabel = new System.Windows.Forms.Label(); 38 this.messageLabel = new System.Windows.Forms.Label(); 39 this.borderPanel = new System.Windows.Forms.Panel(); 40 this.panel = new System.Windows.Forms.Panel(); 41 this.stopButton = new System.Windows.Forms.Button(); 39 42 this.cancelButton = new System.Windows.Forms.Button(); 40 this. panel = new System.Windows.Forms.Panel();43 this.borderPanel.SuspendLayout(); 41 44 this.panel.SuspendLayout(); 42 45 this.SuspendLayout(); … … 48 51 this.progressBar.Location = new System.Drawing.Point(3, 3); 49 52 this.progressBar.Name = "progressBar"; 50 this.progressBar.Size = new System.Drawing.Size(3 52, 23);53 this.progressBar.Size = new System.Drawing.Size(366, 23); 51 54 this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Marquee; 52 55 this.progressBar.TabIndex = 0; 53 56 // 54 // statusLabel57 // messageLabel 55 58 // 56 this.statusLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 59 this.messageLabel.Dock = System.Windows.Forms.DockStyle.Fill; 60 this.messageLabel.Location = new System.Drawing.Point(0, 0); 61 this.messageLabel.Name = "messageLabel"; 62 this.messageLabel.Padding = new System.Windows.Forms.Padding(0, 0, 3, 0); 63 this.messageLabel.Size = new System.Drawing.Size(217, 23); 64 this.messageLabel.TabIndex = 1; 65 this.messageLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 66 // 67 // borderPanel 68 // 69 this.borderPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 70 | System.Windows.Forms.AnchorStyles.Left) 57 71 | System.Windows.Forms.AnchorStyles.Right))); 58 this.statusLabel.Location = new System.Drawing.Point(3, 33); 59 this.statusLabel.Name = "statusLabel"; 60 this.statusLabel.Size = new System.Drawing.Size(352, 17); 61 this.statusLabel.TabIndex = 1; 72 this.borderPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 73 this.borderPanel.Controls.Add(this.panel); 74 this.borderPanel.Controls.Add(this.progressBar); 75 this.borderPanel.Location = new System.Drawing.Point(0, 0); 76 this.borderPanel.Name = "borderPanel"; 77 this.borderPanel.Size = new System.Drawing.Size(374, 62); 78 this.borderPanel.TabIndex = 3; 79 // 80 // panel 81 // 82 this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 83 | System.Windows.Forms.AnchorStyles.Right))); 84 this.panel.Controls.Add(this.messageLabel); 85 this.panel.Controls.Add(this.stopButton); 86 this.panel.Controls.Add(this.cancelButton); 87 this.panel.Location = new System.Drawing.Point(3, 32); 88 this.panel.Name = "panel"; 89 this.panel.Size = new System.Drawing.Size(367, 23); 90 this.panel.TabIndex = 4; 91 // 92 // stopButton 93 // 94 this.stopButton.Dock = System.Windows.Forms.DockStyle.Right; 95 this.stopButton.Location = new System.Drawing.Point(217, 0); 96 this.stopButton.Name = "stopButton"; 97 this.stopButton.Size = new System.Drawing.Size(75, 23); 98 this.stopButton.TabIndex = 3; 99 this.stopButton.Text = "Stop"; 100 this.stopButton.UseVisualStyleBackColor = true; 101 this.stopButton.Click += new System.EventHandler(this.stopButton_Click); 62 102 // 63 103 // cancelButton 64 104 // 65 this.cancelButton. Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));66 this.cancelButton.Location = new System.Drawing.Point(2 80, 53);105 this.cancelButton.Dock = System.Windows.Forms.DockStyle.Right; 106 this.cancelButton.Location = new System.Drawing.Point(292, 0); 67 107 this.cancelButton.Name = "cancelButton"; 68 108 this.cancelButton.Size = new System.Drawing.Size(75, 23); … … 72 112 this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); 73 113 // 74 // panel75 //76 this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)77 | System.Windows.Forms.AnchorStyles.Left)78 | System.Windows.Forms.AnchorStyles.Right)));79 this.panel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;80 this.panel.Controls.Add(this.progressBar);81 this.panel.Controls.Add(this.cancelButton);82 this.panel.Controls.Add(this.statusLabel);83 this.panel.Location = new System.Drawing.Point(0, 0);84 this.panel.Name = "panel";85 this.panel.Size = new System.Drawing.Size(360, 88);86 this.panel.TabIndex = 3;87 //88 114 // ProgressView 89 115 // 90 116 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 91 this.Controls.Add(this. panel);117 this.Controls.Add(this.borderPanel); 92 118 this.Name = "ProgressView"; 93 this.Size = new System.Drawing.Size(360, 88); 119 this.Size = new System.Drawing.Size(374, 62); 120 this.borderPanel.ResumeLayout(false); 94 121 this.panel.ResumeLayout(false); 95 122 this.ResumeLayout(false); … … 100 127 101 128 private System.Windows.Forms.ProgressBar progressBar; 102 private System.Windows.Forms.Label statusLabel; 129 private System.Windows.Forms.Label messageLabel; 130 private System.Windows.Forms.Panel borderPanel; 131 private System.Windows.Forms.Button stopButton; 132 private System.Windows.Forms.Panel panel; 103 133 private System.Windows.Forms.Button cancelButton; 104 private System.Windows.Forms.Panel panel;105 134 } 106 135 } -
stable/HeuristicLab.MainForm.WindowsForms/3.3/HeuristicLab.MainForm.WindowsForms-3.3.csproj
r11920 r17062 151 151 </Compile> 152 152 <Compile Include="Plugin.cs" /> 153 <Compile Include="Progress.cs" /> 153 154 <Compile Include="Views\AsynchronousContentView.cs"> 154 155 <SubType>UserControl</SubType> -
stable/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs
r15584 r17062 61 61 set { 62 62 if (InvokeRequired) { 63 Action<string> action = delegate (string s) { this.Title = s; };63 Action<string> action = delegate (string s) { this.Title = s; }; 64 64 Invoke(action, value); 65 65 } else … … 72 72 set { 73 73 if (InvokeRequired) { 74 Action<Cursor> action = delegate (Cursor c) { this.Cursor = c; };74 Action<Cursor> action = delegate (Cursor c) { this.Cursor = c; }; 75 75 Invoke(action, value); 76 76 } else … … 95 95 if (this.activeView != value) { 96 96 if (InvokeRequired) { 97 Action<IView> action = delegate (IView activeView) { this.ActiveView = activeView; };97 Action<IView> action = delegate (IView activeView) { this.ActiveView = activeView; }; 98 98 Invoke(action, value); 99 99 } else { … … 230 230 } 231 231 232 public IContentView ShowContent<T>(T content, bool reuseExistingView, IEqualityComparer<T> comparer = null) where T : class, IContent {232 public IContentView ShowContent<T>(T content, bool reuseExistingView, IEqualityComparer<T> comparer = null) where T : class, IContent { 233 233 if (content == null) throw new ArgumentNullException("Content cannot be null."); 234 234 if (!reuseExistingView) return ShowContent(content); … … 353 353 /// Adds a <see cref="ProgressView"/> to the <see cref="ContentView"/>s showing the specified content. 354 354 /// </summary> 355 public IProgress AddOperationProgressToContent(IContent content, string progressMessage, bool addToObjectGraphObjects = true) {355 internal void AddProgressToContent(IContent content, IProgress progress, bool addToObjectGraphObjects) { 356 356 if (InvokeRequired) { 357 I Progress result = (IProgress)Invoke((Func<IContent, string, bool, IProgress>)AddOperationProgressToContent, content, progressMessage, addToObjectGraphObjects);358 return result;357 Invoke((Action<IContent, IProgress, bool>)AddProgressToContent, content, progress, addToObjectGraphObjects); 358 return; 359 359 } 360 360 if (contentProgressLookup.ContainsKey(content)) … … 371 371 contentViews = contentViews.Where(v => v.Content == content); 372 372 373 var progress = new Progress(progressMessage, ProgressState.Started);374 373 foreach (var contentView in contentViews) { 375 374 progressViews.Add(new ProgressView(contentView, progress)); … … 377 376 378 377 contentProgressLookup[content] = progress; 379 return progress;380 378 } 381 379 … … 383 381 /// Adds a <see cref="ProgressView"/> to the specified view. 384 382 /// </summary> 385 public IProgress AddOperationProgressToView(Control control, string progressMessage) { 386 var progress = new Progress(progressMessage, ProgressState.Started); 387 AddOperationProgressToView(control, progress); 388 return progress; 389 } 390 391 public void AddOperationProgressToView(Control control, IProgress progress) { 383 internal void AddProgressToControl(Control control, IProgress progress) { 392 384 if (InvokeRequired) { 393 Invoke((Action<Control, IProgress>)Add OperationProgressToView, control, progress);385 Invoke((Action<Control, IProgress>)AddProgressToControl, control, progress); 394 386 return; 395 387 } … … 413 405 /// Removes an existing <see cref="ProgressView"/> from the <see cref="ContentView"/>s showing the specified content. 414 406 /// </summary> 415 public void RemoveOperationProgressFromContent(IContent content, bool finishProgress = true) {407 internal void RemoveProgressFromContent(IContent content, bool finishProgress) { 416 408 if (InvokeRequired) { 417 Invoke((Action<IContent, bool>)Remove OperationProgressFromContent, content, finishProgress);409 Invoke((Action<IContent, bool>)RemoveProgressFromContent, content, finishProgress); 418 410 return; 419 411 } … … 429 421 } 430 422 contentProgressLookup.Remove(content); 431 432 423 } 433 424 … … 435 426 /// Removes an existing <see cref="ProgressView"/> from the specified view. 436 427 /// </summary> 437 public void RemoveOperationProgressFromView(Control control, bool finishProgress = true) {428 internal void RemoveProgressFromControl(Control control, bool finishProgress) { 438 429 if (InvokeRequired) { 439 Invoke((Action<Control, bool>)Remove OperationProgressFromView, control, finishProgress);430 Invoke((Action<Control, bool>)RemoveProgressFromControl, control, finishProgress); 440 431 return; 441 432 } … … 560 551 try { 561 552 ((IActionUserInterfaceItem)item.Tag).Execute(); 562 } 563 catch (Exception ex) { 553 } catch (Exception ex) { 564 554 ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, ex); 565 555 } -
stable/HeuristicLab.MainForm/3.3/HeuristicLab.MainForm-3.3.csproj
r11920 r17062 124 124 <Compile Include="Interfaces\IProgress.cs" /> 125 125 <Compile Include="Plugin.cs" /> 126 <Compile Include="Progress.cs" />127 126 <Compile Include="ViewAttribute.cs" /> 128 127 <Compile Include="Interfaces\IContentView.cs" /> -
stable/HeuristicLab.MainForm/3.3/Interfaces/IProgress.cs
r15584 r17062 24 24 25 25 namespace HeuristicLab.MainForm { 26 public enum ProgressState { Started = 1, Canceled = 2, Finished = 3 }; 26 public enum ProgressState { Started, Finished, StopRequested, CancelRequested } 27 public enum ProgressMode { Determinate, Indeterminate } 27 28 28 29 public interface IProgress : IContent { 30 ProgressState ProgressState { get; } 31 32 string Message { get; set; } 33 34 ProgressMode ProgressMode { get; set; } 29 35 /// <summary> 30 /// Gets or sets the currently associated status text with the progress. 36 /// Gets or sets the currently associated progress value in the range [0;1] (values outside the range are truncated). 37 /// Changing the ProgressValue when <c>ProgressMode</c> is <c>Indeterminate</c> raises an Exception. 31 38 /// </summary> 32 string Status { get; set; } 33 /// <summary> 34 /// Gets or sets the currently associated progress value in the range (0;1]. 35 /// Values outside this range are permitted and need to be handled in some feasible manner. 36 /// </summary> 39 /// <exception cref="InvalidOperationException">Setting the ProgressValue-property while in the Indeterminate state is invalid.</exception> 37 40 double ProgressValue { get; set; } 38 /// <summary>39 /// Gets or sets the current state of the progress. Every progress starts in state40 /// Started and then becomes either Canceled or Finished.41 /// If it is reused it may be Started again.42 /// </summary>43 ProgressState ProgressState { get; }44 /// <summary>45 /// Returns whether the operation can be canceled or not.46 /// This can change during the course of the progress.47 /// </summary>48 bool CanBeCanceled { get; }49 41 50 /// <summary>51 /// Requests the operation behind the process to cancel.52 /// Check the !ProgressState property when the cancellation succeeded. 53 /// The corresponding event will also notify of a success.54 /// </summary>55 /// <exception cref="NotSupportedException">Thrown when cancellation is not supported.</exception>42 bool CanBeStopped { get; set; } 43 bool CanBeCanceled { get; set; } 44 45 void Start(string message, ProgressMode mode = ProgressMode.Determinate); 46 void Finish(); 47 void Stop(); 56 48 void Cancel(); 57 /// <summary>58 /// Sets the ProgressValue to 1 and the ProgressState to Finished.59 /// </summary>60 void Finish();61 49 62 /// <summary> 63 /// Starts or restarts a Progress. 64 /// </summary> 65 void Start(); 66 67 void Start(string status); 68 69 /// <summary> 70 /// The status text changed. 71 /// </summary> 72 event EventHandler StatusChanged; 73 /// <summary> 74 /// The value of the progress changed. This is the (0;1] progress value from starting to finish. Values outside this range are permitted and need to be handled in some feasible manner. 75 /// </summary> 50 event EventHandler ProgressStateChanged; 51 event EventHandler MessageChanged; 52 event EventHandler ProgressBarModeChanged; 76 53 event EventHandler ProgressValueChanged; 77 /// <summary> 78 /// The state of the progress changed. The handler is supposed to query the ProgressState property. 79 /// </summary> 80 event EventHandler ProgressStateChanged; 81 /// <summary> 82 /// The progress' ability to cancel changed. 83 /// </summary> 54 event EventHandler CanBeStoppedChanged; 84 55 event EventHandler CanBeCanceledChanged; 85 /// <summary> 86 /// A cancelation is requested. 87 /// </summary> 56 event EventHandler StopRequested; 88 57 event EventHandler CancelRequested; 89 58 } -
stable/HeuristicLab.Optimization
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Optimization merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Optimization merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Optimization.Views merged: 15940,16356,16389,16430 /trunk/sources/HeuristicLab.Optimization.Views merged: 15566,15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization/3.3/Problems/SingleObjectiveHeuristicOptimizationProblem.cs
-
stable/HeuristicLab.Optimizer
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Optimizer merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Optimizer merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimizer/3.3/FileManager.cs
r15584 r17062 78 78 if (view == null) 79 79 ErrorHandling.ShowErrorDialog("There is no view for the loaded item. It cannot be displayed.", new InvalidOperationException("No View Available")); 80 } 81 catch (Exception ex) { 80 } catch (Exception ex) { 82 81 ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, "Cannot open file.", ex); 83 } 84 finally { 82 } finally { 85 83 ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).ResetAppStartingCursor(); 86 84 } … … 145 143 if (error != null) throw error; 146 144 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().UpdateTitle(); 147 } 148 catch (Exception ex) { 145 } catch (Exception ex) { 149 146 ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, "Cannot save file.", ex); 150 } 151 finally { 147 } finally { 152 148 SetSaveOperationProgressInContentViews(content, false); 153 149 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().ResetAppStartingCursor(); … … 161 157 mainForm.Invoke((Action)delegate { 162 158 if (showProgress) { 163 mainForm.AddOperationProgressToContent(content, string.Format("Saving to file \"{0}\"...", Path.GetFileName(fileName ?? content.Filename)));159 Progress.Show(content, string.Format("Saving to file \"{0}\"...", Path.GetFileName(fileName ?? content.Filename))); 164 160 } else 165 mainForm.RemoveOperationProgressFromContent(content);161 Progress.Hide(content); 166 162 }); 167 163 #endregion -
stable/HeuristicLab.Optimizer/3.3/StartPage.cs
r15584 r17062 88 88 89 89 private void LoadSamples(object state) { 90 progress = MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(samplesListView, "Loading...");90 progress = Progress.ShowOnControl(samplesListView, "Loading..."); 91 91 try { 92 92 var assembly = Assembly.GetExecutingAssembly(); … … 112 112 OnAllSamplesLoaded(); 113 113 } finally { 114 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(samplesListView);114 Progress.HideFromControl(samplesListView); 115 115 } 116 116 } … … 138 138 }; 139 139 groupLookup[standardProblemsGroup] = standardProblems; 140 var dataAnalysisProblems = new List<string> { "ALPSGP_SymReg", "SGP_SymbClass", "SGP_SymbReg", "OSGP_SymReg", "OSGP_TimeSeries", "GE_SymbReg", "GPR" };140 var dataAnalysisProblems = new List<string> { "ALPSGP_SymReg", "SGP_SymbClass", "SGP_SymbReg", "OSGP_SymReg", "OSGP_TimeSeries", "GE_SymbReg", "GPR" }; 141 141 groupLookup[dataAnalysisGroup] = dataAnalysisProblems; 142 142 var scripts = new List<string> { "GA_QAP_Script", "GUI_Automation_Script", "OSGA_Rastrigin_Script", -
stable/HeuristicLab.Persistence
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Persistence merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Persistence merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.BinPacking
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.BinPacking merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.BinPacking merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.BinPacking.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.BinPacking.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.BinPacking.Views merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.DataAnalysis merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicClassificationSolutionView.cs
r15584 r17062 60 60 var name = exportFileDialog.FileName; 61 61 using (BackgroundWorker bg = new BackgroundWorker()) { 62 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Exportion solution to " + name + ".");62 Progress.Show(this, "Exportion solution to " + name + ".", ProgressMode.Indeterminate); 63 63 bg.DoWork += (o, a) => exporter.Export(Content, name); 64 bg.RunWorkerCompleted += (o, a) => MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);64 bg.RunWorkerCompleted += (o, a) => Progress.Hide(this); 65 65 bg.RunWorkerAsync(); 66 66 } -
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicDiscriminantFunctionClassificationSolutionView.cs
r15584 r17062 59 59 var name = exportFileDialog.FileName; 60 60 using (BackgroundWorker bg = new BackgroundWorker()) { 61 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Exportion solution to " + name + ".");61 Progress.Show(this, "Exportion solution to " + name + ".", ProgressMode.Indeterminate); 62 62 bg.DoWork += (o, a) => exporter.Export(Content, name); 63 bg.RunWorkerCompleted += (o, a) => MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);63 bg.RunWorkerCompleted += (o, a) => Progress.Hide(this); 64 64 bg.RunWorkerAsync(); 65 65 } -
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression merged: 15581,15583,15589,15611
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs
r15584 r17062 61 61 var name = exportFileDialog.FileName; 62 62 using (BackgroundWorker bg = new BackgroundWorker()) { 63 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Exporting solution to " + name + ".");63 Progress.Show(this, "Exporting solution to " + name + ".", ProgressMode.Indeterminate); 64 64 bg.DoWork += (o, a) => exporter.Export(Content, name); 65 bg.RunWorkerCompleted += (o, a) => MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);65 bg.RunWorkerCompleted += (o, a) => Progress.Hide(this); 66 66 bg.RunWorkerAsync(); 67 67 } -
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4 merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4 merged: 15581,15583,15589,15611
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r15584 r17062 24 24 using System.Drawing; 25 25 using System.Linq; 26 using System.Threading; 26 27 using System.Threading.Tasks; 27 28 using System.Windows.Forms; … … 40 41 private readonly ISymbolicDataAnalysisSolutionImpactValuesCalculator impactCalculator; 41 42 42 private readonly IProgress progress = new Progress(); 43 private readonly Progress progress = new Progress(); 44 private CancellationTokenSource cancellationTokenSource; 43 45 44 46 private enum TreeState { Valid, Invalid } … … 152 154 Content.ProblemDataChanged += Content_Changed; 153 155 treeChart.Repainted += treeChart_Repainted; 154 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(grpSimplify, progress); 156 Progress.ShowOnControl(grpSimplify, progress); 157 progress.StopRequested += progress_StopRequested; 155 158 } 156 159 protected override void DeregisterContentEvents() { … … 159 162 Content.ProblemDataChanged -= Content_Changed; 160 163 treeChart.Repainted -= treeChart_Repainted; 161 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(grpSimplify, false); 164 Progress.HideFromControl(grpSimplify, false); 165 progress.StopRequested -= progress_StopRequested; 162 166 } 163 167 … … 178 182 } 179 183 184 private void progress_StopRequested(object sender, EventArgs e) { 185 cancellationTokenSource.Cancel(); 186 } 187 180 188 private async void UpdateView() { 181 189 if (Content == null || Content.Model == null || Content.ProblemData == null) return; … … 184 192 185 193 progress.Start("Calculate Impact and Replacement Values ..."); 194 progress.CanBeStopped = true; 195 cancellationTokenSource = new CancellationTokenSource(); 186 196 var impactAndReplacementValues = await Task.Run(() => CalculateImpactAndReplacementValues(tree)); 187 await Task.Delay(500); // wait for progressbar to finish animation 197 try { 198 await Task.Delay(500, cancellationTokenSource.Token); // wait for progressbar to finish animation 199 } catch (OperationCanceledException) { } 188 200 var replacementValues = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item2); 189 201 foreach (var pair in replacementValues.Where(pair => !(pair.Key is ConstantTreeNode))) { … … 192 204 nodeImpacts = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item1); 193 205 progress.Finish(); 206 progress.CanBeStopped = false; 194 207 PaintNodeImpacts(); 195 208 } … … 198 211 var impactAndReplacementValues = new Dictionary<ISymbolicExpressionTreeNode, Tuple<double, double>>(); 199 212 foreach (var node in tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix()) { 213 if (progress.ProgressState == ProgressState.StopRequested) continue; 200 214 double impactValue, replacementValue, newQualityForImpactsCalculation; 201 215 impactCalculator.CalculateImpactAndReplacementValues(Content.Model, node, Content.ProblemData, Content.ProblemData.TrainingIndices, out impactValue, out replacementValue, out newQualityForImpactsCalculation); -
stable/HeuristicLab.Problems.DataAnalysis.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionVariableImpactsView.cs
r16438 r17062 120 120 121 121 //Prepare arguments 122 var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;123 122 var replMethod = (ClassificationSolutionVariableImpactsCalculator.ReplacementMethodEnum)replacementComboBox.Items[replacementComboBox.SelectedIndex]; 124 123 var factorReplMethod = (ClassificationSolutionVariableImpactsCalculator.FactorReplacementMethodEnum)factorVarReplComboBox.Items[factorVarReplComboBox.SelectedIndex]; … … 126 125 127 126 variableImpactsArrayView.Caption = Content.Name + " Variable Impacts"; 128 progress = mainForm.AddOperationProgressToView(this, "Calculating variable impacts for " + Content.Name); 129 progress.ProgressValue = 0; 130 127 progress = Progress.Show(this, "Calculating variable impacts for " + Content.Name); 131 128 cancellationToken = new CancellationTokenSource(); 132 129 … … 146 143 rawVariableImpacts.AddRange(impacts); 147 144 UpdateOrdering(); 148 } 149 finally { 150 ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).RemoveOperationProgressFromView(this); 145 } finally { 146 Progress.Hide(this); 151 147 } 152 148 } … … 175 171 if (cancellationToken.Token.IsCancellationRequested) { return null; } 176 172 progress.ProgressValue = (double)++i / count; 177 progress. Status= string.Format("Calculating impact for variable {0} ({1} of {2})", variableName, i, count);173 progress.Message = string.Format("Calculating impact for variable {0} ({1} of {2})", variableName, i, count); 178 174 179 175 double impact = 0; -
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/MenuItems/ShrinkDataAnalysisRunsMenuItem.cs
r15584 r17062 72 72 public override void Execute() { 73 73 IContentView activeView = (IContentView)MainFormManager.MainForm.ActiveView; 74 var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;75 mainForm.AddOperationProgressToContent(activeView.Content, "Removing duplicate datasets.");74 var content = activeView.Content; 75 Progress.Show(content, "Removing duplicate datasets.", ProgressMode.Indeterminate); 76 76 77 77 Action<IContentView> action = (view) => DatasetUtil.RemoveDuplicateDatasets(view.Content); … … 79 79 action.BeginInvoke(activeView, delegate (IAsyncResult result) { 80 80 action.EndInvoke(result); 81 mainForm.RemoveOperationProgressFromContent(activeView.Content);81 Progress.Hide(content); 82 82 }, null); 83 83 } -
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionVariableImpactsView.cs
r16438 r17062 111 111 112 112 private async void UpdateVariableImpact() { 113 IProgress progress;114 115 113 //Check if the selection is valid 116 114 if (Content == null) { return; } … … 120 118 121 119 //Prepare arguments 122 var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;123 120 var replMethod = (RegressionSolutionVariableImpactsCalculator.ReplacementMethodEnum)replacementComboBox.Items[replacementComboBox.SelectedIndex]; 124 121 var factorReplMethod = (RegressionSolutionVariableImpactsCalculator.FactorReplacementMethodEnum)factorVarReplComboBox.Items[factorVarReplComboBox.SelectedIndex]; … … 126 123 127 124 variableImpactsArrayView.Caption = Content.Name + " Variable Impacts"; 128 progress = mainForm.AddOperationProgressToView(this, "Calculating variable impacts for " + Content.Name); 129 progress.ProgressValue = 0; 130 125 var progress = Progress.Show(this, "Calculating variable impacts for " + Content.Name); 131 126 cancellationToken = new CancellationTokenSource(); 132 127 … … 148 143 } 149 144 finally { 150 ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).RemoveOperationProgressFromView(this);145 Progress.Hide(this); 151 146 } 152 147 } … … 175 170 if (cancellationToken.Token.IsCancellationRequested) { return null; } 176 171 progress.ProgressValue = (double)++i / count; 177 progress. Status= string.Format("Calculating impact for variable {0} ({1} of {2})", variableName, i, count);172 progress.Message = string.Format("Calculating impact for variable {0} ({1} of {2})", variableName, i, count); 178 173 179 174 double impact = 0; -
stable/HeuristicLab.Problems.DataAnalysis/3.4
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.GrammaticalEvolution
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.GrammaticalEvolution merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.GrammaticalEvolution merged: 15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.Instances
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.Instances merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.Instances merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.Instances.DataAnalysis
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.Instances.DataAnalysis merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.Instances.DataAnalysis.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.Instances.DataAnalysis.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionInstanceProviderView.cs
r15584 r17062 46 46 47 47 Task.Factory.StartNew(() => { 48 var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm; 48 var activeView = (IContentView)MainFormManager.MainForm.ActiveView; 49 var content = activeView.Content; 49 50 // lock active view and show progress bar 50 IContentView activeView = (IContentView)MainFormManager.MainForm.ActiveView; 51 try { 52 var progress = Progress.Show(content, "Loading problem instance."); 51 53 52 try { 53 var progress = mainForm.AddOperationProgressToContent(activeView.Content, 54 "Loading problem instance."); 54 Content.ProgressChanged += (o, args) => { progress.ProgressValue = args.ProgressPercentage / 100.0; }; 55 55 56 Content.ProgressChanged += 57 (o, args) => { progress.ProgressValue = args.ProgressPercentage / 100.0; }; 58 59 instance = Content.ImportData(importTypeDialog.Path, importTypeDialog.ImportType, 60 importTypeDialog.CSVFormat); 56 instance = Content.ImportData(importTypeDialog.Path, importTypeDialog.ImportType, importTypeDialog.CSVFormat); 61 57 } catch (Exception ex) { 62 58 ErrorWhileParsing(ex); 63 59 return; 64 60 } finally { 65 mainForm.RemoveOperationProgressFromContent(activeView.Content);61 Progress.Hide(content); 66 62 } 67 63 -
stable/HeuristicLab.Problems.Instances.TSPLIB.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.Instances.TSPLIB.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.Instances.TSPLIB.Views merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.Instances.Views/3.3/ProblemInstanceProviderViewGeneric.cs
r15584 r17062 121 121 122 122 IContentView activeView = (IContentView)MainFormManager.MainForm.ActiveView; 123 var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;123 var content = activeView.Content; 124 124 // lock active view and show progress bar 125 mainForm.AddOperationProgressToContent(activeView.Content, "Loading problem instance.");125 Progress.Show(content, "Loading problem instance.", ProgressMode.Indeterminate); 126 126 127 127 Task.Factory.StartNew(() => { … … 131 131 } catch (Exception ex) { 132 132 ErrorHandling.ShowErrorDialog(String.Format("Could not load the problem instance {0}", descriptor.Name), ex); 133 mainForm.RemoveOperationProgressFromContent(activeView.Content);133 Progress.Hide(content); 134 134 return; 135 135 } … … 139 139 ErrorHandling.ShowErrorDialog(String.Format("This problem does not support loading the instance {0}", descriptor.Name), ex); 140 140 } finally { 141 mainForm.RemoveOperationProgressFromContent(activeView.Content);141 Progress.Hide(content); 142 142 } 143 143 }); -
stable/HeuristicLab.Problems.QuadraticAssignment
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.QuadraticAssignment merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.QuadraticAssignment merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.QuadraticAssignment.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.QuadraticAssignment.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.QuadraticAssignment.Views merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.TestFunctions
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.TestFunctions merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.TestFunctions merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.TravelingSalesman.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.TravelingSalesman.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.VehicleRouting merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.VehicleRouting merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.VehicleRouting.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.VehicleRouting.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Problems.VehicleRouting.Views merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Random
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Random merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Scripting.Views/3.3/ScriptView.cs
r16832 r17062 180 180 181 181 private void AddProgressView(string progressMessage) { 182 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 183 mainForm.AddOperationProgressToView(this, progressMessage); 182 Progress.Show(this, progressMessage, ProgressMode.Indeterminate); 184 183 progressViewCreated = true; 185 184 } … … 187 186 private void RemoveProgressView() { 188 187 if (!progressViewCreated) return; 189 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 190 mainForm.RemoveOperationProgressFromView(this); 188 Progress.Hide(this); 191 189 progressViewCreated = false; 192 190 } -
stable/HeuristicLab.Services.Access
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Services.Access merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.Access.DataAccess
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Services.Access.DataAccess merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.Deployment
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Services.Deployment merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.Deployment.DataAccess
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Services.Deployment.DataAccess merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.Hive
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Services.Hive merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Services.Hive merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.Hive.DataAccess
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Services.Hive.DataAccess merged: 16356,16389,16430 /trunk/sources/HeuristicLab.Services.Hive.DataAccess merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.Hive.JanitorService
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Services.Hive.JanitorService merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.Hive.Web
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Services.Hive.Web merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.OKB
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Services.OKB merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.OKB.DataAccess
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Services.OKB.DataAccess merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.WebApp
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Services.WebApp merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.WebApp.Maintenance
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Services.WebApp.Maintenance merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Services.WebApp.Statistics
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Services.WebApp.Statistics merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Tests
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Tests merged: 16206-16207,16213,16283,16294,16298,16356-16358,16366,16389,16430 /trunk/sources/HeuristicLab.Tests merged: 15581,15583
- Property svn:mergeinfo changed
Note: See TracChangeset
for help on using the changeset viewer.