Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Configurations/HeightStructuresCalculationConfigurationReader.cs =================================================================== diff -u -re9fbad61d0a2e9ab98d3b87e8690ecbe4eb14025 -ra5b0726549ca0e36c37c560966b5cdc6d1a2ec42 --- Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Configurations/HeightStructuresCalculationConfigurationReader.cs (.../HeightStructuresCalculationConfigurationReader.cs) (revision e9fbad61d0a2e9ab98d3b87e8690ecbe4eb14025) +++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Configurations/HeightStructuresCalculationConfigurationReader.cs (.../HeightStructuresCalculationConfigurationReader.cs) (revision a5b0726549ca0e36c37c560966b5cdc6d1a2ec42) @@ -37,7 +37,8 @@ /// public class HeightStructuresCalculationConfigurationReader : CalculationConfigurationReader { - private const string hbLocatieSchemaName = "HbLocatieSchema_0.xsd"; + private const string hbLocatieSchemaVersion0Name = "HbLocatieSchema_0.xsd"; + private const string hbLocatieSchemaVersion1Name = "HbLocatieSchema.xsd"; private const string orientatieSchemaName = "OrientatieSchema.xsd"; private const string golfReductieSchemaName = "GolfReductieSchema.xsd"; private const string voorlandProfielSchemaName = "VoorlandProfielSchema.xsd"; @@ -64,11 +65,11 @@ : base(filePath, new[] { new CalculationConfigurationSchemaDefinition( - 0, Resources.KunstwerkenHoogteSchema, + 0, Resources.KunstwerkenHoogteSchema_0, new Dictionary { { - hbLocatieSchemaName, RiskeerCommonIOResources.HbLocatieSchema_0 + hbLocatieSchemaVersion0Name, RiskeerCommonIOResources.HbLocatieSchema_0 }, { orientatieSchemaName, RiskeerCommonIOResources.OrientatieSchema @@ -94,7 +95,39 @@ { scenarioSchemaName, RiskeerCommonIOResources.ScenarioSchema } - }, null) + }, null), + new CalculationConfigurationSchemaDefinition( + 1, Resources.KunstwerkenHoogteSchema, + new Dictionary + { + { + hbLocatieSchemaVersion1Name, RiskeerCommonIOResources.HbLocatieSchema + }, + { + orientatieSchemaName, RiskeerCommonIOResources.OrientatieSchema + }, + { + voorlandProfielSchemaName, RiskeerCommonIOResources.VoorlandProfielSchema + }, + { + golfReductieSchemaName, RiskeerCommonIOResources.GolfReductieSchema + }, + { + stochastSchemaName, RiskeerCommonIOResources.StochastSchema + }, + { + stochastStandaardafwijkingSchemaName, RiskeerCommonIOResources.StochastStandaardafwijkingSchema + }, + { + stochastVariatiecoefficientSchemaName, RiskeerCommonIOResources.StochastVariatiecoefficientSchema + }, + { + structureBaseSchemaName, RiskeerCommonIOResources.KunstwerkenBasisSchema + }, + { + scenarioSchemaName, RiskeerCommonIOResources.ScenarioSchema + } + }, Resources.KunstwerkenHoogteSchemaConfiguratieSchema0To1) }) {} protected override HeightStructuresCalculationConfiguration ParseCalculationElement(XElement calculationElement) @@ -104,7 +137,7 @@ FailureProbabilityStructureWithErosion = calculationElement.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.FailureProbabilityStructureWithErosionElement), StructureNormalOrientation = calculationElement.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.Orientation), ForeshoreProfileId = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.ForeshoreProfileNameElement), - HydraulicBoundaryLocationName = calculationElement.GetHydraulicBoundaryLocationName(), + HydraulicBoundaryLocationName = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.HydraulicBoundaryLocationElementNew), StructureId = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.StructureElement), WaveReduction = calculationElement.GetWaveReductionParameters(), LevelCrestStructure = calculationElement.GetStochastConfiguration(HeightStructuresConfigurationSchemaIdentifiers.LevelCrestStructureStochastName), Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Properties/Resources.Designer.cs =================================================================== diff -u -r106eeb3a0608bd85eb1fcc8fff72256fd9c3ac5f -ra5b0726549ca0e36c37c560966b5cdc6d1a2ec42 --- Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 106eeb3a0608bd85eb1fcc8fff72256fd9c3ac5f) +++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision a5b0726549ca0e36c37c560966b5cdc6d1a2ec42) @@ -40,7 +40,7 @@ // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -93,12 +93,56 @@ ///(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 [rest of string was truncated]";. + ///but WITHOUT ANY WARRANTY; without even the implied warranty of + ///ME [rest of string was truncated]";. /// internal static string KunstwerkenHoogteSchema { get { return ResourceManager.GetString("KunstwerkenHoogteSchema", resourceCulture); } } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8"?><!-- + ///Copyright (C) Stichting Deltares 2019. All rights reserved. + /// + ///This file is part of Riskeer. + /// + ///Riskeer 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 + ///ME [rest of string was truncated]";. + /// + internal static string KunstwerkenHoogteSchema_0 { + get { + return ResourceManager.GetString("KunstwerkenHoogteSchema_0", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> + ///<!-- + ///Copyright (C) Stichting Deltares 2019. All rights reserved. + /// + ///This file is part of Riskeer. + /// + ///Riskeer 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 + /// [rest of string was truncated]";. + /// + internal static string KunstwerkenHoogteSchemaConfiguratieSchema0To1 { + get { + return ResourceManager.GetString("KunstwerkenHoogteSchemaConfiguratieSchema0To1", resourceCulture); + } + } } } Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Properties/Resources.resx =================================================================== diff -u -rbf1fde9d2147a6eeaecebbb371be2c4856759159 -ra5b0726549ca0e36c37c560966b5cdc6d1a2ec42 --- Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Properties/Resources.resx (.../Resources.resx) (revision bf1fde9d2147a6eeaecebbb371be2c4856759159) +++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Properties/Resources.resx (.../Resources.resx) (revision a5b0726549ca0e36c37c560966b5cdc6d1a2ec42) @@ -121,4 +121,10 @@ ..\Resources\KunstwerkenHoogteSchema.xsd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + ..\resources\kunstwerkenhoogteschemaconfiguratieschema0to1.xslt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + + ..\resources\kunstwerkenhoogteschema_0.xsd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + \ No newline at end of file Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Resources/KunstwerkenHoogteSchema.xsd =================================================================== diff -u -r1a3a54d9378da14718c66fd31b3a0f2f5e7b560b -ra5b0726549ca0e36c37c560966b5cdc6d1a2ec42 --- Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Resources/KunstwerkenHoogteSchema.xsd (.../KunstwerkenHoogteSchema.xsd) (revision 1a3a54d9378da14718c66fd31b3a0f2f5e7b560b) +++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Resources/KunstwerkenHoogteSchema.xsd (.../KunstwerkenHoogteSchema.xsd) (revision a5b0726549ca0e36c37c560966b5cdc6d1a2ec42) @@ -30,11 +30,20 @@ + + + + + + + + + - + Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Resources/KunstwerkenHoogteSchemaConfiguratieSchema0To1.xslt =================================================================== diff -u --- Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Resources/KunstwerkenHoogteSchemaConfiguratieSchema0To1.xslt (revision 0) +++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Resources/KunstwerkenHoogteSchemaConfiguratieSchema0To1.xslt (revision a5b0726549ca0e36c37c560966b5cdc6d1a2ec42) @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + \ No newline at end of file Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Resources/KunstwerkenHoogteSchema_0.xsd =================================================================== diff -u --- Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Resources/KunstwerkenHoogteSchema_0.xsd (revision 0) +++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.IO/Resources/KunstwerkenHoogteSchema_0.xsd (revision a5b0726549ca0e36c37c560966b5cdc6d1a2ec42) @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationConfigurationReaderTest.cs =================================================================== diff -u -r1a3a54d9378da14718c66fd31b3a0f2f5e7b560b -ra5b0726549ca0e36c37c560966b5cdc6d1a2ec42 --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationConfigurationReaderTest.cs (.../HeightStructuresCalculationConfigurationReaderTest.cs) (revision 1a3a54d9378da14718c66fd31b3a0f2f5e7b560b) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.IO.Test/Configurations/HeightStructuresCalculationConfigurationReaderTest.cs (.../HeightStructuresCalculationConfigurationReaderTest.cs) (revision a5b0726549ca0e36c37c560966b5cdc6d1a2ec42) @@ -199,8 +199,8 @@ .SetName("invalidShouldIllustrationPointsBeCalculatedNoBoolean"); yield return new TestCaseData("invalidCalculationMultipleScenario.xml", - "Element 'scenario' cannot appear more than once if content model type is \"all\".") - .SetName("invalidCalculationMultipleScenario"); + "Element 'scenario' cannot appear more than once if content model type is \"all\".") + .SetName("invalidCalculationMultipleScenario"); yield return new TestCaseData("invalidScenarioMultipleContribution.xml", "Element 'bijdrage' cannot appear more than once if content model type is \"all\".") .SetName("invalidScenarioMultipleContribution"); @@ -219,6 +219,10 @@ yield return new TestCaseData("invalidScenarioRelevantNoBoolean.xml", "The 'gebruik' element is invalid - The value 'string' is invalid according to its datatype 'Boolean'") .SetName("invalidScenarioRelevantNoBoolean"); + + yield return new TestCaseData("invalidCalculationVersion1HydraulicBoundaryLocationOld.xml", + "The element 'berekening' has invalid child element 'hrlocatie'.") + .SetName("invalidCalculationVersion1HydraulicBoundaryLocationOld"); } } @@ -290,6 +294,8 @@ [TestCase("validFullConfigurationNew")] [TestCase("validFullConfiguration_differentOrder_old")] [TestCase("validFullConfiguration_differentOrder_new")] + [TestCase("validFullConfigurationVersion1")] + [TestCase("validFullConfiguration_differentOrder_Version1")] public void Read_ValidFullConfigurations_ExpectedValues(string fileName) { // Setup Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.IO.Test/test-data/HeightStructuresCalculationConfigurationReader/invalidCalculationVersion1HydraulicBoundaryLocationOld.xml =================================================================== diff -u --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.IO.Test/test-data/HeightStructuresCalculationConfigurationReader/invalidCalculationVersion1HydraulicBoundaryLocationOld.xml (revision 0) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.IO.Test/test-data/HeightStructuresCalculationConfigurationReader/invalidCalculationVersion1HydraulicBoundaryLocationOld.xml (revision a5b0726549ca0e36c37c560966b5cdc6d1a2ec42) @@ -0,0 +1,6 @@ + + + + Some_hydraulic_boundary_location + + \ No newline at end of file Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.IO.Test/test-data/HeightStructuresCalculationConfigurationReader/validFullConfigurationVersion1.xml =================================================================== diff -u --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.IO.Test/test-data/HeightStructuresCalculationConfigurationReader/validFullConfigurationVersion1.xml (revision 0) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.IO.Test/test-data/HeightStructuresCalculationConfigurationReader/validFullConfigurationVersion1.xml (revision a5b0726549ca0e36c37c560966b5cdc6d1a2ec42) @@ -0,0 +1,55 @@ + + + + Locatie1 + kunstwerk1 + 67.1 + true + 1E-6 + profiel1 + + true + havendam + 1.234 + true + + + + 6.0 + 0.12 + + + 1.10 + 0.12 + + + 15.2 + 0.1 + + + 15.2 + 0.1 + + + 15000 + 0.01 + + + 0.2 + 0.01 + + + 4.3 + 0.1 + + + 2 + 0.1 + + + + true + 8.8 + + + Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.IO.Test/test-data/HeightStructuresCalculationConfigurationReader/validFullConfiguration_differentOrder_Version1.xml =================================================================== diff -u --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.IO.Test/test-data/HeightStructuresCalculationConfigurationReader/validFullConfiguration_differentOrder_Version1.xml (revision 0) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.IO.Test/test-data/HeightStructuresCalculationConfigurationReader/validFullConfiguration_differentOrder_Version1.xml (revision a5b0726549ca0e36c37c560966b5cdc6d1a2ec42) @@ -0,0 +1,55 @@ + + + + + + 6.0 + 0.12 + + + 4.3 + 0.1 + + + 2 + 0.1 + + + 1.10 + 0.12 + + + 15.2 + 0.1 + + + 15000 + 0.01 + + + 15.2 + 0.1 + + + 0.2 + 0.01 + + + + true + 8.8 + + + true + 1.234 + havendam + true + + profiel1 + 1E-6 + true + 67.1 + kunstwerk1 + Locatie1 + +