Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 1eb1ecd1 authored by Stefanos Doumpoulakis's avatar Stefanos Doumpoulakis
Browse files

fix: convert steering pump tech (#858)

parent d105fabc
No related branches found
No related tags found
No related merge requests found
......@@ -217,6 +217,7 @@ namespace XMLConverterLibrary
XMLUtils.SetElementsType(doc, "Auxiliaries", null);
XMLUtils.SetElementsType(doc, "Auxiliaries/Data", "AUX_Conventional_LorryDataType");
XMLUtils.SetElementsAttribute(doc, "Auxiliaries/Data/SteeringPump/Technology", "axleNumber", "1");
XMLUtils.FixElementsValue(doc, "Auxiliaries/Data/SteeringPump/Technology");
}
protected void ConvertAirDrag(XDocument doc)
......@@ -344,7 +345,7 @@ namespace XMLConverterLibrary
XMLUtils.SetElementName(doc, "Vehicle/LegislativeClass", "LegislativeCategory", TargetNamespace);
XMLUtils.SetElementName(doc, "Vehicle/VehicleCategory", "ChassisConfiguration", TargetNamespace);
XMLUtils.FixElementValue(doc, "ChassisConfiguration");
XMLUtils.FixElementsValue(doc, "Vehicle/ChassisConfiguration");
XMLUtils.SetElementName(doc, "Vehicle/CurbMassChassis", "CorrectedActualMass", TargetNamespace);
XMLUtils.SetElementName(doc, "Vehicle/GrossVehicleMass", "TechnicalPermissibleMaximumLadenMass", TargetNamespace);
......
......@@ -34,9 +34,10 @@ namespace XMLConverterLibrary
_valueFixes = new Dictionary<string, Dictionary<string, string>>() {
{
"ChassisConfiguration", new Dictionary<string, string>() {
{ "Rigid Truck", "Rigid Lorry" }
}
"Vehicle/ChassisConfiguration", new Dictionary<string, string>() { { "Rigid Truck", "Rigid Lorry" } }
},
{
"Auxiliaries/Data/SteeringPump/Technology", new Dictionary<string, string>() { { "Electric", "Electric driven pump" } }
}
};
}
......@@ -99,18 +100,16 @@ namespace XMLConverterLibrary
node.Name = xs + name;
}
public static void FixElementValue(XDocument doc, string element)
public static void FixElementsValue(XDocument doc, string elementPath)
{
var node = doc.XPathSelectElement(QueryLocalName(element));
var nodes = doc.XPathSelectElements(QueryLocalName(elementPath.Split('/')));
if (node == null)
foreach (var node in nodes)
{
return;
}
if (_valueFixes.ContainsKey(element) && _valueFixes[element].ContainsKey(node.Value))
if (_valueFixes.ContainsKey(elementPath) && _valueFixes[elementPath].ContainsKey(node.Value))
{
node.Value = _valueFixes[element][node.Value];
node.Value = _valueFixes[elementPath][node.Value];
}
}
}
......
......@@ -556,7 +556,7 @@
<Technology>Belt driven or driven via transm. - Electronically controlled visco clutch</Technology>
</Fan>
<SteeringPump>
<Technology>Fixed displacement with elec. control</Technology>
<Technology>Electric</Technology>
</SteeringPump>
<ElectricSystem>
<Technology>Standard technology</Technology>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment