- Timestamp:
- 03/05/14 14:48:13 (10 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing
- Property svn:mergeinfo changed
-
branches/DataPreprocessing/HeuristicLab.Problems.Scheduling.Views/3.3/JobShopSchedulingProblemView.Designer.cs
r10000 r10538 60 60 this.SuspendLayout(); 61 61 // 62 // problemInstanceSplitContainer63 //64 this.problemInstanceSplitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));65 this.problemInstanceSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;66 //67 62 // problemInstanceSplitContainer.Panel2 68 63 // 69 64 this.problemInstanceSplitContainer.Panel2.Controls.Add(this.problemTabControl); 70 //71 // ProblemInstanceConsumerViewHost72 //73 this.problemInstanceProviderViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));74 this.problemInstanceProviderViewHost.Dock = System.Windows.Forms.DockStyle.Fill;75 this.problemInstanceProviderViewHost.Location = new System.Drawing.Point(0, 0);76 this.problemInstanceProviderViewHost.Size = new System.Drawing.Size(511, 26);77 65 // 78 66 // parameterCollectionView -
branches/DataPreprocessing/HeuristicLab.Problems.Scheduling.Views/3.3/JobShopSchedulingProblemView.cs
r9456 r10538 20 20 #endregion 21 21 22 using System; 22 23 using System.Windows.Forms; 24 using HeuristicLab.Collections; 25 using HeuristicLab.Encodings.ScheduleEncoding; 23 26 using HeuristicLab.MainForm; 24 27 using HeuristicLab.Optimization.Views; … … 43 46 protected override void OnContentChanged() { 44 47 base.OnContentChanged(); 45 if (Content == null) { 46 ganttChart.Reset(); 47 } else { 48 FillGanttChart(Content); 48 FillGanttChart(); 49 } 50 51 protected override void DeregisterContentEvents() { 52 Content.JobDataParameter.ValueChanged -= JobDataParameterOnValueChanged; 53 Content.JobData.ItemsAdded -= JobsOnChanged; 54 Content.JobData.ItemsRemoved -= JobsOnChanged; 55 Content.JobData.ItemsReplaced -= JobsOnChanged; 56 Content.JobData.CollectionReset -= JobsOnChanged; 57 foreach (var job in Content.JobData) { 58 job.TasksChanged -= JobOnTasksChanged; 59 } 60 base.DeregisterContentEvents(); 61 } 62 protected override void RegisterContentEvents() { 63 base.RegisterContentEvents(); 64 Content.JobDataParameter.ValueChanged += JobDataParameterOnValueChanged; 65 Content.JobData.ItemsAdded += JobsOnChanged; 66 Content.JobData.ItemsRemoved += JobsOnChanged; 67 Content.JobData.ItemsReplaced += JobsOnChanged; 68 Content.JobData.CollectionReset += JobsOnChanged; 69 foreach (var job in Content.JobData) { 70 job.TasksChanged += JobOnTasksChanged; 49 71 } 50 72 } 51 73 52 private void FillGanttChart(JobShopSchedulingProblem content) { 74 private void JobsOnChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<Job>> e) { 75 foreach (var job in e.OldItems) 76 job.Value.TasksChanged -= JobOnTasksChanged; 77 foreach (var job in e.Items) 78 job.Value.TasksChanged += JobOnTasksChanged; 79 FillGanttChart(); 80 } 81 82 private void JobDataParameterOnValueChanged(object sender, EventArgs e) { 83 Content.JobData.ItemsAdded += JobsOnChanged; 84 Content.JobData.ItemsRemoved += JobsOnChanged; 85 Content.JobData.ItemsReplaced += JobsOnChanged; 86 Content.JobData.CollectionReset += JobsOnChanged; 87 foreach (var job in Content.JobData) { 88 job.TasksChanged += JobOnTasksChanged; 89 } 90 FillGanttChart(); 91 } 92 93 private void JobOnTasksChanged(object sender, EventArgs e) { 94 FillGanttChart(); 95 } 96 97 private void FillGanttChart() { 53 98 ganttChart.Reset(); 99 if (Content == null) return; 54 100 int jobCount = 0; 55 foreach (var j in content.JobData) {101 foreach (var j in Content.JobData) { 56 102 double lastEndTime = 0; 57 foreach (var t in content.JobData[jobCount].Tasks) {103 foreach (var t in Content.JobData[jobCount].Tasks) { 58 104 int categoryNr = t.JobNr; 59 105 string categoryName = "Job" + categoryNr; … … 63 109 lastEndTime + 1, 64 110 lastEndTime + t.Duration, 65 "Job" + t.JobNr + " - " + "Task#" + t.TaskNr .ToString());111 "Job" + t.JobNr + " - " + "Task#" + t.TaskNr); 66 112 lastEndTime += t.Duration; 67 113 }
Note: See TracChangeset
for help on using the changeset viewer.