Changeset 8156
- Timestamp:
- 06/28/12 18:49:22 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs
r8145 r8156 69 69 imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.MonitorLarge); 70 70 imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.NetworkCenterLarge); 71 progressView = new ProgressView(this);72 71 } 73 72 … … 78 77 currentProgress = new Progress(); 79 78 currentProgress.Status = "Downloading resources. Please be patient."; 79 if (progressView == null) { 80 progressView = new ProgressView(this); 81 } 80 82 progressView.Progress = currentProgress; 81 83 } -
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r8146 r8156 464 464 Invoke(new EventHandler(Content_IsProgressingChanged), sender, e); 465 465 } else { 466 if (Content != null && Content. IsProgressing) {466 if (Content != null && Content.Progress != null && Content.IsProgressing) { 467 467 SetProgressView(); 468 468 } else { 469 FinishProgressView();469 progressView.Progress = null; 470 470 } 471 471 } -
trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r8109 r8156 258 258 private void UploadJob(RefreshableJob refreshableJob, CancellationToken cancellationToken) { 259 259 try { 260 refreshableJob.IsProgressing = true; 260 261 refreshableJob.Progress = new Progress("Connecting to server..."); 261 refreshableJob.IsProgressing = true;262 263 262 IEnumerable<string> resourceNames = ToResourceNameList(refreshableJob.Job.ResourceNames); 264 263 var resourceIds = new List<Guid>(); … … 316 315 } 317 316 finally { 317 refreshableJob.Progress.Finish(); 318 318 refreshableJob.IsProgressing = false; 319 319 } … … 427 427 public static void LoadJob(RefreshableJob refreshableJob) { 428 428 var hiveExperiment = refreshableJob.Job; 429 refreshableJob.IsProgressing = true; 429 430 refreshableJob.Progress = new Progress(); 430 431 431 432 try { 432 refreshableJob.IsProgressing = true;433 433 int totalJobCount = 0; 434 434 IEnumerable<LightweightTask> allTasks; … … 471 471 } 472 472 finally { 473 refreshableJob.Progress.Finish(); 473 474 refreshableJob.IsProgressing = false; 474 475 } -
trunk/sources/HeuristicLab.Clients.Hive/3.3/RefreshableJob.cs
r8090 r8156 31 31 32 32 namespace HeuristicLab.Clients.Hive { 33 public class RefreshableJob : IHiveItem, IDeepCloneable, IContent, I ProgressReporter, IComparable<RefreshableJob> {33 public class RefreshableJob : IHiveItem, IDeepCloneable, IContent, IComparable<RefreshableJob> { 34 34 private JobResultPoller jobResultPoller; 35 35 private ConcurrentTaskDownloader<ItemTask> jobDownloader; 36 36 private static object locker = new object(); 37 38 public bool IsProgressing { get; set; } 37 39 38 40 private Job job; … … 165 167 } 166 168 167 private bool isProgressing;168 public bool IsProgressing {169 get { return isProgressing; }170 set {171 if (isProgressing != value) {172 isProgressing = value;173 OnIsProgressingChanged();174 }175 }176 }177 178 169 private IProgress progress; 179 170 public IProgress Progress { 180 171 get { return progress; } 181 set { this.progress = value; } 182 } 172 set { 173 this.progress = value; 174 OnIsProgressingChanged(); 175 } 176 } 177 183 178 184 179 private ThreadSafeLog log; … … 229 224 230 225 #region JobResultPoller Events 231 232 226 public void StartResultPolling() { 233 227 if (jobResultPoller == null) { … … 410 404 } 411 405 412 public event EventHandler IsProgressingChanged;413 protected virtual void OnIsProgressingChanged() {414 var handler = IsProgressingChanged;415 if (handler != null) handler(this, EventArgs.Empty);416 }417 418 406 public event EventHandler IsDownloadableChanged; 419 407 private void OnIsDownloadableChanged() { … … 473 461 protected virtual void OnTaskReceived() { 474 462 var handler = TaskReceived; 463 if (handler != null) handler(this, EventArgs.Empty); 464 } 465 public event EventHandler IsProgressingChanged; 466 private void OnIsProgressingChanged() { 467 var handler = IsProgressingChanged; 475 468 if (handler != null) handler(this, EventArgs.Empty); 476 469 } -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Views/ProgressView.cs
r8145 r8156 32 32 set { 33 33 if (progress == value) return; 34 DeregisterProgressEvents();34 Finish(); 35 35 progress = value; 36 36 RegisterProgressEvents(); … … 50 50 51 51 private void ShowProgress() { 52 this.Left = (parentView.ClientRectangle.Width / 2) - (this.Width / 2); 53 this.Top = (parentView.ClientRectangle.Height / 2) - (this.Height / 2); 54 this.Anchor = AnchorStyles.Left | AnchorStyles.Top; 52 if (progress != null) { 53 this.Left = (parentView.ClientRectangle.Width / 2) - (this.Width / 2); 54 this.Top = (parentView.ClientRectangle.Height / 2) - (this.Height / 2); 55 this.Anchor = AnchorStyles.Left | AnchorStyles.Top; 55 56 56 LockBackground();57 LockBackground(); 57 58 58 if (!parentView.Controls.Contains(this)) { 59 parentView.Controls.Add(this); 59 if (!parentView.Controls.Contains(this)) { 60 parentView.Controls.Add(this); 61 } 62 63 BringToFront(); 64 Visible = true; 60 65 } 61 62 BringToFront();63 Visible = true;64 66 } 65 67 … … 123 125 if (InvokeRequired) Invoke((Action)UpdateProgressValue); 124 126 else { 125 double progressValue = progress.ProgressValue; 126 if (progressValue < progressBar.Minimum || progressValue > progressBar.Maximum) { 127 progressBar.Style = ProgressBarStyle.Marquee; 128 progressBar.Value = progressBar.Minimum; 129 } else { 130 progressBar.Style = ProgressBarStyle.Blocks; 131 progressBar.Value = (int)Math.Round(progressBar.Minimum + progressValue * (progressBar.Maximum - progressBar.Minimum)); 127 if (progress != null) { 128 double progressValue = progress.ProgressValue; 129 if (progressValue < progressBar.Minimum || progressValue > progressBar.Maximum) { 130 progressBar.Style = ProgressBarStyle.Marquee; 131 progressBar.Value = progressBar.Minimum; 132 } else { 133 progressBar.Style = ProgressBarStyle.Blocks; 134 progressBar.Value = (int)Math.Round(progressBar.Minimum + progressValue * (progressBar.Maximum - progressBar.Minimum)); 135 } 132 136 } 133 137 } … … 137 141 if (InvokeRequired) Invoke((Action)UpdateProgressStatus); 138 142 else { 139 string status = progress.Status; 140 statusLabel.Text = progress.Status; 143 if (progress != null) { 144 string status = progress.Status; 145 statusLabel.Text = progress.Status; 146 } 141 147 } 142 148 } -
trunk/sources/HeuristicLab.MainForm/3.3/HeuristicLab.MainForm-3.3.csproj
r7582 r8156 117 117 <Compile Include="Interfaces\IConfigureableView.cs" /> 118 118 <Compile Include="Interfaces\IProgress.cs" /> 119 <Compile Include="Interfaces\IProgressReporter.cs" />120 119 <Compile Include="Plugin.cs" /> 121 120 <Compile Include="Progress.cs" /> -
trunk/sources/HeuristicLab.MainForm/3.3/Interfaces/IProgress.cs
r8145 r8156 30 30 void SignalSuccessfulCancelation(); 31 31 32 bool CancelRequested { get; set; } 33 32 34 event EventHandler Finished; 33 35 event EventHandler StatusChanged; 34 36 event EventHandler ProgressValueChanged; 35 36 bool CancelRequested { get; set; }37 37 event EventHandler Canceled; 38 39 40 38 } 41 39 }
Note: See TracChangeset
for help on using the changeset viewer.