Index: DamClients/DamUI/trunk/src/Dam/Forms/DamGeometryEditor.cs =================================================================== diff -u -r875 -r1410 --- DamClients/DamUI/trunk/src/Dam/Forms/DamGeometryEditor.cs (.../DamGeometryEditor.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Forms/DamGeometryEditor.cs (.../DamGeometryEditor.cs) (revision 1410) @@ -37,40 +37,29 @@ /// public class DamGeometryEditor : IDomain { - private DamSpatialEditorDecorator spatialEditor; - private LocationJob locationJob = null; - private FailureMechanismSystemType failureMechanismType = FailureMechanismSystemType.StabilityInside; - private int index = 0; // Indicates the ranking in the probabilities - private Panel panel = new Panel(); - private bool openCharacteristicPointEditor; - + private readonly Panel panel = new Panel(); + /// /// Cross-section geometry spatialEditor /// /// The cross section spatialEditor public DamGeometryEditor(GeometryEditor geometryEditor) { - spatialEditor = new DamSpatialEditorDecorator(geometryEditor.SpatialEditor); - + var spatialEditor = new DamSpatialEditorDecorator(geometryEditor.SpatialEditor); var projectTypeComboBox = new RepositoryItemComboBox { TextEditStyle = TextEditStyles.DisableTextEditor }; - var projectTypeBarItem = new BarEditItem { Width = 200, Edit = projectTypeComboBox }; + var projectTypeBarItem = new BarEditItem { Width = 150, Edit = projectTypeComboBox }; var previousButton = new BarButtonItem { Glyph = Resources.Previous }; var nextButton = new BarButtonItem { Glyph = Resources.Next }; var probabilityItem = new BarStaticItem(); var soilProfileLabel = new BarStaticItem(); var editMode = new BarButtonItem { Glyph = Properties.Resources.pencil }; - /** - * TODO - * DevExpress notes that using LinkPersistInfo directly is not the way to add items. - * However, adding items using MainBar.AddItem adds the items to the front of the - * mainbar instead of adding new items to the back - */ - geometryEditor.MainBar.LinksPersistInfo.Add(new LinkPersistInfo(projectTypeBarItem, true)); - geometryEditor.MainBar.LinksPersistInfo.Add(new LinkPersistInfo(previousButton)); - geometryEditor.MainBar.LinksPersistInfo.Add(new LinkPersistInfo(nextButton)); - geometryEditor.MainBar.LinksPersistInfo.Add(new LinkPersistInfo(probabilityItem)); - geometryEditor.MainBar.LinksPersistInfo.Add(new LinkPersistInfo(soilProfileLabel)); + // For some reason, LinkPersistInfo that was used here does not work anymore so replaced it by AddItem (MWDAM-1199) + geometryEditor.MainBar.AddItem(projectTypeBarItem); + geometryEditor.MainBar.AddItem(previousButton); + geometryEditor.MainBar.AddItem(nextButton); + geometryEditor.MainBar.AddItem(probabilityItem); + geometryEditor.MainBar.AddItem(soilProfileLabel); // geometryEditor.MainBar.LinksPersistInfo.Insert(2, new LinkPersistInfo(editMode)); // Disable line editing of characteristic points (MWDAM-915) BindSupport.Bind(panel, projectTypeBarItem, spatialEditor.GetType(), StaticReflection.GetMemberName(x => x.FailureMechanismType)); Index: DamClients/DamUI/trunk/src/Dam/Data/DamFailureMechanismeCalculationSpecification.cs =================================================================== diff -u -r875 -r1410 --- DamClients/DamUI/trunk/src/Dam/Data/DamFailureMechanismeCalculationSpecification.cs (.../branches/CalcualtionIncluded/src/Dam/Data/DamFailureMechanismeCalculationSpecification.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Data/DamFailureMechanismeCalculationSpecification.cs (.../trunk/src/Dam/Data/DamFailureMechanismeCalculationSpecification.cs) (revision 1410) @@ -1,30 +1,36 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2010 Deltares. All rights reserved. -// -// B.S.T.I.M. The -// tom.the@deltares.nl -// 18-05-2010 -// -// data class for specifying one single calculation -// data class for xml file creator for DGSMStabDam.dll -// Note: this is a single class with dual purpose; maybe refactor -// Pull out the XML specific things into DamMStabInput -// -//----------------------------------------------------------------------- +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of the application DAM - UI. +// +// DAM - UI is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. using System.Collections; using System.ComponentModel; using System.Xml.Serialization; using Deltares.Dam.Data.UISupport; +using Deltares.Standard; using Deltares.Standard.Attributes; using Deltares.Standard.EventPublisher; using Deltares.Standard.Validation; namespace Deltares.Dam.Data { using System; - using Deltares.Standard; /// /// @@ -37,7 +43,8 @@ private FailureMechanismeParamatersMStab failureMechanismeParamatersMStab; private static ProbabilisticType probabilisticType; private static DamProjectType damProjectType; - private StabilityKernelType stabilityKernelType = StabilityKernelType.DamClassic; + private StabilityKernelType stabilityKernelType = StabilityKernelType.DamClassic; + private Boolean firstTime = true; public DamFailureMechanismeCalculationSpecification() { @@ -64,8 +71,10 @@ get { return failureMechanismSystemType; } set { - if (failureMechanismSystemType != value) + // Make sure the set is doen for the very first time too even when the value has not chenged (MWDAM-1199). + if (failureMechanismSystemType != value || firstTime) { + firstTime = false; DataEventPublisher.BeforeChange(this, "FailureMechanismSystemType"); failureMechanismSystemType = value; // To solve MWDAM-592, remember the current pipingmodeltype as this gets reset by setting the @@ -171,9 +180,13 @@ public void Assign(DamFailureMechanismeCalculationSpecification damFailureMechanismeCalculation) { - this.FailureMechanismSystemType = damFailureMechanismeCalculation.failureMechanismSystemType; - this.FailureMechanismeParamatersMStab.Assign(damFailureMechanismeCalculation.FailureMechanismeParamatersMStab); - //assign interface + failureMechanismSystemType = damFailureMechanismeCalculation.FailureMechanismSystemType; + calculationModel = damFailureMechanismeCalculation.CalculationModel; + pipingModelType = damFailureMechanismeCalculation.pipingModelType; + failureMechanismeParamatersMStab.Assign(damFailureMechanismeCalculation.FailureMechanismeParamatersMStab); + StabilityModelType = damFailureMechanismeCalculation.StabilityModelType; + stabilityKernelType = damFailureMechanismeCalculation.StabilityKernelType; + //assign interface } public DamFailureMechanismeCalculationSpecification Clone() Index: DamClients/DamUI/trunk/src/Dam/Forms/DamSpatialEditorDecorator.cs =================================================================== diff -u -r875 -r1410 --- DamClients/DamUI/trunk/src/Dam/Forms/DamSpatialEditorDecorator.cs (.../branches/CalcualtionIncluded/src/Dam/Forms/DamSpatialEditorDecorator.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Forms/DamSpatialEditorDecorator.cs (.../trunk/src/Dam/Forms/DamSpatialEditorDecorator.cs) (revision 1410) @@ -1,12 +1,32 @@ -using System; +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of the application DAM - UI. +// +// DAM - UI is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using Deltares.Dam.Data; using Deltares.Dam.Data.Sensors; using Deltares.Geometry; using Deltares.Geometry.Forms; -using Deltares.Geotechnics; using Deltares.Geotechnics.Forms; using Deltares.Geotechnics.Soils; using Deltares.Geotechnics.SurfaceLines; @@ -129,7 +149,6 @@ /// Enter/exit edit mode. Edit mode allows the characteristic points to be moved /// along the surface line. /// - /// true to enter edit mode, false to exit edit mode public bool EditMode { get { @@ -230,7 +249,6 @@ { isVisible = GeometryProbabilitiesCount - 1 > 0; } - return isVisible; } @@ -412,18 +430,9 @@ { if (csvExportData.AnalysisType == AnalysisType.AdaptGeometry) { - switch (csvExportData.DamFailureMechanismeCalculation.FailureMechanismSystemType) + if (csvExportData.RedesignedSurfaceLine2 != null) { - case FailureMechanismSystemType.Piping: - ShowRedesignedSurfaceLine(csvExportData.RedesignedSurfaceLine2Piping.Geometry); - break; - case FailureMechanismSystemType.StabilityInside: - case FailureMechanismSystemType.StabilityOutside: - if (csvExportData.RedesignedSurfaceLine2Stability != null) - { - ShowRedesignedSurfaceLine(csvExportData.RedesignedSurfaceLine2Stability.Geometry); - } - break; + ShowRedesignedSurfaceLine(csvExportData.RedesignedSurfaceLine2.Geometry); } } }