Index: src/Deltares.DSoilModel.Forms.Tests/DSoilModelContextTest.cs =================================================================== diff -u -r498 -r521 --- src/Deltares.DSoilModel.Forms.Tests/DSoilModelContextTest.cs (.../DSoilModelContextTest.cs) (revision 498) +++ src/Deltares.DSoilModel.Forms.Tests/DSoilModelContextTest.cs (.../DSoilModelContextTest.cs) (revision 521) @@ -4,6 +4,7 @@ using System.Reflection; using Deltares.DSoilModel.Data; using Deltares.Geotechnics; +using Deltares.Geotechnics.ConePenetrationTest; using Deltares.Geotechnics.Mechanisms; using Deltares.Standard; using Deltares.Standard.Attributes; @@ -234,7 +235,6 @@ AdhereToFilter(UserColumnFilters.FlowSlideWti, visibleProperties); } - [Test] public void DSoilModelContext_ParameterViewForPreconsolidationStress_Visibility() { @@ -272,6 +272,18 @@ } } + [Test] + public void DSoilModelContext_GetFormat() + { + var dSoilModelContext = SetupDSoilModelContext(null); + + Assert.AreEqual("F3", dSoilModelContext.GetFormat(typeof(ConePenetrationTestPerSegment), null, "Xlocal")); + Assert.AreEqual("F3", dSoilModelContext.GetFormat(null, new ConePenetrationTestPerSegment(), "Xlocal")); + + Assert.AreEqual("F3", dSoilModelContext.GetFormat(typeof(BoringPerSegment), null, "Xlocal")); + Assert.AreEqual("F3", dSoilModelContext.GetFormat(null, new BoringPerSegment(), "Xlocal")); + } + private static void AdhereToFilter(UserColumnFilters? filter, ICollection visibleProperties) { var dSoilModelContext = SetupDSoilModelContext(filter); Index: src/Deltares.DSoilModel.Application/Program.cs =================================================================== diff -u -r475 -r521 --- src/Deltares.DSoilModel.Application/Program.cs (.../Program.cs) (revision 475) +++ src/Deltares.DSoilModel.Application/Program.cs (.../Program.cs) (revision 521) @@ -27,6 +27,8 @@ var splashImage = new Bitmap(typeof(Program).Assembly.GetManifestResourceStream(splashResourceName)); var aboutImage = new Bitmap(typeof(Program).Assembly.GetManifestResourceStream(aboutResourceName)); + Context.CurrentContext = new DSoilModelContext(); + var mainForm = new MainForm(typeof(Program), splashImage, false, new SplashDialogWti()); mainForm.AboutDialog = new AboutDialogWti(aboutImage); Index: src/Deltares.DSoilModel.Forms/DSoilModelPlugin.cs =================================================================== diff -u -r483 -r521 --- src/Deltares.DSoilModel.Forms/DSoilModelPlugin.cs (.../DSoilModelPlugin.cs) (revision 483) +++ src/Deltares.DSoilModel.Forms/DSoilModelPlugin.cs (.../DSoilModelPlugin.cs) (revision 521) @@ -263,12 +263,6 @@ extraGeometryEditor.SpatialEditor.ReadUserValues(); mainForm.AddControl(extraGeometryEditor); - var context = new DSoilModelContext - { - ParameterView = ParameterViewSettings.AllParameters - }; - Context.CurrentContext = context; - ConfigureMenus(); ConfigureGeometryEditor(); ConfigureSegmentGeometryEditor(); Index: src/Deltares.DSoilModel.Forms/DSoilModelContext.cs =================================================================== diff -u -r498 -r521 --- src/Deltares.DSoilModel.Forms/DSoilModelContext.cs (.../DSoilModelContext.cs) (revision 498) +++ src/Deltares.DSoilModel.Forms/DSoilModelContext.cs (.../DSoilModelContext.cs) (revision 521) @@ -1,4 +1,5 @@ -using System.Collections; +using System; +using System.Collections; using System.Collections.Generic; using Deltares.DSoilModel.Data; using Deltares.Geotechnics; @@ -381,6 +382,33 @@ return null; } + /// + /// Gets the format. + /// + /// The type. + /// The source. + /// The member. + /// + public override string GetFormat(Type type, object source, string member) + { + if (type == typeof(ConePenetrationTestPerSegment) || source is ConePenetrationTestPerSegment) + { + if (member == StaticReflection.GetMemberName(x => x.Xlocal)) + { + return "F3"; + } + } + if (type == typeof(BoringPerSegment) || source is BoringPerSegment) + { + if (member == StaticReflection.GetMemberName(x => x.Xlocal)) + { + return "F3"; + } + } + + return base.GetFormat(type, source, member); + } + protected override HashSet GetFilteredProperties(object soilUserFilter) { if (soilUserFilter is UserColumnFilters) Index: src/Deltares.DSoilModel.Forms/SegmentControl.cs =================================================================== diff -u -r390 -r521 --- src/Deltares.DSoilModel.Forms/SegmentControl.cs (.../SegmentControl.cs) (revision 390) +++ src/Deltares.DSoilModel.Forms/SegmentControl.cs (.../SegmentControl.cs) (revision 521) @@ -1,4 +1,5 @@ using System.Windows.Forms; +using Deltares.Standard; using Deltares.Geotechnics; using Deltares.Standard.EventPublisher.Enum; using Deltares.Standard.Forms; @@ -39,8 +40,11 @@ CPTsGroupControl, BoringsGroupControl, StartConversionButton); GeometriesGridControl.PropertyEditorReactionType = PropertyEditorReactionType.Ignore; + GeometriesGridControl.CurrentContext = Context.CurrentContext; CptsGridViewControl.PropertyEditorReactionType = PropertyEditorReactionType.Ignore; + CptsGridViewControl.CurrentContext = Context.CurrentContext; BoringsGridViewControl.PropertyEditorReactionType = PropertyEditorReactionType.Ignore; + BoringsGridViewControl.CurrentContext = Context.CurrentContext; FormsSupport.RepairRightAnchoredControls(this); FormsSupport.AdjustSizeToContents(this); Index: src/Deltares.DSoilModel.Application/Deltares.DSoilModel.Application.csproj =================================================================== diff -u -r476 -r521 --- src/Deltares.DSoilModel.Application/Deltares.DSoilModel.Application.csproj (.../Deltares.DSoilModel.Application.csproj) (revision 476) +++ src/Deltares.DSoilModel.Application/Deltares.DSoilModel.Application.csproj (.../Deltares.DSoilModel.Application.csproj) (revision 521) @@ -45,6 +45,10 @@ ..\..\lib\Deltares\DslFormsGeo\Deltares.Geometry.Forms.dll + + False + ..\..\lib\Deltares\DslGeo\Deltares.Geotechnics.dll + ..\..\lib\Deltares\DslFormsGeo\Deltares.Geotechnics.Forms.dll