Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 98ee6eb5 authored by Harald Martini's avatar Harald Martini
Browse files

Merge branch 'feature/VECTO-1410-multistage-tool-buses' of...

Merge branch 'feature/VECTO-1410-multistage-tool-buses' of git+ssh://129.27.107.191:2211/vecto-dev into feature/VECTO-1410-multistage-tool-buses
parents e4bdc861 44789738
No related branches found
No related tags found
No related merge requests found
......@@ -153,20 +153,21 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
jobContainer.Execute();
jobContainer.WaitFinished();
var validator = new XMLValidator(XmlReader.Create(writer.XMLMultistageReportFileName));
var valid = validator.ValidateXML(XmlDocumentType.MultistageOutputData);
if (!valid) {
dialogHelper?.ShowMessageBox($"Error writing file {validator.ValidationError}", "Error",
MessageBoxButton.OK, MessageBoxImage.Error);
Debug.WriteLine("Invalid Outputfile");
return;
} else {
dialogHelper?.ShowMessageBox($"Written to {writer.XMLMultistageReportFileName}", "Info",
MessageBoxButton.OK, MessageBoxImage.Information);
Debug.WriteLine($"Written to {writer.XMLMultistageReportFileName}");
using (var reader = XmlReader.Create(writer.XMLMultistageReportFileName)) {
var validator = new XMLValidator(reader);
var valid = validator.ValidateXML(XmlDocumentType.MultistageOutputData);
if (!valid){
dialogHelper?.ShowMessageBox($"Error writing file {validator.ValidationError}", "Error",
MessageBoxButton.OK, MessageBoxImage.Error);
Debug.WriteLine("Invalid Outputfile");
return;
} else {
dialogHelper?.ShowMessageBox($"Written to {writer.XMLMultistageReportFileName}", "Info",
MessageBoxButton.OK, MessageBoxImage.Information);
Debug.WriteLine($"Written to {writer.XMLMultistageReportFileName}");
}
}
}
......
......@@ -138,7 +138,7 @@
</xs:complexType>
</xs:element>
<xs:sequence minOccurs="0">
<xs:element name="SmartAlternator">
<xs:element name="SmartAlternator" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="RatedCurrent" type="xs:integer">
......
......@@ -121,7 +121,7 @@
</xs:complexType>
</xs:element>
<xs:sequence minOccurs="0">
<xs:element name="SmartAlternator">
<xs:element name="SmartAlternator" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="RatedCurrent" type="xs:integer">
......
......@@ -11,6 +11,7 @@ using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider;
using TUGraz.VectoCore.Models.Simulation.Impl;
using TUGraz.VectoCore.OutputData;
using TUGraz.VectoCore.OutputData.FileIO;
using TUGraz.VectoCore.OutputData.XML;
using TUGraz.VectoCore.Tests.Models.Simulation;
using TUGraz.VectoCore.Utils;
......@@ -84,9 +85,11 @@ namespace TUGraz.VectoCore.Tests.Integration.Multistage
var progress = jobContainer.GetProgress();
Assert.IsTrue(progress.All(r => r.Value.Success), string.Concat<Exception>(progress.Select(r => r.Value.Error)));
using (var xmlReader = XmlReader.Create(writer.XMLMultistageReportFileName)) {
var validator = new XMLValidator(xmlReader);
Assert.IsTrue(validator.ValidateXML(VectoCore.Utils.XmlDocumentType.MultistageOutputData), validator.ValidationError);
}
var validator = new XMLValidator(XmlReader.Create(writer.XMLMultistageReportFileName));
Assert.IsTrue(validator.ValidateXML(VectoCore.Utils.XmlDocumentType.MultistageOutputData), validator.ValidationError);
}
......@@ -118,5 +121,34 @@ namespace TUGraz.VectoCore.Tests.Integration.Multistage
Assert.IsTrue(progress.All(r => r.Value.Success), string.Concat<Exception>(progress.Select(r => r.Value.Error)));
Assert.IsTrue(jobContainer.Runs.All(r => r.Success), String.Concat<Exception>(jobContainer.Runs.Select(r => r.ExecException)));
}
public const string PrimaryBus =
@"TestData\XML\XMLReaderDeclaration\SchemaVersion2.6_Buses\vecto_vehicle-primary_heavyBus-sample.xml";
public const string PrimaryBus_SmartES =
@"TestData\XML\XMLReaderDeclaration\SchemaVersion2.6_Buses\vecto_vehicle-primary_heavyBusSmartES-sample.xml";
[TestCase(PrimaryBus, TestName = "Multistage Write VIF Primary"),
TestCase(PrimaryBus_SmartES, TestName = "Multistage Write VIF Primary SmartES")
]
public void TestMultistageWritingVif(string primaryFile)
{
var inputData = xmlInputReader.Create(primaryFile);
var writer = new FileOutputWriter("vif_writing_test.xml");
var xmlreport = new XMLDeclarationReportMultistageBusVehicle(writer);
//var xmlreport = new XMLDeclarationReportPrimaryVehicle(writer);
var factory = new SimulatorFactory(ExecutionMode.Declaration, inputData, writer, xmlreport) {
WriteModalResults = true,
//ActualModalData = true,
Validate = false
};
var jobContainer = new JobContainer(new SummaryDataContainer(writer));
jobContainer.AddRuns(factory);
xmlreport.DoWriteReport();
}
}
}
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -273,8 +273,6 @@ xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationOutput:VehicleInterimFile
<ElectricSystem>
<AlternatorTechnology>conventional</AlternatorTechnology>
<SupplyFromHEVPossible>false</SupplyFromHEVPossible>
<MaxAlternatorPower>15000</MaxAlternatorPower>
<ElectricStorageCapacity>50</ElectricStorageCapacity>
</ElectricSystem>
<PneumaticSystem>
<SizeOfAirSupply>Large Supply 2-stage</SizeOfAirSupply>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment