Fisheye: Tag 6759 refers to a dead (removed) revision in file `DamClients/DamUI/trunk/src/Dam/Forms/WaterBoardPropertyControl.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: DamClients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs =================================================================== diff -u -r6755 -r6759 --- DamClients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs (.../DamPlugin.cs) (revision 6755) +++ DamClients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs (.../DamPlugin.cs) (revision 6759) @@ -133,7 +133,7 @@ private readonly LocationPropertyControl locationPropertyControl = new LocationPropertyControl(); private readonly DamSurfaceLineControl damSurfaceLineControl = new DamSurfaceLineControl(); private readonly DamProjectCalculationSpecificationPropertyControl damProjectCalculationSpecificationPropertyControl = new DamProjectCalculationSpecificationPropertyControl(); - private readonly WaterBoardPropertyControl waterBoardPropertyControl = new WaterBoardPropertyControl(); + private readonly DikePropertyControl dikePropertyControl = new DikePropertyControl(); private readonly BarButtonItem showCalculationOptionsItem = new BarButtonItem(); private readonly MapEditor mapControl = new MapEditor(); private MainForm mainForm; @@ -482,10 +482,8 @@ dpc.BuildPropertyControlTabForTypes(new LocationScenariosControl(), typeof(Location), typeof(LocationJob)); dpc.BuildPropertyControlTabForTypes(damSurfaceLineControl, typeof(SurfaceLine2), typeof(CharacteristicPoint), typeof(LocationJob)); - progressDelegate = waterBoardPropertyControl.DoProgress; - dpc.BuildPropertyControlTabForTypes(waterBoardPropertyControl, - typeof(WaterBoard), typeof(WaterBoardJob), typeof(DamProjectData)); - dpc.BuildPropertyControlTabForTypes(new DikePropertyControl(), typeof(Dike), typeof(DikeJob)); + progressDelegate = dikePropertyControl.DoProgress; + dpc.BuildPropertyControlTabForTypes(dikePropertyControl, typeof(Dike), typeof(DikeJob)); dpc.BuildPropertyControlTabForTypes(damProjectCalculationSpecificationPropertyControl, typeof(DamProjectData)); dpc.BuildPropertyControlTabForTypes(designCalculationPropertyControl, typeof(CsvExportData), typeof(LocationJob)); } @@ -722,7 +720,7 @@ DataEventPublisher.InvokeWithoutPublishingEvents(() => { - mainForm.Invoke(new TaskDelegate(DataEventPublisher.SelectionChanged), damProject.DamProjectData.WaterBoard); + mainForm.Invoke(new TaskDelegate(DataEventPublisher.SelectionChanged), damProject.DamProjectData.WaterBoard.SelectedDike); LogManager.Clear(); damProject.DamProjectData.ClearResults(); }); Index: DamClients/DamUI/trunk/src/Dam/Forms/DikePropertyControl.cs =================================================================== diff -u -r6436 -r6759 --- DamClients/DamUI/trunk/src/Dam/Forms/DikePropertyControl.cs (.../DikePropertyControl.cs) (revision 6436) +++ DamClients/DamUI/trunk/src/Dam/Forms/DikePropertyControl.cs (.../DikePropertyControl.cs) (revision 6759) @@ -19,10 +19,15 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Windows.Forms; using Deltares.Dam.Data; +using Deltares.Standard; +using Deltares.Standard.Calculate; +using Deltares.Standard.EventPublisher; using Deltares.Standard.Forms; using Deltares.Standard.Forms.DExpress; +using ProgressDelegate = Deltares.DamEngine.Data.Standard.Calculation.ProgressDelegate; namespace Deltares.Dam.Forms { @@ -37,10 +42,55 @@ BindSupport.BindTextAndValue(this, NameLabel, NameTextEdit, typeof(Dike), "Name"); BindSupport.BindTextAndValue(this, DescriptionLabel, DescriptionTextEdit, typeof(Dike), "Description"); - LocalizationSupport.Register(typeof(Dike), groupControl1); + DataEventPublisher.OnAfterChange += DataEventPublisher_OnAfterChange; + LocalizationSupport.Register(typeof(Dike), CalculationGroup, groupControl1); FormsSupport.RepairRightAnchoredControls(this); } + public void DoProgress(double progress) + { + if (InvokeRequired) + { + Invoke(new ProgressDelegate(DoProgress), progress); + } + else + { + CalculationProgressBar.EditValue = Math.Round(100 * progress); + + if (!CalculationGroup.Visible && progress < 1) + { + CalculationGroup.Visible = true; + } + + Refresh(); + } + } + + private void DataEventPublisher_OnAfterChange(object sender, PublishEventArgs e) + { + if (InvokeRequired) + { + Invoke(new DataEventPublisherEventDelegate(DataEventPublisher_OnAfterChange), sender, e); + } + else + { + if (sender is CalculationManager) + { + bool running = ((CalculationManager) sender).IsRunning; + CalculationGroup.Visible = running; + + if (!running) + { + CalculationProgressBar.EditValue = 0; + } + } + else if (sender == dike) + { + DataEventPublisher.AfterChange(this); + } + } + } + public object SelectedObject { get @@ -65,7 +115,7 @@ dike = dikeJob.Dike; } } - + CalculationGroup.Visible = false; BindSupport.Assign(this, dike); NameTextEdit.Enabled = false; } Fisheye: Tag 6759 refers to a dead (removed) revision in file `DamClients/DamUI/trunk/src/Dam/Forms/WaterBoardPropertyControl.resx'. Fisheye: No comparison available. Pass `N' to diff? Index: DamClients/DamUI/trunk/src/Dam/Forms/DikePropertyControl.Designer.cs =================================================================== diff -u -r6439 -r6759 --- DamClients/DamUI/trunk/src/Dam/Forms/DikePropertyControl.Designer.cs (.../DikePropertyControl.Designer.cs) (revision 6439) +++ DamClients/DamUI/trunk/src/Dam/Forms/DikePropertyControl.Designer.cs (.../DikePropertyControl.Designer.cs) (revision 6759) @@ -49,17 +49,41 @@ /// private void InitializeComponent() { + this.CalculationGroup = new DevExpress.XtraEditors.GroupControl(); + this.CalculationProgressBar = new DevExpress.XtraEditors.ProgressBarControl(); this.groupControl1 = new DevExpress.XtraEditors.GroupControl(); this.NameTextEdit = new DevExpress.XtraEditors.TextEdit(); this.NameLabel = new DevExpress.XtraEditors.LabelControl(); this.DescriptionTextEdit = new DevExpress.XtraEditors.TextEdit(); this.DescriptionLabel = new DevExpress.XtraEditors.LabelControl(); + ((System.ComponentModel.ISupportInitialize)(this.CalculationGroup)).BeginInit(); + this.CalculationGroup.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.CalculationProgressBar.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.groupControl1)).BeginInit(); this.groupControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.NameTextEdit.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.DescriptionTextEdit.Properties)).BeginInit(); this.SuspendLayout(); // + // CalculationGroup + // + this.CalculationGroup.Controls.Add(this.CalculationProgressBar); + this.CalculationGroup.Dock = System.Windows.Forms.DockStyle.Top; + this.CalculationGroup.Location = new System.Drawing.Point(0, 0); + this.CalculationGroup.Name = "CalculationGroup"; + this.CalculationGroup.Size = new System.Drawing.Size(191, 80); + this.CalculationGroup.TabIndex = 15; + this.CalculationGroup.Text = "Progress"; + // + // CalculationProgressBar + // + this.CalculationProgressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.CalculationProgressBar.Location = new System.Drawing.Point(15, 38); + this.CalculationProgressBar.Name = "CalculationProgressBar"; + this.CalculationProgressBar.Size = new System.Drawing.Size(159, 24); + this.CalculationProgressBar.TabIndex = 0; + // // groupControl1 // this.groupControl1.Controls.Add(this.DescriptionTextEdit); @@ -117,8 +141,12 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.groupControl1); + this.Controls.Add(this.CalculationGroup); this.Name = "DikePropertyControl"; this.Size = new System.Drawing.Size(219, 131); + ((System.ComponentModel.ISupportInitialize)(this.CalculationGroup)).EndInit(); + this.CalculationGroup.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.CalculationProgressBar.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.groupControl1)).EndInit(); this.groupControl1.ResumeLayout(false); this.groupControl1.PerformLayout(); @@ -130,6 +158,8 @@ #endregion + private DevExpress.XtraEditors.GroupControl CalculationGroup; + private DevExpress.XtraEditors.ProgressBarControl CalculationProgressBar; private DevExpress.XtraEditors.GroupControl groupControl1; private DevExpress.XtraEditors.TextEdit NameTextEdit; private DevExpress.XtraEditors.LabelControl NameLabel; Fisheye: Tag 6759 refers to a dead (removed) revision in file `DamClients/DamUI/trunk/src/Dam/Forms/WaterBoardPropertyControl.Designer.cs'. Fisheye: No comparison available. Pass `N' to diff?