diff --git a/Documentation/User Manual Source/Release Notes Vecto3.x.pdf b/Documentation/User Manual Source/Release Notes Vecto3.x.pdf index fe4a9057fd06ea12cd30ff6aa1ae1244ac1f0e9c..6ac6b262a72c2d7bd76a9b01d18d80002d962f70 100644 Binary files a/Documentation/User Manual Source/Release Notes Vecto3.x.pdf and b/Documentation/User Manual Source/Release Notes Vecto3.x.pdf differ diff --git a/VECTO3GUI2020/App.xaml b/VECTO3GUI2020/App.xaml index 2655e63c000b91d4ef3b7958157faf8437f2ea41..a0a32a7f03e28a215c69b6eadd9571c7d05e353b 100644 --- a/VECTO3GUI2020/App.xaml +++ b/VECTO3GUI2020/App.xaml @@ -8,7 +8,8 @@ <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <!-- Add new ResourceDictionaries here--> - <ResourceDictionary Source="Resources/ViewModelBindings.xaml"/> + <ResourceDictionary Source="/Resources/ViewModelBindings/ViewModelBindings.xaml"/> + <ResourceDictionary Source="/Resources/ViewModelBindings/VehicleViewModelBinding.xaml"/> <ResourceDictionary Source="Resources/Converter.xaml"/> <ResourceDictionary Source="Resources/MultistageParameterDataTemplates.xaml"/> <ResourceDictionary Source="Resources\Styles\ButtonStyles.xaml"/> diff --git a/VECTO3GUI2020/App.xaml.cs b/VECTO3GUI2020/App.xaml.cs index 40d044273af0b577032b9e4fc747faeca6fd7e41..e1369a396469400dcff8cd01aca5c9e05394b6b8 100644 --- a/VECTO3GUI2020/App.xaml.cs +++ b/VECTO3GUI2020/App.xaml.cs @@ -3,6 +3,7 @@ using System.Windows; using Ninject; using TUGraz.VectoCore; using VECTO3GUI2020.Ninject; +using VECTO3GUI2020.Ninject.Factories; using VECTO3GUI2020.Ninject.Vehicle; using VECTO3GUI2020.Properties; using Application = System.Windows.Application; @@ -32,7 +33,6 @@ namespace VECTO3GUI2020 container = new StandardKernel( new VectoNinjectModule(), new JobEditModule(), - new ComponentModule(), new DocumentModule(), new XMLWriterFactoryModule(), new FactoryModule(), diff --git a/VECTO3GUI2020/Helper/TemplateSelector/MultistageVehicleDataTemplateSelector.cs b/VECTO3GUI2020/Helper/TemplateSelector/MultistageVehicleDataTemplateSelector.cs index 5c230dfe950700dc01724da4c9dbe16c46be2a22..406427ba00fb77b20ec55098cd4b62594c947da3 100644 --- a/VECTO3GUI2020/Helper/TemplateSelector/MultistageVehicleDataTemplateSelector.cs +++ b/VECTO3GUI2020/Helper/TemplateSelector/MultistageVehicleDataTemplateSelector.cs @@ -29,7 +29,7 @@ namespace VECTO3GUI2020.Helper.TemplateSelector Type type = null; switch (vm) { - case InterimStageBusVehicleViewModel_v2_8 declvm: + case InterimStageBusVehicleViewModel declvm: if (declvm.ExemptedVehicle) { type = typeof(VehicleView_v2_8_exempted); } else { diff --git a/VECTO3GUI2020/Helper/XMLExtension.cs b/VECTO3GUI2020/Helper/XMLExtension.cs index c8f11753b6efcad28890a9b62b4a4593d0dce88b..dec71f88112c2ef10db48cbf3605d66676ade156 100644 --- a/VECTO3GUI2020/Helper/XMLExtension.cs +++ b/VECTO3GUI2020/Helper/XMLExtension.cs @@ -6,12 +6,12 @@ using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; using TUGraz.VectoCore.Utils; using VECTO3GUI2020.Util.XML; -using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.Util.XML.Components; namespace VECTO3GUI2020.Helper { - public static class XMLExtension + public static class XMLExtension { public static XElement CreateSignatureElement(this IXMLComponentWriter componentWriter, XNamespace nameSpace, string uri, DigestData digestData, bool hash = false) diff --git a/VECTO3GUI2020/Helper/XmlHelper.cs b/VECTO3GUI2020/Helper/XmlHelper.cs index 9401e886066fa33065514f54ea54a5abee7a1d55..bc1fe3e1dc183961f8f4f1b12cbc22386b9c49c9 100644 --- a/VECTO3GUI2020/Helper/XmlHelper.cs +++ b/VECTO3GUI2020/Helper/XmlHelper.cs @@ -42,7 +42,7 @@ namespace VECTO3GUI2020.Helper if (xmlDocument == null) return false; - var documentType = XMLHelper.GetDocumentType(xmlDocument.DocumentElement.LocalName); + var documentType = XMLHelper.GetDocumentTypeFromRootElement(xmlDocument.DocumentElement.LocalName); if (documentType == null) { throw new VectoException("unknown xml file! {0}", xmlDocument.DocumentElement.LocalName); diff --git a/VECTO3GUI2020/MainWindow.xaml b/VECTO3GUI2020/MainWindow.xaml index 85c6888d21f6c84b3711953bb715c51d2d70c97e..6bffe6fefbe90a2e1b4d004e310dda884b7edddf 100644 --- a/VECTO3GUI2020/MainWindow.xaml +++ b/VECTO3GUI2020/MainWindow.xaml @@ -39,7 +39,7 @@ </MenuItem> <Separator></Separator> <MenuItem Header="{x:Static resx:GUILabels.CreateInterimCompletedInput}" Command="{Binding JobListVm.NewCompletedInputCommand}" /> - <MenuItem Header="{x:Static resx:GUILabels.CreateExemptedInterimCompletedInput}" Command="{Binding JobListVm.NewExemptedCompletedInputCommand}" /> + <!--<MenuItem Header="{x:Static resx:GUILabels.CreateExemptedInterimCompletedInput}" Command="{Binding JobListVm.NewExemptedCompletedInputCommand}" />--> </MenuItem> <MenuItem Header="Load File" Command="{Binding JobListVm.AddJobAsyncCommand}"/> <MenuItem Header="Settings" Command="{Binding OpenSettings}"/> @@ -47,7 +47,7 @@ <MenuItem Header="Edit" VerticalAlignment="Stretch"> <MenuItem Header="Edit Job" ToolTip="Edit selected Job" Command="{Binding JobListVm.EditDocument}"/> <MenuItem Header="Source File"> - <MenuItem Header="Show in Explorer" Command="{Binding JobListVm.ShowSourceFileCommand}"/> + <MenuItem Header="Reveal in File Explorer" Command="{Binding JobListVm.ShowSourceFileCommand}"/> <MenuItem Header="Open in Editor" Command="{Binding JobListVm.OpenSourceFileCommand}"/> </MenuItem> <!--<MenuItem Header="Simulate Job" ToolTip="Simulates the selected Job"/>--> diff --git a/VECTO3GUI2020/Ninject/DocumentModule.cs b/VECTO3GUI2020/Ninject/DocumentModule.cs index 31fd37e9536e38507981f3da9f41c74de455d9bd..856d5d17935781acfb8e69558be405dc71596ce3 100644 --- a/VECTO3GUI2020/Ninject/DocumentModule.cs +++ b/VECTO3GUI2020/Ninject/DocumentModule.cs @@ -12,15 +12,17 @@ namespace VECTO3GUI2020.Ninject public override void Load() { - Bind<IDocumentViewModel>().To<DeclarationJobViewModel>().Named(XmlDocumentType.DeclarationJobData.ToString()); - Bind<IDocumentViewModel>().To<MultiStageJobViewModel_v0_1>() - .Named(XmlDocumentType.MultistepOutputData.ToString()); + //Bind<IDocumentViewModel>().To<DeclarationJobViewModel>().Named(XmlDocumentType.DeclarationJobData.ToString()); - Bind<IDocumentViewModel>().To<CreateVifViewModel>() - .Named(typeof(JSONInputDataV10_PrimaryAndStageInputBus).ToString()); - Bind<IDocumentViewModel>().To<CompletedBusV7ViewModel>() - .Named(typeof(JSONInputDataCompletedBusFactorMethodV7).ToString()); + //Bind<IDocumentViewModel>().To<MultiStageJobViewModel_v0_1>() + // .Named(XmlDocumentType.MultistepOutputData.ToString()); + + //Bind<IDocumentViewModel>().To<CreateVifViewModel>() + // .Named(typeof(JSONInputDataV10_PrimaryAndStageInputBus).ToString()); + + //Bind<IDocumentViewModel>().To<CompletedBusV7ViewModel>() + // .Named(typeof(JSONInputDataCompletedBusFactorMethodV7).ToString()); //Bind<IDocumentViewModel>().To<MultistageJobViewModel>().Named(XmlDocumentType.MultistageOutputData.ToString()); //Bind<IDocumentViewModel>().To<DeclarationTrailerJobDocumentViewModel>().Named(XmlDocumentType.DeclarationTrailerJobData.ToString()); diff --git a/VECTO3GUI2020/Ninject/Factories/ComponentViewModelFactoryModule.cs b/VECTO3GUI2020/Ninject/Factories/ComponentViewModelFactoryModule.cs new file mode 100644 index 0000000000000000000000000000000000000000..56e05248aedb8397fbfc55408b4d8267fec90fd1 --- /dev/null +++ b/VECTO3GUI2020/Ninject/Factories/ComponentViewModelFactoryModule.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.AccessControl; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using Ninject.Extensions.Factory; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.Utils; +using TUGraz.VectoCore.Utils.Ninject; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.Ninject.Factories +{ + + public interface IComponentViewModelFactoryInternal + { + IComponentViewModel CreateComponentViewModel(DataSource source, object inputData); + ICommonComponentViewModel CreateCommonComponentViewModel(object inputData); + + + } + + + public class ComponentViewModelFactoryModule : AbstractNinjectModule + { + private IComponentViewModelFactoryInternal factory; + private const string scopeName = nameof(IComponentViewModelFactory); + private const string common = "common"; + + #region Overrides of NinjectModule + + public override void Load() + { + Bind<IComponentViewModelFactory>().To<ComponentViewModelFactory>(); + Bind<IComponentViewModelFactoryInternal>().ToFactory(() => new CombineArgumentsToNameInstanceProvider(new[] { + new CombineArgumentsToNameInstanceProvider.MethodSettings() { + methods = new []{typeof(IComponentViewModelFactoryInternal).GetMethod(nameof(IComponentViewModelFactoryInternal.CreateComponentViewModel))}, + combineToNameDelegate = CombineToNameDelegate, + skipArguments = 1, + takeArguments = 1, + }, + new CombineArgumentsToNameInstanceProvider.MethodSettings() { + methods = new []{typeof(IComponentViewModelFactoryInternal).GetMethod(nameof(IComponentViewModelFactoryInternal.CreateCommonComponentViewModel))}, + combineToNameDelegate = arguments => common, + skipArguments = 0, + takeArguments = 0, + } + })).Named(scopeName); + + Bind<ICommonComponentViewModel>().To<CommonComponentViewModel>().WhenAnyAncestorNamed(scopeName).Named(common); + AddInternalComponentBinding<AirDragViewModel_v1_0>(XMLDeclarationAirdragDataProviderV10.NAMESPACE_URI, XMLDeclarationAirdragDataProviderV10.XSD_TYPE); + AddInternalComponentBinding<AirDragViewModel_v2_0>(XMLDeclarationAirdragDataProviderV20.NAMESPACE_URI, XMLDeclarationAirdragDataProviderV20.XSD_TYPE); + AddInternalComponentBinding<AirDragViewModel_v2_4>(XMLDeclarationAirdragDataProviderV24.NAMESPACE_URI, XMLDeclarationAirdragDataProviderV24.XSD_TYPE); + + + + + } + + private void AddInternalComponentBinding<TConcrete>(XNamespace ns, string type) where TConcrete : IComponentViewModel + { + Bind<IComponentViewModel>().To<TConcrete>().WhenAnyAncestorNamed(scopeName).Named(CombineToName(ns, type)); + } + + private string CombineToNameDelegate(object[] arguments) + { + if (arguments.Length >= 1 && arguments[0] is DataSource dataSource) { + XNamespace ns = dataSource.TypeVersion; + var type = dataSource.Type; + return CombineToName(ns, xsdType: type); + } + + throw new ArgumentException($"First argument must be of type {typeof(DataSource)}"); + + } + + private string CombineToName(XNamespace ns, string xsdType) + { + return XMLHelper.CombineNamespace(ns, xsdType); + } + #endregion + } +} diff --git a/VECTO3GUI2020/Ninject/Factories/DocumentViewModelFactoryModule.cs b/VECTO3GUI2020/Ninject/Factories/DocumentViewModelFactoryModule.cs new file mode 100644 index 0000000000000000000000000000000000000000..f703b8f85bd3836b4cd2a188f9f0585a96598dc9 --- /dev/null +++ b/VECTO3GUI2020/Ninject/Factories/DocumentViewModelFactoryModule.cs @@ -0,0 +1,110 @@ +using System; +using Ninject.Extensions.Factory; +using Ninject.Modules; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24; +using TUGraz.VectoCore.Utils; +using TUGraz.VectoCore.Utils.Ninject; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Implementation.Document; +using VECTO3GUI2020.ViewModel.Interfaces.Document; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; + +namespace VECTO3GUI2020.Ninject.Factories +{ + public class DocumentViewModelFactoryModule : NinjectModule + { + #region Overrides of NinjectModule + + public const string DocumentViewModelFactoryScope = nameof(IDocumentViewModelFactory); + public const string MultistepInputScope = nameof(IMultiStepInputViewModelFactory); + public const string DeclarationViewModelScope = nameof(IDeclarationInputViewModelFactory); + + public const string NewDocumentViewModelScope = nameof(INewDocumentViewModelFactory); + + + public const string PrimaryAndStageInputScope = nameof(IPrimaryAndStageInputViewModelFactory); + + public override void Load() + { + Bind<IDocumentViewModelFactory>().To<DocumentViewModelFactory>().InSingletonScope().Named(DocumentViewModelFactoryScope); + + #region MultistepViewModel + + Bind<IMultiStepInputViewModelFactory>().ToFactory().InSingletonScope().Named(MultistepInputScope); + Bind<IDocumentViewModel>().To<MultiStageJobViewModel_v0_1>().WhenParentNamed(MultistepInputScope); + #endregion + + #region DeclarationInputData + + Bind<IDeclarationInputViewModelFactory>().ToFactory(() => new CombineArgumentsToNameInstanceProvider(true, + new[] { + new CombineArgumentsToNameInstanceProvider.MethodSettings() { + methods = new []{typeof(IDeclarationInputViewModelFactory).GetMethod(nameof(IDeclarationInputViewModelFactory.CreateDeclarationViewModel))}, + takeArguments = 1, + combineToNameDelegate = (arguments) => { + if (arguments == null || arguments.Length < 1) { + throw new ArgumentException("Invalid number of arguments"); + } + + if (arguments[0] is IDeclarationInputDataProvider inputData) { + var name = $"{inputData.JobInputData.Vehicle.DataSource.SourceVersion}:{inputData.JobInputData.Vehicle.DataSource.Type}"; + return name; + } + + throw new ArgumentException($"Invalid argument of type {arguments[0].GetType()}"); + } + }, + } + ) + ).Named(DeclarationViewModelScope); + Bind<IDocumentViewModel>().To<SimulationOnlyDeclarationJob>().WhenParentNamed(DeclarationViewModelScope); + + var StageInputXMLVersions = new[] { + new { XMLDeclarationConventionalCompletedBusDataProviderV24.NAMESPACE_URI, XMLDeclarationConventionalCompletedBusDataProviderV24.XSD_TYPE}, + new { AbstractXMLDeclarationCompletedBusDataProviderV24.NAMESPACE_URI, XMLDeclarationHevCompletedBusDataProviderV24.XSD_TYPE}, + new { AbstractXMLDeclarationCompletedBusDataProviderV24.NAMESPACE_URI, XMLDeclarationPEVCompletedBusDataProviderV24.XSD_TYPE}, + new { XMLDeclarationExemptedCompletedBusDataProviderV24.NAMESPACE_URI, XMLDeclarationExemptedCompletedBusDataProviderV24.XSD_TYPE}, + new { AbstractXMLDeclarationCompletedBusDataProviderV24.NAMESPACE_URI, XMLDeclarationIepcCompletedBusDataProviderV24.XSD_TYPE}, + }; + foreach (var version in StageInputXMLVersions) + { + var name = $"{version.NAMESPACE_URI.GetVersionFromNamespaceUri()}:{version.XSD_TYPE}"; + + Bind<IDocumentViewModel>().To<StageInputViewModel>().WhenParentNamed(DeclarationViewModelScope) + .Named(name); + } + #endregion + + + #region NewViewModels + + Bind<INewDocumentViewModelFactory>().ToFactory().Named(NewDocumentViewModelScope); + Bind<IDocumentViewModel>().ToConstructor( + constructorArgs => new StageInputViewModel( + constructorArgs.Inject<bool>(), + constructorArgs.Inject<IMultiStageViewModelFactory>(), + constructorArgs.Inject<IAdditionalJobInfoViewModel>())) + .WhenParentNamed(NewDocumentViewModelScope) + .NamedLikeFactoryMethod((INewDocumentViewModelFactory f) => f.GetCreateNewStepInputViewModel(false)); ; + + Bind<IDocumentViewModel>().ToConstructor( + constructorArgs => new CreateVifViewModel( + constructorArgs.Inject<bool>(), + constructorArgs.Inject<IDialogHelper>(), + constructorArgs.Inject<IXMLInputDataReader>(), + constructorArgs.Inject<IAdditionalJobInfoViewModel>())) + .WhenParentNamed(NewDocumentViewModelScope) + .NamedLikeFactoryMethod((INewDocumentViewModelFactory f) => f.GetCreateNewVifViewModel(false)); + + #endregion + + Bind<IPrimaryAndStageInputViewModelFactory>().ToFactory().Named(PrimaryAndStageInputScope); + Bind<IDocumentViewModel>().To<CreateVifViewModel>().WhenParentNamed(PrimaryAndStageInputScope); + } + #endregion + } +} diff --git a/VECTO3GUI2020/Ninject/Factories/FactoryModule.cs b/VECTO3GUI2020/Ninject/Factories/FactoryModule.cs new file mode 100644 index 0000000000000000000000000000000000000000..48ad1a6d264c3d862f6bbb8705545abd278fa0fe --- /dev/null +++ b/VECTO3GUI2020/Ninject/Factories/FactoryModule.cs @@ -0,0 +1,40 @@ +using Ninject.Extensions.Factory; +using TUGraz.VectoCore; +using VECTO3GUI2020.Ninject.Util; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; + +namespace VECTO3GUI2020.Ninject.Factories +{ + public class FactoryModule : AbstractNinjectModule + { + public override void Load() + { + LoadModule<DocumentViewModelFactoryModule>(); + LoadModule<ComponentViewModelFactoryModule>(); + LoadModule<VehicleViewModelFactoryModule>(); + LoadModule<XMLWriterFactoryModule>(); + LoadModule<MultistepComponentViewModelFactory>(); + + //Bind<IXMLWriterFactory>().ToFactory(() => new UseFirstArgumentTypeAsNameInstanceProvider(fallback: true)); + //Bind<IMultiStageViewModelFactory>().ToFactory(() => new UseFirstArgumentAsNameInstanceProvider(skipFirstArgument: true, fallback: true)); + + Bind<IJobEditViewModelFactory>().ToFactory(() => new UseFirstArgumentTypeAsNameInstanceProvider()); + + + + + + + Bind<IMultiStageViewModelFactory>().To<MultiStageViewModelFactory>(). + InSingletonScope(); + Bind<IMultiStageViewModelFactoryDefaultInstanceProvider>(). + ToFactory(); + //Bind<IMultiStageViewModelFactoryTypeAsNameInstanceProvider>(). + // ToFactory(() => new UseFirstArgumentTypeAsNameInstanceProvider()); + Bind<IMultistageViewModelFactoryFirstParameterAsNameInstanceProvider>().ToFactory(() => + new UseFirstArgumentAsNameInstanceProvider(skipFirstArgument: false)); + + } + } +} diff --git a/VECTO3GUI2020/Ninject/Factories/MultiStageViewModelFactory.cs b/VECTO3GUI2020/Ninject/Factories/MultiStageViewModelFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..5bd18960b5c422c9658e3fa267ce4a29bb21da6c --- /dev/null +++ b/VECTO3GUI2020/Ninject/Factories/MultiStageViewModelFactory.cs @@ -0,0 +1,142 @@ +using Ninject; +using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24; +using TUGraz.VectoCore.Models.Simulation; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.ViewModel.Implementation; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Implementation.Document; +using VECTO3GUI2020.ViewModel.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.Common; +using VECTO3GUI2020.ViewModel.Interfaces.Document; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; + +namespace VECTO3GUI2020.Ninject.Factories +{ + public class MultiStageViewModelFactory : IMultiStageViewModelFactory + { + private IMultiStageViewModelFactoryDefaultInstanceProvider _multiStageVmFactoryDefaultInstanceProvider; + + private IMultistageViewModelFactoryFirstParameterAsNameInstanceProvider + _multistageViewModelFactoryFirstParameterAsNameInstanceProvider; + + private readonly IDocumentViewModelFactory _documentViewModelFactory; + private readonly IVehicleViewModelFactory _vehicleViewModelFactory; + private readonly IMultistepComponentViewModelFactory _multistepComponentViewModelFactory; + + public MultiStageViewModelFactory( + IMultiStageViewModelFactoryDefaultInstanceProvider multiStageVmFactoryDefaultInstanceProvider, + IMultistageViewModelFactoryFirstParameterAsNameInstanceProvider multistageViewModelFactoryFirstParameterAsNameInstanceProvider, + IDocumentViewModelFactory documentViewModelFactory, + IVehicleViewModelFactory vehicleViewModelFactory, IMultistepComponentViewModelFactory multistepComponentViewModelFactory) + { + _multiStageVmFactoryDefaultInstanceProvider = multiStageVmFactoryDefaultInstanceProvider; + _multistageViewModelFactoryFirstParameterAsNameInstanceProvider = multistageViewModelFactoryFirstParameterAsNameInstanceProvider; + + _multistepComponentViewModelFactory = multistepComponentViewModelFactory; + _documentViewModelFactory = documentViewModelFactory; + _vehicleViewModelFactory = vehicleViewModelFactory; + } + + #region Implementation of IMultiStageViewModelFactoryDefaultInstanceProvider + + public IViewModelBase GetNewMultistageJobViewModel() + { + return _multiStageVmFactoryDefaultInstanceProvider.GetNewMultistageJobViewModel(); + } + + public IMultiStageJobViewModel GetMultiStageJobViewModel(IMultistepBusInputDataProvider inputData) + { + return _documentViewModelFactory.CreateDocumentViewModel(inputData) as IMultiStageJobViewModel; + } + + public IMultistageVehicleViewModel GetInterimStageVehicleViewModel(CompletedBusArchitecture arch) + { + + if (_vehicleViewModelFactory.CreateNewVehicleViewModel(arch) is IMultistageVehicleViewModel veh) { + return veh; + }; + throw new VectoException($"Could not create viewmodel for {arch} completed bus!"); + } + + public IVehicleViewModel GetInterimStageVehicleViewModel(IVehicleDeclarationInputData consolidatedVehicleData, bool exempted) + { + return _vehicleViewModelFactory.CreateVehicleViewModel(consolidatedVehicleData, null); + } + + public IMultistageVehicleViewModel GetInterimStageVehicleViewModel(IVehicleDeclarationInputData inputData) + { + return _vehicleViewModelFactory.CreateVehicleViewModel(null, vehicleInput: inputData) as IMultistageVehicleViewModel; + } + + public IManufacturingStageViewModel GetManufacturingStageViewModel( + IManufacturingStageInputData consolidatedManufacturingStageInputData, bool exempted) + { + return _multiStageVmFactoryDefaultInstanceProvider.GetManufacturingStageViewModel(consolidatedManufacturingStageInputData, exempted); + } + + public IMultistageAirdragViewModel GetMultistageAirdragViewModel() + { + return _multiStageVmFactoryDefaultInstanceProvider.GetMultistageAirdragViewModel(); + } + + public IMultistageAirdragViewModel GetMultistageAirdragViewModel(IAirdragDeclarationInputData consolidatedAirdragInputData) + { + return _multiStageVmFactoryDefaultInstanceProvider.GetMultistageAirdragViewModel(consolidatedAirdragInputData); + } + + public IMultistageAuxiliariesViewModel GetAuxiliariesViewModel( + CompletedBusArchitecture arch) + { + return _multistepComponentViewModelFactory.CreateNewMultistepBusAuxViewModel(arch); + } + + public IMultistageAuxiliariesViewModel + GetAuxiliariesViewModel(CompletedBusArchitecture arch, + IBusAuxiliariesDeclarationData consolidatedAuxiliariesInputData) + { + return _multistepComponentViewModelFactory.CreateNewMultistepBusAuxViewModel(arch); + } + + #endregion + + + + + + #region Implementation of IMultistageViewModelFactoryFirstParameterAsNameInstanceProvider + + public IVehicleViewModel CreateStageInputVehicleViewModel(string inputProviderType) + { + return _multistageViewModelFactoryFirstParameterAsNameInstanceProvider.CreateStageInputVehicleViewModel(inputProviderType); + } + + #endregion + + #region Implementation of IDocumentViewModelFactory + + public IDocumentViewModel CreateDocumentViewModel(IInputDataProvider declarationInput) + { + return _documentViewModelFactory.CreateDocumentViewModel(declarationInput); + } + + public IDocumentViewModel GetCreateNewStepInputViewModel(bool exemptedVehicle) + { + return _documentViewModelFactory.GetCreateNewStepInputViewModel(exemptedVehicle); + } + + public IDocumentViewModel GetCreateNewVifViewModel(bool completed) + { + return _documentViewModelFactory.GetCreateNewVifViewModel(completed); + } + + #endregion + + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/Ninject/Factories/MultistageViewModelModule.cs b/VECTO3GUI2020/Ninject/Factories/MultistageViewModelModule.cs new file mode 100644 index 0000000000000000000000000000000000000000..130ab03579e06507cde0b35d3e2978e86a4e49d9 --- /dev/null +++ b/VECTO3GUI2020/Ninject/Factories/MultistageViewModelModule.cs @@ -0,0 +1,73 @@ +using System; +using System.Diagnostics; +using System.Xml.Linq; +using Ninject.Extensions.Factory; +using Ninject.Modules; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration; +using TUGraz.VectoCore.Utils; +using TUGraz.VectoCore.Utils.Ninject; +using VECTO3GUI2020.Model.Multistage; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.Common; +using VECTO3GUI2020.ViewModel.Interfaces.Document; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; + +namespace VECTO3GUI2020.Ninject.Factories +{ + public interface IMultistepComponentViewModelFactory + { + IMultistageAuxiliariesViewModel CreateMultistepBusAuxViewModel(CompletedBusArchitecture arch, IBusAuxiliariesDeclarationData consolidatedInputData); + IMultistageAuxiliariesViewModel CreateNewMultistepBusAuxViewModel(CompletedBusArchitecture arch); + } + + + public class MultistepComponentViewModelFactory : AbstractNinjectModule + { + private string scopeName = "MultistepComponent"; + #region Overrides of NinjectModule + + public override void Load() + { + Bind<IMultistepComponentViewModelFactory>().ToFactory(() => new CombineArgumentsToNameInstanceProvider(new[] { + new CombineArgumentsToNameInstanceProvider.MethodSettings() { + methods = new[] { + typeof(IMultistepComponentViewModelFactory).GetMethod(nameof(IMultistepComponentViewModelFactory.CreateNewMultistepBusAuxViewModel)), + typeof(IMultistepComponentViewModelFactory).GetMethod(nameof(IMultistepComponentViewModelFactory.CreateMultistepBusAuxViewModel)) + }, + combineToNameDelegate = (args) => { + if (args.Length >= 1 && args[0] is CompletedBusArchitecture arch) { + return arch.ToString(); + } + throw new ArgumentException($"arg[0] must be {nameof(CompletedBusArchitecture)}"); + }, + skipArguments = 1, + takeArguments = 1 + } + })).Named(scopeName); + AddBinding<IMultistageAuxiliariesViewModel, MultistageAuxiliariesViewModel_Conventional>(CompletedBusArchitecture.Conventional); + AddBinding<IMultistageAuxiliariesViewModel, MultistageAuxiliariesViewModel_xEV>(CompletedBusArchitecture.HEV); + AddBinding<IMultistageAuxiliariesViewModel, MultistageAuxiliariesViewModel_xEV>(CompletedBusArchitecture.PEV); + AddBinding<IMultistageAuxiliariesViewModel, MultistageAuxiliariesViewModel_xEV>(CompletedBusArchitecture.IEPC); + } + + [DebuggerStepThrough] + public string GetName(CompletedBusArchitecture arch) + { + return arch.ToString(); + } + #endregion + + + public void AddBinding<TInterface, TConcrete>(CompletedBusArchitecture arch) + where TConcrete : class, TInterface + { + Bind<TInterface>().To<TConcrete>().WhenParentNamed(scopeName).Named(GetName(arch)); + } + + } + +} diff --git a/VECTO3GUI2020/Ninject/Factories/VehicleViewModelFactory.cs b/VECTO3GUI2020/Ninject/Factories/VehicleViewModelFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..d1599b8d199796fbd76ecb32ed155a895f55c4b9 --- /dev/null +++ b/VECTO3GUI2020/Ninject/Factories/VehicleViewModelFactory.cs @@ -0,0 +1,143 @@ +using System; +using System.Reflection; +using System.Xml.Linq; +using Ninject.Extensions.Factory; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24; +using TUGraz.VectoCore.Models.SimulationComponent; +using TUGraz.VectoCore.Utils; +using TUGraz.VectoCore.Utils.Ninject; +using VECTO3GUI2020.Annotations; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; + +namespace VECTO3GUI2020.Ninject.Factories +{ + + public interface IVehicleViewModelFactory + { + /// <summary> + /// + /// </summary> + /// <param name="consolidatedInputData">null if an exisiting step input should be used</param> + /// <param name="stepInputData">null if a new step inputviewmodel should be created</param> + /// <param name="exempted"></param> + /// <returns></returns> + IVehicleViewModel CreateVehicleViewModel(IVehicleDeclarationInputData consolidatedVehicleData, IVehicleDeclarationInputData vehicleInput); + + IVehicleViewModel CreateNewVehicleViewModel(CompletedBusArchitecture arch); + } + + public class VehicleViewModelFactoryModule : AbstractNinjectModule + { + #region Overrides of NinjectModule + + private const string scopeName = nameof(IVehicleViewModelFactory); + public override void Load() + { + Bind<IVehicleViewModelFactory>().ToFactory(() => new CombineArgumentsToNameInstanceProvider(new[] { + ///From consolidated data + new CombineArgumentsToNameInstanceProvider.MethodSettings() { + combineToNameDelegate = (args) => { + if (args.Length >= 2) { + //Step inputviewmodel with consolidate vehicle data from previous steps + if (args[0] is IVehicleDeclarationInputData consolidatedVehicle) { + return ArchName(consolidatedVehicle.VehicleType, consolidatedVehicle.ExemptedVehicle).ToString(); + } + + //Standalone step input + if (args[1] is IVehicleDeclarationInputData vehicle) { + return CombineToName(vehicle.DataSource.TypeVersion, vehicle.DataSource.Type); + } + } + throw new ArgumentException($"arg[0] must be {nameof(IVehicleDeclarationInputData)}"); + }, + methods = new []{typeof(IVehicleViewModelFactory).GetMethod(nameof(IVehicleViewModelFactory.CreateVehicleViewModel))}, + takeArguments = 2, + skipArguments = 0, + }, + new CombineArgumentsToNameInstanceProvider.MethodSettings() { + methods = new[]{typeof(IVehicleViewModelFactory).GetMethod(nameof(IVehicleViewModelFactory.CreateNewVehicleViewModel))}, + combineToNameDelegate = (args) => { + if (args.Length >= 1 && args[0] is CompletedBusArchitecture arch) { + return arch.ToString(); + } + throw new ArgumentException($"arg[0] must be {nameof(CompletedBusArchitecture)}"); + }, + skipArguments = 1, + takeArguments = 1 + } + })).Named(scopeName); + + ///Empty vehicle view models //Create depending on jobtype + AddVehicleViewModelBinding<InterimStageConventionalBusVehicleViewModel>(VectoSimulationJobType.ConventionalVehicle); + //One for hev is enough map to same name + AddVehicleViewModelBinding<InterimStageHevBusVehicleViewModel>( VectoSimulationJobType.ParallelHybridVehicle); + + AddVehicleViewModelBinding<InterimStagePevBusVehicleViewModel>( VectoSimulationJobType.BatteryElectricVehicle); + + AddVehicleViewModelBinding<InterimStageIEPCBusVehicleViewModel>(VectoSimulationJobType.IEPC_E); + + AddVehicleViewModelBinding<InterimStageExemptedBusVehicleViewModel>(VectoSimulationJobType.EngineOnlySimulation, true); + + + + ///Vehicle Viewmodels for existing files + AddVehicleViewModelBinding<InterimStageConventionalBusVehicleViewModel>(XMLDeclarationConventionalCompletedBusDataProviderV24.NAMESPACE_URI, XMLDeclarationConventionalCompletedBusDataProviderV24.XSD_TYPE); + AddVehicleViewModelBinding<InterimStageHevBusVehicleViewModel>(XMLDeclarationHevCompletedBusDataProviderV24.NAMESPACE_URI, XMLDeclarationHevCompletedBusDataProviderV24.XSD_TYPE); + + AddVehicleViewModelBinding<InterimStagePevBusVehicleViewModel>(XMLDeclarationPEVCompletedBusDataProviderV24.NAMESPACE_URI, XMLDeclarationPEVCompletedBusDataProviderV24.XSD_TYPE); + AddVehicleViewModelBinding<InterimStageIEPCBusVehicleViewModel>(XMLDeclarationIepcCompletedBusDataProviderV24.NAMESPACE_URI, XMLDeclarationIepcCompletedBusDataProviderV24.XSD_TYPE); + + AddVehicleViewModelBinding<InterimStageExemptedBusVehicleViewModel>(XMLDeclarationExemptedCompletedBusDataProviderV24.NAMESPACE_URI, XMLDeclarationExemptedCompletedBusDataProviderV24.XSD_TYPE); + + } + + #endregion + private void AddVehicleViewModelBinding<TConcrete>(XNamespace ns, string type) where TConcrete : IVehicleViewModel + { + Bind<IVehicleViewModel>().To<TConcrete>().WhenAnyAncestorNamed(scopeName).Named(CombineToName(ns, type)); + } + + private void AddVehicleViewModelBinding<TConcrete>(VectoSimulationJobType jobType, bool exempted = false) where TConcrete : IVehicleViewModel + { + Bind<IVehicleViewModel>().To<TConcrete>().WhenAnyAncestorNamed(scopeName).Named(ArchName(jobType, exempted).ToString()); + } + + + public static CompletedBusArchitecture ArchName(VectoSimulationJobType jobType, bool exempted = false) + { + if (exempted) { + return CompletedBusArchitecture.Exempted; + } + switch(jobType){ + case VectoSimulationJobType.ConventionalVehicle: + return CompletedBusArchitecture.Conventional; + case VectoSimulationJobType.ParallelHybridVehicle: + case VectoSimulationJobType.SerialHybridVehicle: + case VectoSimulationJobType.IHPC: + return CompletedBusArchitecture.HEV; + case VectoSimulationJobType.BatteryElectricVehicle: + return CompletedBusArchitecture.PEV; + case VectoSimulationJobType.IEPC_E: + case VectoSimulationJobType.IEPC_S: + return CompletedBusArchitecture.IEPC; + default: + throw new ArgumentOutOfRangeException(nameof(jobType), jobType, null); + } + } + public static string CombineToName(XNamespace ns, string type) + { + return XMLHelper.CombineNamespace(ns, type); + } + } + + + + + +} + + + diff --git a/VECTO3GUI2020/Ninject/Factories/XMLWriterFactoryModule.cs b/VECTO3GUI2020/Ninject/Factories/XMLWriterFactoryModule.cs new file mode 100644 index 0000000000000000000000000000000000000000..a36e3966748b219148ae922b5a2d20559feb05e2 --- /dev/null +++ b/VECTO3GUI2020/Ninject/Factories/XMLWriterFactoryModule.cs @@ -0,0 +1,179 @@ +using System; +using System.Diagnostics; +using System.Xml.Linq; +using Ninject.Extensions.Factory; +using Ninject.Modules; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.Utils; +using TUGraz.VectoCore.Utils.Ninject; +using VECTO3GUI2020.Ninject.Util; +using VECTO3GUI2020.Resources.XML; +using VECTO3GUI2020.Util.XML; +using VECTO3GUI2020.Util.XML.Components; + +using VECTO3GUI2020.Util.XML.Vehicle; + +namespace VECTO3GUI2020.Ninject.Factories +{ + public class XMLWriterFactoryModule : NinjectModule + { + private const string vehicleScope = nameof(IXMLWriterFactoryInternal); + public override void Load() + { + Bind<IXMLWriterFactory>().To<XMLWriterFactory>().InSingletonScope(); + + + Bind<IXMLWriterFactoryInternal>().ToFactory(() => new CombineArgumentsToNameInstanceProvider(false, new [] { + new CombineArgumentsToNameInstanceProvider.MethodSettings() { + combineToNameDelegate = ((args) => { + if (args[0] is DataSource dataSource) { + return GetName(dataSource.TypeVersion, dataSource.Type); + } + throw new ArgumentException(); + }), + methods = new [] { + typeof(IXMLWriterFactoryInternal).GetMethod(nameof(IXMLWriterFactoryInternal.CreateWriter)), + typeof(IXMLWriterFactoryInternal).GetMethod(nameof(IXMLWriterFactoryInternal.CreateComponentsWriter)), + typeof(IXMLWriterFactoryInternal).GetMethod(nameof(IXMLWriterFactoryInternal.CreateComponentWriter)) + }, + skipArguments = 1, + takeArguments = 1, + } + })).InSingletonScope().Named(vehicleScope); + + Array.ForEach(XMLCompletedBusVehicleWriterConventional.SUPPORTEDVERSIONS, sv => AddVehicleWriterBinding<XMLCompletedBusVehicleWriterConventional>(sv.version, sv.type)); + + Array.ForEach(XMLCompletedBusVehicleWriterExempted.SUPPORTEDVERSIONS, sv => AddVehicleWriterBinding<XMLCompletedBusVehicleWriterExempted>(sv.version, sv.type)); + #region Vehicle + AddVehicleWriterBinding<XMLCompletedBusVehicleWriterHEV>(XMLCompletedBusVehicleWriterHEV.VERSION); + AddVehicleWriterBinding<XMLCompletedBusVehicleWriterPEV>(XMLCompletedBusVehicleWriterPEV.VERSION); + AddVehicleWriterBinding<XMLCompletedBusVehicleWriterIEPC>(XMLCompletedBusVehicleWriterIEPC.VERSION); + + #endregion Vehicle + + #region Components + AddComponentsWriterBinding<XMLCompletedBusComponentWriter_Conventional>(XMLCompletedBusComponentWriter_Conventional.VERSION); + AddComponentsWriterBinding<XMLCompletedBusComponentsWriter_xEV>(XMLCompletedBusComponentsWriter_xEV.VERSION); + + + #endregion + + #region Airdrag + AddComponentWriterBinding<XMLAirDragWriter_v2_0>(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V20, XMLTypes.AirDragDataDeclarationType); + AddComponentWriterBinding<XMLAirDragWriter_v1_0>(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V10, XMLTypes.AirDragDataDeclarationType); + AddComponentWriterBinding<XMLAirDragWriter_v2_4>(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLTypes.AirDragModifiedUseStandardValueType); + + #endregion + + #region BusAux + AddBusAuxWriterBinding<XMLCompletedBusAuxiliariesWriterConventional>(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLTypes.AUX_Conventional_CompletedBusType); + AddBusAuxWriterBinding<XMLCompletedBusAuxiliariesWriter_xEV>(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLTypes.AUX_xEV_CompletedBusType); + #endregion + + + #region + + + + + + //Array.ForEach( + // XMLComponentsWriter_v1_0.SUPPORTED_VERSIONS, + // sv => Bind<IXMLComponentsWriter>().To<XMLComponentsWriter_v1_0>().Named(sv)); + + //Array.ForEach( + // XMLComponentsWriter_v2_0.SUPPORTED_VERSIONS, + // sv => Bind<IXMLComponentsWriter>().To<XMLComponentsWriter_v2_0>().Named(sv)); + + //Array.ForEach( + // XMLEngineWriter_v1_0.SUPPORTED_VERSIONS, + // sv => Bind<IXMLComponentWriter>().To<XMLEngineWriter_v1_0>().Named(sv)); + + //Array.ForEach( + // XMLEngineWriter_v2_0.SUPPORTED_VERSIONS, + // sv => Bind<IXMLComponentWriter>().To<XMLEngineWriter_v2_0>().Named(sv)); + + //Array.ForEach( + // XMLGearboxWriter_v2_0.SUPPORTED_VERSIONS, + // sv => Bind<IXMLComponentWriter>().To<XMLGearboxWriter_v2_0>().Named(sv)); + + //Array.ForEach( + // XMLRetarderWriter_v2_0.SUPPORTED_VERSIONS, + // sv => Bind<IXMLComponentWriter>().To<XMLRetarderWriter_v2_0>().Named(sv)); + + //Array.ForEach( + // XMLAxleGearWriter_v2_0.SUPPORTED_VERSIONS, + // sv => Bind<IXMLComponentWriter>().To<XMLAxleGearWriter_v2_0>().Named(sv)); + + //Array.ForEach( + // XMLAxleWheelsWriter_v2_0.SUPPORTED_VERSIONS, + // sv => Bind<IXMLComponentWriter>().To<XMLAxleWheelsWriter_v2_0>().Named(sv)); + + //Array.ForEach( + // XMLAxleWheelWriter_v2_0.SUPPORTED_VERSIONS, + // sv => Bind<IXMLComponentWriter>().To<XMLAxleWheelWriter_v2_0>().Named(sv)); + + //Array.ForEach( + // XMLTyreWriter_v2_0.SUPPORTED_VERSIONS, + // sv => Bind<IXMLComponentWriter>().To<XMLTyreWriter_v2_0>().Named(sv)); + + //Array.ForEach( + // XMLTyreWriter_v2_3.SUPPORTED_VERSIONS, + // sv => Bind<IXMLComponentWriter>().To<XMLTyreWriter_v2_3>().Named(sv)); + + //Array.ForEach( + // XMLAuxiliariesWriter_v2_0.SUPPORTED_VERSIONS, + // sv => Bind<IXMLComponentWriter>().To<XMLAuxiliariesWriter_v2_0>().Named(sv)); + //Array.ForEach( + // XMLAirDragWriter_v2_0.SUPPORTED_VERSIONS, + // sv => Bind<IXMLComponentWriter>().To<XMLAirDragWriter_v2_0>().Named(sv)); + + //Bind<IXMLBusAuxiliariesWriter>().To<XMLCompletedBusAuxiliariesWriterConventional>(); + + #endregion + + } + + public string GetName(XNamespace version, string xsdType) + { + return XMLHelper.CombineNamespace(version, xsdType); + } + + private void AddVehicleWriterBinding<TConcrete>((XNamespace ns, string xsdType) version) where TConcrete : class, IXMLVehicleWriter + { + Debug.WriteLine($"Create Binding for {typeof(TConcrete)} named '{GetName(version.ns, version.xsdType)}'"); + Bind<IXMLVehicleWriter>().To<TConcrete>().WhenParentNamed(vehicleScope).Named(GetName(version.ns, version.xsdType)); + } + private void AddVehicleWriterBinding<TConcrete>(XNamespace version, string xsdType) where TConcrete : class, IXMLVehicleWriter + { + Debug.WriteLine($"Create Binding for {typeof(TConcrete)} named '{GetName(version, xsdType)}'"); + Bind<IXMLVehicleWriter>().To<TConcrete>().WhenParentNamed(vehicleScope).Named(GetName(version, xsdType)); + } + private void AddComponentsWriterBinding<TConcrete>((XNamespace version, string xsdType) version) + where TConcrete : class, IXMLComponentsWriter + { + Debug.WriteLine($"Create Binding for {typeof(TConcrete)} named '{GetName(version.version, version.xsdType)}'"); + Bind<IXMLComponentsWriter>().To<TConcrete>().WhenParentNamed(vehicleScope).Named(GetName(version.version, version.xsdType)); + } + + private void AddComponentsWriterBinding<TConcrete>(XNamespace version, string xsdType) + where TConcrete : class, IXMLComponentsWriter + { + Debug.WriteLine($"Create Binding for {typeof(TConcrete)} named '{GetName(version, xsdType)}'"); + Bind<IXMLComponentsWriter>().To<TConcrete>().WhenParentNamed(vehicleScope).Named(GetName(version, xsdType)); + } + + private void AddComponentWriterBinding<TConcrete>(XNamespace version, string xsdType) where TConcrete : class, IXMLComponentWriter + { + Debug.WriteLine($"Create Binding for {typeof(TConcrete)} named '{GetName(version, xsdType)}'"); + Bind<IXMLComponentWriter>().To<TConcrete>().WhenParentNamed(vehicleScope).Named(GetName(version, xsdType)); + } + + private void AddBusAuxWriterBinding<TConcrete>(XNamespace version, string xsdType) + where TConcrete : class, IXMLBusAuxiliariesWriter + { + Debug.WriteLine($"Create Binding for {typeof(TConcrete)} named '{GetName(version, xsdType)}'"); + Bind<IXMLBusAuxiliariesWriter>().To<TConcrete>().WhenParentNamed(vehicleScope).Named(GetName(version, xsdType)); + } + } +} diff --git a/VECTO3GUI2020/Ninject/FactoryModule.cs b/VECTO3GUI2020/Ninject/FactoryModule.cs deleted file mode 100644 index fa07b41e5527c1f8a45b85fbcd9d79c311ce3a7d..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Ninject/FactoryModule.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Ninject.Extensions.Factory; -using Ninject.Modules; -using VECTO3GUI2020.Ninject.Util; -using VECTO3GUI2020.Util.XML.Interfaces; -using VECTO3GUI2020.ViewModel.Interfaces.Document; -using VECTO3GUI2020.ViewModel.Interfaces.JobEdit; -using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; -using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; - -namespace VECTO3GUI2020.Ninject -{ - public class FactoryModule : NinjectModule - { - public override void Load() - { - Bind<IXMLWriterFactory>().ToFactory(() => new UseFirstArgumentTypeAsNameInstanceProvider(fallback:true)); - //Bind<IMultiStageViewModelFactory>().ToFactory(() => new UseFirstArgumentAsNameInstanceProvider(skipFirstArgument: true, fallback: true)); - - Bind<IJobEditViewModelFactory>().ToFactory(() => new UseFirstArgumentTypeAsNameInstanceProvider()); - Bind<IDocumentViewModelFactory>().ToFactory(() => new UseFirstArgumentAsNameInstanceProvider(false)); - Bind<IComponentViewModelFactory>().ToFactory( - () => new UseFirstArgumentTypeAsNameInstanceProvider(true)); - - - Bind<IMultiStageViewModelFactory>().To<MultiStageViewModelFactory>(). - InSingletonScope(); - Bind<IMultiStageViewModelFactoryDefaultInstanceProvider>(). - ToFactory(); - Bind<IMultiStageViewModelFactoryTypeAsNameInstanceProvider>(). - ToFactory(() => new UseFirstArgumentTypeAsNameInstanceProvider()); - Bind<IMultistageViewModelFactoryFirstParameterAsNameInstanceProvider>().ToFactory(() => - new UseFirstArgumentAsNameInstanceProvider(skipFirstArgument: false)); - - } - } -} diff --git a/VECTO3GUI2020/Ninject/IMultistageDependencies.cs b/VECTO3GUI2020/Ninject/IMultistageDependencies.cs index 33a375cbb7dc549465730fcc0d49487d789d06fe..f98350fd68c474485fc609526b5bc18ceb85e43b 100644 --- a/VECTO3GUI2020/Ninject/IMultistageDependencies.cs +++ b/VECTO3GUI2020/Ninject/IMultistageDependencies.cs @@ -4,19 +4,19 @@ using TUGraz.VectoCore.InputData.FileIO.XML; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Factory; using TUGraz.VectoCore.Utils; using VECTO3GUI2020.Helper; -using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.Util.XML; using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; namespace VECTO3GUI2020.Ninject { - public interface IMultistageDependencies + public interface IMultistageDependencies { Lazy<IDialogHelper> DialogHelperLazy { get; } IDialogHelper DialogHelper { get; } IDeclarationInjectFactory InjectFactory { get; } IComponentViewModelFactory ComponentViewModelFactory { get; } - + IXMLComponentInputReader ComponentInputReader { get; } IXMLWriterFactory XMLWriterFactory { get; } } } \ No newline at end of file diff --git a/VECTO3GUI2020/Ninject/MultiStageViewModelFactory.cs b/VECTO3GUI2020/Ninject/MultiStageViewModelFactory.cs deleted file mode 100644 index 5f2bc79206ae6517b0fede51ce06d44229bf42c1..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Ninject/MultiStageViewModelFactory.cs +++ /dev/null @@ -1,123 +0,0 @@ -using TUGraz.VectoCommon.InputData; -using VECTO3GUI2020.ViewModel.Implementation; -using VECTO3GUI2020.ViewModel.Interfaces.Common; -using VECTO3GUI2020.ViewModel.Interfaces.Document; -using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; -using VECTO3GUI2020.ViewModel.MultiStage.Implementation; -using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; - -namespace VECTO3GUI2020.Ninject -{ - public class MultiStageViewModelFactory : IMultiStageViewModelFactory - { - private IMultiStageViewModelFactoryDefaultInstanceProvider _multiStageVmFactoryDefaultInstanceProvider; - private IMultiStageViewModelFactoryTypeAsNameInstanceProvider _multiStageViewModelFactoryTypeAsNameInstanceProvider; - - private IMultistageViewModelFactoryFirstParameterAsNameInstanceProvider - _multistageViewModelFactoryFirstParameterAsNameInstanceProvider; - - - public MultiStageViewModelFactory(IMultiStageViewModelFactoryDefaultInstanceProvider multiStageVmFactoryDefaultInstanceProvider, - IMultiStageViewModelFactoryTypeAsNameInstanceProvider multiStageViewModelFactoryTypeAsNameInstanceProvider, IMultistageViewModelFactoryFirstParameterAsNameInstanceProvider multistageViewModelFactoryFirstParameterAsNameInstanceProvider) - { - _multiStageVmFactoryDefaultInstanceProvider = multiStageVmFactoryDefaultInstanceProvider; - _multiStageViewModelFactoryTypeAsNameInstanceProvider = multiStageViewModelFactoryTypeAsNameInstanceProvider; - _multistageViewModelFactoryFirstParameterAsNameInstanceProvider = multistageViewModelFactoryFirstParameterAsNameInstanceProvider; - } - - #region Implementation of IMultiStageViewModelFactoryDefaultInstanceProvider - - public IDocumentViewModel GetStageInputViewModel(bool exemptedVehicle) - { - return _multiStageVmFactoryDefaultInstanceProvider.GetStageInputViewModel(exemptedVehicle); - } - - public IViewModelBase GetNewMultistageJobViewModel() - { - return _multiStageVmFactoryDefaultInstanceProvider.GetNewMultistageJobViewModel(); - } - - public IMultiStageJobViewModel GetMultiStageJobViewModel(IMultistepBusInputDataProvider inputData) - { - return _multiStageVmFactoryDefaultInstanceProvider.GetMultiStageJobViewModel(inputData); - } - - public IVehicleViewModel GetInterimStageVehicleViewModel() - { - return _multiStageVmFactoryDefaultInstanceProvider.GetInterimStageVehicleViewModel(); - } - - public IVehicleViewModel GetInterimStageVehicleViewModel(IVehicleDeclarationInputData consolidatedVehicleData, bool exempted) - { - return _multiStageVmFactoryDefaultInstanceProvider.GetInterimStageVehicleViewModel(consolidatedVehicleData, exempted); - } - - public IManufacturingStageViewModel GetManufacturingStageViewModel( - IManufacturingStageInputData consolidatedManufacturingStageInputData, bool exempted) - { - return _multiStageVmFactoryDefaultInstanceProvider.GetManufacturingStageViewModel(consolidatedManufacturingStageInputData, exempted); - } - - public IMultistageAirdragViewModel GetMultistageAirdragViewModel() - { - return _multiStageVmFactoryDefaultInstanceProvider.GetMultistageAirdragViewModel(); - } - - public IMultistageAirdragViewModel GetMultistageAirdragViewModel(IAirdragDeclarationInputData consolidatedAirdragInputData) - { - return _multiStageVmFactoryDefaultInstanceProvider.GetMultistageAirdragViewModel(consolidatedAirdragInputData); - } - - public IMultistageAuxiliariesViewModel GetAuxiliariesViewModel() - { - return _multiStageVmFactoryDefaultInstanceProvider.GetAuxiliariesViewModel(); - } - - public IMultistageAuxiliariesViewModel - GetAuxiliariesViewModel(IBusAuxiliariesDeclarationData consolidatedAuxiliariesInputData) - { - return _multiStageVmFactoryDefaultInstanceProvider.GetAuxiliariesViewModel(consolidatedAuxiliariesInputData); - } - - public ICreateVifViewModel GetCreateNewVifViewModel(bool completed) - { - return _multiStageVmFactoryDefaultInstanceProvider.GetCreateNewVifViewModel(completed); - } - - public ICreateVifViewModel GetCreateNewVifViewModel() - { - return _multiStageVmFactoryDefaultInstanceProvider.GetCreateNewVifViewModel(); - } - - #endregion - - #region Implementation of IMultiStageViewModelFactoryTypeAsNameInstanceProvider - - public IDocumentViewModel CreateDocumentViewModel(IDeclarationInputDataProvider inputData) - { - return _multiStageViewModelFactoryTypeAsNameInstanceProvider.CreateDocumentViewModel(inputData); - } - - public IDocumentViewModel CreateDocumentViewModel(IInputDataProvider inputData) - { - return _multiStageViewModelFactoryTypeAsNameInstanceProvider.CreateDocumentViewModel(inputData); - } - - public IVehicleViewModel CreateStageInputVehicleViewModel(IVehicleDeclarationInputData inputData) - { - return _multiStageViewModelFactoryTypeAsNameInstanceProvider.CreateStageInputVehicleViewModel(inputData); - } - - #endregion - - - #region Implementation of IMultistageViewModelFactoryFirstParameterAsNameInstanceProvider - - public IVehicleViewModel CreateStageInputVehicleViewModel(string inputProviderType) - { - return _multistageViewModelFactoryFirstParameterAsNameInstanceProvider.CreateStageInputVehicleViewModel(inputProviderType); - } - - #endregion - } -} \ No newline at end of file diff --git a/VECTO3GUI2020/Ninject/MultistageLazyDependencies.cs b/VECTO3GUI2020/Ninject/MultistageLazyDependencies.cs index 4272646006b9a3ed0b98932bef69d93d44e908ff..f308a947b43678177f4cffe9b72d8b293f3e93b7 100644 --- a/VECTO3GUI2020/Ninject/MultistageLazyDependencies.cs +++ b/VECTO3GUI2020/Ninject/MultistageLazyDependencies.cs @@ -3,24 +3,26 @@ using TUGraz.VectoCore.InputData.FileIO.XML; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Factory; using TUGraz.VectoCore.Utils; using VECTO3GUI2020.Helper; -using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.Util.XML; using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; namespace VECTO3GUI2020.Ninject { - public class MultistageLazyDependencies : IMultistageDependencies + public class MultistageLazyDependencies : IMultistageDependencies { private readonly Lazy<IXMLWriterFactory> _xmlWriterFactory; private readonly Lazy<IDeclarationInjectFactory> _injectFactory; private readonly Lazy<IComponentViewModelFactory> _componentViewModelFactory; private readonly Lazy<IMultiStageViewModelFactory> _multistageViewModelFactory; private readonly Lazy<IDialogHelper> _dialogHelper; + private readonly Lazy<IXMLComponentInputReader> _componentInputReader; public Lazy<IMultiStageViewModelFactory> MultistageViewModelFactory => _multistageViewModelFactory; public Lazy<IDialogHelper> DialogHelperLazy => _dialogHelper; public IDialogHelper DialogHelper => _dialogHelper.Value; public IDeclarationInjectFactory InjectFactory => _injectFactory.Value; public IComponentViewModelFactory ComponentViewModelFactory => _componentViewModelFactory.Value; + public IXMLComponentInputReader ComponentInputReader => _componentInputReader.Value; public IXMLWriterFactory XMLWriterFactory => _xmlWriterFactory.Value; public MultistageLazyDependencies( @@ -28,13 +30,15 @@ namespace VECTO3GUI2020.Ninject Lazy<IDeclarationInjectFactory> injectFactory, Lazy<IComponentViewModelFactory> componentViewModelFactory, Lazy<IXMLWriterFactory> xmlWriterFactory, - Lazy<IMultiStageViewModelFactory> viewModelFactory) + Lazy<IMultiStageViewModelFactory> viewModelFactory, + Lazy<IXMLComponentInputReader> componentInputReader) { _dialogHelper = dialogHelper; _componentViewModelFactory = componentViewModelFactory; _injectFactory = injectFactory; _xmlWriterFactory = xmlWriterFactory; _multistageViewModelFactory = viewModelFactory; + _componentInputReader = componentInputReader; } } } \ No newline at end of file diff --git a/VECTO3GUI2020/Ninject/MultistageModule.cs b/VECTO3GUI2020/Ninject/MultistageModule.cs index 0d0ddb97eacb589502be32d1c9b2e10dbe5d923f..e69b3286a00e170deb907c5a72dde4ec888c5fbb 100644 --- a/VECTO3GUI2020/Ninject/MultistageModule.cs +++ b/VECTO3GUI2020/Ninject/MultistageModule.cs @@ -22,29 +22,15 @@ namespace VECTO3GUI2020.Ninject Bind<IMultiStageJobViewModel>().To<MultiStageJobViewModel_v0_1>(). NamedLikeFactoryMethod((IMultiStageViewModelFactory f) => f.GetMultiStageJobViewModel(null)); - Bind<IVehicleViewModel>().To<InterimStageBusVehicleViewModel_v2_8>(). - NamedLikeFactoryMethod((IMultiStageViewModelFactory f)=>f.GetInterimStageVehicleViewModel()); - Bind<IManufacturingStageViewModel>().To<ManufacturingStageViewModel_v0_1>(). NamedLikeFactoryMethod((IMultiStageViewModelFactory f) => f.GetManufacturingStageViewModel(null, false)); Bind<IMultistageAirdragViewModel>().To<MultistageAirdragViewModel>(). NamedLikeFactoryMethod((IMultiStageViewModelFactory f) => f.GetMultistageAirdragViewModel()); - Bind<IMultistageAuxiliariesViewModel>().To<MultistageAuxiliariesViewModel>(). - NamedLikeFactoryMethod((IMultiStageViewModelFactory f) => f.GetAuxiliariesViewModel(null)); Bind<IMultistageDependencies>().To<MultistageLazyDependencies>(); - Bind<ICreateVifViewModel>().To<CreateVifViewModel>(). - NamedLikeFactoryMethod((IMultiStageViewModelFactory f) => f.GetCreateNewVifViewModel()); - - Bind<IDocumentViewModel>().To<StageInputViewModel>() - .Named(typeof(XMLDeclarationInputDataProviderV20).ToString()); - - Bind<IDocumentViewModel>().To<StageInputViewModel>() - .NamedLikeFactoryMethod((IMultiStageViewModelFactory f) => f.GetStageInputViewModel(default(bool))); - Bind<IAdditionalJobInfoViewModel>().To<AdditionalJobInfoViewModelMultiStage>() .WhenInjectedInto(typeof(IMultiStageJobViewModel)); diff --git a/VECTO3GUI2020/Ninject/Vecto3GUI2020Module.cs b/VECTO3GUI2020/Ninject/Vecto3GUI2020Module.cs index cfbe3a2fc2872d464985a0648cca0122af454cfc..54081f783028f4c40815c4c990398793e0952139 100644 --- a/VECTO3GUI2020/Ninject/Vecto3GUI2020Module.cs +++ b/VECTO3GUI2020/Ninject/Vecto3GUI2020Module.cs @@ -1,5 +1,6 @@ using System.Windows; using Ninject.Modules; +using TUGraz.VectoCore; using VECTO3GUI2020.Helper; using VECTO3GUI2020.Model.Implementation; using VECTO3GUI2020.Model.Interfaces; @@ -9,12 +10,15 @@ using VECTO3GUI2020.ViewModel.Interfaces; namespace VECTO3GUI2020.Ninject { - public class Vecto3GUI2020Module : NinjectModule + public class Vecto3GUI2020Module : AbstractNinjectModule { #region Overrides of NinjectModule public override void Load() { + LoadModule<MultistageModule>(); + + Bind<IJobListViewModel>().To<JobListViewModel>().InSingletonScope(); Bind<IMainWindowViewModel>().To<MainWindowViewModel>(); diff --git a/VECTO3GUI2020/Ninject/Vehicle/ComponentModule.cs b/VECTO3GUI2020/Ninject/Vehicle/ComponentModule.cs index c220e5bfa8a69c97ab98d372685c4c4e54ec2795..8827dc17c7036228cbda46ad8b0f33b1ad6b9ecd 100644 --- a/VECTO3GUI2020/Ninject/Vehicle/ComponentModule.cs +++ b/VECTO3GUI2020/Ninject/Vehicle/ComponentModule.cs @@ -1,4 +1,5 @@  +using System; using Ninject.Extensions.Factory; using Ninject.Modules; using TUGraz.VectoCommon.Models; @@ -16,11 +17,12 @@ using VECTO3GUI2020.ViewModel.MultiStage.Implementation; namespace VECTO3GUI2020.Ninject.Vehicle { + [Obsolete] public class ComponentModule : NinjectModule { public override void Load() - { - + { + throw new NotImplementedException("Will be replaced to get rid of type dependencies"); #region IComponentViewModelFactory @@ -30,8 +32,8 @@ namespace VECTO3GUI2020.Ninject.Vehicle - Bind<IVehicleViewModel>().To<InterimStageBusVehicleViewModel_v2_8>().Named(InterimStageBusVehicleViewModel_v2_8.VERSION); - Bind<IVehicleViewModel>().To<InterimStageBusVehicleViewModel_v2_8>().Named(InterimStageBusVehicleViewModel_v2_8.VERSION_EXEMPTED); + Bind<IVehicleViewModel>().To<InterimStageBusVehicleViewModel>().Named(InterimStageBusVehicleViewModel.VERSION); + Bind<IVehicleViewModel>().To<InterimStageBusVehicleViewModel>().Named(InterimStageBusVehicleViewModel.VERSION_EXEMPTED); Bind<IComponentViewModel>().To<EngineViewModel_v1_0>().Named(EngineViewModel_v1_0.VERSION); diff --git a/VECTO3GUI2020/Ninject/XMLWriterFactoryModule.cs b/VECTO3GUI2020/Ninject/XMLWriterFactoryModule.cs deleted file mode 100644 index ed0a9a0e032baa8ade5053a224f42d42748c755e..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Ninject/XMLWriterFactoryModule.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using Ninject.Extensions.Factory; -using Ninject.Modules; -using VECTO3GUI2020.Ninject.Util; -using VECTO3GUI2020.Util.XML.Implementation; -using VECTO3GUI2020.Util.XML.Implementation.ComponentWriter; -using VECTO3GUI2020.Util.XML.Implementation.DocumentWriter; -using VECTO3GUI2020.Util.XML.Interfaces; - -namespace VECTO3GUI2020.Ninject -{ - public class XMLWriterFactoryModule : NinjectModule - { - public override void Load() - { - - - Array.ForEach( - XMLDeclarationJobWriter_v1_0.SUPPORTED_VERSIONS, - (sv=> - Bind<IXMLDeclarationJobWriter>().To<XMLDeclarationJobWriter_v1_0>().Named(sv))); - - Array.ForEach( - XMLDeclarationJobWriter_v2_0.SUPPORTED_VERSIONS, - (sv => - Bind<IXMLDeclarationJobWriter>().To<XMLDeclarationJobWriter_v2_0>().Named(sv))); - - Array.ForEach( - XMLPTOWriter_v1_0.SUPPORTED_VERSIONS, - sv => Bind<IXMLComponentWriter>().To<XMLPTOWriter_v1_0>().Named(sv)); - - Array.ForEach( - XMLPTOWriter_v2_0.SUPPORTED_VERSIONS, - sv => Bind<IXMLComponentWriter>().To<XMLPTOWriter_v2_0>().Named(sv)); - - - Array.ForEach( - XMLVehicleWriter_v1_0.SUPPORTEDVERSIONS, - (sv) => - Bind<IXMLVehicleWriter>().To<XMLVehicleWriter_v1_0>().Named(sv)); - - Array.ForEach( - XMLVehicleWriter_v2_0.SUPPORTEDVERSIONS, - sv => - Bind<IXMLVehicleWriter>().To<XMLVehicleWriter_v2_0>().Named(sv)); - - Array.ForEach( - XMLVehicleWriter_v2_10.SUPPORTEDVERSIONS, - sv => - Bind<IXMLVehicleWriter>().To<XMLVehicleWriter_v2_10>().Named(sv)); - - Array.ForEach( - XMLComponentsWriter_v1_0.SUPPORTED_VERSIONS, - sv => Bind<IXMLComponentsWriter>().To<XMLComponentsWriter_v1_0>().Named(sv)); - - Array.ForEach( - XMLComponentsWriter_v2_0.SUPPORTED_VERSIONS, - sv => Bind<IXMLComponentsWriter>().To<XMLComponentsWriter_v2_0>().Named(sv)); - - Array.ForEach( - XMLEngineWriter_v1_0.SUPPORTED_VERSIONS, - sv => Bind<IXMLComponentWriter>().To<XMLEngineWriter_v1_0>().Named(sv)); - - Array.ForEach( - XMLEngineWriter_v2_0.SUPPORTED_VERSIONS, - sv => Bind<IXMLComponentWriter>().To<XMLEngineWriter_v2_0>().Named(sv)); - - Array.ForEach( - XMLGearboxWriter_v2_0.SUPPORTED_VERSIONS, - sv => Bind<IXMLComponentWriter>().To<XMLGearboxWriter_v2_0>().Named(sv)); - - Array.ForEach( - XMLRetarderWriter_v2_0.SUPPORTED_VERSIONS, - sv => Bind<IXMLComponentWriter>().To<XMLRetarderWriter_v2_0>().Named(sv)); - - Array.ForEach( - XMLAxleGearWriter_v2_0.SUPPORTED_VERSIONS, - sv => Bind<IXMLComponentWriter>().To<XMLAxleGearWriter_v2_0>().Named(sv)); - - Array.ForEach( - XMLAxleWheelsWriter_v2_0.SUPPORTED_VERSIONS, - sv => Bind<IXMLComponentWriter>().To<XMLAxleWheelsWriter_v2_0>().Named(sv)); - - Array.ForEach( - XMLAxleWheelWriter_v2_0.SUPPORTED_VERSIONS, - sv=> Bind<IXMLComponentWriter>().To<XMLAxleWheelWriter_v2_0>().Named(sv)); - - Array.ForEach( - XMLTyreWriter_v2_0.SUPPORTED_VERSIONS, - sv=> Bind<IXMLComponentWriter>().To<XMLTyreWriter_v2_0>().Named(sv)); - - Array.ForEach( - XMLTyreWriter_v2_3.SUPPORTED_VERSIONS, - sv=>Bind<IXMLComponentWriter>().To<XMLTyreWriter_v2_3>().Named(sv)); - - Array.ForEach( - XMLAuxiliariesWriter_v2_0.SUPPORTED_VERSIONS, - sv => Bind<IXMLComponentWriter>().To<XMLAuxiliariesWriter_v2_0>().Named(sv)); - Array.ForEach( - XMLAirDragWriter_v2_0.SUPPORTED_VERSIONS, - sv => Bind<IXMLComponentWriter>().To<XMLAirDragWriter_v2_0>().Named(sv)); - - Bind<IXMLBusAuxiliariesWriter>().To<XMLBusAuxiliariesWriterMultistage>(); - - } - } -} diff --git a/VECTO3GUI2020/Properties/Strings.Designer.cs b/VECTO3GUI2020/Properties/Strings.Designer.cs index 8ab0b64d91b1dab1f514b75cd977bdfe05f6b2b1..aacd66b1cd5cb4c84700d5e7641954f8e5c6ca2f 100644 --- a/VECTO3GUI2020/Properties/Strings.Designer.cs +++ b/VECTO3GUI2020/Properties/Strings.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // <auto-generated> -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. // </auto-generated> //------------------------------------------------------------------------------ @@ -13,13 +13,13 @@ namespace VECTO3GUI2020.Properties { /// <summary> - /// A strongly-typed resource class, for looking up localized strings, etc. + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. /// </summary> - // This class was auto-generated by the StronglyTypedResourceBuilder - // 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", "16.0.0.0")] + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Strings { @@ -33,7 +33,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Returns the cached ResourceManager instance used by this class. + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { @@ -61,7 +61,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Adjustable Auxiliary Heater. + /// Sucht eine lokalisierte Zeichenfolge, die Adjustable Auxiliary Heater ähnelt. /// </summary> public static string AdjustableAuxiliaryHeater { get { @@ -70,7 +70,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Airdrag Area. + /// Sucht eine lokalisierte Zeichenfolge, die Declared CdxA ähnelt. /// </summary> public static string AirDragArea { get { @@ -79,7 +79,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Airdrag Area 0. + /// Sucht eine lokalisierte Zeichenfolge, die Airdrag Area 0 ähnelt. /// </summary> public static string AirdragArea0 { get { @@ -88,7 +88,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Air Electric Heater. + /// Sucht eine lokalisierte Zeichenfolge, die Air Electric Heater ähnelt. /// </summary> public static string AirElectricHeater { get { @@ -97,7 +97,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Angledrive Type. + /// Sucht eine lokalisierte Zeichenfolge, die Angledrive Type ähnelt. /// </summary> public static string AngledriveType { get { @@ -106,7 +106,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Auxiliary Heater Power. + /// Sucht eine lokalisierte Zeichenfolge, die Auxiliary Heater Power ähnelt. /// </summary> public static string AuxHeaterPower { get { @@ -115,7 +115,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Axle Configuration. + /// Sucht eine lokalisierte Zeichenfolge, die Axle Configuration ähnelt. /// </summary> public static string AxleConfiguration { get { @@ -124,7 +124,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Axlegear Ratio. + /// Sucht eine lokalisierte Zeichenfolge, die Axlegear Ratio ähnelt. /// </summary> public static string AxleGearRatio { get { @@ -133,7 +133,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Brake Lights LED. + /// Sucht eine lokalisierte Zeichenfolge, die Brake Lights LED ähnelt. /// </summary> public static string BrakelightsLED { get { @@ -142,7 +142,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Certification Number. + /// Sucht eine lokalisierte Zeichenfolge, die Certification Number ähnelt. /// </summary> public static string Certification_Number { get { @@ -151,7 +151,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Certification Method. + /// Sucht eine lokalisierte Zeichenfolge, die Certification Method ähnelt. /// </summary> public static string CertificationMethod { get { @@ -160,7 +160,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Certification Number. + /// Sucht eine lokalisierte Zeichenfolge, die Certification Number ähnelt. /// </summary> public static string CertificationNumber { get { @@ -169,7 +169,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Curb Mass Chassis. + /// Sucht eine lokalisierte Zeichenfolge, die Curb Mass Chassis ähnelt. /// </summary> public static string CurbMassChassis { get { @@ -178,7 +178,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Dayrunning Lights LED. + /// Sucht eine lokalisierte Zeichenfolge, die Dayrunning Lights LED ähnelt. /// </summary> public static string DayrunninglightsLED { get { @@ -187,7 +187,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Dimension. + /// Sucht eine lokalisierte Zeichenfolge, die Dimension ähnelt. /// </summary> public static string Dimension { get { @@ -196,7 +196,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Displacement. + /// Sucht eine lokalisierte Zeichenfolge, die Displacement ähnelt. /// </summary> public static string Displacement { get { @@ -205,7 +205,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Doordrive Technology. + /// Sucht eine lokalisierte Zeichenfolge, die Doordrive Technology ähnelt. /// </summary> public static string DoorDriveTechnology { get { @@ -214,7 +214,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Double Glazing. + /// Sucht eine lokalisierte Zeichenfolge, die Double Glazing ähnelt. /// </summary> public static string DoubleGlazing { get { @@ -223,7 +223,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Efficiency. + /// Sucht eine lokalisierte Zeichenfolge, die Efficiency ähnelt. /// </summary> public static string Efficiency { get { @@ -232,7 +232,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Engine Idle Speed. + /// Sucht eine lokalisierte Zeichenfolge, die Engine Idle Speed ähnelt. /// </summary> public static string EngineIdleSpeed { get { @@ -241,7 +241,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Entrance Height. + /// Sucht eine lokalisierte Zeichenfolge, die Entrance Height ähnelt. /// </summary> public static string EntranceHeight { get { @@ -250,7 +250,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Gross Vehicle Mass. + /// Sucht eine lokalisierte Zeichenfolge, die Gross Vehicle Mass ähnelt. /// </summary> public static string GrossVehicleMass { get { @@ -259,7 +259,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Gross Vehicle Mass Rating. + /// Sucht eine lokalisierte Zeichenfolge, die Gross Vehicle Mass Rating ähnelt. /// </summary> public static string GrossVehicleMassRating { get { @@ -268,7 +268,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Head Lights LED. + /// Sucht eine lokalisierte Zeichenfolge, die Head Lights LED ähnelt. /// </summary> public static string HeadlightsLED { get { @@ -277,7 +277,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Heat Pump Mode. + /// Sucht eine lokalisierte Zeichenfolge, die Heat Pump Mode ähnelt. /// </summary> public static string HeatPumpMode { get { @@ -286,7 +286,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Heat Pump Mode Driver. + /// Sucht eine lokalisierte Zeichenfolge, die Heat Pump Mode Driver ähnelt. /// </summary> public static string HeatPumpModeDriverCompartment { get { @@ -295,7 +295,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Heat Pump Mode Passenger. + /// Sucht eine lokalisierte Zeichenfolge, die Heat Pump Mode Passenger ähnelt. /// </summary> public static string HeatPumpModePassengerCompartment { get { @@ -304,7 +304,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Heat Pump Type. + /// Sucht eine lokalisierte Zeichenfolge, die Heat Pump Type ähnelt. /// </summary> public static string HeatPumpType { get { @@ -313,7 +313,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Heat Pump Type Driver. + /// Sucht eine lokalisierte Zeichenfolge, die Heat Pump Type Driver ähnelt. /// </summary> public static string HeatPumpTypeDriverCompartment { get { @@ -322,7 +322,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Heat Pump Type Passenger. + /// Sucht eine lokalisierte Zeichenfolge, die Heat Pump Type Passenger ähnelt. /// </summary> public static string HeatPumpTypePassengerCompartment { get { @@ -331,7 +331,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Height. + /// Sucht eine lokalisierte Zeichenfolge, die Height ähnelt. /// </summary> public static string Height { get { @@ -340,7 +340,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Idling Speed. + /// Sucht eine lokalisierte Zeichenfolge, die Idling Speed ähnelt. /// </summary> public static string IdlingSpeed { get { @@ -349,7 +349,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Interior Lights LED. + /// Sucht eine lokalisierte Zeichenfolge, die Interior Lights LED ähnelt. /// </summary> public static string InteriorLightsLED { get { @@ -358,7 +358,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Legislative Class. + /// Sucht eine lokalisierte Zeichenfolge, die Legislative Class ähnelt. /// </summary> public static string LegislativeClass { get { @@ -367,7 +367,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Length. + /// Sucht eine lokalisierte Zeichenfolge, die Length ähnelt. /// </summary> public static string Length { get { @@ -376,7 +376,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Low Entry. + /// Sucht eine lokalisierte Zeichenfolge, die Low Entry ähnelt. /// </summary> public static string LowEntry { get { @@ -385,7 +385,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Manufacturer. + /// Sucht eine lokalisierte Zeichenfolge, die Manufacturer ähnelt. /// </summary> public static string Manufacturer { get { @@ -394,7 +394,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Manufacturer Address. + /// Sucht eine lokalisierte Zeichenfolge, die Manufacturer Address ähnelt. /// </summary> public static string ManufacturerAddress { get { @@ -403,7 +403,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Manufacturer Adress. + /// Sucht eine lokalisierte Zeichenfolge, die Manufacturer Adress ähnelt. /// </summary> public static string ManufacturerAdress { get { @@ -412,7 +412,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Max. Torque Declared. + /// Sucht eine lokalisierte Zeichenfolge, die Max. Torque Declared ähnelt. /// </summary> public static string MaxTorqueDeclared { get { @@ -421,7 +421,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Model. + /// Sucht eine lokalisierte Zeichenfolge, die Model ähnelt. /// </summary> public static string Model { get { @@ -430,7 +430,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Passengers Lower Deck. + /// Sucht eine lokalisierte Zeichenfolge, die Passengers Lower Deck ähnelt. /// </summary> public static string NumberOfPassengersLowerDeck { get { @@ -439,7 +439,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Passengers Upper Deck. + /// Sucht eine lokalisierte Zeichenfolge, die Passengers Upper Deck ähnelt. /// </summary> public static string NumberOfPassengersUpperDeck { get { @@ -448,7 +448,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Other Heating Technology. + /// Sucht eine lokalisierte Zeichenfolge, die Other Heating Technology ähnelt. /// </summary> public static string OtherHeatingTechnology { get { @@ -457,7 +457,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Position Lights LED. + /// Sucht eine lokalisierte Zeichenfolge, die Position Lights LED ähnelt. /// </summary> public static string PositionlightsLED { get { @@ -466,7 +466,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Predictive Cruise Control. + /// Sucht eine lokalisierte Zeichenfolge, die Predictive Cruise Control ähnelt. /// </summary> public static string PredictiveCruiseControl { get { @@ -475,7 +475,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Transmission Type. + /// Sucht eine lokalisierte Zeichenfolge, die Transmission Type ähnelt. /// </summary> public static string PTOTransmissionType { get { @@ -484,7 +484,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Rated Power. + /// Sucht eine lokalisierte Zeichenfolge, die Rated Power ähnelt. /// </summary> public static string RatedPowerDeclared { get { @@ -493,7 +493,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Rated Speed Declared. + /// Sucht eine lokalisierte Zeichenfolge, die Rated Speed Declared ähnelt. /// </summary> public static string RatedSpeedDeclared { get { @@ -502,7 +502,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Ratio. + /// Sucht eine lokalisierte Zeichenfolge, die Ratio ähnelt. /// </summary> public static string Ratio { get { @@ -511,7 +511,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Registered Class. + /// Sucht eine lokalisierte Zeichenfolge, die Registered Class ähnelt. /// </summary> public static string RegisteredClass { get { @@ -520,7 +520,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Retarder Ratio. + /// Sucht eine lokalisierte Zeichenfolge, die Retarder Ratio ähnelt. /// </summary> public static string RetarderRatio { get { @@ -529,7 +529,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Retarder Type. + /// Sucht eine lokalisierte Zeichenfolge, die Retarder Type ähnelt. /// </summary> public static string RetarderType { get { @@ -538,7 +538,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Roll Resistance Coefficient. + /// Sucht eine lokalisierte Zeichenfolge, die Roll Resistance Coefficient ähnelt. /// </summary> public static string RRC { get { @@ -547,8 +547,8 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Do you want to overwrite - /// . + /// Sucht eine lokalisierte Zeichenfolge, die Do you want to overwrite + /// ähnelt. /// </summary> public static string SaveExecute_Do_you_want_to_overwrite { get { @@ -557,7 +557,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Seperate Air Distribution Ducts. + /// Sucht eine lokalisierte Zeichenfolge, die Seperate Air Distribution Ducts ähnelt. /// </summary> public static string SeparateAirDistributionDucts { get { @@ -566,7 +566,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to System Configuration. + /// Sucht eine lokalisierte Zeichenfolge, die System Configuration ähnelt. /// </summary> public static string SystemConfiguration { get { @@ -575,7 +575,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Tank System. + /// Sucht eine lokalisierte Zeichenfolge, die Tank System ähnelt. /// </summary> public static string TankSystem { get { @@ -584,7 +584,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Transferred Airdrag Area. + /// Sucht eine lokalisierte Zeichenfolge, die Transferred Airdrag Area ähnelt. /// </summary> public static string TransferredAirDragArea { get { @@ -593,7 +593,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Transmission Type. + /// Sucht eine lokalisierte Zeichenfolge, die Transmission Type ähnelt. /// </summary> public static string TransmissionType { get { @@ -602,7 +602,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Twin Tyres. + /// Sucht eine lokalisierte Zeichenfolge, die Twin Tyres ähnelt. /// </summary> public static string TwinTyres { get { @@ -611,7 +611,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Vehicle Category. + /// Sucht eine lokalisierte Zeichenfolge, die Vehicle Category ähnelt. /// </summary> public static string VehicleCategory { get { @@ -620,7 +620,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Vehicle Code. + /// Sucht eine lokalisierte Zeichenfolge, die Vehicle Code ähnelt. /// </summary> public static string VehicleCode { get { @@ -629,7 +629,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Vehicle Declaration Type. + /// Sucht eine lokalisierte Zeichenfolge, die Vehicle Declaration Type ähnelt. /// </summary> public static string VehicleDeclarationType { get { @@ -638,7 +638,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Vehicle Type Approval Number. + /// Sucht eine lokalisierte Zeichenfolge, die Vehicle Type Approval Number ähnelt. /// </summary> public static string VehicleTypeApprovalNumber { get { @@ -647,7 +647,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Vehicle Identification Number. + /// Sucht eine lokalisierte Zeichenfolge, die Vehicle Identification Number ähnelt. /// </summary> public static string VehicleViewModel_v1_0_VIN { get { @@ -656,7 +656,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Vehicle Identification Number. + /// Sucht eine lokalisierte Zeichenfolge, die Vehicle Identification Number ähnelt. /// </summary> public static string VIN { get { @@ -665,7 +665,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Water Electric Heater. + /// Sucht eine lokalisierte Zeichenfolge, die Water Electric Heater ähnelt. /// </summary> public static string WaterElectricHeater { get { @@ -674,7 +674,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Waste Heat Recovery. + /// Sucht eine lokalisierte Zeichenfolge, die Waste Heat Recovery ähnelt. /// </summary> public static string WHRType { get { @@ -683,7 +683,7 @@ namespace VECTO3GUI2020.Properties { } /// <summary> - /// Looks up a localized string similar to Width. + /// Sucht eine lokalisierte Zeichenfolge, die Width ähnelt. /// </summary> public static string Width { get { diff --git a/VECTO3GUI2020/Properties/Strings.resx b/VECTO3GUI2020/Properties/Strings.resx index 57cca07abe89d77a22e2a2bc6424af7854f89f46..3543c56aab3b5d5becefad2b2722af4951b289a1 100644 --- a/VECTO3GUI2020/Properties/Strings.resx +++ b/VECTO3GUI2020/Properties/Strings.resx @@ -118,7 +118,7 @@ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <data name="AirDragArea" xml:space="preserve"> - <value>Airdrag Area</value> + <value>Declared CdxA</value> </data> <data name="AngledriveType" xml:space="preserve"> <value>Angledrive Type</value> diff --git a/VECTO3GUI2020/Resources/ViewModelBindings/VehicleViewModelBinding.xaml b/VECTO3GUI2020/Resources/ViewModelBindings/VehicleViewModelBinding.xaml new file mode 100644 index 0000000000000000000000000000000000000000..add55091c0c1e50a748afe424f905e7792c0151c --- /dev/null +++ b/VECTO3GUI2020/Resources/ViewModelBindings/VehicleViewModelBinding.xaml @@ -0,0 +1,44 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:VECTO3GUI2020" + xmlns:interfaces="clr-namespace:VECTO3GUI2020.ViewModel.Interfaces" + xmlns:views="clr-namespace:VECTO3GUI2020.Views" + xmlns:jobeditviews="clr-namespace:VECTO3GUI2020.Views.JobEditViews" + xmlns:impl="clr-namespace:VECTO3GUI2020.ViewModel.Implementation" + xmlns:jobeditimpl="clr-namespace:VECTO3GUI2020.ViewModel.Implementation.JobEdit" + xmlns:vehicleimpl="clr-namespace:VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle" + xmlns:vehicleviews="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle" + xmlns:multistageviews="clr-namespace:VECTO3GUI2020.Views.Multistage" + xmlns:additionaljobInfoViews="clr-namespace:VECTO3GUI2020.Views.Multistage.AdditionalJobInfoViews" + xmlns:componentimpl="clr-namespace:VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components" + xmlns:componentviews="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + xmlns:multistageimpl="clr-namespace:VECTO3GUI2020.ViewModel.MultiStage.Implementation" + xmlns:viewModel="clr-namespace:VECTO3GUI2020.ViewModel" + xmlns:common="clr-namespace:VECTO3GUI2020.ViewModel.Implementation.Common"> + + + <DataTemplate x:Shared="False" DataType="{x:Type multistageimpl:InterimStageExemptedBusVehicleViewModel}"> + <multistageviews:VehicleView_v2_8/> + </DataTemplate> + + <DataTemplate x:Shared="False" DataType="{x:Type multistageimpl:InterimStageConventionalBusVehicleViewModel}"> + <multistageviews:VehicleView_v2_8/> + </DataTemplate> + + <DataTemplate x:Shared="False" DataType="{x:Type multistageimpl:InterimStageHevBusVehicleViewModel}"> + <multistageviews:VehicleView_v2_8/> + </DataTemplate> + + <DataTemplate x:Shared="False" DataType="{x:Type multistageimpl:InterimStageIEPCBusVehicleViewModel}"> + <multistageviews:VehicleView_v2_8/> + </DataTemplate> + + <DataTemplate x:Shared="False" DataType="{x:Type multistageimpl:InterimStagePevBusVehicleViewModel}"> + <multistageviews:VehicleView_v2_8/> + </DataTemplate> + + + + + +</ResourceDictionary> \ No newline at end of file diff --git a/VECTO3GUI2020/Resources/ViewModelBindings.xaml b/VECTO3GUI2020/Resources/ViewModelBindings/ViewModelBindings.xaml similarity index 98% rename from VECTO3GUI2020/Resources/ViewModelBindings.xaml rename to VECTO3GUI2020/Resources/ViewModelBindings/ViewModelBindings.xaml index 989565530245f6076ecc56cb6d37d494b058d07d..22a017dff7bce12582a4b453a22256a96e04d3e0 100644 --- a/VECTO3GUI2020/Resources/ViewModelBindings.xaml +++ b/VECTO3GUI2020/Resources/ViewModelBindings/ViewModelBindings.xaml @@ -205,9 +205,6 @@ <multistageviews:ManufacturingStageView></multistageviews:ManufacturingStageView> </DataTemplate> - <DataTemplate x:Shared="False" DataType="{x:Type multistageimpl:InterimStageBusVehicleViewModel_v2_8}"> - <multistageviews:VehicleView_v2_8/> - </DataTemplate> <DataTemplate x:Shared="False" DataType="{x:Type multistageimpl:MultiStageJobViewModel_v0_1}"> <multistageviews:MultiStageView/> diff --git a/VECTO3GUI2020/Resources/XML/XMLTypes.cs b/VECTO3GUI2020/Resources/XML/XMLTypes.cs new file mode 100644 index 0000000000000000000000000000000000000000..c7859eab068831e688c96d76da0f1b0127b5e076 --- /dev/null +++ b/VECTO3GUI2020/Resources/XML/XMLTypes.cs @@ -0,0 +1,56 @@ +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24; + +namespace VECTO3GUI2020.Resources.XML +{ + public static class XMLTypes + { + #region Vehicle + + public const string Vehicle_Conventional_CompletedBusDeclarationType = + XMLDeclarationConventionalCompletedBusDataProviderV24.XSD_TYPE; + public const string Vehicle_Hev_CompletedBusDeclarationType = + XMLDeclarationHevCompletedBusDataProviderV24.XSD_TYPE; + public const string Vehicle_Pev_CompletedBusDeclarationType = + XMLDeclarationPEVCompletedBusDataProviderV24.XSD_TYPE; + public const string Vehicle_Iepc_CompletedBusDeclarationType = + XMLDeclarationIepcCompletedBusDataProviderV24.XSD_TYPE; + + public const string Vehicle_Exempted_CompletedBusDeclarationType = + XMLDeclarationExemptedCompletedBusDataProviderV24.XSD_TYPE; + + + #endregion + + #region Components + public const string Components_xEV_CompletedBusType = "Components_xEV_CompletedBusType"; + public const string Components_Conventional_CompletedBusType = "Components_Conventional_CompletedBusType"; + #endregion + + + #region Airdrag + public const string AirDragDataDeclarationType = "AirDragDataDeclarationType"; + public const string AirDragModifiedUseStandardValueType = "AirDragModifiedUseStandardValueType"; + + #endregion + + + #region BusAux + + public const string AUX_Conventional_CompletedBusType = "AUX_Conventional_CompletedBusType"; + public const string AUX_xEV_CompletedBusType = "AUX_xEV_CompletedBusType"; + + #endregion + + + #region ADAS + + public const string ADAS_Conventional_Type = "ADAS_Conventional_Type"; + public const string ADAS_HEV_Type = "ADAS_HEV_Type"; + public const string ADAS_PEV_Type = "ADAS_PEV_Type"; + public const string ADAS_IEPC_Type = "ADAS_IEPC_Type"; + + + #endregion + } +} + diff --git a/VECTO3GUI2020/Util/RelayCommand.cs b/VECTO3GUI2020/Util/RelayCommand.cs index 702384d99666b8eafa41b9d97b4d63584f147224..4efdff12be6d4abbd6b87ddf73fbed50e897dd65 100644 --- a/VECTO3GUI2020/Util/RelayCommand.cs +++ b/VECTO3GUI2020/Util/RelayCommand.cs @@ -1,84 +1,85 @@ -using System; -using System.Windows.Input; +//using System; +//using System.Windows.Input; -namespace VECTO3GUI2020.Util -{ - public class RelayCommand<T> : ICommand - { +//namespace VECTO3GUI2020.Util +//{ +// [Obsolete("Use MVVMToolkit instead")] +// public class RelayCommand<T> : ICommand +// { - private readonly Action<T> _execute; - private readonly Predicate<T> _canExecute; +// private readonly Action<T> _execute; +// private readonly Predicate<T> _canExecute; - public event EventHandler CanExecuteChanged { - add - { - CommandManager.RequerySuggested += value; - } - remove - { - CommandManager.RequerySuggested -= value; - } - } +// public event EventHandler CanExecuteChanged { +// add +// { +// CommandManager.RequerySuggested += value; +// } +// remove +// { +// CommandManager.RequerySuggested -= value; +// } +// } - public RelayCommand(Action<T> execute, Predicate<T> canExecute = null) - { - _execute = execute?? throw new ArgumentNullException(nameof(execute)); - _canExecute = canExecute; - } +// public RelayCommand(Action<T> execute, Predicate<T> canExecute = null) +// { +// _execute = execute?? throw new ArgumentNullException(nameof(execute)); +// _canExecute = canExecute; +// } - public bool CanExecute(object parameter) - { - return _canExecute != null ?_canExecute((T)parameter) : true; - } +// public bool CanExecute(object parameter) +// { +// return _canExecute != null ?_canExecute((T)parameter) : true; +// } - public void Execute(object parameter) - { - _execute((T)parameter); - } - } +// public void Execute(object parameter) +// { +// _execute((T)parameter); +// } +// } +// [Obsolete ("Use MVVMToolkit instead")] +// public class RelayCommand : ICommand +// { - public class RelayCommand : ICommand - { +// private readonly Action _execute; +// private readonly Func<bool> _canExecute; - private readonly Action _execute; - private readonly Func<bool> _canExecute; +// public RelayCommand(Action execute, Func<bool> canExecute = null) +// { +// _execute = execute ?? throw new ArgumentNullException(nameof(execute)); +// _canExecute = canExecute; - public RelayCommand(Action execute, Func<bool> canExecute = null) - { - _execute = execute ?? throw new ArgumentNullException(nameof(execute)); - _canExecute = canExecute; +// } - } +// public event EventHandler CanExecuteChanged +// { +// add +// { +// CommandManager.RequerySuggested += value; +// } - public event EventHandler CanExecuteChanged - { - add - { - CommandManager.RequerySuggested += value; - } +// remove +// { +// CommandManager.RequerySuggested -= value; +// } +// } - remove - { - CommandManager.RequerySuggested -= value; - } - } +// public bool CanExecute(object parameter) +// { +// return _canExecute != null ? _canExecute() : true ; +// } - public bool CanExecute(object parameter) - { - return _canExecute != null ? _canExecute() : true ; - } +// public void Execute(object parameter) +// { +// _execute(); +// } - public void Execute(object parameter) - { - _execute(); - } - - } -} +// } +//} diff --git a/VECTO3GUI2020/Util/XML/Components/IXMLComponentWriter.cs b/VECTO3GUI2020/Util/XML/Components/IXMLComponentWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..245c2eb7eb79b6c718b2c51217757e0acbb87707 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Components/IXMLComponentWriter.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.Util.XML.Components +{ + public interface IXMLComponentWriter + { + XElement GetElement(); + IXMLComponentWriter Init(IComponentInputData inputData); + } +} diff --git a/VECTO3GUI2020/Util/XML/Components/IXMLComponentsWriter.cs b/VECTO3GUI2020/Util/XML/Components/IXMLComponentsWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..c63910bcbb5c108d5092cf3160f4383cde92c659 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Components/IXMLComponentsWriter.cs @@ -0,0 +1,11 @@ +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.Util.XML.Components +{ + public interface IXMLComponentsWriter + { + XElement GetComponents(); + IXMLComponentsWriter Init(IVehicleComponentsDeclaration inputData); + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/Util/XML/Components/XMLAirDragWriter.cs b/VECTO3GUI2020/Util/XML/Components/XMLAirDragWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..1f774fbd9c5637e9fbee0b12d36280ce7275239d --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Components/XMLAirDragWriter.cs @@ -0,0 +1,155 @@ +using System; +using System.Linq; +using System.Xml; +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; + +namespace VECTO3GUI2020.Util.XML.Components +{ + public abstract class XMLAirDragWriter : IXMLComponentWriter + { + protected IAirdragDeclarationInputData _inputData; + protected abstract XNamespace DefaultNamespace { get; } + protected XElement _xElement; + protected string _uri = null; + + protected XMLAirDragWriter() + { + + if (_uri == null) { + _uri = "AirdragComponent" + XMLHelper.GetGUID(); + } + } + + public XElement GetElement() + { + + if (_xElement == null) + { + + Initialize(); + CreateDataElements(); + var signatureElemnet = this.CreateSignatureElement(XMLNamespaces.V20, _uri, _inputData.DigestValue); + _xElement.Add(signatureElemnet); + } + + return _xElement; + } + + public IXMLComponentWriter Init(IComponentInputData inputData) + { + _inputData = inputData as IAirdragDeclarationInputData; + _uri = inputData.DigestValue?.Reference?.Replace("#", ""); + + return this; + } + + public XElement GetElement(XNamespace wrapperNamespace) + { + throw new NotImplementedException(); + } + + protected abstract void Initialize(); + protected abstract void CreateDataElements(); + + + } + + public class XMLAirDragWriter_v2_0 : XMLAirDragWriter + { + public XMLAirDragWriter_v2_0() : base() { } + protected override void CreateDataElements() + { + var dataElement = new XElement(DefaultNamespace + XMLNames.ComponentDataWrapper); + _xElement.Add(dataElement); + + dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri), new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.AirDrag_Data_Type_Attr), new XAttribute("xmlns", DefaultNamespace)); + + dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); + dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_Model, _inputData.Model)); + dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); + dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_Date, _inputData.Date)); + dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_AppVersion, _inputData.AppVersion)); + dataElement.Add(new XElement(DefaultNamespace + XMLNames.AirDrag_CdxA_0, _inputData.AirDragArea_0.ToXMLFormat(2))); + dataElement.Add(new XElement(DefaultNamespace + XMLNames.AirDrag_TransferredCDxA, _inputData.TransferredAirDragArea.ToXMLFormat(2))); + dataElement.Add(new XElement(DefaultNamespace + XMLNames.AirDrag_DeclaredCdxA, _inputData.AirDragArea.ToXMLFormat(2))); + + + dataElement.DescendantsAndSelf().Where(e => string.IsNullOrEmpty(e.Value)).Remove(); + } + + protected override XNamespace DefaultNamespace => XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V20; + + protected override void Initialize() + { + _xElement = new XElement(XMLNames.Component_AirDrag); + } + } + + public class XMLAirDragWriter_v2_4 : XMLAirDragWriter + { + protected override XNamespace DefaultNamespace => XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24; + public XMLAirDragWriter_v2_4() : base() { } + protected override void CreateDataElements() + { + var dataElement = new XElement(XMLNamespaces.V20 + XMLNames.ComponentDataWrapper); + _xElement.Add(dataElement); + + dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, "std"), new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, + "AirDragModifiedUseStandardValueType"), new XAttribute("xmlns", DefaultNamespace)); + + //dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); + //dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_Model, _inputData.Model)); + //dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); + //dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_Date, _inputData.Date)); + //dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_AppVersion, _inputData.AppVersion)); + //dataElement.Add(new XElement(DefaultNamespace + XMLNames.AirDrag_CdxA_0, _inputData.AirDragArea_0.ToXMLFormat(2))); + //dataElement.Add(new XElement(DefaultNamespace + XMLNames.AirDrag_TransferredCDxA, _inputData.TransferredAirDragArea.ToXMLFormat(2))); + //dataElement.Add(new XElement(DefaultNamespace + XMLNames.AirDrag_DeclaredCdxA, _inputData.AirDragArea.ToXMLFormat(2))); + + + //dataElement.DescendantsAndSelf().Where(e => string.IsNullOrEmpty(e.Value)).Remove(); + } + + protected override void Initialize() + { + _xElement = new XElement(XMLNames.Component_AirDrag); + } + } + + public class XMLAirDragWriter_v1_0 : XMLAirDragWriter + { + protected override XNamespace DefaultNamespace => XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V10; + public XMLAirDragWriter_v1_0() : base() { } + protected override void CreateDataElements() + { + var dataElement = new XElement(XMLNamespaces.V20 + XMLNames.ComponentDataWrapper); + _xElement.Add(dataElement); + + dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri), new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.AirDrag_Data_Type_Attr), new XAttribute("xmlns", DefaultNamespace)); + + dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); + dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_Model, _inputData.Model)); + dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); + dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_Date, _inputData.Date)); + dataElement.Add(new XElement(DefaultNamespace + XMLNames.Component_AppVersion, _inputData.AppVersion)); + dataElement.Add(new XElement(DefaultNamespace + XMLNames.AirDrag_CdxA_0, _inputData.AirDragArea_0.ToXMLFormat(2))); + dataElement.Add(new XElement(DefaultNamespace + XMLNames.AirDrag_TransferredCDxA, _inputData.TransferredAirDragArea.ToXMLFormat(2))); + dataElement.Add(new XElement(DefaultNamespace + XMLNames.AirDrag_DeclaredCdxA, _inputData.AirDragArea.ToXMLFormat(2))); + + + dataElement.DescendantsAndSelf().Where(e => string.IsNullOrEmpty(e.Value)).Remove(); + } + + protected override void Initialize() + { + _xElement = new XElement(XMLNames.Component_AirDrag); + } + } + +} diff --git a/VECTO3GUI2020/Util/XML/Components/XMLAuxiliariesWriter.cs b/VECTO3GUI2020/Util/XML/Components/XMLAuxiliariesWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..ba6af87999cfa0b0118edbe3a34bcbd15371cd8c --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Components/XMLAuxiliariesWriter.cs @@ -0,0 +1,70 @@ +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using System.Threading.Tasks; +//using System.Xml.Linq; +//using TUGraz.VectoCommon.InputData; +//using TUGraz.VectoCommon.Resources; +//using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +//namespace VECTO3GUI2020.Util.XML.Components +//{ +// public abstract class XMLAuxiliariesWriter : IXMLComponentWriter +// { +// protected XNamespace _defaultNamespace; +// protected XElement _xElement; +// protected IAuxiliariesDeclarationInputData _inputData; + +// public XMLAuxiliariesWriter(IAuxiliariesDeclarationInputData inputData) +// { +// _inputData = inputData; +// } + +// public XElement GetElement() +// { +// if (_xElement == null) +// { +// Initialize(); +// CreateElements(); +// } + +// return _xElement; +// } +// public abstract void Initialize(); + +// public abstract void CreateElements(); +// } + +// public class XMLAuxiliariesWriter_v2_0 : XMLAuxiliariesWriter +// { + +// public static readonly string[] SUPPORTED_VERSIONS = { +// typeof(AuxiliariesViewModel_v2_0).ToString() +// }; + +// public XMLAuxiliariesWriter_v2_0(IAuxiliariesDeclarationInputData inputData) : base(inputData) { } + +// public override void CreateElements() +// { +// var dataElement = new XElement(_defaultNamespace + XMLNames.ComponentDataWrapper); +// _xElement.Add(dataElement); + +// dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Auxiliaries_Type_Attr_DataDeclarationType)); + +// foreach (var auxiliary in _inputData.Auxiliaries) +// { +// var auxElement = new XElement(_defaultNamespace + auxiliary.Type.ToString()); +// auxElement.Add(new XElement(_defaultNamespace + XMLNames.Auxiliaries_Auxiliary_Technology, +// auxiliary.Technology[0])); +// dataElement.Add(auxElement); +// } +// } + +// public override void Initialize() +// { +// _defaultNamespace = XMLNamespaces.V20; +// _xElement = new XElement(_defaultNamespace + XMLNames.Component_Auxiliaries); +// } +// } +//} diff --git a/VECTO3GUI2020/Util/XML/Components/XMLAxleGearWriter.cs b/VECTO3GUI2020/Util/XML/Components/XMLAxleGearWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..c8bbc355a394caa2598bbc9e5bad0a4dbb15d0a3 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Components/XMLAxleGearWriter.cs @@ -0,0 +1,93 @@ +//using System; +//using System.Collections.Generic; +//using System.Data; +//using System.Linq; +//using System.Text; +//using System.Threading.Tasks; +//using System.Xml.Linq; +//using TUGraz.VectoCommon.InputData; +//using TUGraz.VectoCommon.Models; +//using TUGraz.VectoCommon.Resources; +//using TUGraz.VectoCommon.Utils; +//using VECTO3GUI2020.Helper; +//using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +//namespace VECTO3GUI2020.Util.XML.Components +//{ +//// public abstract class XMLAxleGearWriter : IXMLComponentWriter +//// { +//// protected XElement _xElement; +//// protected IAxleGearInputData _inputData; +//// protected XNamespace _defaultNamespace; +//// protected string _uri = "ToDO-ADD_URI"; + +//// public XMLAxleGearWriter(IAxleGearInputData inputData) +//// { +//// _inputData = inputData; + + +//// } + +//// public abstract void Initialize(); +//// public abstract void CreateDataElements(); + +//// public XElement GetElement() +//// { +//// if (_xElement == null) +//// { +//// Initialize(); +//// CreateDataElements(); +//// _xElement.Add(this.CreateSignatureElement(_defaultNamespace, _uri, _inputData.DigestValue)); +//// } +//// return _xElement; +//// } +//// } + +//// public class XMLAxleGearWriter_v2_0 : XMLAxleGearWriter +//// { +//// public static readonly string[] SUPPORTED_VERSIONS = { +//// typeof(AxleGearViewModel_v2_0).ToString() +//// }; + + +//// public XMLAxleGearWriter_v2_0(IAxleGearInputData inputData) : base(inputData) +//// { + +//// } + + +//// public override void Initialize() +//// { +//// _defaultNamespace = XMLNamespaces.V20; +//// _xElement = new XElement(_defaultNamespace + XMLNames.Component_Axlegear); +//// } + +//// public override void CreateDataElements() +//// { +//// var dataElement = new XElement(_defaultNamespace + XMLNames.ComponentDataWrapper); +//// _xElement.Add(dataElement); + +//// dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri)); +//// dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.AxleGear_Type_Attr)); +//// dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); +//// dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model)); +//// dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); +//// dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Date, _inputData.Date)); +//// dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_AppVersion, _inputData.AppVersion)); +//// dataElement.Add(new XElement(_defaultNamespace + XMLNames.Axlegear_LineType, _inputData.LineType.ToXMLFormat())); +//// dataElement.Add(new XElement(_defaultNamespace + XMLNames.AngleDrive_Ratio, _inputData.Ratio.ToXMLFormat(3))); +//// dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_CertificationMethod, _inputData.CertificationMethod.ToXMLFormat())); + +//// var torqueLossMap = new XElement(_defaultNamespace + XMLNames.Axlegear_TorqueLossMap); +//// dataElement.Add(torqueLossMap); +//// foreach (DataRow row in _inputData.LossMap.Rows) +//// { +//// var entry = new XElement(_defaultNamespace + XMLNames.Axlegear_TorqueLossMap_Entry); +//// entry.Add(new XAttribute(XMLNames.TransmissionLossmap_InputSpeed_Attr, row[0].ToString())); +//// entry.Add(new XAttribute(XMLNames.TransmissionLossmap_InputTorque_Attr, row[1].ToString())); +//// entry.Add(new XAttribute(XMLNames.TransmissionLossmap_TorqueLoss_Attr, row[2].ToString())); +//// torqueLossMap.Add(entry); +//// } +//// } +//// } +////} diff --git a/VECTO3GUI2020/Util/XML/Components/XMLAxleWheelWriter.cs b/VECTO3GUI2020/Util/XML/Components/XMLAxleWheelWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..a8d313563490d22522820afc0bbb647440a06ee3 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Components/XMLAxleWheelWriter.cs @@ -0,0 +1,68 @@ +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using System.Threading.Tasks; +//using System.Xml.Linq; +//using TUGraz.VectoCommon.InputData; +//using TUGraz.VectoCommon.Resources; +//using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +//namespace VECTO3GUI2020.Util.XML.Components +//{ +// public abstract class XMLAxleWheelWriter : IXMLComponentWriter +// { +// protected IXMLWriterFactory _writerFactory; +// protected IAxleDeclarationInputData _inputData; + +// protected XNamespace _defaultNamespace; + +// protected XElement _xElement; +// public XMLAxleWheelWriter(IAxleDeclarationInputData inputData, IXMLWriterFactory writerFactory) +// { +// _inputData = inputData; +// _writerFactory = writerFactory; +// } + +// public XElement GetElement() +// { +// if (_xElement == null) +// { +// Initialize(); +// CreateElement(); +// } + +// return _xElement; +// } + +// protected abstract void CreateElement(); +// protected abstract void Initialize(); +// } + + +// public class XMLAxleWheelWriter_v2_0 : XMLAxleWheelWriter +// { +// public static readonly string[] SUPPORTED_VERSIONS = { +// typeof(AxleViewModel_v2_0).ToString() +// }; +// public XMLAxleWheelWriter_v2_0(IAxleDeclarationInputData inputData, IXMLWriterFactory writerFactory) : base(inputData, writerFactory) { } + +// protected override void CreateElement() +// { +// _xElement.Add(new XAttribute(XMLNames.AxleWheels_Axles_Axle_AxleNumber_Attr, 0));//_inputData.AxleNumber)); +// _xElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Axle_Type_Attr_AxleDataDeclarationType)); +// _xElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_AxleType, _inputData.AxleType)); +// _xElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_TwinTyres, _inputData.TwinTyres)); +// _xElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_Steered, false)); //_inputData.Steered)); + +// _xElement.Add(_writerFactory.CreateComponentWriter(_inputData.Tyre).GetElement()); +// } + +// protected override void Initialize() +// { + +// _defaultNamespace = XMLNamespaces.V20; +// _xElement = new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle); +// } +// } +//} diff --git a/VECTO3GUI2020/Util/XML/Components/XMLAxleWheelsWriter.cs b/VECTO3GUI2020/Util/XML/Components/XMLAxleWheelsWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..7479de6ca35ea960237ecc15c0d42c3827ce34b6 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Components/XMLAxleWheelsWriter.cs @@ -0,0 +1,71 @@ +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using System.Threading.Tasks; +//using System.Xml.Linq; +//using TUGraz.VectoCommon.InputData; +//using TUGraz.VectoCommon.Resources; +//using VECTO3GUI2020.Helper; +//using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +//namespace VECTO3GUI2020.Util.XML.Components +//{ +// public abstract class XMLAxleWheelsWriter : IXMLComponentWriter +// { +// protected XElement _xElement; +// protected XNamespace _defaultNameSpace; +// protected IAxlesDeclarationInputData _inputData; +// protected IXMLWriterFactory _writerFactory; + +// protected XMLAxleWheelsWriter(IAxlesDeclarationInputData inputData, IXMLWriterFactory writerFactory) +// { +// _inputData = inputData; +// _writerFactory = writerFactory; +// } + +// public XElement GetElement() +// { +// if (_xElement == null) +// { +// Initialize(); +// CreateDataElements(); +// } + +// return _xElement; +// } + +// public abstract void CreateDataElements(); +// public abstract void Initialize(); +// } + + +// public class XMLAxleWheelsWriter_v2_0 : XMLAxleWheelsWriter +// { +// public static readonly string[] SUPPORTED_VERSIONS = { +// typeof(AxleWheelsViewModel_v2_0).ToString() +// }; +// public override void CreateDataElements() +// { +// _xElement.Add(new XElement(_defaultNameSpace + XMLNames.ComponentDataWrapper)); +// var dataElement = _xElement.LastNode as XElement; + +// dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.AxleWheels_Type_Attr_AxleWheelsDeclarationType)); + +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.AxleWheels_Axles)); +// var axles = dataElement.LastNode as XElement; +// foreach (var axle in _inputData.AxlesDeclaration) +// { +// axles.Add(_writerFactory.CreateComponentWriter(axle).GetElement()); +// } +// } + +// public override void Initialize() +// { +// _defaultNameSpace = XMLNamespaces.V20; +// _xElement = new XElement(_defaultNameSpace + XMLNames.Component_AxleWheels); +// } + +// public XMLAxleWheelsWriter_v2_0(IAxlesDeclarationInputData inputData, IXMLWriterFactory writerFactory) : base(inputData, writerFactory) { } +// } +//} diff --git a/VECTO3GUI2020/Util/XML/Components/XMLCompletedBusAuxiliariesWriter.cs b/VECTO3GUI2020/Util/XML/Components/XMLCompletedBusAuxiliariesWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..2137e9b6a4ec292aa66638ebf92df2c7220a5e49 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Components/XMLCompletedBusAuxiliariesWriter.cs @@ -0,0 +1,189 @@ +using System.Linq; +using System.Xml.Linq; + +using TUGraz.VectoCommon.BusAuxiliaries; +using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCore.OutputData.XML.GroupWriter; +using TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration; +using VECTO3GUI2020.Resources.XML; + +namespace VECTO3GUI2020.Util.XML.Components +{ + public interface IXMLBusAuxiliariesWriter + { + XElement GetElement(); + IXMLBusAuxiliariesWriter Init(IBusAuxiliariesDeclarationData inputData); + } + + public abstract class XMLCompletedBusAuxiliariesWriter : IXMLBusAuxiliariesWriter + { + protected IBusAuxiliariesDeclarationData _inputData; + protected XElement _xElement; + protected readonly IGroupWriterFactory _groupWriterFactory; + + protected abstract string AuxType { get; } + protected XNamespace DefaultNamespace => XMLNamespaces.V24; + + protected XMLCompletedBusAuxiliariesWriter(IGroupWriterFactory groupWriterFactory) + { + _groupWriterFactory = groupWriterFactory; + } + + public XElement GetElement() + { + if (_xElement == null) + { + if (_inputData == null) { + throw new VectoException($"Writer not initialized call {nameof(Init)} first"); + } + Initialize(); + CreateElements(); + } + + return _xElement; + } + + public IXMLBusAuxiliariesWriter Init(IBusAuxiliariesDeclarationData inputData) + { + _inputData = inputData; + return this; + } + + public XElement GetElement(XNamespace wrapperNamespace) + { + throw new System.NotImplementedException(); + } + + protected void Initialize() + { + _xElement = new XElement(DefaultNamespace + XMLNames.Component_Auxiliaries); + } + + public abstract void CreateElements(); + } + + + + public class XMLCompletedBusAuxiliariesWriterConventional : XMLCompletedBusAuxiliariesWriter + { + protected override string AuxType => XMLTypes.AUX_Conventional_CompletedBusType; + + public XMLCompletedBusAuxiliariesWriterConventional(IGroupWriterFactory groupWriterFactory) : base(groupWriterFactory) + { + + } + + #region Overrides of XMLCompletedBusAuxiliariesWriter + + public override void CreateElements() + { + CreateElementsWithGroupWriters(); + } + + private void CreateElementsWithGroupWriters() + { + + var dataElement = new XElement(DefaultNamespace + XMLNames.ComponentDataWrapper, + new XAttribute("xmlns", XMLNamespaces.V24), + new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, AuxType)); + + if (_inputData.ElectricConsumers != null) + { + var electricSystemElement = new XElement(DefaultNamespace + XMLNames.BusAux_ElectricSystem); + var ledLightsElement = new XElement(DefaultNamespace + "LEDLights"); + ledLightsElement.Add( + // ReSharper disable once CoVariantArrayConversion + _groupWriterFactory.GetBusAuxiliariesDeclarationGroupWriter(GroupNames.BusAuxElectricSystemLightsGroup, DefaultNamespace) + .GetGroupElements(_inputData)); + electricSystemElement.Add(ledLightsElement); + dataElement.Add(electricSystemElement); + + } + + if (_inputData.HVACAux != null) + { + var hvacElement = new XElement(DefaultNamespace + "HVAC"); + hvacElement.Add(_groupWriterFactory + .GetBusAuxiliariesDeclarationGroupWriter(GroupNames.BusAuxHVACConventionalSequenceGroup, + DefaultNamespace) + .GetGroupElements(_inputData)); + dataElement.Add(hvacElement); + } + + _xElement.Add(dataElement); + + } + + private XElement GetHeatPumpTypeElement(string xmlName, string value) + { + if (value == "~null~") + { + value = null; + } + return new XElement(DefaultNamespace + xmlName, value); + } + + private XElement GetHeatPumpGroupElement(string xmlNameWrapper, string xmlNameFirstComponent, + string xmlNameSecondComponent, string firstValue, string secondValue) + { + var element = new XElement(DefaultNamespace + xmlNameWrapper, + new XElement(DefaultNamespace + xmlNameFirstComponent, firstValue), + new XElement(DefaultNamespace + xmlNameSecondComponent, secondValue)); + + return element; + } + + + #endregion + } + + + public class XMLCompletedBusAuxiliariesWriter_xEV : XMLCompletedBusAuxiliariesWriter + { + public XMLCompletedBusAuxiliariesWriter_xEV(IGroupWriterFactory groupWriterFactory) : base(groupWriterFactory) { } + protected override string AuxType => XMLTypes.AUX_xEV_CompletedBusType; + + public override void CreateElements() + { + CreateElementsWithGroupWriters(); + } + + private void CreateElementsWithGroupWriters() + { + + var dataElement = new XElement(DefaultNamespace + XMLNames.ComponentDataWrapper, + new XAttribute("xmlns", XMLNamespaces.V24), + new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, AuxType)); + + if (_inputData.ElectricConsumers != null) + { + var electricSystemElement = new XElement(DefaultNamespace + XMLNames.BusAux_ElectricSystem); + var ledLightsElement = new XElement(DefaultNamespace + XMLNames.BusAux_LEDLights); + ledLightsElement.Add( + // ReSharper disable once CoVariantArrayConversion + _groupWriterFactory.GetBusAuxiliariesDeclarationGroupWriter(GroupNames.BusAuxElectricSystemLightsGroup, DefaultNamespace) + .GetGroupElements(_inputData)); + electricSystemElement.Add(ledLightsElement); + dataElement.Add(electricSystemElement); + + } + + if (_inputData.HVACAux != null) + { + var hvacElement = new XElement(DefaultNamespace + XMLNames.BusAux_HVAC); + hvacElement.Add(_groupWriterFactory.GetBusAuxiliariesDeclarationGroupWriter(GroupNames.BusAuxHVACConventionalSequenceGroup, DefaultNamespace) + .GetGroupElements(_inputData)); + hvacElement.Add(_groupWriterFactory.GetBusAuxiliariesDeclarationGroupWriter(GroupNames.BusAuxHVACxEVSequenceGroup, DefaultNamespace) + .GetGroupElements(_inputData)); + dataElement.Add(hvacElement); + } + + _xElement.Add(dataElement); + + } + + + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/Util/XML/Components/XMLComponentsWriter.cs b/VECTO3GUI2020/Util/XML/Components/XMLComponentsWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..70a8eb20e205f36eaf5b8e158d0b695f60a2ff9f --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Components/XMLComponentsWriter.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using TUGraz.IVT.VectoXML.Writer; +using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.Resources.XML; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; +using EnvironmentVariableTarget = System.EnvironmentVariableTarget; + +namespace VECTO3GUI2020.Util.XML.Components +{ + + + public abstract class XMLCompletedBusComponentsWriter : IXMLComponentsWriter + { + protected IVehicleComponentsDeclaration _inputData; + protected readonly IXMLWriterFactory _writerFactory; + + public XMLCompletedBusComponentsWriter(IXMLWriterFactory writerFactory) + { + _writerFactory = writerFactory; + } + + + #region Implementation of IXMLComponentsWriter + + public XElement GetComponents() + { + if (_inputData == null) { + throw new VectoException("Input data not initialized"); + } + + return DoCreateComponents(); + } + + protected abstract XElement DoCreateComponents(); + + public IXMLComponentsWriter Init(IVehicleComponentsDeclaration inputData) + { + _inputData = inputData; + return this; + } + + #endregion + } + + public class XMLCompletedBusComponentsWriter_xEV : XMLCompletedBusComponentsWriter + { + + public static (XNamespace ns, string xsdType) VERSION = ( + XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLTypes.Components_xEV_CompletedBusType); + + + + public XMLCompletedBusComponentsWriter_xEV(IXMLWriterFactory writerFactory) : base(writerFactory) { } + + #region Overrides of XMLCompletedBusComponentsWriter + + protected override XElement DoCreateComponents() + { + var componentElement = new XElement(VERSION.ns + XMLNames.Vehicle_Components, + new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, VERSION.xsdType)); + + + if (_inputData.AirdragInputData != null) + { + var airDragElement = _writerFactory.CreateComponentWriter(_inputData.AirdragInputData).GetElement(); + + var tempAirDragElement = new XElement(VERSION.ns + XMLNames.Component_AirDrag); + + airDragElement.Name = tempAirDragElement.Name; + componentElement.Add(airDragElement); + } + + if (_inputData.BusAuxiliaries != null) + { + var busAuxElement = _writerFactory.CreateComponentWriter(_inputData.BusAuxiliaries).GetElement(); + + + componentElement.Add(busAuxElement); + } + + + return componentElement; + } + + #endregion + } + + public class XMLCompletedBusComponentWriter_Conventional : XMLCompletedBusComponentsWriter + { + public static (XNamespace ns, string xsdType) VERSION = ( + XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLTypes.Components_Conventional_CompletedBusType); + + public XMLCompletedBusComponentWriter_Conventional(IXMLWriterFactory writerFactory) : base(writerFactory) { } + + #region Overrides of XMLCompletedBusComponentsWriter + + protected override XElement DoCreateComponents() + { + + var componentElement = new XElement(VERSION.ns + XMLNames.Vehicle_Components, + new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, VERSION.xsdType)); + + + if (_inputData.AirdragInputData != null) { + var airDragElement = _writerFactory.CreateComponentWriter(_inputData.AirdragInputData).GetElement(); + + var tempAirDragElement = new XElement(VERSION.ns + XMLNames.Component_AirDrag); + + airDragElement.Name = tempAirDragElement.Name; + componentElement.Add(airDragElement); + } + + if (_inputData.BusAuxiliaries != null) { + var busAuxElement = _writerFactory.CreateComponentWriter(_inputData.BusAuxiliaries).GetElement(); + + + componentElement.Add(busAuxElement); + } + + + return componentElement; + + } + + #endregion + } +} diff --git a/VECTO3GUI2020/Util/XML/Components/XMLEngineWriter.cs b/VECTO3GUI2020/Util/XML/Components/XMLEngineWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..3c66ba8140dcf184ea6f6b6d3ea7eff2ffd2b960 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Components/XMLEngineWriter.cs @@ -0,0 +1,162 @@ +//using System; +//using System.Collections.Generic; +//using System.Data; +//using System.Diagnostics; +//using System.Linq; +//using System.Reflection; +//using System.Text; +//using System.Threading.Tasks; +//using System.Xml.Linq; +//using TUGraz.VectoCommon.InputData; +//using TUGraz.VectoCommon.Models; +//using TUGraz.VectoCommon.Resources; +//using TUGraz.VectoCommon.Utils; +//using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +//using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +//using TUGraz.VectoCore.Utils; +//using VECTO3GUI2020.Helper; +//using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +//namespace VECTO3GUI2020.Util.XML.Components +//{ +// public abstract class XMLEngineWriter : IXMLComponentWriter +// { +// protected XElement _xElement; +// protected XNamespace _defaultNameSpace; +// protected readonly IEngineDeclarationInputData _inputData; +// protected string id = "toDo-Add-Identifier"; + +// public XMLEngineWriter(IEngineDeclarationInputData inputData) +// { +// _inputData = inputData; +// } + +// public virtual XElement GetElement() +// { +// if (_xElement == null) +// { +// Initialize(); +// CreateDataElements(); +// _xElement.Add(this.CreateSignatureElement(_defaultNameSpace, id, _inputData.DigestValue)); +// } + +// return _xElement; +// } + +// protected abstract void Initialize(); +// protected abstract void CreateDataElements(); + + +// } + +// public class XMLEngineWriter_v1_0 : XMLEngineWriter +// { + +// public static readonly string[] SUPPORTED_VERSIONS = { +// typeof(EngineViewModel_v1_0).ToString() +// }; + + +// public override XElement GetElement() +// { +// throw new NotImplementedException(); +// } + +// protected override void Initialize() +// { +// throw new NotImplementedException(); +// } + +// protected override void CreateDataElements() +// { +// throw new NotImplementedException(); +// } + +// public XMLEngineWriter_v1_0(IEngineDeclarationInputData inputData) : base(inputData) { } +// } + +// public class XMLEngineWriter_v2_0 : XMLEngineWriter +// { +// private static XNamespace _v20 = XMLNamespaces.V20; +// public static readonly string[] SUPPORTED_VERSIONS = { +// typeof(EngineViewModel_v2_0).ToString(), +// }; + +// protected override void Initialize() +// { +// _defaultNameSpace = _v20; +// _xElement = new XElement(_defaultNameSpace + XMLNames.Component_Engine); +// } + +// protected override void CreateDataElements() +// { +// var _dataXElement = new XElement(_defaultNameSpace + XMLNames.ComponentDataWrapper); +// _xElement.Add(_dataXElement); +// _dataXElement.Add(new XAttribute(XMLNames.Component_ID_Attr, id)); +// _dataXElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Engine_Type_Attr)); + +// Debug.Assert(_xElement != null); +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Model, _inputData.Model)); +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_CertificationNumber, +// _inputData.CertificationNumber)); +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Date, _inputData.Date)); +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_AppVersion, _inputData.AppVersion)); +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_Displacement, _inputData.Displacement.ConvertToCubicCentiMeter().ToXMLFormat(0))); +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_IdlingSpeed, "100")); +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_RatedSpeed, _inputData.RatedSpeedDeclared.AsRPM.ToXMLFormat(0))); +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_RatedPower, _inputData.RatedPowerDeclared.ToXMLFormat(0))); +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_MaxTorque, _inputData.MaxTorqueDeclared.ToXMLFormat(0))); + +// Debug.Assert(_inputData.EngineModes.Count == 1, "Only 1 Engine Mode supported in XMLEngineWriter_v2_0"); +// var mode = _inputData.EngineModes[0]; + +// Debug.Assert(mode.Fuels.Count == 1, "Only one fuel supported in XMLEngineWriter_v2_0"); +// var fuel = mode.Fuels[0]; + +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_WHTCUrban, fuel.WHTCUrban.ToXMLFormat(4))); +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_WHTCRural, fuel.WHTCRural.ToXMLFormat(4))); +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_WHTCMotorway, fuel.WHTCMotorway.ToXMLFormat(4))); + +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_ColdHotBalancingFactor, fuel.ColdHotBalancingFactor.ToXMLFormat(4))); +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_CorrectionFactor_RegPer, fuel.CorrectionFactorRegPer.ToXMLFormat(4))); + + +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_CorrecionFactor_NCV, "1.0000")); + +// _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_FuelType, fuel.FuelType.ToXMLFormat())); + +// var fuelConsumptionMapElement = new XElement(_defaultNameSpace + XMLNames.Engine_FuelConsumptionMap); +// var tableData = fuel.FuelConsumptionMap; + +// foreach (DataRow fuelEntry in tableData.Rows) +// { +// var entry = new XElement(_defaultNameSpace + XMLNames.Engine_FuelConsumptionMap_Entry); +// entry.Add(new XAttribute(XMLNames.Engine_FuelConsumptionMap_EngineSpeed_Attr, fuelEntry.ItemArray[0])); +// entry.Add(new XAttribute(XMLNames.Engine_FuelConsumptionMap_Torque_Attr, fuelEntry.ItemArray[1])); +// entry.Add(new XAttribute(XMLNames.Engine_FuelConsumptionMap_FuelConsumption_Attr, fuelEntry.ItemArray[2])); +// fuelConsumptionMapElement.Add(entry); +// } +// _dataXElement.Add(fuelConsumptionMapElement); + +// var fullLoadAndDragCurveElement = new XElement(_defaultNameSpace + XMLNames.Engine_FullLoadAndDragCurve); +// tableData = mode.FullLoadCurve; +// foreach (DataRow loadAndDragEntry in tableData.Rows) +// { +// var entry = new XElement(_defaultNameSpace + XMLNames.Engine_FullLoadCurve_Entry); +// entry.Add(new XAttribute(XMLNames.Engine_EngineFullLoadCurve_EngineSpeed_Attr, loadAndDragEntry.ItemArray[0])); +// entry.Add(new XAttribute(XMLNames.Engine_FullLoadCurve_MaxTorque_Attr, loadAndDragEntry.ItemArray[1])); +// entry.Add(new XAttribute(XMLNames.Engine_FullLoadCurve_DragTorque_Attr, loadAndDragEntry.ItemArray[2])); +// fullLoadAndDragCurveElement.Add(entry); +// } +// _dataXElement.Add(fullLoadAndDragCurveElement); +// } + + + +// public XMLEngineWriter_v2_0(IEngineDeclarationInputData inputData) : base(inputData) +// { + +// } +// } +//} diff --git a/VECTO3GUI2020/Util/XML/Components/XMLGearboxWriter.cs b/VECTO3GUI2020/Util/XML/Components/XMLGearboxWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..de7dd8888c90aa9c8c0cb7b35a72050baeda80a7 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Components/XMLGearboxWriter.cs @@ -0,0 +1,114 @@ +//using System; +//using System.Collections.Generic; +//using System.Data; +//using System.Diagnostics; +//using System.Linq; +//using System.Text; +//using System.Threading.Tasks; +//using System.Xml.Linq; +//using TUGraz.VectoCommon.InputData; +//using TUGraz.VectoCommon.Models; +//using TUGraz.VectoCommon.Resources; +//using TUGraz.VectoCommon.Utils; +//using VECTO3GUI2020.Helper; +//using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +//namespace VECTO3GUI2020.Util.XML.Components +//{ +// public abstract class XMLGearboxWriter : IXMLComponentWriter +// { +// protected IGearboxDeclarationInputData _inputData; +// protected XElement _xElement; +// protected XNamespace _defaultNameSpace; +// protected string _uri = "toDo-Adduri"; + +// public XMLGearboxWriter(IGearboxDeclarationInputData inputData) +// { + +// _inputData = inputData; +// } + +// public virtual XElement GetElement() +// { +// if (_xElement == null) +// { +// Initialize(); +// CreateDataElements(); +// _xElement.Add(this.CreateSignatureElement(_defaultNameSpace, _uri, _inputData.DigestValue)); +// } +// return _xElement; +// } + +// protected abstract void Initialize(); +// protected abstract void CreateDataElements(); +// } +// public class XMLGearboxWriter_v2_0 : XMLGearboxWriter +// { +// public static readonly string[] SUPPORTED_VERSIONS = { +// typeof(GearboxViewModel_v2_0).ToString() +// }; + +// public XMLGearboxWriter_v2_0(IGearboxDeclarationInputData inputData) : base(inputData) +// { +// } + +// protected override void Initialize() +// { +// _defaultNameSpace = XMLNamespaces.V20; +// _xElement = new XElement(_defaultNameSpace + XMLNames.Component_Gearbox); +// } + +// protected override void CreateDataElements() +// { +// var dataElement = new XElement(_defaultNameSpace + XMLNames.ComponentDataWrapper); +// _xElement.Add(dataElement); +// dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri)); +// dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Gearbox_attr_GearboxDataDeclarationType)); +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Model, _inputData.Model)); +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Date, _inputData.Date)); +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_AppVersion, _inputData.AppVersion)); +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_TransmissionType, _inputData.Type.ToXMLFormat())); +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Gearbox_CertificationMethod, _inputData.CertificationMethod.ToXMLFormat())); + +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gears)); +// var gearsElement = dataElement.LastNode as XElement; +// gearsElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, XMLNames.Gearbox_Gears_Attr_GearsDeclarationType)); +// foreach (var gear in _inputData.Gears) +// { +// gearsElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gears_Gear)); +// var gearElement = gearsElement.LastNode as XElement; +// //var gearElement = new XElement(_defaultNameSpace + XMLNames.Gearbox_Gears_Gear); +// //gearsElement.Add(gearElement); +// gearElement.Add(new XAttribute(XMLNames.Gearbox_Gear_GearNumber_Attr, gear.Gear)); +// gearElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gear_Ratio, gear.Ratio.ToXMLFormat(3))); + +// if (gear.MaxTorque != null) +// { +// gearElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gears_MaxTorque, gear.MaxTorque)); +// } + +// if (gear.MaxInputSpeed != null) +// { +// gearElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gear_MaxSpeed, gear.MaxInputSpeed)); +// } + +// var torqueLossMapElement = new XElement(_defaultNameSpace + XMLNames.Gearbox_Gear_TorqueLossMap); +// gearElement.Add(torqueLossMapElement); +// foreach (DataRow torquelossEntry in gear.LossMap.Rows) +// { +// var entry = new XElement(_defaultNameSpace + XMLNames.Gearbox_Gear_TorqueLossMap_Entry); +// torqueLossMapElement.Add(entry); +// entry.Add(new XAttribute(XMLNames.TransmissionLossmap_InputSpeed_Attr, torquelossEntry[0].ToString())); +// entry.Add(new XAttribute(XMLNames.TransmissionLossmap_InputTorque_Attr, torquelossEntry[1].ToString())); +// entry.Add(new XAttribute(XMLNames.TransmissionLossmap_TorqueLoss_Attr, torquelossEntry[2].ToString())); + +// } +// } +// Debug.WriteLine(_xElement.ToString()); +// } + + +// } +//} diff --git a/VECTO3GUI2020/Util/XML/Components/XMLPTOWriter.cs b/VECTO3GUI2020/Util/XML/Components/XMLPTOWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..a48091c3014b905f99d1b62210ec48728d2812bb --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Components/XMLPTOWriter.cs @@ -0,0 +1,84 @@ +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using System.Threading.Tasks; +//using System.Xml.Linq; +//using TUGraz.VectoCommon.InputData; +//using TUGraz.VectoCommon.Resources; +//using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader; +//using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +//namespace VECTO3GUI2020.Util.XML.Components +//{ +// public abstract class XMLPTOWriter : IXMLComponentWriter +// { +// protected XElement _xElement; +// protected XNamespace _defaultNamespace; +// private IPTOTransmissionInputData _inputData; + +// public XMLPTOWriter(IPTOTransmissionInputData inputData) +// { +// _inputData = inputData; +// Initialize(); +// CreateElements(); +// } + + + +// public XElement GetElement() +// { +// return _xElement; +// } + +// protected abstract void Initialize(); +// protected abstract void CreateElements(); +// } + +// public class XMLPTOWriter_v1_0 : XMLPTOWriter +// { +// public static readonly string[] SUPPORTED_VERSIONS = { +// typeof(PTOViewModel_V1_0).ToString() +// }; + +// public XMLPTOWriter_v1_0(IPTOTransmissionInputData inputData) : base(inputData) { } + +// protected override void Initialize() +// { + +// throw new NotImplementedException(); +// } + +// protected override void CreateElements() +// { +// throw new NotImplementedException(); +// } +// } + + + + +// public class XMLPTOWriter_v2_0 : XMLPTOWriter_v1_0 +// { +// public static readonly string[] SUPPORTED_VERSIONS = { +// typeof(PTOViewModel_V2_0).ToString() +// }; + +// public XMLPTOWriter_v2_0(IPTOTransmissionInputData inputData) : base(inputData) { } + +// protected override void Initialize() +// { +// _defaultNamespace = XMLNamespaces.V20; +// _xElement = new XElement(_defaultNamespace + XMLNames.Vehicle_PTO); +// _xElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, XMLNames.Component_Type_Attr_PTO)); +// } + +// protected override void CreateElements() +// { +// _xElement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_PTO_ShaftsGearWheels, "none")); +// _xElement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_PTO_OtherElements, "none")); +// } +// } + + +//} diff --git a/VECTO3GUI2020/Util/XML/Components/XMLRetarderWriter.cs b/VECTO3GUI2020/Util/XML/Components/XMLRetarderWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..fb1c8be9e7e57c5583dce015ecd051df1b88bf80 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Components/XMLRetarderWriter.cs @@ -0,0 +1,106 @@ +//using System; +//using System.Collections.Generic; +//using System.Data; +//using System.Linq; +//using System.Text; +//using System.Threading.Tasks; +//using System.Xml.Linq; +//using TUGraz.VectoCommon.InputData; +//using TUGraz.VectoCommon.Models; +//using TUGraz.VectoCommon.Resources; +//using VECTO3GUI2020.Helper; +//using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +//namespace VECTO3GUI2020.Util.XML.Components +//{ +// public abstract class XMLRetarderWriter : IXMLComponentWriter +// { +// protected XElement _xElement; +// protected IRetarderInputData _inputData; +// protected XNamespace _defaultNameSpace; +// protected string _uri = "toTo-Add-URI"; + +// public XMLRetarderWriter(IRetarderInputData inputData) +// { +// _inputData = inputData; +// } + +// protected abstract void Initialize(); +// protected abstract void CreateDataElements(); + +// public XElement GetElement() +// { +// if (_xElement == null) +// { +// Initialize(); +// CreateDataElements(); +// _xElement.Add(this.CreateSignatureElement(_defaultNameSpace, _uri, _inputData.DigestValue)); +// } +// return _xElement; +// } +// } + +// public class XMLRetarderWriter_v1_0 : XMLRetarderWriter +// { +// public static readonly string[] SUPPORTED_VERSIONS = { +// typeof(RetarderViewModel_v1_0).ToString() +// }; + +// protected override void Initialize() +// { +// _defaultNameSpace = XMLNamespaces.V10; +// _xElement = new XElement(_defaultNameSpace + XMLNames.Component_Retarder); +// } + +// protected override void CreateDataElements() +// { +// var dataElement = new XElement(_defaultNameSpace + XMLNames.ComponentDataWrapper); +// _xElement.Add(dataElement); + +// dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri)); +// dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, XMLNames.Retarder_Attr_DataDeclarationType)); +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Model, _inputData.Model)); +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Date, _inputData.Date)); +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_AppVersion, _inputData.AppVersion)); +// dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_CertificationMethod, _inputData.CertificationMethod.ToXMLFormat())); + +// var lossMapElement = new XElement(_defaultNameSpace + XMLNames.Retarder_RetarderLossMap); +// dataElement.Add(lossMapElement); + +// foreach (DataRow lossMapRow in _inputData.LossMap.Rows) +// { +// var entryElement = new XElement(_defaultNameSpace + XMLNames.Retarder_RetarderLossMap_Entry); +// entryElement.Add(new XAttribute(XMLNames.Retarder_RetarderLossmap_RetarderSpeed_Attr, lossMapRow[0].ToString())); +// entryElement.Add(new XAttribute(XMLNames.Retarder_RetarderLossmap_TorqueLoss_Attr, lossMapRow[1].ToString())); +// lossMapElement.Add(entryElement); +// } +// } + +// public XMLRetarderWriter_v1_0(IRetarderInputData inputData) : base(inputData) { } +// } + + + +// public class XMLRetarderWriter_v2_0 : XMLRetarderWriter_v1_0 +// { +// public static readonly string[] SUPPORTED_VERSIONS = { +// typeof(RetarderViewModel_v2_0).ToString() +// }; + + +// public XMLRetarderWriter_v2_0(IRetarderInputData inputData) : base(inputData) +// { + +// } + + + +// protected override void Initialize() +// { +// _defaultNameSpace = XMLNamespaces.V20; +// _xElement = new XElement(_defaultNameSpace + XMLNames.Component_Retarder); +// } +// } +//} diff --git a/VECTO3GUI2020/Util/XML/Components/XMLTyreWriter.cs b/VECTO3GUI2020/Util/XML/Components/XMLTyreWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..f94d276ae29debb772dcdb76bbf4e62f85740011 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Components/XMLTyreWriter.cs @@ -0,0 +1,100 @@ +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using System.Threading.Tasks; +//using System.Xml.Linq; +//using TUGraz.VectoCommon.InputData; +//using TUGraz.VectoCommon.Resources; +//using TUGraz.VectoCommon.Utils; +//using VECTO3GUI2020.Helper; +//using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +//namespace VECTO3GUI2020.Util.XML.Components +//{ +// public abstract class XMLTyreWriter : IXMLComponentWriter +// { +// protected ITyreDeclarationInputData _inputData; + +// protected XNamespace _defaultNamespace; +// protected XElement _xElement; +// protected string _uri = "ToDo-Add-Id"; + +// public XMLTyreWriter(ITyreDeclarationInputData inputData) +// { +// _inputData = inputData; +// } + +// public XElement GetElement() +// { +// if (_xElement == null) +// { +// Initialize(); +// CreateDataElements(); +// _xElement.Add(this.CreateSignatureElement(_defaultNamespace, _uri, _inputData.DigestValue)); +// } + +// return _xElement; +// } +// protected abstract void Initialize(); +// protected abstract void CreateDataElements(); + + + + + +// } + +// public class XMLTyreWriter_v2_0 : XMLTyreWriter +// { +// public static readonly string[] SUPPORTED_VERSIONS = { +// typeof(TyreViewModel_v2_0).ToString() +// }; + +// public XMLTyreWriter_v2_0(ITyreDeclarationInputData inputData) : base(inputData) { } +// protected override void CreateDataElements() +// { +// var dataElement = new XElement(_defaultNamespace + XMLNames.ComponentDataWrapper); +// _xElement.Add(dataElement); + +// dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri)); +// dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Tyre_Type_Attr_TyreDataDeclarationType)); +// dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); +// dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model)); +// dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); +// dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Date, _inputData.Date)); +// dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_AppVersion, _inputData.AppVersion)); +// dataElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_Dimension, _inputData.Dimension)); +// dataElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_RRCDeclared, _inputData.RollResistanceCoefficient.ToXMLFormat(4))); +// dataElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_FzISO, _inputData.TyreTestLoad.ToXMLFormat(0))); +// } + +// protected override void Initialize() +// { +// _defaultNamespace = XMLNamespaces.V20; +// _xElement = new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_Tyre); +// } + +// } + +// public class XMLTyreWriter_v2_3 : XMLTyreWriter_v2_0 +// { +// public new static readonly string[] SUPPORTED_VERSIONS = { +// typeof(TyreViewModel_v2_3).ToString() +// }; +// public XMLTyreWriter_v2_3(ITyreDeclarationInputData inputData) : base(inputData) { } + +// protected override void CreateDataElements() +// { +// base.CreateDataElements(); + +// } + +// protected override void Initialize() +// { +// _defaultNamespace = XMLNamespaces.V23; +// _xElement = new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_Tyre); +// } +// } + +//} diff --git a/VECTO3GUI2020/Util/XML/Documents/IXMLDeclarationJobWriter.cs b/VECTO3GUI2020/Util/XML/Documents/IXMLDeclarationJobWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..2d8dceabbe3e943ccbe0dced575c28ca391dd5b0 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Documents/IXMLDeclarationJobWriter.cs @@ -0,0 +1,9 @@ +using System.Xml.Linq; + +namespace VECTO3GUI2020.Util.XML.Documents +{ + public interface IXMLDeclarationJobWriter + { + XDocument GetDocument(); + } +} diff --git a/VECTO3GUI2020/Util/XML/Documents/XMLDeclarationJobWriter.cs b/VECTO3GUI2020/Util/XML/Documents/XMLDeclarationJobWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..59fa061e7e2fca06b67b1989caf1c76dda15ea1d --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Documents/XMLDeclarationJobWriter.cs @@ -0,0 +1,97 @@ +using System; +using System.Diagnostics; +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit; + +namespace VECTO3GUI2020.Util.XML.Documents +{ + public abstract class XMLDeclarationJobWriter : IXMLDeclarationJobWriter + { + + protected XDocument _xDocument; + protected string _schemaVersion; + private IXMLWriterFactory _xmlWriterFactory; + + protected string LocalSchemaLocation = @"V:\VectoCore\VectoCore\Resources\XSD\"; + + //Must be overwritten by subclasses; + protected abstract void Initialize(); + + + + public XMLDeclarationJobWriter(IDeclarationJobInputData inputData, IXMLWriterFactory xmlWriterFactory) + { + _xmlWriterFactory = xmlWriterFactory; + Initialize(); + + (_xDocument.FirstNode as XElement)?.Add(_xmlWriterFactory.CreateVehicleWriter(inputData.Vehicle).GetElement()); + var rootElement = _xDocument.FirstNode as XElement; + + } + + + + + + public XDocument GetDocument() + { + return _xDocument; + } + } + + + public class XMLDeclarationJobWriter_v1_0 : XMLDeclarationJobWriter + { + + + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(XMLDeclarationJobInputDataProviderV10).ToString() + }; + public XMLDeclarationJobWriter_v1_0(IDeclarationJobInputData inputData, IXMLWriterFactory xmlWriterFactory) : base(inputData, xmlWriterFactory) + { + + } + protected override void Initialize() + { + throw new NotImplementedException(); + } + + + } + + public class XMLDeclarationJobWriter_v2_0 : XMLDeclarationJobWriter + { + + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(DeclarationJobEditViewModel_v2_0).ToString(), + typeof(XMLDeclarationJobInputDataProviderV20).ToString() + }; + + public XMLDeclarationJobWriter_v2_0(IDeclarationJobInputData inputData, IXMLWriterFactory xmlWriterFactory) : base(inputData, xmlWriterFactory) + { + + } + + protected override void Initialize() + { + _schemaVersion = "2.0"; + _xDocument = new XDocument(); + + var xElement = new XElement(XMLNamespaces.Tns_v20 + XMLNames.VectoInputDeclaration); + _xDocument.Add(xElement); + + xElement.Add(new XAttribute("schemaVersion", _schemaVersion)); + xElement.Add(new XAttribute("xmlns", XMLNamespaces.DeclarationDefinition + ":v" + _schemaVersion)); + xElement.Add(new XAttribute(XNamespace.Xmlns + "xsi", XMLNamespaces.Xsi.NamespaceName)); + xElement.Add(new XAttribute(XNamespace.Xmlns + "tns", XMLNamespaces.Tns_v20)); + xElement.Add(new XAttribute(XMLNamespaces.Xsi + "schemaLocation", + $"{XMLNamespaces.DeclarationRootNamespace} {LocalSchemaLocation}VectoDeclarationJob.xsd")); + + Debug.WriteLine(_xDocument.ToString()); + } + } + +} diff --git a/VECTO3GUI2020/Util/XML/IXMLWriterFactory.cs b/VECTO3GUI2020/Util/XML/IXMLWriterFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..f49dbfd37296c244eb9eb7b2360f9605a2c1a4a7 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/IXMLWriterFactory.cs @@ -0,0 +1,156 @@ +using System; +using System.Xml.Linq; +using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.InputData; +using VECTO3GUI2020.Util.XML.Components; +using VECTO3GUI2020.Util.XML.Documents; +using VECTO3GUI2020.Util.XML.Vehicle; + +namespace VECTO3GUI2020.Util.XML +{ + public interface IXMLWriterFactory + { + IXMLDeclarationJobWriter CreateJobWriter(IDeclarationJobInputData inputData); + IXMLVehicleWriter CreateVehicleWriter(IVehicleDeclarationInputData inputData); + + + + //IXMLComponentWriter CreateComponentWriter(IComponentInputData inputData); + //IXMLComponentWriter CreateComponentWriter(IAuxiliariesDeclarationInputData inputData); + //IXMLComponentWriter CreateComponentWriter(IAxlesDeclarationInputData inputData); + //IXMLComponentWriter CreateComponentWriter(IAxleDeclarationInputData inputData); + + + //IXMLComponentWriter CreateComponentWriter(IPTOTransmissionInputData inputData); + //IXMLComponentsWriter CreateComponentsWriter(IVehicleComponentsDeclaration inputData); + + IXMLComponentsWriter CreateComponentsWriterWithVersion(XNamespace ns, string xsdType, + IVehicleComponentsDeclaration inputData); + IXMLComponentsWriter CreateComponentsWriterWithVersion(XNamespace ns, string xsdType); + //IXMLBusAuxiliariesWriter CreateBuxAuxiliariesWriter(IBusAuxiliariesDeclarationData inputData); + + + #region Airdrag + IXMLComponentWriter CreateComponentWriter(IAirdragDeclarationInputData inputData); + #endregion + + #region BusAux + + IXMLBusAuxiliariesWriter CreateComponentWriter(IBusAuxiliariesDeclarationData inputData); + #endregion BusAux + + TWriter CreateComponentWriterWithVersion<TWriter>(XNamespace ns, string xsdType); + } + + public interface IXMLWriterFactoryInternal + { + TWriter CreateWriter<TWriter, TData>(DataSource source, TData inputData); + TWriter CreateComponentsWriter<TWriter>(DataSource source); + TWriter CreateComponentWriter<TWriter>(DataSource source); + } + + public class XMLWriterFactory : IXMLWriterFactory + { + private IXMLWriterFactoryInternal _internalFactory; + + public XMLWriterFactory(IXMLWriterFactoryInternal internalFactory) + { + _internalFactory = internalFactory; + } + private TWriter CreateWriter<TWriter, TData>(DataSource source, TData inputData) + { + return _internalFactory.CreateWriter<TWriter, TData>(source, inputData); + } + + + + + #region Implementation of IXMLWriterFactory + + public IXMLDeclarationJobWriter CreateJobWriter(IDeclarationJobInputData inputData) + { + throw new NotImplementedException(); + } + + public IXMLVehicleWriter CreateVehicleWriter(IVehicleDeclarationInputData inputData) + { + return _internalFactory.CreateWriter<IXMLVehicleWriter, IVehicleDeclarationInputData>(inputData.DataSource, inputData); + //throw new System.NotImplementedException(); + } + + public IXMLComponentWriter CreateComponentWriter(IComponentInputData inputData) + { + throw new NotImplementedException(); + } + + public IXMLComponentWriter CreateComponentWriter(IAuxiliariesDeclarationInputData inputData) + { + throw new NotImplementedException(); + } + + public IXMLComponentWriter CreateComponentWriter(IAxlesDeclarationInputData inputData) + { + throw new NotImplementedException(); + } + + public IXMLComponentWriter CreateComponentWriter(IAxleDeclarationInputData inputData) + { + throw new NotImplementedException(); + } + + public IXMLComponentWriter CreateComponentWriter(IAirdragDeclarationInputData inputData) + { + return _internalFactory.CreateComponentWriter<IXMLComponentWriter>(inputData.DataSource).Init(inputData); + } + + public IXMLBusAuxiliariesWriter CreateComponentWriter(IBusAuxiliariesDeclarationData inputData) + { + if (inputData.DataSource == null) { + throw new VectoException("No version specified in datasource"); + } + return _internalFactory.CreateComponentWriter<IXMLBusAuxiliariesWriter>(inputData.DataSource).Init(inputData); + } + + + public TWriter CreateComponentWriterWithVersion<TWriter>(XNamespace ns, string xsdType) + { + return _internalFactory.CreateComponentWriter<TWriter>(new DataSource() { + TypeVersion = ns.ToString(), + Type = xsdType, + }); + } + + public IXMLComponentWriter CreateComponentWriter(IPTOTransmissionInputData inputData) + { + throw new NotImplementedException(); + } + + public IXMLComponentsWriter CreateComponentsWriter(IVehicleComponentsDeclaration inputData) + { + throw new NotImplementedException(); + } + + public IXMLComponentsWriter CreateComponentsWriterWithVersion(XNamespace ns, string xsdType) + { + return _internalFactory.CreateComponentsWriter<IXMLComponentsWriter>(new DataSource() + { + TypeVersion = ns.ToString(), + Type = xsdType, + }); + } + + public IXMLComponentsWriter CreateComponentsWriterWithVersion(XNamespace ns, string xsdType, + IVehicleComponentsDeclaration inputData) + { + return CreateComponentsWriterWithVersion(ns, xsdType).Init(inputData); + } + + //public IXMLBusAuxiliariesWriter CreateBuxAuxiliariesWriter(IBusAuxiliariesDeclarationData inputData) + // { + // throw new NotImplementedException(); + // } + + + #endregion + } +} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAirDragWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAirDragWriter.cs deleted file mode 100644 index 07e369e7a66d2915158042fa391d8354cf1665b9..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAirDragWriter.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Linq; -using System.Xml.Linq; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Resources; -using VECTO3GUI2020.Helper; -using VECTO3GUI2020.Util.XML.Interfaces; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; -using VECTO3GUI2020.ViewModel.MultiStage.Implementation; - -namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter -{ - public abstract class XMLAirDragWriter : IXMLComponentWriter - { - protected IAirdragDeclarationInputData _inputData; - protected XNamespace _defaultNamespace; - protected XElement _xElement; - protected string _uri = "ToDO-Add-id"; - - public XMLAirDragWriter(IAirdragDeclarationInputData inputData) - { - _inputData = inputData; - _uri = inputData.DigestValue?.Reference?.Replace("#",""); - if (_uri == null) { - _uri = "AirdragComponent" + Guid.NewGuid().ToString("n").Substring(0, 20); - } - } - - public XElement GetElement() - { - if (_xElement == null) { - - Initialize(); - CreateDataElements(); - var signatureElemnet = this.CreateSignatureElement(_defaultNamespace, _uri, _inputData.DigestValue); - _xElement.Add(signatureElemnet); - } - - return _xElement; - } - - public XElement GetElement(XNamespace wrapperNamespace) - { - throw new NotImplementedException(); - } - - protected abstract void Initialize(); - protected abstract void CreateDataElements(); - - - } - - public class XMLAirDragWriter_v2_0 : XMLAirDragWriter - { - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(AirDragViewModel_v2_0).ToString(), - typeof(MultistageAirdragViewModel).ToString() - }; - public XMLAirDragWriter_v2_0(IAirdragDeclarationInputData inputData) : base(inputData) { } - protected override void CreateDataElements() - { - var dataElement = new XElement(_defaultNamespace + XMLNames.ComponentDataWrapper); - _xElement.Add(dataElement); - - dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri), new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, "v2.0:" + - XMLNames.AirDrag_Data_Type_Attr)); - - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Date, _inputData.Date)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_AppVersion, _inputData.AppVersion)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.AirDrag_CdxA_0, _inputData.AirDragArea_0.ToXMLFormat(2))); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.AirDrag_TransferredCDxA, _inputData.TransferredAirDragArea.ToXMLFormat(2))); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.AirDrag_DeclaredCdxA, _inputData.AirDragArea.ToXMLFormat(2))); - - - dataElement.DescendantsAndSelf().Where(e => string.IsNullOrEmpty(e.Value)).Remove(); - } - - protected override void Initialize() - { - _defaultNamespace = XMLNamespaces.V20; - _xElement = new XElement(XMLNames.Component_AirDrag); - } - } -} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAuxiliariesWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAuxiliariesWriter.cs deleted file mode 100644 index aadcf95e8de288c0e7d0fa61dbb3fe40cba2cc71..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAuxiliariesWriter.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Resources; -using VECTO3GUI2020.Util.XML.Interfaces; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; - -namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter -{ - public abstract class XMLAuxiliariesWriter : IXMLComponentWriter - { - protected XNamespace _defaultNamespace; - protected XElement _xElement; - protected IAuxiliariesDeclarationInputData _inputData; - - public XMLAuxiliariesWriter(IAuxiliariesDeclarationInputData inputData) - { - _inputData = inputData; - } - - public XElement GetElement() - { - if (_xElement == null) { - Initialize(); - CreateElements(); - } - - return _xElement; - } - public abstract void Initialize(); - - public abstract void CreateElements(); - } - - public class XMLAuxiliariesWriter_v2_0 : XMLAuxiliariesWriter - { - - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(AuxiliariesViewModel_v2_0).ToString() - }; - - public XMLAuxiliariesWriter_v2_0(IAuxiliariesDeclarationInputData inputData) : base(inputData) { } - - public override void CreateElements() - { - var dataElement = new XElement(_defaultNamespace + XMLNames.ComponentDataWrapper); - _xElement.Add(dataElement); - - dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Auxiliaries_Type_Attr_DataDeclarationType)); - - foreach (var auxiliary in _inputData.Auxiliaries) { - var auxElement = new XElement(_defaultNamespace + auxiliary.Type.ToString()); - auxElement.Add(new XElement(_defaultNamespace + XMLNames.Auxiliaries_Auxiliary_Technology, - auxiliary.Technology[0])); - dataElement.Add(auxElement); - } - } - - public override void Initialize() - { - _defaultNamespace = XMLNamespaces.V20; - _xElement = new XElement(_defaultNamespace + XMLNames.Component_Auxiliaries); - } - } -} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleGearWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleGearWriter.cs deleted file mode 100644 index d687eb07adb2732548f1aa3ebf22b92144a04d35..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleGearWriter.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Models; -using TUGraz.VectoCommon.Resources; -using TUGraz.VectoCommon.Utils; -using VECTO3GUI2020.Helper; -using VECTO3GUI2020.Util.XML.Interfaces; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; - -namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter -{ - public abstract class XMLAxleGearWriter : IXMLComponentWriter - { - protected XElement _xElement; - protected IAxleGearInputData _inputData; - protected XNamespace _defaultNamespace; - protected string _uri = "ToDO-ADD_URI"; - - public XMLAxleGearWriter(IAxleGearInputData inputData) - { - _inputData = inputData; - - - } - - public abstract void Initialize(); - public abstract void CreateDataElements(); - - public XElement GetElement() - { - if (_xElement == null) { - Initialize(); - CreateDataElements(); - _xElement.Add(this.CreateSignatureElement(_defaultNamespace, _uri, _inputData.DigestValue)); - } - return _xElement; - } - } - - public class XMLAxleGearWriter_v2_0 : XMLAxleGearWriter - { - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(AxleGearViewModel_v2_0).ToString() - }; - - - public XMLAxleGearWriter_v2_0(IAxleGearInputData inputData) : base(inputData) - { - - } - - - public override void Initialize() - { - _defaultNamespace = XML.XMLNamespaces.V20; - _xElement = new XElement(_defaultNamespace + XMLNames.Component_Axlegear); - } - - public override void CreateDataElements() - { - var dataElement = new XElement(_defaultNamespace + XMLNames.ComponentDataWrapper); - _xElement.Add(dataElement); - - dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri)); - dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.AxleGear_Type_Attr)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Date, _inputData.Date)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_AppVersion, _inputData.AppVersion)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Axlegear_LineType, _inputData.LineType.ToXMLFormat())); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.AngleDrive_Ratio, _inputData.Ratio.ToXMLFormat(3))); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_CertificationMethod, _inputData.CertificationMethod.ToXMLFormat())); - - var torqueLossMap = new XElement(_defaultNamespace + XMLNames.Axlegear_TorqueLossMap); - dataElement.Add(torqueLossMap); - foreach (DataRow row in _inputData.LossMap.Rows) { - var entry = new XElement(_defaultNamespace + XMLNames.Axlegear_TorqueLossMap_Entry); - entry.Add(new XAttribute(XMLNames.TransmissionLossmap_InputSpeed_Attr, row[0].ToString())); - entry.Add(new XAttribute(XMLNames.TransmissionLossmap_InputTorque_Attr, row[1].ToString())); - entry.Add(new XAttribute(XMLNames.TransmissionLossmap_TorqueLoss_Attr, row[2].ToString())); - torqueLossMap.Add(entry); - } - } - } -} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleWheelWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleWheelWriter.cs deleted file mode 100644 index f52ba462826299b408bb0f7ef5b2fc9e6ea5e585..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleWheelWriter.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Resources; -using VECTO3GUI2020.Util.XML.Interfaces; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; - -namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter -{ - public abstract class XMLAxleWheelWriter : IXMLComponentWriter - { - protected IXMLWriterFactory _writerFactory; - protected IAxleDeclarationInputData _inputData; - - protected XNamespace _defaultNamespace; - - protected XElement _xElement; - public XMLAxleWheelWriter(IAxleDeclarationInputData inputData, IXMLWriterFactory writerFactory) - { - _inputData = inputData; - _writerFactory = writerFactory; - } - - public XElement GetElement() - { - if (_xElement == null) { - Initialize(); - CreateElement(); - } - - return _xElement; - } - - protected abstract void CreateElement(); - protected abstract void Initialize(); - } - - - public class XMLAxleWheelWriter_v2_0 : XMLAxleWheelWriter - { - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(AxleViewModel_v2_0).ToString() - }; - public XMLAxleWheelWriter_v2_0(IAxleDeclarationInputData inputData, IXMLWriterFactory writerFactory) : base(inputData, writerFactory) { } - - protected override void CreateElement() - { - _xElement.Add(new XAttribute(XMLNames.AxleWheels_Axles_Axle_AxleNumber_Attr, 0));//_inputData.AxleNumber)); - _xElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Axle_Type_Attr_AxleDataDeclarationType)); - _xElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_AxleType, _inputData.AxleType)); - _xElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_TwinTyres, _inputData.TwinTyres)); - _xElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_Steered, false)); //_inputData.Steered)); - - _xElement.Add(_writerFactory.CreateComponentWriter(_inputData.Tyre).GetElement()); - } - - protected override void Initialize() - { - - _defaultNamespace = XML.XMLNamespaces.V20; - _xElement = new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle); - } - } -} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleWheelsWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleWheelsWriter.cs deleted file mode 100644 index 9692c640c49e5768fbef6a98b2272a12016c933a..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleWheelsWriter.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Resources; -using VECTO3GUI2020.Helper; -using VECTO3GUI2020.Util.XML.Interfaces; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; - -namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter -{ - public abstract class XMLAxleWheelsWriter : IXMLComponentWriter - { - protected XElement _xElement; - protected XNamespace _defaultNameSpace; - protected IAxlesDeclarationInputData _inputData; - protected IXMLWriterFactory _writerFactory; - - protected XMLAxleWheelsWriter(IAxlesDeclarationInputData inputData, IXMLWriterFactory writerFactory) - { - _inputData = inputData; - _writerFactory = writerFactory; - } - - public XElement GetElement() - { - if (_xElement == null) { - Initialize(); - CreateDataElements(); - } - - return _xElement; - } - - public abstract void CreateDataElements(); - public abstract void Initialize(); - } - - - public class XMLAxleWheelsWriter_v2_0 : XMLAxleWheelsWriter - { - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(AxleWheelsViewModel_v2_0).ToString() - }; - public override void CreateDataElements() - { - _xElement.Add(new XElement(_defaultNameSpace + XMLNames.ComponentDataWrapper)); - var dataElement = _xElement.LastNode as XElement; - - dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.AxleWheels_Type_Attr_AxleWheelsDeclarationType)); - - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.AxleWheels_Axles)); - var axles = dataElement.LastNode as XElement; - foreach (var axle in _inputData.AxlesDeclaration) { - axles.Add(_writerFactory.CreateComponentWriter(axle).GetElement()); - } - } - - public override void Initialize() - { - _defaultNameSpace = XML.XMLNamespaces.V20; - _xElement = new XElement(_defaultNameSpace + XMLNames.Component_AxleWheels); - } - - public XMLAxleWheelsWriter_v2_0(IAxlesDeclarationInputData inputData, IXMLWriterFactory writerFactory) : base(inputData, writerFactory) { } - } -} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLBusAuxiliariesWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLBusAuxiliariesWriter.cs deleted file mode 100644 index d26aba13d57821cf8ebdb23559612c6f983273ab..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLBusAuxiliariesWriter.cs +++ /dev/null @@ -1,178 +0,0 @@ -using System.Linq; -using System.Xml.Linq; - -using TUGraz.VectoCommon.BusAuxiliaries; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Resources; -using TUGraz.VectoCore.OutputData.XML.GroupWriter; -using VECTO3GUI2020.Util.XML.Interfaces; - -namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter -{ - public interface IXMLBusAuxiliariesWriter : IXMLComponentWriter - { - - } - - public abstract class XMLBusAuxiliariesWriter : IXMLBusAuxiliariesWriter - { - protected readonly IBusAuxiliariesDeclarationData _inputData; - protected XElement _xElement; - - protected XMLBusAuxiliariesWriter(IBusAuxiliariesDeclarationData inputData) - { - _inputData = inputData; - } - - public XElement GetElement() - { - if (_xElement == null) - { - Initialize(); - CreateElements(); - } - - return _xElement; - } - - public XElement GetElement(XNamespace wrapperNamespace) - { - throw new System.NotImplementedException(); - } - - public abstract void Initialize(); - - public abstract void CreateElements(); - } - - - - public class XMLBusAuxiliariesWriterMultistage : XMLBusAuxiliariesWriter - { - - - private XNamespace _defaultNamespace; - private readonly IGroupWriterFactory _groupWriterFactory; - - public XMLBusAuxiliariesWriterMultistage(IBusAuxiliariesDeclarationData inputData, - IGroupWriterFactory groupWriterFactory) : base(inputData) - { - _groupWriterFactory = groupWriterFactory; - } - - #region Overrides of XMLBusAuxiliariesWriter - - public override void Initialize() - { - _defaultNamespace = XMLNamespaces.V24; - _xElement = new XElement(_defaultNamespace + XMLNames.Component_Auxiliaries); - } - - public override void CreateElements() - { - CreateElementsWithGroupWriters(); - return; - - - var dataElement = new XElement(_defaultNamespace + XMLNames.ComponentDataWrapper, - new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, "CompletedVehicleAuxiliaryDataDeclarationType")); - _xElement.Add(dataElement); - - - if (_inputData.ElectricConsumers != null) { - var electricSystemElement = new XElement(_defaultNamespace + XMLNames.BusAux_ElectricSystem); - var ledLightsElement = new XElement(_defaultNamespace + "LEDLights"); - ledLightsElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_Interiorlights, _inputData.ElectricConsumers.InteriorLightsLED)); - ledLightsElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_Dayrunninglights, _inputData.ElectricConsumers.DayrunninglightsLED)); - ledLightsElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_Positionlights, _inputData.ElectricConsumers.PositionlightsLED)); - ledLightsElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_Brakelights, _inputData.ElectricConsumers.BrakelightsLED)); - ledLightsElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_Headlights, _inputData.ElectricConsumers.HeadlightsLED)); - electricSystemElement.Add(ledLightsElement); - dataElement.Add(electricSystemElement); - } - - if (_inputData.HVACAux != null) { - var hvacElement = new XElement(_defaultNamespace + "HVAC"); - hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_SystemConfiguration, _inputData.HVACAux.SystemConfiguration.ToXmlFormat())); - - hvacElement.Add(GetHeatPumpGroupElement( - xmlNameWrapper:XMLNames.Bus_HeatPumpTypeDriver, - xmlNameFirstComponent:XMLNames.BusHVACHeatPumpCooling, - firstValue:_inputData.HVACAux.HeatPumpTypeCoolingDriverCompartment.GetLabel(), - xmlNameSecondComponent:XMLNames.BusHVACHeatPumpHeating, - secondValue:_inputData.HVACAux.HeatPumpTypeHeatingDriverCompartment.GetLabel())); - - hvacElement.Add(GetHeatPumpGroupElement( - xmlNameWrapper: XMLNames.Bus_HeatPumpTypePassenger, - xmlNameFirstComponent: XMLNames.BusHVACHeatPumpCooling, - firstValue: _inputData.HVACAux.HeatPumpTypeCoolingPassengerCompartment.GetLabel(), - xmlNameSecondComponent: XMLNames.BusHVACHeatPumpHeating, - secondValue: _inputData.HVACAux.HeatPumpTypeHeatingPassengerCompartment.GetLabel())); - - - hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_AuxiliaryHeaterPower, _inputData.HVACAux.AuxHeaterPower?.ToXMLFormat(0))); - hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_DoubleGlazing, _inputData.HVACAux.DoubleGlazing)); - hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_AdjustableAuxiliaryHeater, _inputData.HVACAux.AdjustableAuxiliaryHeater)); - hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_SeparateAirDistributionDucts, _inputData.HVACAux.SeparateAirDistributionDucts)); - hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_WaterElectricHeater, _inputData.HVACAux.WaterElectricHeater)); - hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_AirElectricHeater, _inputData.HVACAux.AirElectricHeater)); - hvacElement.Add(new XElement(_defaultNamespace + XMLNames.Bus_OtherHeatingTechnology, _inputData.HVACAux.OtherHeatingTechnology)); - dataElement.Add(hvacElement); - } - - dataElement.DescendantsAndSelf().Where(e => string.IsNullOrEmpty(e.Value)).Remove(); - } - - private void CreateElementsWithGroupWriters() - { - - var dataElement = new XElement(_defaultNamespace + XMLNames.ComponentDataWrapper, - new XAttribute("xmlns" , XMLNamespaces.V24), - new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, "AUX_Conventional_CompletedBusType")); - - if (_inputData.ElectricConsumers != null) { - var electricSystemElement = new XElement(_defaultNamespace + XMLNames.BusAux_ElectricSystem); - var ledLightsElement = new XElement(_defaultNamespace + "LEDLights"); - ledLightsElement.Add( - // ReSharper disable once CoVariantArrayConversion - _groupWriterFactory.GetBusAuxiliariesDeclarationGroupWriter(GroupNames.BusAuxElectricSystemLightsGroup, _defaultNamespace) - .GetGroupElements(_inputData)); - electricSystemElement.Add(ledLightsElement); - dataElement.Add(electricSystemElement); - - } - - if (_inputData.HVACAux != null) { - var hvacElement = new XElement(_defaultNamespace + "HVAC"); - hvacElement.Add(_groupWriterFactory.GetBusAuxiliariesDeclarationGroupWriter(GroupNames.BusAuxHVACConventionalSequenceGroup, _defaultNamespace) - .GetGroupElements(_inputData)); - dataElement.Add(hvacElement); - } - - _xElement.Add(dataElement); - - } - - private XElement GetHeatPumpTypeElement(string xmlName, string value) - { - if (value == "~null~") - { - value = null; - } - return new XElement(_defaultNamespace + xmlName, value); - } - - private XElement GetHeatPumpGroupElement(string xmlNameWrapper, string xmlNameFirstComponent, - string xmlNameSecondComponent, string firstValue, string secondValue) - { - var element = new XElement(_defaultNamespace + xmlNameWrapper, - new XElement(_defaultNamespace + xmlNameFirstComponent, firstValue), - new XElement(_defaultNamespace + xmlNameSecondComponent, secondValue)); - - return element; - } - - - #endregion - } -} \ No newline at end of file diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLComponentsWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLComponentsWriter.cs deleted file mode 100644 index db6943a1f19d80c5993e1b9ad340085ac11eef99..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLComponentsWriter.cs +++ /dev/null @@ -1,144 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using TUGraz.IVT.VectoXML.Writer; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Resources; -using TUGraz.VectoCommon.Utils; -using VECTO3GUI2020.Util.XML.Interfaces; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; -using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; -using EnvironmentVariableTarget = System.EnvironmentVariableTarget; - -namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter -{ - public abstract class XMLComponentsWriter : IXMLComponentsWriter - { - protected IXMLWriterFactory _xMLWriterFactory; - - protected XElement _xElement; - - protected static string _name = "Components"; - protected static readonly string _declarationDefinition = "urn:tugraz:ivt:VectoAPI:DeclarationDefinitions"; - protected static readonly XNamespace _xsi = XNamespace.Get("http://www.w3.org/2001/XMLSchema-instance"); - protected static readonly XNamespace _v10 = _declarationDefinition + ":v1.0"; - protected static readonly XNamespace _v20 = _declarationDefinition + ":v2.0"; - protected XNamespace _defaultNamespace; - protected IVehicleComponentsDeclaration _inputData; - - - public XMLComponentsWriter(IVehicleComponentsDeclaration inputData, IXMLWriterFactory xMLWriterFactory) - { - _inputData = inputData; - _xMLWriterFactory = xMLWriterFactory; - Initialize(); - CreateComponents(); - } - - - protected abstract void CreateComponents(); - public abstract XElement GetComponents(); - public abstract void Initialize(); - - - } - - public class XMLComponentsWriter_v1_0 : XMLComponentsWriter - { - - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(ComponentsViewModel_v1_0).ToString() - }; - public XMLComponentsWriter_v1_0(IVehicleComponentsDeclaration inputData, IXMLWriterFactory xMLWriterFactory) : - base(inputData, xMLWriterFactory) - { - - } - - protected override void CreateComponents() - { - throw new NotImplementedException(); - } - - public override XElement GetComponents() - { - throw new NotImplementedException(); - } - - public override void Initialize() - { - _defaultNamespace = _v10; - } - } - - - public class XMLComponentsWriter_v2_0 : XMLComponentsWriter_v1_0 - { - public new static readonly string[] SUPPORTED_VERSIONS = { - typeof(ComponentsViewModel_v2_0).ToString() - }; - - public XMLComponentsWriter_v2_0(IVehicleComponentsDeclaration inputData, IXMLWriterFactory xMLWriterFactory) : - base(inputData, xMLWriterFactory) - { - - } - - - protected override void CreateComponents() - { - Debug.Assert(_inputData is IComponentsViewModel); - IXMLComponentWriter writer; - if (_inputData.EngineInputData != null) { - writer = _xMLWriterFactory.CreateComponentWriter(_inputData.EngineInputData); - _xElement.Add(writer.GetElement()); - } - - if (_inputData.GearboxInputData != null) { - writer = _xMLWriterFactory.CreateComponentWriter(_inputData.GearboxInputData); - _xElement.Add(writer.GetElement()); - } - - if (_inputData.RetarderInputData != null) { - writer = _xMLWriterFactory.CreateComponentWriter(_inputData.RetarderInputData); - _xElement.Add(writer.GetElement()); - } - - if (_inputData.AxleGearInputData != null) { - writer = _xMLWriterFactory.CreateComponentWriter(_inputData.AxleGearInputData); - _xElement.Add(writer.GetElement()); - } - - if (_inputData.AxleWheels != null) { - writer = _xMLWriterFactory.CreateComponentWriter(_inputData.AxleWheels); - _xElement.Add(writer.GetElement()); - } - - if (_inputData.AuxiliaryInputData != null) { - writer = _xMLWriterFactory.CreateComponentWriter(_inputData.AuxiliaryInputData); - _xElement.Add(writer.GetElement()); - } - - if (_inputData.AirdragInputData != null) { - writer = _xMLWriterFactory.CreateComponentWriter(_inputData.AirdragInputData); - _xElement.Add(writer.GetElement()); - } - } - - public override XElement GetComponents() - { - return _xElement; - } - - public override void Initialize() - { - _defaultNamespace = XMLNamespaces.V20; - _xElement = new XElement(_defaultNamespace + XMLNames.Vehicle_Components); - _xElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, XMLNames.Components_type_attr)); - } - } -} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLEngineWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLEngineWriter.cs deleted file mode 100644 index e4a5e37542bc1d543feda92d6e24ebf6e8939969..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLEngineWriter.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Models; -using TUGraz.VectoCommon.Resources; -using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; -using TUGraz.VectoCore.Utils; -using VECTO3GUI2020.Helper; -using VECTO3GUI2020.Util.XML.Interfaces; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; - -namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter -{ - public abstract class XMLEngineWriter : IXMLComponentWriter - { - protected XElement _xElement; - protected XNamespace _defaultNameSpace; - protected readonly IEngineDeclarationInputData _inputData; - protected string id = "toDo-Add-Identifier"; - - public XMLEngineWriter(IEngineDeclarationInputData inputData) - { - _inputData = inputData; - } - - public virtual XElement GetElement() - { - if (_xElement == null) { - Initialize(); - CreateDataElements(); - _xElement.Add(this.CreateSignatureElement(_defaultNameSpace, id, _inputData.DigestValue)); - } - - return _xElement; - } - - protected abstract void Initialize(); - protected abstract void CreateDataElements(); - - - } - - public class XMLEngineWriter_v1_0 : XMLEngineWriter - { - - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(EngineViewModel_v1_0).ToString() - }; - - - public override XElement GetElement() - { - throw new NotImplementedException(); - } - - protected override void Initialize() - { - throw new NotImplementedException(); - } - - protected override void CreateDataElements() - { - throw new NotImplementedException(); - } - - public XMLEngineWriter_v1_0(IEngineDeclarationInputData inputData) : base(inputData) { } - } - - public class XMLEngineWriter_v2_0 : XMLEngineWriter - { - private static XNamespace _v20 = XML.XMLNamespaces.V20; - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(EngineViewModel_v2_0).ToString(), - }; - - protected override void Initialize() - { - _defaultNameSpace = _v20; - _xElement = new XElement(_defaultNameSpace + XMLNames.Component_Engine); - } - - protected override void CreateDataElements() - { - var _dataXElement = new XElement(_defaultNameSpace + XMLNames.ComponentDataWrapper); - _xElement.Add(_dataXElement); - _dataXElement.Add(new XAttribute(XMLNames.Component_ID_Attr, id)); - _dataXElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Engine_Type_Attr)); - - Debug.Assert(_xElement != null); - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Model, _inputData.Model)); - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_CertificationNumber, - _inputData.CertificationNumber)); - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Date, _inputData.Date)); - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_AppVersion, _inputData.AppVersion)); - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_Displacement, _inputData.Displacement.ConvertToCubicCentiMeter().ToXMLFormat(0))); - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_IdlingSpeed, "100")); - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_RatedSpeed, _inputData.RatedSpeedDeclared.AsRPM.ToXMLFormat(0))); - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_RatedPower, _inputData.RatedPowerDeclared.ToXMLFormat(0))); - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_MaxTorque, _inputData.MaxTorqueDeclared.ToXMLFormat(0))); - - Debug.Assert(_inputData.EngineModes.Count == 1, "Only 1 Engine Mode supported in XMLEngineWriter_v2_0"); - var mode = _inputData.EngineModes[0]; - - Debug.Assert(mode.Fuels.Count == 1, "Only one fuel supported in XMLEngineWriter_v2_0"); - var fuel = mode.Fuels[0]; - - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_WHTCUrban, fuel.WHTCUrban.ToXMLFormat(4))); - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_WHTCRural, fuel.WHTCRural.ToXMLFormat(4))); - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_WHTCMotorway, fuel.WHTCMotorway.ToXMLFormat(4))); - - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_ColdHotBalancingFactor, fuel.ColdHotBalancingFactor.ToXMLFormat(4))); - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_CorrectionFactor_RegPer, fuel.CorrectionFactorRegPer.ToXMLFormat(4))); - - - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_CorrecionFactor_NCV, "1.0000")); - - _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_FuelType, fuel.FuelType.ToXMLFormat())); - - var fuelConsumptionMapElement = new XElement(_defaultNameSpace + XMLNames.Engine_FuelConsumptionMap); - var tableData = fuel.FuelConsumptionMap; - - foreach (DataRow fuelEntry in tableData.Rows) { - var entry = new XElement(_defaultNameSpace + XMLNames.Engine_FuelConsumptionMap_Entry); - entry.Add(new XAttribute(XMLNames.Engine_FuelConsumptionMap_EngineSpeed_Attr, fuelEntry.ItemArray[0])); - entry.Add(new XAttribute(XMLNames.Engine_FuelConsumptionMap_Torque_Attr, fuelEntry.ItemArray[1])); - entry.Add(new XAttribute(XMLNames.Engine_FuelConsumptionMap_FuelConsumption_Attr, fuelEntry.ItemArray[2])); - fuelConsumptionMapElement.Add(entry); - } - _dataXElement.Add(fuelConsumptionMapElement); - - var fullLoadAndDragCurveElement = new XElement(_defaultNameSpace + XMLNames.Engine_FullLoadAndDragCurve); - tableData = mode.FullLoadCurve; - foreach (DataRow loadAndDragEntry in tableData.Rows) { - var entry = new XElement(_defaultNameSpace + XMLNames.Engine_FullLoadCurve_Entry); - entry.Add(new XAttribute(XMLNames.Engine_EngineFullLoadCurve_EngineSpeed_Attr, loadAndDragEntry.ItemArray[0])); - entry.Add(new XAttribute(XMLNames.Engine_FullLoadCurve_MaxTorque_Attr, loadAndDragEntry.ItemArray[1])); - entry.Add(new XAttribute(XMLNames.Engine_FullLoadCurve_DragTorque_Attr, loadAndDragEntry.ItemArray[2])); - fullLoadAndDragCurveElement.Add(entry); - } - _dataXElement.Add(fullLoadAndDragCurveElement); - } - - - - public XMLEngineWriter_v2_0(IEngineDeclarationInputData inputData) : base(inputData) - { - - } - } -} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLGearboxWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLGearboxWriter.cs deleted file mode 100644 index 4fed42688b1d8666740e171164e99f0e9d930e58..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLGearboxWriter.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Models; -using TUGraz.VectoCommon.Resources; -using TUGraz.VectoCommon.Utils; -using VECTO3GUI2020.Helper; -using VECTO3GUI2020.Util.XML.Interfaces; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; - -namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter -{ - public abstract class XMLGearboxWriter : IXMLComponentWriter - { - protected IGearboxDeclarationInputData _inputData; - protected XElement _xElement; - protected XNamespace _defaultNameSpace; - protected string _uri = "toDo-Adduri"; - - public XMLGearboxWriter(IGearboxDeclarationInputData inputData) - { - - _inputData = inputData; - } - - public virtual XElement GetElement() - { - if (_xElement == null) { - Initialize(); - CreateDataElements(); - _xElement.Add(this.CreateSignatureElement(_defaultNameSpace, _uri, _inputData.DigestValue)); - } - return _xElement; - } - - protected abstract void Initialize(); - protected abstract void CreateDataElements(); - } - public class XMLGearboxWriter_v2_0 : XMLGearboxWriter - { - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(GearboxViewModel_v2_0).ToString() - }; - - public XMLGearboxWriter_v2_0(IGearboxDeclarationInputData inputData) : base(inputData) - { - } - - protected override void Initialize() - { - _defaultNameSpace = XML.XMLNamespaces.V20; - _xElement = new XElement(_defaultNameSpace + XMLNames.Component_Gearbox); - } - - protected override void CreateDataElements() - { - var dataElement = new XElement(_defaultNameSpace + XMLNames.ComponentDataWrapper); - _xElement.Add(dataElement); - dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri)); - dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Gearbox_attr_GearboxDataDeclarationType)); - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Model, _inputData.Model)); - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Date, _inputData.Date)); - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_AppVersion, _inputData.AppVersion)); - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_TransmissionType, _inputData.Type.ToXMLFormat())); - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Gearbox_CertificationMethod, _inputData.CertificationMethod.ToXMLFormat())); - - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gears)); - var gearsElement = dataElement.LastNode as XElement; - gearsElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, XMLNames.Gearbox_Gears_Attr_GearsDeclarationType)); - foreach (var gear in _inputData.Gears) { - gearsElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gears_Gear)); - var gearElement = gearsElement.LastNode as XElement; - //var gearElement = new XElement(_defaultNameSpace + XMLNames.Gearbox_Gears_Gear); - //gearsElement.Add(gearElement); - gearElement.Add(new XAttribute(XMLNames.Gearbox_Gear_GearNumber_Attr, gear.Gear)); - gearElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gear_Ratio, gear.Ratio.ToXMLFormat(3))); - - if (gear.MaxTorque != null) { - gearElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gears_MaxTorque, gear.MaxTorque)); - } - - if (gear.MaxInputSpeed != null) { - gearElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gear_MaxSpeed, gear.MaxInputSpeed)); - } - - var torqueLossMapElement = new XElement(_defaultNameSpace + XMLNames.Gearbox_Gear_TorqueLossMap); - gearElement.Add(torqueLossMapElement); - foreach (DataRow torquelossEntry in gear.LossMap.Rows) { - var entry = new XElement(_defaultNameSpace + XMLNames.Gearbox_Gear_TorqueLossMap_Entry); - torqueLossMapElement.Add(entry); - entry.Add(new XAttribute(XMLNames.TransmissionLossmap_InputSpeed_Attr, torquelossEntry[0].ToString())); - entry.Add(new XAttribute(XMLNames.TransmissionLossmap_InputTorque_Attr, torquelossEntry[1].ToString())); - entry.Add(new XAttribute(XMLNames.TransmissionLossmap_TorqueLoss_Attr, torquelossEntry[2].ToString())); - - } - } - Debug.WriteLine(_xElement.ToString()); - } - - - } -} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLPTOWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLPTOWriter.cs deleted file mode 100644 index e6794a06e0ff0fee1ae506af44980f96bcb6186b..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLPTOWriter.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Resources; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader; -using VECTO3GUI2020.Util.XML.Interfaces; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; - -namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter -{ - public abstract class XMLPTOWriter : IXMLComponentWriter - { - protected XElement _xElement; - protected XNamespace _defaultNamespace; - private IPTOTransmissionInputData _inputData; - - public XMLPTOWriter(IPTOTransmissionInputData inputData) - { - _inputData = inputData; - Initialize(); - CreateElements(); - } - - - - public XElement GetElement() - { - return _xElement; - } - - protected abstract void Initialize(); - protected abstract void CreateElements(); - } - - public class XMLPTOWriter_v1_0 : XMLPTOWriter - { - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(PTOViewModel_V1_0).ToString() - }; - - public XMLPTOWriter_v1_0(IPTOTransmissionInputData inputData) : base(inputData) { } - - protected override void Initialize() - { - - throw new NotImplementedException(); - } - - protected override void CreateElements() - { - throw new NotImplementedException(); - } - } - - - - - public class XMLPTOWriter_v2_0 : XMLPTOWriter_v1_0 - { - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(PTOViewModel_V2_0).ToString() - }; - - public XMLPTOWriter_v2_0(IPTOTransmissionInputData inputData) : base(inputData) { } - - protected override void Initialize() - { - _defaultNamespace = XMLNamespaces.V20; - _xElement = new XElement(_defaultNamespace + XMLNames.Vehicle_PTO); - _xElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, XMLNames.Component_Type_Attr_PTO)); - } - - protected override void CreateElements() - { - _xElement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_PTO_ShaftsGearWheels, "none")); - _xElement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_PTO_OtherElements, "none")); - } - } - - -} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLRetarderWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLRetarderWriter.cs deleted file mode 100644 index f75d43a420b938fe62e3b6c374b85842c7b4999c..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLRetarderWriter.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Models; -using TUGraz.VectoCommon.Resources; -using VECTO3GUI2020.Helper; -using VECTO3GUI2020.Util.XML.Interfaces; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; - -namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter -{ - public abstract class XMLRetarderWriter : IXMLComponentWriter - { - protected XElement _xElement; - protected IRetarderInputData _inputData; - protected XNamespace _defaultNameSpace; - protected string _uri = "toTo-Add-URI"; - - public XMLRetarderWriter(IRetarderInputData inputData) - { - _inputData = inputData; - } - - protected abstract void Initialize(); - protected abstract void CreateDataElements(); - - public XElement GetElement() - { - if (_xElement == null) { - Initialize(); - CreateDataElements(); - _xElement.Add(this.CreateSignatureElement(_defaultNameSpace, _uri, _inputData.DigestValue)); - } - return _xElement; - } - } - - public class XMLRetarderWriter_v1_0 : XMLRetarderWriter - { - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(RetarderViewModel_v1_0).ToString() - }; - - protected override void Initialize() - { - _defaultNameSpace = XML.XMLNamespaces.V10; - _xElement = new XElement(_defaultNameSpace + XMLNames.Component_Retarder); - } - - protected override void CreateDataElements() - { - var dataElement = new XElement(_defaultNameSpace + XMLNames.ComponentDataWrapper); - _xElement.Add(dataElement); - - dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri)); - dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, XMLNames.Retarder_Attr_DataDeclarationType)); - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Model, _inputData.Model)); - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Date, _inputData.Date)); - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_AppVersion, _inputData.AppVersion)); - dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_CertificationMethod, _inputData.CertificationMethod.ToXMLFormat())); - - var lossMapElement = new XElement(_defaultNameSpace + XMLNames.Retarder_RetarderLossMap); - dataElement.Add(lossMapElement); - - foreach (DataRow lossMapRow in _inputData.LossMap.Rows) - { - var entryElement = new XElement(_defaultNameSpace + XMLNames.Retarder_RetarderLossMap_Entry); - entryElement.Add(new XAttribute(XMLNames.Retarder_RetarderLossmap_RetarderSpeed_Attr, lossMapRow[0].ToString())); - entryElement.Add(new XAttribute(XMLNames.Retarder_RetarderLossmap_TorqueLoss_Attr, lossMapRow[1].ToString())); - lossMapElement.Add(entryElement); - } - } - - public XMLRetarderWriter_v1_0(IRetarderInputData inputData) : base(inputData) { } - } - - - - public class XMLRetarderWriter_v2_0 : XMLRetarderWriter_v1_0 - { - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(RetarderViewModel_v2_0).ToString() - }; - - - public XMLRetarderWriter_v2_0(IRetarderInputData inputData) : base(inputData) - { - - } - - - - protected override void Initialize() - { - _defaultNameSpace = XML.XMLNamespaces.V20; - _xElement = new XElement(_defaultNameSpace + XMLNames.Component_Retarder); - } - } -} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLTyreWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLTyreWriter.cs deleted file mode 100644 index 7e10b6ed70f53fca7a91ffceefed4773135c57ff..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLTyreWriter.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Resources; -using TUGraz.VectoCommon.Utils; -using VECTO3GUI2020.Helper; -using VECTO3GUI2020.Util.XML.Interfaces; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; - -namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter -{ - public abstract class XMLTyreWriter : IXMLComponentWriter - { - protected ITyreDeclarationInputData _inputData; - - protected XNamespace _defaultNamespace; - protected XElement _xElement; - protected string _uri = "ToDo-Add-Id"; - - public XMLTyreWriter(ITyreDeclarationInputData inputData) - { - _inputData = inputData; - } - - public XElement GetElement() - { - if (_xElement == null) { - Initialize(); - CreateDataElements(); - _xElement.Add(this.CreateSignatureElement(_defaultNamespace, _uri, _inputData.DigestValue)); - } - - return _xElement; - } - protected abstract void Initialize(); - protected abstract void CreateDataElements(); - - - - - - } - - public class XMLTyreWriter_v2_0 : XMLTyreWriter - { - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(TyreViewModel_v2_0).ToString() - }; - - public XMLTyreWriter_v2_0(ITyreDeclarationInputData inputData) : base(inputData) { } - protected override void CreateDataElements() - { - var dataElement = new XElement(_defaultNamespace + XMLNames.ComponentDataWrapper); - _xElement.Add(dataElement); - - dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri)); - dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Tyre_Type_Attr_TyreDataDeclarationType)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Date, _inputData.Date)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_AppVersion, _inputData.AppVersion)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_Dimension, _inputData.Dimension)); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_RRCDeclared, _inputData.RollResistanceCoefficient.ToXMLFormat(4))); - dataElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_FzISO, _inputData.TyreTestLoad.ToXMLFormat(0))); - } - - protected override void Initialize() - { - _defaultNamespace = XML.XMLNamespaces.V20; - _xElement = new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_Tyre); - } - - } - - public class XMLTyreWriter_v2_3 : XMLTyreWriter_v2_0 - { - public new static readonly string[] SUPPORTED_VERSIONS = { - typeof(TyreViewModel_v2_3).ToString() - }; - public XMLTyreWriter_v2_3(ITyreDeclarationInputData inputData) : base(inputData) { } - - protected override void CreateDataElements() - { - base.CreateDataElements(); - - } - - protected override void Initialize() - { - _defaultNamespace = XML.XMLNamespaces.V23; - _xElement = new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_Tyre); - } - } - -} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLVehicleWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLVehicleWriter.cs deleted file mode 100644 index d81f3a11e18dace97d64808396d94ff9e4287074..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLVehicleWriter.cs +++ /dev/null @@ -1,433 +0,0 @@ -using System; -using System.Diagnostics; -using System.Linq; -using System.Xml.Linq; -using TUGraz.VectoCommon.BusAuxiliaries; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Models; -using TUGraz.VectoCommon.Resources; -using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; -using TUGraz.VectoCore.OutputData.XML.ComponentWriter; -using TUGraz.VectoCore.OutputData.XML.GroupWriter; -using TUGraz.VectoCore.Utils; -using VECTO3GUI2020.Helper; -using VECTO3GUI2020.Properties; -using VECTO3GUI2020.Util.XML.Interfaces; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle; -using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; -using VECTO3GUI2020.ViewModel.MultiStage.Implementation; - -namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter -{ - public abstract class XMLVehicleWriter : IXMLVehicleWriter - { - - - - #region XML - protected XElement _Xelement; - - protected XNamespace _defaultNamespace; - #endregion - - //Template Methods - protected abstract void Initialize(); - protected abstract void CreateElements(); - - protected readonly IVehicleDeclarationInputData _inputData; - protected IXMLWriterFactory _xmlWriterFactory; - - public XMLVehicleWriter(IVehicleDeclarationInputData inputData, IXMLWriterFactory xmlWriterFactory) - { - Debug.Assert(inputData != null); - this._inputData = inputData; - _xmlWriterFactory = xmlWriterFactory; - } - - - - public XElement GetElement() - { - if (_Xelement == null) { - Initialize(); - CreateElements(); - } - return _Xelement; - } - } - public class XMLVehicleWriter_v1_0 : XMLVehicleWriter - { - public static readonly string[] SUPPORTEDVERSIONS = { - typeof(XMLDeclarationVehicleDataProviderV10).ToString(), - typeof(VehicleViewModel_v1_0).ToString() - }; - - public XMLVehicleWriter_v1_0(IVehicleDeclarationInputData inputData, IXMLWriterFactory xmlWriterFactory) : base(inputData, xmlWriterFactory) - { - - } - - protected override void CreateElements() - { - throw new NotImplementedException(); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer), - new XElement(_defaultNamespace + XMLNames.Component_ManufacturerAddress, - _inputData.ManufacturerAddress), - new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model), - new XElement(_defaultNamespace + XMLNames.Vehicle_VIN, _inputData.VIN), - new XElement(_defaultNamespace + XMLNames.Component_Date, _inputData.Date), - new XElement(_defaultNamespace + XMLNames.Vehicle_LegislativeClass, _inputData.LegislativeClass), - new XElement(_defaultNamespace + XMLNames.Vehicle_AxleConfiguration, - AxleConfigurationHelper.ToXMLFormat(_inputData.AxleConfiguration)), - new XElement(_defaultNamespace + XMLNames.Vehicle_CurbMassChassis, - _inputData.CurbMassChassis.ToXMLFormat()), - new XElement(_defaultNamespace + XMLNames.Vehicle_GrossVehicleMass, - _inputData.GrossVehicleMassRating.ToXMLFormat()), - new XElement(_defaultNamespace + XMLNames.Vehicle_IdlingSpeed, - _inputData.EngineIdleSpeed.ToXMLFormat())); - - //new XElement(_defaultNamespace + XMLNames.Vehicle_RetarderType, _inputData.RetarderType.ToXMLFormat()), - - //_inputData.RetarderRatio == null ? null : new XElement(_defaultNamespace + XMLNames.Vehicle_RetarderRatio, _inputData.RetarderRatio), - - //new XElement(_defaultNamespace + XMLNames.Vehicle_AngledriveType, _inputData.AngledriveType.ToXMLFormat()), - - - //https://stackoverflow.com/questions/24743916/how-to-convert-xmlnode-into-xelement - //Remove this when PTOType is handled correct. - //XElement.Load(_inputData.PTONode.CreateNavigator().ReadSubtree()), - - //new XElement(_defaultNamespace + XMLNames.Vehicle_Components, - // new XAttribute(_xsi + "type", ComponentsXSD)) - - - //); - - - } - - protected override void Initialize() - { - throw new NotImplementedException(); - } - } - - - public class XMLVehicleWriter_v2_0 : XMLVehicleWriter_v1_0 - { - public new static readonly string[] SUPPORTEDVERSIONS = { - typeof(XMLDeclarationVehicleDataProviderV10).ToString(), - typeof(VehicleViewModel_v2_0).ToString() - }; - - public XMLVehicleWriter_v2_0(IVehicleDeclarationInputData inputData, - IXMLWriterFactory xmlWriterFactory) : base(inputData, xmlWriterFactory) - { - - - } - - protected override void CreateElements() - { - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Component_ManufacturerAddress, - _inputData.ManufacturerAddress)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_VIN, _inputData.VIN)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Component_Date, _inputData.Date)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_LegislativeClass, - _inputData.LegislativeClass)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_VehicleCategory, _inputData.VehicleCategory)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_AxleConfiguration, - _inputData.AxleConfiguration.ToXMLFormat())); - - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_CurbMassChassis, _inputData.CurbMassChassis.ToXMLFormat(0))); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_GrossVehicleMass, - _inputData.GrossVehicleMassRating.ToXMLFormat(0))); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_IdlingSpeed, - _inputData.EngineIdleSpeed.AsRPM.ToXMLFormat(0))); - - //TODO: Remove when IVehicleDeclarationInputData is updated - if (_inputData is IVehicleViewModel viewModelInputData) { - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_RetarderType, - viewModelInputData.RetarderType.ToXMLFormat())); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_RetarderRatio, viewModelInputData.RetarderRatio.ToXMLFormat(3))); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_AngledriveType, - viewModelInputData.AngledriveType.ToXMLFormat())); - _Xelement.Add(_xmlWriterFactory.CreateComponentWriter(viewModelInputData.PTOTransmissionInputData) - .GetElement()); - } else { - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_RetarderType, - RetarderType.None.ToXMLFormat())); - //_Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_RetarderRatio, "1.000")); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_AngledriveType, - AngledriveType.None.ToXMLFormat())); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_PTO, - new XElement(_defaultNamespace + XMLNames.Vehicle_PTO_ShaftsGearWheels, "none"), - new XElement(_defaultNamespace + XMLNames.Vehicle_PTO_OtherElements, "none"))); - } - - - - _Xelement.Add(_xmlWriterFactory.CreateComponentsWriter(_inputData.Components).GetComponents()); - } - - protected override void Initialize() - { - _defaultNamespace = XMLNamespaces.V20; - _Xelement = new XElement(_defaultNamespace + XMLNames.Component_Vehicle); - _Xelement.Add(new XAttribute(XMLNames.Component_ID_Attr, _inputData.Identifier)); - _Xelement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, XMLNames.VehicleAttr_VehicleDeclarationType)); - } - } - - public class XMLVehicleWriter_v2_1 { } - - public class XMLVehicleWriter_v2_7 { } - - public class XMLVehicleWriter_PrimaryBus_v2_6 {} - - public class XMLVehicleWriter_ExcemptedVehicle_v2_2 { } - - - public class XMLVehicleWriter_v2_10 : XMLVehicleWriter - { - private readonly bool _exempted; - public static readonly string[] SUPPORTEDVERSIONS = { - typeof(InterimStageBusVehicleViewModel_v2_8).ToString(), - typeof(StageInputViewModel).ToString() - }; - - private readonly IGroupWriterFactory _groupWriterFactory; - private readonly bool _conventional; - private readonly IComponentWriterFactory _componentWriterFactory; - - public XMLVehicleWriter_v2_10(IVehicleDeclarationInputData inputData, - IXMLWriterFactory xmlWriterFactory, - IGroupWriterFactory groupWriterFactory, - IComponentWriterFactory componentWriterFactory) : base(inputData, xmlWriterFactory) - { - - //TODO: CHECK ALL POSSIBIBILITIES FOR VEHICLES - _exempted = inputData.ExemptedVehicle; - - _conventional = !_exempted; - _groupWriterFactory = groupWriterFactory; - _componentWriterFactory = componentWriterFactory; - } - - #region Overrides of XMLVehicleWriter - - protected override void Initialize() - { - _defaultNamespace = XMLNamespaces.V24; - - _Xelement = new XElement(XMLNamespaces.V20 + XMLNames.Component_Vehicle, - new XAttribute("xmlns", _defaultNamespace)); - - _Xelement.Add(new XAttribute(XMLNames.Component_ID_Attr, _inputData.Identifier ?? ("VEH-" + Guid.NewGuid().ToString("n").Substring(0, 20)))); - if (_conventional) { - _Xelement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, "Vehicle_Conventional_CompletedBusDeclarationType")); - } else if(_exempted) { - _Xelement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, "Vehicle_Exempted_CompletedBusDeclarationType")); - } - - } - - protected override void CreateElements() - { - if (_conventional) { - CreateConventionalElements(); - return; - } - - if (_exempted) { - CreateExemptedElements(); - return; - } - - throw new NotImplementedException("Old Implementation"); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Component_ManufacturerAddress, - _inputData.ManufacturerAddress)); - - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_VIN, _inputData.VIN)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Component_Date, XMLExtension.ToXmlFormat(DateTime.Today))); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_LegislativeCategory, _inputData.LegislativeClass.ToXMLFormat())); - - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.CorrectedActualMass, _inputData.CurbMassChassis?.ToXMLFormat(0))); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_TPMLM, - _inputData.GrossVehicleMassRating?.ToXMLFormat(0))); - - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_AirdragModifiedMultistep, _inputData.AirdragModifiedMultistep)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_NgTankSystem, _inputData.TankSystem)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_RegisteredClass, _inputData.RegisteredClass.ToXMLFormat())); - - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_NumberPassengerSeatsLowerDeck, _inputData.NumberPassengerSeatsLowerDeck)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_NumberPassengersStandingLowerDeck, _inputData.NumberPassengersStandingLowerDeck)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_NumberPassengerSeatsUpperDeck, _inputData.NumberPassengerSeatsUpperDeck)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_NumberPassengersStandingUpperDeck, _inputData.NumberPassengersStandingUpperDeck)); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_BodyworkCode, _inputData.VehicleCode.ToXMLFormat())); - - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_LowEntry, _inputData.LowEntry)); - - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_HeightIntegratedBody, _inputData.Height?.ConvertToMilliMeter())); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_VehicleLength, _inputData.Length?.ConvertToMilliMeter())); - - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_VehicleWidth, _inputData.Width?.ConvertToMilliMeter())); - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_EntranceHeight, _inputData.EntranceHeight?.ConvertToMilliMeter())); - - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.BusAux_PneumaticSystem_DoorDriveTechnology, - _inputData.DoorDriveTechnology != null - ? _inputData.DoorDriveTechnology.ToXMLFormat() - : null)); - - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_VehicleDeclarationType, _inputData.VehicleDeclarationType)); - - if (_inputData.ADAS != null) { - var adasNamespace = XMLNamespaces.V23; - var aDASElement = new XElement(_defaultNamespace + XMLNames.Vehicle_ADAS); - _Xelement.Add(aDASElement); - aDASElement.Add(new XElement(adasNamespace + XMLNames.Vehicle_ADAS_EngineStopStart, _inputData.ADAS.EngineStopStart)); - - bool ecoRollWithoutEngineStop = _inputData.ADAS.EcoRoll == EcoRollType.WithoutEngineStop; - bool ecoRollWithEngineStop = _inputData.ADAS.EcoRoll == EcoRollType.WithEngineStop; - - aDASElement.Add(new XElement(adasNamespace + XMLNames.Vehicle_ADAS_EcoRollWithoutEngineStop, ecoRollWithoutEngineStop)); - aDASElement.Add(new XElement(adasNamespace + XMLNames.Vehicle_ADAS_EcoRollWithEngineStopStart, ecoRollWithEngineStop)); - aDASElement.Add(new XElement(adasNamespace + XMLNames.Vehicle_ADAS_PCC, - _inputData.ADAS.PredictiveCruiseControl.ToXMLFormat())); - aDASElement.Add(new XElement(adasNamespace + XMLNames.Vehicle_ADAS_ATEcoRollReleaseLockupClutch, _inputData.ADAS?.ATEcoRollReleaseLockupClutch )); - } - _Xelement.DescendantsAndSelf().Where(e => string.IsNullOrEmpty(e.Value)).Remove(); - - if (_inputData.Components != null) { - var componentElement = new XElement( - _defaultNamespace + XMLNames.Vehicle_Components, - new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, - "CompletedVehicleComponentsDeclarationType")); - - //Airdrag - if (_inputData.Components.AirdragInputData != null) { - var airDragElement = _xmlWriterFactory.CreateComponentWriter(_inputData.Components.AirdragInputData) - .GetElement(); - var tempAirDragElement = new XElement(_defaultNamespace + XMLNames.Component_AirDrag); - - airDragElement.Name = tempAirDragElement.Name; - componentElement.Add(airDragElement); - } - - //auxiliaries - if (_inputData.Components.BusAuxiliaries != null) { - var auxiliaryElement = _xmlWriterFactory.CreateBuxAuxiliariesWriter(_inputData.Components.BusAuxiliaries) - .GetElement(); - - componentElement.Add(auxiliaryElement); - - } - _Xelement.Add(componentElement); - - } - } - - private void CreateConventionalElements() - { - _Xelement.Add( - _groupWriterFactory.GetVehicleDeclarationGroupWriter( - GroupNames.Vehicle_CompletedBus_GeneralParametersSequenceGroup, _defaultNamespace).GetGroupElements(_inputData), - _groupWriterFactory.GetVehicleDeclarationGroupWriter( - GroupNames.Vehicle_CompletedBusParametersSequenceGroup, _defaultNamespace).GetGroupElements(_inputData) - ); - _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_NgTankSystem, _inputData.TankSystem)); - - // ReSharper disable once CoVariantArrayConversion - _Xelement.Add(_groupWriterFactory.GetVehicleDeclarationGroupWriter( - GroupNames.Vehicle_CompletedBus_PassengerCountSequenceGroup, _defaultNamespace).GetGroupElements(_inputData)); - - _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_BodyworkCode, _inputData.VehicleCode.ToXMLFormat())); - _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Bus_LowEntry, _inputData.LowEntry)); - - - _Xelement.Add(_groupWriterFactory.GetVehicleDeclarationGroupWriter( - GroupNames.Vehicle_CompletedBus_DimensionsSequenceGroup, _defaultNamespace) - .GetGroupElements(_inputData)); - - _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.BusAux_PneumaticSystem_DoorDriveTechnology, - _inputData.DoorDriveTechnology != null - ? _inputData.DoorDriveTechnology.ToXMLFormat() - : null)); - - _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_VehicleDeclarationType, _inputData.VehicleDeclarationType)); - _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.VehicleTypeApprovalNumber, _inputData.VehicleTypeApprovalNumber)); - - if (_inputData.ADAS != null) { - _Xelement.Add(_componentWriterFactory.getDeclarationAdasWriter(GroupNames.ADAS_Conventional_Type, _defaultNamespace).GetComponent(_inputData.ADAS)); - } - - - if (_inputData.Components != null) - { - var componentElement = new XElement( - _defaultNamespace + XMLNames.Vehicle_Components, - new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, - GUILabels.Components_Conventional_CompletedBusType)); - - //Airdrag - if (_inputData.Components.AirdragInputData != null) - { - var airDragElement = _xmlWriterFactory.CreateComponentWriter(_inputData.Components.AirdragInputData) - .GetElement(); - var tempAirDragElement = new XElement(_defaultNamespace + XMLNames.Component_AirDrag); - - airDragElement.Name = tempAirDragElement.Name; - componentElement.Add(airDragElement); - } - - //auxiliaries - if (_inputData.Components.BusAuxiliaries != null) - { - var auxiliaryElement = _xmlWriterFactory.CreateBuxAuxiliariesWriter(_inputData.Components.BusAuxiliaries) - .GetElement(); - - componentElement.Add(auxiliaryElement); - - } - _Xelement.Add(componentElement); - - } - - } - - - private void CreateExemptedElements() - { - - - // ReSharper disable once CoVariantArrayConversion - _Xelement.Add(_groupWriterFactory - .GetVehicleDeclarationGroupWriter(GroupNames.Vehicle_CompletedBus_GeneralParametersSequenceGroup, - _defaultNamespace).GetGroupElements(_inputData)); - - _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model)); - _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_LegislativeCategory, _inputData.LegislativeClass.ToXMLFormat())); - _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.CorrectedActualMass, _inputData.CurbMassChassis?.ToXMLFormat(0))); - _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_TPMLM, - _inputData.GrossVehicleMassRating?.ToXMLFormat(0))); - - _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_RegisteredClass, _inputData.RegisteredClass.ToXMLFormat())); - - _Xelement.Add(_groupWriterFactory.GetVehicleDeclarationGroupWriter(GroupNames.Vehicle_CompletedBus_PassengerCountSequenceGroup, _defaultNamespace).GetGroupElements(_inputData)); - - _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_BodyworkCode, _inputData.VehicleCode.ToXMLFormat())); - - _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Bus_LowEntry, _inputData.LowEntry)); - - _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Bus_HeightIntegratedBody, _inputData.Height?.ConvertToMilliMeter())); - } - - #endregion - } - -} diff --git a/VECTO3GUI2020/Util/XML/Implementation/DocumentWriter/XMLDeclarationJobWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/DocumentWriter/XMLDeclarationJobWriter.cs deleted file mode 100644 index f55e85d7d01c7c78cf57259cdb66d9d12b30b256..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Implementation/DocumentWriter/XMLDeclarationJobWriter.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Diagnostics; -using System.Xml.Linq; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Resources; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; -using VECTO3GUI2020.Util.XML.Interfaces; -using VECTO3GUI2020.ViewModel.Implementation.JobEdit; - -namespace VECTO3GUI2020.Util.XML.Implementation.DocumentWriter -{ - public abstract class XMLDeclarationJobWriter : IXMLDeclarationJobWriter - { - - protected XDocument _xDocument; - protected string _schemaVersion; - private IXMLWriterFactory _xmlWriterFactory; - - protected string LocalSchemaLocation = @"V:\VectoCore\VectoCore\Resources\XSD\"; - - //Must be overwritten by subclasses; - protected abstract void Initialize(); - - - - public XMLDeclarationJobWriter(IDeclarationJobInputData inputData, IXMLWriterFactory xmlWriterFactory) - { - _xmlWriterFactory = xmlWriterFactory; - Initialize(); - - (_xDocument.FirstNode as XElement)?.Add(_xmlWriterFactory.CreateVehicleWriter(inputData.Vehicle).GetElement()); - var rootElement = _xDocument.FirstNode as XElement; - - } - - - - - - public XDocument GetDocument() - { - return _xDocument; - } - } - - - public class XMLDeclarationJobWriter_v1_0 : XMLDeclarationJobWriter - { - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(XMLDeclarationJobInputDataProviderV10).ToString() - }; - public XMLDeclarationJobWriter_v1_0(IDeclarationJobInputData inputData, IXMLWriterFactory xmlWriterFactory) : base(inputData, xmlWriterFactory) - { - - } - protected override void Initialize() - { - throw new NotImplementedException(); - } - - - } - - public class XMLDeclarationJobWriter_v2_0 : XMLDeclarationJobWriter - { - - public static readonly string[] SUPPORTED_VERSIONS = { - typeof(DeclarationJobEditViewModel_v2_0).ToString(), - typeof(XMLDeclarationJobInputDataProviderV20).ToString() - }; - - public XMLDeclarationJobWriter_v2_0(IDeclarationJobInputData inputData, IXMLWriterFactory xmlWriterFactory) : base(inputData, xmlWriterFactory) - { - - } - - protected override void Initialize() - { - _schemaVersion = "2.0"; - _xDocument = new XDocument(); - - var xElement = new XElement(XMLNamespaces.Tns_v20 + XMLNames.VectoInputDeclaration); - _xDocument.Add(xElement); - - xElement.Add(new XAttribute("schemaVersion", _schemaVersion)); - xElement.Add(new XAttribute("xmlns", XMLNamespaces.DeclarationDefinition + ":v" + _schemaVersion)); - xElement.Add(new XAttribute(XNamespace.Xmlns + "xsi", XMLNamespaces.Xsi.NamespaceName)); - xElement.Add(new XAttribute(XNamespace.Xmlns + "tns", XMLNamespaces.Tns_v20)); - xElement.Add(new XAttribute(XMLNamespaces.Xsi + "schemaLocation", - $"{XMLNamespaces.DeclarationRootNamespace} {LocalSchemaLocation}VectoDeclarationJob.xsd")); - - Debug.WriteLine(_xDocument.ToString()); - } - } - -} diff --git a/VECTO3GUI2020/Util/XML/Interfaces/IXMLComponentWriter.cs b/VECTO3GUI2020/Util/XML/Interfaces/IXMLComponentWriter.cs deleted file mode 100644 index ac5bf9d65c69cbaa91fd525c159c953264fbfc2b..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Interfaces/IXMLComponentWriter.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; - -namespace VECTO3GUI2020.Util.XML.Interfaces -{ - public interface IXMLComponentWriter - { - XElement GetElement(); - } -} diff --git a/VECTO3GUI2020/Util/XML/Interfaces/IXMLComponentsWriter.cs b/VECTO3GUI2020/Util/XML/Interfaces/IXMLComponentsWriter.cs deleted file mode 100644 index 5ac14496747748a0b6138f2d71985a60969ca752..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Interfaces/IXMLComponentsWriter.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Xml.Linq; - -namespace VECTO3GUI2020.Util.XML.Interfaces -{ - public interface IXMLComponentsWriter - { - XElement GetComponents(); - } -} \ No newline at end of file diff --git a/VECTO3GUI2020/Util/XML/Interfaces/IXMLDeclarationJobWriter.cs b/VECTO3GUI2020/Util/XML/Interfaces/IXMLDeclarationJobWriter.cs deleted file mode 100644 index b9854e0d632f9153a06c453001a5550d1655ab0f..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Interfaces/IXMLDeclarationJobWriter.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Xml.Linq; - -namespace VECTO3GUI2020.Util.XML.Interfaces -{ - public interface IXMLDeclarationJobWriter - { - XDocument GetDocument(); - } -} diff --git a/VECTO3GUI2020/Util/XML/Interfaces/IXMLVehicleWriter.cs b/VECTO3GUI2020/Util/XML/Interfaces/IXMLVehicleWriter.cs deleted file mode 100644 index 6af7fe70e31c41004a7aaf81af669baabdbd809f..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Interfaces/IXMLVehicleWriter.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Xml.Linq; - -namespace VECTO3GUI2020.Util.XML.Interfaces -{ - public interface IXMLVehicleWriter - { - XElement GetElement(); - } -} diff --git a/VECTO3GUI2020/Util/XML/Interfaces/IXMLWriterFactory.cs b/VECTO3GUI2020/Util/XML/Interfaces/IXMLWriterFactory.cs deleted file mode 100644 index 94c82c81bd5e50e00ded437f64ef98ca70e7fd71..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/Util/XML/Interfaces/IXMLWriterFactory.cs +++ /dev/null @@ -1,24 +0,0 @@ -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; -using TUGraz.VectoCore.OutputData.XML.Engineering.Interfaces; -using TUGraz.VectoCore.OutputData.XML.Engineering.Writer; -using VECTO3GUI2020.Util.XML.Implementation.ComponentWriter; - -namespace VECTO3GUI2020.Util.XML.Interfaces -{ - public interface IXMLWriterFactory - { - IXMLDeclarationJobWriter CreateJobWriter(IDeclarationJobInputData inputData); - IXMLVehicleWriter CreateVehicleWriter(IVehicleDeclarationInputData inputData); - IXMLComponentWriter CreateComponentWriter(IComponentInputData inputData); - IXMLComponentWriter CreateComponentWriter(IAuxiliariesDeclarationInputData inputData); - IXMLComponentWriter CreateComponentWriter(IAxlesDeclarationInputData inputData); - IXMLComponentWriter CreateComponentWriter(IAxleDeclarationInputData inputData); - IXMLComponentWriter CreateComponentWriter(IAirdragDeclarationInputData inputData); - - IXMLComponentWriter CreateComponentWriter(IPTOTransmissionInputData inputData); - IXMLComponentsWriter CreateComponentsWriter(IVehicleComponentsDeclaration inputData); - - IXMLBusAuxiliariesWriter CreateBuxAuxiliariesWriter(IBusAuxiliariesDeclarationData inputData); - } -} diff --git a/VECTO3GUI2020/Util/XML/Vehicle/IXMLVehicleWriter.cs b/VECTO3GUI2020/Util/XML/Vehicle/IXMLVehicleWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..4e1cd3d484eb156afbacd86b0b7a7081c0af6ddf --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Vehicle/IXMLVehicleWriter.cs @@ -0,0 +1,9 @@ +using System.Xml.Linq; + +namespace VECTO3GUI2020.Util.XML.Vehicle +{ + public interface IXMLVehicleWriter + { + XElement GetElement(); + } +} diff --git a/VECTO3GUI2020/Util/XML/Vehicle/XMLVehicleWriter.cs b/VECTO3GUI2020/Util/XML/Vehicle/XMLVehicleWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..2433ac4345df363ec760fe38ba09dfedcd3e9be7 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Vehicle/XMLVehicleWriter.cs @@ -0,0 +1,459 @@ +using System; +using System.Diagnostics; +using System.Linq; +using System.Security.RightsManagement; +using System.Xml; +using System.Xml.Linq; +using System.Xml.Serialization; +using TUGraz.VectoCommon.BusAuxiliaries; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24; +using TUGraz.VectoCore.Models.Declaration; +using TUGraz.VectoCore.OutputData.XML.ComponentWriter; +using TUGraz.VectoCore.OutputData.XML.GroupWriter; +using TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Properties; +using VECTO3GUI2020.Resources.XML; +using VECTO3GUI2020.Util.XML; +using VECTO3GUI2020.Util.XML.Vehicle; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; + +namespace VECTO3GUI2020.Util.XML.Vehicle +{ + public abstract class XMLVehicleWriter : IXMLVehicleWriter + { + #region XML + + protected XElement _Xelement; + + protected XNamespace _defaultNamespace; + + #endregion + + //Template Methods + protected abstract void Initialize(); + protected abstract void CreateElements(); + + protected readonly IVehicleDeclarationInputData _inputData; + protected IXMLWriterFactory _xmlWriterFactory; + + public XMLVehicleWriter(IVehicleDeclarationInputData inputData, IXMLWriterFactory xmlWriterFactory) + { + Debug.Assert(inputData != null); + _inputData = inputData; + _xmlWriterFactory = xmlWriterFactory; + } + + + public XElement GetElement() + { + if (_Xelement == null) { + Initialize(); + CreateElements(); + } + + return _Xelement; + } + } + + public abstract class XMLCompletedBusVehicleWriter : XMLVehicleWriter + { + protected readonly IComponentWriterFactory _componentWriterFactory; + protected readonly IGroupWriterFactory _groupWriterFactory; + public abstract string VehicleType { get; } + + + protected XMLCompletedBusVehicleWriter(IVehicleDeclarationInputData inputData, + IXMLWriterFactory xmlWriterFactory, IGroupWriterFactory groupWriterFactory, + IComponentWriterFactory componentWriterFactory) : base(inputData, xmlWriterFactory) + { + _groupWriterFactory = groupWriterFactory; + _componentWriterFactory = componentWriterFactory; + } + + protected override void Initialize() + { + _defaultNamespace = XMLNamespaces.V24; + + var type = new XmlTypeAttribute(); + type.Namespace = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24; + type.TypeName = VehicleType; + + XNamespace v20 = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V20; + _Xelement = new XElement(v20 + XMLNames.Component_Vehicle, + new XAttribute(XMLNames.Component_ID_Attr, + _inputData.Identifier ?? "VEH-" + Guid.NewGuid().ToString("n").Substring(0, 20)), + new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, VehicleType), + new XAttribute("xmlns", _defaultNamespace)); + } + } + + public class XMLCompletedBusVehicleWriterExempted : XMLCompletedBusVehicleWriter + { + public static readonly (XNamespace version, string type)[] SUPPORTEDVERSIONS = { + (XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, + XMLDeclarationExemptedCompletedBusDataProviderV24.XSD_TYPE) + }; + + #region Overrides of XMLCompletedBusVehicleWriter + + public override string VehicleType => XMLDeclarationExemptedCompletedBusDataProviderV24.XSD_TYPE; + + #endregion + + + #region Overrides of XMLVehicleWriter + + public XMLCompletedBusVehicleWriterExempted(IVehicleDeclarationInputData inputData, + IXMLWriterFactory xmlWriterFactory, IGroupWriterFactory groupWriterFactory, + IComponentWriterFactory componentWriterFactory) : base(inputData, xmlWriterFactory, groupWriterFactory, + componentWriterFactory) { } + + protected override void CreateElements() + { + // ReSharper disable once CoVariantArrayConversion + _Xelement.Add(_groupWriterFactory + .GetVehicleDeclarationGroupWriter(GroupNames.Vehicle_CompletedBus_GeneralParametersSequenceGroup, + _defaultNamespace).GetGroupElements(_inputData)); + + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model)); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_LegislativeCategory, + _inputData.LegislativeClass.ToXMLFormat())); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.CorrectedActualMass, + _inputData.CurbMassChassis?.ToXMLFormat(0))); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_TPMLM, + _inputData.GrossVehicleMassRating?.ToXMLFormat(0))); + + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_RegisteredClass, + _inputData.RegisteredClass.ToXMLFormat())); + + _Xelement.Add(_groupWriterFactory + .GetVehicleDeclarationGroupWriter(GroupNames.Vehicle_CompletedBus_PassengerCountSequenceGroup, + _defaultNamespace).GetGroupElements(_inputData)); + + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_BodyworkCode, + _inputData.VehicleCode.ToXMLFormat())); + + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Bus_LowEntry, _inputData.LowEntry)); + + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Bus_HeightIntegratedBody, + _inputData.Height?.ConvertToMilliMeter())); + } + + #endregion + } + + public class XMLCompletedBusVehicleWriterConventional : XMLCompletedBusVehicleWriter + { + public static readonly (XNamespace version, string type)[] SUPPORTEDVERSIONS = { + (XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, + XMLDeclarationConventionalCompletedBusDataProviderV24.XSD_TYPE) + }; + + private readonly IGroupWriterFactory _groupWriterFactory; + private readonly bool _conventional; + private readonly IComponentWriterFactory _componentWriterFactory; + + public override string VehicleType => XMLDeclarationConventionalCompletedBusDataProviderV24.XSD_TYPE; + + public XMLCompletedBusVehicleWriterConventional(IVehicleDeclarationInputData inputData, + IXMLWriterFactory xmlWriterFactory, + IGroupWriterFactory groupWriterFactory, + IComponentWriterFactory componentWriterFactory) : base(inputData, xmlWriterFactory, groupWriterFactory, + componentWriterFactory) + { + _groupWriterFactory = groupWriterFactory; + _componentWriterFactory = componentWriterFactory; + } + + #region Overrides of XMLVehicleWriter + + protected override void CreateElements() + { + CreateConventionalElements(); + } + + private void CreateConventionalElements() + { + _Xelement.Add( + _groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBus_GeneralParametersSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData), + _groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBusParametersSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData) + ); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_NgTankSystem, + _inputData.TankSystem)); + + // ReSharper disable once CoVariantArrayConversion + _Xelement.Add(_groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBus_PassengerCountSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData)); + + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_BodyworkCode, + _inputData.VehicleCode.ToXMLFormat())); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Bus_LowEntry, _inputData.LowEntry)); + + + _Xelement.Add(_groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBus_DimensionsSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData)); + + _Xelement.AddIfContentNotNull(new XElement( + _defaultNamespace + XMLNames.BusAux_PneumaticSystem_DoorDriveTechnology, + _inputData.DoorDriveTechnology != null + ? _inputData.DoorDriveTechnology.ToXMLFormat() + : null)); + + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_VehicleDeclarationType, + _inputData.VehicleDeclarationType)); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.VehicleTypeApprovalNumber, + _inputData.VehicleTypeApprovalNumber)); + + if (_inputData.ADAS != null) { + _Xelement.Add(_componentWriterFactory + .getDeclarationAdasWriter(GroupNames.ADAS_Conventional_Type, _defaultNamespace) + .GetComponent(_inputData.ADAS)); + } + + if (_inputData.Components != null) { + _Xelement.Add(_xmlWriterFactory.CreateComponentsWriterWithVersion( + XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, + XMLTypes.Components_Conventional_CompletedBusType, + _inputData.Components).GetComponents()); + } + } + + #endregion + } + + public class XMLCompletedBusVehicleWriterHEV : XMLCompletedBusVehicleWriter + { + public static (XNamespace version, string type) VERSION = ( + XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, + XMLDeclarationHevCompletedBusDataProviderV24.XSD_TYPE); + + #region Overrides of XMLCompletedBusVehicleWriter + + public override string VehicleType => XMLDeclarationHevCompletedBusDataProviderV24.XSD_TYPE; + + #endregion + + public XMLCompletedBusVehicleWriterHEV(IVehicleDeclarationInputData inputData, + IXMLWriterFactory xmlWriterFactory, IGroupWriterFactory groupWriterFactory, + IComponentWriterFactory componentWriterFactory) : base(inputData, xmlWriterFactory, groupWriterFactory, + componentWriterFactory) { } + + #region Overrides of XMLVehicleWriter + + protected override void CreateElements() + { + _Xelement.Add( + _groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBus_GeneralParametersSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData), + _groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBusParametersSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData) + ); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_NgTankSystem, + _inputData.TankSystem)); + + // ReSharper disable once CoVariantArrayConversion + _Xelement.Add(_groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBus_PassengerCountSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData)); + + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_BodyworkCode, + _inputData.VehicleCode.ToXMLFormat())); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Bus_LowEntry, _inputData.LowEntry)); + + + _Xelement.Add(_groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBus_DimensionsSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData)); + + _Xelement.AddIfContentNotNull(new XElement( + _defaultNamespace + XMLNames.BusAux_PneumaticSystem_DoorDriveTechnology, + _inputData.DoorDriveTechnology != null + ? _inputData.DoorDriveTechnology.ToXMLFormat() + : null)); + + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_VehicleDeclarationType, + _inputData.VehicleDeclarationType)); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.VehicleTypeApprovalNumber, + _inputData.VehicleTypeApprovalNumber)); + + if (_inputData.ADAS != null) { + + _Xelement.Add(_componentWriterFactory + .getDeclarationAdasWriter(GroupNames.ADAS_HEV_Type, _defaultNamespace) + .GetComponent(_inputData.ADAS)); + } + + if (_inputData.Components != null) { + _Xelement.Add(_xmlWriterFactory.CreateComponentsWriterWithVersion( + XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLTypes.Components_xEV_CompletedBusType, + _inputData.Components).GetComponents()); + } + } + + #endregion + } + + public class XMLCompletedBusVehicleWriterPEV : XMLCompletedBusVehicleWriter + { + public static (XNamespace version, string type) VERSION = ( + XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, + XMLDeclarationPEVCompletedBusDataProviderV24.XSD_TYPE); + + #region Overrides of XMLCompletedBusVehicleWriter + + public override string VehicleType => XMLDeclarationPEVCompletedBusDataProviderV24.XSD_TYPE; + + #endregion + + public XMLCompletedBusVehicleWriterPEV(IVehicleDeclarationInputData inputData, + IXMLWriterFactory xmlWriterFactory, IGroupWriterFactory groupWriterFactory, + IComponentWriterFactory componentWriterFactory) : base(inputData, xmlWriterFactory, groupWriterFactory, + componentWriterFactory) { } + + #region Overrides of XMLVehicleWriter + + protected override void CreateElements() + { + _Xelement.Add( + _groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBus_GeneralParametersSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData), + _groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBusParametersSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData) + ); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_NgTankSystem, + _inputData.TankSystem)); + + // ReSharper disable once CoVariantArrayConversion + _Xelement.Add(_groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBus_PassengerCountSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData)); + + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_BodyworkCode, + _inputData.VehicleCode.ToXMLFormat())); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Bus_LowEntry, _inputData.LowEntry)); + + + _Xelement.Add(_groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBus_DimensionsSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData)); + + _Xelement.AddIfContentNotNull(new XElement( + _defaultNamespace + XMLNames.BusAux_PneumaticSystem_DoorDriveTechnology, + _inputData.DoorDriveTechnology != null + ? _inputData.DoorDriveTechnology.ToXMLFormat() + : null)); + + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_VehicleDeclarationType, + _inputData.VehicleDeclarationType)); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.VehicleTypeApprovalNumber, + _inputData.VehicleTypeApprovalNumber)); + + if (_inputData.ADAS != null) { + _Xelement.Add(_componentWriterFactory + .getDeclarationAdasWriter(GroupNames.ADAS_PEV_Type, _defaultNamespace) + .GetComponent(_inputData.ADAS)); + } + + if (_inputData.Components != null) { + _Xelement.Add(_xmlWriterFactory.CreateComponentsWriterWithVersion( + XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLTypes.Components_xEV_CompletedBusType, + _inputData.Components).GetComponents()); + } + + } + } + + #endregion + + public class XMLCompletedBusVehicleWriterIEPC : XMLCompletedBusVehicleWriter + { + public static (XNamespace version, string type) VERSION = ( + XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, + XMLDeclarationIepcCompletedBusDataProviderV24.XSD_TYPE); + + #region Overrides of XMLCompletedBusVehicleWriter + + public override string VehicleType => XMLDeclarationIepcCompletedBusDataProviderV24.XSD_TYPE; + + #endregion + + public XMLCompletedBusVehicleWriterIEPC(IVehicleDeclarationInputData inputData, + IXMLWriterFactory xmlWriterFactory, + IGroupWriterFactory groupWriterFactory, IComponentWriterFactory componentWriterFactory) : base(inputData, + xmlWriterFactory, groupWriterFactory, componentWriterFactory) { } + + #region Overrides of XMLVehicleWriter + + protected override void CreateElements() + { + _Xelement.Add( + _groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBus_GeneralParametersSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData), + _groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBusParametersSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData) + ); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_NgTankSystem, + _inputData.TankSystem)); + + // ReSharper disable once CoVariantArrayConversion + _Xelement.Add(_groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBus_PassengerCountSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData)); + + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Vehicle_BodyworkCode, + _inputData.VehicleCode.ToXMLFormat())); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.Bus_LowEntry, _inputData.LowEntry)); + + + _Xelement.Add(_groupWriterFactory.GetVehicleDeclarationGroupWriter( + GroupNames.Vehicle_CompletedBus_DimensionsSequenceGroup, _defaultNamespace) + .GetGroupElements(_inputData)); + + _Xelement.AddIfContentNotNull(new XElement( + _defaultNamespace + XMLNames.BusAux_PneumaticSystem_DoorDriveTechnology, + _inputData.DoorDriveTechnology != null + ? _inputData.DoorDriveTechnology.ToXMLFormat() + : null)); + + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Bus_VehicleDeclarationType, + _inputData.VehicleDeclarationType)); + _Xelement.AddIfContentNotNull(new XElement(_defaultNamespace + XMLNames.VehicleTypeApprovalNumber, + _inputData.VehicleTypeApprovalNumber)); + + if (_inputData.ADAS != null) { + _Xelement.Add(_componentWriterFactory + .getDeclarationAdasWriter(GroupNames.ADAS_IEPC_Type, _defaultNamespace) + .GetComponent(_inputData.ADAS)); + } + + if (_inputData.Components != null) { + _Xelement.Add(_xmlWriterFactory.CreateComponentsWriterWithVersion( + XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLTypes.Components_xEV_CompletedBusType, + _inputData.Components).GetComponents()); + } + } + } +} + +#endregion \ No newline at end of file diff --git a/VECTO3GUI2020/VECTO3GUI2020.csproj b/VECTO3GUI2020/VECTO3GUI2020.csproj index 1c31f8ef61b82310512be01b2f137fc49f9c33da..31403c6cfc1af0797592ee1f5f80fab85094505e 100644 --- a/VECTO3GUI2020/VECTO3GUI2020.csproj +++ b/VECTO3GUI2020/VECTO3GUI2020.csproj @@ -9,7 +9,7 @@ <ApplicationIcon>Resources\Icons\Icon2.ico</ApplicationIcon> <UseWPF>true</UseWPF> <UseWindowsForms>true</UseWindowsForms> - <PublishTrimmed >false</PublishTrimmed > + <PublishTrimmed>false</PublishTrimmed> <ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets> <TargetFrameworks>net48;net6.0-windows</TargetFrameworks> <DefineConstants /> @@ -107,6 +107,16 @@ <Resource Include="Resources\Images\VECTO-About.png" /> </ItemGroup> + <ItemGroup> + <Page Update="MainWindow.xaml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Page> + </ItemGroup> + + <ItemGroup> + <Folder Include="Util\XML\Implementation\DocumentWriter\" /> + </ItemGroup> + <!--Workauround for build error--> <!--https://github.com/dotnet/wpf/pull/6680--> diff --git a/VECTO3GUI2020/ViewModel/Implementation/AboutViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/AboutViewModel.cs index 22d39d6457ccf5a8cdc6843513249181cb654e64..bb2c2011c960a78710e9269d42a6d45de4120841 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/AboutViewModel.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/AboutViewModel.cs @@ -1,6 +1,6 @@ using System.Diagnostics; using System.Windows.Input; -using VECTO3GUI2020.Util; +using CommunityToolkit.Mvvm.Input; using VECTO3GUI2020.ViewModel.Implementation.Common; using VECTO3GUI2020.ViewModel.Interfaces; diff --git a/VECTO3GUI2020/ViewModel/Implementation/Document/DocumentViewModelFactory.cs b/VECTO3GUI2020/ViewModel/Implementation/Document/DocumentViewModelFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..92151a1c76730383939efd7d061673914512e0a8 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/Document/DocumentViewModelFactory.cs @@ -0,0 +1,96 @@ +using System; +using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.ViewModel.Interfaces.Document; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using VECTO3GUI2020.Views.Multistage; + +namespace VECTO3GUI2020.ViewModel.Implementation.Document +{ + public class DocumentViewModelFactory : IDocumentViewModelFactory + { + private readonly IMultiStepInputViewModelFactory _multistepInputFactory; + private readonly IDeclarationInputViewModelFactory _declarationInputViewModelFactory; + private readonly INewDocumentViewModelFactory _newDocumentViewModelFactory; + private readonly IPrimaryAndStageInputViewModelFactory _primaryAndStageViewModelFactory; + + + public DocumentViewModelFactory( + IMultiStepInputViewModelFactory multiStepInputFactory, + IDeclarationInputViewModelFactory declarationInputViewModelFactory, + INewDocumentViewModelFactory newDocumentViewModelFactory, + IPrimaryAndStageInputViewModelFactory primaryAndStageFactory) + { + _multistepInputFactory = multiStepInputFactory; + _declarationInputViewModelFactory = declarationInputViewModelFactory; + _newDocumentViewModelFactory = newDocumentViewModelFactory; + _primaryAndStageViewModelFactory = primaryAndStageFactory; + } + + + public IDocumentViewModel CreateDocumentViewModel(IInputDataProvider inputData) + { + switch (inputData) + { + case IMultistepBusInputDataProvider multiStep: + return CreateMultistageViewModel(multiStep); + case IMultistageVIFInputData createVifInput: + return CreateVifViewModel(createVifInput); + case IMultistagePrimaryAndStageInputDataProvider primaryAndStep: + return CreatePrimaryAndStageDocumentViewModel(primaryAndStep); + case IDeclarationInputDataProvider declarationInputDataProvider: + return CreateDeclarationInputDocumentViewModel(declarationInputDataProvider); + } + throw new Exception($"{inputData.DataSource.SourceFile} could not be opened"); + + } + /// <summary> + /// Attempts the creation of a viewmodel for the provided input data, in case no matching binding is found, a <see cref="SimulationOnlyDeclarationJob"/> is created, to allow simulation but no editing + /// </summary> + /// <param name="declarationInputDataProvider"></param> + /// <returns></returns> + /// <exception cref="NotImplementedException"></exception> + private IDocumentViewModel CreateDeclarationInputDocumentViewModel(IDeclarationInputDataProvider declarationInputDataProvider) + { + return _declarationInputViewModelFactory.CreateDeclarationViewModel(declarationInputDataProvider); + } + + private IDocumentViewModel CreatePrimaryAndStageDocumentViewModel(IMultistagePrimaryAndStageInputDataProvider primaryAndStep) + { + return _primaryAndStageViewModelFactory.CreateDeclarationViewModel(primaryAndStep); + } + + private IDocumentViewModel CreateMultistageViewModel(IMultistepBusInputDataProvider inputData) + { + return _multistepInputFactory.CreateMultistepViewModel(inputData); + } + + + + /// <summary> + /// Viewmodel to create VIF out of VIF + step input + /// </summary> + /// <returns></returns> + private IDocumentViewModel CreateVifViewModel(IMultistageVIFInputData createVif) + { + throw new VectoException($"No viewmodel for {nameof(IMultistageVIFInputData)}"); + } + + public IDocumentViewModel GetCreateNewStepInputViewModel(bool exemptedVehicle) + { + return _newDocumentViewModelFactory.GetCreateNewStepInputViewModel(exemptedVehicle); + } + + public IDocumentViewModel GetCreateNewVifViewModel(bool completed) + { + return _newDocumentViewModelFactory.GetCreateNewVifViewModel(completed); + } + + //public IDocumentViewModel GetCreateNewVifViewModel() + //{ + // return _newDocumentViewModelFactory.GetCreateNewVifViewModel(); + //} + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/Implementation/Document/SimulationOnlyDeclarationJob.cs b/VECTO3GUI2020/ViewModel/Implementation/Document/SimulationOnlyDeclarationJob.cs index 77f8343fd9d3bb81be7417cc855eb9f8377f87d6..07f5cbaf630de9df1e677ef87b982d9f54c7836f 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/Document/SimulationOnlyDeclarationJob.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/Document/SimulationOnlyDeclarationJob.cs @@ -65,6 +65,13 @@ namespace VECTO3GUI2020.ViewModel.Implementation.Document _documentName = name; } + public SimulationOnlyDeclarationJob(IDeclarationInputDataProvider inputData) + { + _documentType = XmlDocumentType.DeclarationJobData; + _dataSource = inputData.DataSource; + _documentName = inputData.JobInputData.JobName; + } + } } \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/DeclarationJobEditViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/DeclarationJobEditViewModel.cs index 6e6b830b0fc1f34771b536e77449dc2a5867f112..94738786e2785883ab84862372713af4f980b089 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/DeclarationJobEditViewModel.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/DeclarationJobEditViewModel.cs @@ -10,20 +10,19 @@ using System.Windows.Input; using System.Xml; using System.Xml.Linq; using System.Xml.Schema; +using CommunityToolkit.Mvvm.Input; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; -using TUGraz.VectoCore.Utils; using VECTO3GUI2020.Helper; using VECTO3GUI2020.Properties; -using VECTO3GUI2020.Util; -using VECTO3GUI2020.Util.XML.Interfaces; using VECTO3GUI2020.ViewModel.Implementation.Common; using VECTO3GUI2020.ViewModel.Interfaces; using VECTO3GUI2020.ViewModel.Interfaces.JobEdit; using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; +using VECTO3GUI2020.Util.XML; namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit { diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AirDragViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AirDragViewModel.cs index 7a455bedc0d3959a2f845a92d5262d7de1153f04..51266c4e4f1c8d0bcf16b73eae62f90ee1419038 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AirDragViewModel.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AirDragViewModel.cs @@ -34,7 +34,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components - public AirDragViewModel(IXMLAirdragDeclarationInputData inputData, IComponentViewModelFactory vmFactory) + public AirDragViewModel(IAirdragDeclarationInputData inputData, IComponentViewModelFactory vmFactory) { LabelVisible = true; IsReadOnly = false; @@ -48,7 +48,6 @@ namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components SetProperties(); } - public abstract void SetProperties(); public string Name { get { return _name; } } private bool _isPresent; @@ -115,21 +114,25 @@ namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components public virtual SquareMeter AirDragArea { - get => throw new NotImplementedException(); - set => throw new NotImplementedException(); + get => _airDragArea; + set => SetProperty(ref _airDragArea, value); } - public virtual SquareMeter TransferredAirDragArea { - get => throw new NotImplementedException(); - set => throw new NotImplementedException(); + + public virtual SquareMeter TransferredAirDragArea + { + get => _transferredAirDragArea; + set => SetProperty(ref _transferredAirDragArea, value); } - public virtual SquareMeter AirDragArea_0 { - get => throw new NotImplementedException(); - set => throw new NotImplementedException(); + + public virtual SquareMeter AirDragArea_0 + { + get => _airDragArea_0; + set => SetProperty(ref _airDragArea_0, value); } - #endregion + #endregion - public bool LabelVisible + public bool LabelVisible { get => _labelVisible; set => SetProperty(ref _labelVisible, value); @@ -140,20 +143,24 @@ namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components get => _isReadOnly; set => SetProperty(ref _isReadOnly, value); } + + public abstract void SetProperties(); } public class AirDragViewModel_v1_0 : AirDragViewModel { public static readonly string VERSION = typeof(XMLDeclarationAirdragDataProviderV10).FullName; - public AirDragViewModel_v1_0(IXMLAirdragDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + public AirDragViewModel_v1_0(IAirdragDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) { } public override void SetProperties() { - throw new NotImplementedException(); + _airDragArea = _inputData.AirDragArea; + _airDragArea_0 = _inputData.AirDragArea_0; + _transferredAirDragArea = _inputData.TransferredAirDragArea; } } @@ -161,7 +168,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components { public static new readonly string VERSION = typeof(XMLDeclarationAirdragDataProviderV20).FullName; - public AirDragViewModel_v2_0(IXMLAirdragDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + public AirDragViewModel_v2_0(IAirdragDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) { } @@ -195,7 +202,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components { public new static readonly string VERSION = typeof(XMLDeclarationAirdragDataProviderV24).FullName; - public AirDragViewModel_v2_4(IXMLAirdragDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + public AirDragViewModel_v2_4(IAirdragDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) { LabelVisible = false; IsReadOnly = true; diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AuxiliariesViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AuxiliariesViewModel.cs index c7c7a32f3aeded10f748918dfc21f670d21a09cc..7259b5b66def481b86f3585394d96cc9d0812611 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AuxiliariesViewModel.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AuxiliariesViewModel.cs @@ -62,7 +62,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components foreach (var auxiliary in _inputData.Auxiliaries) { Debug.Assert(auxiliary.Technology.Count == 1); - var componentViewModel = _componentViewModelFactory.CreateComponentViewModel(auxiliary as IXMLAuxiliaryDeclarationInputData); + var componentViewModel = _componentViewModelFactory.CreateComponentViewModel(auxiliary); AuxiliaryViewModels.Add(componentViewModel as IAuxiliaryViewModel); } } diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs index 728e55fa2eaa6843675d312c2d4ab3c941430537..7640d8d0625ea0348ecc9d0c4f64be14ac5cdd61 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs @@ -20,10 +20,12 @@ using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCore.InputData.FileIO.JSON; using TUGraz.VectoCore.InputData.FileIO.XML; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; using TUGraz.VectoCore.Models.Simulation; using TUGraz.VectoCore.Models.Simulation.Impl; @@ -75,7 +77,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation private IDialogHelper _dialogHelper; private IWindowHelper _windowHelper; - private IDocumentViewModelFactory _documentViewModelFactory; + //private IDocumentViewModelFactory _documentViewModelFactory; private IMultiStageViewModelFactory _multiStageViewModelFactory; private readonly IXMLInputDataReader _inputDataReader; @@ -99,7 +101,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation } - public JobListViewModel(IDocumentViewModelFactory documentViewModelFactory, + public JobListViewModel( IXMLInputDataReader inputDataReader, IDialogHelper dialogHelper, IWindowHelper windowHelper, @@ -107,8 +109,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation ISimulatorFactoryFactory simulatorFactoryFactory, IOutputViewModel outputViewModel) : this() { - _documentViewModelFactory = documentViewModelFactory; - _dialogHelper = dialogHelper; + _dialogHelper = dialogHelper; _windowHelper = windowHelper; _inputDataReader = inputDataReader; _multiStageViewModelFactory = multiStageViewModelFactory; @@ -135,6 +136,8 @@ namespace VECTO3GUI2020.ViewModel.Implementation System.Windows.Application.Current.Exit += new ExitEventHandler(this.OnApplicationExit); LoadFiles(); } + + _jobs.CollectionChanged += (sender, args) => SaveFileNamesToFile(); } @@ -278,41 +281,43 @@ namespace VECTO3GUI2020.ViewModel.Implementation private Task<IDocumentViewModel> LoadXMLFile([NotNull] string fileName) { - var xElement = new System.Xml.XmlDocument(); - xElement.Load(fileName); - - var documentType = XMLHelper.GetDocumentType(xElement?.DocumentElement?.LocalName); - if (documentType == XmlDocumentType.MultistepOutputData) + var documentType = XMLHelper.GetDocumentTypeFromFile(fileName); + if (!documentType.IsOneOf(XmlDocumentType.MultistepOutputData, XmlDocumentType.DeclarationJobData)) { - var inputDataProvider = _inputDataReader.Create(fileName) as IMultistepBusInputDataProvider; - return Task.FromResult(_multiStageViewModelFactory.GetMultiStageJobViewModel(inputDataProvider) as IDocumentViewModel); - } - else if (documentType == XmlDocumentType.DeclarationJobData) - { - //Remove - var inputDataProvider = _inputDataReader.CreateDeclaration(fileName); - IDocumentViewModel result; - try - { - result = _multiStageViewModelFactory.CreateDocumentViewModel(inputDataProvider); - } - catch (Exception ex) - { - Debug.WriteLine(ex.GetInnerExceptionMessages()); - result = new SimulationOnlyDeclarationJob(inputDataProvider.DataSource, inputDataProvider.JobInputData.JobName, XmlDocumentType.DeclarationJobData) as IDocumentViewModel; - } - return Task.FromResult(result); - } - else { return Task.FromException<IDocumentViewModel>( new VectoXMLException($"{documentType.ToString()} not supported")); - //throw new VectoXMLException($"{documentType.ToString()} not supported"); } - return null; - - - + var inputDataProvider = _inputDataReader.CreateDeclaration(fileName); + var vm = _multiStageViewModelFactory.CreateDocumentViewModel(inputDataProvider); + return Task.FromResult(vm); + + //if (documentType == XmlDocumentType.MultistepOutputData) + //{ + // var inputDataProvider = _inputDataReader.Create(fileName) as IMultistepBusInputDataProvider; + // return Task.FromResult(_multiStageViewModelFactory.GetMultiStageJobViewModel(inputDataProvider) as IDocumentViewModel); + //} + //else if (documentType == XmlDocumentType.DeclarationJobData) + //{ + // //Remove + // var inputDataProvider = _inputDataReader.CreateDeclaration(fileName); + // IDocumentViewModel result; + // try + // { + // result = _multiStageViewModelFactory.CreateDocumentViewModel(inputDataProvider); + // } + // catch (Exception ex) + // { + // Debug.WriteLine(ex.GetInnerExceptionMessages()); + // result = new SimulationOnlyDeclarationJob(inputDataProvider.DataSource, inputDataProvider.JobInputData.JobName, XmlDocumentType.DeclarationJobData) as IDocumentViewModel; + // } + // return Task.FromResult(result); + //} + //else { + // return Task.FromException<IDocumentViewModel>( + // new VectoXMLException($"{documentType.ToString()} not supported")); + // //throw new VectoXMLException($"{documentType.ToString()} not supported"); + //} } #endregion @@ -865,7 +870,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation private void NewCompletedInputCommandExecute(bool exempted) { - var stageInputVm = _multiStageViewModelFactory.GetStageInputViewModel(exempted); + var stageInputVm = _multiStageViewModelFactory.GetCreateNewStepInputViewModel(exempted); AddJob(stageInputVm); @@ -888,7 +893,9 @@ namespace VECTO3GUI2020.ViewModel.Implementation { return _newVifCommand ?? (_newVifCommand = new RelayCommand<bool>((b) => { var newVifViewModel = _multiStageViewModelFactory.GetCreateNewVifViewModel(b); - lock (_jobsLock) { + //var newVifViewModel = _multiStageViewModelFactory.GetCreateNewVifViewModel(b); + lock (_jobsLock) + { _jobs.Add(newVifViewModel); } _windowHelper.ShowWindow(newVifViewModel); @@ -933,7 +940,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation { get { - return _editJobCommand ?? (_editJobCommand = new Util.RelayCommand<IDocumentViewModel>(EditDocumentExecute, + return _editJobCommand ?? (_editJobCommand = new RelayCommand<IDocumentViewModel>(EditDocumentExecute, (IDocumentViewModel jobentry) => { var canExecute = jobentry != null && jobentry.EditViewModel != null; return canExecute; @@ -958,7 +965,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation { get { - return _viewXMLCommand ?? new Util.RelayCommand<IJobViewModel>(ViewXMLFileExecute, + return _viewXMLCommand ?? new RelayCommand<IJobViewModel>(ViewXMLFileExecute, (IJobViewModel jobentry) => { return (jobentry != null); @@ -1026,7 +1033,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation { get { - return _moveJobUpCommand ?? new Util.RelayCommand<IDocumentViewModel>(MoveJobUpExecute, (IDocumentViewModel jobentry) => + return _moveJobUpCommand ?? new RelayCommand<IDocumentViewModel>(MoveJobUpExecute, (IDocumentViewModel jobentry) => { return (jobentry != null && Jobs.Count > 1 && Jobs.IndexOf(jobentry) != 0); }); @@ -1052,7 +1059,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation { get { - return _moveJobDownCommand ?? new Util.RelayCommand<IDocumentViewModel>(MoveJobDownExecute, (IDocumentViewModel jobentry) => + return _moveJobDownCommand ?? new RelayCommand<IDocumentViewModel>(MoveJobDownExecute, (IDocumentViewModel jobentry) => { return (jobentry != null && Jobs.Count > 1 && Jobs.IndexOf(jobentry) != Jobs.Count - 1); }); diff --git a/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs index 2d57fad4d1060fab475b11577282f0106a9578ae..e082c1bc99685366251e7ebfe5bcc5e2e9d23e15 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using VECTO3GUI2020.ViewModel.Interfaces; using System.Windows.Input; using System.Reflection; +using CommunityToolkit.Mvvm.Input; using VECTO3GUI2020.Helper; using VECTO3GUI2020.ViewModel.Implementation.Common; -using VECTO3GUI2020.Util; namespace VECTO3GUI2020.ViewModel.Implementation { diff --git a/VECTO3GUI2020/ViewModel/Implementation/OutputViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/OutputViewModel.cs index fc84fc8ef8dff4dcb3ac9a5171e00ca5af072f03..3cfb526b33c0c8a0cc2c530de72c7ddd73b235c0 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/OutputViewModel.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/OutputViewModel.cs @@ -2,8 +2,8 @@ using System.Collections.ObjectModel; using System.Windows.Data; using System.Windows.Input; +using CommunityToolkit.Mvvm.Input; using VECTO3GUI2020.Helper; -using VECTO3GUI2020.Util; using VECTO3GUI2020.ViewModel.Implementation.Common; using VECTO3GUI2020.ViewModel.Interfaces; diff --git a/VECTO3GUI2020/ViewModel/Implementation/SettingsViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/SettingsViewModel.cs index 3d25b5f92d4047893b0560da2cace6b606367073..a4e85720ee6ca326dc858ae732d645bbc5670375 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/SettingsViewModel.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/SettingsViewModel.cs @@ -4,9 +4,9 @@ using System.IO; using System.Windows; using System.Windows.Forms; using System.Windows.Input; +using CommunityToolkit.Mvvm.Input; using VECTO3GUI2020.Helper; using VECTO3GUI2020.Properties; -using VECTO3GUI2020.Util; using VECTO3GUI2020.ViewModel.Implementation.Common; using VECTO3GUI2020.ViewModel.Interfaces; diff --git a/VECTO3GUI2020/ViewModel/Interfaces/Document/IDocumentViewModelFactory.cs b/VECTO3GUI2020/ViewModel/Interfaces/Document/IDocumentViewModelFactory.cs index d9b0d9fff1c98f26dac9f6bf9430e8efb7eab7d9..23439d1b0e421d4e4067510a6f5df5006ccb0522 100644 --- a/VECTO3GUI2020/ViewModel/Interfaces/Document/IDocumentViewModelFactory.cs +++ b/VECTO3GUI2020/ViewModel/Interfaces/Document/IDocumentViewModelFactory.cs @@ -1,8 +1,10 @@ -using TUGraz.VectoCore.Utils; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; namespace VECTO3GUI2020.ViewModel.Interfaces.Document { - public interface IDocumentViewModelFactory + public interface IDocumentViewModelFactory : INewDocumentViewModelFactory { /* public enum XmlDocumentType @@ -20,8 +22,36 @@ namespace VECTO3GUI2020.ViewModel.Interfaces.Document } */ - IDocumentViewModel CreateDocumentViewModel(XmlDocumentType xmlDocumentType, string sourcefile); + IDocumentViewModel CreateDocumentViewModel(IInputDataProvider declarationInput); + } + + + public interface IMultiStepInputViewModelFactory + { + IDocumentViewModel CreateMultistepViewModel(IMultistepBusInputDataProvider inputData); + } + + public interface ICreateVifViewModelFactory + { + IDocumentViewModel CreateVifViewModel(IMultistageVIFInputData multistep); + } + public interface IDeclarationInputViewModelFactory + { + IDocumentViewModel CreateDeclarationViewModel(IDeclarationInputDataProvider inputData); + } + + public interface IPrimaryAndStageInputViewModelFactory + { + IDocumentViewModel CreateDeclarationViewModel(IMultistagePrimaryAndStageInputDataProvider inputData); + } + + public interface INewDocumentViewModelFactory + { + IDocumentViewModel GetCreateNewStepInputViewModel(bool exemptedVehicle); + IDocumentViewModel GetCreateNewVifViewModel(bool completed); + //IDocumentViewModel GetCreateNewVifViewModel(); + } } diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IComponentViewModelFactory.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IComponentViewModelFactory.cs index a7c964dd5f27c4084768bba78732185c07be0cbb..ceb592c14e9e75535b1a79adb3efddde0f5ba65b 100644 --- a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IComponentViewModelFactory.cs +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IComponentViewModelFactory.cs @@ -1,21 +1,120 @@ -using TUGraz.VectoCommon.InputData; +using System; +using TUGraz.VectoCommon.InputData; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using VECTO3GUI2020.Ninject.Factories; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components { - public interface IComponentViewModelFactory + public interface IComponentViewModelFactory { /// <summary> /// Creates a ViewModel for a component. /// </summary> /// <param name="inputData">The Type of the input Data is used to resolve a Named Binding and is also passed to the constructor</param> /// <returns></returns> - IComponentViewModel CreateComponentViewModel(object inputData); - IVehicleViewModel CreateVehicleViewModel(IVehicleDeclarationInputData inputData); - IAdasViewModel CreateAdasViewModel(IAdvancedDriverAssistantSystemDeclarationInputData inputData); - IEngineModeViewModel CreateEngineModeViewModel(IEngineModeDeclarationInputData inputData); - IEngineFuelViewModel CreateEngineFuelViewModel(IEngineFuelDeclarationInputData inputData); - IComponentsViewModel CreateComponentsViewModel(IXMLVehicleComponentsDeclaration inputData); + IComponentViewModel CreateComponentViewModel(IComponentInputData inputData); + IVehicleViewModel CreateVehicleViewModel(IVehicleDeclarationInputData inputData); + IAdasViewModel CreateAdasViewModel(IAdvancedDriverAssistantSystemDeclarationInputData inputData); + IEngineModeViewModel CreateEngineModeViewModel(IEngineModeDeclarationInputData inputData); + IEngineFuelViewModel CreateEngineFuelViewModel(IEngineFuelDeclarationInputData inputData); + IComponentsViewModel CreateComponentsViewModel(IXMLVehicleComponentsDeclaration inputData); ICommonComponentViewModel CreateCommonComponentViewModel(IComponentInputData inputData); + + + IComponentViewModel CreateComponentViewModel(ITransmissionInputData inputData); + IComponentViewModel CreateComponentViewModel(IPTOTransmissionInputData inputData); + IComponentViewModel CreateComponentViewModel(IAxlesDeclarationInputData inputData); + IComponentViewModel CreateComponentViewModel(IAxleDeclarationInputData inputData); + IComponentViewModel CreateComponentViewModel(IAuxiliariesDeclarationInputData inputData); + IComponentViewModel CreateComponentViewModel(IAuxiliaryDeclarationInputData inputData); + + + + } + + public class ComponentViewModelFactory : IComponentViewModelFactory + { + private readonly IComponentViewModelFactoryInternal _internalFactory; + + #region Implementation of IComponentViewModelFactory + + public ComponentViewModelFactory(IComponentViewModelFactoryInternal internalFactory) + { + _internalFactory = internalFactory; + } + + public IComponentViewModel CreateComponentViewModel(IComponentInputData inputData) + { + return CreateComponentViewModel(inputData.DataSource, inputData); + } + + + private IComponentViewModel CreateComponentViewModel<TIn>(DataSource dataSource, TIn inputData) + { + return _internalFactory.CreateComponentViewModel(dataSource, inputData); + } + + public IVehicleViewModel CreateVehicleViewModel(IVehicleDeclarationInputData inputData) + { + throw new NotImplementedException(); + } + + public IAdasViewModel CreateAdasViewModel(IAdvancedDriverAssistantSystemDeclarationInputData inputData) + { + throw new NotImplementedException(); + } + + public IEngineModeViewModel CreateEngineModeViewModel(IEngineModeDeclarationInputData inputData) + { + throw new NotImplementedException(); + } + + public IEngineFuelViewModel CreateEngineFuelViewModel(IEngineFuelDeclarationInputData inputData) + { + throw new NotImplementedException(); + } + + public IComponentsViewModel CreateComponentsViewModel(IXMLVehicleComponentsDeclaration inputData) + { + throw new NotImplementedException(); + } + + public ICommonComponentViewModel CreateCommonComponentViewModel(IComponentInputData inputData) + { + return _internalFactory.CreateCommonComponentViewModel(inputData); + } + + public IComponentViewModel CreateComponentViewModel(ITransmissionInputData inputData) + { + throw new NotImplementedException(); + } + + public IComponentViewModel CreateComponentViewModel(IPTOTransmissionInputData inputData) + { + throw new NotImplementedException(); + } + + public IComponentViewModel CreateComponentViewModel(IAxlesDeclarationInputData inputData) + { + throw new NotImplementedException(); + } + + public IComponentViewModel CreateComponentViewModel(IAxleDeclarationInputData inputData) + { + throw new NotImplementedException(); + } + + public IComponentViewModel CreateComponentViewModel(IAuxiliariesDeclarationInputData inputData) + { + throw new NotImplementedException(); + } + + public IComponentViewModel CreateComponentViewModel(IAuxiliaryDeclarationInputData inputData) + { + throw new NotImplementedException(); + } + + #endregion } } diff --git a/VECTO3GUI2020/ViewModel/MultiStage/ClassDiagram1.cd b/VECTO3GUI2020/ViewModel/MultiStage/ClassDiagram1.cd new file mode 100644 index 0000000000000000000000000000000000000000..bf78d9e5a6a4ade59fe3b28cbc20bf89e6343a8c --- /dev/null +++ b/VECTO3GUI2020/ViewModel/MultiStage/ClassDiagram1.cd @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="utf-8"?> +<ClassDiagram MajorVersion="1" MinorVersion="1"> + <Class Name="VECTO3GUI2020.ViewModel.MultiStage.Implementation.StageInputViewModel"> + <Position X="8" Y="3.75" Width="3.5" /> + <TypeIdentifier> + <HashCode>AAAABAAABAQAAgAAEEAAAAQAAIAABIEAAAAGQACABkI=</HashCode> + <FileName>ViewModel\MultiStage\Implementation\StageInputViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.MultiStage.Implementation.MultiStageJobViewModel_v0_1"> + <Position X="1.75" Y="5.5" Width="2.5" /> + <TypeIdentifier> + <HashCode>GAAAFAAIBEQBAgQCBMgCAhQQEIAAAEGAEABAmYGgBgY=</HashCode> + <FileName>ViewModel\MultiStage\Implementation\MultistageJobViewModel_v0_1.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.MultiStage.Implementation.NullSumWriter" Collapsed="true"> + <Position X="4.5" Y="5.5" Width="2.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAg=</HashCode> + <FileName>ViewModel\MultiStage\Implementation\MultistageJobViewModel_v0_1.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.MultiStage.Implementation.InterimStageBusVehicleViewModel_v2_8" BaseTypeListCollapsed="true"> + <Position X="14.5" Y="5" Width="2.75" /> + <TypeIdentifier> + <HashCode>GoqtjOJsdkIQU7J5C/N3qMfFnRmkC4GNAjrL18uimxo=</HashCode> + <FileName>ViewModel\MultiStage\Implementation\InterimStageBusVehicleViewModel_v2_8.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" Collapsed="true" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.MultiStage.Implementation.CreateVifViewModel"> + <Position X="11.75" Y="5.25" Width="2" /> + <TypeIdentifier> + <HashCode>BQABhAEChEQAggYAhEiAGAVQgBBAgEEAOAIgRAGEBgo=</HashCode> + <FileName>ViewModel\MultiStage\Implementation\CreateVifViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Interface Name="VECTO3GUI2020.ViewModel.Interfaces.Document.IDocumentViewModel" Collapsed="true"> + <Position X="1.25" Y="0.75" Width="4.5" /> + <TypeIdentifier> + <HashCode>AAAABAAABAQAAgAAAAAAAAAAAAAAAAAAAAAAAACABgI=</HashCode> + <FileName>ViewModel\Interfaces\Document\IDocumentViewModel.cs</FileName> + </TypeIdentifier> + </Interface> + <Interface Name="VECTO3GUI2020.ViewModel.Interfaces.Document.IJobViewModel" Collapsed="true"> + <Position X="1.75" Y="2" Width="2" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> + <FileName>ViewModel\Interfaces\Document\IJobViewModel.cs</FileName> + </TypeIdentifier> + </Interface> + <Interface Name="VECTO3GUI2020.ViewModel.MultiStage.Implementation.ICreateVifViewModel" Collapsed="true"> + <Position X="5" Y="1.75" Width="2" /> + <TypeIdentifier> + <HashCode>AAAAAAACgAAAAAAAAAgAEAAAAAAAAEAACAAARAEAAAA=</HashCode> + <FileName>ViewModel\MultiStage\Implementation\CreateVifViewModel.cs</FileName> + </TypeIdentifier> + </Interface> + <Interface Name="VECTO3GUI2020.ViewModel.MultiStage.Implementation.IMultiStageJobViewModel" Collapsed="true"> + <Position X="1.5" Y="3.5" Width="4.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAIgAAAAAAAAAAACAAAAAAAAAAAA=</HashCode> + <FileName>ViewModel\MultiStage\Implementation\MultistageJobViewModel_v0_1.cs</FileName> + </TypeIdentifier> + </Interface> + <Interface Name="VECTO3GUI2020.ViewModel.MultiStage.Implementation.IMultistageVehicleViewModel" Collapsed="true"> + <Position X="12" Y="1.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAgAAIAAAAAAQAAAAAAAAEAAAAAAAAIAAAAAgAAAAA=</HashCode> + <FileName>ViewModel\MultiStage\Implementation\InterimStageBusVehicleViewModel_v2_8.cs</FileName> + </TypeIdentifier> + </Interface> + <Enum Name="VECTO3GUI2020.ViewModel.MultiStage.Implementation.AIRDRAGMODIFIED" Collapsed="true"> + <Position X="15" Y="4.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAA=</HashCode> + <FileName>ViewModel\MultiStage\Implementation\InterimStageBusVehicleViewModel_v2_8.cs</FileName> + </TypeIdentifier> + </Enum> + <Font Name="Segoe UI" Size="9" /> +</ClassDiagram> \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Factories/IMultistepComponentViewModelFactory.cs b/VECTO3GUI2020/ViewModel/MultiStage/Factories/IMultistepComponentViewModelFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..a5be406464ad68d9d21b708f9bcb33ee0a4027de --- /dev/null +++ b/VECTO3GUI2020/ViewModel/MultiStage/Factories/IMultistepComponentViewModelFactory.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VECTO3GUI2020.ViewModel.MultiStage.Factories +{ + +} diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs index f1217cbed0bcf4a96faed06ca18997f2a595e97d..291465c0b6493d4a784d7550eb6e9e0a0165cc5f 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs @@ -156,7 +156,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation private void SetInputData(IInputDataProvider inputData) { - var inputDataProvider = inputData as JSONInputDataV10_PrimaryAndStageInputBus; + var inputDataProvider = inputData as IMultistagePrimaryAndStageInputDataProvider; Debug.Assert(inputDataProvider != null); try { @@ -381,7 +381,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation try { inputData = _inputDataReader.Create(fileName) as IDeclarationInputDataProvider; - valid = inputData != null && inputData.JobInputData.Vehicle.VehicleCategory.IsBus(); + + valid = inputData != null && inputData.JobInputData.Vehicle.VehicleCategory == VehicleCategory.HeavyBusPrimaryVehicle; } catch (Exception ex) { diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel.cs similarity index 83% rename from VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs rename to VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel.cs index 652da7f5a8d298a861130e34f93f01ddeb1d1515..20e1b61dda00f0bee48333e4a952fae62874e5a0 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel.cs @@ -6,16 +6,19 @@ using System.Diagnostics; using System.Resources; using System.Runtime.CompilerServices; using System.Xml; +using System.Xml.Linq; using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24; +using TUGraz.VectoCore.Utils; using VECTO3GUI2020.Helper; using VECTO3GUI2020.Properties; +using VECTO3GUI2020.Resources.XML; +using VECTO3GUI2020.Util.XML; using VECTO3GUI2020.ViewModel.Implementation.Common; -using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; using EnumHelper = VECTO3GUI2020.Helper.EnumHelper; @@ -58,18 +61,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation } } - public interface IMultistageVehicleViewModel : IVehicleViewModel, INotifyPropertyChanged - { - bool HasErrors { get; } - Dictionary<string, string> Errors { get; } - IMultistageAirdragViewModel MultistageAirdragViewModel { get; set; } - IMultistageAuxiliariesViewModel MultistageAuxiliariesViewModel { get; set; } - bool PrimaryVehicleHybridElectric { get; set; } - void SetVehicleInputData(IVehicleDeclarationInputData vehicleInputData); - } - - public class InterimStageBusVehicleViewModel_v2_8 : ViewModelBase, IMultistageVehicleViewModel, + public abstract class InterimStageBusVehicleViewModel : ViewModelBase, IMultistageVehicleViewModel, IVehicleComponentsDeclaration, IAdvancedDriverAssistantSystemDeclarationInputData, IDataErrorInfo { public static readonly Type INPUTPROVIDERTYPE = typeof(XMLDeclarationConventionalCompletedBusDataProviderV24); @@ -77,6 +70,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation public static string VERSION = INPUTPROVIDERTYPE.ToString(); public static string VERSION_EXEMPTED = INPUTPROVIDERTYPEEXEMPTED.ToString(); + public abstract CompletedBusArchitecture Architecture { get; } private readonly IMultiStageViewModelFactory _multiStageViewModelFactory; @@ -115,13 +109,18 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation #endregion - + protected bool _exemptedVehicle; public string Name => "Vehicle"; public bool IsPresent => true; - public DataSource DataSource => throw new NotImplementedException(); + public DataSource DataSource => new DataSource() { + TypeVersion = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, + Type = XMLType + }; + + public abstract string XMLType { get; } public bool SavedInDeclarationMode => true; @@ -152,41 +151,44 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation } } - public InterimStageBusVehicleViewModel_v2_8(string inputProviderType, IMultiStageViewModelFactory multiStageViewModelFactory) + protected InterimStageBusVehicleViewModel(IMultiStageViewModelFactory multiStageViewModelFactory, bool exempted = false) { - if (inputProviderType == VERSION_EXEMPTED) - { - _exemptedVehicle = true; + _exemptedVehicle = exempted; + _multiStageViewModelFactory = multiStageViewModelFactory; + InitEmpty(); + } + + protected InterimStageBusVehicleViewModel(IVehicleDeclarationInputData consolidatedVehicleData, IVehicleDeclarationInputData vehicleInput, IMultiStageViewModelFactory multistepViewModelFactory, bool exemptedVehicle = false) + { + _multiStageViewModelFactory = multistepViewModelFactory; + var vehicleData = consolidatedVehicleData ?? vehicleInput; + _exemptedVehicle = exemptedVehicle; + + if (consolidatedVehicleData != null && vehicleInput == null) { + InitConsolidated(consolidatedVehicleData); + + return; } - _multiStageViewModelFactory = multiStageViewModelFactory; + if (vehicleInput != null && consolidatedVehicleData == null) { + InitVehicleData(vehicleInput); - if (!_exemptedVehicle) - { - MultistageAirdragViewModel = _multiStageViewModelFactory.GetMultistageAirdragViewModel(); - MultistageAuxiliariesViewModel = _multiStageViewModelFactory.GetAuxiliariesViewModel(); + return; } - CreateParameterViewModels(); - ShowConsolidatedData = false; - } - public InterimStageBusVehicleViewModel_v2_8(IVehicleDeclarationInputData inputData, IMultiStageViewModelFactory multiStageViewModelFactory) : - this(inputData.GetType().ToString(), multiStageViewModelFactory) - { - SetVehicleInputData(inputData); + throw new ArgumentException($"Either {nameof(consolidatedVehicleData)} OR {vehicleInput} must be specified"); } - public InterimStageBusVehicleViewModel_v2_8(IVehicleDeclarationInputData consolidatedVehicleData, - IMultiStageViewModelFactory multistageViewModelFactory, bool exempted) + private void SetDataSource(IVehicleDeclarationInputData inputData) { - ConsolidatedVehicleData = consolidatedVehicleData; - _exemptedVehicle = exempted; - _multiStageViewModelFactory = multistageViewModelFactory; + } - if (!exempted) { - MultistageAirdragViewModel = _multiStageViewModelFactory.GetMultistageAirdragViewModel(consolidatedVehicleData?.Components?.AirdragInputData); - + private void InitEmpty() + { + if (!_exemptedVehicle) { + MultistageAirdragViewModel = _multiStageViewModelFactory.GetMultistageAirdragViewModel(); + MultistageAuxiliariesViewModel = _multiStageViewModelFactory.GetAuxiliariesViewModel(Architecture); MultistageAirdragViewModel.AirdragViewModelChanged += ((sender, args) => { if (sender is IMultistageAirdragViewModel vm) { @@ -199,31 +201,61 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation } } }); + } + + CreateParameterViewModels(); + ShowConsolidatedData = false; + } + + private void InitConsolidated(IVehicleDeclarationInputData consolidatedVehicleData) + { + ConsolidatedVehicleData = consolidatedVehicleData; + + if (!_exemptedVehicle) { + MultistageAirdragViewModel = _multiStageViewModelFactory.GetMultistageAirdragViewModel(consolidatedVehicleData?.Components?.AirdragInputData); + + MultistageAirdragViewModel.AirdragViewModelChanged += ((sender, args) => { + if (sender is IMultistageAirdragViewModel vm) { + if (AirdragModifiedMultistepMandatory) { + if (vm.AirDragViewModel != null) { + AirdragModifiedMultistep = true; + } + } + } + }); MultistageAuxiliariesViewModel = - _multiStageViewModelFactory.GetAuxiliariesViewModel(consolidatedVehicleData?.Components? + _multiStageViewModelFactory.GetAuxiliariesViewModel(Architecture, consolidatedVehicleData?.Components? .BusAuxiliaries); } - CreateParameterViewModels(); - - if (consolidatedVehicleData?.AirdragModifiedMultistep != null) - { + if (consolidatedVehicleData?.AirdragModifiedMultistep != null) { AirdragModifiedMultistepMandatory = true; AirdragModifiedMultistepEditingEnabled = true; } - if (consolidatedVehicleData?.Components?.AirdragInputData != null) - { + if (consolidatedVehicleData?.Components?.AirdragInputData != null) { AirdragModifiedMultistepMandatory = true; AirdragModifiedMultistepEditingEnabled = true; } - } + } - private void CreateParameterViewModels() + private void InitVehicleData(IVehicleDeclarationInputData vehicleInput) { + if (!_exemptedVehicle) + { + MultistageAirdragViewModel = _multiStageViewModelFactory.GetMultistageAirdragViewModel(); + MultistageAuxiliariesViewModel = _multiStageViewModelFactory.GetAuxiliariesViewModel(Architecture); + } + + CreateParameterViewModels(); + ShowConsolidatedData = false; + SetVehicleInputData(vehicleInput, checkExempted:true); + } + + private void CreateParameterViewModels() { _parameterViewModels = new Dictionary<string, MultistageParameterViewModel>(); var properties = this.GetType().GetProperties(); var backedUpParameters = new HashSet<string>() { @@ -381,11 +413,11 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation set { SetProperty(ref _consolidatedVehicleData, value); } } - public void SetVehicleInputData(IVehicleDeclarationInputData vehicleInputData) + public void SetVehicleInputData(IVehicleDeclarationInputData vehicleInputData, bool checkExempted) { - if (vehicleInputData.ExemptedVehicle != ExemptedVehicle) { - throw new VectoException(ExemptedVehicle ? "Only exempted stage inputs are allowed" : "Exempted Vehicle not allowed"); - } + //if (checkExempted && vehicleInputData.ExemptedVehicle != ExemptedVehicle) { + // throw new VectoException(ExemptedVehicle ? "Only exempted stage inputs are allowed" : "Exempted Vehicle not allowed"); + //} if (ExemptedVehicle) { SetExemptedVehicleInputData(vehicleInputData); @@ -439,7 +471,6 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation private void SetExemptedVehicleInputData(IVehicleDeclarationInputData vehicleInputData) { - Debug.Assert(vehicleInputData.ExemptedVehicle); Manufacturer = vehicleInputData.Manufacturer; Identifier = vehicleInputData.Identifier; ManufacturerAddress = vehicleInputData.ManufacturerAddress; @@ -1227,7 +1258,108 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation private bool _airdragModifiedMultistepMandatory; private int? _numberPassengersStandingLowerDeck; private int? _numberPassengersStandingUpperDeck; - private bool _exemptedVehicle; } + + + public class InterimStageConventionalBusVehicleViewModel : InterimStageBusVehicleViewModel + { + public InterimStageConventionalBusVehicleViewModel(IVehicleDeclarationInputData consolidatedVehicleData, + IVehicleDeclarationInputData vehicleInput, IMultiStageViewModelFactory multistepViewModelFactory) + : base(consolidatedVehicleData, vehicleInput, multistepViewModelFactory) + { + + } + public InterimStageConventionalBusVehicleViewModel(IMultiStageViewModelFactory multiStageViewModelFactory) : base(multiStageViewModelFactory) { } + + #region Overrides of InterimStageBusVehicleViewModel + + public override CompletedBusArchitecture Architecture => + CompletedBusArchitecture.Conventional; + + public override string XMLType => XMLTypes.Vehicle_Conventional_CompletedBusDeclarationType; + + #endregion + } + + + public class InterimStageExemptedBusVehicleViewModel : InterimStageBusVehicleViewModel + { + public InterimStageExemptedBusVehicleViewModel(IVehicleDeclarationInputData consolidatedVehicleData, + IVehicleDeclarationInputData vehicleInput, IMultiStageViewModelFactory multistepViewModelFactory) : base( + consolidatedVehicleData, vehicleInput, multistepViewModelFactory,exemptedVehicle:true) + { + } + + public InterimStageExemptedBusVehicleViewModel(IMultiStageViewModelFactory multistepViewModelFactory) : base(multistepViewModelFactory, exempted:true) + { + + } + public override string XMLType => XMLTypes.Vehicle_Exempted_CompletedBusDeclarationType; + + #region Overrides of InterimStageBusVehicleViewModel + + public override CompletedBusArchitecture Architecture => + CompletedBusArchitecture.Exempted; + + #endregion + } + + public class InterimStageHevBusVehicleViewModel : InterimStageBusVehicleViewModel + { + public InterimStageHevBusVehicleViewModel(IVehicleDeclarationInputData consolidatedVehicleData, + IVehicleDeclarationInputData vehicleInput, IMultiStageViewModelFactory multistepViewModelFactory) : base( + consolidatedVehicleData, vehicleInput, multistepViewModelFactory) + { + + } + + public InterimStageHevBusVehicleViewModel(IMultiStageViewModelFactory multiStageViewModelFactory) : base(multiStageViewModelFactory) { } + + public override CompletedBusArchitecture Architecture + { + get => CompletedBusArchitecture.HEV; + } + + public override string XMLType => XMLTypes.Vehicle_Hev_CompletedBusDeclarationType; + } + + public class InterimStagePevBusVehicleViewModel : InterimStageBusVehicleViewModel + { + public InterimStagePevBusVehicleViewModel(IVehicleDeclarationInputData consolidatedVehicleData, + IVehicleDeclarationInputData vehicleInput, IMultiStageViewModelFactory multistepViewModelFactory) : base( + consolidatedVehicleData, vehicleInput, multistepViewModelFactory) + { + + } + public InterimStagePevBusVehicleViewModel(IMultiStageViewModelFactory multiStageViewModelFactory) : base(multiStageViewModelFactory) { } + + #region Overrides of InterimStageBusVehicleViewModel + + public override CompletedBusArchitecture Architecture + { + get { return CompletedBusArchitecture.PEV; } + } + public override string XMLType => XMLTypes.Vehicle_Pev_CompletedBusDeclarationType; + #endregion + } + + public class InterimStageIEPCBusVehicleViewModel : InterimStageBusVehicleViewModel + { + public InterimStageIEPCBusVehicleViewModel(IVehicleDeclarationInputData consolidatedVehicleData, + IVehicleDeclarationInputData vehicleInput, IMultiStageViewModelFactory multistepViewModelFactory) : base( + consolidatedVehicleData, vehicleInput, multistepViewModelFactory) + { + + } + public InterimStageIEPCBusVehicleViewModel(IMultiStageViewModelFactory multiStageViewModelFactory) : base(multiStageViewModelFactory) { } + + #region Overrides of InterimStageBusVehicleViewModel + + public override CompletedBusArchitecture Architecture => + CompletedBusArchitecture.IEPC; + public override string XMLType => XMLTypes.Vehicle_Iepc_CompletedBusDeclarationType; + #endregion + } + } \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/ManufacturingStageViewModel_v0_1.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/ManufacturingStageViewModel_v0_1.cs index 629a89884c5ac71f6cf8e0b85877504f5eda9ee7..41da9c0701b14b5550aed1eb08f15ebcfbfb7b1b 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/ManufacturingStageViewModel_v0_1.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/ManufacturingStageViewModel_v0_1.cs @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.ObjectModel; using System.Linq; using System.Net.Mime; using System.Security.RightsManagement; @@ -47,18 +48,38 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation public DigestData Signature => throw new NotImplementedException(); public void SetInputData(IVehicleDeclarationInputData vehicleInputData) { - VehicleViewModel.SetVehicleInputData(vehicleInputData); + VehicleViewModel.SetVehicleInputData(vehicleInputData, true); OnPropertyChanged(nameof(CurrentView)); } + private ObservableCollection<CompletedBusArchitecture> _architectureItems = + new ObservableCollection<CompletedBusArchitecture>(Enum.GetValues(typeof(CompletedBusArchitecture)).Cast<CompletedBusArchitecture>()); + + public ObservableCollection<CompletedBusArchitecture> ArchitectureItems + { + get => _architectureItems; + set => SetProperty(ref _architectureItems, value); + } + + public CompletedBusArchitecture Architecture + { + get => _architecture; + set + { + SetProperty(ref _architecture, value); + _architectureItems = new ObservableCollection<CompletedBusArchitecture>() { Architecture }; + } + } public ManufacturingStageViewModel_v0_1(IManufacturingStageInputData consolidatedManufacturingStageInputData, bool exempted, IMultiStageViewModelFactory viewModelFactory) : base(viewModelFactory) { Title = "Edit Manufacturing Stage"; - + Architecture = + consolidatedManufacturingStageInputData.Vehicle.VehicleType.GetCompletedBusArchitecture( + consolidatedManufacturingStageInputData.Vehicle.ExemptedVehicle); _stepCount = consolidatedManufacturingStageInputData?.StepCount + 1 ?? 2; @@ -79,6 +100,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation private int _stepCount; private DigestData _hashPreviousStep; private IManufacturingStageInputData _consolidatedManufacturingStageInputData; + private CompletedBusArchitecture _architecture; private class ApplicationInformationMultistage : IApplicationInformation diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAirdragViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAirdragViewModel.cs index 2f35a076f48168456ecb17a21432480b103abc58..109122ff5cfca34519aa0d988d104a4b19508706 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAirdragViewModel.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAirdragViewModel.cs @@ -9,6 +9,7 @@ using System.Windows.Input; using System.Xml; using System.Xml.Linq; using System.Xml.Schema; +using CommunityToolkit.Mvvm.Input; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; @@ -22,7 +23,6 @@ using TUGraz.VectoCore.Utils; using VECTO3GUI2020.Helper; using VECTO3GUI2020.Ninject; using VECTO3GUI2020.Properties; -using VECTO3GUI2020.Util; using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; @@ -150,38 +150,47 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation var success = true; var errorStringBuilder = new StringBuilder(); try { - var xDoc = XDocument.Load(fileName); - var doc = new XmlDocument(); - doc.Load(fileName); - - var airdragElements = xDoc.Descendants().Where(e => e.Name.LocalName == XMLNames.Component_AirDrag); - if (airdragElements.Count() == 1) { - //GET FROM FILE - var dataProviderVersion = XMLDeclarationAirdragDataProviderV20.QUALIFIED_XSD_TYPE; - - - var validator = new XMLValidator(doc); - var valid = validator.ValidateXML(TUGraz.VectoCore.Utils.XmlDocumentType - .DeclarationComponentData); - if (!valid) { - throw new VectoException("Invalid input file"); - } - - //dataProviderVersion = XMLHelper.GetVersion(doc.Node); - - XElement airdragElement = airdragElements.First(); - XmlNode airdragNode = airdragElement.ToXmlNode(); - - var airDragInputData = - _dependencies.InjectFactory.CreateAirdragData(dataProviderVersion, null, airdragNode, fileName); - AirDragViewModel = - _dependencies.ComponentViewModelFactory.CreateComponentViewModel(airDragInputData) as IAirDragViewModel; - AirDragViewModel.IsReadOnly = true; - AirDragViewModel.LabelVisible = false; - success = true; - } else { - success = false; - } + var airDragInputData = _dependencies.ComponentInputReader.CreateAirdrag(fileName); + AirDragViewModel = + _dependencies.ComponentViewModelFactory.CreateComponentViewModel(airDragInputData) as IAirDragViewModel; + AirDragViewModel.IsReadOnly = true; + AirDragViewModel.LabelVisible = false; + success = true; + + + // // ---- old implementation + // var xDoc = XDocument.Load(fileName); + //var doc = new XmlDocument(); + //doc.Load(fileName); + + //var airdragElements = xDoc.Descendants().Where(e => e.Name.LocalName == XMLNames.Component_AirDrag); + //if (airdragElements.Count() == 1) { + // //GET FROM FILE + // var dataProviderVersion = XMLDeclarationAirdragDataProviderV20.QUALIFIED_XSD_TYPE; + + + // var validator = new XMLValidator(doc); + // var valid = validator.ValidateXML(TUGraz.VectoCore.Utils.XmlDocumentType + // .DeclarationComponentData); + // if (!valid) { + // throw new VectoException("Invalid input file"); + // } + + // //dataProviderVersion = XMLHelper.GetVersion(doc.Node); + + // XElement airdragElement = airdragElements.First(); + // XmlNode airdragNode = airdragElement.ToXmlNode(); + + // var airDragInputData = + // _dependencies.InjectFactory.CreateAirdragData(dataProviderVersion, null, airdragNode, fileName); + // AirDragViewModel = + // _dependencies.ComponentViewModelFactory.CreateComponentViewModel(airDragInputData) as IAirDragViewModel; + // AirDragViewModel.IsReadOnly = true; + // AirDragViewModel.LabelVisible = false; + // success = true; + //} else { + // success = false; + //} } catch (Exception e) { _dependencies.DialogHelper.ShowMessageBox(e.Message, "Invalid File", diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs index 4093dcb66c7d84beea74d21f38cd0d0577598762..806e9f63f5b84c4579884fdcc7f25be2e4a02188 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs @@ -6,12 +6,16 @@ using System.Diagnostics; using System.Resources; using System.Runtime.CompilerServices; using System.Xml; +using System.Xml.Linq; using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.Utils; using VECTO3GUI2020.Helper; using VECTO3GUI2020.Properties; +using VECTO3GUI2020.Resources.XML; +using VECTO3GUI2020.Util.XML; using VECTO3GUI2020.ViewModel.Implementation.Common; using EnumHelper = VECTO3GUI2020.Helper.EnumHelper; @@ -34,15 +38,16 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation } - public class MultistageAuxiliariesViewModel : ViewModelBase, IMultistageAuxiliariesViewModel, IDataErrorInfo + public abstract class MultistageAuxiliariesViewModel : ViewModelBase, IMultistageAuxiliariesViewModel, IDataErrorInfo { - - public MultistageAuxiliariesViewModel() + protected XNamespace Version => XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24; + protected abstract string XSDType { get; } + protected MultistageAuxiliariesViewModel() { CreateParameterViewModels(); } - public MultistageAuxiliariesViewModel(IBusAuxiliariesDeclarationData consolidatedAuxiliariesInputData) + protected MultistageAuxiliariesViewModel(IBusAuxiliariesDeclarationData consolidatedAuxiliariesInputData) { ConsolidatedInputData = consolidatedAuxiliariesInputData; @@ -68,10 +73,13 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation nameof(AuxHeaterPower), nameof(DoubleGlazing), - nameof(AirElectricHeater), + nameof(AdjustableAuxiliaryHeater), nameof(SeparateAirDistributionDucts), - nameof(OtherHeatingTechnology), + + //xEV + nameof(AirElectricHeater), + nameof(OtherHeatingTechnology), nameof(WaterElectricHeater) }; @@ -317,6 +325,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation set => SetProperty(ref _separateAirDistributionDucts, value); } + public abstract bool ShowxEVProperties { get; } + public bool? WaterElectricHeater { get => _waterElectricHeater; @@ -536,6 +546,13 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation #region Implementation of interfaces (unused Properties); + public DataSource DataSource + { + get => new DataSource () { + Type = XSDType, + TypeVersion = Version.ToString(), + }; + } public XmlNode XMLSource => throw new NotImplementedException(); public string FanTechnology => throw new NotImplementedException(); @@ -681,4 +698,44 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation #endregion } + + + public class MultistageAuxiliariesViewModel_Conventional : MultistageAuxiliariesViewModel + { + + public MultistageAuxiliariesViewModel_Conventional() : base() + { + + } + + protected MultistageAuxiliariesViewModel_Conventional(IBusAuxiliariesDeclarationData consolidatedAuxiliariesInputData) : base(consolidatedAuxiliariesInputData) + { + + } + + #region Overrides of MultistageAuxiliariesViewModel + + protected override string XSDType => XMLTypes.AUX_Conventional_CompletedBusType; + public override bool ShowxEVProperties => false; + + #endregion + } + + public class MultistageAuxiliariesViewModel_xEV : MultistageAuxiliariesViewModel + { + public MultistageAuxiliariesViewModel_xEV() : base() + { + + } + + protected MultistageAuxiliariesViewModel_xEV(IBusAuxiliariesDeclarationData consolidatedAuxiliariesInputData) : base(consolidatedAuxiliariesInputData) + { } + + #region Overrides of MultistageAuxiliariesViewModel + + protected override string XSDType => XMLTypes.AUX_xEV_CompletedBusType; + public override bool ShowxEVProperties => true; + + #endregion + } } \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs index 53fedcf0d45b7f9af4a1a5226ab6d9c32419d6f2..ce98accab265007305d171bca2ac325543c64acb 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Windows; using System.Windows.Input; using System.Xml.Linq; +using CommunityToolkit.Mvvm.Input; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCore.InputData.FileIO.XML; @@ -20,7 +21,6 @@ using TUGraz.VectoCore.Utils; using VECTO3GUI2020.Helper; using VECTO3GUI2020.Ninject; using VECTO3GUI2020.Properties; -using VECTO3GUI2020.Util; using VECTO3GUI2020.ViewModel.Implementation.Common; using VECTO3GUI2020.ViewModel.Interfaces; using VECTO3GUI2020.ViewModel.Interfaces.Document; diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/NewMultiStageJobViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/NewMultiStageJobViewModel.cs index 6f7ae23bba1e830f892026f95f273a9a4117621c..a608ee91d5b3a560de94bf5cb1876dd7abb9b5ec 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/NewMultiStageJobViewModel.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/NewMultiStageJobViewModel.cs @@ -6,13 +6,13 @@ using System.Linq.Expressions; using System.Threading; using System.Windows; using System.Windows.Input; +using CommunityToolkit.Mvvm.Input; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCore.InputData.FileIO.XML; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader; using VECTO3GUI2020.Helper; using VECTO3GUI2020.Properties; -using VECTO3GUI2020.Util; using VECTO3GUI2020.ViewModel.Implementation.Common; using VECTO3GUI2020.ViewModel.Interfaces; using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageInputViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageInputViewModel.cs index a4fe9e81ca41f8ef6984a00982e9cd3a129527f5..566394a7d2d17f00f16647ae33109cba6b744164 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageInputViewModel.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageInputViewModel.cs @@ -1,4 +1,8 @@ -using System.IO; +using System; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCore.Utils; using VECTO3GUI2020.Properties; @@ -11,132 +15,229 @@ using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation { - public class StageInputViewModel : StageViewModelBase, IDocumentViewModel, IJobEditViewModel - { + public class StageInputViewModel : StageViewModelBase, IDocumentViewModel, IJobEditViewModel + { private bool _canBeEdited; - private DataSource _dataSource; - private readonly XmlDocumentType _documentType; - private string _documentName; - private bool _selected; - private static uint _newDocumentCounter = 0; - - private StageInputViewModel(IMultiStageViewModelFactory multistageViewModelFactory, - IAdditionalJobInfoViewModel additionalJobInfoViewModel) : base(multistageViewModelFactory) - { - _documentType = XmlDocumentType.DeclarationJobData; - _additionalJobInfoViewModel = additionalJobInfoViewModel; - _additionalJobInfoViewModel.SetParent(this); + private DataSource _dataSource; + private readonly XmlDocumentType _documentType; + private string _documentName; + private bool _selected; + private static uint _newDocumentCounter = 0; + + + private CompletedBusArchitecture _architecture; + private ObservableCollection<CompletedBusArchitecture> _architectureItems = + new ObservableCollection<CompletedBusArchitecture>(Enum.GetValues(typeof(CompletedBusArchitecture)).Cast<CompletedBusArchitecture>()); + + public ObservableCollection<CompletedBusArchitecture> ArchitectureItems + { + get => _architectureItems; + set => SetProperty(ref _architectureItems, value); + } + + public CompletedBusArchitecture Architecture + { + get => _architecture; + set + { + if (SetProperty(ref _architecture, value)) + { + UpdateVehicleViewModel(); + OnPropertyChanged(nameof(SwitchComponentViewCommand)); + } + } + } + + private void UpdateVehicleViewModel() + { + if (VehicleViewModel == null) { + return; + } + if (VehicleViewModel.ShowConsolidatedData) + { + throw new VectoException("This is only intended on \"standalone\" step inputs"); + } + var oldVm = _vehicleViewModel; + var newVm = _viewModelFactory.GetInterimStageVehicleViewModel(Architecture); + newVm.SetVehicleInputData(oldVm,false); + VehicleViewModel = newVm; + UpdateViewModelsAndTitle(); } - public StageInputViewModel(bool exemptedVehicle, IMultiStageViewModelFactory multiStageViewModelFactory, IAdditionalJobInfoViewModel additionalJobInfoViewModel) : this(multiStageViewModelFactory, additionalJobInfoViewModel) - { - _vehicleViewModel = _viewModelFactory.CreateStageInputVehicleViewModel( - exemptedVehicle - ? InterimStageBusVehicleViewModel_v2_8.VERSION_EXEMPTED - : InterimStageBusVehicleViewModel_v2_8.VERSION) as IMultistageVehicleViewModel; + private StageInputViewModel(IMultiStageViewModelFactory multistageViewModelFactory, + IAdditionalJobInfoViewModel additionalJobInfoViewModel) : base(multistageViewModelFactory) + { + _documentType = XmlDocumentType.DeclarationJobData; + _additionalJobInfoViewModel = additionalJobInfoViewModel; + _additionalJobInfoViewModel.SetParent(this); + } + + + public StageInputViewModel(bool exemptedVehicle, IMultiStageViewModelFactory multiStageViewModelFactory, IAdditionalJobInfoViewModel additionalJobInfoViewModel) : this(multiStageViewModelFactory, additionalJobInfoViewModel) + { + Architecture = exemptedVehicle + ? CompletedBusArchitecture.Exempted + : CompletedBusArchitecture.Conventional; + + + _vehicleViewModel = multiStageViewModelFactory.GetInterimStageVehicleViewModel(Architecture); + + + + Title = $"{GUILabels.Edit_step_input} - New file"; + + _documentName = $"New {(exemptedVehicle ? "exempted " : "")}step input {++_newDocumentCounter}"; + + UpdateViewModelsAndTitle(); + return; + } + + public StageInputViewModel(IDeclarationInputDataProvider inputData, IMultiStageViewModelFactory multiStageViewModelFactory, IAdditionalJobInfoViewModel additionalJobInfoViewModel) : this(multiStageViewModelFactory, additionalJobInfoViewModel) + { + _documentName = inputData.JobInputData.JobName; + + _vehicleViewModel = _viewModelFactory.GetInterimStageVehicleViewModel(inputData.JobInputData.Vehicle); + //_vehicleViewModel = + // _viewModelFactory.CreateStageInputVehicleViewModel(inputData.JobInputData.Vehicle) as IMultistageVehicleViewModel; + // (_vehicleViewModel as InterimStageBusVehicleViewModel).ShowConsolidatedData = false; + _architecture = _vehicleViewModel.Architecture; + _dataSource = inputData.DataSource; + VehicleInputDataFilePath = _dataSource.SourceFile; + + Title = $"{GUILabels.Edit_step_input} - {Path.GetFileName(_dataSource.SourceFile)}"; + UpdateViewModelsAndTitle(); + return; + } + + #region Overrides of StageViewModelBase + /// <summary> + /// Called in base class after input data is loaded. + /// </summary> + /// <param name="loadedInputData"></param> + protected override void LoadStageInputDataFollowUp(IDeclarationInputDataProvider loadedInputData) + { + DataSource = loadedInputData.DataSource; + VehicleInputDataFilePath = DataSource.SourceFile; + UpdateTitle(); + DocumentName = loadedInputData.JobInputData.JobName; + } + + #endregion + + private void UpdateTitle() + { + Title = GUILabels.Edit_step_input + $" - {Architecture} - " + ((_dataSource?.SourceFile != null) + ? Path.GetFileName(_dataSource.SourceFile) + : $"New file"); + } + + private void UpdateViewModelsAndTitle() + { + UpdateTitle(); + var prevKey = Components.FirstOrDefault(kv => kv.Value == CurrentView).Key; + Components["vehicle"] = VehicleViewModel as IViewModelBase; + Components["auxiliaries"] = VehicleViewModel.MultistageAuxiliariesViewModel as IViewModelBase; + Components["airdrag"] = VehicleViewModel.MultistageAirdragViewModel as IViewModelBase; + + + CurrentView = null; + if (prevKey != null) { + CurrentView = Components[prevKey]; + } + CurrentView = CurrentView ?? VehicleViewModel as IViewModelBase; + + - Title = $"{GUILabels.Edit_step_input} - New file"; - _documentName = $"New {(exemptedVehicle ? "exempted " : "")}step input {++_newDocumentCounter}"; - Init(); - } + ShowSaveAndCloseButtons = true; + } - public StageInputViewModel(IDeclarationInputDataProvider inputData, IMultiStageViewModelFactory multiStageViewModelFactory, IAdditionalJobInfoViewModel additionalJobInfoViewModel) : this(multiStageViewModelFactory,additionalJobInfoViewModel) - { - _documentName = inputData.JobInputData.JobName; - _vehicleViewModel = - _viewModelFactory.CreateStageInputVehicleViewModel(inputData.JobInputData.Vehicle) as IMultistageVehicleViewModel; - (_vehicleViewModel as InterimStageBusVehicleViewModel_v2_8).ShowConsolidatedData = false; + #region Implementation of IDocumentViewModel - _dataSource = inputData.DataSource; - VehicleInputDataFilePath = _dataSource.SourceFile; + public string DocumentName + { + get => _documentName; + set => SetProperty(ref _documentName, value); + } - Title = $"{GUILabels.Edit_step_input} - {Path.GetFileName(_dataSource.SourceFile)}"; - Init(); - } + public XmlDocumentType? DocumentType => _documentType; - #region Overrides of StageViewModelBase - /// <summary> - /// Called in base class after input data is loaded. - /// </summary> - /// <param name="loadedInputData"></param> - protected override void LoadStageInputDataFollowUp(IDeclarationInputDataProvider loadedInputData) - { - DataSource = loadedInputData.DataSource; - VehicleInputDataFilePath = DataSource.SourceFile; - UpdateTitle(); - DocumentName = loadedInputData.JobInputData.JobName; - } + public string DocumentTypeName => "Step input"; - #endregion + public DataSource DataSource + { + get => _dataSource; + set + { + SetProperty(ref _dataSource, value); + UpdateTitle(); + } + } - private void UpdateTitle() - { - Title = GUILabels.Edit_step_input + " - " + ((_dataSource?.SourceFile != null) - ? Path.GetFileName(_dataSource.SourceFile) - : "New file"); - } + public IEditViewModel EditViewModel => this; - private void Init() - { - UpdateTitle(); - Components.Add("vehicle", VehicleViewModel as IViewModelBase); - Components.Add("auxiliaries", VehicleViewModel.MultistageAuxiliariesViewModel as IViewModelBase); - Components.Add("airdrag", VehicleViewModel.MultistageAirdragViewModel as IViewModelBase); - CurrentView = VehicleViewModel as IViewModelBase; + public bool Selected + { + get => _selected && CanBeSimulated; + set => SetProperty(ref _selected, value); + } - ShowSaveAndCloseButtons = true; - } + public bool CanBeSimulated + { + get => false; + set => throw new System.NotImplementedException(); + } + private IAdditionalJobInfoViewModel _additionalJobInfoViewModel; + public IAdditionalJobInfoViewModel AdditionalJobInfoVm + { + get => _additionalJobInfoViewModel; + set => SetProperty(ref _additionalJobInfoViewModel, value); + } - #region Implementation of IDocumentViewModel + #endregion - public string DocumentName - { - get => _documentName; - set => SetProperty(ref _documentName, value); - } + #region Implementation of IEditViewModel - public XmlDocumentType? DocumentType => _documentType; + public string Name => "Edit Stage Input"; - public string DocumentTypeName => "Step input"; + #endregion + } + + public enum CompletedBusArchitecture + { + Conventional, + HEV, + PEV, + IEPC, + Exempted + } - public DataSource DataSource + public static class CompleteBusArchitectureHelper + { + public static CompletedBusArchitecture GetCompletedBusArchitecture(this VectoSimulationJobType jobType, + bool exempted = false) { - get => _dataSource; - set + if (exempted) { - SetProperty(ref _dataSource, value); - UpdateTitle(); + return CompletedBusArchitecture.Exempted; } - } - - public IEditViewModel EditViewModel => this; - - public bool Selected - { - get => _selected && CanBeSimulated; - set => SetProperty(ref _selected, value); - } - - public bool CanBeSimulated - { - get => false; - set => throw new System.NotImplementedException(); - } - private IAdditionalJobInfoViewModel _additionalJobInfoViewModel; - public IAdditionalJobInfoViewModel AdditionalJobInfoVm - { - get => _additionalJobInfoViewModel; - set => SetProperty(ref _additionalJobInfoViewModel, value); - } - - #endregion - - #region Implementation of IEditViewModel - - public string Name => "Edit Stage Input"; - - #endregion + switch (jobType) + { + case VectoSimulationJobType.ConventionalVehicle: + return CompletedBusArchitecture.Conventional; + case VectoSimulationJobType.ParallelHybridVehicle: + case VectoSimulationJobType.SerialHybridVehicle: + case VectoSimulationJobType.IHPC: + return CompletedBusArchitecture.HEV; + case VectoSimulationJobType.BatteryElectricVehicle: + return CompletedBusArchitecture.PEV; + case VectoSimulationJobType.IEPC_E: + case VectoSimulationJobType.IEPC_S: + return CompletedBusArchitecture.IEPC; + default: + throw new ArgumentOutOfRangeException(nameof(jobType), jobType, null); + } + } } } \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageViewModelBase.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageViewModelBase.cs index 413202bc4a513a04e0faa81ec9a1b6db71d781ec..c515e3b7c4ace1fb0565ec13846c5d4dec97fbee 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageViewModelBase.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/StageViewModelBase.cs @@ -19,7 +19,6 @@ using VECTO3GUI2020.Util.XML; using VECTO3GUI2020.ViewModel.Implementation.Common; using VECTO3GUI2020.ViewModel.Interfaces.Common; using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; -using RelayCommand = VECTO3GUI2020.Util.RelayCommand; namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation { @@ -92,7 +91,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation get { return _switchComponentViewCommand ?? - new Util.RelayCommand<string>(SwitchViewExecute, (string s) => SwitchViewCanExecute(s)); + new RelayCommand<string>(SwitchViewExecute, (string s) => SwitchViewCanExecute(s)); } } @@ -107,7 +106,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation private bool SwitchViewCanExecute(string viewToShow) { - return Components[viewToShow] != null; + var found = Components.TryGetValue(viewToShow, out var vm); + return found && vm != null; } private IRelayCommand _saveInputDataCommand; @@ -117,7 +117,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation public IRelayCommand SaveInputDataCommand => _saveInputDataCommand ?? - new CommunityToolkit.Mvvm.Input.RelayCommand(() => { SaveInputDataExecute(filename: _vehicleInputDataFilePath); }, + new RelayCommand(() => { SaveInputDataExecute(filename: _vehicleInputDataFilePath); }, () => _vehicleInputDataFilePath != null); public ICommand SaveInputDataAsCommand => @@ -230,7 +230,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation { var inputData = (IDeclarationInputDataProvider)_inputDataReader.Create(fileName); var vehicleInputData = inputData.JobInputData.Vehicle; - VehicleViewModel.SetVehicleInputData(vehicleInputData); + VehicleViewModel.SetVehicleInputData(vehicleInputData, true); VehicleInputDataFilePath = inputData.DataSource.SourceFile; LoadStageInputDataFollowUp(inputData); diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultiStageViewModelFactory.cs b/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultiStageViewModelFactory.cs index cc48e57667c98b9967de9e5c78e3e4843781fc5b..f3a34b60782b0189317de43cc2b6cfd2fdc890d7 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultiStageViewModelFactory.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultiStageViewModelFactory.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.Ninject.Factories; using VECTO3GUI2020.ViewModel.Implementation; using VECTO3GUI2020.ViewModel.Interfaces.Common; using VECTO3GUI2020.ViewModel.Interfaces.Document; @@ -16,36 +17,28 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Interfaces { public interface IMultiStageViewModelFactory : - IMultiStageViewModelFactoryDefaultInstanceProvider, - IMultiStageViewModelFactoryTypeAsNameInstanceProvider, - IMultistageViewModelFactoryFirstParameterAsNameInstanceProvider - { - + IMultiStageViewModelFactoryDefaultInstanceProvider, IDocumentViewModelFactory, +IMultistageViewModelFactoryFirstParameterAsNameInstanceProvider + { + //IVehicleViewModel GetInterimStageVehicleViewModel(StageInputViewModel.CompletedBusArchitecture arch); + IMultistageVehicleViewModel GetInterimStageVehicleViewModel(CompletedBusArchitecture arch); + IMultistageVehicleViewModel GetInterimStageVehicleViewModel(IVehicleDeclarationInputData inputData); } - public interface IMultiStageViewModelFactoryTypeAsNameInstanceProvider - { - IDocumentViewModel CreateDocumentViewModel(IDeclarationInputDataProvider inputData); - IDocumentViewModel CreateDocumentViewModel(IInputDataProvider inputData); - IVehicleViewModel CreateStageInputVehicleViewModel(IVehicleDeclarationInputData inputData); - } public interface IMultistageViewModelFactoryFirstParameterAsNameInstanceProvider { IVehicleViewModel CreateStageInputVehicleViewModel(string inputProviderType); } - - public interface IMultiStageViewModelFactoryDefaultInstanceProvider { - IDocumentViewModel GetStageInputViewModel(bool exemptedVehicle); IViewModelBase GetNewMultistageJobViewModel(); IMultiStageJobViewModel GetMultiStageJobViewModel(IMultistepBusInputDataProvider inputData); - IVehicleViewModel GetInterimStageVehicleViewModel(); + //IVehicleViewModel GetInterimStageVehicleViewModel(); IVehicleViewModel GetInterimStageVehicleViewModel(IVehicleDeclarationInputData consolidatedVehicleData, bool exempted); @@ -55,23 +48,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Interfaces IMultistageAirdragViewModel GetMultistageAirdragViewModel( IAirdragDeclarationInputData consolidatedAirdragInputData); - IMultistageAuxiliariesViewModel GetAuxiliariesViewModel(); - IMultistageAuxiliariesViewModel GetAuxiliariesViewModel( + IMultistageAuxiliariesViewModel GetAuxiliariesViewModel(CompletedBusArchitecture arch); + IMultistageAuxiliariesViewModel GetAuxiliariesViewModel(CompletedBusArchitecture arch, IBusAuxiliariesDeclarationData consolidatedAuxiliariesInputData); - - ICreateVifViewModel GetCreateNewVifViewModel(bool completed); - ICreateVifViewModel GetCreateNewVifViewModel(); - - //IViewModelBase CreateNewMultiStageJobViewModel(); - - //IMultiStageJobViewModel CreateMultiStageJobViewModel(string inputProviderType, IMultistageBusInputDataProvider inputData); - - //IVehicleViewModel CreateInterimStageVehicleViewModel(string inputProviderType); - - //IVehicleViewModel CreateInterimStageVehicleViewModel(string inputProviderType, IVehicleDeclarationInputData prevStageInputData); - - //IManufacturingStageViewModel CreateManufacturingStageViewModel(string inputProviderType, IManufacturingStageInputData consolidatedManufacturingStageInputData); - - //IMultistageAirdragViewModel CreateMultistageAirdragViewModel(); } } diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultistageVehicleViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultistageVehicleViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..c342ed941f09b19971222f1c1a29896b8e14983a --- /dev/null +++ b/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultistageVehicleViewModel.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; +using System.ComponentModel; +using TUGraz.VectoCommon.InputData; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; + +namespace VECTO3GUI2020.ViewModel.MultiStage.Interfaces +{ + public interface IMultistageVehicleViewModel : IVehicleViewModel, INotifyPropertyChanged + { + bool HasErrors { get; } + Dictionary<string, string> Errors { get; } + IMultistageAirdragViewModel MultistageAirdragViewModel { get; set; } + IMultistageAuxiliariesViewModel MultistageAuxiliariesViewModel { get; set; } + bool PrimaryVehicleHybridElectric { get; set; } + bool ShowConsolidatedData { get; set; } + CompletedBusArchitecture Architecture { get; } + void SetVehicleInputData(IVehicleDeclarationInputData vehicleInputData, bool checkExempted); + } +} + diff --git a/VECTO3GUI2020/Views/JoblistView.xaml b/VECTO3GUI2020/Views/JoblistView.xaml index 00b9cb5b6b8bc4b03ce0b526c722bd25e64abf49..ea04ec5a5397e31ddcc7be3dd2ade6a55c360298 100644 --- a/VECTO3GUI2020/Views/JoblistView.xaml +++ b/VECTO3GUI2020/Views/JoblistView.xaml @@ -14,7 +14,7 @@ d:DesignHeight="450" d:DesignWidth="1000"> - <Grid> + <Grid d:Background="Pink"> <Grid.RowDefinitions> <RowDefinition Height="2*"/> <RowDefinition Height="5"/> @@ -110,16 +110,53 @@ </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> - <DataGridTextColumn IsReadOnly="True" Header="Name" Binding="{Binding DocumentName}"></DataGridTextColumn> - <DataGridTextColumn IsReadOnly ="True" Header="Type" Binding="{Binding DocumentTypeName}"></DataGridTextColumn> - <DataGridTextColumn IsReadOnly ="True" Header="File" Binding="{Binding DataSource.SourceFile}"></DataGridTextColumn> + <DataGridTemplateColumn Header="Name" Width="0.5*"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock Margin="2 2 2 2" Text="{Binding DocumentName}" TextAlignment="Left" VerticalAlignment="Center"> + <TextBlock.ToolTip> + <Binding Path="DocumentName"></Binding> + </TextBlock.ToolTip> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + + <!--<DataGridTextColumn IsReadOnly="True" Header="Name" Binding="{Binding DocumentName}" Width="*"> + <DataGridTextColumn.CellStyle> + <Style TargetType="DataGridCell"> + <Setter Property="ToolTip" Value="{Binding DocumentName}" /> + <Setter Property="VerticalContentAlignment" Value="Center" /> + </Style> + </DataGridTextColumn.CellStyle> + </DataGridTextColumn>--> + <DataGridTextColumn IsReadOnly ="True" Header="Type" Binding="{Binding DocumentTypeName}" Width="0.1*" MinWidth="150"></DataGridTextColumn> + <!--<DataGridTextColumn IsReadOnly ="True" Header="File" Binding="{Binding DataSource.SourceFile}" Width="*"> + <DataGridTextColumn.CellStyle> + <Style TargetType="DataGridCell"> + <Setter Property="ToolTip" Value="{Binding DataSource.SourceFile}" /> + <Setter Property="VerticalContentAlignment" Value="Center" /> + </Style> + </DataGridTextColumn.CellStyle> + </DataGridTextColumn>--> + <DataGridTemplateColumn Header="File" Width="*"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock Margin="2 2 2 2" Text="{Binding DataSource.SourceFile}" TextAlignment="Left" VerticalAlignment="Center"> + <TextBlock.ToolTip> + <Binding Path="DataSource.SourceFile"></Binding> + </TextBlock.ToolTip> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> </DataGrid.Columns> <DataGrid.InputBindings> <MouseBinding - MouseAction="LeftDoubleClick" - Command="{Binding EditDocument}" - CommandParameter="{Binding ElementName=JobDataGrid, Path=SelectedItem}"></MouseBinding> + MouseAction="LeftDoubleClick" + Command="{Binding EditDocument}" + CommandParameter="{Binding ElementName=JobDataGrid, Path=SelectedItem}"></MouseBinding> </DataGrid.InputBindings> </DataGrid> <!--<Label x:Name="label" Content="Loading . . ." Visibility="{Binding IsLoading, Converter={StaticResource BooleanToVisibilityConverter}}"/>--> diff --git a/VECTO3GUI2020/Views/Multistage/AirDragView_v2_8.xaml b/VECTO3GUI2020/Views/Multistage/AirDragView_v2_8.xaml index dc1c6a3026177c1b707ed6affe196bc6bd95cfe7..84a28c341a9d1a442a163aa00828b87c16df87d8 100644 --- a/VECTO3GUI2020/Views/Multistage/AirDragView_v2_8.xaml +++ b/VECTO3GUI2020/Views/Multistage/AirDragView_v2_8.xaml @@ -24,12 +24,6 @@ <customControls:LabledTextBoxMultistage Content="{Binding AirDragArea}" ReadOnly="{Binding IsReadOnly}"/> - <customControls:LabledTextBoxMultistage - Content="{Binding AirDragArea_0}" - ReadOnly="{Binding IsReadOnly}"/> - <customControls:LabledTextBoxMultistage - Content="{Binding TransferredAirDragArea}" - ReadOnly="{Binding IsReadOnly}"/> </StackPanel> </Grid> </UserControl> diff --git a/VECTO3GUI2020/Views/Multistage/ManufacturingStageAuxiliariesView.xaml b/VECTO3GUI2020/Views/Multistage/ManufacturingStageAuxiliariesView.xaml index 0665eca666db7e623e2bb2f02c5bca3d024c3d25..3c6f573d5ef4c8ba7e09c8c60bbfcdfeb1c25ca7 100644 --- a/VECTO3GUI2020/Views/Multistage/ManufacturingStageAuxiliariesView.xaml +++ b/VECTO3GUI2020/Views/Multistage/ManufacturingStageAuxiliariesView.xaml @@ -58,6 +58,12 @@ <ContentControl Content="{Binding ParameterViewModels[DoubleGlazing]}"/> <ContentControl Content="{Binding ParameterViewModels[AdjustableAuxiliaryHeater]}"/> <ContentControl Content="{Binding ParameterViewModels[SeparateAirDistributionDucts]}"/> + + <StackPanel Orientation="Vertical" Visibility="{Binding ShowxEVProperties, Converter={StaticResource BooleanToVisibilityConverter}}"> + <ContentControl Content="{Binding ParameterViewModels[WaterElectricHeater]}"/> + <ContentControl Content="{Binding ParameterViewModels[AirElectricHeater]}"/> + <ContentControl Content="{Binding ParameterViewModels[OtherHeatingTechnology]}"/> + </StackPanel> </StackPanel> </DockPanel> </ScrollViewer> diff --git a/VECTO3GUI2020/Views/Multistage/ManufacturingStageView.xaml b/VECTO3GUI2020/Views/Multistage/ManufacturingStageView.xaml index 21a1ba5b48ebed8ed7a3f59915a23f32853c604e..5856be5e9a6cf58788522719f2033448b11ac3df 100644 --- a/VECTO3GUI2020/Views/Multistage/ManufacturingStageView.xaml +++ b/VECTO3GUI2020/Views/Multistage/ManufacturingStageView.xaml @@ -8,21 +8,23 @@ xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:properties="clr-namespace:VECTO3GUI2020.Properties" mc:Ignorable="d" - d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance implementation:ManufacturingStageViewModel_v0_1 }"> + d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance implementation:StageInputViewModel}"> + + <!--d:DataContext="{d:DesignInstance implementation:ManufacturingStageViewModel_v0_1 }"--> <Grid> - <DockPanel> + <DockPanel d:Background="LightPink"> - <DockPanel DockPanel.Dock="Top" LastChildFill="False"> + <DockPanel DockPanel.Dock="Top" LastChildFill="False" d:Background="Aqua"> <UniformGrid DockPanel.Dock="Left" Width="350" Rows="1" HorizontalAlignment="Left"> <Button Style="{DynamicResource MultiStageButtonStyle1}" - Margin="4" Command="{Binding SwitchComponentViewCommand}" CommandParameter="Vehicle">Vehicle</Button> + Margin="4" Command="{Binding SwitchComponentViewCommand}" CommandParameter="Vehicle" x:Name="TopButton">Vehicle</Button> <Button Style="{DynamicResource MultiStageButtonStyle1}" Margin="4" Command="{Binding SwitchComponentViewCommand}" CommandParameter="Airdrag">Airdrag</Button> <Button Style="{DynamicResource MultiStageButtonStyle1}" Margin="4" Command="{Binding SwitchComponentViewCommand}" CommandParameter="Auxiliaries">Auxiliaries</Button> </UniformGrid> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 10 20 10" > + <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 10 20 10" d:Visibility="Visible" d:Background="Green"> <StackPanel.Visibility> <PriorityBinding> <Binding Path="StepCount" Converter="{StaticResource AlwaysVisibleConverter}"/> @@ -43,6 +45,27 @@ </Label> </StackPanel> + <StackPanel d:Background="Red" + DockPanel.Dock="Right" + Orientation="Horizontal" + HorizontalAlignment="Center" + VerticalAlignment="Center" + Margin="0 10 20 10"> + <StackPanel.Visibility> + <PriorityBinding> + <Binding Path="Architecture" Converter="{StaticResource AlwaysVisibleConverter}"/> + <Binding> + <Binding.Source> + <Visibility>Collapsed</Visibility> + </Binding.Source> + </Binding> + </PriorityBinding> + </StackPanel.Visibility> + <Label Padding="4">Architecture</Label> + <ComboBox MinWidth="150" ItemsSource="{Binding ArchitectureItems, UpdateSourceTrigger=PropertyChanged}" SelectedValue="{Binding Architecture, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> + </ComboBox> + </StackPanel> + </DockPanel> <UniformGrid Rows="1" Width="350" DockPanel.Dock="Bottom" HorizontalAlignment="Right" @@ -54,7 +77,7 @@ Command="{Binding CloseWindowCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}">Close</Button> </UniformGrid> - <ContentControl DockPanel.Dock="Top" ContentTemplateSelector="{StaticResource MultistageVehicleDataTemplateSelector}" Content="{Binding CurrentView}"/> + <ContentControl DockPanel.Dock="Top" ContentTemplateSelector="{StaticResource MultistageVehicleDataTemplateSelector}" Content="{Binding CurrentView}" d:Background="Beige"/> </DockPanel> </Grid> </UserControl> diff --git a/VECTO3GUI2020/Views/Multistage/VehicleView_v2_8.xaml b/VECTO3GUI2020/Views/Multistage/VehicleView_v2_8.xaml index 5fb13f8d3cbcdce2ba840f84557e1eec004af5b4..a9ce8d0a4888e00250691c29129e3f93ad63c03c 100644 --- a/VECTO3GUI2020/Views/Multistage/VehicleView_v2_8.xaml +++ b/VECTO3GUI2020/Views/Multistage/VehicleView_v2_8.xaml @@ -7,7 +7,7 @@ xmlns:custom="clr-namespace:VECTO3GUI2020.Views.Multistage.CustomControls" xmlns:implementation="clr-namespace:VECTO3GUI2020.ViewModel.MultiStage.Implementation" xmlns:properties="clr-namespace:VECTO3GUI2020.Properties" xmlns:resources="clr-namespace:System.Resources;assembly=mscorlib" - d:DataContext="{d:DesignInstance Type=implementation:InterimStageBusVehicleViewModel_v2_8}" + d:DataContext="{d:DesignInstance Type=implementation:InterimStageBusVehicleViewModel}" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" BorderBrush="{DynamicResource ButtonHighlightColor}" BorderThickness="2px" Margin="4px"> <UserControl.Resources> diff --git a/Vecto3GUI2020Test/BugReports/VIFTests.cs b/Vecto3GUI2020Test/BugReports/VIFTests.cs index 7e4693efc1968ddf03807c86f255974c4a672d9a..ea9e4a5e3ab1e352da4114fed6765935457f9cfb 100644 --- a/Vecto3GUI2020Test/BugReports/VIFTests.cs +++ b/Vecto3GUI2020Test/BugReports/VIFTests.cs @@ -1,29 +1,36 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Ninject; using NUnit.Framework; using NUnit.Framework.Internal; +using VECTO3GUI2020.Helper; using VECTO3GUI2020.ViewModel.Implementation; using VECTO3GUI2020.ViewModel.Interfaces; +using Vecto3GUI2020Test.Utils; namespace Vecto3GUI2020Test.BugReports { [TestFixture] - public class VifTests : ViewModelTestBase + public class VifTests { - public const string primaryDecimalTestFile = "PrimaryDecimal/primary_heavyBus group41_nonSmart_rounded_decimals.xml"; - - - [TestCase(VifTests.primaryDecimalTestFile, TestName="PneumaticsCompressorDrive")] + [Ignore("DoesNothing")] + [TestCase(TestData.primaryDecimalTestFile, TestName="PneumaticsCompressorDrive")] public async Task CreateAndLoadVifWithWrongDecimalCount(string fileName) { + var path = Path.GetFullPath(fileName); + AssertHelper.FileExists(path); + var kernel = TestHelper.GetKernel(); + var dialogHelper = kernel.Get<IDialogHelper>() as MockDialogHelper; + //Load JobFile - var jobListViewModel = _kernel.Get<IJobListViewModel>() as JobListViewModel; - await jobListViewModel.AddJobAsync(GetTestDataPath(fileName: fileName)); + var jobListViewModel = kernel.Get<IJobListViewModel>() as JobListViewModel; + await jobListViewModel.AddJobAsync(fileName); + dialogHelper.AssertNoErrorDialogs(); Assert.AreEqual(1, jobListViewModel.Jobs.Count); jobListViewModel.Jobs[0].Selected = true; @@ -35,9 +42,9 @@ namespace Vecto3GUI2020Test.BugReports TestContext.WriteLine($"Done! ({stop.Elapsed.TotalSeconds}s)"); - var vifName = fileName.Replace(".xml", ".RSLT_VIF.xml"); - TestContext.WriteLine($"Trying to add {vifName} to JobList"); - await jobListViewModel.AddJobAsync(GetTestDataPath(fileName: vifName)); + var vifpath = path.Replace(".xml", ".RSLT_VIF.xml"); + TestContext.WriteLine($"Trying to add {path} to JobList"); + await jobListViewModel.AddJobAsync(path); Assert.AreEqual(2, jobListViewModel.Jobs.Count); foreach (var documentViewModel in jobListViewModel.Jobs) { diff --git a/Vecto3GUI2020Test/MockInput/MockComponent.cs b/Vecto3GUI2020Test/MockInput/MockComponent.cs new file mode 100644 index 0000000000000000000000000000000000000000..652803f7dc7ea23659f6bedceb08163b02947cd4 --- /dev/null +++ b/Vecto3GUI2020Test/MockInput/MockComponent.cs @@ -0,0 +1,155 @@ +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Xml.Linq; +using Moq; +using TUGraz.VectoCommon.BusAuxiliaries; +using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.Utils; + +namespace Vecto3GUI2020Test.MockInput; + +internal static class MockComponent +{ + public static IVehicleDeclarationInputData AddAirdragComponent(this IVehicleDeclarationInputData mocked, XNamespace version) + { + Mock.Get(mocked.Components).SetupGet(c => c.AirdragInputData).Returns((IAirdragDeclarationInputData)GetAirdragComponentData(version)); + return mocked; + } + + public static IVehicleDeclarationInputData AddBusAux(this IVehicleDeclarationInputData mocked, XNamespace version, string xsdType) + { + Mock.Get(mocked.Components).SetupGet(c => c.BusAuxiliaries) + .Returns((IBusAuxiliariesDeclarationData)GetBusAuxiliariesDeclarationData(version, xsdType)); + return mocked; + } + + public static IVehicleDeclarationInputData AddADAS(this IVehicleDeclarationInputData mocked, XNamespace version, + string xsdType) + { + var mock = Mock.Get(mocked); + mock.SetupGet(m => m.ADAS).Returns(GetADAS(version, xsdType)); + return mock.Object; + } + + public static IAdvancedDriverAssistantSystemDeclarationInputData GetADAS(XNamespace version, string xsdType) + { + var mock = new Mock<IAdvancedDriverAssistantSystemDeclarationInputData>(); + mock.SetupGet(m => m.ATEcoRollReleaseLockupClutch).Returns(false); + mock.SetupGet(m => m.EcoRoll).Returns(EcoRollType.WithEngineStop); + mock.SetupGet(m => m.EngineStopStart).Returns(true); + mock.SetupGet(m => m.PredictiveCruiseControl).Returns(PredictiveCruiseControlType.Option_1_2_3); + return mock.Object; + } + + public static IAirdragDeclarationInputData GetAirdragComponentData(XNamespace version) + { + var mock = new Mock<IAirdragDeclarationInputData>(); + mock.SetupGet(a => a.Manufacturer).Returns("Manufacturer"); + mock.SetupGet(a => a.Model).Returns("Model"); + mock.SetupGet(a => a.Date).Returns(DateTime.Today); + mock.SetupGet(a => a.AppVersion).Returns("Vecto AirDrag x.y"); + mock.SetupGet(a => a.CertificationNumber).Returns("e12*0815/8051*2017/05E0000*00"); + mock.SetupGet(a => a.SavedInDeclarationMode).Returns(true); + mock.SetupGet(a => a.AirDragArea).Returns(6.66.SI<SquareMeter>()); + mock.SetupGet(a => a.AirDragArea_0).Returns(7.77.SI<SquareMeter>()); + mock.SetupGet(a => a.TransferredAirDragArea).Returns(8.88.SI<SquareMeter>()); + + if (version == XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24) + { + mock.SetupGet(a => a.DataSource).Returns( + MockInput.GetMockDataSource(XMLDeclarationAirdragDataProviderV24.XSD_TYPE, version)); + } + else + { + mock.SetupGet(a => a.DataSource).Returns( + MockInput.GetMockDataSource(XMLDeclarationAirdragDataProviderV10.XSD_TYPE, version)); + } + + + //mock.SetupGet(a => a.DataSource.SourceVersion).Returns(version.GetVersionFromNamespaceUri); + //mock.SetupGet(a => a.DataSource.Type).Returns(XMLDeclarationAirdragDataProviderV20.XSD_TYPE); + //mock.SetupGet(a => a.DataSource.TypeVersion).Returns(version.NamespaceName); + return mock.Object; + } + + + public static IBusAuxiliariesDeclarationData GetBusAuxiliariesDeclarationData(XNamespace version, string xsdType) + { + var mocked = new Mock<IBusAuxiliariesDeclarationData>(); + mocked.SetupGet(m => m.DataSource).Returns(MockInput.GetMockDataSource(xsdType, version)); + + #region HVAC + mocked.SetupGet(m => m.HVACAux.AdjustableAuxiliaryHeater).Returns(true); + mocked.SetupGet(m => m.HVACAux.AdjustableCoolantThermostat).Returns(true); + mocked.SetupGet(m => m.HVACAux.AirElectricHeater).Returns(true); + mocked.SetupGet(m => m.HVACAux.AuxHeaterPower).Returns(50.SI<Watt>()); + mocked.SetupGet(m => m.HVACAux.DoubleGlazing).Returns(true); + mocked.SetupGet(m => m.HVACAux.EngineWasteGasHeatExchanger).Returns(true); + mocked.SetupGet(m => m.HVACAux.HeatPumpTypeCoolingDriverCompartment).Returns(HeatPumpType.non_R_744_2_stage); + mocked.SetupGet(m => m.HVACAux.HeatPumpTypeCoolingPassengerCompartment).Returns(HeatPumpType.non_R_744_2_stage); + mocked.SetupGet(m => m.HVACAux.HeatPumpTypeHeatingDriverCompartment).Returns(HeatPumpType.non_R_744_2_stage); + mocked.SetupGet(m => m.HVACAux.HeatPumpTypeHeatingPassengerCompartment).Returns(HeatPumpType.non_R_744_2_stage); + mocked.SetupGet(m => m.HVACAux.SystemConfiguration).Returns(BusHVACSystemConfiguration.Configuration0); + mocked.SetupGet(m => m.HVACAux.SeparateAirDistributionDucts).Returns(true); + mocked.SetupGet(m => m.HVACAux.WaterElectricHeater).Returns(true); + mocked.SetupGet(m => m.HVACAux.OtherHeatingTechnology).Returns(true); + + #endregion + + #region ElectricConsumers + mocked.SetupGet(m => m.ElectricConsumers.BrakelightsLED).Returns(true); + mocked.SetupGet(m => m.ElectricConsumers.DayrunninglightsLED).Returns(true); + mocked.SetupGet(m => m.ElectricConsumers.HeadlightsLED).Returns(true); + mocked.SetupGet(m => m.ElectricConsumers.InteriorLightsLED).Returns(true); + mocked.SetupGet(m => m.ElectricConsumers.PositionlightsLED).Returns(true); + #endregion + + + //mocked.SetupGet(m => m.ElectricSupply.AlternatorTechnology).Returns(AlternatorType.Smart); + //mocked.SetupGet(m => m.ElectricSupply.Alternators).Returns(new List<IAlternatorDeclarationInputData>() { + // GetAlternatorDeclarationInputData(), GetAlternatorDeclarationInputData(), + //}); + //mocked.SetupGet(m => m.ElectricSupply.ESSupplyFromHEVREESS).Returns(true); + //mocked.SetupGet(m => m.ElectricSupply.ElectricStorage) + + + + return mocked.Object; + } + + private static IAlternatorDeclarationInputData GetAlternatorDeclarationInputData() + { + var mocked = new Mock<IAlternatorDeclarationInputData>(); + mocked.SetupGet(m => m.RatedCurrent).Returns(10.SI<Ampere>()); + mocked.SetupGet(m => m.RatedVoltage).Returns(48.SI<Volt>()); + return mocked.Object; + } + + + + public static IVehicleDeclarationInputData SetAirdragVersion(this IVehicleDeclarationInputData mocked, XNamespace version, [CallerMemberName] string creatingMethod = "mocked") + { + if (mocked.Components.AirdragInputData == null) + { + throw new VectoException("Airdrag not mocked"); + }; + + var airdrag = Mock.Get(mocked.Components.AirdragInputData); + airdrag.SetupGet((a) => a.DataSource).Returns(new DataSource() + { + SourceFile = creatingMethod, + SourceType = DataSourceType.XMLFile, + Type = XMLNames.AirDrag_Data_Type_Attr, + SourceVersion = version.GetVersionFromNamespaceUri(), + }); + + + return mocked; + } +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/MockInput/MockDocument.cs b/Vecto3GUI2020Test/MockInput/MockDocument.cs new file mode 100644 index 0000000000000000000000000000000000000000..b21146d679aee40875a4c4d7ffd47b9f702b6fed --- /dev/null +++ b/Vecto3GUI2020Test/MockInput/MockDocument.cs @@ -0,0 +1,137 @@ +using Moq; +using System; +using System.Runtime.CompilerServices; +using System.Xml.Linq; +using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl; +using TUGraz.VectoCore.Utils; + +namespace Vecto3GUI2020Test.MockInput; + +public static class MockDocument +{ + public static IDeclarationJobInputData GetStepInput(string type, XNamespace version) + { + var mock = new Mock<IDeclarationJobInputData>(); + var mocked = mock.Object; + mocked.AddVehicle(type, version); + return mock.Object; + } + + public static IDeclarationInputDataProvider GetDeclarationJob() + { + var mock = new Mock<IDeclarationInputDataProvider>(MockBehavior.Strict); + mock.SetupGet(i => i.DataSource).Returns(MockInput.GetMockDataSource("VectoInputDeclaration", + XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V20)); + mock.SetupGet(i => i.JobInputData).Returns(GetDeclarationJobInputData()); + return mock.Object; + } + + + + public static IMultistepBusInputDataProvider GetMultistepInput(XNamespace stepInputVersion, string stepInputType, int nrOfStages) + { + + var mock = new Mock<IMultistepBusInputDataProvider>(MockBehavior.Strict); + mock.SetupGet(m => m.JobInputData).Returns(GetMultistageJobInputData(version:stepInputVersion, type:stepInputType, nrOfStages:nrOfStages)); + mock.SetupGet(m => m.DataSource).Returns(MockInput.GetMockDataSource(XMLDeclarationInputDataProviderMultistageV01.XSD_TYPE, XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1)); + + + + return mock.Object; + } + + private static IDeclarationMultistageJobInputData GetMultistageJobInputData(XNamespace version, string type, + int nrOfStages = 3) + { + var mock = new Mock<IDeclarationMultistageJobInputData>(); + var mocked = mock.Object; + mock.SetupGet(m => m.PrimaryVehicle).Returns(MockVehicle.GetPrimaryVehicleInformation(XMLDeclarationMultistage_Conventional_PrimaryVehicleBusJobInputDataProviderV01.XSD_TYPE)); + mock.SetupGet(m => m.ManufacturingStages).Returns(MockVehicle.GetManufacturingStages(nrOfStages:nrOfStages, type, version)); + + + //Evaluated later, in case the caller alters some values + mock.SetupGet(m => m.ConsolidateManufacturingStage).Returns(() => + new ConsolidateManufacturingStages(mocked.PrimaryVehicle, mocked.ManufacturingStages)); + + + return mock.Object; + } + + public static IDeclarationInputDataProvider AddStepInput(this IDeclarationInputDataProvider mocked, string type, XNamespace version) + { + var mock = Mock.Get(mocked); + mock.SetupGet(i => i.JobInputData).Returns(GetStepInput(type, version)); + return mocked; + } + + public static IDeclarationJobInputData AddPrimaryVehicle(this IDeclarationJobInputData mocked, string primaryBusType, XNamespace primaryBusVersion) + { + var mock = Mock.Get(mocked); + + mock.Setup(m => m.Vehicle).Returns(MockVehicle.GetPrimaryVehicle(primaryBusType)); + return mocked; + } + + public static IDeclarationJobInputData AddVehicle(this IDeclarationJobInputData declJob, string type, XNamespace version) + { + var mock = Mock.Get(declJob); + mock.SetupGet(j => j.Vehicle).Returns(MockVehicle.GetMockVehicle(type, version)); + return declJob; + } + + public static IDeclarationJobInputData GetDeclarationJobInputData() + { + var mock = new Mock<IDeclarationJobInputData>(); + return mock.Object; + } + + public static IDeclarationInputDataProvider GetDeclarationInputDataProvider( + out Mock<IDeclarationInputDataProvider> mock, VectoSimulationJobType jobType, XNamespace nameSpace) + { + mock = new Mock<IDeclarationInputDataProvider>(); + mock.SetupGet(d => d.JobInputData) + .Returns(GetDeclarationJobInputData().AddPrimaryVehicle(XMLDeclarationConventionalPrimaryBusVehicleDataProviderV24.XSD_TYPE, XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24)); + mock.SetupGet(d => d.PrimaryVehicleData).Returns(MockVehicle.GetPrimaryVehicleInformation(XMLDeclarationMultistage_Conventional_PrimaryVehicleBusJobInputDataProviderV01.XSD_TYPE)); + mock.SetupGet(d => d.DataSource).Returns(new DataSource() + { + SourceFile = "Mock", + SourceType = DataSourceType.XMLFile, + SourceVersion = nameSpace.GetVersionFromNamespaceUri(), + }); + + + + + + + return mock.Object; + } + + public static IMultistageVIFInputData GetMultistepVIFInputData(XNamespace vifVersion, string vifType, int stages, string stepType, XNamespace stepVersion) + { + var mock = new Mock<IMultistageVIFInputData>(); + mock.SetupGet(m => m.MultistageJobInputData).Returns(GetMultistepInput(vifVersion, vifType, stages)); + mock.SetupGet(m => m.VehicleInputData).Returns(GetStepInput(stepType, stepVersion).Vehicle); + + + + return mock.Object; + } + + public static IMultistagePrimaryAndStageInputDataProvider GetPrimaryAndStepInput(string primaryType, + XNamespace stepVehicleVersion, string stepVehicleType, XNamespace primaryBusVersion) + { + var mock = new Mock<IMultistagePrimaryAndStageInputDataProvider>(); + var declJob = GetDeclarationJob(); + declJob.JobInputData.AddPrimaryVehicle(primaryType, primaryBusVersion: primaryBusVersion); + mock.SetupGet(m => m.PrimaryVehicle).Returns(declJob); + mock.SetupGet(m => m.StageInputData).Returns(MockVehicle.GetMockVehicle(stepVehicleType, stepVehicleVersion)); + return mock.Object; + } +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/MockInput/MockInput.cs b/Vecto3GUI2020Test/MockInput/MockInput.cs new file mode 100644 index 0000000000000000000000000000000000000000..07672a25b71e04029c4928c00d694c45feb4d8e5 --- /dev/null +++ b/Vecto3GUI2020Test/MockInput/MockInput.cs @@ -0,0 +1,20 @@ +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.Utils; + +namespace Vecto3GUI2020Test.MockInput; + +static internal class MockInput +{ + public static DataSource GetMockDataSource(string typeName, XNamespace version) + { + return new DataSource() + { + SourceFile = "Mocked", + SourceType = DataSourceType.Missing, + Type = typeName, + TypeVersion = version.NamespaceName, + SourceVersion = version.GetVersionFromNamespaceUri(), + }; + } +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/MockInput/MockVehicle.cs b/Vecto3GUI2020Test/MockInput/MockVehicle.cs new file mode 100644 index 0000000000000000000000000000000000000000..d7fc27ddaf9b58bfbefda1ade898ca9cb5fa0402 --- /dev/null +++ b/Vecto3GUI2020Test/MockInput/MockVehicle.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Xml.Linq; +using Moq; +using TUGraz.VectoCommon.BusAuxiliaries; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.Utils; +using Range = Moq.Range; + +namespace Vecto3GUI2020Test.MockInput; + +internal static class MockVehicle +{ + public static IVehicleDeclarationInputData GetMockVehicle(string type, XNamespace version) + { + var mock = new Mock<IVehicleDeclarationInputData>(); + + + mock.SetupGet(v => v.Identifier).Returns("VEH-1234567890"); + mock.SetupGet(v => v.Manufacturer).Returns("Some Manufacturer"); + mock.SetupGet(v => v.ManufacturerAddress).Returns("Baker Street 221b"); + mock.SetupGet(v => v.VIN).Returns("VEH-1234567890"); + mock.SetupGet(v => v.Date).Returns(DateTime.Today); + mock.SetupGet(v => v.Model).Returns("Fillmore"); + mock.SetupGet(v => v.LegislativeClass).Returns(LegislativeClass.M3); + mock.SetupGet(v => v.CurbMassChassis).Returns(12000.SI<Kilogram>()); + mock.SetupGet(v => v.GrossVehicleMassRating).Returns(15000.SI<Kilogram>()); + mock.SetupGet(v => v.AirdragModifiedMultistep).Returns(true); + mock.SetupGet(v => v.TankSystem).Returns(TankSystem.Compressed); + mock.SetupGet(v => v.RegisteredClass).Returns(RegistrationClass.II_III); + mock.SetupGet(v => v.NumberPassengerSeatsLowerDeck).Returns(1); + mock.SetupGet(v => v.NumberPassengersStandingLowerDeck).Returns(10); + mock.SetupGet(v => v.NumberPassengerSeatsUpperDeck).Returns(11); + mock.SetupGet(v => v.NumberPassengersStandingUpperDeck).Returns(2); + mock.SetupGet(v => v.VehicleCode).Returns(VehicleCode.CB); + mock.SetupGet(v => v.LowEntry).Returns(false); + mock.SetupGet(v => v.Height).Returns(2.5.SI<Meter>()); + mock.SetupGet(v => v.Length).Returns(9.5.SI<Meter>()); + mock.SetupGet(v => v.Width).Returns(2.5.SI<Meter>()); + mock.SetupGet(v => v.EntranceHeight).Returns(150E-3.SI<Meter>()); + mock.SetupGet(v => v.DoorDriveTechnology).Returns(ConsumerTechnology.Electrically); + mock.SetupGet(v => v.VehicleDeclarationType).Returns(VehicleDeclarationType.interim); + mock.SetupGet(v => v.VehicleTypeApprovalNumber).Returns("1234567890"); + mock.SetupGet(v => v.Components).Returns((IVehicleComponentsDeclaration)GetComponentsMock()); + + var obj = mock.Object; + mock.SetupGet(v => v.DataSource).Returns(MockInput.GetMockDataSource( + type, + version)); + + + return mock.Object; + } + + public static IVehicleDeclarationInputData GetPrimaryVehicle(string type) + { + var mock = new Mock<IVehicleDeclarationInputData>(); + mock.SetupGet(v => v.DataSource) + .Returns(MockInput.GetMockDataSource(type, + XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1)); + + + + + + return mock.Object; + } + + private static IVehicleComponentsDeclaration GetComponentsMock() + { + var mock = new Mock<IVehicleComponentsDeclaration>(); + return mock.Object; + } + + public static IPrimaryVehicleInformationInputDataProvider GetPrimaryVehicleInformation(string xsdType) + { + var mock = new Mock<IPrimaryVehicleInformationInputDataProvider>(); + mock.SetupGet(m => m.Vehicle) + .Returns(MockVehicle.GetPrimaryVehicle( + xsdType)); + + + + + return mock.Object; + } + + public static IList<IManufacturingStageInputData> GetManufacturingStages(int nrOfStages, string type, XNamespace version) + { + var result = new List<IManufacturingStageInputData>(nrOfStages); + for (var i = 2; i <= nrOfStages + 1; i++) { + result.Add(GetManufacturingStage(type, version, i)); + } + + + return result; + + } + + public static IManufacturingStageInputData GetManufacturingStage(string type, XNamespace version, int stepCount) + { + var mock = new Mock<IManufacturingStageInputData>(); + mock.SetupGet(m => m.Vehicle).Returns(GetMockVehicle(type, version)); + mock.SetupGet(m => m.StepCount).Returns(stepCount); + + + return mock.Object; + } + + +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/TestData.cs b/Vecto3GUI2020Test/TestData.cs new file mode 100644 index 0000000000000000000000000000000000000000..70731dc9d613b7de5323a1b6dfea04bb1bf2efcf --- /dev/null +++ b/Vecto3GUI2020Test/TestData.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Ninject.Parameters; + +namespace Vecto3GUI2020Test +{ + internal static class TestData + { + private const string TestDataBasePath = @"TestData\"; + private const string XMLBasePath = TestDataBasePath + @"XML\"; + private const string SchemaVersionMultistep = XMLBasePath + @"SchemaVersionMultistage.0.1\"; + private const string SchemaVersion2_4 = XMLBasePath + @"SchemaVersion2.4\"; + + public const string FinalVif = SchemaVersionMultistep + "vecto_multistage_conventional_final_vif.VIF_Report_1.xml"; + public const string NewVifCompletedConventional = TestDataBasePath + "Case2/newVifCompletedConventional.vecto"; + public const string NewVifExempted = TestDataBasePath + "Case2/newVifExempted.vecto"; + public const string NewVifInterimDiesel = TestDataBasePath + "Case1/newVifInterimDiesel.vecto"; + public const string NewVifExemptedIncomplete = TestDataBasePath + "Case1/newVifExemptedIncomplete.vecto"; + public const string PrimaryHeavybusSampleXML = SchemaVersion2_4 + "vecto_vehicle-primary_heavyBus-sample.xml"; + public const string HeavylorryHevSHeavylorryS3XML = SchemaVersion2_4 + @"Distributed\HeavyLorry\HEV-S_heavyLorry_S3.xml"; + public const string primaryDecimalTestFile = $"{TestDataBasePath}/bugreports/PrimaryDecimal/primary_heavyBus group41_nonSmart_rounded_decimals.xml"; + public const string consolidated_multiple_stages = SchemaVersionMultistep + "vecto_multistage_consolidated_multiple_stages.xml"; + public const string consolidated_multiple_stages_airdrag = SchemaVersionMultistep + "vecto_multistage_consolidated_multiple_stages_airdrag.xml"; + public const string consolidated_multiple_stages_hev = SchemaVersionMultistep + "vecto_multistage_consolidated_multiple_stages_hev.xml"; + public const string consolidated_one_stage = SchemaVersionMultistep + "vecto_multistage_consolidated_one_stage.xml"; + public const string primary_vehicle_only = SchemaVersionMultistep + "vecto_multistage_primary_vehicle_only.xml"; + + public const string exempted_primary_vif = SchemaVersionMultistep + "exempted_primary_heavyBus.VIF.xml"; + public const string stageInputFullSample = XMLBasePath + "vecto_vehicle-stage_input_full-sample.xml"; + public const string airdragLoadTestFile = SchemaVersionMultistep + "AirdragLoadTestFile.xml"; + public const string airdragLoadTestFilev2 = SchemaVersionMultistep + "AirdragLoadTestFilev2.xml"; + + public const string exemptedCompleted = SchemaVersionMultistep + "exempted_completed.VIF_Report_2.xml"; + + + public const string _finalVif = "vecto_multistage_conventional_final_vif.VIF_Report_1.xml"; + } +} diff --git a/Vecto3GUI2020Test/TestData/Case1/newVifExemptedIncomplete.vecto b/Vecto3GUI2020Test/TestData/Case1/newVifExemptedIncomplete.vecto new file mode 100644 index 0000000000000000000000000000000000000000..ba34d75540dce4a6976213cdfbf1dc507b25ba61 --- /dev/null +++ b/Vecto3GUI2020Test/TestData/Case1/newVifExemptedIncomplete.vecto @@ -0,0 +1,14 @@ +{ + "Header": { + "CreatedBy": "Harry", + "Date": "2021-08-25T00:00:00+02:00", + "AppVersion": "Vecto3GUI2020", + "FileVersion": 10 + }, + "Body": { + "PrimaryVehicle": "..\\XML\\SchemaVersion2.4\\exempted_primary_heavyBus.xml", + "InterimStep": "..\\XML\\SchemaVersion2.4\\vecto_vehicle-exempted_input_interim-sample.xml", + "Completed": false, + "RunSimulation": true + } +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/TestData/Case1/newVifInterimDiesel.vecto b/Vecto3GUI2020Test/TestData/Case1/newVifInterimDiesel.vecto new file mode 100644 index 0000000000000000000000000000000000000000..f574c44c15ec5141558d9bb1e14928b33cd5a016 --- /dev/null +++ b/Vecto3GUI2020Test/TestData/Case1/newVifInterimDiesel.vecto @@ -0,0 +1,16 @@ +{ + "Header": { + "CreatedBy": "Harry", + "Date": "2021-08-25T00:00:00+02:00", + "AppVersion": "Vecto3GUI2020", + "FileVersion": 10 + }, + "Body": { + "PrimaryVehicle": "..\\XML\\SchemaVersion2.4\\vecto_vehicle-primary_heavyBus-sample.xml", + "InterimStep": "..\\XML\\SchemaVersion2.4\\vecto_vehicle-stage_input_full-sample.xml", + "Completed": false, + "RunSimulation": true + } +} + + diff --git a/Vecto3GUI2020Test/TestData/Case1/special_case_1.vecto b/Vecto3GUI2020Test/TestData/Case1/special_case_1.vecto new file mode 100644 index 0000000000000000000000000000000000000000..00c150c42d8346d41197bba2d9e678fcc7f0dfbe --- /dev/null +++ b/Vecto3GUI2020Test/TestData/Case1/special_case_1.vecto @@ -0,0 +1,14 @@ +{ + "Header": { + "CreatedBy": "haraldmartini", + "Date": "2023-03-23T00:00:00+01:00", + "AppVersion": "Vecto3GUI2020", + "FileVersion": 10 + }, + "Body": { + "PrimaryVehicle": "vecto_vehicle-primary_heavyBus-sample.xml", + "InterimStep": "vecto_vehicle-stage_input_only_certain_entries01-sample.xml", + "Completed": false, + "RunSimulation": false + } +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/TestData/Case1/vecto_vehicle-primary_heavyBus-sample.xml b/Vecto3GUI2020Test/TestData/Case1/vecto_vehicle-primary_heavyBus-sample.xml new file mode 100644 index 0000000000000000000000000000000000000000..ce2029db18fd2a714bc20753e8066936a6ca9f20 --- /dev/null +++ b/Vecto3GUI2020Test/TestData/Case1/vecto_vehicle-primary_heavyBus-sample.xml @@ -0,0 +1,3289 @@ +<?xml version="1.0" encoding="UTF-8"?> +<tns:VectoInputDeclaration schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.4" xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationInput:v2.0" xmlns:v2.4="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.4" xmlns:v2.1="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xmlns:di="http://www.w3.org/2000/09/xmldsig#" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationJob V:\VectoCore\VectoCore\Resources\XSD/VectoDeclarationJob.xsd"> + <v2.0:Vehicle id="VEH-1234567890" xsi:type="Vehicle_Conventional_PrimaryBusDeclarationType"> + <Manufacturer>Generic Truck Manufacturer</Manufacturer> + <ManufacturerAddress>Street, ZIP City</ManufacturerAddress> + <Model>Generic Model</Model> + <VIN>VEH-1234567890</VIN> + <Date>2017-02-15T11:00:00Z</Date> + <LegislativeCategory>M3</LegislativeCategory> + <ChassisConfiguration>Bus</ChassisConfiguration> + <AxleConfiguration>4x2</AxleConfiguration> + <Articulated>false</Articulated> + <TechnicalPermissibleMaximumLadenMass>25000</TechnicalPermissibleMaximumLadenMass> + <IdlingSpeed>600</IdlingSpeed> + <RetarderType>Transmission Output Retarder</RetarderType> + <RetarderRatio>1.000</RetarderRatio> + <AngledriveType>None</AngledriveType> + <ZeroEmissionVehicle>false</ZeroEmissionVehicle> + <ADAS xsi:type="ADAS_Conventional_Type"> + <EngineStopStart>false</EngineStopStart> + <EcoRollWithoutEngineStop>false</EcoRollWithoutEngineStop> + <EcoRollWithEngineStop>false</EcoRollWithEngineStop> + <PredictiveCruiseControl>none</PredictiveCruiseControl> + </ADAS> + <TorqueLimits xsi:type="v2.0:TorqueLimitsType"> + <v2.0:Entry gear="6" maxTorque="1800"/> + <v2.0:Entry gear="1" maxTorque="2500"/> + <v2.0:Entry gear="12" maxTorque="1900"/> + </TorqueLimits> + <Components xsi:type="Components_Conventional_PrimaryBusType"> + <Engine> + <v2.0:Data id="ENG-gooZah3D" xsi:type="v2.1:EngineDataDeclarationType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1"> + <Manufacturer>Generic Engine Manufacturer</Manufacturer> + <Model>Generic 40t Long Haul Truck Engine</Model> + <CertificationNumber>e12*0815/8051*2017/05E0000*00</CertificationNumber> + <Date>2017-02-15T11:00:00Z</Date> + <AppVersion>VectoEngine x.y</AppVersion> + <Displacement>12730</Displacement> + <IdlingSpeed>560</IdlingSpeed> + <RatedSpeed>2200</RatedSpeed> + <RatedPower>380000</RatedPower> + <MaxEngineTorque>2400</MaxEngineTorque> + <WHTCUrban>1.0097</WHTCUrban> + <WHTCRural>1.0035</WHTCRural> + <WHTCMotorway>1.0200</WHTCMotorway> + <BFColdHot>1.0000</BFColdHot> + <CFRegPer>1.0000</CFRegPer> + <CFNCV>1.0000</CFNCV> + <FuelType>NG CI</FuelType> + <FuelConsumptionMap> + <Entry engineSpeed="560.00" torque="-149.00" fuelConsumption="0.00"/> + <Entry engineSpeed="560.00" torque="0.00" fuelConsumption="1256.00"/> + <Entry engineSpeed="560.00" torque="200.00" fuelConsumption="3197.00"/> + <Entry engineSpeed="560.00" torque="400.00" fuelConsumption="5295.00"/> + <Entry engineSpeed="560.00" torque="600.00" fuelConsumption="7615.00"/> + <Entry engineSpeed="560.00" torque="800.00" fuelConsumption="9375.00"/> + <Entry engineSpeed="560.00" torque="1000.00" fuelConsumption="11239.00"/> + <Entry engineSpeed="560.00" torque="1180.00" fuelConsumption="12869.00"/> + <Entry engineSpeed="600.00" torque="-148.00" fuelConsumption="0.00"/> + <Entry engineSpeed="600.00" torque="0.00" fuelConsumption="1459.00"/> + <Entry engineSpeed="600.00" torque="200.00" fuelConsumption="3358.00"/> + <Entry engineSpeed="600.00" torque="400.00" fuelConsumption="5498.00"/> + <Entry engineSpeed="600.00" torque="600.00" fuelConsumption="8101.00"/> + <Entry engineSpeed="600.00" torque="800.00" fuelConsumption="10014.00"/> + <Entry engineSpeed="600.00" torque="1000.00" fuelConsumption="12071.00"/> + <Entry engineSpeed="600.00" torque="1200.00" fuelConsumption="14201.00"/> + <Entry engineSpeed="600.00" torque="1282.00" fuelConsumption="15304.00"/> + <Entry engineSpeed="800.00" torque="-149.00" fuelConsumption="0.00"/> + <Entry engineSpeed="800.00" torque="0.00" fuelConsumption="1879.00"/> + <Entry engineSpeed="800.00" torque="200.00" fuelConsumption="4286.00"/> + <Entry engineSpeed="800.00" torque="400.00" fuelConsumption="7021.00"/> + <Entry engineSpeed="800.00" torque="600.00" fuelConsumption="10059.00"/> + <Entry engineSpeed="800.00" torque="800.00" fuelConsumption="13086.00"/> + <Entry engineSpeed="800.00" torque="1000.00" fuelConsumption="16015.00"/> + <Entry engineSpeed="800.00" torque="1200.00" fuelConsumption="19239.00"/> + <Entry engineSpeed="800.00" torque="1400.00" fuelConsumption="22426.00"/> + <Entry engineSpeed="800.00" torque="1600.00" fuelConsumption="25483.00"/> + <Entry engineSpeed="800.00" torque="1791.00" fuelConsumption="28905.00"/> + <Entry engineSpeed="1000.00" torque="-160.00" fuelConsumption="0.00"/> + <Entry engineSpeed="1000.00" torque="0.00" fuelConsumption="2865.00"/> + <Entry engineSpeed="1000.00" torque="200.00" fuelConsumption="5963.00"/> + <Entry engineSpeed="1000.00" torque="400.00" fuelConsumption="9198.00"/> + <Entry engineSpeed="1000.00" torque="600.00" fuelConsumption="12354.00"/> + <Entry engineSpeed="1000.00" torque="800.00" fuelConsumption="15965.00"/> + <Entry engineSpeed="1000.00" torque="1000.00" fuelConsumption="19864.00"/> + <Entry engineSpeed="1000.00" torque="1200.00" fuelConsumption="23530.00"/> + <Entry engineSpeed="1000.00" torque="1400.00" fuelConsumption="27202.00"/> + <Entry engineSpeed="1000.00" torque="1600.00" fuelConsumption="31165.00"/> + <Entry engineSpeed="1000.00" torque="1800.00" fuelConsumption="35103.00"/> + <Entry engineSpeed="1000.00" torque="2000.00" fuelConsumption="39360.00"/> + <Entry engineSpeed="1000.00" torque="2200.00" fuelConsumption="44120.00"/> + <Entry engineSpeed="1000.00" torque="2300.00" fuelConsumption="46836.00"/> + <Entry engineSpeed="1200.00" torque="-179.00" fuelConsumption="0.00"/> + <Entry engineSpeed="1200.00" torque="0.00" fuelConsumption="3307.00"/> + <Entry engineSpeed="1200.00" torque="200.00" fuelConsumption="6897.00"/> + <Entry engineSpeed="1200.00" torque="400.00" fuelConsumption="10651.00"/> + <Entry engineSpeed="1200.00" torque="600.00" fuelConsumption="14645.00"/> + <Entry engineSpeed="1200.00" torque="800.00" fuelConsumption="19115.00"/> + <Entry engineSpeed="1200.00" torque="1000.00" fuelConsumption="23677.00"/> + <Entry engineSpeed="1200.00" torque="1200.00" fuelConsumption="28180.00"/> + <Entry engineSpeed="1200.00" torque="1400.00" fuelConsumption="32431.00"/> + <Entry engineSpeed="1200.00" torque="1600.00" fuelConsumption="36698.00"/> + <Entry engineSpeed="1200.00" torque="1800.00" fuelConsumption="41691.00"/> + <Entry engineSpeed="1200.00" torque="2000.00" fuelConsumption="46915.00"/> + <Entry engineSpeed="1200.00" torque="2200.00" fuelConsumption="51783.00"/> + <Entry engineSpeed="1200.00" torque="2300.00" fuelConsumption="54932.00"/> + <Entry engineSpeed="1400.00" torque="-203.00" fuelConsumption="0.00"/> + <Entry engineSpeed="1400.00" torque="0.00" fuelConsumption="4306.00"/> + <Entry engineSpeed="1400.00" torque="200.00" fuelConsumption="8143.00"/> + <Entry engineSpeed="1400.00" torque="400.00" fuelConsumption="12723.00"/> + <Entry engineSpeed="1400.00" torque="600.00" fuelConsumption="17523.00"/> + <Entry engineSpeed="1400.00" torque="800.00" fuelConsumption="22288.00"/> + <Entry engineSpeed="1400.00" torque="1000.00" fuelConsumption="27093.00"/> + <Entry engineSpeed="1400.00" torque="1200.00" fuelConsumption="32536.00"/> + <Entry engineSpeed="1400.00" torque="1400.00" fuelConsumption="37746.00"/> + <Entry engineSpeed="1400.00" torque="1600.00" fuelConsumption="43194.00"/> + <Entry engineSpeed="1400.00" torque="1800.00" fuelConsumption="49453.00"/> + <Entry engineSpeed="1400.00" torque="2000.00" fuelConsumption="55830.00"/> + <Entry engineSpeed="1400.00" torque="2200.00" fuelConsumption="61072.00"/> + <Entry engineSpeed="1400.00" torque="2300.00" fuelConsumption="64377.00"/> + <Entry engineSpeed="1600.00" torque="-235.00" fuelConsumption="0.00"/> + <Entry engineSpeed="1600.00" torque="0.00" fuelConsumption="5209.00"/> + <Entry engineSpeed="1600.00" torque="200.00" fuelConsumption="9669.00"/> + <Entry engineSpeed="1600.00" torque="400.00" fuelConsumption="14838.00"/> + <Entry engineSpeed="1600.00" torque="600.00" fuelConsumption="20127.00"/> + <Entry engineSpeed="1600.00" torque="800.00" fuelConsumption="25894.00"/> + <Entry engineSpeed="1600.00" torque="1000.00" fuelConsumption="31631.00"/> + <Entry engineSpeed="1600.00" torque="1200.00" fuelConsumption="37248.00"/> + <Entry engineSpeed="1600.00" torque="1400.00" fuelConsumption="42826.00"/> + <Entry engineSpeed="1600.00" torque="1600.00" fuelConsumption="49752.00"/> + <Entry engineSpeed="1600.00" torque="1800.00" fuelConsumption="57020.00"/> + <Entry engineSpeed="1600.00" torque="2000.00" fuelConsumption="63914.00"/> + <Entry engineSpeed="1600.00" torque="2079.00" fuelConsumption="66520.00"/> + <Entry engineSpeed="1800.00" torque="-264.00" fuelConsumption="0.00"/> + <Entry engineSpeed="1800.00" torque="0.00" fuelConsumption="6409.00"/> + <Entry engineSpeed="1800.00" torque="200.00" fuelConsumption="11777.00"/> + <Entry engineSpeed="1800.00" torque="400.00" fuelConsumption="17320.00"/> + <Entry engineSpeed="1800.00" torque="600.00" fuelConsumption="23394.00"/> + <Entry engineSpeed="1800.00" torque="800.00" fuelConsumption="30501.00"/> + <Entry engineSpeed="1800.00" torque="1000.00" fuelConsumption="36378.00"/> + <Entry engineSpeed="1800.00" torque="1200.00" fuelConsumption="43079.00"/> + <Entry engineSpeed="1800.00" torque="1400.00" fuelConsumption="49796.00"/> + <Entry engineSpeed="1800.00" torque="1600.00" fuelConsumption="57436.00"/> + <Entry engineSpeed="1800.00" torque="1800.00" fuelConsumption="65157.00"/> + <Entry engineSpeed="1800.00" torque="1857.00" fuelConsumption="67574.00"/> + <Entry engineSpeed="2000.00" torque="-301.00" fuelConsumption="0.00"/> + <Entry engineSpeed="2000.00" torque="0.00" fuelConsumption="9127.00"/> + <Entry engineSpeed="2000.00" torque="200.00" fuelConsumption="14822.00"/> + <Entry engineSpeed="2000.00" torque="400.00" fuelConsumption="20655.00"/> + <Entry engineSpeed="2000.00" torque="600.00" fuelConsumption="27076.00"/> + <Entry engineSpeed="2000.00" torque="800.00" fuelConsumption="34188.00"/> + <Entry engineSpeed="2000.00" torque="1000.00" fuelConsumption="42837.00"/> + <Entry engineSpeed="2000.00" torque="1200.00" fuelConsumption="51018.00"/> + <Entry engineSpeed="2000.00" torque="1352.00" fuelConsumption="56618.00"/> + <Entry engineSpeed="2100.00" torque="-320.00" fuelConsumption="0.00"/> + <Entry engineSpeed="2100.00" torque="0.00" fuelConsumption="10470.00"/> + <Entry engineSpeed="2100.00" torque="200.00" fuelConsumption="16332.00"/> + <Entry engineSpeed="2100.00" torque="400.00" fuelConsumption="22396.00"/> + <Entry engineSpeed="2100.00" torque="600.00" fuelConsumption="28914.00"/> + <Entry engineSpeed="2100.00" torque="800.00" fuelConsumption="35717.00"/> + <Entry engineSpeed="2100.00" torque="1000.00" fuelConsumption="45643.00"/> + <Entry engineSpeed="2100.00" torque="1100.00" fuelConsumption="50653.00"/> + </FuelConsumptionMap> + <FullLoadAndDragCurve> + <Entry engineSpeed="560.00" maxTorque="1180.00" dragTorque="-149.00"/> + <Entry engineSpeed="600.00" maxTorque="1282.00" dragTorque="-148.00"/> + <Entry engineSpeed="800.00" maxTorque="1791.00" dragTorque="-149.00"/> + <Entry engineSpeed="1000.00" maxTorque="2300.00" dragTorque="-160.00"/> + <Entry engineSpeed="1200.00" maxTorque="2300.00" dragTorque="-179.00"/> + <Entry engineSpeed="1400.00" maxTorque="2300.00" dragTorque="-203.00"/> + <Entry engineSpeed="1600.00" maxTorque="2079.00" dragTorque="-235.00"/> + <Entry engineSpeed="1800.00" maxTorque="1857.00" dragTorque="-264.00"/> + <Entry engineSpeed="2000.00" maxTorque="1352.00" dragTorque="-301.00"/> + <Entry engineSpeed="2100.00" maxTorque="1100.00" dragTorque="-320.00"/> + </FullLoadAndDragCurve> + </v2.0:Data> + <v2.0:Signature> + <di:Reference URI="#ENG-gooZah3D"> + <di:Transforms> + <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization"/> + <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> + </di:Transforms> + <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> + <di:DigestValue>sNtMe9udO39TyKXzgwYEpVKImWizFalaBVqq3jLktuo=</di:DigestValue> + </di:Reference> + </v2.0:Signature> + </Engine> + <Gearbox> + <v2.0:Data id="gbx-vi2Oak2N" xsi:type="GearboxDataDeclarationType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0"> + <Manufacturer>Generic Gearbox Manufacturer</Manufacturer> + <Model>Generic 40t Long Haul Truck Gearbox</Model> + <CertificationNumber>e12*0815/8051*2017/05E0000*00</CertificationNumber> + <Date>2017-01-11T11:00:00Z</Date> + <AppVersion>3.0.1</AppVersion> + <TransmissionType>AMT</TransmissionType> + <MainCertificationMethod>Standard values</MainCertificationMethod> + <Gears> + <Gear number="1"> + <Ratio>14.930</Ratio> + <MaxTorque>1900</MaxTorque> + <MaxSpeed>2000</MaxSpeed> + <TorqueLossMap> + <Entry inputSpeed="0.00" inputTorque="-350.00" torqueLoss="12.06"/> + <Entry inputSpeed="0.00" inputTorque="-150.00" torqueLoss="8.06"/> + <Entry inputSpeed="0.00" inputTorque="50.00" torqueLoss="6.06"/> + <Entry inputSpeed="0.00" inputTorque="250.00" torqueLoss="10.06"/> + <Entry inputSpeed="0.00" inputTorque="450.00" torqueLoss="14.06"/> + <Entry inputSpeed="0.00" inputTorque="650.00" torqueLoss="18.06"/> + <Entry inputSpeed="0.00" inputTorque="850.00" torqueLoss="22.06"/> + <Entry inputSpeed="0.00" inputTorque="1050.00" torqueLoss="26.06"/> + <Entry inputSpeed="0.00" inputTorque="1250.00" torqueLoss="30.06"/> + <Entry inputSpeed="0.00" inputTorque="1450.00" torqueLoss="34.06"/> + <Entry inputSpeed="0.00" inputTorque="1650.00" torqueLoss="38.06"/> + <Entry inputSpeed="0.00" inputTorque="1850.00" torqueLoss="42.06"/> + <Entry inputSpeed="0.00" inputTorque="2050.00" torqueLoss="46.06"/> + <Entry inputSpeed="0.00" inputTorque="2250.00" torqueLoss="50.06"/> + <Entry inputSpeed="0.00" inputTorque="3000.00" torqueLoss="54.06"/> + <Entry inputSpeed="100.00" inputTorque="-350.00" torqueLoss="12.56"/> + <Entry inputSpeed="100.00" inputTorque="-150.00" torqueLoss="8.56"/> + <Entry inputSpeed="100.00" inputTorque="50.00" torqueLoss="6.56"/> + <Entry inputSpeed="100.00" inputTorque="250.00" torqueLoss="10.56"/> + <Entry inputSpeed="100.00" inputTorque="450.00" torqueLoss="14.56"/> + <Entry inputSpeed="100.00" inputTorque="650.00" torqueLoss="18.56"/> + <Entry inputSpeed="100.00" inputTorque="850.00" torqueLoss="22.56"/> + <Entry inputSpeed="100.00" inputTorque="1050.00" torqueLoss="26.56"/> + <Entry inputSpeed="100.00" inputTorque="1250.00" torqueLoss="30.56"/> + <Entry inputSpeed="100.00" inputTorque="1450.00" torqueLoss="34.56"/> + <Entry inputSpeed="100.00" inputTorque="1650.00" torqueLoss="38.56"/> + <Entry inputSpeed="100.00" inputTorque="1850.00" torqueLoss="42.56"/> + <Entry inputSpeed="100.00" inputTorque="2050.00" torqueLoss="46.56"/> + <Entry inputSpeed="100.00" inputTorque="2250.00" torqueLoss="50.56"/> + <Entry inputSpeed="100.00" inputTorque="3000.00" torqueLoss="54.56"/> + <Entry inputSpeed="300.00" inputTorque="-350.00" torqueLoss="13.58"/> + <Entry inputSpeed="300.00" inputTorque="-150.00" torqueLoss="9.58"/> + <Entry inputSpeed="300.00" inputTorque="50.00" torqueLoss="7.58"/> + <Entry inputSpeed="300.00" inputTorque="250.00" torqueLoss="11.58"/> + <Entry inputSpeed="300.00" inputTorque="450.00" torqueLoss="15.58"/> + <Entry inputSpeed="300.00" inputTorque="650.00" torqueLoss="19.58"/> + <Entry inputSpeed="300.00" inputTorque="850.00" torqueLoss="23.58"/> + <Entry inputSpeed="300.00" inputTorque="1050.00" torqueLoss="27.58"/> + <Entry inputSpeed="300.00" inputTorque="1250.00" torqueLoss="31.58"/> + <Entry inputSpeed="300.00" inputTorque="1450.00" torqueLoss="35.58"/> + <Entry inputSpeed="300.00" inputTorque="1650.00" torqueLoss="39.58"/> + <Entry inputSpeed="300.00" inputTorque="1850.00" torqueLoss="43.58"/> + <Entry inputSpeed="300.00" inputTorque="2050.00" torqueLoss="47.58"/> + <Entry inputSpeed="300.00" inputTorque="2250.00" torqueLoss="51.58"/> + <Entry inputSpeed="300.00" inputTorque="3000.00" torqueLoss="55.58"/> + <Entry inputSpeed="500.00" inputTorque="-350.00" torqueLoss="14.59"/> + <Entry inputSpeed="500.00" inputTorque="-150.00" torqueLoss="10.59"/> + <Entry inputSpeed="500.00" inputTorque="50.00" torqueLoss="8.59"/> + <Entry inputSpeed="500.00" inputTorque="250.00" torqueLoss="12.59"/> + <Entry inputSpeed="500.00" inputTorque="450.00" torqueLoss="16.59"/> + <Entry inputSpeed="500.00" inputTorque="650.00" torqueLoss="20.59"/> + <Entry inputSpeed="500.00" inputTorque="850.00" torqueLoss="24.59"/> + <Entry inputSpeed="500.00" inputTorque="1050.00" torqueLoss="28.59"/> + <Entry inputSpeed="500.00" inputTorque="1250.00" torqueLoss="32.59"/> + <Entry inputSpeed="500.00" inputTorque="1450.00" torqueLoss="36.59"/> + <Entry inputSpeed="500.00" inputTorque="1650.00" torqueLoss="40.59"/> + <Entry inputSpeed="500.00" inputTorque="1850.00" torqueLoss="44.59"/> + <Entry inputSpeed="500.00" inputTorque="2050.00" torqueLoss="48.59"/> + <Entry inputSpeed="500.00" inputTorque="2250.00" torqueLoss="52.59"/> + <Entry inputSpeed="500.00" inputTorque="3000.00" torqueLoss="56.59"/> + <Entry inputSpeed="700.00" inputTorque="-350.00" torqueLoss="15.60"/> + <Entry inputSpeed="700.00" inputTorque="-150.00" torqueLoss="11.60"/> + <Entry inputSpeed="700.00" inputTorque="50.00" torqueLoss="9.60"/> + <Entry inputSpeed="700.00" inputTorque="250.00" torqueLoss="13.60"/> + <Entry inputSpeed="700.00" inputTorque="450.00" torqueLoss="17.60"/> + <Entry inputSpeed="700.00" inputTorque="650.00" torqueLoss="21.60"/> + <Entry inputSpeed="700.00" inputTorque="850.00" torqueLoss="25.60"/> + <Entry inputSpeed="700.00" inputTorque="1050.00" torqueLoss="29.60"/> + <Entry inputSpeed="700.00" inputTorque="1250.00" torqueLoss="33.60"/> + <Entry inputSpeed="700.00" inputTorque="1450.00" torqueLoss="37.60"/> + <Entry inputSpeed="700.00" inputTorque="1650.00" torqueLoss="41.60"/> + <Entry inputSpeed="700.00" inputTorque="1850.00" torqueLoss="45.60"/> + <Entry inputSpeed="700.00" inputTorque="2050.00" torqueLoss="49.60"/> + <Entry inputSpeed="700.00" inputTorque="2250.00" torqueLoss="53.60"/> + <Entry inputSpeed="700.00" inputTorque="3000.00" torqueLoss="57.60"/> + <Entry inputSpeed="900.00" inputTorque="-350.00" torqueLoss="16.61"/> + <Entry inputSpeed="900.00" inputTorque="-150.00" torqueLoss="12.61"/> + <Entry inputSpeed="900.00" inputTorque="50.00" torqueLoss="10.61"/> + <Entry inputSpeed="900.00" inputTorque="250.00" torqueLoss="14.61"/> + <Entry inputSpeed="900.00" inputTorque="450.00" torqueLoss="18.61"/> + <Entry inputSpeed="900.00" inputTorque="650.00" torqueLoss="22.61"/> + <Entry inputSpeed="900.00" inputTorque="850.00" torqueLoss="26.61"/> + <Entry inputSpeed="900.00" inputTorque="1050.00" torqueLoss="30.61"/> + <Entry inputSpeed="900.00" inputTorque="1250.00" torqueLoss="34.61"/> + <Entry inputSpeed="900.00" inputTorque="1450.00" torqueLoss="38.61"/> + <Entry inputSpeed="900.00" inputTorque="1650.00" torqueLoss="42.61"/> + <Entry inputSpeed="900.00" inputTorque="1850.00" torqueLoss="46.61"/> + <Entry inputSpeed="900.00" inputTorque="2050.00" torqueLoss="50.61"/> + <Entry inputSpeed="900.00" inputTorque="2250.00" torqueLoss="54.61"/> + <Entry inputSpeed="900.00" inputTorque="3000.00" torqueLoss="58.61"/> + <Entry inputSpeed="1100.00" inputTorque="-350.00" torqueLoss="17.63"/> + <Entry inputSpeed="1100.00" inputTorque="-150.00" torqueLoss="13.63"/> + <Entry inputSpeed="1100.00" inputTorque="50.00" torqueLoss="11.63"/> + <Entry inputSpeed="1100.00" inputTorque="250.00" torqueLoss="15.63"/> + <Entry inputSpeed="1100.00" inputTorque="450.00" torqueLoss="19.63"/> + <Entry inputSpeed="1100.00" inputTorque="650.00" torqueLoss="23.63"/> + <Entry inputSpeed="1100.00" inputTorque="850.00" torqueLoss="27.63"/> + <Entry inputSpeed="1100.00" inputTorque="1050.00" torqueLoss="31.63"/> + <Entry inputSpeed="1100.00" inputTorque="1250.00" torqueLoss="35.63"/> + <Entry inputSpeed="1100.00" inputTorque="1450.00" torqueLoss="39.63"/> + <Entry inputSpeed="1100.00" inputTorque="1650.00" torqueLoss="43.63"/> + <Entry inputSpeed="1100.00" inputTorque="1850.00" torqueLoss="47.63"/> + <Entry inputSpeed="1100.00" inputTorque="2050.00" torqueLoss="51.63"/> + <Entry inputSpeed="1100.00" inputTorque="2250.00" torqueLoss="55.63"/> + <Entry inputSpeed="1100.00" inputTorque="3000.00" torqueLoss="59.63"/> + <Entry inputSpeed="1300.00" inputTorque="-350.00" torqueLoss="18.64"/> + <Entry inputSpeed="1300.00" inputTorque="-150.00" torqueLoss="14.64"/> + <Entry inputSpeed="1300.00" inputTorque="50.00" torqueLoss="12.64"/> + <Entry inputSpeed="1300.00" inputTorque="250.00" torqueLoss="16.64"/> + <Entry inputSpeed="1300.00" inputTorque="450.00" torqueLoss="20.64"/> + <Entry inputSpeed="1300.00" inputTorque="650.00" torqueLoss="24.64"/> + <Entry inputSpeed="1300.00" inputTorque="850.00" torqueLoss="28.64"/> + <Entry inputSpeed="1300.00" inputTorque="1050.00" torqueLoss="32.64"/> + <Entry inputSpeed="1300.00" inputTorque="1250.00" torqueLoss="36.64"/> + <Entry inputSpeed="1300.00" inputTorque="1450.00" torqueLoss="40.64"/> + <Entry inputSpeed="1300.00" inputTorque="1650.00" torqueLoss="44.64"/> + <Entry inputSpeed="1300.00" inputTorque="1850.00" torqueLoss="48.64"/> + <Entry inputSpeed="1300.00" inputTorque="2050.00" torqueLoss="52.64"/> + <Entry inputSpeed="1300.00" inputTorque="2250.00" torqueLoss="56.64"/> + <Entry inputSpeed="1300.00" inputTorque="3000.00" torqueLoss="60.64"/> + <Entry inputSpeed="1500.00" inputTorque="-350.00" torqueLoss="19.65"/> + <Entry inputSpeed="1500.00" inputTorque="-150.00" torqueLoss="15.65"/> + <Entry inputSpeed="1500.00" inputTorque="50.00" torqueLoss="13.65"/> + <Entry inputSpeed="1500.00" inputTorque="250.00" torqueLoss="17.65"/> + <Entry inputSpeed="1500.00" inputTorque="450.00" torqueLoss="21.65"/> + <Entry inputSpeed="1500.00" inputTorque="650.00" torqueLoss="25.65"/> + <Entry inputSpeed="1500.00" inputTorque="850.00" torqueLoss="29.65"/> + <Entry inputSpeed="1500.00" inputTorque="1050.00" torqueLoss="33.65"/> + <Entry inputSpeed="1500.00" inputTorque="1250.00" torqueLoss="37.65"/> + <Entry inputSpeed="1500.00" inputTorque="1450.00" torqueLoss="41.65"/> + <Entry inputSpeed="1500.00" inputTorque="1650.00" torqueLoss="45.65"/> + <Entry inputSpeed="1500.00" inputTorque="1850.00" torqueLoss="49.65"/> + <Entry inputSpeed="1500.00" inputTorque="2050.00" torqueLoss="53.65"/> + <Entry inputSpeed="1500.00" inputTorque="2250.00" torqueLoss="57.65"/> + <Entry inputSpeed="1500.00" inputTorque="3000.00" torqueLoss="61.65"/> + <Entry inputSpeed="1700.00" inputTorque="-350.00" torqueLoss="20.66"/> + <Entry inputSpeed="1700.00" inputTorque="-150.00" torqueLoss="16.66"/> + <Entry inputSpeed="1700.00" inputTorque="50.00" torqueLoss="14.66"/> + <Entry inputSpeed="1700.00" inputTorque="250.00" torqueLoss="18.66"/> + <Entry inputSpeed="1700.00" inputTorque="450.00" torqueLoss="22.66"/> + <Entry inputSpeed="1700.00" inputTorque="650.00" torqueLoss="26.66"/> + <Entry inputSpeed="1700.00" inputTorque="850.00" torqueLoss="30.66"/> + <Entry inputSpeed="1700.00" inputTorque="1050.00" torqueLoss="34.66"/> + <Entry inputSpeed="1700.00" inputTorque="1250.00" torqueLoss="38.66"/> + <Entry inputSpeed="1700.00" inputTorque="1450.00" torqueLoss="42.66"/> + <Entry inputSpeed="1700.00" inputTorque="1650.00" torqueLoss="46.66"/> + <Entry inputSpeed="1700.00" inputTorque="1850.00" torqueLoss="50.66"/> + <Entry inputSpeed="1700.00" inputTorque="2050.00" torqueLoss="54.66"/> + <Entry inputSpeed="1700.00" inputTorque="2250.00" torqueLoss="58.66"/> + <Entry inputSpeed="1700.00" inputTorque="3000.00" torqueLoss="62.66"/> + <Entry inputSpeed="1900.00" inputTorque="-350.00" torqueLoss="21.67"/> + <Entry inputSpeed="1900.00" inputTorque="-150.00" torqueLoss="17.67"/> + <Entry inputSpeed="1900.00" inputTorque="50.00" torqueLoss="15.67"/> + <Entry inputSpeed="1900.00" inputTorque="250.00" torqueLoss="19.67"/> + <Entry inputSpeed="1900.00" inputTorque="450.00" torqueLoss="23.67"/> + <Entry inputSpeed="1900.00" inputTorque="650.00" torqueLoss="27.67"/> + <Entry inputSpeed="1900.00" inputTorque="850.00" torqueLoss="31.67"/> + <Entry inputSpeed="1900.00" inputTorque="1050.00" torqueLoss="35.67"/> + <Entry inputSpeed="1900.00" inputTorque="1250.00" torqueLoss="39.67"/> + <Entry inputSpeed="1900.00" inputTorque="1450.00" torqueLoss="43.67"/> + <Entry inputSpeed="1900.00" inputTorque="1650.00" torqueLoss="47.67"/> + <Entry inputSpeed="1900.00" inputTorque="1850.00" torqueLoss="51.67"/> + <Entry inputSpeed="1900.00" inputTorque="2050.00" torqueLoss="55.67"/> + <Entry inputSpeed="1900.00" inputTorque="2250.00" torqueLoss="59.67"/> + <Entry inputSpeed="1900.00" inputTorque="3000.00" torqueLoss="63.67"/> + <Entry inputSpeed="2100.00" inputTorque="-350.00" torqueLoss="22.69"/> + <Entry inputSpeed="2100.00" inputTorque="-150.00" torqueLoss="18.69"/> + <Entry inputSpeed="2100.00" inputTorque="50.00" torqueLoss="16.69"/> + <Entry inputSpeed="2100.00" inputTorque="250.00" torqueLoss="20.69"/> + <Entry inputSpeed="2100.00" inputTorque="450.00" torqueLoss="24.69"/> + <Entry inputSpeed="2100.00" inputTorque="650.00" torqueLoss="28.69"/> + <Entry inputSpeed="2100.00" inputTorque="850.00" torqueLoss="32.69"/> + <Entry inputSpeed="2100.00" inputTorque="1050.00" torqueLoss="36.69"/> + <Entry inputSpeed="2100.00" inputTorque="1250.00" torqueLoss="40.69"/> + <Entry inputSpeed="2100.00" inputTorque="1450.00" torqueLoss="44.69"/> + <Entry inputSpeed="2100.00" inputTorque="1650.00" torqueLoss="48.69"/> + <Entry inputSpeed="2100.00" inputTorque="1850.00" torqueLoss="52.69"/> + <Entry inputSpeed="2100.00" inputTorque="2050.00" torqueLoss="56.69"/> + <Entry inputSpeed="2100.00" inputTorque="2250.00" torqueLoss="60.69"/> + <Entry inputSpeed="2100.00" inputTorque="3000.00" torqueLoss="64.69"/> + <Entry inputSpeed="0.00" inputTorque="-1000.00" torqueLoss="25.06"/> + <Entry inputSpeed="100.00" inputTorque="-1000.00" torqueLoss="25.56"/> + <Entry inputSpeed="300.00" inputTorque="-1000.00" torqueLoss="26.58"/> + <Entry inputSpeed="500.00" inputTorque="-1000.00" torqueLoss="27.59"/> + <Entry inputSpeed="700.00" inputTorque="-1000.00" torqueLoss="28.60"/> + <Entry inputSpeed="900.00" inputTorque="-1000.00" torqueLoss="29.61"/> + <Entry inputSpeed="1100.00" inputTorque="-1000.00" torqueLoss="30.63"/> + <Entry inputSpeed="1300.00" inputTorque="-1000.00" torqueLoss="31.64"/> + <Entry inputSpeed="1500.00" inputTorque="-1000.00" torqueLoss="32.65"/> + <Entry inputSpeed="1700.00" inputTorque="-1000.00" torqueLoss="33.66"/> + <Entry inputSpeed="1900.00" inputTorque="-1000.00" torqueLoss="34.67"/> + <Entry inputSpeed="2100.00" inputTorque="-1000.00" torqueLoss="35.69"/> + </TorqueLossMap> + </Gear> + <Gear number="2"> + <Ratio>11.640</Ratio> + <MaxTorque>1900</MaxTorque> + <MaxSpeed>2000</MaxSpeed> + <TorqueLossMap> + <Entry inputSpeed="0.00" inputTorque="-350.00" torqueLoss="12.06"/> + <Entry inputSpeed="0.00" inputTorque="-150.00" torqueLoss="8.06"/> + <Entry inputSpeed="0.00" inputTorque="50.00" torqueLoss="6.06"/> + <Entry inputSpeed="0.00" inputTorque="250.00" torqueLoss="10.06"/> + <Entry inputSpeed="0.00" inputTorque="450.00" torqueLoss="14.06"/> + <Entry inputSpeed="0.00" inputTorque="650.00" torqueLoss="18.06"/> + <Entry inputSpeed="0.00" inputTorque="850.00" torqueLoss="22.06"/> + <Entry inputSpeed="0.00" inputTorque="1050.00" torqueLoss="26.06"/> + <Entry inputSpeed="0.00" inputTorque="1250.00" torqueLoss="30.06"/> + <Entry inputSpeed="0.00" inputTorque="1450.00" torqueLoss="34.06"/> + <Entry inputSpeed="0.00" inputTorque="1650.00" torqueLoss="38.06"/> + <Entry inputSpeed="0.00" inputTorque="1850.00" torqueLoss="42.06"/> + <Entry inputSpeed="0.00" inputTorque="2050.00" torqueLoss="46.06"/> + <Entry inputSpeed="0.00" inputTorque="2250.00" torqueLoss="50.06"/> + <Entry inputSpeed="0.00" inputTorque="3000.00" torqueLoss="54.06"/> + <Entry inputSpeed="100.00" inputTorque="-350.00" torqueLoss="12.56"/> + <Entry inputSpeed="100.00" inputTorque="-150.00" torqueLoss="8.56"/> + <Entry inputSpeed="100.00" inputTorque="50.00" torqueLoss="6.56"/> + <Entry inputSpeed="100.00" inputTorque="250.00" torqueLoss="10.56"/> + <Entry inputSpeed="100.00" inputTorque="450.00" torqueLoss="14.56"/> + <Entry inputSpeed="100.00" inputTorque="650.00" torqueLoss="18.56"/> + <Entry inputSpeed="100.00" inputTorque="850.00" torqueLoss="22.56"/> + <Entry inputSpeed="100.00" inputTorque="1050.00" torqueLoss="26.56"/> + <Entry inputSpeed="100.00" inputTorque="1250.00" torqueLoss="30.56"/> + <Entry inputSpeed="100.00" inputTorque="1450.00" torqueLoss="34.56"/> + <Entry inputSpeed="100.00" inputTorque="1650.00" torqueLoss="38.56"/> + <Entry inputSpeed="100.00" inputTorque="1850.00" torqueLoss="42.56"/> + <Entry inputSpeed="100.00" inputTorque="2050.00" torqueLoss="46.56"/> + <Entry inputSpeed="100.00" inputTorque="2250.00" torqueLoss="50.56"/> + <Entry inputSpeed="100.00" inputTorque="3000.00" torqueLoss="54.56"/> + <Entry inputSpeed="300.00" inputTorque="-350.00" torqueLoss="13.58"/> + <Entry inputSpeed="300.00" inputTorque="-150.00" torqueLoss="9.58"/> + <Entry inputSpeed="300.00" inputTorque="50.00" torqueLoss="7.58"/> + <Entry inputSpeed="300.00" inputTorque="250.00" torqueLoss="11.58"/> + <Entry inputSpeed="300.00" inputTorque="450.00" torqueLoss="15.58"/> + <Entry inputSpeed="300.00" inputTorque="650.00" torqueLoss="19.58"/> + <Entry inputSpeed="300.00" inputTorque="850.00" torqueLoss="23.58"/> + <Entry inputSpeed="300.00" inputTorque="1050.00" torqueLoss="27.58"/> + <Entry inputSpeed="300.00" inputTorque="1250.00" torqueLoss="31.58"/> + <Entry inputSpeed="300.00" inputTorque="1450.00" torqueLoss="35.58"/> + <Entry inputSpeed="300.00" inputTorque="1650.00" torqueLoss="39.58"/> + <Entry inputSpeed="300.00" inputTorque="1850.00" torqueLoss="43.58"/> + <Entry inputSpeed="300.00" inputTorque="2050.00" torqueLoss="47.58"/> + <Entry inputSpeed="300.00" inputTorque="2250.00" torqueLoss="51.58"/> + <Entry inputSpeed="300.00" inputTorque="3000.00" torqueLoss="55.58"/> + <Entry inputSpeed="500.00" inputTorque="-350.00" torqueLoss="14.59"/> + <Entry inputSpeed="500.00" inputTorque="-150.00" torqueLoss="10.59"/> + <Entry inputSpeed="500.00" inputTorque="50.00" torqueLoss="8.59"/> + <Entry inputSpeed="500.00" inputTorque="250.00" torqueLoss="12.59"/> + <Entry inputSpeed="500.00" inputTorque="450.00" torqueLoss="16.59"/> + <Entry inputSpeed="500.00" inputTorque="650.00" torqueLoss="20.59"/> + <Entry inputSpeed="500.00" inputTorque="850.00" torqueLoss="24.59"/> + <Entry inputSpeed="500.00" inputTorque="1050.00" torqueLoss="28.59"/> + <Entry inputSpeed="500.00" inputTorque="1250.00" torqueLoss="32.59"/> + <Entry inputSpeed="500.00" inputTorque="1450.00" torqueLoss="36.59"/> + <Entry inputSpeed="500.00" inputTorque="1650.00" torqueLoss="40.59"/> + <Entry inputSpeed="500.00" inputTorque="1850.00" torqueLoss="44.59"/> + <Entry inputSpeed="500.00" inputTorque="2050.00" torqueLoss="48.59"/> + <Entry inputSpeed="500.00" inputTorque="2250.00" torqueLoss="52.59"/> + <Entry inputSpeed="500.00" inputTorque="3000.00" torqueLoss="56.59"/> + <Entry inputSpeed="700.00" inputTorque="-350.00" torqueLoss="15.60"/> + <Entry inputSpeed="700.00" inputTorque="-150.00" torqueLoss="11.60"/> + <Entry inputSpeed="700.00" inputTorque="50.00" torqueLoss="9.60"/> + <Entry inputSpeed="700.00" inputTorque="250.00" torqueLoss="13.60"/> + <Entry inputSpeed="700.00" inputTorque="450.00" torqueLoss="17.60"/> + <Entry inputSpeed="700.00" inputTorque="650.00" torqueLoss="21.60"/> + <Entry inputSpeed="700.00" inputTorque="850.00" torqueLoss="25.60"/> + <Entry inputSpeed="700.00" inputTorque="1050.00" torqueLoss="29.60"/> + <Entry inputSpeed="700.00" inputTorque="1250.00" torqueLoss="33.60"/> + <Entry inputSpeed="700.00" inputTorque="1450.00" torqueLoss="37.60"/> + <Entry inputSpeed="700.00" inputTorque="1650.00" torqueLoss="41.60"/> + <Entry inputSpeed="700.00" inputTorque="1850.00" torqueLoss="45.60"/> + <Entry inputSpeed="700.00" inputTorque="2050.00" torqueLoss="49.60"/> + <Entry inputSpeed="700.00" inputTorque="2250.00" torqueLoss="53.60"/> + <Entry inputSpeed="700.00" inputTorque="3000.00" torqueLoss="57.60"/> + <Entry inputSpeed="900.00" inputTorque="-350.00" torqueLoss="16.61"/> + <Entry inputSpeed="900.00" inputTorque="-150.00" torqueLoss="12.61"/> + <Entry inputSpeed="900.00" inputTorque="50.00" torqueLoss="10.61"/> + <Entry inputSpeed="900.00" inputTorque="250.00" torqueLoss="14.61"/> + <Entry inputSpeed="900.00" inputTorque="450.00" torqueLoss="18.61"/> + <Entry inputSpeed="900.00" inputTorque="650.00" torqueLoss="22.61"/> + <Entry inputSpeed="900.00" inputTorque="850.00" torqueLoss="26.61"/> + <Entry inputSpeed="900.00" inputTorque="1050.00" torqueLoss="30.61"/> + <Entry inputSpeed="900.00" inputTorque="1250.00" torqueLoss="34.61"/> + <Entry inputSpeed="900.00" inputTorque="1450.00" torqueLoss="38.61"/> + <Entry inputSpeed="900.00" inputTorque="1650.00" torqueLoss="42.61"/> + <Entry inputSpeed="900.00" inputTorque="1850.00" torqueLoss="46.61"/> + <Entry inputSpeed="900.00" inputTorque="2050.00" torqueLoss="50.61"/> + <Entry inputSpeed="900.00" inputTorque="2250.00" torqueLoss="54.61"/> + <Entry inputSpeed="900.00" inputTorque="3000.00" torqueLoss="58.61"/> + <Entry inputSpeed="1100.00" inputTorque="-350.00" torqueLoss="17.63"/> + <Entry inputSpeed="1100.00" inputTorque="-150.00" torqueLoss="13.63"/> + <Entry inputSpeed="1100.00" inputTorque="50.00" torqueLoss="11.63"/> + <Entry inputSpeed="1100.00" inputTorque="250.00" torqueLoss="15.63"/> + <Entry inputSpeed="1100.00" inputTorque="450.00" torqueLoss="19.63"/> + <Entry inputSpeed="1100.00" inputTorque="650.00" torqueLoss="23.63"/> + <Entry inputSpeed="1100.00" inputTorque="850.00" torqueLoss="27.63"/> + <Entry inputSpeed="1100.00" inputTorque="1050.00" torqueLoss="31.63"/> + <Entry inputSpeed="1100.00" inputTorque="1250.00" torqueLoss="35.63"/> + <Entry inputSpeed="1100.00" inputTorque="1450.00" torqueLoss="39.63"/> + <Entry inputSpeed="1100.00" inputTorque="1650.00" torqueLoss="43.63"/> + <Entry inputSpeed="1100.00" inputTorque="1850.00" torqueLoss="47.63"/> + <Entry inputSpeed="1100.00" inputTorque="2050.00" torqueLoss="51.63"/> + <Entry inputSpeed="1100.00" inputTorque="2250.00" torqueLoss="55.63"/> + <Entry inputSpeed="1100.00" inputTorque="3000.00" torqueLoss="59.63"/> + <Entry inputSpeed="1300.00" inputTorque="-350.00" torqueLoss="18.64"/> + <Entry inputSpeed="1300.00" inputTorque="-150.00" torqueLoss="14.64"/> + <Entry inputSpeed="1300.00" inputTorque="50.00" torqueLoss="12.64"/> + <Entry inputSpeed="1300.00" inputTorque="250.00" torqueLoss="16.64"/> + <Entry inputSpeed="1300.00" inputTorque="450.00" torqueLoss="20.64"/> + <Entry inputSpeed="1300.00" inputTorque="650.00" torqueLoss="24.64"/> + <Entry inputSpeed="1300.00" inputTorque="850.00" torqueLoss="28.64"/> + <Entry inputSpeed="1300.00" inputTorque="1050.00" torqueLoss="32.64"/> + <Entry inputSpeed="1300.00" inputTorque="1250.00" torqueLoss="36.64"/> + <Entry inputSpeed="1300.00" inputTorque="1450.00" torqueLoss="40.64"/> + <Entry inputSpeed="1300.00" inputTorque="1650.00" torqueLoss="44.64"/> + <Entry inputSpeed="1300.00" inputTorque="1850.00" torqueLoss="48.64"/> + <Entry inputSpeed="1300.00" inputTorque="2050.00" torqueLoss="52.64"/> + <Entry inputSpeed="1300.00" inputTorque="2250.00" torqueLoss="56.64"/> + <Entry inputSpeed="1300.00" inputTorque="3000.00" torqueLoss="60.64"/> + <Entry inputSpeed="1500.00" inputTorque="-350.00" torqueLoss="19.65"/> + <Entry inputSpeed="1500.00" inputTorque="-150.00" torqueLoss="15.65"/> + <Entry inputSpeed="1500.00" inputTorque="50.00" torqueLoss="13.65"/> + <Entry inputSpeed="1500.00" inputTorque="250.00" torqueLoss="17.65"/> + <Entry inputSpeed="1500.00" inputTorque="450.00" torqueLoss="21.65"/> + <Entry inputSpeed="1500.00" inputTorque="650.00" torqueLoss="25.65"/> + <Entry inputSpeed="1500.00" inputTorque="850.00" torqueLoss="29.65"/> + <Entry inputSpeed="1500.00" inputTorque="1050.00" torqueLoss="33.65"/> + <Entry inputSpeed="1500.00" inputTorque="1250.00" torqueLoss="37.65"/> + <Entry inputSpeed="1500.00" inputTorque="1450.00" torqueLoss="41.65"/> + <Entry inputSpeed="1500.00" inputTorque="1650.00" torqueLoss="45.65"/> + <Entry inputSpeed="1500.00" inputTorque="1850.00" torqueLoss="49.65"/> + <Entry inputSpeed="1500.00" inputTorque="2050.00" torqueLoss="53.65"/> + <Entry inputSpeed="1500.00" inputTorque="2250.00" torqueLoss="57.65"/> + <Entry inputSpeed="1500.00" inputTorque="3000.00" torqueLoss="61.65"/> + <Entry inputSpeed="1700.00" inputTorque="-350.00" torqueLoss="20.66"/> + <Entry inputSpeed="1700.00" inputTorque="-150.00" torqueLoss="16.66"/> + <Entry inputSpeed="1700.00" inputTorque="50.00" torqueLoss="14.66"/> + <Entry inputSpeed="1700.00" inputTorque="250.00" torqueLoss="18.66"/> + <Entry inputSpeed="1700.00" inputTorque="450.00" torqueLoss="22.66"/> + <Entry inputSpeed="1700.00" inputTorque="650.00" torqueLoss="26.66"/> + <Entry inputSpeed="1700.00" inputTorque="850.00" torqueLoss="30.66"/> + <Entry inputSpeed="1700.00" inputTorque="1050.00" torqueLoss="34.66"/> + <Entry inputSpeed="1700.00" inputTorque="1250.00" torqueLoss="38.66"/> + <Entry inputSpeed="1700.00" inputTorque="1450.00" torqueLoss="42.66"/> + <Entry inputSpeed="1700.00" inputTorque="1650.00" torqueLoss="46.66"/> + <Entry inputSpeed="1700.00" inputTorque="1850.00" torqueLoss="50.66"/> + <Entry inputSpeed="1700.00" inputTorque="2050.00" torqueLoss="54.66"/> + <Entry inputSpeed="1700.00" inputTorque="2250.00" torqueLoss="58.66"/> + <Entry inputSpeed="1700.00" inputTorque="3000.00" torqueLoss="62.66"/> + <Entry inputSpeed="1900.00" inputTorque="-350.00" torqueLoss="21.67"/> + <Entry inputSpeed="1900.00" inputTorque="-150.00" torqueLoss="17.67"/> + <Entry inputSpeed="1900.00" inputTorque="50.00" torqueLoss="15.67"/> + <Entry inputSpeed="1900.00" inputTorque="250.00" torqueLoss="19.67"/> + <Entry inputSpeed="1900.00" inputTorque="450.00" torqueLoss="23.67"/> + <Entry inputSpeed="1900.00" inputTorque="650.00" torqueLoss="27.67"/> + <Entry inputSpeed="1900.00" inputTorque="850.00" torqueLoss="31.67"/> + <Entry inputSpeed="1900.00" inputTorque="1050.00" torqueLoss="35.67"/> + <Entry inputSpeed="1900.00" inputTorque="1250.00" torqueLoss="39.67"/> + <Entry inputSpeed="1900.00" inputTorque="1450.00" torqueLoss="43.67"/> + <Entry inputSpeed="1900.00" inputTorque="1650.00" torqueLoss="47.67"/> + <Entry inputSpeed="1900.00" inputTorque="1850.00" torqueLoss="51.67"/> + <Entry inputSpeed="1900.00" inputTorque="2050.00" torqueLoss="55.67"/> + <Entry inputSpeed="1900.00" inputTorque="2250.00" torqueLoss="59.67"/> + <Entry inputSpeed="1900.00" inputTorque="3000.00" torqueLoss="63.67"/> + <Entry inputSpeed="2100.00" inputTorque="-350.00" torqueLoss="22.69"/> + <Entry inputSpeed="2100.00" inputTorque="-150.00" torqueLoss="18.69"/> + <Entry inputSpeed="2100.00" inputTorque="50.00" torqueLoss="16.69"/> + <Entry inputSpeed="2100.00" inputTorque="250.00" torqueLoss="20.69"/> + <Entry inputSpeed="2100.00" inputTorque="450.00" torqueLoss="24.69"/> + <Entry inputSpeed="2100.00" inputTorque="650.00" torqueLoss="28.69"/> + <Entry inputSpeed="2100.00" inputTorque="850.00" torqueLoss="32.69"/> + <Entry inputSpeed="2100.00" inputTorque="1050.00" torqueLoss="36.69"/> + <Entry inputSpeed="2100.00" inputTorque="1250.00" torqueLoss="40.69"/> + <Entry inputSpeed="2100.00" inputTorque="1450.00" torqueLoss="44.69"/> + <Entry inputSpeed="2100.00" inputTorque="1650.00" torqueLoss="48.69"/> + <Entry inputSpeed="2100.00" inputTorque="1850.00" torqueLoss="52.69"/> + <Entry inputSpeed="2100.00" inputTorque="2050.00" torqueLoss="56.69"/> + <Entry inputSpeed="2100.00" inputTorque="2250.00" torqueLoss="60.69"/> + <Entry inputSpeed="2100.00" inputTorque="3000.00" torqueLoss="64.69"/> + <Entry inputSpeed="0.00" inputTorque="-1000.00" torqueLoss="25.06"/> + <Entry inputSpeed="100.00" inputTorque="-1000.00" torqueLoss="25.56"/> + <Entry inputSpeed="300.00" inputTorque="-1000.00" torqueLoss="26.58"/> + <Entry inputSpeed="500.00" inputTorque="-1000.00" torqueLoss="27.59"/> + <Entry inputSpeed="700.00" inputTorque="-1000.00" torqueLoss="28.60"/> + <Entry inputSpeed="900.00" inputTorque="-1000.00" torqueLoss="29.61"/> + <Entry inputSpeed="1100.00" inputTorque="-1000.00" torqueLoss="30.63"/> + <Entry inputSpeed="1300.00" inputTorque="-1000.00" torqueLoss="31.64"/> + <Entry inputSpeed="1500.00" inputTorque="-1000.00" torqueLoss="32.65"/> + <Entry inputSpeed="1700.00" inputTorque="-1000.00" torqueLoss="33.66"/> + <Entry inputSpeed="1900.00" inputTorque="-1000.00" torqueLoss="34.67"/> + <Entry inputSpeed="2100.00" inputTorque="-1000.00" torqueLoss="35.69"/> + </TorqueLossMap> + </Gear> + <Gear number="3"> + <Ratio>9.020</Ratio> + <MaxSpeed>2000</MaxSpeed> + <TorqueLossMap> + <Entry inputSpeed="0.00" inputTorque="-350.00" torqueLoss="12.06"/> + <Entry inputSpeed="0.00" inputTorque="-150.00" torqueLoss="8.06"/> + <Entry inputSpeed="0.00" inputTorque="50.00" torqueLoss="6.06"/> + <Entry inputSpeed="0.00" inputTorque="250.00" torqueLoss="10.06"/> + <Entry inputSpeed="0.00" inputTorque="450.00" torqueLoss="14.06"/> + <Entry inputSpeed="0.00" inputTorque="650.00" torqueLoss="18.06"/> + <Entry inputSpeed="0.00" inputTorque="850.00" torqueLoss="22.06"/> + <Entry inputSpeed="0.00" inputTorque="1050.00" torqueLoss="26.06"/> + <Entry inputSpeed="0.00" inputTorque="1250.00" torqueLoss="30.06"/> + <Entry inputSpeed="0.00" inputTorque="1450.00" torqueLoss="34.06"/> + <Entry inputSpeed="0.00" inputTorque="1650.00" torqueLoss="38.06"/> + <Entry inputSpeed="0.00" inputTorque="1850.00" torqueLoss="42.06"/> + <Entry inputSpeed="0.00" inputTorque="2050.00" torqueLoss="46.06"/> + <Entry inputSpeed="0.00" inputTorque="2250.00" torqueLoss="50.06"/> + <Entry inputSpeed="0.00" inputTorque="3000.00" torqueLoss="54.06"/> + <Entry inputSpeed="100.00" inputTorque="-350.00" torqueLoss="12.56"/> + <Entry inputSpeed="100.00" inputTorque="-150.00" torqueLoss="8.56"/> + <Entry inputSpeed="100.00" inputTorque="50.00" torqueLoss="6.56"/> + <Entry inputSpeed="100.00" inputTorque="250.00" torqueLoss="10.56"/> + <Entry inputSpeed="100.00" inputTorque="450.00" torqueLoss="14.56"/> + <Entry inputSpeed="100.00" inputTorque="650.00" torqueLoss="18.56"/> + <Entry inputSpeed="100.00" inputTorque="850.00" torqueLoss="22.56"/> + <Entry inputSpeed="100.00" inputTorque="1050.00" torqueLoss="26.56"/> + <Entry inputSpeed="100.00" inputTorque="1250.00" torqueLoss="30.56"/> + <Entry inputSpeed="100.00" inputTorque="1450.00" torqueLoss="34.56"/> + <Entry inputSpeed="100.00" inputTorque="1650.00" torqueLoss="38.56"/> + <Entry inputSpeed="100.00" inputTorque="1850.00" torqueLoss="42.56"/> + <Entry inputSpeed="100.00" inputTorque="2050.00" torqueLoss="46.56"/> + <Entry inputSpeed="100.00" inputTorque="2250.00" torqueLoss="50.56"/> + <Entry inputSpeed="100.00" inputTorque="3000.00" torqueLoss="54.56"/> + <Entry inputSpeed="300.00" inputTorque="-350.00" torqueLoss="13.58"/> + <Entry inputSpeed="300.00" inputTorque="-150.00" torqueLoss="9.58"/> + <Entry inputSpeed="300.00" inputTorque="50.00" torqueLoss="7.58"/> + <Entry inputSpeed="300.00" inputTorque="250.00" torqueLoss="11.58"/> + <Entry inputSpeed="300.00" inputTorque="450.00" torqueLoss="15.58"/> + <Entry inputSpeed="300.00" inputTorque="650.00" torqueLoss="19.58"/> + <Entry inputSpeed="300.00" inputTorque="850.00" torqueLoss="23.58"/> + <Entry inputSpeed="300.00" inputTorque="1050.00" torqueLoss="27.58"/> + <Entry inputSpeed="300.00" inputTorque="1250.00" torqueLoss="31.58"/> + <Entry inputSpeed="300.00" inputTorque="1450.00" torqueLoss="35.58"/> + <Entry inputSpeed="300.00" inputTorque="1650.00" torqueLoss="39.58"/> + <Entry inputSpeed="300.00" inputTorque="1850.00" torqueLoss="43.58"/> + <Entry inputSpeed="300.00" inputTorque="2050.00" torqueLoss="47.58"/> + <Entry inputSpeed="300.00" inputTorque="2250.00" torqueLoss="51.58"/> + <Entry inputSpeed="300.00" inputTorque="3000.00" torqueLoss="55.58"/> + <Entry inputSpeed="500.00" inputTorque="-350.00" torqueLoss="14.59"/> + <Entry inputSpeed="500.00" inputTorque="-150.00" torqueLoss="10.59"/> + <Entry inputSpeed="500.00" inputTorque="50.00" torqueLoss="8.59"/> + <Entry inputSpeed="500.00" inputTorque="250.00" torqueLoss="12.59"/> + <Entry inputSpeed="500.00" inputTorque="450.00" torqueLoss="16.59"/> + <Entry inputSpeed="500.00" inputTorque="650.00" torqueLoss="20.59"/> + <Entry inputSpeed="500.00" inputTorque="850.00" torqueLoss="24.59"/> + <Entry inputSpeed="500.00" inputTorque="1050.00" torqueLoss="28.59"/> + <Entry inputSpeed="500.00" inputTorque="1250.00" torqueLoss="32.59"/> + <Entry inputSpeed="500.00" inputTorque="1450.00" torqueLoss="36.59"/> + <Entry inputSpeed="500.00" inputTorque="1650.00" torqueLoss="40.59"/> + <Entry inputSpeed="500.00" inputTorque="1850.00" torqueLoss="44.59"/> + <Entry inputSpeed="500.00" inputTorque="2050.00" torqueLoss="48.59"/> + <Entry inputSpeed="500.00" inputTorque="2250.00" torqueLoss="52.59"/> + <Entry inputSpeed="500.00" inputTorque="3000.00" torqueLoss="56.59"/> + <Entry inputSpeed="700.00" inputTorque="-350.00" torqueLoss="15.60"/> + <Entry inputSpeed="700.00" inputTorque="-150.00" torqueLoss="11.60"/> + <Entry inputSpeed="700.00" inputTorque="50.00" torqueLoss="9.60"/> + <Entry inputSpeed="700.00" inputTorque="250.00" torqueLoss="13.60"/> + <Entry inputSpeed="700.00" inputTorque="450.00" torqueLoss="17.60"/> + <Entry inputSpeed="700.00" inputTorque="650.00" torqueLoss="21.60"/> + <Entry inputSpeed="700.00" inputTorque="850.00" torqueLoss="25.60"/> + <Entry inputSpeed="700.00" inputTorque="1050.00" torqueLoss="29.60"/> + <Entry inputSpeed="700.00" inputTorque="1250.00" torqueLoss="33.60"/> + <Entry inputSpeed="700.00" inputTorque="1450.00" torqueLoss="37.60"/> + <Entry inputSpeed="700.00" inputTorque="1650.00" torqueLoss="41.60"/> + <Entry inputSpeed="700.00" inputTorque="1850.00" torqueLoss="45.60"/> + <Entry inputSpeed="700.00" inputTorque="2050.00" torqueLoss="49.60"/> + <Entry inputSpeed="700.00" inputTorque="2250.00" torqueLoss="53.60"/> + <Entry inputSpeed="700.00" inputTorque="3000.00" torqueLoss="57.60"/> + <Entry inputSpeed="900.00" inputTorque="-350.00" torqueLoss="16.61"/> + <Entry inputSpeed="900.00" inputTorque="-150.00" torqueLoss="12.61"/> + <Entry inputSpeed="900.00" inputTorque="50.00" torqueLoss="10.61"/> + <Entry inputSpeed="900.00" inputTorque="250.00" torqueLoss="14.61"/> + <Entry inputSpeed="900.00" inputTorque="450.00" torqueLoss="18.61"/> + <Entry inputSpeed="900.00" inputTorque="650.00" torqueLoss="22.61"/> + <Entry inputSpeed="900.00" inputTorque="850.00" torqueLoss="26.61"/> + <Entry inputSpeed="900.00" inputTorque="1050.00" torqueLoss="30.61"/> + <Entry inputSpeed="900.00" inputTorque="1250.00" torqueLoss="34.61"/> + <Entry inputSpeed="900.00" inputTorque="1450.00" torqueLoss="38.61"/> + <Entry inputSpeed="900.00" inputTorque="1650.00" torqueLoss="42.61"/> + <Entry inputSpeed="900.00" inputTorque="1850.00" torqueLoss="46.61"/> + <Entry inputSpeed="900.00" inputTorque="2050.00" torqueLoss="50.61"/> + <Entry inputSpeed="900.00" inputTorque="2250.00" torqueLoss="54.61"/> + <Entry inputSpeed="900.00" inputTorque="3000.00" torqueLoss="58.61"/> + <Entry inputSpeed="1100.00" inputTorque="-350.00" torqueLoss="17.63"/> + <Entry inputSpeed="1100.00" inputTorque="-150.00" torqueLoss="13.63"/> + <Entry inputSpeed="1100.00" inputTorque="50.00" torqueLoss="11.63"/> + <Entry inputSpeed="1100.00" inputTorque="250.00" torqueLoss="15.63"/> + <Entry inputSpeed="1100.00" inputTorque="450.00" torqueLoss="19.63"/> + <Entry inputSpeed="1100.00" inputTorque="650.00" torqueLoss="23.63"/> + <Entry inputSpeed="1100.00" inputTorque="850.00" torqueLoss="27.63"/> + <Entry inputSpeed="1100.00" inputTorque="1050.00" torqueLoss="31.63"/> + <Entry inputSpeed="1100.00" inputTorque="1250.00" torqueLoss="35.63"/> + <Entry inputSpeed="1100.00" inputTorque="1450.00" torqueLoss="39.63"/> + <Entry inputSpeed="1100.00" inputTorque="1650.00" torqueLoss="43.63"/> + <Entry inputSpeed="1100.00" inputTorque="1850.00" torqueLoss="47.63"/> + <Entry inputSpeed="1100.00" inputTorque="2050.00" torqueLoss="51.63"/> + <Entry inputSpeed="1100.00" inputTorque="2250.00" torqueLoss="55.63"/> + <Entry inputSpeed="1100.00" inputTorque="3000.00" torqueLoss="59.63"/> + <Entry inputSpeed="1300.00" inputTorque="-350.00" torqueLoss="18.64"/> + <Entry inputSpeed="1300.00" inputTorque="-150.00" torqueLoss="14.64"/> + <Entry inputSpeed="1300.00" inputTorque="50.00" torqueLoss="12.64"/> + <Entry inputSpeed="1300.00" inputTorque="250.00" torqueLoss="16.64"/> + <Entry inputSpeed="1300.00" inputTorque="450.00" torqueLoss="20.64"/> + <Entry inputSpeed="1300.00" inputTorque="650.00" torqueLoss="24.64"/> + <Entry inputSpeed="1300.00" inputTorque="850.00" torqueLoss="28.64"/> + <Entry inputSpeed="1300.00" inputTorque="1050.00" torqueLoss="32.64"/> + <Entry inputSpeed="1300.00" inputTorque="1250.00" torqueLoss="36.64"/> + <Entry inputSpeed="1300.00" inputTorque="1450.00" torqueLoss="40.64"/> + <Entry inputSpeed="1300.00" inputTorque="1650.00" torqueLoss="44.64"/> + <Entry inputSpeed="1300.00" inputTorque="1850.00" torqueLoss="48.64"/> + <Entry inputSpeed="1300.00" inputTorque="2050.00" torqueLoss="52.64"/> + <Entry inputSpeed="1300.00" inputTorque="2250.00" torqueLoss="56.64"/> + <Entry inputSpeed="1300.00" inputTorque="3000.00" torqueLoss="60.64"/> + <Entry inputSpeed="1500.00" inputTorque="-350.00" torqueLoss="19.65"/> + <Entry inputSpeed="1500.00" inputTorque="-150.00" torqueLoss="15.65"/> + <Entry inputSpeed="1500.00" inputTorque="50.00" torqueLoss="13.65"/> + <Entry inputSpeed="1500.00" inputTorque="250.00" torqueLoss="17.65"/> + <Entry inputSpeed="1500.00" inputTorque="450.00" torqueLoss="21.65"/> + <Entry inputSpeed="1500.00" inputTorque="650.00" torqueLoss="25.65"/> + <Entry inputSpeed="1500.00" inputTorque="850.00" torqueLoss="29.65"/> + <Entry inputSpeed="1500.00" inputTorque="1050.00" torqueLoss="33.65"/> + <Entry inputSpeed="1500.00" inputTorque="1250.00" torqueLoss="37.65"/> + <Entry inputSpeed="1500.00" inputTorque="1450.00" torqueLoss="41.65"/> + <Entry inputSpeed="1500.00" inputTorque="1650.00" torqueLoss="45.65"/> + <Entry inputSpeed="1500.00" inputTorque="1850.00" torqueLoss="49.65"/> + <Entry inputSpeed="1500.00" inputTorque="2050.00" torqueLoss="53.65"/> + <Entry inputSpeed="1500.00" inputTorque="2250.00" torqueLoss="57.65"/> + <Entry inputSpeed="1500.00" inputTorque="3000.00" torqueLoss="61.65"/> + <Entry inputSpeed="1700.00" inputTorque="-350.00" torqueLoss="20.66"/> + <Entry inputSpeed="1700.00" inputTorque="-150.00" torqueLoss="16.66"/> + <Entry inputSpeed="1700.00" inputTorque="50.00" torqueLoss="14.66"/> + <Entry inputSpeed="1700.00" inputTorque="250.00" torqueLoss="18.66"/> + <Entry inputSpeed="1700.00" inputTorque="450.00" torqueLoss="22.66"/> + <Entry inputSpeed="1700.00" inputTorque="650.00" torqueLoss="26.66"/> + <Entry inputSpeed="1700.00" inputTorque="850.00" torqueLoss="30.66"/> + <Entry inputSpeed="1700.00" inputTorque="1050.00" torqueLoss="34.66"/> + <Entry inputSpeed="1700.00" inputTorque="1250.00" torqueLoss="38.66"/> + <Entry inputSpeed="1700.00" inputTorque="1450.00" torqueLoss="42.66"/> + <Entry inputSpeed="1700.00" inputTorque="1650.00" torqueLoss="46.66"/> + <Entry inputSpeed="1700.00" inputTorque="1850.00" torqueLoss="50.66"/> + <Entry inputSpeed="1700.00" inputTorque="2050.00" torqueLoss="54.66"/> + <Entry inputSpeed="1700.00" inputTorque="2250.00" torqueLoss="58.66"/> + <Entry inputSpeed="1700.00" inputTorque="3000.00" torqueLoss="62.66"/> + <Entry inputSpeed="1900.00" inputTorque="-350.00" torqueLoss="21.67"/> + <Entry inputSpeed="1900.00" inputTorque="-150.00" torqueLoss="17.67"/> + <Entry inputSpeed="1900.00" inputTorque="50.00" torqueLoss="15.67"/> + <Entry inputSpeed="1900.00" inputTorque="250.00" torqueLoss="19.67"/> + <Entry inputSpeed="1900.00" inputTorque="450.00" torqueLoss="23.67"/> + <Entry inputSpeed="1900.00" inputTorque="650.00" torqueLoss="27.67"/> + <Entry inputSpeed="1900.00" inputTorque="850.00" torqueLoss="31.67"/> + <Entry inputSpeed="1900.00" inputTorque="1050.00" torqueLoss="35.67"/> + <Entry inputSpeed="1900.00" inputTorque="1250.00" torqueLoss="39.67"/> + <Entry inputSpeed="1900.00" inputTorque="1450.00" torqueLoss="43.67"/> + <Entry inputSpeed="1900.00" inputTorque="1650.00" torqueLoss="47.67"/> + <Entry inputSpeed="1900.00" inputTorque="1850.00" torqueLoss="51.67"/> + <Entry inputSpeed="1900.00" inputTorque="2050.00" torqueLoss="55.67"/> + <Entry inputSpeed="1900.00" inputTorque="2250.00" torqueLoss="59.67"/> + <Entry inputSpeed="1900.00" inputTorque="3000.00" torqueLoss="63.67"/> + <Entry inputSpeed="2100.00" inputTorque="-350.00" torqueLoss="22.69"/> + <Entry inputSpeed="2100.00" inputTorque="-150.00" torqueLoss="18.69"/> + <Entry inputSpeed="2100.00" inputTorque="50.00" torqueLoss="16.69"/> + <Entry inputSpeed="2100.00" inputTorque="250.00" torqueLoss="20.69"/> + <Entry inputSpeed="2100.00" inputTorque="450.00" torqueLoss="24.69"/> + <Entry inputSpeed="2100.00" inputTorque="650.00" torqueLoss="28.69"/> + <Entry inputSpeed="2100.00" inputTorque="850.00" torqueLoss="32.69"/> + <Entry inputSpeed="2100.00" inputTorque="1050.00" torqueLoss="36.69"/> + <Entry inputSpeed="2100.00" inputTorque="1250.00" torqueLoss="40.69"/> + <Entry inputSpeed="2100.00" inputTorque="1450.00" torqueLoss="44.69"/> + <Entry inputSpeed="2100.00" inputTorque="1650.00" torqueLoss="48.69"/> + <Entry inputSpeed="2100.00" inputTorque="1850.00" torqueLoss="52.69"/> + <Entry inputSpeed="2100.00" inputTorque="2050.00" torqueLoss="56.69"/> + <Entry inputSpeed="2100.00" inputTorque="2250.00" torqueLoss="60.69"/> + <Entry inputSpeed="2100.00" inputTorque="3000.00" torqueLoss="64.69"/> + <Entry inputSpeed="0.00" inputTorque="-1000.00" torqueLoss="25.06"/> + <Entry inputSpeed="100.00" inputTorque="-1000.00" torqueLoss="25.56"/> + <Entry inputSpeed="300.00" inputTorque="-1000.00" torqueLoss="26.58"/> + <Entry inputSpeed="500.00" inputTorque="-1000.00" torqueLoss="27.59"/> + <Entry inputSpeed="700.00" inputTorque="-1000.00" torqueLoss="28.60"/> + <Entry inputSpeed="900.00" inputTorque="-1000.00" torqueLoss="29.61"/> + <Entry inputSpeed="1100.00" inputTorque="-1000.00" torqueLoss="30.63"/> + <Entry inputSpeed="1300.00" inputTorque="-1000.00" torqueLoss="31.64"/> + <Entry inputSpeed="1500.00" inputTorque="-1000.00" torqueLoss="32.65"/> + <Entry inputSpeed="1700.00" inputTorque="-1000.00" torqueLoss="33.66"/> + <Entry inputSpeed="1900.00" inputTorque="-1000.00" torqueLoss="34.67"/> + <Entry inputSpeed="2100.00" inputTorque="-1000.00" torqueLoss="35.69"/> + </TorqueLossMap> + </Gear> + <Gear number="4"> + <Ratio>7.040</Ratio> + <MaxSpeed>2000</MaxSpeed> + <TorqueLossMap> + <Entry inputSpeed="0.00" inputTorque="-350.00" torqueLoss="12.06"/> + <Entry inputSpeed="0.00" inputTorque="-150.00" torqueLoss="8.06"/> + <Entry inputSpeed="0.00" inputTorque="50.00" torqueLoss="6.06"/> + <Entry inputSpeed="0.00" inputTorque="250.00" torqueLoss="10.06"/> + <Entry inputSpeed="0.00" inputTorque="450.00" torqueLoss="14.06"/> + <Entry inputSpeed="0.00" inputTorque="650.00" torqueLoss="18.06"/> + <Entry inputSpeed="0.00" inputTorque="850.00" torqueLoss="22.06"/> + <Entry inputSpeed="0.00" inputTorque="1050.00" torqueLoss="26.06"/> + <Entry inputSpeed="0.00" inputTorque="1250.00" torqueLoss="30.06"/> + <Entry inputSpeed="0.00" inputTorque="1450.00" torqueLoss="34.06"/> + <Entry inputSpeed="0.00" inputTorque="1650.00" torqueLoss="38.06"/> + <Entry inputSpeed="0.00" inputTorque="1850.00" torqueLoss="42.06"/> + <Entry inputSpeed="0.00" inputTorque="2050.00" torqueLoss="46.06"/> + <Entry inputSpeed="0.00" inputTorque="2250.00" torqueLoss="50.06"/> + <Entry inputSpeed="0.00" inputTorque="3000.00" torqueLoss="54.06"/> + <Entry inputSpeed="100.00" inputTorque="-350.00" torqueLoss="12.56"/> + <Entry inputSpeed="100.00" inputTorque="-150.00" torqueLoss="8.56"/> + <Entry inputSpeed="100.00" inputTorque="50.00" torqueLoss="6.56"/> + <Entry inputSpeed="100.00" inputTorque="250.00" torqueLoss="10.56"/> + <Entry inputSpeed="100.00" inputTorque="450.00" torqueLoss="14.56"/> + <Entry inputSpeed="100.00" inputTorque="650.00" torqueLoss="18.56"/> + <Entry inputSpeed="100.00" inputTorque="850.00" torqueLoss="22.56"/> + <Entry inputSpeed="100.00" inputTorque="1050.00" torqueLoss="26.56"/> + <Entry inputSpeed="100.00" inputTorque="1250.00" torqueLoss="30.56"/> + <Entry inputSpeed="100.00" inputTorque="1450.00" torqueLoss="34.56"/> + <Entry inputSpeed="100.00" inputTorque="1650.00" torqueLoss="38.56"/> + <Entry inputSpeed="100.00" inputTorque="1850.00" torqueLoss="42.56"/> + <Entry inputSpeed="100.00" inputTorque="2050.00" torqueLoss="46.56"/> + <Entry inputSpeed="100.00" inputTorque="2250.00" torqueLoss="50.56"/> + <Entry inputSpeed="100.00" inputTorque="3000.00" torqueLoss="54.56"/> + <Entry inputSpeed="300.00" inputTorque="-350.00" torqueLoss="13.58"/> + <Entry inputSpeed="300.00" inputTorque="-150.00" torqueLoss="9.58"/> + <Entry inputSpeed="300.00" inputTorque="50.00" torqueLoss="7.58"/> + <Entry inputSpeed="300.00" inputTorque="250.00" torqueLoss="11.58"/> + <Entry inputSpeed="300.00" inputTorque="450.00" torqueLoss="15.58"/> + <Entry inputSpeed="300.00" inputTorque="650.00" torqueLoss="19.58"/> + <Entry inputSpeed="300.00" inputTorque="850.00" torqueLoss="23.58"/> + <Entry inputSpeed="300.00" inputTorque="1050.00" torqueLoss="27.58"/> + <Entry inputSpeed="300.00" inputTorque="1250.00" torqueLoss="31.58"/> + <Entry inputSpeed="300.00" inputTorque="1450.00" torqueLoss="35.58"/> + <Entry inputSpeed="300.00" inputTorque="1650.00" torqueLoss="39.58"/> + <Entry inputSpeed="300.00" inputTorque="1850.00" torqueLoss="43.58"/> + <Entry inputSpeed="300.00" inputTorque="2050.00" torqueLoss="47.58"/> + <Entry inputSpeed="300.00" inputTorque="2250.00" torqueLoss="51.58"/> + <Entry inputSpeed="300.00" inputTorque="3000.00" torqueLoss="55.58"/> + <Entry inputSpeed="500.00" inputTorque="-350.00" torqueLoss="14.59"/> + <Entry inputSpeed="500.00" inputTorque="-150.00" torqueLoss="10.59"/> + <Entry inputSpeed="500.00" inputTorque="50.00" torqueLoss="8.59"/> + <Entry inputSpeed="500.00" inputTorque="250.00" torqueLoss="12.59"/> + <Entry inputSpeed="500.00" inputTorque="450.00" torqueLoss="16.59"/> + <Entry inputSpeed="500.00" inputTorque="650.00" torqueLoss="20.59"/> + <Entry inputSpeed="500.00" inputTorque="850.00" torqueLoss="24.59"/> + <Entry inputSpeed="500.00" inputTorque="1050.00" torqueLoss="28.59"/> + <Entry inputSpeed="500.00" inputTorque="1250.00" torqueLoss="32.59"/> + <Entry inputSpeed="500.00" inputTorque="1450.00" torqueLoss="36.59"/> + <Entry inputSpeed="500.00" inputTorque="1650.00" torqueLoss="40.59"/> + <Entry inputSpeed="500.00" inputTorque="1850.00" torqueLoss="44.59"/> + <Entry inputSpeed="500.00" inputTorque="2050.00" torqueLoss="48.59"/> + <Entry inputSpeed="500.00" inputTorque="2250.00" torqueLoss="52.59"/> + <Entry inputSpeed="500.00" inputTorque="3000.00" torqueLoss="56.59"/> + <Entry inputSpeed="700.00" inputTorque="-350.00" torqueLoss="15.60"/> + <Entry inputSpeed="700.00" inputTorque="-150.00" torqueLoss="11.60"/> + <Entry inputSpeed="700.00" inputTorque="50.00" torqueLoss="9.60"/> + <Entry inputSpeed="700.00" inputTorque="250.00" torqueLoss="13.60"/> + <Entry inputSpeed="700.00" inputTorque="450.00" torqueLoss="17.60"/> + <Entry inputSpeed="700.00" inputTorque="650.00" torqueLoss="21.60"/> + <Entry inputSpeed="700.00" inputTorque="850.00" torqueLoss="25.60"/> + <Entry inputSpeed="700.00" inputTorque="1050.00" torqueLoss="29.60"/> + <Entry inputSpeed="700.00" inputTorque="1250.00" torqueLoss="33.60"/> + <Entry inputSpeed="700.00" inputTorque="1450.00" torqueLoss="37.60"/> + <Entry inputSpeed="700.00" inputTorque="1650.00" torqueLoss="41.60"/> + <Entry inputSpeed="700.00" inputTorque="1850.00" torqueLoss="45.60"/> + <Entry inputSpeed="700.00" inputTorque="2050.00" torqueLoss="49.60"/> + <Entry inputSpeed="700.00" inputTorque="2250.00" torqueLoss="53.60"/> + <Entry inputSpeed="700.00" inputTorque="3000.00" torqueLoss="57.60"/> + <Entry inputSpeed="900.00" inputTorque="-350.00" torqueLoss="16.61"/> + <Entry inputSpeed="900.00" inputTorque="-150.00" torqueLoss="12.61"/> + <Entry inputSpeed="900.00" inputTorque="50.00" torqueLoss="10.61"/> + <Entry inputSpeed="900.00" inputTorque="250.00" torqueLoss="14.61"/> + <Entry inputSpeed="900.00" inputTorque="450.00" torqueLoss="18.61"/> + <Entry inputSpeed="900.00" inputTorque="650.00" torqueLoss="22.61"/> + <Entry inputSpeed="900.00" inputTorque="850.00" torqueLoss="26.61"/> + <Entry inputSpeed="900.00" inputTorque="1050.00" torqueLoss="30.61"/> + <Entry inputSpeed="900.00" inputTorque="1250.00" torqueLoss="34.61"/> + <Entry inputSpeed="900.00" inputTorque="1450.00" torqueLoss="38.61"/> + <Entry inputSpeed="900.00" inputTorque="1650.00" torqueLoss="42.61"/> + <Entry inputSpeed="900.00" inputTorque="1850.00" torqueLoss="46.61"/> + <Entry inputSpeed="900.00" inputTorque="2050.00" torqueLoss="50.61"/> + <Entry inputSpeed="900.00" inputTorque="2250.00" torqueLoss="54.61"/> + <Entry inputSpeed="900.00" inputTorque="3000.00" torqueLoss="58.61"/> + <Entry inputSpeed="1100.00" inputTorque="-350.00" torqueLoss="17.63"/> + <Entry inputSpeed="1100.00" inputTorque="-150.00" torqueLoss="13.63"/> + <Entry inputSpeed="1100.00" inputTorque="50.00" torqueLoss="11.63"/> + <Entry inputSpeed="1100.00" inputTorque="250.00" torqueLoss="15.63"/> + <Entry inputSpeed="1100.00" inputTorque="450.00" torqueLoss="19.63"/> + <Entry inputSpeed="1100.00" inputTorque="650.00" torqueLoss="23.63"/> + <Entry inputSpeed="1100.00" inputTorque="850.00" torqueLoss="27.63"/> + <Entry inputSpeed="1100.00" inputTorque="1050.00" torqueLoss="31.63"/> + <Entry inputSpeed="1100.00" inputTorque="1250.00" torqueLoss="35.63"/> + <Entry inputSpeed="1100.00" inputTorque="1450.00" torqueLoss="39.63"/> + <Entry inputSpeed="1100.00" inputTorque="1650.00" torqueLoss="43.63"/> + <Entry inputSpeed="1100.00" inputTorque="1850.00" torqueLoss="47.63"/> + <Entry inputSpeed="1100.00" inputTorque="2050.00" torqueLoss="51.63"/> + <Entry inputSpeed="1100.00" inputTorque="2250.00" torqueLoss="55.63"/> + <Entry inputSpeed="1100.00" inputTorque="3000.00" torqueLoss="59.63"/> + <Entry inputSpeed="1300.00" inputTorque="-350.00" torqueLoss="18.64"/> + <Entry inputSpeed="1300.00" inputTorque="-150.00" torqueLoss="14.64"/> + <Entry inputSpeed="1300.00" inputTorque="50.00" torqueLoss="12.64"/> + <Entry inputSpeed="1300.00" inputTorque="250.00" torqueLoss="16.64"/> + <Entry inputSpeed="1300.00" inputTorque="450.00" torqueLoss="20.64"/> + <Entry inputSpeed="1300.00" inputTorque="650.00" torqueLoss="24.64"/> + <Entry inputSpeed="1300.00" inputTorque="850.00" torqueLoss="28.64"/> + <Entry inputSpeed="1300.00" inputTorque="1050.00" torqueLoss="32.64"/> + <Entry inputSpeed="1300.00" inputTorque="1250.00" torqueLoss="36.64"/> + <Entry inputSpeed="1300.00" inputTorque="1450.00" torqueLoss="40.64"/> + <Entry inputSpeed="1300.00" inputTorque="1650.00" torqueLoss="44.64"/> + <Entry inputSpeed="1300.00" inputTorque="1850.00" torqueLoss="48.64"/> + <Entry inputSpeed="1300.00" inputTorque="2050.00" torqueLoss="52.64"/> + <Entry inputSpeed="1300.00" inputTorque="2250.00" torqueLoss="56.64"/> + <Entry inputSpeed="1300.00" inputTorque="3000.00" torqueLoss="60.64"/> + <Entry inputSpeed="1500.00" inputTorque="-350.00" torqueLoss="19.65"/> + <Entry inputSpeed="1500.00" inputTorque="-150.00" torqueLoss="15.65"/> + <Entry inputSpeed="1500.00" inputTorque="50.00" torqueLoss="13.65"/> + <Entry inputSpeed="1500.00" inputTorque="250.00" torqueLoss="17.65"/> + <Entry inputSpeed="1500.00" inputTorque="450.00" torqueLoss="21.65"/> + <Entry inputSpeed="1500.00" inputTorque="650.00" torqueLoss="25.65"/> + <Entry inputSpeed="1500.00" inputTorque="850.00" torqueLoss="29.65"/> + <Entry inputSpeed="1500.00" inputTorque="1050.00" torqueLoss="33.65"/> + <Entry inputSpeed="1500.00" inputTorque="1250.00" torqueLoss="37.65"/> + <Entry inputSpeed="1500.00" inputTorque="1450.00" torqueLoss="41.65"/> + <Entry inputSpeed="1500.00" inputTorque="1650.00" torqueLoss="45.65"/> + <Entry inputSpeed="1500.00" inputTorque="1850.00" torqueLoss="49.65"/> + <Entry inputSpeed="1500.00" inputTorque="2050.00" torqueLoss="53.65"/> + <Entry inputSpeed="1500.00" inputTorque="2250.00" torqueLoss="57.65"/> + <Entry inputSpeed="1500.00" inputTorque="3000.00" torqueLoss="61.65"/> + <Entry inputSpeed="1700.00" inputTorque="-350.00" torqueLoss="20.66"/> + <Entry inputSpeed="1700.00" inputTorque="-150.00" torqueLoss="16.66"/> + <Entry inputSpeed="1700.00" inputTorque="50.00" torqueLoss="14.66"/> + <Entry inputSpeed="1700.00" inputTorque="250.00" torqueLoss="18.66"/> + <Entry inputSpeed="1700.00" inputTorque="450.00" torqueLoss="22.66"/> + <Entry inputSpeed="1700.00" inputTorque="650.00" torqueLoss="26.66"/> + <Entry inputSpeed="1700.00" inputTorque="850.00" torqueLoss="30.66"/> + <Entry inputSpeed="1700.00" inputTorque="1050.00" torqueLoss="34.66"/> + <Entry inputSpeed="1700.00" inputTorque="1250.00" torqueLoss="38.66"/> + <Entry inputSpeed="1700.00" inputTorque="1450.00" torqueLoss="42.66"/> + <Entry inputSpeed="1700.00" inputTorque="1650.00" torqueLoss="46.66"/> + <Entry inputSpeed="1700.00" inputTorque="1850.00" torqueLoss="50.66"/> + <Entry inputSpeed="1700.00" inputTorque="2050.00" torqueLoss="54.66"/> + <Entry inputSpeed="1700.00" inputTorque="2250.00" torqueLoss="58.66"/> + <Entry inputSpeed="1700.00" inputTorque="3000.00" torqueLoss="62.66"/> + <Entry inputSpeed="1900.00" inputTorque="-350.00" torqueLoss="21.67"/> + <Entry inputSpeed="1900.00" inputTorque="-150.00" torqueLoss="17.67"/> + <Entry inputSpeed="1900.00" inputTorque="50.00" torqueLoss="15.67"/> + <Entry inputSpeed="1900.00" inputTorque="250.00" torqueLoss="19.67"/> + <Entry inputSpeed="1900.00" inputTorque="450.00" torqueLoss="23.67"/> + <Entry inputSpeed="1900.00" inputTorque="650.00" torqueLoss="27.67"/> + <Entry inputSpeed="1900.00" inputTorque="850.00" torqueLoss="31.67"/> + <Entry inputSpeed="1900.00" inputTorque="1050.00" torqueLoss="35.67"/> + <Entry inputSpeed="1900.00" inputTorque="1250.00" torqueLoss="39.67"/> + <Entry inputSpeed="1900.00" inputTorque="1450.00" torqueLoss="43.67"/> + <Entry inputSpeed="1900.00" inputTorque="1650.00" torqueLoss="47.67"/> + <Entry inputSpeed="1900.00" inputTorque="1850.00" torqueLoss="51.67"/> + <Entry inputSpeed="1900.00" inputTorque="2050.00" torqueLoss="55.67"/> + <Entry inputSpeed="1900.00" inputTorque="2250.00" torqueLoss="59.67"/> + <Entry inputSpeed="1900.00" inputTorque="3000.00" torqueLoss="63.67"/> + <Entry inputSpeed="2100.00" inputTorque="-350.00" torqueLoss="22.69"/> + <Entry inputSpeed="2100.00" inputTorque="-150.00" torqueLoss="18.69"/> + <Entry inputSpeed="2100.00" inputTorque="50.00" torqueLoss="16.69"/> + <Entry inputSpeed="2100.00" inputTorque="250.00" torqueLoss="20.69"/> + <Entry inputSpeed="2100.00" inputTorque="450.00" torqueLoss="24.69"/> + <Entry inputSpeed="2100.00" inputTorque="650.00" torqueLoss="28.69"/> + <Entry inputSpeed="2100.00" inputTorque="850.00" torqueLoss="32.69"/> + <Entry inputSpeed="2100.00" inputTorque="1050.00" torqueLoss="36.69"/> + <Entry inputSpeed="2100.00" inputTorque="1250.00" torqueLoss="40.69"/> + <Entry inputSpeed="2100.00" inputTorque="1450.00" torqueLoss="44.69"/> + <Entry inputSpeed="2100.00" inputTorque="1650.00" torqueLoss="48.69"/> + <Entry inputSpeed="2100.00" inputTorque="1850.00" torqueLoss="52.69"/> + <Entry inputSpeed="2100.00" inputTorque="2050.00" torqueLoss="56.69"/> + <Entry inputSpeed="2100.00" inputTorque="2250.00" torqueLoss="60.69"/> + <Entry inputSpeed="2100.00" inputTorque="3000.00" torqueLoss="64.69"/> + <Entry inputSpeed="0.00" inputTorque="-1000.00" torqueLoss="25.06"/> + <Entry inputSpeed="100.00" inputTorque="-1000.00" torqueLoss="25.56"/> + <Entry inputSpeed="300.00" inputTorque="-1000.00" torqueLoss="26.58"/> + <Entry inputSpeed="500.00" inputTorque="-1000.00" torqueLoss="27.59"/> + <Entry inputSpeed="700.00" inputTorque="-1000.00" torqueLoss="28.60"/> + <Entry inputSpeed="900.00" inputTorque="-1000.00" torqueLoss="29.61"/> + <Entry inputSpeed="1100.00" inputTorque="-1000.00" torqueLoss="30.63"/> + <Entry inputSpeed="1300.00" inputTorque="-1000.00" torqueLoss="31.64"/> + <Entry inputSpeed="1500.00" inputTorque="-1000.00" torqueLoss="32.65"/> + <Entry inputSpeed="1700.00" inputTorque="-1000.00" torqueLoss="33.66"/> + <Entry inputSpeed="1900.00" inputTorque="-1000.00" torqueLoss="34.67"/> + <Entry inputSpeed="2100.00" inputTorque="-1000.00" torqueLoss="35.69"/> + </TorqueLossMap> + </Gear> + <Gear number="5"> + <Ratio>5.640</Ratio> + <MaxSpeed>2000</MaxSpeed> + <TorqueLossMap> + <Entry inputSpeed="0.00" inputTorque="-350.00" torqueLoss="12.06"/> + <Entry inputSpeed="0.00" inputTorque="-150.00" torqueLoss="8.06"/> + <Entry inputSpeed="0.00" inputTorque="50.00" torqueLoss="6.06"/> + <Entry inputSpeed="0.00" inputTorque="250.00" torqueLoss="10.06"/> + <Entry inputSpeed="0.00" inputTorque="450.00" torqueLoss="14.06"/> + <Entry inputSpeed="0.00" inputTorque="650.00" torqueLoss="18.06"/> + <Entry inputSpeed="0.00" inputTorque="850.00" torqueLoss="22.06"/> + <Entry inputSpeed="0.00" inputTorque="1050.00" torqueLoss="26.06"/> + <Entry inputSpeed="0.00" inputTorque="1250.00" torqueLoss="30.06"/> + <Entry inputSpeed="0.00" inputTorque="1450.00" torqueLoss="34.06"/> + <Entry inputSpeed="0.00" inputTorque="1650.00" torqueLoss="38.06"/> + <Entry inputSpeed="0.00" inputTorque="1850.00" torqueLoss="42.06"/> + <Entry inputSpeed="0.00" inputTorque="2050.00" torqueLoss="46.06"/> + <Entry inputSpeed="0.00" inputTorque="2250.00" torqueLoss="50.06"/> + <Entry inputSpeed="0.00" inputTorque="3000.00" torqueLoss="54.06"/> + <Entry inputSpeed="100.00" inputTorque="-350.00" torqueLoss="12.56"/> + <Entry inputSpeed="100.00" inputTorque="-150.00" torqueLoss="8.56"/> + <Entry inputSpeed="100.00" inputTorque="50.00" torqueLoss="6.56"/> + <Entry inputSpeed="100.00" inputTorque="250.00" torqueLoss="10.56"/> + <Entry inputSpeed="100.00" inputTorque="450.00" torqueLoss="14.56"/> + <Entry inputSpeed="100.00" inputTorque="650.00" torqueLoss="18.56"/> + <Entry inputSpeed="100.00" inputTorque="850.00" torqueLoss="22.56"/> + <Entry inputSpeed="100.00" inputTorque="1050.00" torqueLoss="26.56"/> + <Entry inputSpeed="100.00" inputTorque="1250.00" torqueLoss="30.56"/> + <Entry inputSpeed="100.00" inputTorque="1450.00" torqueLoss="34.56"/> + <Entry inputSpeed="100.00" inputTorque="1650.00" torqueLoss="38.56"/> + <Entry inputSpeed="100.00" inputTorque="1850.00" torqueLoss="42.56"/> + <Entry inputSpeed="100.00" inputTorque="2050.00" torqueLoss="46.56"/> + <Entry inputSpeed="100.00" inputTorque="2250.00" torqueLoss="50.56"/> + <Entry inputSpeed="100.00" inputTorque="3000.00" torqueLoss="54.56"/> + <Entry inputSpeed="300.00" inputTorque="-350.00" torqueLoss="13.58"/> + <Entry inputSpeed="300.00" inputTorque="-150.00" torqueLoss="9.58"/> + <Entry inputSpeed="300.00" inputTorque="50.00" torqueLoss="7.58"/> + <Entry inputSpeed="300.00" inputTorque="250.00" torqueLoss="11.58"/> + <Entry inputSpeed="300.00" inputTorque="450.00" torqueLoss="15.58"/> + <Entry inputSpeed="300.00" inputTorque="650.00" torqueLoss="19.58"/> + <Entry inputSpeed="300.00" inputTorque="850.00" torqueLoss="23.58"/> + <Entry inputSpeed="300.00" inputTorque="1050.00" torqueLoss="27.58"/> + <Entry inputSpeed="300.00" inputTorque="1250.00" torqueLoss="31.58"/> + <Entry inputSpeed="300.00" inputTorque="1450.00" torqueLoss="35.58"/> + <Entry inputSpeed="300.00" inputTorque="1650.00" torqueLoss="39.58"/> + <Entry inputSpeed="300.00" inputTorque="1850.00" torqueLoss="43.58"/> + <Entry inputSpeed="300.00" inputTorque="2050.00" torqueLoss="47.58"/> + <Entry inputSpeed="300.00" inputTorque="2250.00" torqueLoss="51.58"/> + <Entry inputSpeed="300.00" inputTorque="3000.00" torqueLoss="55.58"/> + <Entry inputSpeed="500.00" inputTorque="-350.00" torqueLoss="14.59"/> + <Entry inputSpeed="500.00" inputTorque="-150.00" torqueLoss="10.59"/> + <Entry inputSpeed="500.00" inputTorque="50.00" torqueLoss="8.59"/> + <Entry inputSpeed="500.00" inputTorque="250.00" torqueLoss="12.59"/> + <Entry inputSpeed="500.00" inputTorque="450.00" torqueLoss="16.59"/> + <Entry inputSpeed="500.00" inputTorque="650.00" torqueLoss="20.59"/> + <Entry inputSpeed="500.00" inputTorque="850.00" torqueLoss="24.59"/> + <Entry inputSpeed="500.00" inputTorque="1050.00" torqueLoss="28.59"/> + <Entry inputSpeed="500.00" inputTorque="1250.00" torqueLoss="32.59"/> + <Entry inputSpeed="500.00" inputTorque="1450.00" torqueLoss="36.59"/> + <Entry inputSpeed="500.00" inputTorque="1650.00" torqueLoss="40.59"/> + <Entry inputSpeed="500.00" inputTorque="1850.00" torqueLoss="44.59"/> + <Entry inputSpeed="500.00" inputTorque="2050.00" torqueLoss="48.59"/> + <Entry inputSpeed="500.00" inputTorque="2250.00" torqueLoss="52.59"/> + <Entry inputSpeed="500.00" inputTorque="3000.00" torqueLoss="56.59"/> + <Entry inputSpeed="700.00" inputTorque="-350.00" torqueLoss="15.60"/> + <Entry inputSpeed="700.00" inputTorque="-150.00" torqueLoss="11.60"/> + <Entry inputSpeed="700.00" inputTorque="50.00" torqueLoss="9.60"/> + <Entry inputSpeed="700.00" inputTorque="250.00" torqueLoss="13.60"/> + <Entry inputSpeed="700.00" inputTorque="450.00" torqueLoss="17.60"/> + <Entry inputSpeed="700.00" inputTorque="650.00" torqueLoss="21.60"/> + <Entry inputSpeed="700.00" inputTorque="850.00" torqueLoss="25.60"/> + <Entry inputSpeed="700.00" inputTorque="1050.00" torqueLoss="29.60"/> + <Entry inputSpeed="700.00" inputTorque="1250.00" torqueLoss="33.60"/> + <Entry inputSpeed="700.00" inputTorque="1450.00" torqueLoss="37.60"/> + <Entry inputSpeed="700.00" inputTorque="1650.00" torqueLoss="41.60"/> + <Entry inputSpeed="700.00" inputTorque="1850.00" torqueLoss="45.60"/> + <Entry inputSpeed="700.00" inputTorque="2050.00" torqueLoss="49.60"/> + <Entry inputSpeed="700.00" inputTorque="2250.00" torqueLoss="53.60"/> + <Entry inputSpeed="700.00" inputTorque="3000.00" torqueLoss="57.60"/> + <Entry inputSpeed="900.00" inputTorque="-350.00" torqueLoss="16.61"/> + <Entry inputSpeed="900.00" inputTorque="-150.00" torqueLoss="12.61"/> + <Entry inputSpeed="900.00" inputTorque="50.00" torqueLoss="10.61"/> + <Entry inputSpeed="900.00" inputTorque="250.00" torqueLoss="14.61"/> + <Entry inputSpeed="900.00" inputTorque="450.00" torqueLoss="18.61"/> + <Entry inputSpeed="900.00" inputTorque="650.00" torqueLoss="22.61"/> + <Entry inputSpeed="900.00" inputTorque="850.00" torqueLoss="26.61"/> + <Entry inputSpeed="900.00" inputTorque="1050.00" torqueLoss="30.61"/> + <Entry inputSpeed="900.00" inputTorque="1250.00" torqueLoss="34.61"/> + <Entry inputSpeed="900.00" inputTorque="1450.00" torqueLoss="38.61"/> + <Entry inputSpeed="900.00" inputTorque="1650.00" torqueLoss="42.61"/> + <Entry inputSpeed="900.00" inputTorque="1850.00" torqueLoss="46.61"/> + <Entry inputSpeed="900.00" inputTorque="2050.00" torqueLoss="50.61"/> + <Entry inputSpeed="900.00" inputTorque="2250.00" torqueLoss="54.61"/> + <Entry inputSpeed="900.00" inputTorque="3000.00" torqueLoss="58.61"/> + <Entry inputSpeed="1100.00" inputTorque="-350.00" torqueLoss="17.63"/> + <Entry inputSpeed="1100.00" inputTorque="-150.00" torqueLoss="13.63"/> + <Entry inputSpeed="1100.00" inputTorque="50.00" torqueLoss="11.63"/> + <Entry inputSpeed="1100.00" inputTorque="250.00" torqueLoss="15.63"/> + <Entry inputSpeed="1100.00" inputTorque="450.00" torqueLoss="19.63"/> + <Entry inputSpeed="1100.00" inputTorque="650.00" torqueLoss="23.63"/> + <Entry inputSpeed="1100.00" inputTorque="850.00" torqueLoss="27.63"/> + <Entry inputSpeed="1100.00" inputTorque="1050.00" torqueLoss="31.63"/> + <Entry inputSpeed="1100.00" inputTorque="1250.00" torqueLoss="35.63"/> + <Entry inputSpeed="1100.00" inputTorque="1450.00" torqueLoss="39.63"/> + <Entry inputSpeed="1100.00" inputTorque="1650.00" torqueLoss="43.63"/> + <Entry inputSpeed="1100.00" inputTorque="1850.00" torqueLoss="47.63"/> + <Entry inputSpeed="1100.00" inputTorque="2050.00" torqueLoss="51.63"/> + <Entry inputSpeed="1100.00" inputTorque="2250.00" torqueLoss="55.63"/> + <Entry inputSpeed="1100.00" inputTorque="3000.00" torqueLoss="59.63"/> + <Entry inputSpeed="1300.00" inputTorque="-350.00" torqueLoss="18.64"/> + <Entry inputSpeed="1300.00" inputTorque="-150.00" torqueLoss="14.64"/> + <Entry inputSpeed="1300.00" inputTorque="50.00" torqueLoss="12.64"/> + <Entry inputSpeed="1300.00" inputTorque="250.00" torqueLoss="16.64"/> + <Entry inputSpeed="1300.00" inputTorque="450.00" torqueLoss="20.64"/> + <Entry inputSpeed="1300.00" inputTorque="650.00" torqueLoss="24.64"/> + <Entry inputSpeed="1300.00" inputTorque="850.00" torqueLoss="28.64"/> + <Entry inputSpeed="1300.00" inputTorque="1050.00" torqueLoss="32.64"/> + <Entry inputSpeed="1300.00" inputTorque="1250.00" torqueLoss="36.64"/> + <Entry inputSpeed="1300.00" inputTorque="1450.00" torqueLoss="40.64"/> + <Entry inputSpeed="1300.00" inputTorque="1650.00" torqueLoss="44.64"/> + <Entry inputSpeed="1300.00" inputTorque="1850.00" torqueLoss="48.64"/> + <Entry inputSpeed="1300.00" inputTorque="2050.00" torqueLoss="52.64"/> + <Entry inputSpeed="1300.00" inputTorque="2250.00" torqueLoss="56.64"/> + <Entry inputSpeed="1300.00" inputTorque="3000.00" torqueLoss="60.64"/> + <Entry inputSpeed="1500.00" inputTorque="-350.00" torqueLoss="19.65"/> + <Entry inputSpeed="1500.00" inputTorque="-150.00" torqueLoss="15.65"/> + <Entry inputSpeed="1500.00" inputTorque="50.00" torqueLoss="13.65"/> + <Entry inputSpeed="1500.00" inputTorque="250.00" torqueLoss="17.65"/> + <Entry inputSpeed="1500.00" inputTorque="450.00" torqueLoss="21.65"/> + <Entry inputSpeed="1500.00" inputTorque="650.00" torqueLoss="25.65"/> + <Entry inputSpeed="1500.00" inputTorque="850.00" torqueLoss="29.65"/> + <Entry inputSpeed="1500.00" inputTorque="1050.00" torqueLoss="33.65"/> + <Entry inputSpeed="1500.00" inputTorque="1250.00" torqueLoss="37.65"/> + <Entry inputSpeed="1500.00" inputTorque="1450.00" torqueLoss="41.65"/> + <Entry inputSpeed="1500.00" inputTorque="1650.00" torqueLoss="45.65"/> + <Entry inputSpeed="1500.00" inputTorque="1850.00" torqueLoss="49.65"/> + <Entry inputSpeed="1500.00" inputTorque="2050.00" torqueLoss="53.65"/> + <Entry inputSpeed="1500.00" inputTorque="2250.00" torqueLoss="57.65"/> + <Entry inputSpeed="1500.00" inputTorque="3000.00" torqueLoss="61.65"/> + <Entry inputSpeed="1700.00" inputTorque="-350.00" torqueLoss="20.66"/> + <Entry inputSpeed="1700.00" inputTorque="-150.00" torqueLoss="16.66"/> + <Entry inputSpeed="1700.00" inputTorque="50.00" torqueLoss="14.66"/> + <Entry inputSpeed="1700.00" inputTorque="250.00" torqueLoss="18.66"/> + <Entry inputSpeed="1700.00" inputTorque="450.00" torqueLoss="22.66"/> + <Entry inputSpeed="1700.00" inputTorque="650.00" torqueLoss="26.66"/> + <Entry inputSpeed="1700.00" inputTorque="850.00" torqueLoss="30.66"/> + <Entry inputSpeed="1700.00" inputTorque="1050.00" torqueLoss="34.66"/> + <Entry inputSpeed="1700.00" inputTorque="1250.00" torqueLoss="38.66"/> + <Entry inputSpeed="1700.00" inputTorque="1450.00" torqueLoss="42.66"/> + <Entry inputSpeed="1700.00" inputTorque="1650.00" torqueLoss="46.66"/> + <Entry inputSpeed="1700.00" inputTorque="1850.00" torqueLoss="50.66"/> + <Entry inputSpeed="1700.00" inputTorque="2050.00" torqueLoss="54.66"/> + <Entry inputSpeed="1700.00" inputTorque="2250.00" torqueLoss="58.66"/> + <Entry inputSpeed="1700.00" inputTorque="3000.00" torqueLoss="62.66"/> + <Entry inputSpeed="1900.00" inputTorque="-350.00" torqueLoss="21.67"/> + <Entry inputSpeed="1900.00" inputTorque="-150.00" torqueLoss="17.67"/> + <Entry inputSpeed="1900.00" inputTorque="50.00" torqueLoss="15.67"/> + <Entry inputSpeed="1900.00" inputTorque="250.00" torqueLoss="19.67"/> + <Entry inputSpeed="1900.00" inputTorque="450.00" torqueLoss="23.67"/> + <Entry inputSpeed="1900.00" inputTorque="650.00" torqueLoss="27.67"/> + <Entry inputSpeed="1900.00" inputTorque="850.00" torqueLoss="31.67"/> + <Entry inputSpeed="1900.00" inputTorque="1050.00" torqueLoss="35.67"/> + <Entry inputSpeed="1900.00" inputTorque="1250.00" torqueLoss="39.67"/> + <Entry inputSpeed="1900.00" inputTorque="1450.00" torqueLoss="43.67"/> + <Entry inputSpeed="1900.00" inputTorque="1650.00" torqueLoss="47.67"/> + <Entry inputSpeed="1900.00" inputTorque="1850.00" torqueLoss="51.67"/> + <Entry inputSpeed="1900.00" inputTorque="2050.00" torqueLoss="55.67"/> + <Entry inputSpeed="1900.00" inputTorque="2250.00" torqueLoss="59.67"/> + <Entry inputSpeed="1900.00" inputTorque="3000.00" torqueLoss="63.67"/> + <Entry inputSpeed="2100.00" inputTorque="-350.00" torqueLoss="22.69"/> + <Entry inputSpeed="2100.00" inputTorque="-150.00" torqueLoss="18.69"/> + <Entry inputSpeed="2100.00" inputTorque="50.00" torqueLoss="16.69"/> + <Entry inputSpeed="2100.00" inputTorque="250.00" torqueLoss="20.69"/> + <Entry inputSpeed="2100.00" inputTorque="450.00" torqueLoss="24.69"/> + <Entry inputSpeed="2100.00" inputTorque="650.00" torqueLoss="28.69"/> + <Entry inputSpeed="2100.00" inputTorque="850.00" torqueLoss="32.69"/> + <Entry inputSpeed="2100.00" inputTorque="1050.00" torqueLoss="36.69"/> + <Entry inputSpeed="2100.00" inputTorque="1250.00" torqueLoss="40.69"/> + <Entry inputSpeed="2100.00" inputTorque="1450.00" torqueLoss="44.69"/> + <Entry inputSpeed="2100.00" inputTorque="1650.00" torqueLoss="48.69"/> + <Entry inputSpeed="2100.00" inputTorque="1850.00" torqueLoss="52.69"/> + <Entry inputSpeed="2100.00" inputTorque="2050.00" torqueLoss="56.69"/> + <Entry inputSpeed="2100.00" inputTorque="2250.00" torqueLoss="60.69"/> + <Entry inputSpeed="2100.00" inputTorque="3000.00" torqueLoss="64.69"/> + <Entry inputSpeed="0.00" inputTorque="-1000.00" torqueLoss="25.06"/> + <Entry inputSpeed="100.00" inputTorque="-1000.00" torqueLoss="25.56"/> + <Entry inputSpeed="300.00" inputTorque="-1000.00" torqueLoss="26.58"/> + <Entry inputSpeed="500.00" inputTorque="-1000.00" torqueLoss="27.59"/> + <Entry inputSpeed="700.00" inputTorque="-1000.00" torqueLoss="28.60"/> + <Entry inputSpeed="900.00" inputTorque="-1000.00" torqueLoss="29.61"/> + <Entry inputSpeed="1100.00" inputTorque="-1000.00" torqueLoss="30.63"/> + <Entry inputSpeed="1300.00" inputTorque="-1000.00" torqueLoss="31.64"/> + <Entry inputSpeed="1500.00" inputTorque="-1000.00" torqueLoss="32.65"/> + <Entry inputSpeed="1700.00" inputTorque="-1000.00" torqueLoss="33.66"/> + <Entry inputSpeed="1900.00" inputTorque="-1000.00" torqueLoss="34.67"/> + <Entry inputSpeed="2100.00" inputTorque="-1000.00" torqueLoss="35.69"/> + </TorqueLossMap> + </Gear> + <Gear number="6"> + <Ratio>4.400</Ratio> + <MaxSpeed>2000</MaxSpeed> + <TorqueLossMap> + <Entry inputSpeed="0.00" inputTorque="-350.00" torqueLoss="12.06"/> + <Entry inputSpeed="0.00" inputTorque="-150.00" torqueLoss="8.06"/> + <Entry inputSpeed="0.00" inputTorque="50.00" torqueLoss="6.06"/> + <Entry inputSpeed="0.00" inputTorque="250.00" torqueLoss="10.06"/> + <Entry inputSpeed="0.00" inputTorque="450.00" torqueLoss="14.06"/> + <Entry inputSpeed="0.00" inputTorque="650.00" torqueLoss="18.06"/> + <Entry inputSpeed="0.00" inputTorque="850.00" torqueLoss="22.06"/> + <Entry inputSpeed="0.00" inputTorque="1050.00" torqueLoss="26.06"/> + <Entry inputSpeed="0.00" inputTorque="1250.00" torqueLoss="30.06"/> + <Entry inputSpeed="0.00" inputTorque="1450.00" torqueLoss="34.06"/> + <Entry inputSpeed="0.00" inputTorque="1650.00" torqueLoss="38.06"/> + <Entry inputSpeed="0.00" inputTorque="1850.00" torqueLoss="42.06"/> + <Entry inputSpeed="0.00" inputTorque="2050.00" torqueLoss="46.06"/> + <Entry inputSpeed="0.00" inputTorque="2250.00" torqueLoss="50.06"/> + <Entry inputSpeed="0.00" inputTorque="3000.00" torqueLoss="54.06"/> + <Entry inputSpeed="100.00" inputTorque="-350.00" torqueLoss="12.56"/> + <Entry inputSpeed="100.00" inputTorque="-150.00" torqueLoss="8.56"/> + <Entry inputSpeed="100.00" inputTorque="50.00" torqueLoss="6.56"/> + <Entry inputSpeed="100.00" inputTorque="250.00" torqueLoss="10.56"/> + <Entry inputSpeed="100.00" inputTorque="450.00" torqueLoss="14.56"/> + <Entry inputSpeed="100.00" inputTorque="650.00" torqueLoss="18.56"/> + <Entry inputSpeed="100.00" inputTorque="850.00" torqueLoss="22.56"/> + <Entry inputSpeed="100.00" inputTorque="1050.00" torqueLoss="26.56"/> + <Entry inputSpeed="100.00" inputTorque="1250.00" torqueLoss="30.56"/> + <Entry inputSpeed="100.00" inputTorque="1450.00" torqueLoss="34.56"/> + <Entry inputSpeed="100.00" inputTorque="1650.00" torqueLoss="38.56"/> + <Entry inputSpeed="100.00" inputTorque="1850.00" torqueLoss="42.56"/> + <Entry inputSpeed="100.00" inputTorque="2050.00" torqueLoss="46.56"/> + <Entry inputSpeed="100.00" inputTorque="2250.00" torqueLoss="50.56"/> + <Entry inputSpeed="100.00" inputTorque="3000.00" torqueLoss="54.56"/> + <Entry inputSpeed="300.00" inputTorque="-350.00" torqueLoss="13.58"/> + <Entry inputSpeed="300.00" inputTorque="-150.00" torqueLoss="9.58"/> + <Entry inputSpeed="300.00" inputTorque="50.00" torqueLoss="7.58"/> + <Entry inputSpeed="300.00" inputTorque="250.00" torqueLoss="11.58"/> + <Entry inputSpeed="300.00" inputTorque="450.00" torqueLoss="15.58"/> + <Entry inputSpeed="300.00" inputTorque="650.00" torqueLoss="19.58"/> + <Entry inputSpeed="300.00" inputTorque="850.00" torqueLoss="23.58"/> + <Entry inputSpeed="300.00" inputTorque="1050.00" torqueLoss="27.58"/> + <Entry inputSpeed="300.00" inputTorque="1250.00" torqueLoss="31.58"/> + <Entry inputSpeed="300.00" inputTorque="1450.00" torqueLoss="35.58"/> + <Entry inputSpeed="300.00" inputTorque="1650.00" torqueLoss="39.58"/> + <Entry inputSpeed="300.00" inputTorque="1850.00" torqueLoss="43.58"/> + <Entry inputSpeed="300.00" inputTorque="2050.00" torqueLoss="47.58"/> + <Entry inputSpeed="300.00" inputTorque="2250.00" torqueLoss="51.58"/> + <Entry inputSpeed="300.00" inputTorque="3000.00" torqueLoss="55.58"/> + <Entry inputSpeed="500.00" inputTorque="-350.00" torqueLoss="14.59"/> + <Entry inputSpeed="500.00" inputTorque="-150.00" torqueLoss="10.59"/> + <Entry inputSpeed="500.00" inputTorque="50.00" torqueLoss="8.59"/> + <Entry inputSpeed="500.00" inputTorque="250.00" torqueLoss="12.59"/> + <Entry inputSpeed="500.00" inputTorque="450.00" torqueLoss="16.59"/> + <Entry inputSpeed="500.00" inputTorque="650.00" torqueLoss="20.59"/> + <Entry inputSpeed="500.00" inputTorque="850.00" torqueLoss="24.59"/> + <Entry inputSpeed="500.00" inputTorque="1050.00" torqueLoss="28.59"/> + <Entry inputSpeed="500.00" inputTorque="1250.00" torqueLoss="32.59"/> + <Entry inputSpeed="500.00" inputTorque="1450.00" torqueLoss="36.59"/> + <Entry inputSpeed="500.00" inputTorque="1650.00" torqueLoss="40.59"/> + <Entry inputSpeed="500.00" inputTorque="1850.00" torqueLoss="44.59"/> + <Entry inputSpeed="500.00" inputTorque="2050.00" torqueLoss="48.59"/> + <Entry inputSpeed="500.00" inputTorque="2250.00" torqueLoss="52.59"/> + <Entry inputSpeed="500.00" inputTorque="3000.00" torqueLoss="56.59"/> + <Entry inputSpeed="700.00" inputTorque="-350.00" torqueLoss="15.60"/> + <Entry inputSpeed="700.00" inputTorque="-150.00" torqueLoss="11.60"/> + <Entry inputSpeed="700.00" inputTorque="50.00" torqueLoss="9.60"/> + <Entry inputSpeed="700.00" inputTorque="250.00" torqueLoss="13.60"/> + <Entry inputSpeed="700.00" inputTorque="450.00" torqueLoss="17.60"/> + <Entry inputSpeed="700.00" inputTorque="650.00" torqueLoss="21.60"/> + <Entry inputSpeed="700.00" inputTorque="850.00" torqueLoss="25.60"/> + <Entry inputSpeed="700.00" inputTorque="1050.00" torqueLoss="29.60"/> + <Entry inputSpeed="700.00" inputTorque="1250.00" torqueLoss="33.60"/> + <Entry inputSpeed="700.00" inputTorque="1450.00" torqueLoss="37.60"/> + <Entry inputSpeed="700.00" inputTorque="1650.00" torqueLoss="41.60"/> + <Entry inputSpeed="700.00" inputTorque="1850.00" torqueLoss="45.60"/> + <Entry inputSpeed="700.00" inputTorque="2050.00" torqueLoss="49.60"/> + <Entry inputSpeed="700.00" inputTorque="2250.00" torqueLoss="53.60"/> + <Entry inputSpeed="700.00" inputTorque="3000.00" torqueLoss="57.60"/> + <Entry inputSpeed="900.00" inputTorque="-350.00" torqueLoss="16.61"/> + <Entry inputSpeed="900.00" inputTorque="-150.00" torqueLoss="12.61"/> + <Entry inputSpeed="900.00" inputTorque="50.00" torqueLoss="10.61"/> + <Entry inputSpeed="900.00" inputTorque="250.00" torqueLoss="14.61"/> + <Entry inputSpeed="900.00" inputTorque="450.00" torqueLoss="18.61"/> + <Entry inputSpeed="900.00" inputTorque="650.00" torqueLoss="22.61"/> + <Entry inputSpeed="900.00" inputTorque="850.00" torqueLoss="26.61"/> + <Entry inputSpeed="900.00" inputTorque="1050.00" torqueLoss="30.61"/> + <Entry inputSpeed="900.00" inputTorque="1250.00" torqueLoss="34.61"/> + <Entry inputSpeed="900.00" inputTorque="1450.00" torqueLoss="38.61"/> + <Entry inputSpeed="900.00" inputTorque="1650.00" torqueLoss="42.61"/> + <Entry inputSpeed="900.00" inputTorque="1850.00" torqueLoss="46.61"/> + <Entry inputSpeed="900.00" inputTorque="2050.00" torqueLoss="50.61"/> + <Entry inputSpeed="900.00" inputTorque="2250.00" torqueLoss="54.61"/> + <Entry inputSpeed="900.00" inputTorque="3000.00" torqueLoss="58.61"/> + <Entry inputSpeed="1100.00" inputTorque="-350.00" torqueLoss="17.63"/> + <Entry inputSpeed="1100.00" inputTorque="-150.00" torqueLoss="13.63"/> + <Entry inputSpeed="1100.00" inputTorque="50.00" torqueLoss="11.63"/> + <Entry inputSpeed="1100.00" inputTorque="250.00" torqueLoss="15.63"/> + <Entry inputSpeed="1100.00" inputTorque="450.00" torqueLoss="19.63"/> + <Entry inputSpeed="1100.00" inputTorque="650.00" torqueLoss="23.63"/> + <Entry inputSpeed="1100.00" inputTorque="850.00" torqueLoss="27.63"/> + <Entry inputSpeed="1100.00" inputTorque="1050.00" torqueLoss="31.63"/> + <Entry inputSpeed="1100.00" inputTorque="1250.00" torqueLoss="35.63"/> + <Entry inputSpeed="1100.00" inputTorque="1450.00" torqueLoss="39.63"/> + <Entry inputSpeed="1100.00" inputTorque="1650.00" torqueLoss="43.63"/> + <Entry inputSpeed="1100.00" inputTorque="1850.00" torqueLoss="47.63"/> + <Entry inputSpeed="1100.00" inputTorque="2050.00" torqueLoss="51.63"/> + <Entry inputSpeed="1100.00" inputTorque="2250.00" torqueLoss="55.63"/> + <Entry inputSpeed="1100.00" inputTorque="3000.00" torqueLoss="59.63"/> + <Entry inputSpeed="1300.00" inputTorque="-350.00" torqueLoss="18.64"/> + <Entry inputSpeed="1300.00" inputTorque="-150.00" torqueLoss="14.64"/> + <Entry inputSpeed="1300.00" inputTorque="50.00" torqueLoss="12.64"/> + <Entry inputSpeed="1300.00" inputTorque="250.00" torqueLoss="16.64"/> + <Entry inputSpeed="1300.00" inputTorque="450.00" torqueLoss="20.64"/> + <Entry inputSpeed="1300.00" inputTorque="650.00" torqueLoss="24.64"/> + <Entry inputSpeed="1300.00" inputTorque="850.00" torqueLoss="28.64"/> + <Entry inputSpeed="1300.00" inputTorque="1050.00" torqueLoss="32.64"/> + <Entry inputSpeed="1300.00" inputTorque="1250.00" torqueLoss="36.64"/> + <Entry inputSpeed="1300.00" inputTorque="1450.00" torqueLoss="40.64"/> + <Entry inputSpeed="1300.00" inputTorque="1650.00" torqueLoss="44.64"/> + <Entry inputSpeed="1300.00" inputTorque="1850.00" torqueLoss="48.64"/> + <Entry inputSpeed="1300.00" inputTorque="2050.00" torqueLoss="52.64"/> + <Entry inputSpeed="1300.00" inputTorque="2250.00" torqueLoss="56.64"/> + <Entry inputSpeed="1300.00" inputTorque="3000.00" torqueLoss="60.64"/> + <Entry inputSpeed="1500.00" inputTorque="-350.00" torqueLoss="19.65"/> + <Entry inputSpeed="1500.00" inputTorque="-150.00" torqueLoss="15.65"/> + <Entry inputSpeed="1500.00" inputTorque="50.00" torqueLoss="13.65"/> + <Entry inputSpeed="1500.00" inputTorque="250.00" torqueLoss="17.65"/> + <Entry inputSpeed="1500.00" inputTorque="450.00" torqueLoss="21.65"/> + <Entry inputSpeed="1500.00" inputTorque="650.00" torqueLoss="25.65"/> + <Entry inputSpeed="1500.00" inputTorque="850.00" torqueLoss="29.65"/> + <Entry inputSpeed="1500.00" inputTorque="1050.00" torqueLoss="33.65"/> + <Entry inputSpeed="1500.00" inputTorque="1250.00" torqueLoss="37.65"/> + <Entry inputSpeed="1500.00" inputTorque="1450.00" torqueLoss="41.65"/> + <Entry inputSpeed="1500.00" inputTorque="1650.00" torqueLoss="45.65"/> + <Entry inputSpeed="1500.00" inputTorque="1850.00" torqueLoss="49.65"/> + <Entry inputSpeed="1500.00" inputTorque="2050.00" torqueLoss="53.65"/> + <Entry inputSpeed="1500.00" inputTorque="2250.00" torqueLoss="57.65"/> + <Entry inputSpeed="1500.00" inputTorque="3000.00" torqueLoss="61.65"/> + <Entry inputSpeed="1700.00" inputTorque="-350.00" torqueLoss="20.66"/> + <Entry inputSpeed="1700.00" inputTorque="-150.00" torqueLoss="16.66"/> + <Entry inputSpeed="1700.00" inputTorque="50.00" torqueLoss="14.66"/> + <Entry inputSpeed="1700.00" inputTorque="250.00" torqueLoss="18.66"/> + <Entry inputSpeed="1700.00" inputTorque="450.00" torqueLoss="22.66"/> + <Entry inputSpeed="1700.00" inputTorque="650.00" torqueLoss="26.66"/> + <Entry inputSpeed="1700.00" inputTorque="850.00" torqueLoss="30.66"/> + <Entry inputSpeed="1700.00" inputTorque="1050.00" torqueLoss="34.66"/> + <Entry inputSpeed="1700.00" inputTorque="1250.00" torqueLoss="38.66"/> + <Entry inputSpeed="1700.00" inputTorque="1450.00" torqueLoss="42.66"/> + <Entry inputSpeed="1700.00" inputTorque="1650.00" torqueLoss="46.66"/> + <Entry inputSpeed="1700.00" inputTorque="1850.00" torqueLoss="50.66"/> + <Entry inputSpeed="1700.00" inputTorque="2050.00" torqueLoss="54.66"/> + <Entry inputSpeed="1700.00" inputTorque="2250.00" torqueLoss="58.66"/> + <Entry inputSpeed="1700.00" inputTorque="3000.00" torqueLoss="62.66"/> + <Entry inputSpeed="1900.00" inputTorque="-350.00" torqueLoss="21.67"/> + <Entry inputSpeed="1900.00" inputTorque="-150.00" torqueLoss="17.67"/> + <Entry inputSpeed="1900.00" inputTorque="50.00" torqueLoss="15.67"/> + <Entry inputSpeed="1900.00" inputTorque="250.00" torqueLoss="19.67"/> + <Entry inputSpeed="1900.00" inputTorque="450.00" torqueLoss="23.67"/> + <Entry inputSpeed="1900.00" inputTorque="650.00" torqueLoss="27.67"/> + <Entry inputSpeed="1900.00" inputTorque="850.00" torqueLoss="31.67"/> + <Entry inputSpeed="1900.00" inputTorque="1050.00" torqueLoss="35.67"/> + <Entry inputSpeed="1900.00" inputTorque="1250.00" torqueLoss="39.67"/> + <Entry inputSpeed="1900.00" inputTorque="1450.00" torqueLoss="43.67"/> + <Entry inputSpeed="1900.00" inputTorque="1650.00" torqueLoss="47.67"/> + <Entry inputSpeed="1900.00" inputTorque="1850.00" torqueLoss="51.67"/> + <Entry inputSpeed="1900.00" inputTorque="2050.00" torqueLoss="55.67"/> + <Entry inputSpeed="1900.00" inputTorque="2250.00" torqueLoss="59.67"/> + <Entry inputSpeed="1900.00" inputTorque="3000.00" torqueLoss="63.67"/> + <Entry inputSpeed="2100.00" inputTorque="-350.00" torqueLoss="22.69"/> + <Entry inputSpeed="2100.00" inputTorque="-150.00" torqueLoss="18.69"/> + <Entry inputSpeed="2100.00" inputTorque="50.00" torqueLoss="16.69"/> + <Entry inputSpeed="2100.00" inputTorque="250.00" torqueLoss="20.69"/> + <Entry inputSpeed="2100.00" inputTorque="450.00" torqueLoss="24.69"/> + <Entry inputSpeed="2100.00" inputTorque="650.00" torqueLoss="28.69"/> + <Entry inputSpeed="2100.00" inputTorque="850.00" torqueLoss="32.69"/> + <Entry inputSpeed="2100.00" inputTorque="1050.00" torqueLoss="36.69"/> + <Entry inputSpeed="2100.00" inputTorque="1250.00" torqueLoss="40.69"/> + <Entry inputSpeed="2100.00" inputTorque="1450.00" torqueLoss="44.69"/> + <Entry inputSpeed="2100.00" inputTorque="1650.00" torqueLoss="48.69"/> + <Entry inputSpeed="2100.00" inputTorque="1850.00" torqueLoss="52.69"/> + <Entry inputSpeed="2100.00" inputTorque="2050.00" torqueLoss="56.69"/> + <Entry inputSpeed="2100.00" inputTorque="2250.00" torqueLoss="60.69"/> + <Entry inputSpeed="2100.00" inputTorque="3000.00" torqueLoss="64.69"/> + <Entry inputSpeed="0.00" inputTorque="-1000.00" torqueLoss="25.06"/> + <Entry inputSpeed="100.00" inputTorque="-1000.00" torqueLoss="25.56"/> + <Entry inputSpeed="300.00" inputTorque="-1000.00" torqueLoss="26.58"/> + <Entry inputSpeed="500.00" inputTorque="-1000.00" torqueLoss="27.59"/> + <Entry inputSpeed="700.00" inputTorque="-1000.00" torqueLoss="28.60"/> + <Entry inputSpeed="900.00" inputTorque="-1000.00" torqueLoss="29.61"/> + <Entry inputSpeed="1100.00" inputTorque="-1000.00" torqueLoss="30.63"/> + <Entry inputSpeed="1300.00" inputTorque="-1000.00" torqueLoss="31.64"/> + <Entry inputSpeed="1500.00" inputTorque="-1000.00" torqueLoss="32.65"/> + <Entry inputSpeed="1700.00" inputTorque="-1000.00" torqueLoss="33.66"/> + <Entry inputSpeed="1900.00" inputTorque="-1000.00" torqueLoss="34.67"/> + <Entry inputSpeed="2100.00" inputTorque="-1000.00" torqueLoss="35.69"/> + </TorqueLossMap> + </Gear> + <Gear number="7"> + <Ratio>3.390</Ratio> + <MaxSpeed>2000</MaxSpeed> + <TorqueLossMap> + <Entry inputSpeed="0.00" inputTorque="-350.00" torqueLoss="12.06"/> + <Entry inputSpeed="0.00" inputTorque="-150.00" torqueLoss="8.06"/> + <Entry inputSpeed="0.00" inputTorque="50.00" torqueLoss="6.06"/> + <Entry inputSpeed="0.00" inputTorque="250.00" torqueLoss="10.06"/> + <Entry inputSpeed="0.00" inputTorque="450.00" torqueLoss="14.06"/> + <Entry inputSpeed="0.00" inputTorque="650.00" torqueLoss="18.06"/> + <Entry inputSpeed="0.00" inputTorque="850.00" torqueLoss="22.06"/> + <Entry inputSpeed="0.00" inputTorque="1050.00" torqueLoss="26.06"/> + <Entry inputSpeed="0.00" inputTorque="1250.00" torqueLoss="30.06"/> + <Entry inputSpeed="0.00" inputTorque="1450.00" torqueLoss="34.06"/> + <Entry inputSpeed="0.00" inputTorque="1650.00" torqueLoss="38.06"/> + <Entry inputSpeed="0.00" inputTorque="1850.00" torqueLoss="42.06"/> + <Entry inputSpeed="0.00" inputTorque="2050.00" torqueLoss="46.06"/> + <Entry inputSpeed="0.00" inputTorque="2250.00" torqueLoss="50.06"/> + <Entry inputSpeed="0.00" inputTorque="3000.00" torqueLoss="54.06"/> + <Entry inputSpeed="100.00" inputTorque="-350.00" torqueLoss="12.56"/> + <Entry inputSpeed="100.00" inputTorque="-150.00" torqueLoss="8.56"/> + <Entry inputSpeed="100.00" inputTorque="50.00" torqueLoss="6.56"/> + <Entry inputSpeed="100.00" inputTorque="250.00" torqueLoss="10.56"/> + <Entry inputSpeed="100.00" inputTorque="450.00" torqueLoss="14.56"/> + <Entry inputSpeed="100.00" inputTorque="650.00" torqueLoss="18.56"/> + <Entry inputSpeed="100.00" inputTorque="850.00" torqueLoss="22.56"/> + <Entry inputSpeed="100.00" inputTorque="1050.00" torqueLoss="26.56"/> + <Entry inputSpeed="100.00" inputTorque="1250.00" torqueLoss="30.56"/> + <Entry inputSpeed="100.00" inputTorque="1450.00" torqueLoss="34.56"/> + <Entry inputSpeed="100.00" inputTorque="1650.00" torqueLoss="38.56"/> + <Entry inputSpeed="100.00" inputTorque="1850.00" torqueLoss="42.56"/> + <Entry inputSpeed="100.00" inputTorque="2050.00" torqueLoss="46.56"/> + <Entry inputSpeed="100.00" inputTorque="2250.00" torqueLoss="50.56"/> + <Entry inputSpeed="100.00" inputTorque="3000.00" torqueLoss="54.56"/> + <Entry inputSpeed="300.00" inputTorque="-350.00" torqueLoss="13.58"/> + <Entry inputSpeed="300.00" inputTorque="-150.00" torqueLoss="9.58"/> + <Entry inputSpeed="300.00" inputTorque="50.00" torqueLoss="7.58"/> + <Entry inputSpeed="300.00" inputTorque="250.00" torqueLoss="11.58"/> + <Entry inputSpeed="300.00" inputTorque="450.00" torqueLoss="15.58"/> + <Entry inputSpeed="300.00" inputTorque="650.00" torqueLoss="19.58"/> + <Entry inputSpeed="300.00" inputTorque="850.00" torqueLoss="23.58"/> + <Entry inputSpeed="300.00" inputTorque="1050.00" torqueLoss="27.58"/> + <Entry inputSpeed="300.00" inputTorque="1250.00" torqueLoss="31.58"/> + <Entry inputSpeed="300.00" inputTorque="1450.00" torqueLoss="35.58"/> + <Entry inputSpeed="300.00" inputTorque="1650.00" torqueLoss="39.58"/> + <Entry inputSpeed="300.00" inputTorque="1850.00" torqueLoss="43.58"/> + <Entry inputSpeed="300.00" inputTorque="2050.00" torqueLoss="47.58"/> + <Entry inputSpeed="300.00" inputTorque="2250.00" torqueLoss="51.58"/> + <Entry inputSpeed="300.00" inputTorque="3000.00" torqueLoss="55.58"/> + <Entry inputSpeed="500.00" inputTorque="-350.00" torqueLoss="14.59"/> + <Entry inputSpeed="500.00" inputTorque="-150.00" torqueLoss="10.59"/> + <Entry inputSpeed="500.00" inputTorque="50.00" torqueLoss="8.59"/> + <Entry inputSpeed="500.00" inputTorque="250.00" torqueLoss="12.59"/> + <Entry inputSpeed="500.00" inputTorque="450.00" torqueLoss="16.59"/> + <Entry inputSpeed="500.00" inputTorque="650.00" torqueLoss="20.59"/> + <Entry inputSpeed="500.00" inputTorque="850.00" torqueLoss="24.59"/> + <Entry inputSpeed="500.00" inputTorque="1050.00" torqueLoss="28.59"/> + <Entry inputSpeed="500.00" inputTorque="1250.00" torqueLoss="32.59"/> + <Entry inputSpeed="500.00" inputTorque="1450.00" torqueLoss="36.59"/> + <Entry inputSpeed="500.00" inputTorque="1650.00" torqueLoss="40.59"/> + <Entry inputSpeed="500.00" inputTorque="1850.00" torqueLoss="44.59"/> + <Entry inputSpeed="500.00" inputTorque="2050.00" torqueLoss="48.59"/> + <Entry inputSpeed="500.00" inputTorque="2250.00" torqueLoss="52.59"/> + <Entry inputSpeed="500.00" inputTorque="3000.00" torqueLoss="56.59"/> + <Entry inputSpeed="700.00" inputTorque="-350.00" torqueLoss="15.60"/> + <Entry inputSpeed="700.00" inputTorque="-150.00" torqueLoss="11.60"/> + <Entry inputSpeed="700.00" inputTorque="50.00" torqueLoss="9.60"/> + <Entry inputSpeed="700.00" inputTorque="250.00" torqueLoss="13.60"/> + <Entry inputSpeed="700.00" inputTorque="450.00" torqueLoss="17.60"/> + <Entry inputSpeed="700.00" inputTorque="650.00" torqueLoss="21.60"/> + <Entry inputSpeed="700.00" inputTorque="850.00" torqueLoss="25.60"/> + <Entry inputSpeed="700.00" inputTorque="1050.00" torqueLoss="29.60"/> + <Entry inputSpeed="700.00" inputTorque="1250.00" torqueLoss="33.60"/> + <Entry inputSpeed="700.00" inputTorque="1450.00" torqueLoss="37.60"/> + <Entry inputSpeed="700.00" inputTorque="1650.00" torqueLoss="41.60"/> + <Entry inputSpeed="700.00" inputTorque="1850.00" torqueLoss="45.60"/> + <Entry inputSpeed="700.00" inputTorque="2050.00" torqueLoss="49.60"/> + <Entry inputSpeed="700.00" inputTorque="2250.00" torqueLoss="53.60"/> + <Entry inputSpeed="700.00" inputTorque="3000.00" torqueLoss="57.60"/> + <Entry inputSpeed="900.00" inputTorque="-350.00" torqueLoss="16.61"/> + <Entry inputSpeed="900.00" inputTorque="-150.00" torqueLoss="12.61"/> + <Entry inputSpeed="900.00" inputTorque="50.00" torqueLoss="10.61"/> + <Entry inputSpeed="900.00" inputTorque="250.00" torqueLoss="14.61"/> + <Entry inputSpeed="900.00" inputTorque="450.00" torqueLoss="18.61"/> + <Entry inputSpeed="900.00" inputTorque="650.00" torqueLoss="22.61"/> + <Entry inputSpeed="900.00" inputTorque="850.00" torqueLoss="26.61"/> + <Entry inputSpeed="900.00" inputTorque="1050.00" torqueLoss="30.61"/> + <Entry inputSpeed="900.00" inputTorque="1250.00" torqueLoss="34.61"/> + <Entry inputSpeed="900.00" inputTorque="1450.00" torqueLoss="38.61"/> + <Entry inputSpeed="900.00" inputTorque="1650.00" torqueLoss="42.61"/> + <Entry inputSpeed="900.00" inputTorque="1850.00" torqueLoss="46.61"/> + <Entry inputSpeed="900.00" inputTorque="2050.00" torqueLoss="50.61"/> + <Entry inputSpeed="900.00" inputTorque="2250.00" torqueLoss="54.61"/> + <Entry inputSpeed="900.00" inputTorque="3000.00" torqueLoss="58.61"/> + <Entry inputSpeed="1100.00" inputTorque="-350.00" torqueLoss="17.63"/> + <Entry inputSpeed="1100.00" inputTorque="-150.00" torqueLoss="13.63"/> + <Entry inputSpeed="1100.00" inputTorque="50.00" torqueLoss="11.63"/> + <Entry inputSpeed="1100.00" inputTorque="250.00" torqueLoss="15.63"/> + <Entry inputSpeed="1100.00" inputTorque="450.00" torqueLoss="19.63"/> + <Entry inputSpeed="1100.00" inputTorque="650.00" torqueLoss="23.63"/> + <Entry inputSpeed="1100.00" inputTorque="850.00" torqueLoss="27.63"/> + <Entry inputSpeed="1100.00" inputTorque="1050.00" torqueLoss="31.63"/> + <Entry inputSpeed="1100.00" inputTorque="1250.00" torqueLoss="35.63"/> + <Entry inputSpeed="1100.00" inputTorque="1450.00" torqueLoss="39.63"/> + <Entry inputSpeed="1100.00" inputTorque="1650.00" torqueLoss="43.63"/> + <Entry inputSpeed="1100.00" inputTorque="1850.00" torqueLoss="47.63"/> + <Entry inputSpeed="1100.00" inputTorque="2050.00" torqueLoss="51.63"/> + <Entry inputSpeed="1100.00" inputTorque="2250.00" torqueLoss="55.63"/> + <Entry inputSpeed="1100.00" inputTorque="3000.00" torqueLoss="59.63"/> + <Entry inputSpeed="1300.00" inputTorque="-350.00" torqueLoss="18.64"/> + <Entry inputSpeed="1300.00" inputTorque="-150.00" torqueLoss="14.64"/> + <Entry inputSpeed="1300.00" inputTorque="50.00" torqueLoss="12.64"/> + <Entry inputSpeed="1300.00" inputTorque="250.00" torqueLoss="16.64"/> + <Entry inputSpeed="1300.00" inputTorque="450.00" torqueLoss="20.64"/> + <Entry inputSpeed="1300.00" inputTorque="650.00" torqueLoss="24.64"/> + <Entry inputSpeed="1300.00" inputTorque="850.00" torqueLoss="28.64"/> + <Entry inputSpeed="1300.00" inputTorque="1050.00" torqueLoss="32.64"/> + <Entry inputSpeed="1300.00" inputTorque="1250.00" torqueLoss="36.64"/> + <Entry inputSpeed="1300.00" inputTorque="1450.00" torqueLoss="40.64"/> + <Entry inputSpeed="1300.00" inputTorque="1650.00" torqueLoss="44.64"/> + <Entry inputSpeed="1300.00" inputTorque="1850.00" torqueLoss="48.64"/> + <Entry inputSpeed="1300.00" inputTorque="2050.00" torqueLoss="52.64"/> + <Entry inputSpeed="1300.00" inputTorque="2250.00" torqueLoss="56.64"/> + <Entry inputSpeed="1300.00" inputTorque="3000.00" torqueLoss="60.64"/> + <Entry inputSpeed="1500.00" inputTorque="-350.00" torqueLoss="19.65"/> + <Entry inputSpeed="1500.00" inputTorque="-150.00" torqueLoss="15.65"/> + <Entry inputSpeed="1500.00" inputTorque="50.00" torqueLoss="13.65"/> + <Entry inputSpeed="1500.00" inputTorque="250.00" torqueLoss="17.65"/> + <Entry inputSpeed="1500.00" inputTorque="450.00" torqueLoss="21.65"/> + <Entry inputSpeed="1500.00" inputTorque="650.00" torqueLoss="25.65"/> + <Entry inputSpeed="1500.00" inputTorque="850.00" torqueLoss="29.65"/> + <Entry inputSpeed="1500.00" inputTorque="1050.00" torqueLoss="33.65"/> + <Entry inputSpeed="1500.00" inputTorque="1250.00" torqueLoss="37.65"/> + <Entry inputSpeed="1500.00" inputTorque="1450.00" torqueLoss="41.65"/> + <Entry inputSpeed="1500.00" inputTorque="1650.00" torqueLoss="45.65"/> + <Entry inputSpeed="1500.00" inputTorque="1850.00" torqueLoss="49.65"/> + <Entry inputSpeed="1500.00" inputTorque="2050.00" torqueLoss="53.65"/> + <Entry inputSpeed="1500.00" inputTorque="2250.00" torqueLoss="57.65"/> + <Entry inputSpeed="1500.00" inputTorque="3000.00" torqueLoss="61.65"/> + <Entry inputSpeed="1700.00" inputTorque="-350.00" torqueLoss="20.66"/> + <Entry inputSpeed="1700.00" inputTorque="-150.00" torqueLoss="16.66"/> + <Entry inputSpeed="1700.00" inputTorque="50.00" torqueLoss="14.66"/> + <Entry inputSpeed="1700.00" inputTorque="250.00" torqueLoss="18.66"/> + <Entry inputSpeed="1700.00" inputTorque="450.00" torqueLoss="22.66"/> + <Entry inputSpeed="1700.00" inputTorque="650.00" torqueLoss="26.66"/> + <Entry inputSpeed="1700.00" inputTorque="850.00" torqueLoss="30.66"/> + <Entry inputSpeed="1700.00" inputTorque="1050.00" torqueLoss="34.66"/> + <Entry inputSpeed="1700.00" inputTorque="1250.00" torqueLoss="38.66"/> + <Entry inputSpeed="1700.00" inputTorque="1450.00" torqueLoss="42.66"/> + <Entry inputSpeed="1700.00" inputTorque="1650.00" torqueLoss="46.66"/> + <Entry inputSpeed="1700.00" inputTorque="1850.00" torqueLoss="50.66"/> + <Entry inputSpeed="1700.00" inputTorque="2050.00" torqueLoss="54.66"/> + <Entry inputSpeed="1700.00" inputTorque="2250.00" torqueLoss="58.66"/> + <Entry inputSpeed="1700.00" inputTorque="3000.00" torqueLoss="62.66"/> + <Entry inputSpeed="1900.00" inputTorque="-350.00" torqueLoss="21.67"/> + <Entry inputSpeed="1900.00" inputTorque="-150.00" torqueLoss="17.67"/> + <Entry inputSpeed="1900.00" inputTorque="50.00" torqueLoss="15.67"/> + <Entry inputSpeed="1900.00" inputTorque="250.00" torqueLoss="19.67"/> + <Entry inputSpeed="1900.00" inputTorque="450.00" torqueLoss="23.67"/> + <Entry inputSpeed="1900.00" inputTorque="650.00" torqueLoss="27.67"/> + <Entry inputSpeed="1900.00" inputTorque="850.00" torqueLoss="31.67"/> + <Entry inputSpeed="1900.00" inputTorque="1050.00" torqueLoss="35.67"/> + <Entry inputSpeed="1900.00" inputTorque="1250.00" torqueLoss="39.67"/> + <Entry inputSpeed="1900.00" inputTorque="1450.00" torqueLoss="43.67"/> + <Entry inputSpeed="1900.00" inputTorque="1650.00" torqueLoss="47.67"/> + <Entry inputSpeed="1900.00" inputTorque="1850.00" torqueLoss="51.67"/> + <Entry inputSpeed="1900.00" inputTorque="2050.00" torqueLoss="55.67"/> + <Entry inputSpeed="1900.00" inputTorque="2250.00" torqueLoss="59.67"/> + <Entry inputSpeed="1900.00" inputTorque="3000.00" torqueLoss="63.67"/> + <Entry inputSpeed="2100.00" inputTorque="-350.00" torqueLoss="22.69"/> + <Entry inputSpeed="2100.00" inputTorque="-150.00" torqueLoss="18.69"/> + <Entry inputSpeed="2100.00" inputTorque="50.00" torqueLoss="16.69"/> + <Entry inputSpeed="2100.00" inputTorque="250.00" torqueLoss="20.69"/> + <Entry inputSpeed="2100.00" inputTorque="450.00" torqueLoss="24.69"/> + <Entry inputSpeed="2100.00" inputTorque="650.00" torqueLoss="28.69"/> + <Entry inputSpeed="2100.00" inputTorque="850.00" torqueLoss="32.69"/> + <Entry inputSpeed="2100.00" inputTorque="1050.00" torqueLoss="36.69"/> + <Entry inputSpeed="2100.00" inputTorque="1250.00" torqueLoss="40.69"/> + <Entry inputSpeed="2100.00" inputTorque="1450.00" torqueLoss="44.69"/> + <Entry inputSpeed="2100.00" inputTorque="1650.00" torqueLoss="48.69"/> + <Entry inputSpeed="2100.00" inputTorque="1850.00" torqueLoss="52.69"/> + <Entry inputSpeed="2100.00" inputTorque="2050.00" torqueLoss="56.69"/> + <Entry inputSpeed="2100.00" inputTorque="2250.00" torqueLoss="60.69"/> + <Entry inputSpeed="2100.00" inputTorque="3000.00" torqueLoss="64.69"/> + <Entry inputSpeed="0.00" inputTorque="-1000.00" torqueLoss="25.06"/> + <Entry inputSpeed="100.00" inputTorque="-1000.00" torqueLoss="25.56"/> + <Entry inputSpeed="300.00" inputTorque="-1000.00" torqueLoss="26.58"/> + <Entry inputSpeed="500.00" inputTorque="-1000.00" torqueLoss="27.59"/> + <Entry inputSpeed="700.00" inputTorque="-1000.00" torqueLoss="28.60"/> + <Entry inputSpeed="900.00" inputTorque="-1000.00" torqueLoss="29.61"/> + <Entry inputSpeed="1100.00" inputTorque="-1000.00" torqueLoss="30.63"/> + <Entry inputSpeed="1300.00" inputTorque="-1000.00" torqueLoss="31.64"/> + <Entry inputSpeed="1500.00" inputTorque="-1000.00" torqueLoss="32.65"/> + <Entry inputSpeed="1700.00" inputTorque="-1000.00" torqueLoss="33.66"/> + <Entry inputSpeed="1900.00" inputTorque="-1000.00" torqueLoss="34.67"/> + <Entry inputSpeed="2100.00" inputTorque="-1000.00" torqueLoss="35.69"/> + </TorqueLossMap> + </Gear> + <Gear number="8"> + <Ratio>2.650</Ratio> + <MaxSpeed>2000</MaxSpeed> + <TorqueLossMap> + <Entry inputSpeed="0.00" inputTorque="-350.00" torqueLoss="12.06"/> + <Entry inputSpeed="0.00" inputTorque="-150.00" torqueLoss="8.06"/> + <Entry inputSpeed="0.00" inputTorque="50.00" torqueLoss="6.06"/> + <Entry inputSpeed="0.00" inputTorque="250.00" torqueLoss="10.06"/> + <Entry inputSpeed="0.00" inputTorque="450.00" torqueLoss="14.06"/> + <Entry inputSpeed="0.00" inputTorque="650.00" torqueLoss="18.06"/> + <Entry inputSpeed="0.00" inputTorque="850.00" torqueLoss="22.06"/> + <Entry inputSpeed="0.00" inputTorque="1050.00" torqueLoss="26.06"/> + <Entry inputSpeed="0.00" inputTorque="1250.00" torqueLoss="30.06"/> + <Entry inputSpeed="0.00" inputTorque="1450.00" torqueLoss="34.06"/> + <Entry inputSpeed="0.00" inputTorque="1650.00" torqueLoss="38.06"/> + <Entry inputSpeed="0.00" inputTorque="1850.00" torqueLoss="42.06"/> + <Entry inputSpeed="0.00" inputTorque="2050.00" torqueLoss="46.06"/> + <Entry inputSpeed="0.00" inputTorque="2250.00" torqueLoss="50.06"/> + <Entry inputSpeed="0.00" inputTorque="3000.00" torqueLoss="54.06"/> + <Entry inputSpeed="100.00" inputTorque="-350.00" torqueLoss="12.56"/> + <Entry inputSpeed="100.00" inputTorque="-150.00" torqueLoss="8.56"/> + <Entry inputSpeed="100.00" inputTorque="50.00" torqueLoss="6.56"/> + <Entry inputSpeed="100.00" inputTorque="250.00" torqueLoss="10.56"/> + <Entry inputSpeed="100.00" inputTorque="450.00" torqueLoss="14.56"/> + <Entry inputSpeed="100.00" inputTorque="650.00" torqueLoss="18.56"/> + <Entry inputSpeed="100.00" inputTorque="850.00" torqueLoss="22.56"/> + <Entry inputSpeed="100.00" inputTorque="1050.00" torqueLoss="26.56"/> + <Entry inputSpeed="100.00" inputTorque="1250.00" torqueLoss="30.56"/> + <Entry inputSpeed="100.00" inputTorque="1450.00" torqueLoss="34.56"/> + <Entry inputSpeed="100.00" inputTorque="1650.00" torqueLoss="38.56"/> + <Entry inputSpeed="100.00" inputTorque="1850.00" torqueLoss="42.56"/> + <Entry inputSpeed="100.00" inputTorque="2050.00" torqueLoss="46.56"/> + <Entry inputSpeed="100.00" inputTorque="2250.00" torqueLoss="50.56"/> + <Entry inputSpeed="100.00" inputTorque="3000.00" torqueLoss="54.56"/> + <Entry inputSpeed="300.00" inputTorque="-350.00" torqueLoss="13.58"/> + <Entry inputSpeed="300.00" inputTorque="-150.00" torqueLoss="9.58"/> + <Entry inputSpeed="300.00" inputTorque="50.00" torqueLoss="7.58"/> + <Entry inputSpeed="300.00" inputTorque="250.00" torqueLoss="11.58"/> + <Entry inputSpeed="300.00" inputTorque="450.00" torqueLoss="15.58"/> + <Entry inputSpeed="300.00" inputTorque="650.00" torqueLoss="19.58"/> + <Entry inputSpeed="300.00" inputTorque="850.00" torqueLoss="23.58"/> + <Entry inputSpeed="300.00" inputTorque="1050.00" torqueLoss="27.58"/> + <Entry inputSpeed="300.00" inputTorque="1250.00" torqueLoss="31.58"/> + <Entry inputSpeed="300.00" inputTorque="1450.00" torqueLoss="35.58"/> + <Entry inputSpeed="300.00" inputTorque="1650.00" torqueLoss="39.58"/> + <Entry inputSpeed="300.00" inputTorque="1850.00" torqueLoss="43.58"/> + <Entry inputSpeed="300.00" inputTorque="2050.00" torqueLoss="47.58"/> + <Entry inputSpeed="300.00" inputTorque="2250.00" torqueLoss="51.58"/> + <Entry inputSpeed="300.00" inputTorque="3000.00" torqueLoss="55.58"/> + <Entry inputSpeed="500.00" inputTorque="-350.00" torqueLoss="14.59"/> + <Entry inputSpeed="500.00" inputTorque="-150.00" torqueLoss="10.59"/> + <Entry inputSpeed="500.00" inputTorque="50.00" torqueLoss="8.59"/> + <Entry inputSpeed="500.00" inputTorque="250.00" torqueLoss="12.59"/> + <Entry inputSpeed="500.00" inputTorque="450.00" torqueLoss="16.59"/> + <Entry inputSpeed="500.00" inputTorque="650.00" torqueLoss="20.59"/> + <Entry inputSpeed="500.00" inputTorque="850.00" torqueLoss="24.59"/> + <Entry inputSpeed="500.00" inputTorque="1050.00" torqueLoss="28.59"/> + <Entry inputSpeed="500.00" inputTorque="1250.00" torqueLoss="32.59"/> + <Entry inputSpeed="500.00" inputTorque="1450.00" torqueLoss="36.59"/> + <Entry inputSpeed="500.00" inputTorque="1650.00" torqueLoss="40.59"/> + <Entry inputSpeed="500.00" inputTorque="1850.00" torqueLoss="44.59"/> + <Entry inputSpeed="500.00" inputTorque="2050.00" torqueLoss="48.59"/> + <Entry inputSpeed="500.00" inputTorque="2250.00" torqueLoss="52.59"/> + <Entry inputSpeed="500.00" inputTorque="3000.00" torqueLoss="56.59"/> + <Entry inputSpeed="700.00" inputTorque="-350.00" torqueLoss="15.60"/> + <Entry inputSpeed="700.00" inputTorque="-150.00" torqueLoss="11.60"/> + <Entry inputSpeed="700.00" inputTorque="50.00" torqueLoss="9.60"/> + <Entry inputSpeed="700.00" inputTorque="250.00" torqueLoss="13.60"/> + <Entry inputSpeed="700.00" inputTorque="450.00" torqueLoss="17.60"/> + <Entry inputSpeed="700.00" inputTorque="650.00" torqueLoss="21.60"/> + <Entry inputSpeed="700.00" inputTorque="850.00" torqueLoss="25.60"/> + <Entry inputSpeed="700.00" inputTorque="1050.00" torqueLoss="29.60"/> + <Entry inputSpeed="700.00" inputTorque="1250.00" torqueLoss="33.60"/> + <Entry inputSpeed="700.00" inputTorque="1450.00" torqueLoss="37.60"/> + <Entry inputSpeed="700.00" inputTorque="1650.00" torqueLoss="41.60"/> + <Entry inputSpeed="700.00" inputTorque="1850.00" torqueLoss="45.60"/> + <Entry inputSpeed="700.00" inputTorque="2050.00" torqueLoss="49.60"/> + <Entry inputSpeed="700.00" inputTorque="2250.00" torqueLoss="53.60"/> + <Entry inputSpeed="700.00" inputTorque="3000.00" torqueLoss="57.60"/> + <Entry inputSpeed="900.00" inputTorque="-350.00" torqueLoss="16.61"/> + <Entry inputSpeed="900.00" inputTorque="-150.00" torqueLoss="12.61"/> + <Entry inputSpeed="900.00" inputTorque="50.00" torqueLoss="10.61"/> + <Entry inputSpeed="900.00" inputTorque="250.00" torqueLoss="14.61"/> + <Entry inputSpeed="900.00" inputTorque="450.00" torqueLoss="18.61"/> + <Entry inputSpeed="900.00" inputTorque="650.00" torqueLoss="22.61"/> + <Entry inputSpeed="900.00" inputTorque="850.00" torqueLoss="26.61"/> + <Entry inputSpeed="900.00" inputTorque="1050.00" torqueLoss="30.61"/> + <Entry inputSpeed="900.00" inputTorque="1250.00" torqueLoss="34.61"/> + <Entry inputSpeed="900.00" inputTorque="1450.00" torqueLoss="38.61"/> + <Entry inputSpeed="900.00" inputTorque="1650.00" torqueLoss="42.61"/> + <Entry inputSpeed="900.00" inputTorque="1850.00" torqueLoss="46.61"/> + <Entry inputSpeed="900.00" inputTorque="2050.00" torqueLoss="50.61"/> + <Entry inputSpeed="900.00" inputTorque="2250.00" torqueLoss="54.61"/> + <Entry inputSpeed="900.00" inputTorque="3000.00" torqueLoss="58.61"/> + <Entry inputSpeed="1100.00" inputTorque="-350.00" torqueLoss="17.63"/> + <Entry inputSpeed="1100.00" inputTorque="-150.00" torqueLoss="13.63"/> + <Entry inputSpeed="1100.00" inputTorque="50.00" torqueLoss="11.63"/> + <Entry inputSpeed="1100.00" inputTorque="250.00" torqueLoss="15.63"/> + <Entry inputSpeed="1100.00" inputTorque="450.00" torqueLoss="19.63"/> + <Entry inputSpeed="1100.00" inputTorque="650.00" torqueLoss="23.63"/> + <Entry inputSpeed="1100.00" inputTorque="850.00" torqueLoss="27.63"/> + <Entry inputSpeed="1100.00" inputTorque="1050.00" torqueLoss="31.63"/> + <Entry inputSpeed="1100.00" inputTorque="1250.00" torqueLoss="35.63"/> + <Entry inputSpeed="1100.00" inputTorque="1450.00" torqueLoss="39.63"/> + <Entry inputSpeed="1100.00" inputTorque="1650.00" torqueLoss="43.63"/> + <Entry inputSpeed="1100.00" inputTorque="1850.00" torqueLoss="47.63"/> + <Entry inputSpeed="1100.00" inputTorque="2050.00" torqueLoss="51.63"/> + <Entry inputSpeed="1100.00" inputTorque="2250.00" torqueLoss="55.63"/> + <Entry inputSpeed="1100.00" inputTorque="3000.00" torqueLoss="59.63"/> + <Entry inputSpeed="1300.00" inputTorque="-350.00" torqueLoss="18.64"/> + <Entry inputSpeed="1300.00" inputTorque="-150.00" torqueLoss="14.64"/> + <Entry inputSpeed="1300.00" inputTorque="50.00" torqueLoss="12.64"/> + <Entry inputSpeed="1300.00" inputTorque="250.00" torqueLoss="16.64"/> + <Entry inputSpeed="1300.00" inputTorque="450.00" torqueLoss="20.64"/> + <Entry inputSpeed="1300.00" inputTorque="650.00" torqueLoss="24.64"/> + <Entry inputSpeed="1300.00" inputTorque="850.00" torqueLoss="28.64"/> + <Entry inputSpeed="1300.00" inputTorque="1050.00" torqueLoss="32.64"/> + <Entry inputSpeed="1300.00" inputTorque="1250.00" torqueLoss="36.64"/> + <Entry inputSpeed="1300.00" inputTorque="1450.00" torqueLoss="40.64"/> + <Entry inputSpeed="1300.00" inputTorque="1650.00" torqueLoss="44.64"/> + <Entry inputSpeed="1300.00" inputTorque="1850.00" torqueLoss="48.64"/> + <Entry inputSpeed="1300.00" inputTorque="2050.00" torqueLoss="52.64"/> + <Entry inputSpeed="1300.00" inputTorque="2250.00" torqueLoss="56.64"/> + <Entry inputSpeed="1300.00" inputTorque="3000.00" torqueLoss="60.64"/> + <Entry inputSpeed="1500.00" inputTorque="-350.00" torqueLoss="19.65"/> + <Entry inputSpeed="1500.00" inputTorque="-150.00" torqueLoss="15.65"/> + <Entry inputSpeed="1500.00" inputTorque="50.00" torqueLoss="13.65"/> + <Entry inputSpeed="1500.00" inputTorque="250.00" torqueLoss="17.65"/> + <Entry inputSpeed="1500.00" inputTorque="450.00" torqueLoss="21.65"/> + <Entry inputSpeed="1500.00" inputTorque="650.00" torqueLoss="25.65"/> + <Entry inputSpeed="1500.00" inputTorque="850.00" torqueLoss="29.65"/> + <Entry inputSpeed="1500.00" inputTorque="1050.00" torqueLoss="33.65"/> + <Entry inputSpeed="1500.00" inputTorque="1250.00" torqueLoss="37.65"/> + <Entry inputSpeed="1500.00" inputTorque="1450.00" torqueLoss="41.65"/> + <Entry inputSpeed="1500.00" inputTorque="1650.00" torqueLoss="45.65"/> + <Entry inputSpeed="1500.00" inputTorque="1850.00" torqueLoss="49.65"/> + <Entry inputSpeed="1500.00" inputTorque="2050.00" torqueLoss="53.65"/> + <Entry inputSpeed="1500.00" inputTorque="2250.00" torqueLoss="57.65"/> + <Entry inputSpeed="1500.00" inputTorque="3000.00" torqueLoss="61.65"/> + <Entry inputSpeed="1700.00" inputTorque="-350.00" torqueLoss="20.66"/> + <Entry inputSpeed="1700.00" inputTorque="-150.00" torqueLoss="16.66"/> + <Entry inputSpeed="1700.00" inputTorque="50.00" torqueLoss="14.66"/> + <Entry inputSpeed="1700.00" inputTorque="250.00" torqueLoss="18.66"/> + <Entry inputSpeed="1700.00" inputTorque="450.00" torqueLoss="22.66"/> + <Entry inputSpeed="1700.00" inputTorque="650.00" torqueLoss="26.66"/> + <Entry inputSpeed="1700.00" inputTorque="850.00" torqueLoss="30.66"/> + <Entry inputSpeed="1700.00" inputTorque="1050.00" torqueLoss="34.66"/> + <Entry inputSpeed="1700.00" inputTorque="1250.00" torqueLoss="38.66"/> + <Entry inputSpeed="1700.00" inputTorque="1450.00" torqueLoss="42.66"/> + <Entry inputSpeed="1700.00" inputTorque="1650.00" torqueLoss="46.66"/> + <Entry inputSpeed="1700.00" inputTorque="1850.00" torqueLoss="50.66"/> + <Entry inputSpeed="1700.00" inputTorque="2050.00" torqueLoss="54.66"/> + <Entry inputSpeed="1700.00" inputTorque="2250.00" torqueLoss="58.66"/> + <Entry inputSpeed="1700.00" inputTorque="3000.00" torqueLoss="62.66"/> + <Entry inputSpeed="1900.00" inputTorque="-350.00" torqueLoss="21.67"/> + <Entry inputSpeed="1900.00" inputTorque="-150.00" torqueLoss="17.67"/> + <Entry inputSpeed="1900.00" inputTorque="50.00" torqueLoss="15.67"/> + <Entry inputSpeed="1900.00" inputTorque="250.00" torqueLoss="19.67"/> + <Entry inputSpeed="1900.00" inputTorque="450.00" torqueLoss="23.67"/> + <Entry inputSpeed="1900.00" inputTorque="650.00" torqueLoss="27.67"/> + <Entry inputSpeed="1900.00" inputTorque="850.00" torqueLoss="31.67"/> + <Entry inputSpeed="1900.00" inputTorque="1050.00" torqueLoss="35.67"/> + <Entry inputSpeed="1900.00" inputTorque="1250.00" torqueLoss="39.67"/> + <Entry inputSpeed="1900.00" inputTorque="1450.00" torqueLoss="43.67"/> + <Entry inputSpeed="1900.00" inputTorque="1650.00" torqueLoss="47.67"/> + <Entry inputSpeed="1900.00" inputTorque="1850.00" torqueLoss="51.67"/> + <Entry inputSpeed="1900.00" inputTorque="2050.00" torqueLoss="55.67"/> + <Entry inputSpeed="1900.00" inputTorque="2250.00" torqueLoss="59.67"/> + <Entry inputSpeed="1900.00" inputTorque="3000.00" torqueLoss="63.67"/> + <Entry inputSpeed="2100.00" inputTorque="-350.00" torqueLoss="22.69"/> + <Entry inputSpeed="2100.00" inputTorque="-150.00" torqueLoss="18.69"/> + <Entry inputSpeed="2100.00" inputTorque="50.00" torqueLoss="16.69"/> + <Entry inputSpeed="2100.00" inputTorque="250.00" torqueLoss="20.69"/> + <Entry inputSpeed="2100.00" inputTorque="450.00" torqueLoss="24.69"/> + <Entry inputSpeed="2100.00" inputTorque="650.00" torqueLoss="28.69"/> + <Entry inputSpeed="2100.00" inputTorque="850.00" torqueLoss="32.69"/> + <Entry inputSpeed="2100.00" inputTorque="1050.00" torqueLoss="36.69"/> + <Entry inputSpeed="2100.00" inputTorque="1250.00" torqueLoss="40.69"/> + <Entry inputSpeed="2100.00" inputTorque="1450.00" torqueLoss="44.69"/> + <Entry inputSpeed="2100.00" inputTorque="1650.00" torqueLoss="48.69"/> + <Entry inputSpeed="2100.00" inputTorque="1850.00" torqueLoss="52.69"/> + <Entry inputSpeed="2100.00" inputTorque="2050.00" torqueLoss="56.69"/> + <Entry inputSpeed="2100.00" inputTorque="2250.00" torqueLoss="60.69"/> + <Entry inputSpeed="2100.00" inputTorque="3000.00" torqueLoss="64.69"/> + <Entry inputSpeed="0.00" inputTorque="-1000.00" torqueLoss="25.06"/> + <Entry inputSpeed="100.00" inputTorque="-1000.00" torqueLoss="25.56"/> + <Entry inputSpeed="300.00" inputTorque="-1000.00" torqueLoss="26.58"/> + <Entry inputSpeed="500.00" inputTorque="-1000.00" torqueLoss="27.59"/> + <Entry inputSpeed="700.00" inputTorque="-1000.00" torqueLoss="28.60"/> + <Entry inputSpeed="900.00" inputTorque="-1000.00" torqueLoss="29.61"/> + <Entry inputSpeed="1100.00" inputTorque="-1000.00" torqueLoss="30.63"/> + <Entry inputSpeed="1300.00" inputTorque="-1000.00" torqueLoss="31.64"/> + <Entry inputSpeed="1500.00" inputTorque="-1000.00" torqueLoss="32.65"/> + <Entry inputSpeed="1700.00" inputTorque="-1000.00" torqueLoss="33.66"/> + <Entry inputSpeed="1900.00" inputTorque="-1000.00" torqueLoss="34.67"/> + <Entry inputSpeed="2100.00" inputTorque="-1000.00" torqueLoss="35.69"/> + </TorqueLossMap> + </Gear> + <Gear number="9"> + <Ratio>2.050</Ratio> + <MaxSpeed>2000</MaxSpeed> + <TorqueLossMap> + <Entry inputSpeed="0.00" inputTorque="-350.00" torqueLoss="12.06"/> + <Entry inputSpeed="0.00" inputTorque="-150.00" torqueLoss="8.06"/> + <Entry inputSpeed="0.00" inputTorque="50.00" torqueLoss="6.06"/> + <Entry inputSpeed="0.00" inputTorque="250.00" torqueLoss="10.06"/> + <Entry inputSpeed="0.00" inputTorque="450.00" torqueLoss="14.06"/> + <Entry inputSpeed="0.00" inputTorque="650.00" torqueLoss="18.06"/> + <Entry inputSpeed="0.00" inputTorque="850.00" torqueLoss="22.06"/> + <Entry inputSpeed="0.00" inputTorque="1050.00" torqueLoss="26.06"/> + <Entry inputSpeed="0.00" inputTorque="1250.00" torqueLoss="30.06"/> + <Entry inputSpeed="0.00" inputTorque="1450.00" torqueLoss="34.06"/> + <Entry inputSpeed="0.00" inputTorque="1650.00" torqueLoss="38.06"/> + <Entry inputSpeed="0.00" inputTorque="1850.00" torqueLoss="42.06"/> + <Entry inputSpeed="0.00" inputTorque="2050.00" torqueLoss="46.06"/> + <Entry inputSpeed="0.00" inputTorque="2250.00" torqueLoss="50.06"/> + <Entry inputSpeed="0.00" inputTorque="3000.00" torqueLoss="54.06"/> + <Entry inputSpeed="100.00" inputTorque="-350.00" torqueLoss="12.56"/> + <Entry inputSpeed="100.00" inputTorque="-150.00" torqueLoss="8.56"/> + <Entry inputSpeed="100.00" inputTorque="50.00" torqueLoss="6.56"/> + <Entry inputSpeed="100.00" inputTorque="250.00" torqueLoss="10.56"/> + <Entry inputSpeed="100.00" inputTorque="450.00" torqueLoss="14.56"/> + <Entry inputSpeed="100.00" inputTorque="650.00" torqueLoss="18.56"/> + <Entry inputSpeed="100.00" inputTorque="850.00" torqueLoss="22.56"/> + <Entry inputSpeed="100.00" inputTorque="1050.00" torqueLoss="26.56"/> + <Entry inputSpeed="100.00" inputTorque="1250.00" torqueLoss="30.56"/> + <Entry inputSpeed="100.00" inputTorque="1450.00" torqueLoss="34.56"/> + <Entry inputSpeed="100.00" inputTorque="1650.00" torqueLoss="38.56"/> + <Entry inputSpeed="100.00" inputTorque="1850.00" torqueLoss="42.56"/> + <Entry inputSpeed="100.00" inputTorque="2050.00" torqueLoss="46.56"/> + <Entry inputSpeed="100.00" inputTorque="2250.00" torqueLoss="50.56"/> + <Entry inputSpeed="100.00" inputTorque="3000.00" torqueLoss="54.56"/> + <Entry inputSpeed="300.00" inputTorque="-350.00" torqueLoss="13.58"/> + <Entry inputSpeed="300.00" inputTorque="-150.00" torqueLoss="9.58"/> + <Entry inputSpeed="300.00" inputTorque="50.00" torqueLoss="7.58"/> + <Entry inputSpeed="300.00" inputTorque="250.00" torqueLoss="11.58"/> + <Entry inputSpeed="300.00" inputTorque="450.00" torqueLoss="15.58"/> + <Entry inputSpeed="300.00" inputTorque="650.00" torqueLoss="19.58"/> + <Entry inputSpeed="300.00" inputTorque="850.00" torqueLoss="23.58"/> + <Entry inputSpeed="300.00" inputTorque="1050.00" torqueLoss="27.58"/> + <Entry inputSpeed="300.00" inputTorque="1250.00" torqueLoss="31.58"/> + <Entry inputSpeed="300.00" inputTorque="1450.00" torqueLoss="35.58"/> + <Entry inputSpeed="300.00" inputTorque="1650.00" torqueLoss="39.58"/> + <Entry inputSpeed="300.00" inputTorque="1850.00" torqueLoss="43.58"/> + <Entry inputSpeed="300.00" inputTorque="2050.00" torqueLoss="47.58"/> + <Entry inputSpeed="300.00" inputTorque="2250.00" torqueLoss="51.58"/> + <Entry inputSpeed="300.00" inputTorque="3000.00" torqueLoss="55.58"/> + <Entry inputSpeed="500.00" inputTorque="-350.00" torqueLoss="14.59"/> + <Entry inputSpeed="500.00" inputTorque="-150.00" torqueLoss="10.59"/> + <Entry inputSpeed="500.00" inputTorque="50.00" torqueLoss="8.59"/> + <Entry inputSpeed="500.00" inputTorque="250.00" torqueLoss="12.59"/> + <Entry inputSpeed="500.00" inputTorque="450.00" torqueLoss="16.59"/> + <Entry inputSpeed="500.00" inputTorque="650.00" torqueLoss="20.59"/> + <Entry inputSpeed="500.00" inputTorque="850.00" torqueLoss="24.59"/> + <Entry inputSpeed="500.00" inputTorque="1050.00" torqueLoss="28.59"/> + <Entry inputSpeed="500.00" inputTorque="1250.00" torqueLoss="32.59"/> + <Entry inputSpeed="500.00" inputTorque="1450.00" torqueLoss="36.59"/> + <Entry inputSpeed="500.00" inputTorque="1650.00" torqueLoss="40.59"/> + <Entry inputSpeed="500.00" inputTorque="1850.00" torqueLoss="44.59"/> + <Entry inputSpeed="500.00" inputTorque="2050.00" torqueLoss="48.59"/> + <Entry inputSpeed="500.00" inputTorque="2250.00" torqueLoss="52.59"/> + <Entry inputSpeed="500.00" inputTorque="3000.00" torqueLoss="56.59"/> + <Entry inputSpeed="700.00" inputTorque="-350.00" torqueLoss="15.60"/> + <Entry inputSpeed="700.00" inputTorque="-150.00" torqueLoss="11.60"/> + <Entry inputSpeed="700.00" inputTorque="50.00" torqueLoss="9.60"/> + <Entry inputSpeed="700.00" inputTorque="250.00" torqueLoss="13.60"/> + <Entry inputSpeed="700.00" inputTorque="450.00" torqueLoss="17.60"/> + <Entry inputSpeed="700.00" inputTorque="650.00" torqueLoss="21.60"/> + <Entry inputSpeed="700.00" inputTorque="850.00" torqueLoss="25.60"/> + <Entry inputSpeed="700.00" inputTorque="1050.00" torqueLoss="29.60"/> + <Entry inputSpeed="700.00" inputTorque="1250.00" torqueLoss="33.60"/> + <Entry inputSpeed="700.00" inputTorque="1450.00" torqueLoss="37.60"/> + <Entry inputSpeed="700.00" inputTorque="1650.00" torqueLoss="41.60"/> + <Entry inputSpeed="700.00" inputTorque="1850.00" torqueLoss="45.60"/> + <Entry inputSpeed="700.00" inputTorque="2050.00" torqueLoss="49.60"/> + <Entry inputSpeed="700.00" inputTorque="2250.00" torqueLoss="53.60"/> + <Entry inputSpeed="700.00" inputTorque="3000.00" torqueLoss="57.60"/> + <Entry inputSpeed="900.00" inputTorque="-350.00" torqueLoss="16.61"/> + <Entry inputSpeed="900.00" inputTorque="-150.00" torqueLoss="12.61"/> + <Entry inputSpeed="900.00" inputTorque="50.00" torqueLoss="10.61"/> + <Entry inputSpeed="900.00" inputTorque="250.00" torqueLoss="14.61"/> + <Entry inputSpeed="900.00" inputTorque="450.00" torqueLoss="18.61"/> + <Entry inputSpeed="900.00" inputTorque="650.00" torqueLoss="22.61"/> + <Entry inputSpeed="900.00" inputTorque="850.00" torqueLoss="26.61"/> + <Entry inputSpeed="900.00" inputTorque="1050.00" torqueLoss="30.61"/> + <Entry inputSpeed="900.00" inputTorque="1250.00" torqueLoss="34.61"/> + <Entry inputSpeed="900.00" inputTorque="1450.00" torqueLoss="38.61"/> + <Entry inputSpeed="900.00" inputTorque="1650.00" torqueLoss="42.61"/> + <Entry inputSpeed="900.00" inputTorque="1850.00" torqueLoss="46.61"/> + <Entry inputSpeed="900.00" inputTorque="2050.00" torqueLoss="50.61"/> + <Entry inputSpeed="900.00" inputTorque="2250.00" torqueLoss="54.61"/> + <Entry inputSpeed="900.00" inputTorque="3000.00" torqueLoss="58.61"/> + <Entry inputSpeed="1100.00" inputTorque="-350.00" torqueLoss="17.63"/> + <Entry inputSpeed="1100.00" inputTorque="-150.00" torqueLoss="13.63"/> + <Entry inputSpeed="1100.00" inputTorque="50.00" torqueLoss="11.63"/> + <Entry inputSpeed="1100.00" inputTorque="250.00" torqueLoss="15.63"/> + <Entry inputSpeed="1100.00" inputTorque="450.00" torqueLoss="19.63"/> + <Entry inputSpeed="1100.00" inputTorque="650.00" torqueLoss="23.63"/> + <Entry inputSpeed="1100.00" inputTorque="850.00" torqueLoss="27.63"/> + <Entry inputSpeed="1100.00" inputTorque="1050.00" torqueLoss="31.63"/> + <Entry inputSpeed="1100.00" inputTorque="1250.00" torqueLoss="35.63"/> + <Entry inputSpeed="1100.00" inputTorque="1450.00" torqueLoss="39.63"/> + <Entry inputSpeed="1100.00" inputTorque="1650.00" torqueLoss="43.63"/> + <Entry inputSpeed="1100.00" inputTorque="1850.00" torqueLoss="47.63"/> + <Entry inputSpeed="1100.00" inputTorque="2050.00" torqueLoss="51.63"/> + <Entry inputSpeed="1100.00" inputTorque="2250.00" torqueLoss="55.63"/> + <Entry inputSpeed="1100.00" inputTorque="3000.00" torqueLoss="59.63"/> + <Entry inputSpeed="1300.00" inputTorque="-350.00" torqueLoss="18.64"/> + <Entry inputSpeed="1300.00" inputTorque="-150.00" torqueLoss="14.64"/> + <Entry inputSpeed="1300.00" inputTorque="50.00" torqueLoss="12.64"/> + <Entry inputSpeed="1300.00" inputTorque="250.00" torqueLoss="16.64"/> + <Entry inputSpeed="1300.00" inputTorque="450.00" torqueLoss="20.64"/> + <Entry inputSpeed="1300.00" inputTorque="650.00" torqueLoss="24.64"/> + <Entry inputSpeed="1300.00" inputTorque="850.00" torqueLoss="28.64"/> + <Entry inputSpeed="1300.00" inputTorque="1050.00" torqueLoss="32.64"/> + <Entry inputSpeed="1300.00" inputTorque="1250.00" torqueLoss="36.64"/> + <Entry inputSpeed="1300.00" inputTorque="1450.00" torqueLoss="40.64"/> + <Entry inputSpeed="1300.00" inputTorque="1650.00" torqueLoss="44.64"/> + <Entry inputSpeed="1300.00" inputTorque="1850.00" torqueLoss="48.64"/> + <Entry inputSpeed="1300.00" inputTorque="2050.00" torqueLoss="52.64"/> + <Entry inputSpeed="1300.00" inputTorque="2250.00" torqueLoss="56.64"/> + <Entry inputSpeed="1300.00" inputTorque="3000.00" torqueLoss="60.64"/> + <Entry inputSpeed="1500.00" inputTorque="-350.00" torqueLoss="19.65"/> + <Entry inputSpeed="1500.00" inputTorque="-150.00" torqueLoss="15.65"/> + <Entry inputSpeed="1500.00" inputTorque="50.00" torqueLoss="13.65"/> + <Entry inputSpeed="1500.00" inputTorque="250.00" torqueLoss="17.65"/> + <Entry inputSpeed="1500.00" inputTorque="450.00" torqueLoss="21.65"/> + <Entry inputSpeed="1500.00" inputTorque="650.00" torqueLoss="25.65"/> + <Entry inputSpeed="1500.00" inputTorque="850.00" torqueLoss="29.65"/> + <Entry inputSpeed="1500.00" inputTorque="1050.00" torqueLoss="33.65"/> + <Entry inputSpeed="1500.00" inputTorque="1250.00" torqueLoss="37.65"/> + <Entry inputSpeed="1500.00" inputTorque="1450.00" torqueLoss="41.65"/> + <Entry inputSpeed="1500.00" inputTorque="1650.00" torqueLoss="45.65"/> + <Entry inputSpeed="1500.00" inputTorque="1850.00" torqueLoss="49.65"/> + <Entry inputSpeed="1500.00" inputTorque="2050.00" torqueLoss="53.65"/> + <Entry inputSpeed="1500.00" inputTorque="2250.00" torqueLoss="57.65"/> + <Entry inputSpeed="1500.00" inputTorque="3000.00" torqueLoss="61.65"/> + <Entry inputSpeed="1700.00" inputTorque="-350.00" torqueLoss="20.66"/> + <Entry inputSpeed="1700.00" inputTorque="-150.00" torqueLoss="16.66"/> + <Entry inputSpeed="1700.00" inputTorque="50.00" torqueLoss="14.66"/> + <Entry inputSpeed="1700.00" inputTorque="250.00" torqueLoss="18.66"/> + <Entry inputSpeed="1700.00" inputTorque="450.00" torqueLoss="22.66"/> + <Entry inputSpeed="1700.00" inputTorque="650.00" torqueLoss="26.66"/> + <Entry inputSpeed="1700.00" inputTorque="850.00" torqueLoss="30.66"/> + <Entry inputSpeed="1700.00" inputTorque="1050.00" torqueLoss="34.66"/> + <Entry inputSpeed="1700.00" inputTorque="1250.00" torqueLoss="38.66"/> + <Entry inputSpeed="1700.00" inputTorque="1450.00" torqueLoss="42.66"/> + <Entry inputSpeed="1700.00" inputTorque="1650.00" torqueLoss="46.66"/> + <Entry inputSpeed="1700.00" inputTorque="1850.00" torqueLoss="50.66"/> + <Entry inputSpeed="1700.00" inputTorque="2050.00" torqueLoss="54.66"/> + <Entry inputSpeed="1700.00" inputTorque="2250.00" torqueLoss="58.66"/> + <Entry inputSpeed="1700.00" inputTorque="3000.00" torqueLoss="62.66"/> + <Entry inputSpeed="1900.00" inputTorque="-350.00" torqueLoss="21.67"/> + <Entry inputSpeed="1900.00" inputTorque="-150.00" torqueLoss="17.67"/> + <Entry inputSpeed="1900.00" inputTorque="50.00" torqueLoss="15.67"/> + <Entry inputSpeed="1900.00" inputTorque="250.00" torqueLoss="19.67"/> + <Entry inputSpeed="1900.00" inputTorque="450.00" torqueLoss="23.67"/> + <Entry inputSpeed="1900.00" inputTorque="650.00" torqueLoss="27.67"/> + <Entry inputSpeed="1900.00" inputTorque="850.00" torqueLoss="31.67"/> + <Entry inputSpeed="1900.00" inputTorque="1050.00" torqueLoss="35.67"/> + <Entry inputSpeed="1900.00" inputTorque="1250.00" torqueLoss="39.67"/> + <Entry inputSpeed="1900.00" inputTorque="1450.00" torqueLoss="43.67"/> + <Entry inputSpeed="1900.00" inputTorque="1650.00" torqueLoss="47.67"/> + <Entry inputSpeed="1900.00" inputTorque="1850.00" torqueLoss="51.67"/> + <Entry inputSpeed="1900.00" inputTorque="2050.00" torqueLoss="55.67"/> + <Entry inputSpeed="1900.00" inputTorque="2250.00" torqueLoss="59.67"/> + <Entry inputSpeed="1900.00" inputTorque="3000.00" torqueLoss="63.67"/> + <Entry inputSpeed="2100.00" inputTorque="-350.00" torqueLoss="22.69"/> + <Entry inputSpeed="2100.00" inputTorque="-150.00" torqueLoss="18.69"/> + <Entry inputSpeed="2100.00" inputTorque="50.00" torqueLoss="16.69"/> + <Entry inputSpeed="2100.00" inputTorque="250.00" torqueLoss="20.69"/> + <Entry inputSpeed="2100.00" inputTorque="450.00" torqueLoss="24.69"/> + <Entry inputSpeed="2100.00" inputTorque="650.00" torqueLoss="28.69"/> + <Entry inputSpeed="2100.00" inputTorque="850.00" torqueLoss="32.69"/> + <Entry inputSpeed="2100.00" inputTorque="1050.00" torqueLoss="36.69"/> + <Entry inputSpeed="2100.00" inputTorque="1250.00" torqueLoss="40.69"/> + <Entry inputSpeed="2100.00" inputTorque="1450.00" torqueLoss="44.69"/> + <Entry inputSpeed="2100.00" inputTorque="1650.00" torqueLoss="48.69"/> + <Entry inputSpeed="2100.00" inputTorque="1850.00" torqueLoss="52.69"/> + <Entry inputSpeed="2100.00" inputTorque="2050.00" torqueLoss="56.69"/> + <Entry inputSpeed="2100.00" inputTorque="2250.00" torqueLoss="60.69"/> + <Entry inputSpeed="2100.00" inputTorque="3000.00" torqueLoss="64.69"/> + <Entry inputSpeed="0.00" inputTorque="-1000.00" torqueLoss="25.06"/> + <Entry inputSpeed="100.00" inputTorque="-1000.00" torqueLoss="25.56"/> + <Entry inputSpeed="300.00" inputTorque="-1000.00" torqueLoss="26.58"/> + <Entry inputSpeed="500.00" inputTorque="-1000.00" torqueLoss="27.59"/> + <Entry inputSpeed="700.00" inputTorque="-1000.00" torqueLoss="28.60"/> + <Entry inputSpeed="900.00" inputTorque="-1000.00" torqueLoss="29.61"/> + <Entry inputSpeed="1100.00" inputTorque="-1000.00" torqueLoss="30.63"/> + <Entry inputSpeed="1300.00" inputTorque="-1000.00" torqueLoss="31.64"/> + <Entry inputSpeed="1500.00" inputTorque="-1000.00" torqueLoss="32.65"/> + <Entry inputSpeed="1700.00" inputTorque="-1000.00" torqueLoss="33.66"/> + <Entry inputSpeed="1900.00" inputTorque="-1000.00" torqueLoss="34.67"/> + <Entry inputSpeed="2100.00" inputTorque="-1000.00" torqueLoss="35.69"/> + </TorqueLossMap> + </Gear> + <Gear number="10"> + <Ratio>1.600</Ratio> + <MaxSpeed>2000</MaxSpeed> + <TorqueLossMap> + <Entry inputSpeed="0.00" inputTorque="-350.00" torqueLoss="12.06"/> + <Entry inputSpeed="0.00" inputTorque="-150.00" torqueLoss="8.06"/> + <Entry inputSpeed="0.00" inputTorque="50.00" torqueLoss="6.06"/> + <Entry inputSpeed="0.00" inputTorque="250.00" torqueLoss="10.06"/> + <Entry inputSpeed="0.00" inputTorque="450.00" torqueLoss="14.06"/> + <Entry inputSpeed="0.00" inputTorque="650.00" torqueLoss="18.06"/> + <Entry inputSpeed="0.00" inputTorque="850.00" torqueLoss="22.06"/> + <Entry inputSpeed="0.00" inputTorque="1050.00" torqueLoss="26.06"/> + <Entry inputSpeed="0.00" inputTorque="1250.00" torqueLoss="30.06"/> + <Entry inputSpeed="0.00" inputTorque="1450.00" torqueLoss="34.06"/> + <Entry inputSpeed="0.00" inputTorque="1650.00" torqueLoss="38.06"/> + <Entry inputSpeed="0.00" inputTorque="1850.00" torqueLoss="42.06"/> + <Entry inputSpeed="0.00" inputTorque="2050.00" torqueLoss="46.06"/> + <Entry inputSpeed="0.00" inputTorque="2250.00" torqueLoss="50.06"/> + <Entry inputSpeed="0.00" inputTorque="3000.00" torqueLoss="54.06"/> + <Entry inputSpeed="100.00" inputTorque="-350.00" torqueLoss="12.56"/> + <Entry inputSpeed="100.00" inputTorque="-150.00" torqueLoss="8.56"/> + <Entry inputSpeed="100.00" inputTorque="50.00" torqueLoss="6.56"/> + <Entry inputSpeed="100.00" inputTorque="250.00" torqueLoss="10.56"/> + <Entry inputSpeed="100.00" inputTorque="450.00" torqueLoss="14.56"/> + <Entry inputSpeed="100.00" inputTorque="650.00" torqueLoss="18.56"/> + <Entry inputSpeed="100.00" inputTorque="850.00" torqueLoss="22.56"/> + <Entry inputSpeed="100.00" inputTorque="1050.00" torqueLoss="26.56"/> + <Entry inputSpeed="100.00" inputTorque="1250.00" torqueLoss="30.56"/> + <Entry inputSpeed="100.00" inputTorque="1450.00" torqueLoss="34.56"/> + <Entry inputSpeed="100.00" inputTorque="1650.00" torqueLoss="38.56"/> + <Entry inputSpeed="100.00" inputTorque="1850.00" torqueLoss="42.56"/> + <Entry inputSpeed="100.00" inputTorque="2050.00" torqueLoss="46.56"/> + <Entry inputSpeed="100.00" inputTorque="2250.00" torqueLoss="50.56"/> + <Entry inputSpeed="100.00" inputTorque="3000.00" torqueLoss="54.56"/> + <Entry inputSpeed="300.00" inputTorque="-350.00" torqueLoss="13.58"/> + <Entry inputSpeed="300.00" inputTorque="-150.00" torqueLoss="9.58"/> + <Entry inputSpeed="300.00" inputTorque="50.00" torqueLoss="7.58"/> + <Entry inputSpeed="300.00" inputTorque="250.00" torqueLoss="11.58"/> + <Entry inputSpeed="300.00" inputTorque="450.00" torqueLoss="15.58"/> + <Entry inputSpeed="300.00" inputTorque="650.00" torqueLoss="19.58"/> + <Entry inputSpeed="300.00" inputTorque="850.00" torqueLoss="23.58"/> + <Entry inputSpeed="300.00" inputTorque="1050.00" torqueLoss="27.58"/> + <Entry inputSpeed="300.00" inputTorque="1250.00" torqueLoss="31.58"/> + <Entry inputSpeed="300.00" inputTorque="1450.00" torqueLoss="35.58"/> + <Entry inputSpeed="300.00" inputTorque="1650.00" torqueLoss="39.58"/> + <Entry inputSpeed="300.00" inputTorque="1850.00" torqueLoss="43.58"/> + <Entry inputSpeed="300.00" inputTorque="2050.00" torqueLoss="47.58"/> + <Entry inputSpeed="300.00" inputTorque="2250.00" torqueLoss="51.58"/> + <Entry inputSpeed="300.00" inputTorque="3000.00" torqueLoss="55.58"/> + <Entry inputSpeed="500.00" inputTorque="-350.00" torqueLoss="14.59"/> + <Entry inputSpeed="500.00" inputTorque="-150.00" torqueLoss="10.59"/> + <Entry inputSpeed="500.00" inputTorque="50.00" torqueLoss="8.59"/> + <Entry inputSpeed="500.00" inputTorque="250.00" torqueLoss="12.59"/> + <Entry inputSpeed="500.00" inputTorque="450.00" torqueLoss="16.59"/> + <Entry inputSpeed="500.00" inputTorque="650.00" torqueLoss="20.59"/> + <Entry inputSpeed="500.00" inputTorque="850.00" torqueLoss="24.59"/> + <Entry inputSpeed="500.00" inputTorque="1050.00" torqueLoss="28.59"/> + <Entry inputSpeed="500.00" inputTorque="1250.00" torqueLoss="32.59"/> + <Entry inputSpeed="500.00" inputTorque="1450.00" torqueLoss="36.59"/> + <Entry inputSpeed="500.00" inputTorque="1650.00" torqueLoss="40.59"/> + <Entry inputSpeed="500.00" inputTorque="1850.00" torqueLoss="44.59"/> + <Entry inputSpeed="500.00" inputTorque="2050.00" torqueLoss="48.59"/> + <Entry inputSpeed="500.00" inputTorque="2250.00" torqueLoss="52.59"/> + <Entry inputSpeed="500.00" inputTorque="3000.00" torqueLoss="56.59"/> + <Entry inputSpeed="700.00" inputTorque="-350.00" torqueLoss="15.60"/> + <Entry inputSpeed="700.00" inputTorque="-150.00" torqueLoss="11.60"/> + <Entry inputSpeed="700.00" inputTorque="50.00" torqueLoss="9.60"/> + <Entry inputSpeed="700.00" inputTorque="250.00" torqueLoss="13.60"/> + <Entry inputSpeed="700.00" inputTorque="450.00" torqueLoss="17.60"/> + <Entry inputSpeed="700.00" inputTorque="650.00" torqueLoss="21.60"/> + <Entry inputSpeed="700.00" inputTorque="850.00" torqueLoss="25.60"/> + <Entry inputSpeed="700.00" inputTorque="1050.00" torqueLoss="29.60"/> + <Entry inputSpeed="700.00" inputTorque="1250.00" torqueLoss="33.60"/> + <Entry inputSpeed="700.00" inputTorque="1450.00" torqueLoss="37.60"/> + <Entry inputSpeed="700.00" inputTorque="1650.00" torqueLoss="41.60"/> + <Entry inputSpeed="700.00" inputTorque="1850.00" torqueLoss="45.60"/> + <Entry inputSpeed="700.00" inputTorque="2050.00" torqueLoss="49.60"/> + <Entry inputSpeed="700.00" inputTorque="2250.00" torqueLoss="53.60"/> + <Entry inputSpeed="700.00" inputTorque="3000.00" torqueLoss="57.60"/> + <Entry inputSpeed="900.00" inputTorque="-350.00" torqueLoss="16.61"/> + <Entry inputSpeed="900.00" inputTorque="-150.00" torqueLoss="12.61"/> + <Entry inputSpeed="900.00" inputTorque="50.00" torqueLoss="10.61"/> + <Entry inputSpeed="900.00" inputTorque="250.00" torqueLoss="14.61"/> + <Entry inputSpeed="900.00" inputTorque="450.00" torqueLoss="18.61"/> + <Entry inputSpeed="900.00" inputTorque="650.00" torqueLoss="22.61"/> + <Entry inputSpeed="900.00" inputTorque="850.00" torqueLoss="26.61"/> + <Entry inputSpeed="900.00" inputTorque="1050.00" torqueLoss="30.61"/> + <Entry inputSpeed="900.00" inputTorque="1250.00" torqueLoss="34.61"/> + <Entry inputSpeed="900.00" inputTorque="1450.00" torqueLoss="38.61"/> + <Entry inputSpeed="900.00" inputTorque="1650.00" torqueLoss="42.61"/> + <Entry inputSpeed="900.00" inputTorque="1850.00" torqueLoss="46.61"/> + <Entry inputSpeed="900.00" inputTorque="2050.00" torqueLoss="50.61"/> + <Entry inputSpeed="900.00" inputTorque="2250.00" torqueLoss="54.61"/> + <Entry inputSpeed="900.00" inputTorque="3000.00" torqueLoss="58.61"/> + <Entry inputSpeed="1100.00" inputTorque="-350.00" torqueLoss="17.63"/> + <Entry inputSpeed="1100.00" inputTorque="-150.00" torqueLoss="13.63"/> + <Entry inputSpeed="1100.00" inputTorque="50.00" torqueLoss="11.63"/> + <Entry inputSpeed="1100.00" inputTorque="250.00" torqueLoss="15.63"/> + <Entry inputSpeed="1100.00" inputTorque="450.00" torqueLoss="19.63"/> + <Entry inputSpeed="1100.00" inputTorque="650.00" torqueLoss="23.63"/> + <Entry inputSpeed="1100.00" inputTorque="850.00" torqueLoss="27.63"/> + <Entry inputSpeed="1100.00" inputTorque="1050.00" torqueLoss="31.63"/> + <Entry inputSpeed="1100.00" inputTorque="1250.00" torqueLoss="35.63"/> + <Entry inputSpeed="1100.00" inputTorque="1450.00" torqueLoss="39.63"/> + <Entry inputSpeed="1100.00" inputTorque="1650.00" torqueLoss="43.63"/> + <Entry inputSpeed="1100.00" inputTorque="1850.00" torqueLoss="47.63"/> + <Entry inputSpeed="1100.00" inputTorque="2050.00" torqueLoss="51.63"/> + <Entry inputSpeed="1100.00" inputTorque="2250.00" torqueLoss="55.63"/> + <Entry inputSpeed="1100.00" inputTorque="3000.00" torqueLoss="59.63"/> + <Entry inputSpeed="1300.00" inputTorque="-350.00" torqueLoss="18.64"/> + <Entry inputSpeed="1300.00" inputTorque="-150.00" torqueLoss="14.64"/> + <Entry inputSpeed="1300.00" inputTorque="50.00" torqueLoss="12.64"/> + <Entry inputSpeed="1300.00" inputTorque="250.00" torqueLoss="16.64"/> + <Entry inputSpeed="1300.00" inputTorque="450.00" torqueLoss="20.64"/> + <Entry inputSpeed="1300.00" inputTorque="650.00" torqueLoss="24.64"/> + <Entry inputSpeed="1300.00" inputTorque="850.00" torqueLoss="28.64"/> + <Entry inputSpeed="1300.00" inputTorque="1050.00" torqueLoss="32.64"/> + <Entry inputSpeed="1300.00" inputTorque="1250.00" torqueLoss="36.64"/> + <Entry inputSpeed="1300.00" inputTorque="1450.00" torqueLoss="40.64"/> + <Entry inputSpeed="1300.00" inputTorque="1650.00" torqueLoss="44.64"/> + <Entry inputSpeed="1300.00" inputTorque="1850.00" torqueLoss="48.64"/> + <Entry inputSpeed="1300.00" inputTorque="2050.00" torqueLoss="52.64"/> + <Entry inputSpeed="1300.00" inputTorque="2250.00" torqueLoss="56.64"/> + <Entry inputSpeed="1300.00" inputTorque="3000.00" torqueLoss="60.64"/> + <Entry inputSpeed="1500.00" inputTorque="-350.00" torqueLoss="19.65"/> + <Entry inputSpeed="1500.00" inputTorque="-150.00" torqueLoss="15.65"/> + <Entry inputSpeed="1500.00" inputTorque="50.00" torqueLoss="13.65"/> + <Entry inputSpeed="1500.00" inputTorque="250.00" torqueLoss="17.65"/> + <Entry inputSpeed="1500.00" inputTorque="450.00" torqueLoss="21.65"/> + <Entry inputSpeed="1500.00" inputTorque="650.00" torqueLoss="25.65"/> + <Entry inputSpeed="1500.00" inputTorque="850.00" torqueLoss="29.65"/> + <Entry inputSpeed="1500.00" inputTorque="1050.00" torqueLoss="33.65"/> + <Entry inputSpeed="1500.00" inputTorque="1250.00" torqueLoss="37.65"/> + <Entry inputSpeed="1500.00" inputTorque="1450.00" torqueLoss="41.65"/> + <Entry inputSpeed="1500.00" inputTorque="1650.00" torqueLoss="45.65"/> + <Entry inputSpeed="1500.00" inputTorque="1850.00" torqueLoss="49.65"/> + <Entry inputSpeed="1500.00" inputTorque="2050.00" torqueLoss="53.65"/> + <Entry inputSpeed="1500.00" inputTorque="2250.00" torqueLoss="57.65"/> + <Entry inputSpeed="1500.00" inputTorque="3000.00" torqueLoss="61.65"/> + <Entry inputSpeed="1700.00" inputTorque="-350.00" torqueLoss="20.66"/> + <Entry inputSpeed="1700.00" inputTorque="-150.00" torqueLoss="16.66"/> + <Entry inputSpeed="1700.00" inputTorque="50.00" torqueLoss="14.66"/> + <Entry inputSpeed="1700.00" inputTorque="250.00" torqueLoss="18.66"/> + <Entry inputSpeed="1700.00" inputTorque="450.00" torqueLoss="22.66"/> + <Entry inputSpeed="1700.00" inputTorque="650.00" torqueLoss="26.66"/> + <Entry inputSpeed="1700.00" inputTorque="850.00" torqueLoss="30.66"/> + <Entry inputSpeed="1700.00" inputTorque="1050.00" torqueLoss="34.66"/> + <Entry inputSpeed="1700.00" inputTorque="1250.00" torqueLoss="38.66"/> + <Entry inputSpeed="1700.00" inputTorque="1450.00" torqueLoss="42.66"/> + <Entry inputSpeed="1700.00" inputTorque="1650.00" torqueLoss="46.66"/> + <Entry inputSpeed="1700.00" inputTorque="1850.00" torqueLoss="50.66"/> + <Entry inputSpeed="1700.00" inputTorque="2050.00" torqueLoss="54.66"/> + <Entry inputSpeed="1700.00" inputTorque="2250.00" torqueLoss="58.66"/> + <Entry inputSpeed="1700.00" inputTorque="3000.00" torqueLoss="62.66"/> + <Entry inputSpeed="1900.00" inputTorque="-350.00" torqueLoss="21.67"/> + <Entry inputSpeed="1900.00" inputTorque="-150.00" torqueLoss="17.67"/> + <Entry inputSpeed="1900.00" inputTorque="50.00" torqueLoss="15.67"/> + <Entry inputSpeed="1900.00" inputTorque="250.00" torqueLoss="19.67"/> + <Entry inputSpeed="1900.00" inputTorque="450.00" torqueLoss="23.67"/> + <Entry inputSpeed="1900.00" inputTorque="650.00" torqueLoss="27.67"/> + <Entry inputSpeed="1900.00" inputTorque="850.00" torqueLoss="31.67"/> + <Entry inputSpeed="1900.00" inputTorque="1050.00" torqueLoss="35.67"/> + <Entry inputSpeed="1900.00" inputTorque="1250.00" torqueLoss="39.67"/> + <Entry inputSpeed="1900.00" inputTorque="1450.00" torqueLoss="43.67"/> + <Entry inputSpeed="1900.00" inputTorque="1650.00" torqueLoss="47.67"/> + <Entry inputSpeed="1900.00" inputTorque="1850.00" torqueLoss="51.67"/> + <Entry inputSpeed="1900.00" inputTorque="2050.00" torqueLoss="55.67"/> + <Entry inputSpeed="1900.00" inputTorque="2250.00" torqueLoss="59.67"/> + <Entry inputSpeed="1900.00" inputTorque="3000.00" torqueLoss="63.67"/> + <Entry inputSpeed="2100.00" inputTorque="-350.00" torqueLoss="22.69"/> + <Entry inputSpeed="2100.00" inputTorque="-150.00" torqueLoss="18.69"/> + <Entry inputSpeed="2100.00" inputTorque="50.00" torqueLoss="16.69"/> + <Entry inputSpeed="2100.00" inputTorque="250.00" torqueLoss="20.69"/> + <Entry inputSpeed="2100.00" inputTorque="450.00" torqueLoss="24.69"/> + <Entry inputSpeed="2100.00" inputTorque="650.00" torqueLoss="28.69"/> + <Entry inputSpeed="2100.00" inputTorque="850.00" torqueLoss="32.69"/> + <Entry inputSpeed="2100.00" inputTorque="1050.00" torqueLoss="36.69"/> + <Entry inputSpeed="2100.00" inputTorque="1250.00" torqueLoss="40.69"/> + <Entry inputSpeed="2100.00" inputTorque="1450.00" torqueLoss="44.69"/> + <Entry inputSpeed="2100.00" inputTorque="1650.00" torqueLoss="48.69"/> + <Entry inputSpeed="2100.00" inputTorque="1850.00" torqueLoss="52.69"/> + <Entry inputSpeed="2100.00" inputTorque="2050.00" torqueLoss="56.69"/> + <Entry inputSpeed="2100.00" inputTorque="2250.00" torqueLoss="60.69"/> + <Entry inputSpeed="2100.00" inputTorque="3000.00" torqueLoss="64.69"/> + <Entry inputSpeed="0.00" inputTorque="-1000.00" torqueLoss="25.06"/> + <Entry inputSpeed="100.00" inputTorque="-1000.00" torqueLoss="25.56"/> + <Entry inputSpeed="300.00" inputTorque="-1000.00" torqueLoss="26.58"/> + <Entry inputSpeed="500.00" inputTorque="-1000.00" torqueLoss="27.59"/> + <Entry inputSpeed="700.00" inputTorque="-1000.00" torqueLoss="28.60"/> + <Entry inputSpeed="900.00" inputTorque="-1000.00" torqueLoss="29.61"/> + <Entry inputSpeed="1100.00" inputTorque="-1000.00" torqueLoss="30.63"/> + <Entry inputSpeed="1300.00" inputTorque="-1000.00" torqueLoss="31.64"/> + <Entry inputSpeed="1500.00" inputTorque="-1000.00" torqueLoss="32.65"/> + <Entry inputSpeed="1700.00" inputTorque="-1000.00" torqueLoss="33.66"/> + <Entry inputSpeed="1900.00" inputTorque="-1000.00" torqueLoss="34.67"/> + <Entry inputSpeed="2100.00" inputTorque="-1000.00" torqueLoss="35.69"/> + </TorqueLossMap> + </Gear> + <Gear number="11"> + <Ratio>1.280</Ratio> + <MaxSpeed>2000</MaxSpeed> + <TorqueLossMap> + <Entry inputSpeed="0.00" inputTorque="-350.00" torqueLoss="12.06"/> + <Entry inputSpeed="0.00" inputTorque="-150.00" torqueLoss="8.06"/> + <Entry inputSpeed="0.00" inputTorque="50.00" torqueLoss="6.06"/> + <Entry inputSpeed="0.00" inputTorque="250.00" torqueLoss="10.06"/> + <Entry inputSpeed="0.00" inputTorque="450.00" torqueLoss="14.06"/> + <Entry inputSpeed="0.00" inputTorque="650.00" torqueLoss="18.06"/> + <Entry inputSpeed="0.00" inputTorque="850.00" torqueLoss="22.06"/> + <Entry inputSpeed="0.00" inputTorque="1050.00" torqueLoss="26.06"/> + <Entry inputSpeed="0.00" inputTorque="1250.00" torqueLoss="30.06"/> + <Entry inputSpeed="0.00" inputTorque="1450.00" torqueLoss="34.06"/> + <Entry inputSpeed="0.00" inputTorque="1650.00" torqueLoss="38.06"/> + <Entry inputSpeed="0.00" inputTorque="1850.00" torqueLoss="42.06"/> + <Entry inputSpeed="0.00" inputTorque="2050.00" torqueLoss="46.06"/> + <Entry inputSpeed="0.00" inputTorque="2250.00" torqueLoss="50.06"/> + <Entry inputSpeed="0.00" inputTorque="3000.00" torqueLoss="54.06"/> + <Entry inputSpeed="100.00" inputTorque="-350.00" torqueLoss="12.56"/> + <Entry inputSpeed="100.00" inputTorque="-150.00" torqueLoss="8.56"/> + <Entry inputSpeed="100.00" inputTorque="50.00" torqueLoss="6.56"/> + <Entry inputSpeed="100.00" inputTorque="250.00" torqueLoss="10.56"/> + <Entry inputSpeed="100.00" inputTorque="450.00" torqueLoss="14.56"/> + <Entry inputSpeed="100.00" inputTorque="650.00" torqueLoss="18.56"/> + <Entry inputSpeed="100.00" inputTorque="850.00" torqueLoss="22.56"/> + <Entry inputSpeed="100.00" inputTorque="1050.00" torqueLoss="26.56"/> + <Entry inputSpeed="100.00" inputTorque="1250.00" torqueLoss="30.56"/> + <Entry inputSpeed="100.00" inputTorque="1450.00" torqueLoss="34.56"/> + <Entry inputSpeed="100.00" inputTorque="1650.00" torqueLoss="38.56"/> + <Entry inputSpeed="100.00" inputTorque="1850.00" torqueLoss="42.56"/> + <Entry inputSpeed="100.00" inputTorque="2050.00" torqueLoss="46.56"/> + <Entry inputSpeed="100.00" inputTorque="2250.00" torqueLoss="50.56"/> + <Entry inputSpeed="100.00" inputTorque="3000.00" torqueLoss="54.56"/> + <Entry inputSpeed="300.00" inputTorque="-350.00" torqueLoss="13.58"/> + <Entry inputSpeed="300.00" inputTorque="-150.00" torqueLoss="9.58"/> + <Entry inputSpeed="300.00" inputTorque="50.00" torqueLoss="7.58"/> + <Entry inputSpeed="300.00" inputTorque="250.00" torqueLoss="11.58"/> + <Entry inputSpeed="300.00" inputTorque="450.00" torqueLoss="15.58"/> + <Entry inputSpeed="300.00" inputTorque="650.00" torqueLoss="19.58"/> + <Entry inputSpeed="300.00" inputTorque="850.00" torqueLoss="23.58"/> + <Entry inputSpeed="300.00" inputTorque="1050.00" torqueLoss="27.58"/> + <Entry inputSpeed="300.00" inputTorque="1250.00" torqueLoss="31.58"/> + <Entry inputSpeed="300.00" inputTorque="1450.00" torqueLoss="35.58"/> + <Entry inputSpeed="300.00" inputTorque="1650.00" torqueLoss="39.58"/> + <Entry inputSpeed="300.00" inputTorque="1850.00" torqueLoss="43.58"/> + <Entry inputSpeed="300.00" inputTorque="2050.00" torqueLoss="47.58"/> + <Entry inputSpeed="300.00" inputTorque="2250.00" torqueLoss="51.58"/> + <Entry inputSpeed="300.00" inputTorque="3000.00" torqueLoss="55.58"/> + <Entry inputSpeed="500.00" inputTorque="-350.00" torqueLoss="14.59"/> + <Entry inputSpeed="500.00" inputTorque="-150.00" torqueLoss="10.59"/> + <Entry inputSpeed="500.00" inputTorque="50.00" torqueLoss="8.59"/> + <Entry inputSpeed="500.00" inputTorque="250.00" torqueLoss="12.59"/> + <Entry inputSpeed="500.00" inputTorque="450.00" torqueLoss="16.59"/> + <Entry inputSpeed="500.00" inputTorque="650.00" torqueLoss="20.59"/> + <Entry inputSpeed="500.00" inputTorque="850.00" torqueLoss="24.59"/> + <Entry inputSpeed="500.00" inputTorque="1050.00" torqueLoss="28.59"/> + <Entry inputSpeed="500.00" inputTorque="1250.00" torqueLoss="32.59"/> + <Entry inputSpeed="500.00" inputTorque="1450.00" torqueLoss="36.59"/> + <Entry inputSpeed="500.00" inputTorque="1650.00" torqueLoss="40.59"/> + <Entry inputSpeed="500.00" inputTorque="1850.00" torqueLoss="44.59"/> + <Entry inputSpeed="500.00" inputTorque="2050.00" torqueLoss="48.59"/> + <Entry inputSpeed="500.00" inputTorque="2250.00" torqueLoss="52.59"/> + <Entry inputSpeed="500.00" inputTorque="3000.00" torqueLoss="56.59"/> + <Entry inputSpeed="700.00" inputTorque="-350.00" torqueLoss="15.60"/> + <Entry inputSpeed="700.00" inputTorque="-150.00" torqueLoss="11.60"/> + <Entry inputSpeed="700.00" inputTorque="50.00" torqueLoss="9.60"/> + <Entry inputSpeed="700.00" inputTorque="250.00" torqueLoss="13.60"/> + <Entry inputSpeed="700.00" inputTorque="450.00" torqueLoss="17.60"/> + <Entry inputSpeed="700.00" inputTorque="650.00" torqueLoss="21.60"/> + <Entry inputSpeed="700.00" inputTorque="850.00" torqueLoss="25.60"/> + <Entry inputSpeed="700.00" inputTorque="1050.00" torqueLoss="29.60"/> + <Entry inputSpeed="700.00" inputTorque="1250.00" torqueLoss="33.60"/> + <Entry inputSpeed="700.00" inputTorque="1450.00" torqueLoss="37.60"/> + <Entry inputSpeed="700.00" inputTorque="1650.00" torqueLoss="41.60"/> + <Entry inputSpeed="700.00" inputTorque="1850.00" torqueLoss="45.60"/> + <Entry inputSpeed="700.00" inputTorque="2050.00" torqueLoss="49.60"/> + <Entry inputSpeed="700.00" inputTorque="2250.00" torqueLoss="53.60"/> + <Entry inputSpeed="700.00" inputTorque="3000.00" torqueLoss="57.60"/> + <Entry inputSpeed="900.00" inputTorque="-350.00" torqueLoss="16.61"/> + <Entry inputSpeed="900.00" inputTorque="-150.00" torqueLoss="12.61"/> + <Entry inputSpeed="900.00" inputTorque="50.00" torqueLoss="10.61"/> + <Entry inputSpeed="900.00" inputTorque="250.00" torqueLoss="14.61"/> + <Entry inputSpeed="900.00" inputTorque="450.00" torqueLoss="18.61"/> + <Entry inputSpeed="900.00" inputTorque="650.00" torqueLoss="22.61"/> + <Entry inputSpeed="900.00" inputTorque="850.00" torqueLoss="26.61"/> + <Entry inputSpeed="900.00" inputTorque="1050.00" torqueLoss="30.61"/> + <Entry inputSpeed="900.00" inputTorque="1250.00" torqueLoss="34.61"/> + <Entry inputSpeed="900.00" inputTorque="1450.00" torqueLoss="38.61"/> + <Entry inputSpeed="900.00" inputTorque="1650.00" torqueLoss="42.61"/> + <Entry inputSpeed="900.00" inputTorque="1850.00" torqueLoss="46.61"/> + <Entry inputSpeed="900.00" inputTorque="2050.00" torqueLoss="50.61"/> + <Entry inputSpeed="900.00" inputTorque="2250.00" torqueLoss="54.61"/> + <Entry inputSpeed="900.00" inputTorque="3000.00" torqueLoss="58.61"/> + <Entry inputSpeed="1100.00" inputTorque="-350.00" torqueLoss="17.63"/> + <Entry inputSpeed="1100.00" inputTorque="-150.00" torqueLoss="13.63"/> + <Entry inputSpeed="1100.00" inputTorque="50.00" torqueLoss="11.63"/> + <Entry inputSpeed="1100.00" inputTorque="250.00" torqueLoss="15.63"/> + <Entry inputSpeed="1100.00" inputTorque="450.00" torqueLoss="19.63"/> + <Entry inputSpeed="1100.00" inputTorque="650.00" torqueLoss="23.63"/> + <Entry inputSpeed="1100.00" inputTorque="850.00" torqueLoss="27.63"/> + <Entry inputSpeed="1100.00" inputTorque="1050.00" torqueLoss="31.63"/> + <Entry inputSpeed="1100.00" inputTorque="1250.00" torqueLoss="35.63"/> + <Entry inputSpeed="1100.00" inputTorque="1450.00" torqueLoss="39.63"/> + <Entry inputSpeed="1100.00" inputTorque="1650.00" torqueLoss="43.63"/> + <Entry inputSpeed="1100.00" inputTorque="1850.00" torqueLoss="47.63"/> + <Entry inputSpeed="1100.00" inputTorque="2050.00" torqueLoss="51.63"/> + <Entry inputSpeed="1100.00" inputTorque="2250.00" torqueLoss="55.63"/> + <Entry inputSpeed="1100.00" inputTorque="3000.00" torqueLoss="59.63"/> + <Entry inputSpeed="1300.00" inputTorque="-350.00" torqueLoss="18.64"/> + <Entry inputSpeed="1300.00" inputTorque="-150.00" torqueLoss="14.64"/> + <Entry inputSpeed="1300.00" inputTorque="50.00" torqueLoss="12.64"/> + <Entry inputSpeed="1300.00" inputTorque="250.00" torqueLoss="16.64"/> + <Entry inputSpeed="1300.00" inputTorque="450.00" torqueLoss="20.64"/> + <Entry inputSpeed="1300.00" inputTorque="650.00" torqueLoss="24.64"/> + <Entry inputSpeed="1300.00" inputTorque="850.00" torqueLoss="28.64"/> + <Entry inputSpeed="1300.00" inputTorque="1050.00" torqueLoss="32.64"/> + <Entry inputSpeed="1300.00" inputTorque="1250.00" torqueLoss="36.64"/> + <Entry inputSpeed="1300.00" inputTorque="1450.00" torqueLoss="40.64"/> + <Entry inputSpeed="1300.00" inputTorque="1650.00" torqueLoss="44.64"/> + <Entry inputSpeed="1300.00" inputTorque="1850.00" torqueLoss="48.64"/> + <Entry inputSpeed="1300.00" inputTorque="2050.00" torqueLoss="52.64"/> + <Entry inputSpeed="1300.00" inputTorque="2250.00" torqueLoss="56.64"/> + <Entry inputSpeed="1300.00" inputTorque="3000.00" torqueLoss="60.64"/> + <Entry inputSpeed="1500.00" inputTorque="-350.00" torqueLoss="19.65"/> + <Entry inputSpeed="1500.00" inputTorque="-150.00" torqueLoss="15.65"/> + <Entry inputSpeed="1500.00" inputTorque="50.00" torqueLoss="13.65"/> + <Entry inputSpeed="1500.00" inputTorque="250.00" torqueLoss="17.65"/> + <Entry inputSpeed="1500.00" inputTorque="450.00" torqueLoss="21.65"/> + <Entry inputSpeed="1500.00" inputTorque="650.00" torqueLoss="25.65"/> + <Entry inputSpeed="1500.00" inputTorque="850.00" torqueLoss="29.65"/> + <Entry inputSpeed="1500.00" inputTorque="1050.00" torqueLoss="33.65"/> + <Entry inputSpeed="1500.00" inputTorque="1250.00" torqueLoss="37.65"/> + <Entry inputSpeed="1500.00" inputTorque="1450.00" torqueLoss="41.65"/> + <Entry inputSpeed="1500.00" inputTorque="1650.00" torqueLoss="45.65"/> + <Entry inputSpeed="1500.00" inputTorque="1850.00" torqueLoss="49.65"/> + <Entry inputSpeed="1500.00" inputTorque="2050.00" torqueLoss="53.65"/> + <Entry inputSpeed="1500.00" inputTorque="2250.00" torqueLoss="57.65"/> + <Entry inputSpeed="1500.00" inputTorque="3000.00" torqueLoss="61.65"/> + <Entry inputSpeed="1700.00" inputTorque="-350.00" torqueLoss="20.66"/> + <Entry inputSpeed="1700.00" inputTorque="-150.00" torqueLoss="16.66"/> + <Entry inputSpeed="1700.00" inputTorque="50.00" torqueLoss="14.66"/> + <Entry inputSpeed="1700.00" inputTorque="250.00" torqueLoss="18.66"/> + <Entry inputSpeed="1700.00" inputTorque="450.00" torqueLoss="22.66"/> + <Entry inputSpeed="1700.00" inputTorque="650.00" torqueLoss="26.66"/> + <Entry inputSpeed="1700.00" inputTorque="850.00" torqueLoss="30.66"/> + <Entry inputSpeed="1700.00" inputTorque="1050.00" torqueLoss="34.66"/> + <Entry inputSpeed="1700.00" inputTorque="1250.00" torqueLoss="38.66"/> + <Entry inputSpeed="1700.00" inputTorque="1450.00" torqueLoss="42.66"/> + <Entry inputSpeed="1700.00" inputTorque="1650.00" torqueLoss="46.66"/> + <Entry inputSpeed="1700.00" inputTorque="1850.00" torqueLoss="50.66"/> + <Entry inputSpeed="1700.00" inputTorque="2050.00" torqueLoss="54.66"/> + <Entry inputSpeed="1700.00" inputTorque="2250.00" torqueLoss="58.66"/> + <Entry inputSpeed="1700.00" inputTorque="3000.00" torqueLoss="62.66"/> + <Entry inputSpeed="1900.00" inputTorque="-350.00" torqueLoss="21.67"/> + <Entry inputSpeed="1900.00" inputTorque="-150.00" torqueLoss="17.67"/> + <Entry inputSpeed="1900.00" inputTorque="50.00" torqueLoss="15.67"/> + <Entry inputSpeed="1900.00" inputTorque="250.00" torqueLoss="19.67"/> + <Entry inputSpeed="1900.00" inputTorque="450.00" torqueLoss="23.67"/> + <Entry inputSpeed="1900.00" inputTorque="650.00" torqueLoss="27.67"/> + <Entry inputSpeed="1900.00" inputTorque="850.00" torqueLoss="31.67"/> + <Entry inputSpeed="1900.00" inputTorque="1050.00" torqueLoss="35.67"/> + <Entry inputSpeed="1900.00" inputTorque="1250.00" torqueLoss="39.67"/> + <Entry inputSpeed="1900.00" inputTorque="1450.00" torqueLoss="43.67"/> + <Entry inputSpeed="1900.00" inputTorque="1650.00" torqueLoss="47.67"/> + <Entry inputSpeed="1900.00" inputTorque="1850.00" torqueLoss="51.67"/> + <Entry inputSpeed="1900.00" inputTorque="2050.00" torqueLoss="55.67"/> + <Entry inputSpeed="1900.00" inputTorque="2250.00" torqueLoss="59.67"/> + <Entry inputSpeed="1900.00" inputTorque="3000.00" torqueLoss="63.67"/> + <Entry inputSpeed="2100.00" inputTorque="-350.00" torqueLoss="22.69"/> + <Entry inputSpeed="2100.00" inputTorque="-150.00" torqueLoss="18.69"/> + <Entry inputSpeed="2100.00" inputTorque="50.00" torqueLoss="16.69"/> + <Entry inputSpeed="2100.00" inputTorque="250.00" torqueLoss="20.69"/> + <Entry inputSpeed="2100.00" inputTorque="450.00" torqueLoss="24.69"/> + <Entry inputSpeed="2100.00" inputTorque="650.00" torqueLoss="28.69"/> + <Entry inputSpeed="2100.00" inputTorque="850.00" torqueLoss="32.69"/> + <Entry inputSpeed="2100.00" inputTorque="1050.00" torqueLoss="36.69"/> + <Entry inputSpeed="2100.00" inputTorque="1250.00" torqueLoss="40.69"/> + <Entry inputSpeed="2100.00" inputTorque="1450.00" torqueLoss="44.69"/> + <Entry inputSpeed="2100.00" inputTorque="1650.00" torqueLoss="48.69"/> + <Entry inputSpeed="2100.00" inputTorque="1850.00" torqueLoss="52.69"/> + <Entry inputSpeed="2100.00" inputTorque="2050.00" torqueLoss="56.69"/> + <Entry inputSpeed="2100.00" inputTorque="2250.00" torqueLoss="60.69"/> + <Entry inputSpeed="2100.00" inputTorque="3000.00" torqueLoss="64.69"/> + <Entry inputSpeed="0.00" inputTorque="-1000.00" torqueLoss="25.06"/> + <Entry inputSpeed="100.00" inputTorque="-1000.00" torqueLoss="25.56"/> + <Entry inputSpeed="300.00" inputTorque="-1000.00" torqueLoss="26.58"/> + <Entry inputSpeed="500.00" inputTorque="-1000.00" torqueLoss="27.59"/> + <Entry inputSpeed="700.00" inputTorque="-1000.00" torqueLoss="28.60"/> + <Entry inputSpeed="900.00" inputTorque="-1000.00" torqueLoss="29.61"/> + <Entry inputSpeed="1100.00" inputTorque="-1000.00" torqueLoss="30.63"/> + <Entry inputSpeed="1300.00" inputTorque="-1000.00" torqueLoss="31.64"/> + <Entry inputSpeed="1500.00" inputTorque="-1000.00" torqueLoss="32.65"/> + <Entry inputSpeed="1700.00" inputTorque="-1000.00" torqueLoss="33.66"/> + <Entry inputSpeed="1900.00" inputTorque="-1000.00" torqueLoss="34.67"/> + <Entry inputSpeed="2100.00" inputTorque="-1000.00" torqueLoss="35.69"/> + </TorqueLossMap> + </Gear> + <Gear number="12"> + <Ratio>1.000</Ratio> + <TorqueLossMap> + <Entry inputSpeed="0.00" inputTorque="-350.00" torqueLoss="6.81"/> + <Entry inputSpeed="0.00" inputTorque="-150.00" torqueLoss="5.81"/> + <Entry inputSpeed="0.00" inputTorque="50.00" torqueLoss="5.31"/> + <Entry inputSpeed="0.00" inputTorque="250.00" torqueLoss="6.31"/> + <Entry inputSpeed="0.00" inputTorque="450.00" torqueLoss="7.31"/> + <Entry inputSpeed="0.00" inputTorque="650.00" torqueLoss="8.31"/> + <Entry inputSpeed="0.00" inputTorque="850.00" torqueLoss="9.31"/> + <Entry inputSpeed="0.00" inputTorque="1050.00" torqueLoss="10.31"/> + <Entry inputSpeed="0.00" inputTorque="1250.00" torqueLoss="11.31"/> + <Entry inputSpeed="0.00" inputTorque="1450.00" torqueLoss="12.31"/> + <Entry inputSpeed="0.00" inputTorque="1650.00" torqueLoss="13.31"/> + <Entry inputSpeed="0.00" inputTorque="1850.00" torqueLoss="14.31"/> + <Entry inputSpeed="0.00" inputTorque="2050.00" torqueLoss="15.31"/> + <Entry inputSpeed="0.00" inputTorque="2250.00" torqueLoss="16.31"/> + <Entry inputSpeed="0.00" inputTorque="2800.00" torqueLoss="17.31"/> + <Entry inputSpeed="100.00" inputTorque="-350.00" torqueLoss="7.32"/> + <Entry inputSpeed="100.00" inputTorque="-150.00" torqueLoss="6.32"/> + <Entry inputSpeed="100.00" inputTorque="50.00" torqueLoss="5.82"/> + <Entry inputSpeed="100.00" inputTorque="250.00" torqueLoss="6.82"/> + <Entry inputSpeed="100.00" inputTorque="450.00" torqueLoss="7.82"/> + <Entry inputSpeed="100.00" inputTorque="650.00" torqueLoss="8.82"/> + <Entry inputSpeed="100.00" inputTorque="850.00" torqueLoss="9.82"/> + <Entry inputSpeed="100.00" inputTorque="1050.00" torqueLoss="10.82"/> + <Entry inputSpeed="100.00" inputTorque="1250.00" torqueLoss="11.82"/> + <Entry inputSpeed="100.00" inputTorque="1450.00" torqueLoss="12.82"/> + <Entry inputSpeed="100.00" inputTorque="1650.00" torqueLoss="13.82"/> + <Entry inputSpeed="100.00" inputTorque="1850.00" torqueLoss="14.82"/> + <Entry inputSpeed="100.00" inputTorque="2050.00" torqueLoss="15.82"/> + <Entry inputSpeed="100.00" inputTorque="2250.00" torqueLoss="16.82"/> + <Entry inputSpeed="100.00" inputTorque="2800.00" torqueLoss="17.82"/> + <Entry inputSpeed="300.00" inputTorque="-350.00" torqueLoss="8.33"/> + <Entry inputSpeed="300.00" inputTorque="-150.00" torqueLoss="7.33"/> + <Entry inputSpeed="300.00" inputTorque="50.00" torqueLoss="6.83"/> + <Entry inputSpeed="300.00" inputTorque="250.00" torqueLoss="7.83"/> + <Entry inputSpeed="300.00" inputTorque="450.00" torqueLoss="8.83"/> + <Entry inputSpeed="300.00" inputTorque="650.00" torqueLoss="9.83"/> + <Entry inputSpeed="300.00" inputTorque="850.00" torqueLoss="10.83"/> + <Entry inputSpeed="300.00" inputTorque="1050.00" torqueLoss="11.83"/> + <Entry inputSpeed="300.00" inputTorque="1250.00" torqueLoss="12.83"/> + <Entry inputSpeed="300.00" inputTorque="1450.00" torqueLoss="13.83"/> + <Entry inputSpeed="300.00" inputTorque="1650.00" torqueLoss="14.83"/> + <Entry inputSpeed="300.00" inputTorque="1850.00" torqueLoss="15.83"/> + <Entry inputSpeed="300.00" inputTorque="2050.00" torqueLoss="16.83"/> + <Entry inputSpeed="300.00" inputTorque="2250.00" torqueLoss="17.83"/> + <Entry inputSpeed="300.00" inputTorque="2800.00" torqueLoss="18.83"/> + <Entry inputSpeed="500.00" inputTorque="-350.00" torqueLoss="9.34"/> + <Entry inputSpeed="500.00" inputTorque="-150.00" torqueLoss="8.34"/> + <Entry inputSpeed="500.00" inputTorque="50.00" torqueLoss="7.84"/> + <Entry inputSpeed="500.00" inputTorque="250.00" torqueLoss="8.84"/> + <Entry inputSpeed="500.00" inputTorque="450.00" torqueLoss="9.84"/> + <Entry inputSpeed="500.00" inputTorque="650.00" torqueLoss="10.84"/> + <Entry inputSpeed="500.00" inputTorque="850.00" torqueLoss="11.84"/> + <Entry inputSpeed="500.00" inputTorque="1050.00" torqueLoss="12.84"/> + <Entry inputSpeed="500.00" inputTorque="1250.00" torqueLoss="13.84"/> + <Entry inputSpeed="500.00" inputTorque="1450.00" torqueLoss="14.84"/> + <Entry inputSpeed="500.00" inputTorque="1650.00" torqueLoss="15.84"/> + <Entry inputSpeed="500.00" inputTorque="1850.00" torqueLoss="16.84"/> + <Entry inputSpeed="500.00" inputTorque="2050.00" torqueLoss="17.84"/> + <Entry inputSpeed="500.00" inputTorque="2250.00" torqueLoss="18.84"/> + <Entry inputSpeed="500.00" inputTorque="2800.00" torqueLoss="19.84"/> + <Entry inputSpeed="700.00" inputTorque="-350.00" torqueLoss="10.35"/> + <Entry inputSpeed="700.00" inputTorque="-150.00" torqueLoss="9.35"/> + <Entry inputSpeed="700.00" inputTorque="50.00" torqueLoss="8.85"/> + <Entry inputSpeed="700.00" inputTorque="250.00" torqueLoss="9.85"/> + <Entry inputSpeed="700.00" inputTorque="450.00" torqueLoss="10.85"/> + <Entry inputSpeed="700.00" inputTorque="650.00" torqueLoss="11.85"/> + <Entry inputSpeed="700.00" inputTorque="850.00" torqueLoss="12.85"/> + <Entry inputSpeed="700.00" inputTorque="1050.00" torqueLoss="13.85"/> + <Entry inputSpeed="700.00" inputTorque="1250.00" torqueLoss="14.85"/> + <Entry inputSpeed="700.00" inputTorque="1450.00" torqueLoss="15.85"/> + <Entry inputSpeed="700.00" inputTorque="1650.00" torqueLoss="16.85"/> + <Entry inputSpeed="700.00" inputTorque="1850.00" torqueLoss="17.85"/> + <Entry inputSpeed="700.00" inputTorque="2050.00" torqueLoss="18.85"/> + <Entry inputSpeed="700.00" inputTorque="2250.00" torqueLoss="19.85"/> + <Entry inputSpeed="700.00" inputTorque="2800.00" torqueLoss="20.85"/> + <Entry inputSpeed="900.00" inputTorque="-350.00" torqueLoss="11.36"/> + <Entry inputSpeed="900.00" inputTorque="-150.00" torqueLoss="10.36"/> + <Entry inputSpeed="900.00" inputTorque="50.00" torqueLoss="9.86"/> + <Entry inputSpeed="900.00" inputTorque="250.00" torqueLoss="10.86"/> + <Entry inputSpeed="900.00" inputTorque="450.00" torqueLoss="11.86"/> + <Entry inputSpeed="900.00" inputTorque="650.00" torqueLoss="12.86"/> + <Entry inputSpeed="900.00" inputTorque="850.00" torqueLoss="13.86"/> + <Entry inputSpeed="900.00" inputTorque="1050.00" torqueLoss="14.86"/> + <Entry inputSpeed="900.00" inputTorque="1250.00" torqueLoss="15.86"/> + <Entry inputSpeed="900.00" inputTorque="1450.00" torqueLoss="16.86"/> + <Entry inputSpeed="900.00" inputTorque="1650.00" torqueLoss="17.86"/> + <Entry inputSpeed="900.00" inputTorque="1850.00" torqueLoss="18.86"/> + <Entry inputSpeed="900.00" inputTorque="2050.00" torqueLoss="19.86"/> + <Entry inputSpeed="900.00" inputTorque="2250.00" torqueLoss="20.86"/> + <Entry inputSpeed="900.00" inputTorque="2800.00" torqueLoss="21.86"/> + <Entry inputSpeed="1100.00" inputTorque="-350.00" torqueLoss="12.37"/> + <Entry inputSpeed="1100.00" inputTorque="-150.00" torqueLoss="11.37"/> + <Entry inputSpeed="1100.00" inputTorque="50.00" torqueLoss="10.88"/> + <Entry inputSpeed="1100.00" inputTorque="250.00" torqueLoss="11.88"/> + <Entry inputSpeed="1100.00" inputTorque="450.00" torqueLoss="12.88"/> + <Entry inputSpeed="1100.00" inputTorque="650.00" torqueLoss="13.88"/> + <Entry inputSpeed="1100.00" inputTorque="850.00" torqueLoss="14.88"/> + <Entry inputSpeed="1100.00" inputTorque="1050.00" torqueLoss="15.88"/> + <Entry inputSpeed="1100.00" inputTorque="1250.00" torqueLoss="16.88"/> + <Entry inputSpeed="1100.00" inputTorque="1450.00" torqueLoss="17.88"/> + <Entry inputSpeed="1100.00" inputTorque="1650.00" torqueLoss="18.88"/> + <Entry inputSpeed="1100.00" inputTorque="1850.00" torqueLoss="19.88"/> + <Entry inputSpeed="1100.00" inputTorque="2050.00" torqueLoss="20.88"/> + <Entry inputSpeed="1100.00" inputTorque="2250.00" torqueLoss="21.88"/> + <Entry inputSpeed="1100.00" inputTorque="2800.00" torqueLoss="22.88"/> + <Entry inputSpeed="1300.00" inputTorque="-350.00" torqueLoss="13.39"/> + <Entry inputSpeed="1300.00" inputTorque="-150.00" torqueLoss="12.39"/> + <Entry inputSpeed="1300.00" inputTorque="50.00" torqueLoss="11.89"/> + <Entry inputSpeed="1300.00" inputTorque="250.00" torqueLoss="12.89"/> + <Entry inputSpeed="1300.00" inputTorque="450.00" torqueLoss="13.89"/> + <Entry inputSpeed="1300.00" inputTorque="650.00" torqueLoss="14.89"/> + <Entry inputSpeed="1300.00" inputTorque="850.00" torqueLoss="15.89"/> + <Entry inputSpeed="1300.00" inputTorque="1050.00" torqueLoss="16.89"/> + <Entry inputSpeed="1300.00" inputTorque="1250.00" torqueLoss="17.89"/> + <Entry inputSpeed="1300.00" inputTorque="1450.00" torqueLoss="18.89"/> + <Entry inputSpeed="1300.00" inputTorque="1650.00" torqueLoss="19.89"/> + <Entry inputSpeed="1300.00" inputTorque="1850.00" torqueLoss="20.89"/> + <Entry inputSpeed="1300.00" inputTorque="2050.00" torqueLoss="21.89"/> + <Entry inputSpeed="1300.00" inputTorque="2250.00" torqueLoss="22.89"/> + <Entry inputSpeed="1300.00" inputTorque="2800.00" torqueLoss="23.89"/> + <Entry inputSpeed="1500.00" inputTorque="-350.00" torqueLoss="14.40"/> + <Entry inputSpeed="1500.00" inputTorque="-150.00" torqueLoss="13.40"/> + <Entry inputSpeed="1500.00" inputTorque="50.00" torqueLoss="12.90"/> + <Entry inputSpeed="1500.00" inputTorque="250.00" torqueLoss="13.90"/> + <Entry inputSpeed="1500.00" inputTorque="450.00" torqueLoss="14.90"/> + <Entry inputSpeed="1500.00" inputTorque="650.00" torqueLoss="15.90"/> + <Entry inputSpeed="1500.00" inputTorque="850.00" torqueLoss="16.90"/> + <Entry inputSpeed="1500.00" inputTorque="1050.00" torqueLoss="17.90"/> + <Entry inputSpeed="1500.00" inputTorque="1250.00" torqueLoss="18.90"/> + <Entry inputSpeed="1500.00" inputTorque="1450.00" torqueLoss="19.90"/> + <Entry inputSpeed="1500.00" inputTorque="1650.00" torqueLoss="20.90"/> + <Entry inputSpeed="1500.00" inputTorque="1850.00" torqueLoss="21.90"/> + <Entry inputSpeed="1500.00" inputTorque="2050.00" torqueLoss="22.90"/> + <Entry inputSpeed="1500.00" inputTorque="2250.00" torqueLoss="23.90"/> + <Entry inputSpeed="1500.00" inputTorque="2800.00" torqueLoss="24.90"/> + <Entry inputSpeed="1700.00" inputTorque="-350.00" torqueLoss="15.41"/> + <Entry inputSpeed="1700.00" inputTorque="-150.00" torqueLoss="14.41"/> + <Entry inputSpeed="1700.00" inputTorque="50.00" torqueLoss="13.91"/> + <Entry inputSpeed="1700.00" inputTorque="250.00" torqueLoss="14.91"/> + <Entry inputSpeed="1700.00" inputTorque="450.00" torqueLoss="15.91"/> + <Entry inputSpeed="1700.00" inputTorque="650.00" torqueLoss="16.91"/> + <Entry inputSpeed="1700.00" inputTorque="850.00" torqueLoss="17.91"/> + <Entry inputSpeed="1700.00" inputTorque="1050.00" torqueLoss="18.91"/> + <Entry inputSpeed="1700.00" inputTorque="1250.00" torqueLoss="19.91"/> + <Entry inputSpeed="1700.00" inputTorque="1450.00" torqueLoss="20.91"/> + <Entry inputSpeed="1700.00" inputTorque="1650.00" torqueLoss="21.91"/> + <Entry inputSpeed="1700.00" inputTorque="1850.00" torqueLoss="22.91"/> + <Entry inputSpeed="1700.00" inputTorque="2050.00" torqueLoss="23.91"/> + <Entry inputSpeed="1700.00" inputTorque="2250.00" torqueLoss="24.91"/> + <Entry inputSpeed="1700.00" inputTorque="2800.00" torqueLoss="25.91"/> + <Entry inputSpeed="1900.00" inputTorque="-350.00" torqueLoss="16.42"/> + <Entry inputSpeed="1900.00" inputTorque="-150.00" torqueLoss="15.42"/> + <Entry inputSpeed="1900.00" inputTorque="50.00" torqueLoss="14.92"/> + <Entry inputSpeed="1900.00" inputTorque="250.00" torqueLoss="15.92"/> + <Entry inputSpeed="1900.00" inputTorque="450.00" torqueLoss="16.92"/> + <Entry inputSpeed="1900.00" inputTorque="650.00" torqueLoss="17.92"/> + <Entry inputSpeed="1900.00" inputTorque="850.00" torqueLoss="18.92"/> + <Entry inputSpeed="1900.00" inputTorque="1050.00" torqueLoss="19.92"/> + <Entry inputSpeed="1900.00" inputTorque="1250.00" torqueLoss="20.92"/> + <Entry inputSpeed="1900.00" inputTorque="1450.00" torqueLoss="21.92"/> + <Entry inputSpeed="1900.00" inputTorque="1650.00" torqueLoss="22.92"/> + <Entry inputSpeed="1900.00" inputTorque="1850.00" torqueLoss="23.92"/> + <Entry inputSpeed="1900.00" inputTorque="2050.00" torqueLoss="24.92"/> + <Entry inputSpeed="1900.00" inputTorque="2250.00" torqueLoss="25.92"/> + <Entry inputSpeed="1900.00" inputTorque="2800.00" torqueLoss="26.92"/> + <Entry inputSpeed="2100.00" inputTorque="-350.00" torqueLoss="17.43"/> + <Entry inputSpeed="2100.00" inputTorque="-150.00" torqueLoss="16.43"/> + <Entry inputSpeed="2100.00" inputTorque="50.00" torqueLoss="15.94"/> + <Entry inputSpeed="2100.00" inputTorque="250.00" torqueLoss="16.94"/> + <Entry inputSpeed="2100.00" inputTorque="450.00" torqueLoss="17.94"/> + <Entry inputSpeed="2100.00" inputTorque="650.00" torqueLoss="18.94"/> + <Entry inputSpeed="2100.00" inputTorque="850.00" torqueLoss="19.94"/> + <Entry inputSpeed="2100.00" inputTorque="1050.00" torqueLoss="20.94"/> + <Entry inputSpeed="2100.00" inputTorque="1250.00" torqueLoss="21.94"/> + <Entry inputSpeed="2100.00" inputTorque="1450.00" torqueLoss="22.94"/> + <Entry inputSpeed="2100.00" inputTorque="1650.00" torqueLoss="23.94"/> + <Entry inputSpeed="2100.00" inputTorque="1850.00" torqueLoss="24.94"/> + <Entry inputSpeed="2100.00" inputTorque="2050.00" torqueLoss="25.94"/> + <Entry inputSpeed="2100.00" inputTorque="2250.00" torqueLoss="26.94"/> + <Entry inputSpeed="2100.00" inputTorque="2800.00" torqueLoss="27.94"/> + <Entry inputSpeed="0.00" inputTorque="-1000.00" torqueLoss="10.06"/> + <Entry inputSpeed="100.00" inputTorque="-1000.00" torqueLoss="10.56"/> + <Entry inputSpeed="300.00" inputTorque="-1000.00" torqueLoss="11.58"/> + <Entry inputSpeed="500.00" inputTorque="-1000.00" torqueLoss="12.59"/> + <Entry inputSpeed="700.00" inputTorque="-1000.00" torqueLoss="13.60"/> + <Entry inputSpeed="900.00" inputTorque="-1000.00" torqueLoss="14.61"/> + <Entry inputSpeed="1100.00" inputTorque="-1000.00" torqueLoss="15.63"/> + <Entry inputSpeed="1300.00" inputTorque="-1000.00" torqueLoss="16.64"/> + <Entry inputSpeed="1500.00" inputTorque="-1000.00" torqueLoss="17.65"/> + <Entry inputSpeed="1700.00" inputTorque="-1000.00" torqueLoss="18.66"/> + <Entry inputSpeed="1900.00" inputTorque="-1000.00" torqueLoss="19.67"/> + <Entry inputSpeed="2100.00" inputTorque="-1000.00" torqueLoss="20.69"/> + </TorqueLossMap> + </Gear> + </Gears> + </v2.0:Data> + <v2.0:Signature> + <di:Reference URI="#gbx-vi2Oak2N"> + <di:Transforms> + <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization"/> + <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> + </di:Transforms> + <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> + <di:DigestValue>ieNmjofFObDBGnB7+GX9of3HYe3ydK/ra+YvmULVJIk=</di:DigestValue> + </di:Reference> + </v2.0:Signature> + </Gearbox> + <TorqueConverter> + <v2.0:Data id="tc-123xyz" xsi:type="TorqueConverterDataDeclarationType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0"> + <Manufacturer>Some Manufacturer</Manufacturer> + <Model>Some Model</Model> + <CertificationNumber>e12*0815/8051*2017/05E0000*00</CertificationNumber> + <Date>2017-02-15T11:00:00Z</Date> + <AppVersion>TC CalcApp 123</AppVersion> + <CertificationMethod>Standard values</CertificationMethod> + <Characteristics> + <Entry speedRatio="0.0000" torqueRatio="1.00" inputTorqueRef="300.00"/> + <Entry speedRatio="0.5000" torqueRatio="1.00" inputTorqueRef="200.00"/> + <Entry speedRatio="0.9000" torqueRatio="0.90" inputTorqueRef="200.00"/> + </Characteristics> + </v2.0:Data> + <v2.0:Signature> + <di:Reference URI="#tc-123xyz"> + <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> + <di:DigestValue>q2sumDwsqQKLw4xwkEllgsygF5bHBwZPSS66UNaXXis=</di:DigestValue> + </di:Reference> + </v2.0:Signature> + </TorqueConverter> + <Angledrive> + <v2.0:Data id="agl-vi2Oak2N" xsi:type="AngledriveDataDeclarationType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0"> + <Manufacturer>Generic Gearbox Manufacturer</Manufacturer> + <Model>Generic 40t Long Haul Truck Gearbox</Model> + <CertificationNumber>e12*0815/8051*2017/05E0000*00</CertificationNumber> + <Date>2017-01-11T11:00:00Z</Date> + <AppVersion>3.0.1</AppVersion> + <Ratio>2.345</Ratio> + <CertificationMethod>Standard values</CertificationMethod> + <TorqueLossMap> + <Entry inputSpeed="0.00" inputTorque="-10000.00" torqueLoss="100.00"/> + <Entry inputSpeed="1000.00" inputTorque="-1000.00" torqueLoss="100.00"/> + <Entry inputSpeed="0.00" inputTorque="0.00" torqueLoss="10.00"/> + <Entry inputSpeed="1000.00" inputTorque="0.00" torqueLoss="10.00"/> + <Entry inputSpeed="0.00" inputTorque="10000.00" torqueLoss="100.00"/> + <Entry inputSpeed="1000.00" inputTorque="1000.00" torqueLoss="100.00"/> + </TorqueLossMap> + </v2.0:Data> + <v2.0:Signature> + <di:Reference URI="#agl-vi2Oak2N"> + <di:Transforms> + <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization"/> + <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> + </di:Transforms> + <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> + <di:DigestValue>1tuF9SoA8luoUBQGym4bYi1TurDSmcYqBDJ6AP20OSs=</di:DigestValue> + </di:Reference> + </v2.0:Signature> + </Angledrive> + <Retarder> + <v2.0:Data id="RET-Shai9imi" xsi:type="RetarderDataDeclarationType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0"> + <Manufacturer>Generic Retarder Manufacturer</Manufacturer> + <Model>Generic Retarder</Model> + <CertificationNumber>e12*0815/8051*2017/05E0000*00</CertificationNumber> + <Date>2017-01-11T11:00:00Z</Date> + <AppVersion>3.0.1</AppVersion> + <CertificationMethod>Standard values</CertificationMethod> + <RetarderLossMap> + <Entry retarderSpeed="0.00" torqueLoss="10.00"/> + <Entry retarderSpeed="100.00" torqueLoss="10.02"/> + <Entry retarderSpeed="200.00" torqueLoss="10.08"/> + <Entry retarderSpeed="300.00" torqueLoss="10.18"/> + <Entry retarderSpeed="400.00" torqueLoss="10.32"/> + <Entry retarderSpeed="500.00" torqueLoss="10.50"/> + <Entry retarderSpeed="600.00" torqueLoss="10.72"/> + <Entry retarderSpeed="700.00" torqueLoss="10.98"/> + <Entry retarderSpeed="800.00" torqueLoss="11.28"/> + <Entry retarderSpeed="900.00" torqueLoss="11.62"/> + <Entry retarderSpeed="1000.00" torqueLoss="12.00"/> + <Entry retarderSpeed="1100.00" torqueLoss="12.42"/> + <Entry retarderSpeed="1200.00" torqueLoss="12.88"/> + <Entry retarderSpeed="1300.00" torqueLoss="13.38"/> + <Entry retarderSpeed="1400.00" torqueLoss="13.92"/> + <Entry retarderSpeed="1500.00" torqueLoss="14.50"/> + <Entry retarderSpeed="1600.00" torqueLoss="15.12"/> + <Entry retarderSpeed="1700.00" torqueLoss="15.78"/> + <Entry retarderSpeed="1800.00" torqueLoss="16.48"/> + <Entry retarderSpeed="1900.00" torqueLoss="17.22"/> + <Entry retarderSpeed="2000.00" torqueLoss="18.00"/> + <Entry retarderSpeed="2100.00" torqueLoss="18.82"/> + <Entry retarderSpeed="2200.00" torqueLoss="19.68"/> + <Entry retarderSpeed="2300.00" torqueLoss="20.58"/> + </RetarderLossMap> + </v2.0:Data> + <v2.0:Signature> + <di:Reference URI="#RET-Shai9imi"> + <di:Transforms> + <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization"/> + <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> + </di:Transforms> + <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> + <di:DigestValue>fcEtYfDAbfuRq0xpuzapmEj+Py1PIPUZwVmx+amNvcc=</di:DigestValue> + </di:Reference> + </v2.0:Signature> + </Retarder> + <Axlegear> + <v2.0:Data id="AXL-EC3ohnoh" xsi:type="AxlegearDataDeclarationType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0"> + <Manufacturer>Generic Gearbox Manufacturer</Manufacturer> + <Model>Generic 40t Long Haul Truck AxleGear</Model> + <CertificationNumber>e12*0815/8051*2017/05E0000*00</CertificationNumber> + <Date>2017-01-11T11:00:00Z</Date> + <AppVersion>3.0.1</AppVersion> + <LineType>Single portal axle</LineType> + <Ratio>2.590</Ratio> + <CertificationMethod>Standard values</CertificationMethod> + <TorqueLossMap> + <Entry inputSpeed="0.00" inputTorque="-5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="0.00" inputTorque="-4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="0.00" inputTorque="-3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="300.00" inputTorque="14000.00" torqueLoss="250.00"/> + <Entry inputSpeed="300.00" inputTorque="15000.00" torqueLoss="265.00"/> + <Entry inputSpeed="300.00" inputTorque="16000.00" torqueLoss="280.00"/> + <Entry inputSpeed="300.00" inputTorque="17000.00" torqueLoss="295.00"/> + <Entry inputSpeed="300.00" inputTorque="18000.00" torqueLoss="310.00"/> + <Entry inputSpeed="300.00" inputTorque="19000.00" torqueLoss="325.00"/> + <Entry inputSpeed="300.00" inputTorque="20000.00" torqueLoss="340.00"/> + <Entry inputSpeed="300.00" inputTorque="21000.00" torqueLoss="355.00"/> + <Entry inputSpeed="0.00" inputTorque="-2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="0.00" inputTorque="-1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="0.00" inputTorque="0.00" torqueLoss="40.00"/> + <Entry inputSpeed="0.00" inputTorque="1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="0.00" inputTorque="2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="0.00" inputTorque="3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="0.00" inputTorque="4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="0.00" inputTorque="5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="0.00" inputTorque="6000.00" torqueLoss="130.00"/> + <Entry inputSpeed="0.00" inputTorque="7000.00" torqueLoss="145.00"/> + <Entry inputSpeed="0.00" inputTorque="8000.00" torqueLoss="160.00"/> + <Entry inputSpeed="0.00" inputTorque="9000.00" torqueLoss="175.00"/> + <Entry inputSpeed="0.00" inputTorque="10000.00" torqueLoss="190.00"/> + <Entry inputSpeed="0.00" inputTorque="11000.00" torqueLoss="205.00"/> + <Entry inputSpeed="0.00" inputTorque="12000.00" torqueLoss="220.00"/> + <Entry inputSpeed="0.00" inputTorque="13000.00" torqueLoss="235.00"/> + <Entry inputSpeed="0.00" inputTorque="14000.00" torqueLoss="250.00"/> + <Entry inputSpeed="0.00" inputTorque="15000.00" torqueLoss="265.00"/> + <Entry inputSpeed="100.00" inputTorque="9000.00" torqueLoss="175.00"/> + <Entry inputSpeed="100.00" inputTorque="10000.00" torqueLoss="190.00"/> + <Entry inputSpeed="100.00" inputTorque="11000.00" torqueLoss="205.00"/> + <Entry inputSpeed="100.00" inputTorque="12000.00" torqueLoss="220.00"/> + <Entry inputSpeed="100.00" inputTorque="13000.00" torqueLoss="235.00"/> + <Entry inputSpeed="100.00" inputTorque="14000.00" torqueLoss="250.00"/> + <Entry inputSpeed="100.00" inputTorque="15000.00" torqueLoss="265.00"/> + <Entry inputSpeed="100.00" inputTorque="16000.00" torqueLoss="280.00"/> + <Entry inputSpeed="0.00" inputTorque="16000.00" torqueLoss="280.00"/> + <Entry inputSpeed="0.00" inputTorque="21000.00" torqueLoss="355.00"/> + <Entry inputSpeed="0.00" inputTorque="22000.00" torqueLoss="370.00"/> + <Entry inputSpeed="0.00" inputTorque="23000.00" torqueLoss="385.00"/> + <Entry inputSpeed="0.00" inputTorque="24000.00" torqueLoss="400.00"/> + <Entry inputSpeed="0.00" inputTorque="25000.00" torqueLoss="415.00"/> + <Entry inputSpeed="0.00" inputTorque="26000.00" torqueLoss="430.00"/> + <Entry inputSpeed="0.00" inputTorque="27000.00" torqueLoss="445.00"/> + <Entry inputSpeed="0.00" inputTorque="28000.00" torqueLoss="460.00"/> + <Entry inputSpeed="0.00" inputTorque="29000.00" torqueLoss="475.00"/> + <Entry inputSpeed="0.00" inputTorque="30000.00" torqueLoss="490.00"/> + <Entry inputSpeed="0.00" inputTorque="31000.00" torqueLoss="505.00"/> + <Entry inputSpeed="0.00" inputTorque="32000.00" torqueLoss="520.00"/> + <Entry inputSpeed="0.00" inputTorque="33000.00" torqueLoss="535.00"/> + <Entry inputSpeed="0.00" inputTorque="34000.00" torqueLoss="550.00"/> + <Entry inputSpeed="0.00" inputTorque="35000.00" torqueLoss="565.00"/> + <Entry inputSpeed="100.00" inputTorque="-5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="100.00" inputTorque="-4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="100.00" inputTorque="-3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="100.00" inputTorque="-2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="0.00" inputTorque="17000.00" torqueLoss="295.00"/> + <Entry inputSpeed="0.00" inputTorque="18000.00" torqueLoss="310.00"/> + <Entry inputSpeed="0.00" inputTorque="19000.00" torqueLoss="325.00"/> + <Entry inputSpeed="0.00" inputTorque="20000.00" torqueLoss="340.00"/> + <Entry inputSpeed="100.00" inputTorque="-1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="100.00" inputTorque="0.00" torqueLoss="40.00"/> + <Entry inputSpeed="100.00" inputTorque="1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="100.00" inputTorque="2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="100.00" inputTorque="3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="100.00" inputTorque="4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="100.00" inputTorque="5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="100.00" inputTorque="6000.00" torqueLoss="130.00"/> + <Entry inputSpeed="100.00" inputTorque="7000.00" torqueLoss="145.00"/> + <Entry inputSpeed="100.00" inputTorque="8000.00" torqueLoss="160.00"/> + <Entry inputSpeed="100.00" inputTorque="17000.00" torqueLoss="295.00"/> + <Entry inputSpeed="100.00" inputTorque="18000.00" torqueLoss="310.00"/> + <Entry inputSpeed="100.00" inputTorque="19000.00" torqueLoss="325.00"/> + <Entry inputSpeed="100.00" inputTorque="20000.00" torqueLoss="340.00"/> + <Entry inputSpeed="100.00" inputTorque="21000.00" torqueLoss="355.00"/> + <Entry inputSpeed="100.00" inputTorque="22000.00" torqueLoss="370.00"/> + <Entry inputSpeed="100.00" inputTorque="23000.00" torqueLoss="385.00"/> + <Entry inputSpeed="100.00" inputTorque="24000.00" torqueLoss="400.00"/> + <Entry inputSpeed="100.00" inputTorque="25000.00" torqueLoss="415.00"/> + <Entry inputSpeed="100.00" inputTorque="26000.00" torqueLoss="430.00"/> + <Entry inputSpeed="100.00" inputTorque="27000.00" torqueLoss="445.00"/> + <Entry inputSpeed="100.00" inputTorque="28000.00" torqueLoss="460.00"/> + <Entry inputSpeed="100.00" inputTorque="29000.00" torqueLoss="475.00"/> + <Entry inputSpeed="100.00" inputTorque="30000.00" torqueLoss="490.00"/> + <Entry inputSpeed="100.00" inputTorque="31000.00" torqueLoss="505.00"/> + <Entry inputSpeed="100.00" inputTorque="32000.00" torqueLoss="520.00"/> + <Entry inputSpeed="100.00" inputTorque="33000.00" torqueLoss="535.00"/> + <Entry inputSpeed="100.00" inputTorque="34000.00" torqueLoss="550.00"/> + <Entry inputSpeed="100.00" inputTorque="35000.00" torqueLoss="565.00"/> + <Entry inputSpeed="300.00" inputTorque="-5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="300.00" inputTorque="-4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="300.00" inputTorque="-3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="300.00" inputTorque="-2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="300.00" inputTorque="-1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="300.00" inputTorque="0.00" torqueLoss="40.00"/> + <Entry inputSpeed="300.00" inputTorque="1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="300.00" inputTorque="2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="300.00" inputTorque="3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="300.00" inputTorque="4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="300.00" inputTorque="5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="300.00" inputTorque="6000.00" torqueLoss="130.00"/> + <Entry inputSpeed="300.00" inputTorque="7000.00" torqueLoss="145.00"/> + <Entry inputSpeed="300.00" inputTorque="8000.00" torqueLoss="160.00"/> + <Entry inputSpeed="300.00" inputTorque="9000.00" torqueLoss="175.00"/> + <Entry inputSpeed="300.00" inputTorque="10000.00" torqueLoss="190.00"/> + <Entry inputSpeed="300.00" inputTorque="11000.00" torqueLoss="205.00"/> + <Entry inputSpeed="300.00" inputTorque="12000.00" torqueLoss="220.00"/> + <Entry inputSpeed="300.00" inputTorque="13000.00" torqueLoss="235.00"/> + <Entry inputSpeed="300.00" inputTorque="22000.00" torqueLoss="370.00"/> + <Entry inputSpeed="300.00" inputTorque="23000.00" torqueLoss="385.00"/> + <Entry inputSpeed="300.00" inputTorque="24000.00" torqueLoss="400.00"/> + <Entry inputSpeed="300.00" inputTorque="25000.00" torqueLoss="415.00"/> + <Entry inputSpeed="300.00" inputTorque="26000.00" torqueLoss="430.00"/> + <Entry inputSpeed="300.00" inputTorque="27000.00" torqueLoss="445.00"/> + <Entry inputSpeed="300.00" inputTorque="28000.00" torqueLoss="460.00"/> + <Entry inputSpeed="300.00" inputTorque="29000.00" torqueLoss="475.00"/> + <Entry inputSpeed="300.00" inputTorque="30000.00" torqueLoss="490.00"/> + <Entry inputSpeed="300.00" inputTorque="31000.00" torqueLoss="505.00"/> + <Entry inputSpeed="300.00" inputTorque="32000.00" torqueLoss="520.00"/> + <Entry inputSpeed="300.00" inputTorque="33000.00" torqueLoss="535.00"/> + <Entry inputSpeed="300.00" inputTorque="34000.00" torqueLoss="550.00"/> + <Entry inputSpeed="300.00" inputTorque="35000.00" torqueLoss="565.00"/> + <Entry inputSpeed="500.00" inputTorque="-5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="500.00" inputTorque="-4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="500.00" inputTorque="-3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="500.00" inputTorque="-2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="500.00" inputTorque="-1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="500.00" inputTorque="0.00" torqueLoss="40.00"/> + <Entry inputSpeed="500.00" inputTorque="1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="500.00" inputTorque="2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="500.00" inputTorque="3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="500.00" inputTorque="4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="500.00" inputTorque="5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="500.00" inputTorque="6000.00" torqueLoss="130.00"/> + <Entry inputSpeed="500.00" inputTorque="7000.00" torqueLoss="145.00"/> + <Entry inputSpeed="500.00" inputTorque="8000.00" torqueLoss="160.00"/> + <Entry inputSpeed="500.00" inputTorque="9000.00" torqueLoss="175.00"/> + <Entry inputSpeed="500.00" inputTorque="10000.00" torqueLoss="190.00"/> + <Entry inputSpeed="500.00" inputTorque="11000.00" torqueLoss="205.00"/> + <Entry inputSpeed="500.00" inputTorque="12000.00" torqueLoss="220.00"/> + <Entry inputSpeed="500.00" inputTorque="13000.00" torqueLoss="235.00"/> + <Entry inputSpeed="500.00" inputTorque="14000.00" torqueLoss="250.00"/> + <Entry inputSpeed="500.00" inputTorque="15000.00" torqueLoss="265.00"/> + <Entry inputSpeed="500.00" inputTorque="16000.00" torqueLoss="280.00"/> + <Entry inputSpeed="500.00" inputTorque="17000.00" torqueLoss="295.00"/> + <Entry inputSpeed="500.00" inputTorque="18000.00" torqueLoss="310.00"/> + <Entry inputSpeed="500.00" inputTorque="19000.00" torqueLoss="325.00"/> + <Entry inputSpeed="500.00" inputTorque="20000.00" torqueLoss="340.00"/> + <Entry inputSpeed="500.00" inputTorque="21000.00" torqueLoss="355.00"/> + <Entry inputSpeed="500.00" inputTorque="22000.00" torqueLoss="370.00"/> + <Entry inputSpeed="500.00" inputTorque="23000.00" torqueLoss="385.00"/> + <Entry inputSpeed="500.00" inputTorque="24000.00" torqueLoss="400.00"/> + <Entry inputSpeed="500.00" inputTorque="25000.00" torqueLoss="415.00"/> + <Entry inputSpeed="500.00" inputTorque="26000.00" torqueLoss="430.00"/> + <Entry inputSpeed="500.00" inputTorque="27000.00" torqueLoss="445.00"/> + <Entry inputSpeed="500.00" inputTorque="28000.00" torqueLoss="460.00"/> + <Entry inputSpeed="500.00" inputTorque="29000.00" torqueLoss="475.00"/> + <Entry inputSpeed="500.00" inputTorque="30000.00" torqueLoss="490.00"/> + <Entry inputSpeed="500.00" inputTorque="31000.00" torqueLoss="505.00"/> + <Entry inputSpeed="500.00" inputTorque="32000.00" torqueLoss="520.00"/> + <Entry inputSpeed="500.00" inputTorque="33000.00" torqueLoss="535.00"/> + <Entry inputSpeed="500.00" inputTorque="34000.00" torqueLoss="550.00"/> + <Entry inputSpeed="500.00" inputTorque="35000.00" torqueLoss="565.00"/> + <Entry inputSpeed="700.00" inputTorque="-5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="700.00" inputTorque="-4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="700.00" inputTorque="-3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="700.00" inputTorque="-2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="700.00" inputTorque="-1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="700.00" inputTorque="0.00" torqueLoss="40.00"/> + <Entry inputSpeed="700.00" inputTorque="1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="700.00" inputTorque="2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="700.00" inputTorque="3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="700.00" inputTorque="4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="700.00" inputTorque="5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="700.00" inputTorque="6000.00" torqueLoss="130.00"/> + <Entry inputSpeed="700.00" inputTorque="7000.00" torqueLoss="145.00"/> + <Entry inputSpeed="700.00" inputTorque="8000.00" torqueLoss="160.00"/> + <Entry inputSpeed="700.00" inputTorque="9000.00" torqueLoss="175.00"/> + <Entry inputSpeed="700.00" inputTorque="10000.00" torqueLoss="190.00"/> + <Entry inputSpeed="700.00" inputTorque="11000.00" torqueLoss="205.00"/> + <Entry inputSpeed="700.00" inputTorque="12000.00" torqueLoss="220.00"/> + <Entry inputSpeed="700.00" inputTorque="13000.00" torqueLoss="235.00"/> + <Entry inputSpeed="700.00" inputTorque="14000.00" torqueLoss="250.00"/> + <Entry inputSpeed="700.00" inputTorque="15000.00" torqueLoss="265.00"/> + <Entry inputSpeed="700.00" inputTorque="16000.00" torqueLoss="280.00"/> + <Entry inputSpeed="700.00" inputTorque="17000.00" torqueLoss="295.00"/> + <Entry inputSpeed="700.00" inputTorque="18000.00" torqueLoss="310.00"/> + <Entry inputSpeed="700.00" inputTorque="19000.00" torqueLoss="325.00"/> + <Entry inputSpeed="700.00" inputTorque="20000.00" torqueLoss="340.00"/> + <Entry inputSpeed="700.00" inputTorque="21000.00" torqueLoss="355.00"/> + <Entry inputSpeed="700.00" inputTorque="22000.00" torqueLoss="370.00"/> + <Entry inputSpeed="700.00" inputTorque="23000.00" torqueLoss="385.00"/> + <Entry inputSpeed="700.00" inputTorque="24000.00" torqueLoss="400.00"/> + <Entry inputSpeed="700.00" inputTorque="25000.00" torqueLoss="415.00"/> + <Entry inputSpeed="700.00" inputTorque="26000.00" torqueLoss="430.00"/> + <Entry inputSpeed="700.00" inputTorque="27000.00" torqueLoss="445.00"/> + <Entry inputSpeed="700.00" inputTorque="28000.00" torqueLoss="460.00"/> + <Entry inputSpeed="700.00" inputTorque="29000.00" torqueLoss="475.00"/> + <Entry inputSpeed="700.00" inputTorque="30000.00" torqueLoss="490.00"/> + <Entry inputSpeed="700.00" inputTorque="31000.00" torqueLoss="505.00"/> + <Entry inputSpeed="700.00" inputTorque="32000.00" torqueLoss="520.00"/> + <Entry inputSpeed="700.00" inputTorque="33000.00" torqueLoss="535.00"/> + <Entry inputSpeed="700.00" inputTorque="34000.00" torqueLoss="550.00"/> + <Entry inputSpeed="700.00" inputTorque="35000.00" torqueLoss="565.00"/> + <Entry inputSpeed="900.00" inputTorque="-5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="900.00" inputTorque="-4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="900.00" inputTorque="-3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="900.00" inputTorque="-2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="900.00" inputTorque="-1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="900.00" inputTorque="0.00" torqueLoss="40.00"/> + <Entry inputSpeed="900.00" inputTorque="1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="900.00" inputTorque="2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="900.00" inputTorque="3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="900.00" inputTorque="4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="900.00" inputTorque="5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="900.00" inputTorque="6000.00" torqueLoss="130.00"/> + <Entry inputSpeed="900.00" inputTorque="7000.00" torqueLoss="145.00"/> + <Entry inputSpeed="900.00" inputTorque="8000.00" torqueLoss="160.00"/> + <Entry inputSpeed="900.00" inputTorque="9000.00" torqueLoss="175.00"/> + <Entry inputSpeed="900.00" inputTorque="10000.00" torqueLoss="190.00"/> + <Entry inputSpeed="900.00" inputTorque="11000.00" torqueLoss="205.00"/> + <Entry inputSpeed="900.00" inputTorque="12000.00" torqueLoss="220.00"/> + <Entry inputSpeed="900.00" inputTorque="13000.00" torqueLoss="235.00"/> + <Entry inputSpeed="900.00" inputTorque="14000.00" torqueLoss="250.00"/> + <Entry inputSpeed="900.00" inputTorque="15000.00" torqueLoss="265.00"/> + <Entry inputSpeed="900.00" inputTorque="16000.00" torqueLoss="280.00"/> + <Entry inputSpeed="900.00" inputTorque="17000.00" torqueLoss="295.00"/> + <Entry inputSpeed="900.00" inputTorque="18000.00" torqueLoss="310.00"/> + <Entry inputSpeed="900.00" inputTorque="19000.00" torqueLoss="325.00"/> + <Entry inputSpeed="900.00" inputTorque="20000.00" torqueLoss="340.00"/> + <Entry inputSpeed="900.00" inputTorque="21000.00" torqueLoss="355.00"/> + <Entry inputSpeed="900.00" inputTorque="22000.00" torqueLoss="370.00"/> + <Entry inputSpeed="900.00" inputTorque="23000.00" torqueLoss="385.00"/> + <Entry inputSpeed="900.00" inputTorque="24000.00" torqueLoss="400.00"/> + <Entry inputSpeed="900.00" inputTorque="25000.00" torqueLoss="415.00"/> + <Entry inputSpeed="900.00" inputTorque="26000.00" torqueLoss="430.00"/> + <Entry inputSpeed="900.00" inputTorque="27000.00" torqueLoss="445.00"/> + <Entry inputSpeed="900.00" inputTorque="28000.00" torqueLoss="460.00"/> + <Entry inputSpeed="900.00" inputTorque="29000.00" torqueLoss="475.00"/> + <Entry inputSpeed="900.00" inputTorque="30000.00" torqueLoss="490.00"/> + <Entry inputSpeed="900.00" inputTorque="31000.00" torqueLoss="505.00"/> + <Entry inputSpeed="900.00" inputTorque="32000.00" torqueLoss="520.00"/> + <Entry inputSpeed="900.00" inputTorque="33000.00" torqueLoss="535.00"/> + <Entry inputSpeed="900.00" inputTorque="34000.00" torqueLoss="550.00"/> + <Entry inputSpeed="900.00" inputTorque="35000.00" torqueLoss="565.00"/> + <Entry inputSpeed="1100.00" inputTorque="-5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="1100.00" inputTorque="-4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="1100.00" inputTorque="-3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="1100.00" inputTorque="-2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="1100.00" inputTorque="-1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="1100.00" inputTorque="0.00" torqueLoss="40.00"/> + <Entry inputSpeed="1100.00" inputTorque="1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="1100.00" inputTorque="2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="1100.00" inputTorque="3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="1100.00" inputTorque="4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="1100.00" inputTorque="5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="1100.00" inputTorque="6000.00" torqueLoss="130.00"/> + <Entry inputSpeed="1100.00" inputTorque="7000.00" torqueLoss="145.00"/> + <Entry inputSpeed="1100.00" inputTorque="8000.00" torqueLoss="160.00"/> + <Entry inputSpeed="1100.00" inputTorque="9000.00" torqueLoss="175.00"/> + <Entry inputSpeed="1100.00" inputTorque="10000.00" torqueLoss="190.00"/> + <Entry inputSpeed="1100.00" inputTorque="11000.00" torqueLoss="205.00"/> + <Entry inputSpeed="1100.00" inputTorque="12000.00" torqueLoss="220.00"/> + <Entry inputSpeed="1100.00" inputTorque="13000.00" torqueLoss="235.00"/> + <Entry inputSpeed="1100.00" inputTorque="14000.00" torqueLoss="250.00"/> + <Entry inputSpeed="1100.00" inputTorque="15000.00" torqueLoss="265.00"/> + <Entry inputSpeed="1100.00" inputTorque="16000.00" torqueLoss="280.00"/> + <Entry inputSpeed="1100.00" inputTorque="17000.00" torqueLoss="295.00"/> + <Entry inputSpeed="1100.00" inputTorque="18000.00" torqueLoss="310.00"/> + <Entry inputSpeed="1100.00" inputTorque="19000.00" torqueLoss="325.00"/> + <Entry inputSpeed="1100.00" inputTorque="20000.00" torqueLoss="340.00"/> + <Entry inputSpeed="1100.00" inputTorque="21000.00" torqueLoss="355.00"/> + <Entry inputSpeed="1100.00" inputTorque="22000.00" torqueLoss="370.00"/> + <Entry inputSpeed="1100.00" inputTorque="23000.00" torqueLoss="385.00"/> + <Entry inputSpeed="1100.00" inputTorque="24000.00" torqueLoss="400.00"/> + <Entry inputSpeed="1100.00" inputTorque="25000.00" torqueLoss="415.00"/> + <Entry inputSpeed="1100.00" inputTorque="26000.00" torqueLoss="430.00"/> + <Entry inputSpeed="1100.00" inputTorque="27000.00" torqueLoss="445.00"/> + <Entry inputSpeed="1100.00" inputTorque="28000.00" torqueLoss="460.00"/> + <Entry inputSpeed="1100.00" inputTorque="29000.00" torqueLoss="475.00"/> + <Entry inputSpeed="1100.00" inputTorque="30000.00" torqueLoss="490.00"/> + <Entry inputSpeed="1100.00" inputTorque="31000.00" torqueLoss="505.00"/> + <Entry inputSpeed="1100.00" inputTorque="32000.00" torqueLoss="520.00"/> + <Entry inputSpeed="1100.00" inputTorque="33000.00" torqueLoss="535.00"/> + <Entry inputSpeed="1100.00" inputTorque="34000.00" torqueLoss="550.00"/> + <Entry inputSpeed="1100.00" inputTorque="35000.00" torqueLoss="565.00"/> + <Entry inputSpeed="1300.00" inputTorque="-5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="1300.00" inputTorque="-4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="1300.00" inputTorque="-3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="1300.00" inputTorque="-2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="1300.00" inputTorque="-1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="1300.00" inputTorque="0.00" torqueLoss="40.00"/> + <Entry inputSpeed="1300.00" inputTorque="1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="1300.00" inputTorque="2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="1300.00" inputTorque="3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="1300.00" inputTorque="4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="1300.00" inputTorque="5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="1300.00" inputTorque="6000.00" torqueLoss="130.00"/> + <Entry inputSpeed="1300.00" inputTorque="7000.00" torqueLoss="145.00"/> + <Entry inputSpeed="1300.00" inputTorque="8000.00" torqueLoss="160.00"/> + <Entry inputSpeed="1300.00" inputTorque="9000.00" torqueLoss="175.00"/> + <Entry inputSpeed="1300.00" inputTorque="10000.00" torqueLoss="190.00"/> + <Entry inputSpeed="1300.00" inputTorque="11000.00" torqueLoss="205.00"/> + <Entry inputSpeed="1300.00" inputTorque="12000.00" torqueLoss="220.00"/> + <Entry inputSpeed="1300.00" inputTorque="13000.00" torqueLoss="235.00"/> + <Entry inputSpeed="1300.00" inputTorque="14000.00" torqueLoss="250.00"/> + <Entry inputSpeed="1300.00" inputTorque="15000.00" torqueLoss="265.00"/> + <Entry inputSpeed="1300.00" inputTorque="16000.00" torqueLoss="280.00"/> + <Entry inputSpeed="1300.00" inputTorque="17000.00" torqueLoss="295.00"/> + <Entry inputSpeed="1300.00" inputTorque="18000.00" torqueLoss="310.00"/> + <Entry inputSpeed="1300.00" inputTorque="19000.00" torqueLoss="325.00"/> + <Entry inputSpeed="1300.00" inputTorque="20000.00" torqueLoss="340.00"/> + <Entry inputSpeed="1300.00" inputTorque="21000.00" torqueLoss="355.00"/> + <Entry inputSpeed="1300.00" inputTorque="22000.00" torqueLoss="370.00"/> + <Entry inputSpeed="1300.00" inputTorque="23000.00" torqueLoss="385.00"/> + <Entry inputSpeed="1300.00" inputTorque="24000.00" torqueLoss="400.00"/> + <Entry inputSpeed="1300.00" inputTorque="25000.00" torqueLoss="415.00"/> + <Entry inputSpeed="1300.00" inputTorque="26000.00" torqueLoss="430.00"/> + <Entry inputSpeed="1300.00" inputTorque="27000.00" torqueLoss="445.00"/> + <Entry inputSpeed="1300.00" inputTorque="28000.00" torqueLoss="460.00"/> + <Entry inputSpeed="1300.00" inputTorque="29000.00" torqueLoss="475.00"/> + <Entry inputSpeed="1300.00" inputTorque="30000.00" torqueLoss="490.00"/> + <Entry inputSpeed="1300.00" inputTorque="31000.00" torqueLoss="505.00"/> + <Entry inputSpeed="1300.00" inputTorque="32000.00" torqueLoss="520.00"/> + <Entry inputSpeed="1300.00" inputTorque="33000.00" torqueLoss="535.00"/> + <Entry inputSpeed="1300.00" inputTorque="34000.00" torqueLoss="550.00"/> + <Entry inputSpeed="1300.00" inputTorque="35000.00" torqueLoss="565.00"/> + <Entry inputSpeed="1500.00" inputTorque="-5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="1500.00" inputTorque="-4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="1500.00" inputTorque="-3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="1500.00" inputTorque="-2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="1500.00" inputTorque="-1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="1500.00" inputTorque="0.00" torqueLoss="40.00"/> + <Entry inputSpeed="1500.00" inputTorque="1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="1500.00" inputTorque="2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="1500.00" inputTorque="3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="1500.00" inputTorque="4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="1500.00" inputTorque="5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="1500.00" inputTorque="6000.00" torqueLoss="130.00"/> + <Entry inputSpeed="1500.00" inputTorque="7000.00" torqueLoss="145.00"/> + <Entry inputSpeed="1500.00" inputTorque="8000.00" torqueLoss="160.00"/> + <Entry inputSpeed="1500.00" inputTorque="9000.00" torqueLoss="175.00"/> + <Entry inputSpeed="1500.00" inputTorque="10000.00" torqueLoss="190.00"/> + <Entry inputSpeed="1500.00" inputTorque="11000.00" torqueLoss="205.00"/> + <Entry inputSpeed="1500.00" inputTorque="12000.00" torqueLoss="220.00"/> + <Entry inputSpeed="1500.00" inputTorque="13000.00" torqueLoss="235.00"/> + <Entry inputSpeed="1500.00" inputTorque="14000.00" torqueLoss="250.00"/> + <Entry inputSpeed="1500.00" inputTorque="15000.00" torqueLoss="265.00"/> + <Entry inputSpeed="1500.00" inputTorque="16000.00" torqueLoss="280.00"/> + <Entry inputSpeed="1500.00" inputTorque="17000.00" torqueLoss="295.00"/> + <Entry inputSpeed="1500.00" inputTorque="18000.00" torqueLoss="310.00"/> + <Entry inputSpeed="1500.00" inputTorque="19000.00" torqueLoss="325.00"/> + <Entry inputSpeed="1500.00" inputTorque="20000.00" torqueLoss="340.00"/> + <Entry inputSpeed="1500.00" inputTorque="21000.00" torqueLoss="355.00"/> + <Entry inputSpeed="1500.00" inputTorque="22000.00" torqueLoss="370.00"/> + <Entry inputSpeed="1500.00" inputTorque="23000.00" torqueLoss="385.00"/> + <Entry inputSpeed="1500.00" inputTorque="24000.00" torqueLoss="400.00"/> + <Entry inputSpeed="1500.00" inputTorque="25000.00" torqueLoss="415.00"/> + <Entry inputSpeed="1500.00" inputTorque="26000.00" torqueLoss="430.00"/> + <Entry inputSpeed="1500.00" inputTorque="27000.00" torqueLoss="445.00"/> + <Entry inputSpeed="1500.00" inputTorque="28000.00" torqueLoss="460.00"/> + <Entry inputSpeed="1500.00" inputTorque="29000.00" torqueLoss="475.00"/> + <Entry inputSpeed="1500.00" inputTorque="30000.00" torqueLoss="490.00"/> + <Entry inputSpeed="1500.00" inputTorque="31000.00" torqueLoss="505.00"/> + <Entry inputSpeed="1500.00" inputTorque="32000.00" torqueLoss="520.00"/> + <Entry inputSpeed="1500.00" inputTorque="33000.00" torqueLoss="535.00"/> + <Entry inputSpeed="1500.00" inputTorque="34000.00" torqueLoss="550.00"/> + <Entry inputSpeed="1500.00" inputTorque="35000.00" torqueLoss="565.00"/> + <Entry inputSpeed="1700.00" inputTorque="-5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="1700.00" inputTorque="-4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="1700.00" inputTorque="-3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="1700.00" inputTorque="-2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="1700.00" inputTorque="-1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="1700.00" inputTorque="0.00" torqueLoss="40.00"/> + <Entry inputSpeed="1700.00" inputTorque="1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="1700.00" inputTorque="2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="1700.00" inputTorque="3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="1700.00" inputTorque="4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="1700.00" inputTorque="5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="1700.00" inputTorque="6000.00" torqueLoss="130.00"/> + <Entry inputSpeed="1700.00" inputTorque="7000.00" torqueLoss="145.00"/> + <Entry inputSpeed="1700.00" inputTorque="8000.00" torqueLoss="160.00"/> + <Entry inputSpeed="1700.00" inputTorque="9000.00" torqueLoss="175.00"/> + <Entry inputSpeed="1700.00" inputTorque="10000.00" torqueLoss="190.00"/> + <Entry inputSpeed="1700.00" inputTorque="11000.00" torqueLoss="205.00"/> + <Entry inputSpeed="1700.00" inputTorque="12000.00" torqueLoss="220.00"/> + <Entry inputSpeed="1700.00" inputTorque="13000.00" torqueLoss="235.00"/> + <Entry inputSpeed="1700.00" inputTorque="14000.00" torqueLoss="250.00"/> + <Entry inputSpeed="1700.00" inputTorque="15000.00" torqueLoss="265.00"/> + <Entry inputSpeed="1700.00" inputTorque="16000.00" torqueLoss="280.00"/> + <Entry inputSpeed="1700.00" inputTorque="17000.00" torqueLoss="295.00"/> + <Entry inputSpeed="1700.00" inputTorque="18000.00" torqueLoss="310.00"/> + <Entry inputSpeed="1700.00" inputTorque="19000.00" torqueLoss="325.00"/> + <Entry inputSpeed="1700.00" inputTorque="20000.00" torqueLoss="340.00"/> + <Entry inputSpeed="1700.00" inputTorque="21000.00" torqueLoss="355.00"/> + <Entry inputSpeed="1700.00" inputTorque="22000.00" torqueLoss="370.00"/> + <Entry inputSpeed="1700.00" inputTorque="23000.00" torqueLoss="385.00"/> + <Entry inputSpeed="1700.00" inputTorque="24000.00" torqueLoss="400.00"/> + <Entry inputSpeed="1700.00" inputTorque="25000.00" torqueLoss="415.00"/> + <Entry inputSpeed="1700.00" inputTorque="26000.00" torqueLoss="430.00"/> + <Entry inputSpeed="1700.00" inputTorque="27000.00" torqueLoss="445.00"/> + <Entry inputSpeed="1700.00" inputTorque="28000.00" torqueLoss="460.00"/> + <Entry inputSpeed="1700.00" inputTorque="29000.00" torqueLoss="475.00"/> + <Entry inputSpeed="1700.00" inputTorque="30000.00" torqueLoss="490.00"/> + <Entry inputSpeed="1700.00" inputTorque="31000.00" torqueLoss="505.00"/> + <Entry inputSpeed="1700.00" inputTorque="32000.00" torqueLoss="520.00"/> + <Entry inputSpeed="1700.00" inputTorque="33000.00" torqueLoss="535.00"/> + <Entry inputSpeed="1700.00" inputTorque="34000.00" torqueLoss="550.00"/> + <Entry inputSpeed="1700.00" inputTorque="35000.00" torqueLoss="565.00"/> + <Entry inputSpeed="1900.00" inputTorque="-5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="1900.00" inputTorque="-4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="1900.00" inputTorque="-3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="1900.00" inputTorque="-2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="1900.00" inputTorque="-1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="1900.00" inputTorque="0.00" torqueLoss="40.00"/> + <Entry inputSpeed="1900.00" inputTorque="1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="1900.00" inputTorque="2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="1900.00" inputTorque="3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="1900.00" inputTorque="4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="1900.00" inputTorque="5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="1900.00" inputTorque="6000.00" torqueLoss="130.00"/> + <Entry inputSpeed="1900.00" inputTorque="7000.00" torqueLoss="145.00"/> + <Entry inputSpeed="1900.00" inputTorque="8000.00" torqueLoss="160.00"/> + <Entry inputSpeed="1900.00" inputTorque="9000.00" torqueLoss="175.00"/> + <Entry inputSpeed="1900.00" inputTorque="10000.00" torqueLoss="190.00"/> + <Entry inputSpeed="1900.00" inputTorque="11000.00" torqueLoss="205.00"/> + <Entry inputSpeed="1900.00" inputTorque="12000.00" torqueLoss="220.00"/> + <Entry inputSpeed="1900.00" inputTorque="13000.00" torqueLoss="235.00"/> + <Entry inputSpeed="1900.00" inputTorque="14000.00" torqueLoss="250.00"/> + <Entry inputSpeed="1900.00" inputTorque="15000.00" torqueLoss="265.00"/> + <Entry inputSpeed="1900.00" inputTorque="16000.00" torqueLoss="280.00"/> + <Entry inputSpeed="1900.00" inputTorque="17000.00" torqueLoss="295.00"/> + <Entry inputSpeed="1900.00" inputTorque="18000.00" torqueLoss="310.00"/> + <Entry inputSpeed="1900.00" inputTorque="19000.00" torqueLoss="325.00"/> + <Entry inputSpeed="1900.00" inputTorque="20000.00" torqueLoss="340.00"/> + <Entry inputSpeed="1900.00" inputTorque="21000.00" torqueLoss="355.00"/> + <Entry inputSpeed="1900.00" inputTorque="22000.00" torqueLoss="370.00"/> + <Entry inputSpeed="1900.00" inputTorque="23000.00" torqueLoss="385.00"/> + <Entry inputSpeed="1900.00" inputTorque="24000.00" torqueLoss="400.00"/> + <Entry inputSpeed="1900.00" inputTorque="25000.00" torqueLoss="415.00"/> + <Entry inputSpeed="1900.00" inputTorque="26000.00" torqueLoss="430.00"/> + <Entry inputSpeed="1900.00" inputTorque="27000.00" torqueLoss="445.00"/> + <Entry inputSpeed="1900.00" inputTorque="28000.00" torqueLoss="460.00"/> + <Entry inputSpeed="1900.00" inputTorque="29000.00" torqueLoss="475.00"/> + <Entry inputSpeed="1900.00" inputTorque="30000.00" torqueLoss="490.00"/> + <Entry inputSpeed="1900.00" inputTorque="31000.00" torqueLoss="505.00"/> + <Entry inputSpeed="1900.00" inputTorque="32000.00" torqueLoss="520.00"/> + <Entry inputSpeed="1900.00" inputTorque="33000.00" torqueLoss="535.00"/> + <Entry inputSpeed="1900.00" inputTorque="34000.00" torqueLoss="550.00"/> + <Entry inputSpeed="1900.00" inputTorque="35000.00" torqueLoss="565.00"/> + <Entry inputSpeed="2100.00" inputTorque="-5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="2100.00" inputTorque="-4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="2100.00" inputTorque="-3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="2100.00" inputTorque="-2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="2100.00" inputTorque="-1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="2100.00" inputTorque="0.00" torqueLoss="40.00"/> + <Entry inputSpeed="2100.00" inputTorque="1000.00" torqueLoss="55.00"/> + <Entry inputSpeed="2100.00" inputTorque="2000.00" torqueLoss="70.00"/> + <Entry inputSpeed="2100.00" inputTorque="3000.00" torqueLoss="85.00"/> + <Entry inputSpeed="2100.00" inputTorque="4000.00" torqueLoss="100.00"/> + <Entry inputSpeed="2100.00" inputTorque="5000.00" torqueLoss="115.00"/> + <Entry inputSpeed="2100.00" inputTorque="6000.00" torqueLoss="130.00"/> + <Entry inputSpeed="2100.00" inputTorque="7000.00" torqueLoss="145.00"/> + <Entry inputSpeed="2100.00" inputTorque="8000.00" torqueLoss="160.00"/> + <Entry inputSpeed="2100.00" inputTorque="9000.00" torqueLoss="175.00"/> + <Entry inputSpeed="2100.00" inputTorque="10000.00" torqueLoss="190.00"/> + <Entry inputSpeed="2100.00" inputTorque="11000.00" torqueLoss="205.00"/> + <Entry inputSpeed="2100.00" inputTorque="12000.00" torqueLoss="220.00"/> + <Entry inputSpeed="2100.00" inputTorque="13000.00" torqueLoss="235.00"/> + <Entry inputSpeed="2100.00" inputTorque="14000.00" torqueLoss="250.00"/> + <Entry inputSpeed="2100.00" inputTorque="15000.00" torqueLoss="265.00"/> + <Entry inputSpeed="2100.00" inputTorque="16000.00" torqueLoss="280.00"/> + <Entry inputSpeed="2100.00" inputTorque="17000.00" torqueLoss="295.00"/> + <Entry inputSpeed="2100.00" inputTorque="18000.00" torqueLoss="310.00"/> + <Entry inputSpeed="2100.00" inputTorque="19000.00" torqueLoss="325.00"/> + <Entry inputSpeed="2100.00" inputTorque="20000.00" torqueLoss="340.00"/> + <Entry inputSpeed="2100.00" inputTorque="21000.00" torqueLoss="355.00"/> + <Entry inputSpeed="2100.00" inputTorque="22000.00" torqueLoss="370.00"/> + <Entry inputSpeed="2100.00" inputTorque="23000.00" torqueLoss="385.00"/> + <Entry inputSpeed="2100.00" inputTorque="24000.00" torqueLoss="400.00"/> + <Entry inputSpeed="2100.00" inputTorque="25000.00" torqueLoss="415.00"/> + <Entry inputSpeed="2100.00" inputTorque="26000.00" torqueLoss="430.00"/> + <Entry inputSpeed="2100.00" inputTorque="27000.00" torqueLoss="445.00"/> + <Entry inputSpeed="2100.00" inputTorque="28000.00" torqueLoss="460.00"/> + <Entry inputSpeed="2100.00" inputTorque="29000.00" torqueLoss="475.00"/> + <Entry inputSpeed="2100.00" inputTorque="30000.00" torqueLoss="490.00"/> + <Entry inputSpeed="2100.00" inputTorque="31000.00" torqueLoss="505.00"/> + <Entry inputSpeed="2100.00" inputTorque="32000.00" torqueLoss="520.00"/> + <Entry inputSpeed="2100.00" inputTorque="33000.00" torqueLoss="535.00"/> + <Entry inputSpeed="2100.00" inputTorque="34000.00" torqueLoss="550.00"/> + <Entry inputSpeed="2100.00" inputTorque="35000.00" torqueLoss="565.00"/> + </TorqueLossMap> + </v2.0:Data> + <v2.0:Signature> + <di:Reference URI="#AXL-EC3ohnoh"> + <di:Transforms> + <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization"/> + <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> + </di:Transforms> + <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> + <di:DigestValue>o4nYTajmWKaduxys5ShmnfJbYd23rpxZ01JbuG6dmzU=</di:DigestValue> + </di:Reference> + </v2.0:Signature> + </Axlegear> + <AxleWheels> + <Data xsi:type="AxleWheelsDataDeclarationType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0"> + <Axles> + <Axle axleNumber="1" xsi:type="AxleDataDeclarationType"> + <AxleType>VehicleNonDriven</AxleType> + <TwinTyres>false</TwinTyres> + <Steered>true</Steered> + <Tyre> + <Data id="WHL-5432198760-315-70-R22.5" xsi:type="TyreDataDeclarationType"> + <Manufacturer>Generic Wheels Manufacturer</Manufacturer> + <Model>Generic Wheel</Model> + <CertificationNumber>e12*0815/8051*2017/05E0000*00</CertificationNumber> + <Date>2017-01-11T14:00:00Z</Date> + <AppVersion>Tyre Generation App 1.0</AppVersion> + <Dimension>315/70 R22.5</Dimension> + <RRCDeclared>0.0055</RRCDeclared> + <FzISO>31300</FzISO> + </Data> + <Signature> + <di:Reference URI="#WHL-5432198760-315-70-R22.5"> + <di:Transforms> + <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization"/> + <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> + </di:Transforms> + <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> + <di:DigestValue>4TkUGQTX8tevHOU9Cj9uyCFuI/aqcEYlo/gyVjVQmv0=</di:DigestValue> + </di:Reference> + </Signature> + </Tyre> + </Axle> + <Axle axleNumber="2" xsi:type="AxleDataDeclarationType"> + <AxleType>VehicleDriven</AxleType> + <TwinTyres>true</TwinTyres> + <Steered>false</Steered> + <Tyre> + <Data id="WHL-5432198760-315-70-R22.5" xsi:type="TyreDataDeclarationType"> + <Manufacturer>Generic Wheels Manufacturer</Manufacturer> + <Model>Generic Wheel</Model> + <CertificationNumber>e12*0815/8051*2017/05E0000*00</CertificationNumber> + <Date>2017-01-11T14:00:00Z</Date> + <AppVersion>Tyre Generation App 1.0</AppVersion> + <Dimension>315/70 R22.5</Dimension> + <RRCDeclared>0.0063</RRCDeclared> + <FzISO>31300</FzISO> + </Data> + <Signature> + <di:Reference URI="#WHL-5432198760-315-70-R22.5"> + <di:Transforms> + <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization"/> + <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> + </di:Transforms> + <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> + <di:DigestValue>KljvtvGUUQ/L7MiLVAqU+bckL5PNDNNwdeLH9kUVrfM=</di:DigestValue> + </di:Reference> + </Signature> + </Tyre> + </Axle> + </Axles> + </Data> + </AxleWheels> + <Auxiliaries> + <Data xsi:type="AUX_Conventional_PrimaryBusType"> + <Fan> + <Technology>Hydraulic driven - Constant displacement pump</Technology> + </Fan> + <SteeringPump> + <Technology axleNumber="1">Variable displacement elec. controlled</Technology> + </SteeringPump> + <ElectricSystem> + <AlternatorTechnology>conventional</AlternatorTechnology> + </ElectricSystem> + <PneumaticSystem> + <SizeOfAirSupply>Large Supply 2-stage</SizeOfAirSupply> + <CompressorDrive>mechanically</CompressorDrive> + <Clutch>none</Clutch> + <CompressorRatio>1.000</CompressorRatio> + <SmartCompressionSystem>false</SmartCompressionSystem> + <SmartRegenerationSystem>false</SmartRegenerationSystem> + <AirsuspensionControl>electronically</AirsuspensionControl> + <PneumaticSCRReagentDosing>true</PneumaticSCRReagentDosing> + </PneumaticSystem> + <HVAC> + <AdjustableCoolantThermostat>true</AdjustableCoolantThermostat> + <EngineWasteGasHeatExchanger>true</EngineWasteGasHeatExchanger> + </HVAC> + </Data> + </Auxiliaries> + </Components> + </v2.0:Vehicle> +</tns:VectoInputDeclaration> diff --git a/Vecto3GUI2020Test/TestData/Case1/vecto_vehicle-stage_input_only_certain_entries01-sample.xml b/Vecto3GUI2020Test/TestData/Case1/vecto_vehicle-stage_input_only_certain_entries01-sample.xml new file mode 100644 index 0000000000000000000000000000000000000000..ac8313e475767fdbd08e7080345679deefe4a63d --- /dev/null +++ b/Vecto3GUI2020Test/TestData/Case1/vecto_vehicle-stage_input_only_certain_entries01-sample.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<tns:VectoInputDeclaration schemaVersion="2.8" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.4" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationInput:v2.0" +xmlns:v2.3="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.3" +xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" +xmlns:di="http://www.w3.org/2000/09/xmldsig#" +xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationJob v:\VectoCore\VectoCore\Resources\XSD/VectoDeclarationJob.xsd"> + <v2.0:Vehicle id="VEH-1234567890" xsi:type="Vehicle_Conventional_CompletedBusDeclarationType" > + <Manufacturer>Some Manufacturer 1</Manufacturer> + <ManufacturerAddress>Some Manufacturer Address 1</ManufacturerAddress> + <VIN>VEH-1234567891</VIN> + <Date>2021-01-09T11:00:00Z</Date> + <Model>Sample Bus Model 2</Model> + <LegislativeCategory>M3</LegislativeCategory> + <CorrectedActualMass>5000</CorrectedActualMass> + <TechnicalPermissibleMaximumLadenMass>10000</TechnicalPermissibleMaximumLadenMass> + <AirdragModifiedMultistep>false</AirdragModifiedMultistep> + <ClassBus>A</ClassBus> + <NgTankSystem>Compressed</NgTankSystem> + <BodyworkCode>CG</BodyworkCode> + <LowEntry>true</LowEntry> + <HeightIntegratedBody>2500</HeightIntegratedBody> + <VehicleLength>10000</VehicleLength> + <VehicleWidth>2600</VehicleWidth> + <EntranceHeight>2000</EntranceHeight> + <DoorDriveTechnology>pneumatic</DoorDriveTechnology> + <VehicleDeclarationType>interim</VehicleDeclarationType> + <ADAS xsi:type="ADAS_Conventional_Type"> + <EngineStopStart>true</EngineStopStart> + <EcoRollWithoutEngineStop>false</EcoRollWithoutEngineStop> + <EcoRollWithEngineStop>false</EcoRollWithEngineStop> + <PredictiveCruiseControl>none</PredictiveCruiseControl> + <APTEcoRollReleaseLockupClutch>true</APTEcoRollReleaseLockupClutch> + </ADAS> + <Components xsi:type="Components_Conventional_CompletedBusType"> + <Auxiliaries> + <Data xsi:type="AUX_Conventional_CompletedBusType"> + <ElectricSystem> + <LEDLights> + <Interiorlights>false</Interiorlights> + <Dayrunninglights>true</Dayrunninglights> + <Headlights>false</Headlights> + </LEDLights> + </ElectricSystem> + <HVAC> + <AuxiliaryHeaterPower>50</AuxiliaryHeaterPower> + <DoubleGlazing>false</DoubleGlazing> + <SeparateAirDistributionDucts>false</SeparateAirDistributionDucts> + </HVAC> + </Data> + </Auxiliaries> + </Components> + </v2.0:Vehicle> +</tns:VectoInputDeclaration> \ No newline at end of file diff --git a/Vecto3GUI2020Test/TestData/Case2/newVifCompletedConventional-noADAS.vecto b/Vecto3GUI2020Test/TestData/Case2/newVifCompletedConventional-noADAS.vecto new file mode 100644 index 0000000000000000000000000000000000000000..d3bc43c71cc5bb8c2f7e48e624c2449817c2838c --- /dev/null +++ b/Vecto3GUI2020Test/TestData/Case2/newVifCompletedConventional-noADAS.vecto @@ -0,0 +1,14 @@ +{ + "Header": { + "CreatedBy": "Harry", + "Date": "2021-09-20T00:00:00+02:00", + "AppVersion": "Vecto3GUI2020", + "FileVersion": 10 + }, + "Body": { + "PrimaryVehicle": "..\\XML\\SchemaVersion2.4\\vecto_vehicle-primary_heavyBus-sample.xml", + "InterimStep": "..\\XML\\SchemaVersion2.4\\vecto_vehicle-stage_input_full-sample-final-noADAS.xml", + "Completed": false, + "RunSimulation": true + } +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/TestData/Case2/newVifCompletedConventional.vecto b/Vecto3GUI2020Test/TestData/Case2/newVifCompletedConventional.vecto new file mode 100644 index 0000000000000000000000000000000000000000..a3eb1c2e225f224def08f86dcbfa9f80e0499cf2 --- /dev/null +++ b/Vecto3GUI2020Test/TestData/Case2/newVifCompletedConventional.vecto @@ -0,0 +1,14 @@ +{ + "Header": { + "CreatedBy": "haraldmartini", + "Date": "2023-03-23T00:00:00+01:00", + "AppVersion": "Vecto3GUI2020", + "FileVersion": 10 + }, + "Body": { + "PrimaryVehicle": "..\\XML\\SchemaVersion2.4\\vecto_vehicle-primary_heavyBus-sample.xml", + "InterimStep": "..\\XML\\SchemaVersion2.4\\vecto_vehicle-stage_input_full-sample-final.xml", + "Completed": true, + "RunSimulation": true + } +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/TestData/Case2/newVifExempted-noTPMLM.vecto b/Vecto3GUI2020Test/TestData/Case2/newVifExempted-noTPMLM.vecto new file mode 100644 index 0000000000000000000000000000000000000000..ee936e3419aeade7435d8ca98acf779f7e30b2af --- /dev/null +++ b/Vecto3GUI2020Test/TestData/Case2/newVifExempted-noTPMLM.vecto @@ -0,0 +1,14 @@ +{ + "Header": { + "CreatedBy": "Harry", + "Date": "2021-08-25T00:00:00+02:00", + "AppVersion": "Vecto3GUI2020", + "FileVersion": 10 + }, + "Body": { + "PrimaryVehicle": "..\\XML\\SchemaVersion2.4\\exempted_primary_heavyBus.xml", + "InterimStep": "..\\XML\\SchemaVersion2.4\\vecto_vehicle-exempted_input_completewithoutTMPLM.xml", + "Completed": false, + "RunSimulation": true + } +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/TestData/Case2/newVifExempted.vecto b/Vecto3GUI2020Test/TestData/Case2/newVifExempted.vecto new file mode 100644 index 0000000000000000000000000000000000000000..055701cea4bcb3377706ec304d5464df66e315f1 --- /dev/null +++ b/Vecto3GUI2020Test/TestData/Case2/newVifExempted.vecto @@ -0,0 +1,14 @@ +{ + "Header": { + "CreatedBy": "Harry", + "Date": "2021-08-25T00:00:00+02:00", + "AppVersion": "Vecto3GUI2020", + "FileVersion": 10 + }, + "Body": { + "PrimaryVehicle": "..\\XML\\SchemaVersion2.4\\exempted_primary_heavyBus.xml", + "InterimStep": "..\\XML\\SchemaVersion2.4\\vecto_vehicle-exempted_input_full-sample.xml", + "Completed": false, + "RunSimulation": true + } +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/TestData/Case2/special_case_2.vecto b/Vecto3GUI2020Test/TestData/Case2/special_case_2.vecto new file mode 100644 index 0000000000000000000000000000000000000000..c312c66e730c57136d19b82b7221a7d0b820b608 --- /dev/null +++ b/Vecto3GUI2020Test/TestData/Case2/special_case_2.vecto @@ -0,0 +1,14 @@ +{ + "Header": { + "CreatedBy": "haraldmartini", + "Date": "2023-03-23T00:00:00+01:00", + "AppVersion": "Vecto3GUI2020", + "FileVersion": 10 + }, + "Body": { + "PrimaryVehicle": "..\\Case1\\vecto_vehicle-primary_heavyBus-sample.xml", + "InterimStep": "vecto_vehicle-stage_input_full-sample.xml", + "Completed": true, + "RunSimulation": true + } +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/TestData/Case2/vecto_vehicle-stage_input_full-sample.xml b/Vecto3GUI2020Test/TestData/Case2/vecto_vehicle-stage_input_full-sample.xml new file mode 100644 index 0000000000000000000000000000000000000000..dd906dd093f9f3443e5ee1ad9a81227f47c75574 --- /dev/null +++ b/Vecto3GUI2020Test/TestData/Case2/vecto_vehicle-stage_input_full-sample.xml @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="UTF-8"?> +<tns:VectoInputDeclaration schemaVersion="2.8" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.4" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationInput:v2.0" +xmlns:v2.3="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.3" +xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" +xmlns:di="http://www.w3.org/2000/09/xmldsig#" +xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationJob v:\VectoCore\VectoCore\Resources\XSD/VectoDeclarationJob.xsd"> + <v2.0:Vehicle id="VEH-1234567890" xsi:type="Vehicle_Conventional_CompletedBusDeclarationType"> + <Manufacturer>Some Manufacturer</Manufacturer> + <ManufacturerAddress>Some Manufacturer Address</ManufacturerAddress> + <VIN>VEH-1234567890</VIN> + <Date>2020-01-09T11:00:00Z</Date> + <Model>Sample Bus Model</Model> + <LegislativeCategory>M3</LegislativeCategory> + <CorrectedActualMass>500</CorrectedActualMass> + <TechnicalPermissibleMaximumLadenMass>3500</TechnicalPermissibleMaximumLadenMass> + <AirdragModifiedMultistep>false</AirdragModifiedMultistep> + <ClassBus>II+III</ClassBus> + <NgTankSystem>Compressed</NgTankSystem> + <NumberPassengerSeatsLowerDeck>0</NumberPassengerSeatsLowerDeck> + <NumberPassengersStandingLowerDeck>10</NumberPassengersStandingLowerDeck> + <NumberPassengerSeatsUpperDeck>10</NumberPassengerSeatsUpperDeck> + <NumberPassengersStandingUpperDeck>10</NumberPassengersStandingUpperDeck> + <BodyworkCode>CB</BodyworkCode> + <LowEntry>false</LowEntry> + <HeightIntegratedBody>2500</HeightIntegratedBody> + <VehicleLength>9500</VehicleLength> + <VehicleWidth>2500</VehicleWidth> + <EntranceHeight>2000</EntranceHeight> + <DoorDriveTechnology>electric</DoorDriveTechnology> + <VehicleDeclarationType>interim</VehicleDeclarationType> + <ADAS xsi:type="ADAS_Conventional_Type"> + <EngineStopStart>true</EngineStopStart> + <EcoRollWithoutEngineStop>false</EcoRollWithoutEngineStop> + <EcoRollWithEngineStop>false</EcoRollWithEngineStop> + <PredictiveCruiseControl>none</PredictiveCruiseControl> + <APTEcoRollReleaseLockupClutch>true</APTEcoRollReleaseLockupClutch> + </ADAS> + <Components xsi:type="Components_Conventional_CompletedBusType"> + <AirDrag> + <v2.0:Data xsi:type="v2.0:AirDragDataDeclarationType" id="CabinX23h"> + <v2.0:Manufacturer>Generic Manufacturer</v2.0:Manufacturer> + <v2.0:Model>Generic Model</v2.0:Model> + <v2.0:CertificationNumber>e12*0815/8051*2017/05E0000*00</v2.0:CertificationNumber> + <v2.0:Date>2017-03-24T15:00:00Z</v2.0:Date> + <v2.0:AppVersion>Vecto AirDrag x.y</v2.0:AppVersion> + <v2.0:CdxA_0>6.31</v2.0:CdxA_0> + <v2.0:TransferredCdxA>6.32</v2.0:TransferredCdxA> + <v2.0:DeclaredCdxA>6.34</v2.0:DeclaredCdxA> + </v2.0:Data> + <v2.0:Signature> + <di:Reference URI="#CabinX23h"> + <di:Transforms> + <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization"/> + <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> + </di:Transforms> + <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> + <di:DigestValue>b9SHCfOoVrBxFQ8wwDK32OO+9bd85DuaUdgs6j/29N8=</di:DigestValue> + </di:Reference> + </v2.0:Signature> + </AirDrag> + <Auxiliaries> + <Data xsi:type="AUX_Conventional_CompletedBusType"> + <ElectricSystem> + <LEDLights> + <Interiorlights>false</Interiorlights> + <Dayrunninglights>true</Dayrunninglights> + <Positionlights>true</Positionlights> + <Brakelights>true</Brakelights> + <Headlights>false</Headlights> + </LEDLights> + </ElectricSystem> + <HVAC> + <SystemConfiguration>0</SystemConfiguration> + <HeatPumpTypeDriverCompartment> + <Cooling>none</Cooling> + <Heating>none</Heating> + </HeatPumpTypeDriverCompartment> + <HeatPumpTypePassengerCompartment> + <Cooling>non R-744 2-stage</Cooling> + <Heating>none</Heating> + </HeatPumpTypePassengerCompartment> + <AuxiliaryHeaterPower>50</AuxiliaryHeaterPower> + <DoubleGlazing>false</DoubleGlazing> + <AdjustableAuxiliaryHeater>true</AdjustableAuxiliaryHeater> + <SeparateAirDistributionDucts>false</SeparateAirDistributionDucts> + </HVAC> + </Data> + </Auxiliaries> + </Components> + </v2.0:Vehicle> +</tns:VectoInputDeclaration> \ No newline at end of file diff --git a/Vecto3GUI2020Test/TestData/bugreports/PrimaryDecimal/primary_heavyBus group41_nonSmart_rounded_decimals.xml b/Vecto3GUI2020Test/TestData/bugreports/PrimaryDecimal/primary_heavyBus group41_nonSmart_rounded_decimals.xml index 5a3f639288f4678d8217f1584a89cc80ec93d47e..386305eb05f3f0164b00ecaf8f2ebdcf1ffb8b7a 100644 --- a/Vecto3GUI2020Test/TestData/bugreports/PrimaryDecimal/primary_heavyBus group41_nonSmart_rounded_decimals.xml +++ b/Vecto3GUI2020Test/TestData/bugreports/PrimaryDecimal/primary_heavyBus group41_nonSmart_rounded_decimals.xml @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<tns:VectoInputDeclaration schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1" xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationInput:v2.0" xmlns:v2.6="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.6" xmlns:v2.1="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xmlns:di="http://www.w3.org/2000/09/xmldsig#" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationJob V:\VectoCore\VectoCore\Resources\XSD/VectoDeclarationJob.xsd"> - <v2.0:Vehicle id="VEH-PrimaryBus_nonSmart" xsi:type="PrimaryVehicleDeclarationType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.6"> +<tns:VectoInputDeclaration schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1" xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationInput:v2.0" xmlns:v2.4="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.4" xmlns:v2.1="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xmlns:di="http://www.w3.org/2000/09/xmldsig#" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationJob V:\VectoCore\VectoCore\Resources\XSD/VectoDeclarationJob.xsd"> + <v2.0:Vehicle id="VEH-PrimaryBus_nonSmart" xsi:type="v2.4:Vehicle_Conventional_PrimaryBusDeclarationType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.4"> <Manufacturer>Generic Truck Manufacturer</Manufacturer> <ManufacturerAddress>Street, ZIP City</ManufacturerAddress> <Model>Generic Model</Model> <VIN>VEH-1234567890_nonSmart</VIN> <Date>2017-02-15T11:00:00Z</Date> + <LegislativeCategory>M3</LegislativeCategory> <ChassisConfiguration>Bus</ChassisConfiguration> <AxleConfiguration>4x2</AxleConfiguration> <Articulated>false</Articulated> @@ -15,18 +16,18 @@ <RetarderRatio>1.000</RetarderRatio> <AngledriveType>None</AngledriveType> <ZeroEmissionVehicle>false</ZeroEmissionVehicle> - <v2.6:ADAS xsi:type="v2.1:AdvancedDriverAssistantSystemsType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1"> + <ADAS xsi:type="ADAS_Conventional_Type"> <EngineStopStart>false</EngineStopStart> <EcoRollWithoutEngineStop>false</EcoRollWithoutEngineStop> <EcoRollWithEngineStop>false</EcoRollWithEngineStop> <PredictiveCruiseControl>none</PredictiveCruiseControl> - </v2.6:ADAS> - <v2.6:TorqueLimits xsi:type="TorqueLimitsType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0"> - <Entry gear="6" maxTorque="1800"/> - <Entry gear="1" maxTorque="2500"/> - </v2.6:TorqueLimits> - <Components xsi:type="PrimaryVehicleComponentsDeclarationType"> - <v2.6:Engine xsi:type="v2.0:EngineComponentDeclarationType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0"> + </ADAS> + <TorqueLimits xsi:type="v2.0:TorqueLimitsType"> + <v2.0:Entry gear="6" maxTorque="1800"/> + <v2.0:Entry gear="1" maxTorque="2500"/> + </TorqueLimits> + <Components xsi:type="Components_Conventional_PrimaryBusType"> + <v2.4:Engine xsi:type="v2.0:EngineComponentDeclarationType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0"> <v2.0:Data id="ENG-gooZah3D" xsi:type="v2.1:EngineDataDeclarationType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1"> <Manufacturer>Generic Engine Manufacturer</Manufacturer> <Model>Generic primary bus 41 Engine</Model> @@ -219,8 +220,8 @@ <di:DigestValue>sNtMe9udO39TyKXzgwYEpVKImWizFalaBVqq3jLktuo=</di:DigestValue> </di:Reference> </Signature> - </v2.6:Engine> - <v2.6:Gearbox xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="GearboxComponentDeclarationType"> + </v2.4:Engine> + <v2.4:Gearbox xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="GearboxComponentDeclarationType"> <Data id="gbx-vi2Oak2N" xsi:type="GearboxDataDeclarationType"> <Manufacturer>Generic Gearbox Manufacturer</Manufacturer> <Model>AT 6 Gear</Model> @@ -1204,8 +1205,8 @@ <di:DigestValue>ieNmjofFObDBGnB7+GX9of3HYe3ydK/ra+YvmULVJIk=</di:DigestValue> </di:Reference> </Signature> - </v2.6:Gearbox> - <v2.6:TorqueConverter xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="TorqueConverterComponentDeclarationType"> + </v2.4:Gearbox> + <v2.4:TorqueConverter xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="TorqueConverterComponentDeclarationType"> <Data id="tc-123xyz" xsi:type="TorqueConverterDataDeclarationType"> <Manufacturer>Some Manufacturer</Manufacturer> <Model>Some Model</Model> @@ -1249,8 +1250,8 @@ <di:DigestValue>q2sumDwsqQKLw4xwkEllgsygF5bHBwZPSS66UNaXXis=</di:DigestValue> </di:Reference> </Signature> - </v2.6:TorqueConverter> - <v2.6:Angledrive xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="AngledriveComponentDeclarationType"> + </v2.4:TorqueConverter> + <v2.4:Angledrive xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="AngledriveComponentDeclarationType"> <Data id="agl-vi2Oak2N" xsi:type="AngledriveDataDeclarationType"> <Manufacturer>Generic Gearbox Manufacturer</Manufacturer> <Model>Generic primary bus 41 Gearbox</Model> @@ -1278,8 +1279,8 @@ <di:DigestValue>1tuF9SoA8luoUBQGym4bYi1TurDSmcYqBDJ6AP20OSs=</di:DigestValue> </di:Reference> </Signature> - </v2.6:Angledrive> - <v2.6:Retarder xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="RetarderComponentDeclarationType"> + </v2.4:Angledrive> + <v2.4:Retarder xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="RetarderComponentDeclarationType"> <Data id="RET-Shai9imi" xsi:type="RetarderDataDeclarationType"> <Manufacturer>Generic Retarder Manufacturer</Manufacturer> <Model>Generic Retarder</Model> @@ -1325,8 +1326,8 @@ <di:DigestValue>fcEtYfDAbfuRq0xpuzapmEj+Py1PIPUZwVmx+amNvcc=</di:DigestValue> </di:Reference> </Signature> - </v2.6:Retarder> - <v2.6:Axlegear xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="AxlegearComponentDeclarationType"> + </v2.4:Retarder> + <v2.4:Axlegear xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="AxlegearComponentDeclarationType"> <Data id="AXL-EC3ohnoh" xsi:type="AxlegearDataDeclarationType"> <Manufacturer>Generic Gearbox Manufacturer</Manufacturer> <Model>Generic primary bus 41 AxleGear</Model> @@ -2119,8 +2120,8 @@ <di:DigestValue>o4nYTajmWKaduxys5ShmnfJbYd23rpxZ01JbuG6dmzU=</di:DigestValue> </di:Reference> </Signature> - </v2.6:Axlegear> - <v2.6:AxleWheels xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="AxleWheelsComponentDeclarationType"> + </v2.4:Axlegear> + <v2.4:AxleWheels xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="AxleWheelsComponentDeclarationType"> <Data xsi:type="AxleWheelsDataDeclarationType"> <Axles> <Axle axleNumber="1" xsi:type="AxleDataDeclarationType"> @@ -2179,9 +2180,9 @@ </Axle> </Axles> </Data> - </v2.6:AxleWheels> - <v2.6:Auxiliaries xsi:type="PrimaryVehicleAuxiliariesComponentDeclarationType"> - <Data xsi:type="PrimaryVehicleAuxiliaryDataDeclarationType"> + </v2.4:AxleWheels> + <v2.4:Auxiliaries xsi:type="AUX_Component_Conventional_PrimaryBus_Type"> + <Data xsi:type="AUX_Conventional_PrimaryBusType"> <Fan> <Technology>Hydraulic driven - Constant displacement pump</Technology> </Fan> @@ -2190,7 +2191,6 @@ </SteeringPump> <ElectricSystem> <AlternatorTechnology>conventional</AlternatorTechnology> - <SupplyFromHEVPossible>false</SupplyFromHEVPossible> </ElectricSystem> <PneumaticSystem> <SizeOfAirSupply>Large Supply 2-stage</SizeOfAirSupply> @@ -2207,7 +2207,7 @@ <EngineWasteGasHeatExchanger>true</EngineWasteGasHeatExchanger> </HVAC> </Data> - </v2.6:Auxiliaries> + </v2.4:Auxiliaries> </Components> </v2.0:Vehicle> </tns:VectoInputDeclaration> diff --git a/Vecto3GUI2020Test/TestData/vecto_multistage_conventional_final_vif.VIF_Report_1.xml b/Vecto3GUI2020Test/TestData/vecto_multistage_conventional_final_vif.VIF_Report_1.xml deleted file mode 100644 index ad423c74f43d8fcb9946c51402ad5c2b1cbb75b8..0000000000000000000000000000000000000000 --- a/Vecto3GUI2020Test/TestData/vecto_multistage_conventional_final_vif.VIF_Report_1.xml +++ /dev/null @@ -1,690 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<VectoOutputMultistep xmlns:di="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:vif0.1="urn:tugraz:ivt:VectoAPI:DeclarationOutput:VehicleInterimFile:v0.1" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xmlns:v2.1="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.1" xmlns:v2.3="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.3" xmlns:v2.10.2="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.10.2" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationOutput:VehicleInterimFile:v0.1 V:\VectoCore\VectoCore\Resources\XSD/VectoOutputMultistep.0.1.xsd" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationOutput:VehicleInterimFile:v0.1"> - <PrimaryVehicle> - <Data id="VEH-622a60d3b3cf4340a362" xsi:type="PrimaryVehicleDataType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationOutput:VehicleInterimFile:v0.1"> - <Vehicle xsi:type="VehiclePIFType"> - <ManufacturerPrimaryVehicle>Generic Truck Manufacturer</ManufacturerPrimaryVehicle> - <ManufacturerAddressPrimaryVehicle>Street, ZIP City</ManufacturerAddressPrimaryVehicle> - <Model>Generic Model</Model> - <VIN>VEH-1234567890</VIN> - <Date>2017-02-15T11:00:00Z</Date> - <LegislativeCategory>M3</LegislativeCategory> - <ChassisConfiguration>Bus</ChassisConfiguration> - <AxleConfiguration>4x2</AxleConfiguration> - <Articulated>false</Articulated> - <TechnicalPermissibleMaximumLadenMass>25000</TechnicalPermissibleMaximumLadenMass> - <IdlingSpeed>600</IdlingSpeed> - <RetarderType>Transmission Output Retarder</RetarderType> - <RetarderRatio>1.000</RetarderRatio> - <AngledriveType>None</AngledriveType> - <ZeroEmissionVehicle>false</ZeroEmissionVehicle> - <vif0.1:ADAS xsi:type="ADAS_Conventional_Type" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.10.2"> - <EngineStopStart>false</EngineStopStart> - <EcoRollWithoutEngineStop>false</EcoRollWithoutEngineStop> - <EcoRollWithEngineStop>false</EcoRollWithEngineStop> - <PredictiveCruiseControl>none</PredictiveCruiseControl> - </vif0.1:ADAS> - <vif0.1:TorqueLimits xsi:type="TorqueLimitsType" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0"> - <v2.0:Entry gear="6" maxTorque="1800" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" /> - <v2.0:Entry gear="1" maxTorque="2500" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" /> - <v2.0:Entry gear="12" maxTorque="1900" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" /> - </vif0.1:TorqueLimits> - <Components xsi:type="VehicleComponentsPIFType"> - <Engine> - <Data xsi:type="EngineDataPIFType"> - <Manufacturer>Generic Engine Manufacturer</Manufacturer> - <Model>Generic 40t Long Haul Truck Engine</Model> - <CertificationNumber>e12*0815/8051*2017/05E0000*00</CertificationNumber> - <Date>2017-02-15T11:00:00Z</Date> - <AppVersion>VectoEngine x.y</AppVersion> - <Displacement>12730</Displacement> - <RatedSpeed>2200</RatedSpeed> - <RatedPower>380000</RatedPower> - <MaxEngineTorque>2400</MaxEngineTorque> - <WHRType> - <v2.3:MechanicalOutputICE>false</v2.3:MechanicalOutputICE> - <v2.3:MechanicalOutputDrivetrain>false</v2.3:MechanicalOutputDrivetrain> - <v2.3:ElectricalOutput>false</v2.3:ElectricalOutput> - </WHRType> - <Mode> - <IdlingSpeed>560</IdlingSpeed> - <FullLoadAndDragCurve> - <Entry engineSpeed="560.00" maxTorque="1180.00" dragTorque="-149.00" /> - <Entry engineSpeed="600.00" maxTorque="1282.00" dragTorque="-148.00" /> - <Entry engineSpeed="800.00" maxTorque="1791.00" dragTorque="-149.00" /> - <Entry engineSpeed="1000.00" maxTorque="2300.00" dragTorque="-160.00" /> - <Entry engineSpeed="1200.00" maxTorque="2300.00" dragTorque="-179.00" /> - <Entry engineSpeed="1400.00" maxTorque="2300.00" dragTorque="-203.00" /> - <Entry engineSpeed="1600.00" maxTorque="2079.00" dragTorque="-235.00" /> - <Entry engineSpeed="1800.00" maxTorque="1857.00" dragTorque="-264.00" /> - <Entry engineSpeed="2000.00" maxTorque="1352.00" dragTorque="-301.00" /> - <Entry engineSpeed="2100.00" maxTorque="1100.00" dragTorque="-320.00" /> - </FullLoadAndDragCurve> - <Fuels> - <FuelType>NG CI</FuelType> - </Fuels> - </Mode> - </Data> - </Engine> - <Transmission> - <Data xsi:type="TransmissionDataPIFType"> - <Manufacturer>Generic Gearbox Manufacturer</Manufacturer> - <Model>Generic 40t Long Haul Truck Gearbox</Model> - <MainCertificationMethod>Standard values</MainCertificationMethod> - <Date>2017-01-11T11:00:00Z</Date> - <AppVersion>3.0.1</AppVersion> - <TransmissionType>AMT</TransmissionType> - <Gears xsi:type="TransmissionGearsPIFType"> - <Gear number="1"> - <Ratio>14.930</Ratio> - <MaxTorque>1900</MaxTorque> - <MaxSpeed>2000</MaxSpeed> - </Gear> - <Gear number="2"> - <Ratio>11.640</Ratio> - <MaxTorque>1900</MaxTorque> - <MaxSpeed>2000</MaxSpeed> - </Gear> - <Gear number="3"> - <Ratio>9.020</Ratio> - <MaxSpeed>2000</MaxSpeed> - </Gear> - <Gear number="4"> - <Ratio>7.040</Ratio> - <MaxSpeed>2000</MaxSpeed> - </Gear> - <Gear number="5"> - <Ratio>5.640</Ratio> - <MaxSpeed>2000</MaxSpeed> - </Gear> - <Gear number="6"> - <Ratio>4.400</Ratio> - <MaxSpeed>2000</MaxSpeed> - </Gear> - <Gear number="7"> - <Ratio>3.390</Ratio> - <MaxSpeed>2000</MaxSpeed> - </Gear> - <Gear number="8"> - <Ratio>2.650</Ratio> - <MaxSpeed>2000</MaxSpeed> - </Gear> - <Gear number="9"> - <Ratio>2.050</Ratio> - <MaxSpeed>2000</MaxSpeed> - </Gear> - <Gear number="10"> - <Ratio>1.600</Ratio> - <MaxSpeed>2000</MaxSpeed> - </Gear> - <Gear number="11"> - <Ratio>1.280</Ratio> - <MaxSpeed>2000</MaxSpeed> - </Gear> - <Gear number="12"> - <Ratio>1.000</Ratio> - </Gear> - </Gears> - </Data> - </Transmission> - <Axlegear> - <Data xsi:type="AxlegearDataPIFType"> - <Manufacturer>Generic Gearbox Manufacturer</Manufacturer> - <Model>Generic 40t Long Haul Truck AxleGear</Model> - <CertificationMethod>Standard values</CertificationMethod> - <Date>2017-01-11T11:00:00Z</Date> - <AppVersion>3.0.1</AppVersion> - <LineType>Single portal axle</LineType> - <Ratio>2.590</Ratio> - </Data> - </Axlegear> - <AxleWheels> - <Data xsi:type="AxleWheelsDataPIFType"> - <Axles> - <Axle axleNumber="1" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="v2.0:AxleDataDeclarationType"> - <v2.0:AxleType>VehicleNonDriven</v2.0:AxleType> - <v2.0:TwinTyres>false</v2.0:TwinTyres> - <v2.0:Steered>true</v2.0:Steered> - <v2.0:Tyre> - <v2.0:Data id="WHL-5432198760-315-70-R22.5" xsi:type="v2.0:TyreDataDeclarationType"> - <v2.0:Manufacturer>Generic Wheels Manufacturer</v2.0:Manufacturer> - <v2.0:Model>Generic Wheel</v2.0:Model> - <v2.0:CertificationNumber>e12*0815/8051*2017/05E0000*00</v2.0:CertificationNumber> - <v2.0:Date>2017-01-11T14:00:00Z</v2.0:Date> - <v2.0:AppVersion>Tyre Generation App 1.0</v2.0:AppVersion> - <v2.0:Dimension>315/70 R22.5</v2.0:Dimension> - <v2.0:RRCDeclared>0.0055</v2.0:RRCDeclared> - <v2.0:FzISO>31300</v2.0:FzISO> - </v2.0:Data> - <v2.0:Signature> - <di:Reference URI="#WHL-5432198760-315-70-R22.5" xmlns:di="http://www.w3.org/2000/09/xmldsig#"> - <di:Transforms> - <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization" /> - <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> - </di:Transforms> - <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /> - <di:DigestValue>4TkUGQTX8tevHOU9Cj9uyCFuI/aqcEYlo/gyVjVQmv0=</di:DigestValue> - </di:Reference> - </v2.0:Signature> - </v2.0:Tyre> - </Axle> - <Axle axleNumber="2" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xsi:type="v2.0:AxleDataDeclarationType"> - <v2.0:AxleType>VehicleDriven</v2.0:AxleType> - <v2.0:TwinTyres>true</v2.0:TwinTyres> - <v2.0:Steered>false</v2.0:Steered> - <v2.0:Tyre> - <v2.0:Data id="WHL-5432198760-315-70-R22.5" xsi:type="v2.0:TyreDataDeclarationType"> - <v2.0:Manufacturer>Generic Wheels Manufacturer</v2.0:Manufacturer> - <v2.0:Model>Generic Wheel</v2.0:Model> - <v2.0:CertificationNumber>e12*0815/8051*2017/05E0000*00</v2.0:CertificationNumber> - <v2.0:Date>2017-01-11T14:00:00Z</v2.0:Date> - <v2.0:AppVersion>Tyre Generation App 1.0</v2.0:AppVersion> - <v2.0:Dimension>315/70 R22.5</v2.0:Dimension> - <v2.0:RRCDeclared>0.0063</v2.0:RRCDeclared> - <v2.0:FzISO>31300</v2.0:FzISO> - </v2.0:Data> - <v2.0:Signature> - <di:Reference URI="#WHL-5432198760-315-70-R22.5" xmlns:di="http://www.w3.org/2000/09/xmldsig#"> - <di:Transforms> - <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization" /> - <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> - </di:Transforms> - <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /> - <di:DigestValue>KljvtvGUUQ/L7MiLVAqU+bckL5PNDNNwdeLH9kUVrfM=</di:DigestValue> - </di:Reference> - </v2.0:Signature> - </v2.0:Tyre> - </Axle> - </Axles> - </Data> - </AxleWheels> - <Auxiliaries> - <Data xsi:type="AuxiliaryDataPIFType"> - <Fan> - <Technology>Hydraulic driven - Constant displacement pump</Technology> - </Fan> - <SteeringPump> - <Technology axleNumber="1">Variable displacement elec. controlled</Technology> - </SteeringPump> - <ElectricSystem> - <AlternatorTechnology>conventional</AlternatorTechnology> - </ElectricSystem> - <PneumaticSystem> - <SizeOfAirSupply>Large Supply 2-stage</SizeOfAirSupply> - <CompressorDrive>electrically</CompressorDrive> - <Clutch>none</Clutch> - <CompressorRatio>1.000</CompressorRatio> - <SmartCompressionSystem>false</SmartCompressionSystem> - <SmartRegenerationSystem>false</SmartRegenerationSystem> - <AirsuspensionControl>electronically</AirsuspensionControl> - <PneumaticSCRReagentDosing>true</PneumaticSCRReagentDosing> - </PneumaticSystem> - <HVAC> - <AdjustableCoolantThermostat>true</AdjustableCoolantThermostat> - <EngineWasteGasHeatExchanger>true</EngineWasteGasHeatExchanger> - </HVAC> - </Data> - </Auxiliaries> - </Components> - </Vehicle> - <InputDataSignature> - <di:Reference URI="#VEH-1234567890"> - <di:Transforms> - <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization" /> - <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> - </di:Transforms> - <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /> - <di:DigestValue>8uY4dWDsEyozlZhzV8X7Fq1tavvoBIXiCn8oAUcsjVw=</di:DigestValue> - </di:Reference> - </InputDataSignature> - <ManufacturerRecordSignature> - <di:Reference URI="#RESULT-c2756d6f924c489c81e9"> - <di:Transforms> - <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization" /> - <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> - </di:Transforms> - <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /> - <di:DigestValue>kCeubdlXuVQOI1TTqjrTTxSNL8vfA19QjSy60xXYCa4=</di:DigestValue> - </di:Reference> - </ManufacturerRecordSignature> - <Results> - <Status>success</Status> - <Result status="success"> - <VehicleGroup>P31SD</VehicleGroup> - <Mission>Heavy Urban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">13098.63</TotalVehicleMass> - <Payload unit="kg">1123.63</Payload> - <PassengerCount>16.52</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">19.71467</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">1104.84</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P31SD</VehicleGroup> - <Mission>Heavy Urban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">17593.16</TotalVehicleMass> - <Payload unit="kg">5618.16</Payload> - <PassengerCount>82.62</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">23.22512</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">1301.57</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P31SD</VehicleGroup> - <Mission>Urban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">13098.63</TotalVehicleMass> - <Payload unit="kg">1123.63</Payload> - <PassengerCount>16.52</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">15.45965</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">866.38</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P31SD</VehicleGroup> - <Mission>Urban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">17593.16</TotalVehicleMass> - <Payload unit="kg">5618.16</Payload> - <PassengerCount>82.62</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">18.39275</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">1030.76</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P31SD</VehicleGroup> - <Mission>Suburban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">13098.63</TotalVehicleMass> - <Payload unit="kg">1123.63</Payload> - <PassengerCount>16.52</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">13.17582</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">738.40</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P31SD</VehicleGroup> - <Mission>Suburban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">17593.16</TotalVehicleMass> - <Payload unit="kg">5618.16</Payload> - <PassengerCount>82.62</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">16.00192</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">896.77</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P31SD</VehicleGroup> - <Mission>Interurban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">13050.44</TotalVehicleMass> - <Payload unit="kg">1075.44</Payload> - <PassengerCount>15.15</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">11.11672</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">623.00</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P31SD</VehicleGroup> - <Mission>Interurban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">15494.61</TotalVehicleMass> - <Payload unit="kg">3519.61</Payload> - <PassengerCount>49.57</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">12.34809</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">692.01</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P31DD</VehicleGroup> - <Mission>Heavy Urban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">13543.34</TotalVehicleMass> - <Payload unit="kg">1193.34</Payload> - <PassengerCount>17.55</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">20.71050</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">1160.65</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P31DD</VehicleGroup> - <Mission>Heavy Urban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">18316.69</TotalVehicleMass> - <Payload unit="kg">5966.69</Payload> - <PassengerCount>87.75</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">24.68655</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">1383.48</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P31DD</VehicleGroup> - <Mission>Urban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">13543.34</TotalVehicleMass> - <Payload unit="kg">1193.34</Payload> - <PassengerCount>17.55</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">16.25928</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">911.20</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P31DD</VehicleGroup> - <Mission>Urban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">18316.69</TotalVehicleMass> - <Payload unit="kg">5966.69</Payload> - <PassengerCount>87.75</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">19.58479</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">1097.56</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P31DD</VehicleGroup> - <Mission>Suburban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">13543.34</TotalVehicleMass> - <Payload unit="kg">1193.34</Payload> - <PassengerCount>17.55</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">13.83088</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">775.11</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P31DD</VehicleGroup> - <Mission>Suburban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">18316.69</TotalVehicleMass> - <Payload unit="kg">5966.69</Payload> - <PassengerCount>87.75</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">17.02489</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">954.10</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P32SD</VehicleGroup> - <Mission>Interurban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">14225.44</TotalVehicleMass> - <Payload unit="kg">1075.44</Payload> - <PassengerCount>15.15</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">11.30640</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">633.63</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P32SD</VehicleGroup> - <Mission>Interurban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">16669.61</TotalVehicleMass> - <Payload unit="kg">3519.61</Payload> - <PassengerCount>49.57</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">12.56427</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">704.12</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P32SD</VehicleGroup> - <Mission>Coach</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">14244.99</TotalVehicleMass> - <Payload unit="kg">1094.99</Payload> - <PassengerCount>15.42</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">8.73159</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">489.33</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P32SD</VehicleGroup> - <Mission>Coach</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">15887.48</TotalVehicleMass> - <Payload unit="kg">2737.48</Payload> - <PassengerCount>38.56</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">9.18847</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">514.94</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P32DD</VehicleGroup> - <Mission>Interurban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">14662.82</TotalVehicleMass> - <Payload unit="kg">1262.82</Payload> - <PassengerCount>17.79</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">11.67569</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">654.33</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P32DD</VehicleGroup> - <Mission>Interurban</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">17609.41</TotalVehicleMass> - <Payload unit="kg">4209.41</Payload> - <PassengerCount>59.29</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">13.23582</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">741.76</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P32DD</VehicleGroup> - <Mission>Coach</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">14747.01</TotalVehicleMass> - <Payload unit="kg">1347.01</Payload> - <PassengerCount>18.97</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">9.18672</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">514.84</CO2> - </Result> - <Result status="success"> - <VehicleGroup>P32DD</VehicleGroup> - <Mission>Coach</Mission> - <SimulationParameters> - <TotalVehicleMass unit="kg">16767.53</TotalVehicleMass> - <Payload unit="kg">3367.53</Payload> - <PassengerCount>47.43</PassengerCount> - <FuelMode>single fuel mode</FuelMode> - </SimulationParameters> - <Fuel type="NG CI"> - <EnergyConsumption unit="MJ/km">9.74629</EnergyConsumption> - </Fuel> - <CO2 unit="g/km">546.20</CO2> - </Result> - </Results> - <ApplicationInformation> - <SimulationToolVersion>0.7.5.2380-DEV !!NOT FOR CERTIFICATION!!</SimulationToolVersion> - <Date>2021-08-24T08:43:39.7171617Z</Date> - </ApplicationInformation> - </Data> - <Signature> - <di:Reference URI="#VEH-622a60d3b3cf4340a362"> - <di:Transforms> - <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization" /> - <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> - </di:Transforms> - <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /> - <di:DigestValue>PMrdzQUpL67ALWFQpWjxSieZ4KQ2iqS2y4BmHV3nJ0g=</di:DigestValue> - </di:Reference> - </Signature> - </PrimaryVehicle> - <ManufacturingStep stepCount="2"> - <Data xsi:type="BusManufacturingStepDataType" id="MST-0adf9390bde54a23a113" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationOutput:VehicleInterimFile:v0.1"> - <HashPreviousStep> - <di:Reference URI="#VEH-622a60d3b3cf4340a362"> - <di:Transforms> - <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization" /> - <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> - </di:Transforms> - <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /> - <di:DigestValue>PMrdzQUpL67ALWFQpWjxSieZ4KQ2iqS2y4BmHV3nJ0g=</di:DigestValue> - </di:Reference> - </HashPreviousStep> - <vif0.1:Vehicle xsi:type="Vehicle_Conventional_CompletedBusDeclarationType" id="VEH-09ab483f390a40d58f5a" xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:DEV:v2.10.2"> - <Manufacturer>Some Manufacturer</Manufacturer> - <ManufacturerAddress>Some Manufacturer Address</ManufacturerAddress> - <VIN>VEH-1234567890</VIN> - <Date>2021-08-23T22:00:00Z</Date> - <Model>Sample Bus Model</Model> - <LegislativeCategory>M3</LegislativeCategory> - <CorrectedActualMass>500</CorrectedActualMass> - <TechnicalPermissibleMaximumLadenMass>3500</TechnicalPermissibleMaximumLadenMass> - <AirdragModifiedMultistep>true</AirdragModifiedMultistep> - <ClassBus>II+III</ClassBus> - <NgTankSystem>Compressed</NgTankSystem> - <NumberPassengerSeatsLowerDeck>1</NumberPassengerSeatsLowerDeck> - <NumberPassengersStandingLowerDeck>10</NumberPassengersStandingLowerDeck> - <NumberPassengerSeatsUpperDeck>11</NumberPassengerSeatsUpperDeck> - <NumberPassengersStandingUpperDeck>2</NumberPassengersStandingUpperDeck> - <BodyworkCode>CB</BodyworkCode> - <LowEntry>false</LowEntry> - <HeightIntegratedBody>2500</HeightIntegratedBody> - <VehicleLength>9500</VehicleLength> - <VehicleWidth>2500</VehicleWidth> - <EntranceHeight>2000</EntranceHeight> - <DoorDriveTechnology>electric</DoorDriveTechnology> - <VehicleDeclarationType>final</VehicleDeclarationType> - <VehicleTypeApprovalNumber>123456</VehicleTypeApprovalNumber> - <ADAS xsi:type="ADAS_Conventional_Type"> - <EngineStopStart>true</EngineStopStart> - <EcoRollWithoutEngineStop>false</EcoRollWithoutEngineStop> - <EcoRollWithEngineStop>false</EcoRollWithEngineStop> - <PredictiveCruiseControl>none</PredictiveCruiseControl> - <APTEcoRollReleaseLockupClutch>true</APTEcoRollReleaseLockupClutch> - </ADAS> - <Components xsi:type="Components_Conventional_CompletedBusType"> - <AirDrag> - <v2.0:Data id="CabinX23h" xsi:type="v2.0:AirDragDataDeclarationType" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0"> - <v2.0:Manufacturer>Generic Manufacturer</v2.0:Manufacturer> - <v2.0:Model>Generic Model</v2.0:Model> - <v2.0:CertificationNumber>e12*0815/8051*2017/05E0000*00</v2.0:CertificationNumber> - <v2.0:Date>2017-03-24T15:00:00Z</v2.0:Date> - <v2.0:AppVersion>Vecto AirDrag x.y</v2.0:AppVersion> - <v2.0:CdxA_0>6.31</v2.0:CdxA_0> - <v2.0:TransferredCdxA>6.32</v2.0:TransferredCdxA> - <v2.0:DeclaredCdxA>6.34</v2.0:DeclaredCdxA> - </v2.0:Data> - <v2.0:Signature xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0"> - <di:Reference URI="#CabinX23h" xmlns:di="http://www.w3.org/2000/09/xmldsig#"> - <di:Transforms> - <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization" /> - <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> - </di:Transforms> - <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /> - <di:DigestValue>b9SHCfOoVrBxFQ8wwDK32OO+9bd85DuaUdgs6j/29N8=</di:DigestValue> - </di:Reference> - </v2.0:Signature> - </AirDrag> - <Auxiliaries> - <Data xsi:type="AUX_Conventional_CompletedBusType"> - <ElectricSystem> - <LEDLights> - <Interiorlights>false</Interiorlights> - <Dayrunninglights>true</Dayrunninglights> - <Positionlights>true</Positionlights> - <Brakelights>true</Brakelights> - <Headlights>false</Headlights> - </LEDLights> - </ElectricSystem> - <HVAC> - <SystemConfiguration>4</SystemConfiguration> - <HeatPumpTypeDriverCompartment> - <Cooling>non R-744 3-stage</Cooling> - <Heating>non R-744 3-stage</Heating> - </HeatPumpTypeDriverCompartment> - <HeatPumpTypePassengerCompartment> - <Cooling>non R-744 2-stage</Cooling> - <Heating>non R-744 4-stage</Heating> - </HeatPumpTypePassengerCompartment> - <AuxiliaryHeaterPower>50</AuxiliaryHeaterPower> - <DoubleGlazing>false</DoubleGlazing> - <AdjustableAuxiliaryHeater>true</AdjustableAuxiliaryHeater> - <SeparateAirDistributionDucts>true</SeparateAirDistributionDucts> - </HVAC> - </Data> - </Auxiliaries> - </Components> - </vif0.1:Vehicle> - <ApplicationInformation> - <SimulationToolVersion>0.7.5.2380-DEV</SimulationToolVersion> - <Date>2021-08-24T08:43:41.1851923Z</Date> - </ApplicationInformation> - </Data> - <Signature> - <di:Reference URI="#MST-0adf9390bde54a23a113"> - <di:Transforms> - <di:Transform Algorithm="urn:vecto:xml:2017:canonicalization" /> - <di:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> - </di:Transforms> - <di:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /> - <di:DigestValue>ExKEVzerQlHGdqCo8XsbBC5PWQ0dKFC0nsiPkW31ZBs=</di:DigestValue> - </di:Reference> - </Signature> - </ManufacturingStep> -</VectoOutputMultistep> \ No newline at end of file diff --git a/Vecto3GUI2020Test/TestHelper.cs b/Vecto3GUI2020Test/TestHelper.cs index 0f800f625c404c350eeaf8e664fe342b627193d3..5ad60cd5dea6e64d0b09cd070eb12f3add347f77 100644 --- a/Vecto3GUI2020Test/TestHelper.cs +++ b/Vecto3GUI2020Test/TestHelper.cs @@ -1,8 +1,15 @@ using System; using System.CodeDom; using System.Runtime.CompilerServices; +using Ninject; using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore; using TUGraz.VectoCore.InputData.FileIO.XML; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Ninject; +using VECTO3GUI2020.Ninject.Factories; +using VECTO3GUI2020.Ninject.Vehicle; +using Vecto3GUI2020Test.Utils; namespace Vecto3GUI2020Test { @@ -10,13 +17,35 @@ namespace Vecto3GUI2020Test { private IXMLInputDataReader _inputDataReader; - public TestHelper(IXMLInputDataReader inputDataReader) + public static IKernel GetKernel() { - _inputDataReader = inputDataReader; + var kernel = new StandardKernel( + new VectoNinjectModule(), + new JobEditModule(), + new DocumentModule(), + new XMLWriterFactoryModule(), + new FactoryModule(), + new Vecto3GUI2020Module() + ); + kernel.Rebind<IDialogHelper>().To<MockDialogHelper>().InSingletonScope(); + kernel.Rebind<IWindowHelper>().To<MockWindowHelper>().InSingletonScope(); + + return kernel; } + public static IKernel GetKernel(out MockDialogHelper mockDialogHelper, out MockWindowHelper mockWindowHelper) + { + var kernel = GetKernel(); + mockDialogHelper = kernel.Get<IDialogHelper>() as MockDialogHelper; + mockWindowHelper = kernel.Get<IWindowHelper>() as MockWindowHelper; + return kernel; + } + public TestHelper(IXMLInputDataReader inputDataReader) + { + _inputDataReader = inputDataReader; + } public IInputDataProvider GetInputDataProvider(string fileName) { diff --git a/Vecto3GUI2020Test/UI/DesktopSession.cs b/Vecto3GUI2020Test/UI/DesktopSession.cs deleted file mode 100644 index 7e4941c8ca65fba015ccfc8e22da3014fa75ee0d..0000000000000000000000000000000000000000 --- a/Vecto3GUI2020Test/UI/DesktopSession.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Diagnostics; -using OpenQA.Selenium.Appium; -using OpenQA.Selenium.Appium.Windows; - -namespace Vecto3GUI2020Test -{ - public class DesktopSession - { - private const string WindowsApplicationDriverUrl = "http://127.0.0.1:4723/"; - WindowsDriver<WindowsElement> desktopSession; - - public DesktopSession() - { - var process = Process.Start(@"C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe"); - - var appCapabilities = new AppiumOptions(); - appCapabilities.AddAdditionalCapability("app", "Root"); - appCapabilities.AddAdditionalCapability("deviceName", "WindowsPC"); - desktopSession = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), appCapabilities); - } - - ~DesktopSession() - { - desktopSession.Quit(); - } - - public WindowsDriver<WindowsElement> DesktopSessionElement - { - get { return desktopSession; } - } - - public WindowsElement FindElementByAbsoluteXPath(string xPath, int nTryCount = 15) - { - WindowsElement uiTarget = null; - - while (nTryCount-- > 0) { - try { - uiTarget = desktopSession.FindElementByXPath(xPath); - } catch { - } - - if (uiTarget != null) { - break; - } else { - System.Threading.Thread.Sleep(200); - } - } - - return uiTarget; - } - } -} diff --git a/Vecto3GUI2020Test/UI/UITests.cs b/Vecto3GUI2020Test/UI/UITests.cs deleted file mode 100644 index 436e722c67439205a97705b8cd1c6929ff5c1274..0000000000000000000000000000000000000000 --- a/Vecto3GUI2020Test/UI/UITests.cs +++ /dev/null @@ -1,270 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using NUnit.Framework; -using OpenQA.Selenium; -using OpenQA.Selenium.Appium.Android; -using OpenQA.Selenium.Appium.Windows; -using OpenQA.Selenium.Interactions; -using Vecto3GUI2020Test.UI; - -namespace Vecto3GUI2020Test -{/// <summary> -/// The Application under Test has to run on a Windows 10 Machine on a Desktop called "VE -/// </summary> -/// - [Ignore("GUI tests are not working that good")] - [TestFixture] - public class UITests : VECTO3GUI2020Session - { - [SetUp] - public void Setup() - { - Setup(TestContext.CurrentContext); - } - - [Ignore("ignored UI test")] - [Test] - public void LoadFileSession() - { - session.FindElementByXPath( - "//Button[@Name=\"New Multistage File\"][@AutomationId=\"JobListViewNewManufacturingStageFileButton\"]").Click(); //open new multistageWindow - - - session.SwitchTo().Window(session.WindowHandles.Last()); - Assert.AreEqual(2, session.WindowHandles.Count); - - - session.FindElementByXPath( - ".//Custom[@AutomationId=\"NewMultistageJobView\"]/Custom[@AutomationId=\"NewMultistageFilePicker\"]/Button[@AutomationId=\"button\"]").Click(); - - - - Assert.AreEqual(3, session.WindowHandles); - - - - Thread.Sleep(100000); - } - - - - - #region DesktopSessionTests - - //[Ignore("disabled Desktop Session tests")] - //[Test] - //public void LoadFile() - //{ - // LoadFileThroughUIWithDesktopSession(fileName: "vecto_multistage_consolidated_multiple_stages.xml"); - //} - //[Ignore("disabled Desktop Session tests")] - //[Test] - //public void LoadFileAirdrag() - //{ - // LoadFileThroughUIWithDesktopSession(fileName: "vecto_multistage_consolidated_multiple_stages_airdrag.xml"); - - //} - //[Ignore("disabled Desktop Session tests")] - //[Test] - //public void LoadFileheatPump() - //{ - // LoadFileThroughUIWithDesktopSession(fileName: "vecto_multistage_consolidated_multiple_stages_heatPump.xml"); - - //} - //[Ignore("disabled Desktop Session tests")] - //[Test] - //public void LoadFilehev() - //{ - // LoadFileThroughUIWithDesktopSession(fileName: "vecto_multistage_consolidated_multiple_stages_hev.xml"); - - //} - - //[Ignore("disabled Desktop Session tests")] - //[Test] - //public void LoadFileNGTankSystem() - //{ - // LoadFileThroughUIWithDesktopSession(fileName: "vecto_multistage_consolidated_multiple_stages_NGTankSystem.xml"); - //} - - //[Ignore("disabled Desktop Session tests")] - //[Test] - //public void LoadFileConsolidatedOneStage() - //{ - // LoadFileThroughUIWithDesktopSession(fileName: "vecto_multistage_consolidated_one_stage.xml"); - //} - //[Ignore("disabled Desktop Session tests")] - //[Test] - //public void LoadFileConsolidatedTwoStages() - //{ - // LoadFileThroughUIWithDesktopSession(fileName: "vecto_multistage_consolidated_two_stages.xml"); - //} - //[Ignore("disabled Desktop Session tests")] - //[Test] - //public void LoadFilePrimaryVehicleOnly() - //{ - // LoadFileThroughUIWithDesktopSession(fileName: "vecto_multistage_primary_vehicle_only.xml"); - //} - - //[Ignore("disabled Desktop Session tests")] - //[Test] - //public void LoadFilePrimaryVehicleStage_2_3() - //{ - // LoadFileThroughUIWithDesktopSession(fileName: "vecto_multistage_consolidated_one_stage.xml"); - //} - //[Ignore("disabled Desktop Session tests")] - //[Test] - //public void LoadFilePrimaryVehicleOnlyAndCheckFields() - //{ - // LoadFileThroughUIWithDesktopSession(fileName: "vecto_multistage_primary_vehicle_only.xml"); - // //Check vehicle fields - // SelectVehicleTab(); - // focusToActiveWindow(); - // //var element = session.FindElementByXPath() - //} - - //private void LoadFileThroughUIWithDesktopSession(string fileName) - //{ - // // LeftClick on Button "New Multistage File" at (65,28) - // // LeftClick on Button "New Multistage File" at (87,25) - // Console.WriteLine("LeftClick on Button \"New Multistage File\" at (87,25)"); - // string xpath_LeftClickButtonNewMultist_87_25 = "/Pane[@ClassName=\"#32769\"][@Name=\"Vecto\"]/Window[@ClassName=\"Window\"][@Name=\"Vecto\"]/Custom[@ClassName=\"JobListView\"]/Button[@Name=\"New Multistage File\"][@AutomationId=\"JobListViewNewManufacturingStageFileButton\"]"; - // var winElem_LeftClickButtonNewMultist_87_25 = desktopSession.FindElementByAbsoluteXPath(xpath_LeftClickButtonNewMultist_87_25); - - // if (winElem_LeftClickButtonNewMultist_87_25 != null) - // { - // winElem_LeftClickButtonNewMultist_87_25.Click(); - // } - // else - // { - // Console.WriteLine($"Failed to find element using xpath: {xpath_LeftClickButtonNewMultist_87_25}"); - // } - // Assert.NotNull(winElem_LeftClickButtonNewMultist_87_25); - - // // LeftDblClick on Button "" at (11,11) - // Console.WriteLine("LeftDblClick on Button \"\" at (11,11)"); - // string xpath_LeftDblClickButton_11_11 = "/Pane[@ClassName=\"#32769\"][@Name=\"Vecto\"]/Window[@ClassName=\"Window\"][starts-with(@Name,\"VECTO3GUI2020.ViewModel.MultiStage.Implementation.NewMultiStageJ\")]/Custom[@AutomationId=\"NewMultistageJobView\"]/Custom[@AutomationId=\"NewMultistageFilePicker\"]/Button[@AutomationId=\"button\"]"; - // var winElem_LeftDblClickButton_11_11 = desktopSession.FindElementByAbsoluteXPath(xpath_LeftDblClickButton_11_11); - - // if (winElem_LeftDblClickButton_11_11 != null) { - // desktopSession.DesktopSessionElement.Mouse.MouseMove(winElem_LeftDblClickButton_11_11.Coordinates); - // desktopSession.DesktopSessionElement.Mouse.DoubleClick(null); - // } - // else - // { - // Console.WriteLine($"Failed to find element using xpath: {xpath_LeftDblClickButton_11_11}"); - - // } - // Assert.NotNull(winElem_LeftDblClickButton_11_11); - - // // LeftDblClick on Edit "Name" at (284,8) - // Console.WriteLine("LeftDblClick on Edit \"Name\" at (284,8)"); - // string xpath_LeftDblClickEditName_284_8 = $"/Pane[@ClassName=\"#32769\"][@Name=\"Vecto\"]/Window[@ClassName=\"Window\"][starts-with(@Name,\"VECTO3GUI2020.ViewModel.MultiStage.Implementation.NewMultiStageJ\")]/Window[@ClassName=\"#32770\"][@Name=\"Öffnen\"]/Pane[@ClassName=\"DUIViewWndClassName\"]/Pane[@Name=\"Shellordneransicht\"][@AutomationId=\"listview\"]/List[@ClassName=\"UIItemsView\"][@Name=\"Elementansicht\"]/ListItem[@ClassName=\"UIItem\"][@Name={fileName}]/Edit[@Name=\"Name\"][@AutomationId=\"System.ItemNameDisplay\"]"; - // var winElem_LeftDblClickEditName_284_8 = desktopSession.FindElementByAbsoluteXPath(xpath_LeftDblClickEditName_284_8); - // if (winElem_LeftDblClickEditName_284_8 != null) - // { - // desktopSession.DesktopSessionElement.Mouse.MouseMove(winElem_LeftDblClickEditName_284_8.Coordinates); - // desktopSession.DesktopSessionElement.Mouse.DoubleClick(null); - // } - // else - // { - // Console.WriteLine($"Failed to find element using xpath: {xpath_LeftDblClickEditName_284_8}"); - // } - // Assert.NotNull(winElem_LeftDblClickEditName_284_8); - - - - // SelectAirdragTab(); - // SelectAuxiliariesTab(); - // SelectVehicleTab(); - // SelectAuxiliariesTab(); - // SelectAirdragTab(); - - - - - - //} - - - //private void SelectVehicleTab() - //{ - // // LeftClick on Text "Vehicle" at (13,14) - // Console.WriteLine("LeftClick on Text \"Vehicle\" at (13,14)"); - // string xpath_LeftClickTextVehicle_13_14 = "/Pane[@ClassName=\"#32769\"][@Name=\"Vecto\"]/Window[@ClassName=\"Window\"][starts-with(@Name,\"VECTO3GUI2020.ViewModel.MultiStage.Implementation.NewMultiStageJ\")]/Custom[@AutomationId=\"NewMultistageJobView\"]/Custom[@ClassName=\"MultiStageView\"]/Custom[@ClassName=\"ManufacturingStageView\"]/Button[@ClassName=\"Button\"][@Name=\"Vehicle\"]/Text[@ClassName=\"TextBlock\"][@Name=\"Vehicle\"]"; - // var winElem_LeftClickTextVehicle_13_14 = desktopSession.FindElementByAbsoluteXPath(xpath_LeftClickTextVehicle_13_14); - // if (winElem_LeftClickTextVehicle_13_14 != null) - // { - // winElem_LeftClickTextVehicle_13_14.Click(); - // } - // else - // { - // Console.WriteLine($"Failed to find element using xpath: {xpath_LeftClickTextVehicle_13_14}"); - // } - // Assert.NotNull(winElem_LeftClickTextVehicle_13_14); - //} - - //private void SelectAirdragTab() - //{ - // // LeftClick on Text "Airdrag" at (21,13) - // Console.WriteLine("LeftClick on Text \"Airdrag\" at (21,13)"); - // string xpath_LeftClickTextAirdrag_21_13 = "/Pane[@ClassName=\"#32769\"][@Name=\"Vecto\"]/Window[@ClassName=\"Window\"][starts-with(@Name,\"VECTO3GUI2020.ViewModel.MultiStage.Implementation.NewMultiStageJ\")]/Custom[@AutomationId=\"NewMultistageJobView\"]/Custom[@ClassName=\"MultiStageView\"]/Custom[@ClassName=\"ManufacturingStageView\"]/Button[@ClassName=\"Button\"][@Name=\"Airdrag\"]/Text[@ClassName=\"TextBlock\"][@Name=\"Airdrag\"]"; - // var winElem_LeftClickTextAirdrag_21_13 = desktopSession.FindElementByAbsoluteXPath(xpath_LeftClickTextAirdrag_21_13); - // if (winElem_LeftClickTextAirdrag_21_13 != null) - // { - // winElem_LeftClickTextAirdrag_21_13.Click(); - // } - // else - // { - // Console.WriteLine($"Failed to find element using xpath: {xpath_LeftClickTextAirdrag_21_13}"); - // return; - // } - // Assert.NotNull(winElem_LeftClickTextAirdrag_21_13); - //} - - //private void SelectAuxiliariesTab() - //{ - // // LeftClick on Button "Auxiliaries" at (9,13) - // Console.WriteLine("LeftClick on Button \"Auxiliaries\" at (9,13)"); - // string xpath_LeftClickButtonAuxiliarie_9_13 = "/Pane[@ClassName=\"#32769\"][@Name=\"Vecto\"]/Window[@ClassName=\"Window\"][starts-with(@Name,\"VECTO3GUI2020.ViewModel.MultiStage.Implementation.NewMultiStageJ\")]/Custom[@AutomationId=\"NewMultistageJobView\"]/Custom[@ClassName=\"MultiStageView\"]/Custom[@ClassName=\"ManufacturingStageView\"]/Button[@ClassName=\"Button\"][@Name=\"Auxiliaries\"]"; - // var winElem_LeftClickButtonAuxiliarie_9_13 = desktopSession.FindElementByAbsoluteXPath(xpath_LeftClickButtonAuxiliarie_9_13); - // if (winElem_LeftClickButtonAuxiliarie_9_13 != null) - // { - // winElem_LeftClickButtonAuxiliarie_9_13.Click(); - // } - // else - // { - // Console.WriteLine($"Failed to find element using xpath: {xpath_LeftClickButtonAuxiliarie_9_13}"); - // } - // Assert.NotNull(winElem_LeftClickButtonAuxiliarie_9_13); - - - //} - - - #endregion - - - [TearDown] - public void OneTimeTeardown() - { - TearDown(); - Thread.Sleep(0); - } - - - - private void focusToActiveWindow() - { - session.SwitchTo().ActiveElement(); - - } - - - - } -} diff --git a/Vecto3GUI2020Test/UI/VECTO3GUI2020Session.cs b/Vecto3GUI2020Test/UI/VECTO3GUI2020Session.cs deleted file mode 100644 index 2f9ebe751a72402da6ecd8dffbede151e61fdae2..0000000000000000000000000000000000000000 --- a/Vecto3GUI2020Test/UI/VECTO3GUI2020Session.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Diagnostics; -using NUnit.Framework; -using OpenQA.Selenium; -using OpenQA.Selenium.Appium.Windows; -using System.Reflection; -using VECTO3GUI2020.Properties; - -namespace Vecto3GUI2020Test.UI -{ - [TestFixture] - public class VECTO3GUI2020Session - { - protected const string WindowsApplicationDriverUrl = "http://127.0.0.1:4723"; - private const string NotepadAppId = @"C:\Windows\System32\notepad.exe"; - - private static Process winappDriverProcess; - - internal static WindowsDriver<WindowsElement> session; - internal static DesktopSession desktopSession; - - public WindowsDriver<WindowsElement> DesktopSessionElement - { - get { return session; } - } - - public static void Setup(TestContext context) - { - // Launch a new instance of VECTO application - if (session == null) { - winappDriverProcess = Process.Start(@"C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe"); - // Create a new session to launch Notepad application - - - var appiumOptions = new OpenQA.Selenium.Appium.AppiumOptions(); - appiumOptions.AddAdditionalCapability("app", @"C:\Users\Harry\source\repos\vecto-dev\VECTO3GUI2020\bin\Debug\VECTO3GUI2020.exe"); - appiumOptions.AddAdditionalCapability("deviceName", "WindowsPC"); - session = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), appiumOptions); - session.ActivateApp(Assembly.GetExecutingAssembly().Location); - - // Use the session to control the app - Assert.IsNotNull(session); - Assert.IsNotNull(session.SessionId); - - - // Set implicit timeout to 1.5 seconds to make element search to retry every 500 ms for at most three times - session.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); - } - - desktopSession = new DesktopSession(); - } - - - public static void TearDown() - { - // Close the application and delete the session - if (session != null) - { - session.CloseApp(); - winappDriverProcess.Kill(); - - session = null; - } - } - - public void TestInitialize() - { - // Select all text and delete to clear the edit box - } - - protected static string SanitizeBackslashes(string input) => input.Replace("\\", Keys.Alt + Keys.NumberPad9 + Keys.NumberPad2 + Keys.Alt); - - } - - public static class SessionExtensions{ - - public static void DoubleCLick(this WindowsElement element) - { - element.Click(); - element.Click(); - } - } -} diff --git a/Vecto3GUI2020Test/Utils/AssertHelper.cs b/Vecto3GUI2020Test/Utils/AssertHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..2e2ad79e5dac97919f38d82a7d094225afdde74a --- /dev/null +++ b/Vecto3GUI2020Test/Utils/AssertHelper.cs @@ -0,0 +1,33 @@ +using System.IO; +using System.Linq; +using NUnit.Framework; +using TUGraz.VectoCommon.Utils; + +namespace Vecto3GUI2020Test.Utils; + +public static class AssertHelper +{ + public static void FileExists(string fileName) + { + if (!File.Exists(fileName)) { + Assert.Fail($"File {fileName} not found!"); + } + } + + public static void FilesExist(params string[] files) + { + foreach (var file in files) { + FileExists(file); + } + } + + public static void AssertNoErrorDialogs(this MockDialogHelper md) + { + Assert.AreEqual(0, md.NrErrors, string.Join("\n", md.Dialogs.Select(d => d.Message))); + } + + public static void AssertErrorMessage(this MockDialogHelper md, string searchString) + { + Assert.That(md.Dialogs.Any(dialog => dialog.Message.Contains(searchString))); + } +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/Utils/MockDialogHelper.cs b/Vecto3GUI2020Test/Utils/MockDialogHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..19ed2220d8781869b879c0d753837b9ce174cd63 --- /dev/null +++ b/Vecto3GUI2020Test/Utils/MockDialogHelper.cs @@ -0,0 +1,140 @@ +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Windows; +using Moq; +using VECTO3GUI2020.Helper; + +namespace Vecto3GUI2020Test.Utils; + +public class MockDialogHelper : IDialogHelper +{ + private IDialogHelper _dialogHelperImplementation; + + public class Dialog + { + public enum DialogType + { + Info, + Error + } + + public DialogType Type + { + get; + set; + } + public string Message + { + get; + set; + } + } + + + private readonly IList<Dialog> _dialogs = new List<Dialog>(); + private readonly Mock<IDialogHelper> _dialogHelperMock; + + public MockDialogHelper() + { + _dialogHelperMock = new Mock<IDialogHelper>(); + _dialogHelperImplementation = _dialogHelperMock.Object; + } + + public IReadOnlyList<Dialog> Dialogs => _dialogs.ToList(); + + public int NrErrors => _dialogs.Count(d => d.Type == Dialog.DialogType.Error); + + #region Implementation of IDialogHelper + + public string OpenFileDialog(string filter = "All files (*.*)|*.*", string initialDirectory = null) + { + throw new System.NotImplementedException(); + } + + public string[] OpenFilesDialog(string filter = "All files (*.*|*.*", string initialDirectory = null) + { + throw new System.NotImplementedException(); + } + + public string OpenXMLFileDialog(string initialDirectory) + { + throw new System.NotImplementedException(); + } + + public string OpenXMLFileDialog() + { + throw new System.NotImplementedException(); + } + + public string[] OpenXMLFilesDialog(string initialDirectory = null) + { + throw new System.NotImplementedException(); + } + + public string OpenFolderDialog(string initialDirectory = null) + { + throw new System.NotImplementedException(); + } + + public string OpenJsonFileDialog(string initialDirectory = null) + { + throw new System.NotImplementedException(); + } + + public string SaveToDialog(string initialDirectory = null, string filter = "All files (*.*|*.*") + { + throw new System.NotImplementedException(); + } + + public string SaveToXMLDialog(string initialDirectory = null) + { + throw new System.NotImplementedException(); + } + + public string SaveToVectoJobDialog(string initialDirectory = null) + { + throw new System.NotImplementedException(); + } + + public string OpenXMLAndVectoFileDialog(string initialDirectory = null) + { + throw new System.NotImplementedException(); + } + + public MessageBoxResult ShowMessageBox(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon) + { + lock (_dialogs) { + _dialogs.Add(new Dialog() { + Message = $"[{caption}] {messageBoxText}", + Type = icon == MessageBoxImage.Error ? Dialog.DialogType.Error : Dialog.DialogType.Info, + }); + } + + return MessageBoxResult.OK; + } + + public MessageBoxResult ShowMessageBox(string messageBoxText, string caption) + { + return ShowMessageBox(messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Asterisk); + } + + public MessageBoxResult ShowErrorMessage(string errorMessage, string caption) + { + lock (_dialogs) { + _dialogs.Add(new Dialog() { + Message = $"[{caption}] {errorMessage}", + Type = Dialog.DialogType.Error, + }); + } + + return MessageBoxResult.OK; + } + + public MessageBoxResult ShowErrorMessage(string errorMessage) + { + return ShowErrorMessage(errorMessage, "-"); + } + + #endregion +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/Utils/MockWindowHelper.cs b/Vecto3GUI2020Test/Utils/MockWindowHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..91ed742fcd059dc7fb787776b0faf73a414ebf1c --- /dev/null +++ b/Vecto3GUI2020Test/Utils/MockWindowHelper.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; +using VECTO3GUI2020.Helper; + +namespace Vecto3GUI2020Test.Utils +{ + public class MockWindowHelper : IWindowHelper + { + #region Implementation of IWindowHelper + + public List<object> Windows = new List<object>(); + + public void ShowWindow(object viewModel) + { + TestContext.WriteLine($"Opened {viewModel.GetType()}"); + lock (Windows) { + Windows.Add(viewModel); + } + } + #endregion + } +} diff --git a/Vecto3GUI2020Test/Vecto3GUI2020Test.csproj b/Vecto3GUI2020Test/Vecto3GUI2020Test.csproj index efafe83894845ebc668c7aaad7c8766a780c28b1..e2f6837654f4fd6d0c551091d1aa27396b20b28b 100644 --- a/Vecto3GUI2020Test/Vecto3GUI2020Test.csproj +++ b/Vecto3GUI2020Test/Vecto3GUI2020Test.csproj @@ -7,6 +7,8 @@ <ItemGroup> <PackageReference Include="Appium.WebDriver" Version="4.3.1" /> + <PackageReference Include="AutoBogus.Moq" Version="2.13.1" /> + <PackageReference Include="Bogus" Version="34.0.2" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" /> <PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" /> <PackageReference Include="Moq" Version="4.18.2" /> @@ -30,11 +32,29 @@ <ItemGroup> <Folder Include="HelperTests\" /> - <Folder Include="Testdata\bugreports\" /> + <Folder Include="TestData\bugreports\" /> <Folder Include="TestData\output\" /> + <Folder Include="XML\XMLInput\" /> + <Folder Include="XML\XMLWritingTest\TestDataCreator\" /> </ItemGroup> <ItemGroup> + <Content Include="..\VectoCore\VectoCoreTest\TestData\XML\XMLReaderDeclaration\**\*.*"> + <Link>TestData\XML\%(RecursiveDir)%(FileName)%(Extension)</Link> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="..\VectoCore\VectoCoreTest\TestData\Integration\Multistage\**\*.*"> + <Link>TestData\Integration\Multistage\%(RecursiveDir)%(FileName)%(Extension)</Link> + <!--<TargetPath>TestData\Integration\Multistage</TargetPath>--> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <!--<Content Remove="..\VectoCore\VectoCoreTest\TestData\Integration\Multistage\newVifCompletedConventional.vecto" /> + <Content Remove="..\VectoCore\VectoCoreTest\TestData\Integration\Multistage\newVifExempted.vecto" /> + <Content Remove="..\VectoCore\VectoCoreTest\TestData\Integration\Multistage\newVifExemptedIncomplete.vecto" /> + <Content Remove="..\VectoCore\VectoCoreTest\TestData\Integration\Multistage\newVifInterimDiesel.vecto" />--> + + + <Content Include="..\VectoCore\VectoCoreTest\TestData\XML\XMLReaderDeclaration\SchemaVersionMultistage.0.1\AidragComponent.xml" Link="Testdata\AidragComponent.xml"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> @@ -95,34 +115,49 @@ <None Update="TestData\bugreports\PrimaryDecimal\primary_heavyBus group41_nonSmart_rounded_decimals.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="TestData\exempted_primary_heavyBus.VIF.xml"> + <None Update="TestData\Case1\newVifExemptedIncomplete.vecto"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Update="TestData\exempted_vif_mandatory.xml"> + <None Update="TestData\Case1\newVifInterimDiesel.vecto"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Update="TestData\final.VIF_Report_4.xml"> + <None Update="TestData\Case1\special_case_1.vecto"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="TestData\Case1\vecto_vehicle-primary_heavyBus-sample.xml"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="TestData\Case1\vecto_vehicle-stage_input_only_certain_entries01-sample.xml"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Update="TestData\Case2\newVifCompletedConventional-noADAS.vecto"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Update="TestData\interim2.VIF_Report_3.xml"> + <None Update="TestData\Case2\newVifCompletedConventional.vecto"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Update="TestData\vecto_multistage_conventional_final_vif.VIF_Report_1.xml"> + <None Update="TestData\Case2\newVifExempted.vecto"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Update="TestData\vecto_vehicle-completed_heavyBus_31b.xml"> + <None Update="TestData\Case2\special_case_2.vecto"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Update="TestData\Case2\vecto_vehicle-stage_input_full-sample.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </None> + <None Update="TestData\exempted_primary_heavyBus.VIF.xml"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Include="..\VectoCore\VectoCoreTest\TestData\Integration\Multistage\newVifCompletedConventional.vecto" Link="TestData\newVifCompletedConventional.vecto"> + <None Update="TestData\exempted_vif_mandatory.xml"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Include="..\VectoCore\VectoCoreTest\TestData\Integration\Multistage\newVifExempted.vecto" Link="TestData\newVifExempted.vecto"> + <None Update="TestData\final.VIF_Report_4.xml"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Include="..\VectoCore\VectoCoreTest\TestData\Integration\Multistage\newVifExemptedIncomplete.vecto" Link="TestData\newVifExemptedIncomplete.vecto"> + <None Update="TestData\interim2.VIF_Report_3.xml"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> - <None Include="..\VectoCore\VectoCoreTest\TestData\Integration\Multistage\newVifInterimDiesel.vecto" Link="TestData\newVifInterimDiesel.vecto"> + <None Update="TestData\vecto_vehicle-completed_heavyBus_31b.xml"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> </ItemGroup> diff --git a/Vecto3GUI2020Test/ViewModelTests/AirdragTests.cs b/Vecto3GUI2020Test/ViewModelTests/AirdragTests.cs index 8fc8052b196f610f50a6893005b01cd6f8fd7f77..9c955c82ee6fac5c9eba8b23eb206331b9ca7dad 100644 --- a/Vecto3GUI2020Test/ViewModelTests/AirdragTests.cs +++ b/Vecto3GUI2020Test/ViewModelTests/AirdragTests.cs @@ -1,5 +1,7 @@ -using NUnit.Framework; +using System.IO; +using NUnit.Framework; using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using Vecto3GUI2020Test.Utils; namespace Vecto3GUI2020Test.ViewModelTests { @@ -19,10 +21,10 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void AirdragModifiedInPreviousStages() { - var vm = LoadFileFromTestDirectory(consolidated_multiple_stages_airdrag); + var vm = LoadFileFromPath(TestData.consolidated_multiple_stages_airdrag); var vehicleVm = vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as - InterimStageBusVehicleViewModel_v2_8; + InterimStageBusVehicleViewModel; Assert.IsTrue(vehicleVm.AirdragModifiedMultistepEditingEnabled); @@ -35,11 +37,11 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void AirdragNotModifiedInPreviousStages() { - var vm = LoadFileFromTestDirectory(consolidated_multiple_stages); + var vm = LoadFileFromPath(TestData.consolidated_multiple_stages); var vehicleVm = vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as - InterimStageBusVehicleViewModel_v2_8; + InterimStageBusVehicleViewModel; Assert.IsFalse(vehicleVm.AirdragModifiedMultistepEditingEnabled); } @@ -54,15 +56,17 @@ namespace Vecto3GUI2020Test.ViewModelTests { ///Load VIF without airdrag - var vm = LoadFileFromTestDirectory(primary_vehicle_only); + var vm = LoadFileFromPath(TestData.primary_vehicle_only); var vehicleVm = vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as - InterimStageBusVehicleViewModel_v2_8; + InterimStageBusVehicleViewModel; Assert.IsNull(vehicleVm.AirdragModifiedMultistep); var airdragViewModel = vehicleVm.MultistageAirdragViewModel as MultistageAirdragViewModel; - Assert.IsTrue(airdragViewModel.LoadAirdragFile(GetTestDataPath(airdragLoadTestFile))); + var airdragPath = Path.GetFullPath(TestData.airdragLoadTestFile); + AssertHelper.FileExists(airdragPath); + Assert.IsTrue(airdragViewModel.LoadAirdragFile(airdragPath)); Assert.IsNull(vehicleVm.AirdragModifiedMultistep); Assert.IsFalse(vehicleVm.AirdragModifiedMultistepMandatory); @@ -80,15 +84,15 @@ namespace Vecto3GUI2020Test.ViewModelTests //Save as new VIF var multistageJobViewModel = vm.MultiStageJobViewModel as MultiStageJobViewModel_v0_1; var outputName = "AidragLoadedInFirstStage"; - multistageJobViewModel.SaveVif(GetFullPath($"{outputName}.xml")); - + multistageJobViewModel.SaveVif(Path.GetFullPath($"{outputName}.xml")); + _mockDialogHelper.AssertNoErrorDialogs(); var resultFile = $"{outputName}.VIF_Report_2.xml"; - Assert.IsTrue(checkFileNameExists(resultFile)); + AssertHelper.FileExists(resultFile); var secondstageVm = LoadFileFromPath(resultFile); Assert.IsNotNull(secondstageVm); var secondStageVehicleVm = (secondstageVm.MultiStageJobViewModel.ManufacturingStageViewModel.VehicleViewModel) as - InterimStageBusVehicleViewModel_v2_8; + InterimStageBusVehicleViewModel; Assert.IsTrue(secondStageVehicleVm.AirdragModifiedMultistepEditingEnabled); Assert.IsTrue(secondStageVehicleVm.AirdragModifiedMultistepMandatory); Assert.IsNull(secondStageVehicleVm.ConsolidatedVehicleData.AirdragModifiedMultistep); @@ -103,10 +107,10 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void AirdragModifiedDisabled() { - var vm = LoadFileFromTestDirectory(primary_vehicle_only); + var vm = LoadFileFromPath(TestData.primary_vehicle_only); var vehicleVm = vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as - InterimStageBusVehicleViewModel_v2_8; + InterimStageBusVehicleViewModel; Assert.IsNull(vehicleVm.AirdragModifiedMultistep); @@ -114,7 +118,7 @@ namespace Vecto3GUI2020Test.ViewModelTests Assert.IsFalse(vehicleVm.AirdragModifiedMultistepMandatory); var airdragViewModel = vehicleVm.MultistageAirdragViewModel; - Assert.IsTrue(airdragViewModel.LoadAirdragFile(GetTestDataPath(airdragLoadTestFile)), "Airdrag file not loaded"); + Assert.IsTrue(airdragViewModel.LoadAirdragFile(Path.GetFullPath(TestData.airdragLoadTestFile)), "Airdrag file not loaded"); Assert.IsFalse(vehicleVm.AirdragModifiedMultistepMandatory); vehicleVm.AirdragModifiedMultistepEditingEnabled = true; @@ -131,7 +135,7 @@ namespace Vecto3GUI2020Test.ViewModelTests //var vm = loadFile(primary_vehicle_only); //var vehicleVM = // vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as - // InterimStageBusVehicleViewModel_v2_8; + // InterimStageBusVehicleViewModel; //Assert.IsNull(vehicleVM.AirdragModifiedMultistage); @@ -146,15 +150,15 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void TemporarySaveAirdragComponent1() { - var vm = LoadFileFromTestDirectory(consolidated_multiple_stages_airdrag); + var vm = LoadFileFromPath(TestData.consolidated_multiple_stages_airdrag); - var vehicleViewModel = vm.MultiStageJobViewModel.ManufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel_v2_8; + var vehicleViewModel = vm.MultiStageJobViewModel.ManufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel; Assert.IsNull(vehicleViewModel.AirdragModifiedMultistep); //Load airdrag file - var airdragLoaded = vehicleViewModel.MultistageAirdragViewModel.LoadAirdragFile(GetTestDataPath(airdragLoadTestFile)); + var airdragLoaded = vehicleViewModel.MultistageAirdragViewModel.LoadAirdragFile(Path.GetFullPath(TestData.airdragLoadTestFile)); var loadedAirdragComponent = vehicleViewModel.MultistageAirdragViewModel.AirDragViewModel; Assert.IsTrue(airdragLoaded, "Airdrag file was not loaded"); @@ -178,16 +182,16 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void TemporarySaveAirdragComponent2() { - var vm = LoadFileFromTestDirectory(consolidated_multiple_stages_airdrag); + var vm = LoadFileFromPath(TestData.consolidated_multiple_stages_airdrag); - var vehicleViewModel = vm.MultiStageJobViewModel.ManufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel_v2_8; + var vehicleViewModel = vm.MultiStageJobViewModel.ManufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel; Assert.IsNull(vehicleViewModel.AirdragModifiedMultistep); //Load input file var multistageJobViewModel = vm.MultiStageJobViewModel as MultiStageJobViewModel_v0_1; - multistageJobViewModel.ManufacturingStageViewModel.LoadStageInputData(GetTestDataPath(stageInputFullSample)); + multistageJobViewModel.ManufacturingStageViewModel.LoadStageInputData(Path.GetFullPath(TestData.stageInputFullSample)); @@ -215,9 +219,9 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void RemoveAirdragComponent() { - var vm = LoadFileFromTestDirectory(consolidated_multiple_stages_airdrag); + var vm = LoadFileFromPath(TestData.consolidated_multiple_stages_airdrag); - var vehicleViewModel = vm.MultiStageJobViewModel.ManufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel_v2_8; + var vehicleViewModel = vm.MultiStageJobViewModel.ManufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel; Assert.IsNull(vehicleViewModel.AirdragModifiedMultistep); @@ -225,7 +229,7 @@ namespace Vecto3GUI2020Test.ViewModelTests //Load input file var multistageJobViewModel = vm.MultiStageJobViewModel as MultiStageJobViewModel_v0_1; multistageJobViewModel.ManufacturingStageViewModel.LoadStageInputData( - GetTestDataPath(stageInputFullSample)); + Path.GetFullPath(TestData.stageInputFullSample)); Assert.IsTrue(vehicleViewModel.AirdragModifiedMultistep); @@ -242,15 +246,15 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void AirdragModifiedSetToTrueWhenComponentIsLoaded() { - var vm = LoadFileFromTestDirectory(consolidated_multiple_stages_airdrag); + var vm = LoadFileFromPath(TestData.consolidated_multiple_stages_airdrag); - var vehicleViewModel = vm.MultiStageJobViewModel.ManufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel_v2_8; + var vehicleViewModel = vm.MultiStageJobViewModel.ManufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel; Assert.IsNull(vehicleViewModel.AirdragModifiedMultistep); //Load airdrag file - var airdragLoaded = vehicleViewModel.MultistageAirdragViewModel.LoadAirdragFile(GetTestDataPath(airdragLoadTestFile)); + var airdragLoaded = vehicleViewModel.MultistageAirdragViewModel.LoadAirdragFile(Path.GetFullPath(TestData.airdragLoadTestFile)); Assert.IsTrue(airdragLoaded, "Airdrag file was not loaded"); //Airdrag modified set to true if a component is loaded and the field is mandatory @@ -263,7 +267,7 @@ namespace Vecto3GUI2020Test.ViewModelTests //AirdragComponent is removed when airdragmodified is set to false; //Load airdrag file - airdragLoaded = vehicleViewModel.MultistageAirdragViewModel.LoadAirdragFile(GetTestDataPath(airdragLoadTestFile)); + airdragLoaded = vehicleViewModel.MultistageAirdragViewModel.LoadAirdragFile(Path.GetFullPath(TestData.airdragLoadTestFile)); Assert.IsTrue(airdragLoaded, "Airdrag file was not loaded"); vehicleViewModel.AirdragModifiedMultistep = false; diff --git a/Vecto3GUI2020Test/ViewModelTests/CreateVifViewModelTests.cs b/Vecto3GUI2020Test/ViewModelTests/CreateVifViewModelTests.cs index fa2079af0237733ff286c6a7117bb844442d4f54..71e247d36580c2e5835528f9b766c7bcd03c756a 100644 --- a/Vecto3GUI2020Test/ViewModelTests/CreateVifViewModelTests.cs +++ b/Vecto3GUI2020Test/ViewModelTests/CreateVifViewModelTests.cs @@ -4,57 +4,72 @@ using System.Threading.Tasks; using System.Windows.Input; using Ninject; using NUnit.Framework; +using VECTO3GUI2020.Helper; using VECTO3GUI2020.ViewModel.Implementation; using VECTO3GUI2020.ViewModel.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.Document; using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using Vecto3GUI2020Test.Utils; namespace Vecto3GUI2020Test.ViewModelTests { [TestFixture] - public class CreateVifViewModelTests : ViewModelTestBase + public class CreateVifViewModelTests// : ViewModelTestBase { private ICreateVifViewModel _createVifViewModel; + private IKernel _kernel; + private MockDialogHelper _dialogHelper; - private const string testdata_2_4 = "XML\\XMLReaderDeclaration\\SchemaVersion2.4\\"; + private const string testdata_2_4 = "TestData\\XML\\SchemaVersion2.4\\"; //private const string testdata_2_10 = "XML\\XMLReaderDeclaration\\SchemaVersion2.10\\"; private const string vecto_vehicle_primary_heavyBusSample = testdata_2_4 + "vecto_vehicle-primary_heavyBus-sample.xml"; private const string vecto_vehicle_exempted_input_only_certain_entries = - "vecto_vehicle-exempted_input_only_certain_entries01-sample.xml"; + testdata_2_4 + "vecto_vehicle-exempted_input_only_certain_entries01-sample.xml"; private const string vecto_vehicle_primary_heavyBusExempted = testdata_2_4 + "exempted_primary_heavyBus.xml"; [SetUp] public void SetUpCreateVif() { - _createVifViewModel = _kernel.Get<ICreateVifViewModel>(); + _kernel = TestHelper.GetKernel(); + _createVifViewModel = _kernel.Get<INewDocumentViewModelFactory>().GetCreateNewVifViewModel(true) as ICreateVifViewModel; + _dialogHelper = _kernel.Get<IDialogHelper>() as MockDialogHelper; + Assert.NotNull(_createVifViewModel); } - [TestCase(stageInputFullSample, TestName="InvalidPrimaryFile_StageInput")] - [TestCase(airdragLoadTestFile, TestName="InvalidPrimaryFile_Airdrag")] - [TestCase(consolidated_multiple_stages_airdrag, TestName = "InvalidPrimaryFile_VIF")] + [TestCase(TestData.stageInputFullSample, TestName="InvalidPrimaryFile_StageInput")] + [TestCase(TestData.airdragLoadTestFile, TestName="InvalidPrimaryFile_Airdrag")] + [TestCase(TestData.consolidated_multiple_stages_airdrag, TestName = "InvalidPrimaryFile_VIF")] [TestCase(vecto_vehicle_exempted_input_only_certain_entries, TestName="InvalidPrimaryFile_ExemptedStageInput")] public void LoadInvalidPrimaryFile(string fileName) { - var filePath = GetTestDataPath(fileName); + + //TODO detect if primary bus is loaded + var filePath = Path.GetFullPath(fileName); + Assert.IsFalse(_createVifViewModel.LoadPrimaryInput(filePath)); Assert.IsNull(_createVifViewModel.PrimaryInputPath); Assert.IsNull(_createVifViewModel.IsPrimaryExempted); - } + + _dialogHelper.AssertErrorMessage("Invalid File"); + } [TestCase(vecto_vehicle_primary_heavyBusSample, TestName = "InvalidStageInput_Primary")] - [TestCase(airdragLoadTestFile, TestName = "InvalidStageInput_Airdrag")] - [TestCase(consolidated_multiple_stages_airdrag, TestName = "InvalidStageFile_VIF")] + [TestCase(TestData.airdragLoadTestFile, TestName = "InvalidStageInput_Airdrag")] + [TestCase(TestData.consolidated_multiple_stages_airdrag, TestName = "InvalidStageFile_VIF")] public void LoadInvalidCompletedFile(string fileName) { - var filePath = GetTestDataPath(fileName); + var filePath = Path.GetFullPath(fileName); + Assert.IsFalse(_createVifViewModel.LoadStageInput(filePath)); Assert.IsNull(_createVifViewModel.IsStageInputExempted); Assert.IsNull(_createVifViewModel.StageInputPath); - } + _dialogHelper.AssertErrorMessage("Invalid File"); + } [Test] @@ -62,7 +77,7 @@ namespace Vecto3GUI2020Test.ViewModelTests { LoadValidNonExemptedFiles(); var outputFile = "test.json"; - var outputPath = GetFullPath(outputFile); + var outputPath = Path.GetFullPath(outputFile); _createVifViewModel.SaveJob(outputPath); FileAssert.Exists(outputPath); @@ -75,8 +90,8 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void LoadNonExemptedCompletedAndExemptedPrimary() { - var exemptedPrimaryPath = GetTestDataPath(vecto_vehicle_primary_heavyBusExempted); - var stageInputPath = GetTestDataPath(stageInputFullSample); + var exemptedPrimaryPath = Path.GetFullPath(vecto_vehicle_primary_heavyBusExempted); + var stageInputPath = Path.GetFullPath(TestData.stageInputFullSample); Assert.IsTrue(_createVifViewModel.LoadPrimaryInput(exemptedPrimaryPath)); Assert.IsFalse(_createVifViewModel.LoadStageInput(stageInputPath)); @@ -87,16 +102,16 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void LoadValidPrimaryFile() { - var filePath = GetTestDataPath(vecto_vehicle_primary_heavyBusSample); + var filePath = Path.GetFullPath(vecto_vehicle_primary_heavyBusSample); Assert.IsTrue(_createVifViewModel.LoadPrimaryInput(filePath)); Assert.AreEqual(filePath, _createVifViewModel.PrimaryInputPath); } - [TestCase(stageInputFullSample, TestName = "ValidStageInput_fullStageInput")] + [TestCase(TestData.stageInputFullSample, TestName = "ValidStageInput_fullStageInput")] [TestCase(vecto_vehicle_exempted_input_only_certain_entries, TestName = "ValidStageInput_exemptedStageInput")] public void LoadValidStageInputFile(string fileName) { - var filePath = GetTestDataPath(fileName); + var filePath = Path.GetFullPath(fileName); Assert.IsTrue(_createVifViewModel.LoadStageInput(filePath)); Assert.AreEqual(filePath, _createVifViewModel.StageInputPath); } @@ -110,9 +125,10 @@ namespace Vecto3GUI2020Test.ViewModelTests public void LoadValidNonExemptedFiles() { - var primaryPath = GetTestDataPath(vecto_vehicle_primary_heavyBusSample); - var stageInputPath = GetTestDataPath(stageInputFullSample); - + var primaryPath = Path.GetFullPath(vecto_vehicle_primary_heavyBusSample); + var stageInputPath = Path.GetFullPath(TestData.stageInputFullSample); + AssertHelper.FileExists(primaryPath); + AssertHelper.FileExists(stageInputPath); Assert.IsTrue(_createVifViewModel.LoadPrimaryInput(primaryPath)); Assert.IsTrue(_createVifViewModel.LoadStageInput(stageInputPath)); } @@ -120,8 +136,9 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void LoadValidExemptedFiles() { - var primaryPath = GetTestDataPath(vecto_vehicle_primary_heavyBusExempted); - var stageInputPath = GetTestDataPath(vecto_vehicle_exempted_input_only_certain_entries); + var primaryPath = Path.GetFullPath(vecto_vehicle_primary_heavyBusExempted); + var stageInputPath = Path.GetFullPath(vecto_vehicle_exempted_input_only_certain_entries); + AssertHelper.FilesExist(primaryPath, stageInputPath); Assert.IsTrue(_createVifViewModel.LoadPrimaryInput(primaryPath)); Assert.IsTrue(_createVifViewModel.LoadStageInput(stageInputPath)); @@ -175,8 +192,8 @@ namespace Vecto3GUI2020Test.ViewModelTests var stagePath = _createVifViewModel.StageInputPath; - var savedToPath = _createVifViewModel.SaveJob(GetFullPath("non_exempted.vecto")); - WriteLine($"Saved to: {savedToPath}"); + var savedToPath = _createVifViewModel.SaveJob(Path.GetFullPath("non_exempted.vecto")); + TestContext.WriteLine($"Saved to: {savedToPath}"); Assert.AreEqual(primaryPath, _createVifViewModel.PrimaryInputPath); Assert.AreEqual(stagePath, _createVifViewModel.StageInputPath); diff --git a/Vecto3GUI2020Test/ViewModelTests/ExemptedTests.cs b/Vecto3GUI2020Test/ViewModelTests/ExemptedTests.cs index 6eb5103bdf51a8728ac17f4c40f1ed8250a8cce6..b0dc6567b7a972921fb3b13c38c7de7addc9aefe 100644 --- a/Vecto3GUI2020Test/ViewModelTests/ExemptedTests.cs +++ b/Vecto3GUI2020Test/ViewModelTests/ExemptedTests.cs @@ -10,6 +10,7 @@ using TUGraz.VectoCommon.Utils; using VECTO3GUI2020.ViewModel.Implementation; using VECTO3GUI2020.ViewModel.Interfaces; using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using Vecto3GUI2020Test.Utils; namespace Vecto3GUI2020Test.ViewModelTests { @@ -17,22 +18,22 @@ namespace Vecto3GUI2020Test.ViewModelTests public class ExemptedTests : ViewModelTestBase { - public const string _exemptedCompleted = "exempted_completed.VIF_Report_2.xml"; + [Test] public void LoadAndSaveExemptedPrimary() { - var newMultiStageJob = LoadFileFromTestDirectory(exempted_primary_vif); + var newMultiStageJob = LoadFileFromPath(Path.GetFullPath(TestData.exempted_primary_vif)); Assert.IsTrue(newMultiStageJob.MultiStageJobViewModel.Exempted); var multistageJobViewModel = newMultiStageJob.MultiStageJobViewModel as MultiStageJobViewModel_v0_1; - var outputPath = GetFullPath("test1.xml"); + var outputPath = Path.GetFullPath("test1.xml"); var vehicleVm = multistageJobViewModel.ManufacturingStageViewModel.VehicleViewModel as - InterimStageBusVehicleViewModel_v2_8; + InterimStageBusVehicleViewModel; Assert.IsTrue(vehicleVm.ExemptedVehicle); @@ -88,17 +89,17 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public async Task SaveAsNewVifAndSimulate() { - var newMultiStageJob = LoadFileFromTestDirectory(exempted_primary_vif); + var newMultiStageJob = LoadFileFromPath(TestData.exempted_primary_vif); Assert.IsTrue(newMultiStageJob.MultiStageJobViewModel.Exempted); var multistageJobViewModel = newMultiStageJob.MultiStageJobViewModel as MultiStageJobViewModel_v0_1; - var outputFile = GetFullPath("exemptedNewVif/test1.xml"); + var outputFile = Path.GetFullPath("exemptedNewVif/test1.xml"); var vehicleVm = multistageJobViewModel.ManufacturingStageViewModel.VehicleViewModel as - InterimStageBusVehicleViewModel_v2_8; + InterimStageBusVehicleViewModel; Assert.IsTrue(vehicleVm.ExemptedVehicle); @@ -134,7 +135,7 @@ namespace Vecto3GUI2020Test.ViewModelTests try { Directory.Delete(Path.GetDirectoryName(outputFile), true); } catch (Exception e) { - WriteLine(e.Message); + TestContext.WriteLine(e.Message); } var result = multistageJobViewModel.SaveVif(outputFile); @@ -167,12 +168,12 @@ namespace Vecto3GUI2020Test.ViewModelTests Assert.AreEqual(PassengerSeatsLowerDeck, lastManStage.Vehicle.NumberPassengerSeatsLowerDeck); - Write("Starting simulation ..."); + TestContext.Write("Starting simulation ..."); jobListVm.Jobs[1].Selected = true; await jobListVm.RunSimulationExecute(); - Write("Done!"); + TestContext.Write("Done!"); } [Test] @@ -180,7 +181,8 @@ namespace Vecto3GUI2020Test.ViewModelTests { //Setup var jobListViewModel = _kernel.Get<IJobListViewModel>() as JobListViewModel; - await jobListViewModel.AddJobAsync(GetTestDataPath(_exemptedCompleted)); + await jobListViewModel.AddJobAsync(Path.GetFullPath(TestData.exemptedCompleted)); + _mockDialogHelper.AssertNoErrorDialogs(); Assert.AreEqual(1, jobListViewModel.Jobs.Count); jobListViewModel.Jobs[0].Selected = true; diff --git a/Vecto3GUI2020Test/ViewModelTests/FactoryTests/ComponentViewModelFactoryTest.cs b/Vecto3GUI2020Test/ViewModelTests/FactoryTests/ComponentViewModelFactoryTest.cs new file mode 100644 index 0000000000000000000000000000000000000000..61c31e53d79ddb9659f3445bdaff9a8072b67fa2 --- /dev/null +++ b/Vecto3GUI2020Test/ViewModelTests/FactoryTests/ComponentViewModelFactoryTest.cs @@ -0,0 +1,76 @@ +using System.Xml.Linq; +using Ninject; +using NUnit.Framework; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.Ninject.Factories; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using Vecto3GUI2020Test.MockInput; +using Vecto3GUI2020Test.Utils; + +namespace Vecto3GUI2020Test.ViewModelTests.FactoryTests; + +[TestFixture] +public class ComponentViewModelFactoryTest +{ + private IComponentViewModelFactory _componentViewModelFactory; + private IKernel _kernel; + private MockDialogHelper _mockDialogHelper; + + [SetUp] + public void Setup() + { + _kernel = TestHelper.GetKernel(out _mockDialogHelper, out _); + _componentViewModelFactory = _kernel.Get<IComponentViewModelFactory>(); + } + + + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V10)] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V20)] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24)] + public void CreateAirdragViewModel(string version) + { + XNamespace ns = version; + var airdragData = MockComponent.GetAirdragComponentData(ns); + + Assert.NotNull(airdragData); + Assert.AreEqual(version, airdragData.DataSource.TypeVersion); + + var componentViewModel = _componentViewModelFactory.CreateComponentViewModel(airdragData); + _mockDialogHelper.AssertNoErrorDialogs(); + Assert.NotNull(componentViewModel); + + var airdragVm = componentViewModel as IAirDragViewModel; + Assert.NotNull(airdragVm); + + switch (airdragVm) { + //since the vms are derived from each other order matters + case AirDragViewModel_v2_4: + Assert.AreEqual(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, version); + break; + case AirDragViewModel_v2_0: + Assert.AreEqual(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V20, version); + break; + case AirDragViewModel_v1_0: + Assert.AreEqual(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V10, version); + break; + default: + Assert.Fail($"Unexpected type {airdragVm.GetType()}"); + break; + } + } + + [Test] + public void CreateMultistepAuxiliaryViewModel([Values] CompletedBusArchitecture arch) + { + if (arch == CompletedBusArchitecture.Exempted) { + return; + } + var multistepComponentFactory = _kernel.Get<IMultistepComponentViewModelFactory>(); + + var auxVm = multistepComponentFactory.CreateNewMultistepBusAuxViewModel(arch); + } + + +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/ViewModelTests/FactoryTests/DocumentViewModelFactoryTest.cs b/Vecto3GUI2020Test/ViewModelTests/FactoryTests/DocumentViewModelFactoryTest.cs new file mode 100644 index 0000000000000000000000000000000000000000..40d370702ae0b248f4b34e51826cd2a11a58f510 --- /dev/null +++ b/Vecto3GUI2020Test/ViewModelTests/FactoryTests/DocumentViewModelFactoryTest.cs @@ -0,0 +1,143 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using Moq; +using Ninject; +using NUnit.Framework; +using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl; +using TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport.ManufacturerReport_0_9.ManufacturerReportXMLTypeWriter; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.ViewModel.Interfaces.Document; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using Vecto3GUI2020Test.MockInput; +using Vecto3GUI2020Test.Utils; + +namespace Vecto3GUI2020Test.ViewModelTests.FactoryTests +{ + [TestFixture] + internal class DocumentViewModelFactoryTest + { + private MockDialogHelper _mockDialogHelper; + private IKernel _kernel; + private IDocumentViewModelFactory _documentViewModelFactory; + + [SetUp] + public void Setup() + { + _kernel = TestHelper.GetKernel(out _mockDialogHelper, out _); + _documentViewModelFactory = _kernel.Get<IDocumentViewModelFactory>(); + } + + [TestCase( XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationConventionalCompletedBusDataProviderV24.XSD_TYPE)] + [TestCase( XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationHevCompletedBusDataProviderV24.XSD_TYPE)] + [TestCase( XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationPEVCompletedBusDataProviderV24.XSD_TYPE)] + [TestCase( XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationExemptedCompletedBusDataProviderV24.XSD_TYPE)] + [TestCase( XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationIepcCompletedBusDataProviderV24.XSD_TYPE)] + public void StepInputDocument(string version, string type) + { + XNamespace ns = version; + var vehicleInput = MockDocument.GetDeclarationJob().AddStepInput( + type, + version); + var document = _documentViewModelFactory.CreateDocumentViewModel(vehicleInput); + var stepInputViewModel = document as StageInputViewModel; + + var arch = stepInputViewModel.Architecture; + if (type == XMLDeclarationConventionalCompletedBusDataProviderV24.XSD_TYPE) { + Assert.AreEqual(arch, CompletedBusArchitecture.Conventional); + } + + if (type == XMLDeclarationPEVCompletedBusDataProviderV24.XSD_TYPE) { + Assert.AreEqual(arch, CompletedBusArchitecture.PEV); + } + + if (type == XMLDeclarationHevCompletedBusDataProviderV24.XSD_TYPE) + { + Assert.AreEqual(arch, CompletedBusArchitecture.HEV); + } + + if (type == XMLDeclarationIepcCompletedBusDataProviderV24.XSD_TYPE) + { + Assert.AreEqual(arch, CompletedBusArchitecture.IEPC); + } + + if (type == XMLDeclarationExemptedCompletedBusDataProviderV24.XSD_TYPE) + { + Assert.AreEqual(arch, CompletedBusArchitecture.Exempted); + } + + Assert.NotNull(stepInputViewModel); + } + + [TestCase] + public void NewStepInput() + { + var exempted = false; + var document = _documentViewModelFactory.GetCreateNewStepInputViewModel(exempted); + + } + + + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationConventionalCompletedBusDataProviderV24.XSD_TYPE, VectoSimulationJobType.ConventionalVehicle)] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationHevCompletedBusDataProviderV24.XSD_TYPE, VectoSimulationJobType.SerialHybridVehicle)] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationHevCompletedBusDataProviderV24.XSD_TYPE, VectoSimulationJobType.ParallelHybridVehicle)] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationPEVCompletedBusDataProviderV24.XSD_TYPE, VectoSimulationJobType.BatteryElectricVehicle)] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationIepcCompletedBusDataProviderV24.XSD_TYPE, VectoSimulationJobType.IEPC_E)] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationExemptedCompletedBusDataProviderV24.XSD_TYPE, VectoSimulationJobType.EngineOnlySimulation)] + public void MultistepInput(string version, string type, VectoSimulationJobType jobType) + { + var ns = version; + IMultistepBusInputDataProvider multistepInput = MockDocument.GetMultistepInput(ns, type, 3); + var mock = Mock.Get(multistepInput); + mock.SetupGet(c => c.JobInputData.ConsolidateManufacturingStage.Vehicle.VehicleType).Returns(jobType); + mock.SetupGet(c => c.JobInputData.ConsolidateManufacturingStage.Vehicle.ExemptedVehicle) + .Returns(type == XMLDeclarationExemptedCompletedBusDataProviderV24.XSD_TYPE); + var doc = _documentViewModelFactory.CreateDocumentViewModel(multistepInput); + Assert.NotNull(doc); + var multistepViewModel = doc as MultiStageJobViewModel_v0_1; + Assert.NotNull(multistepViewModel); + } + + + [TestCase(XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1, "VectoOutputMultistepType", XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationConventionalCompletedBusDataProviderV24.XSD_TYPE)] + [TestCase(XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1, "VectoOutputMultistepType", XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationHevCompletedBusDataProviderV24.XSD_TYPE)] + [TestCase(XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1, "VectoOutputMultistepType", XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationPEVCompletedBusDataProviderV24.XSD_TYPE)] + [TestCase(XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1, "VectoOutputMultistepType",XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationIepcCompletedBusDataProviderV24.XSD_TYPE)] + public void MultistepVIFInputData(string vifVersion, string vifType, string stepVersion, string stepType) + { + XNamespace vifNs = vifVersion; + XNamespace stepNs = stepVersion; + + int stages = 3; + + IMultistageVIFInputData vifInputData = MockDocument.GetMultistepVIFInputData(vifNs, vifType, stages, stepType, stepNs); + + Assert.Throws<VectoException>(() => _documentViewModelFactory.CreateDocumentViewModel(vifInputData)); + } + + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationConventionalPrimaryBusVehicleDataProviderV24.XSD_TYPE, XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationConventionalCompletedBusDataProviderV24.XSD_TYPE)] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationPevPrimaryBusDataProviderV24.XSD_TYPE, XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationPEVCompletedBusDataProviderV24.XSD_TYPE)] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationHevPxPrimaryBusDataProviderV24.XSD_TYPE, XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationHevCompletedBusDataProviderV24.XSD_TYPE)] + public void MultistepPrimaryAndStageInputDataProvider(string primaryVersion, string primaryType, string stepVersion, string stepVehicleType) + { + XNamespace primaryNs = primaryVersion; + XNamespace stepNs = stepVersion; + IMultistagePrimaryAndStageInputDataProvider primaryAndStep = MockDocument.GetPrimaryAndStepInput( + primaryBusVersion:primaryNs, + primaryType:primaryType, + stepVehicleVersion:stepVersion, + stepVehicleType:stepVehicleType + ); + var doc = _documentViewModelFactory.CreateDocumentViewModel(primaryAndStep); + Assert.NotNull(doc); + } + + + } +} diff --git a/Vecto3GUI2020Test/ViewModelTests/JobListViewModelTests.cs b/Vecto3GUI2020Test/ViewModelTests/JobListViewModelTests.cs index 20cacdef6f2f62281d875eeaab608a6ef0a91be9..d0bf852cdb71a89e7cf8e3468d95ea6f8110a3e3 100644 --- a/Vecto3GUI2020Test/ViewModelTests/JobListViewModelTests.cs +++ b/Vecto3GUI2020Test/ViewModelTests/JobListViewModelTests.cs @@ -1,32 +1,43 @@ using System.Diagnostics; +using System.IO; using System.Threading.Tasks; +using CommunityToolkit.Mvvm.ComponentModel.__Internals; +using Moq; using Ninject; using NUnit.Framework; using NUnit.Framework.Internal; +using OpenQA.Selenium; +using VECTO3GUI2020.Helper; using VECTO3GUI2020.ViewModel; using VECTO3GUI2020.ViewModel.Implementation; +using VECTO3GUI2020.ViewModel.Implementation.Document; using VECTO3GUI2020.ViewModel.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.Document; using VECTO3GUI2020.ViewModel.MultiStage.Implementation; using Vecto3GUI2020Test.BugReports; +using Vecto3GUI2020Test.Utils; namespace Vecto3GUI2020Test.ViewModelTests { [TestFixture] - public class JobListViewModelTests : ViewModelTestBase + public class JobListViewModelTests// : ViewModelTestBase { - private const string finalVIF = "vecto_multistage_conventional_final_vif.VIF_Report_1.xml"; - + private IKernel _kernel; private JobListViewModel _jobListViewModel; + private MockDialogHelper _dialogHelper; + private MockWindowHelper _mockWindowHelper; - private const string _newVifCompletedConventional = "newVifCompletedConventional.vecto"; - private const string _newVifExempted = "newVifExempted.vecto"; - private const string _newVifInterimDiesel = "newVifInterimDiesel.vecto"; - private const string _newVifExemptedIncomplete = "newVifExemptedIncomplete.vecto"; [SetUp] public void SetupViewModelTests() { + _kernel = TestHelper.GetKernel(); + _kernel.Rebind<IDialogHelper>().To<MockDialogHelper>().InSingletonScope(); + _kernel.Rebind<IWindowHelper>().To<MockWindowHelper>().InSingletonScope(); _jobListViewModel = _kernel.Get<IJobListViewModel>() as JobListViewModel; + _dialogHelper = _kernel.Get<IDialogHelper>() as MockDialogHelper; + _mockWindowHelper = _kernel.Get<IWindowHelper>() as MockWindowHelper; + } [Test] @@ -35,19 +46,19 @@ namespace Vecto3GUI2020Test.ViewModelTests var watch = new Stopwatch(); watch.Start(); //load final vif - var loadedFile = await _jobListViewModel.AddJobAsync(GetTestDataPath(finalVIF)).ConfigureAwait(false); - + var finalVifPath = Path.GetFullPath(TestData.FinalVif); + AssertHelper.FileExists(finalVifPath); + var loadedFile = await _jobListViewModel.AddJobAsync(finalVifPath).ConfigureAwait(false); + _dialogHelper.AssertNoErrorDialogs(); //select vif for simulation Assert.AreNotEqual(0, _jobListViewModel.Jobs.Count); _jobListViewModel.Jobs[0].Selected = true; - _jobListViewModel.RunSimulationExecute(); TestContext.Write("Canceling Simulation ... "); Assert.IsTrue(_jobListViewModel.SimulationRunning); _jobListViewModel.CancelSimulation.Execute(null); - //Wait var constraint = Is.True.After(delayInMilliseconds: 100000, pollingInterval: 100); Assert.That(() => _jobListViewModel.SimulationRunning == false, constraint); @@ -57,39 +68,128 @@ namespace Vecto3GUI2020Test.ViewModelTests TestContext.WriteLine($"ExecutionTime {watch.Elapsed.TotalSeconds}s"); } - [TestCase(_newVifCompletedConventional, TestName = "VIFConventionalCompleted")] - [TestCase(_newVifInterimDiesel, TestName="VIFConventionalInterim")] - [TestCase(_newVifExempted, TestName = "VIFExempted")] - [TestCase(_newVifExemptedIncomplete, TestName = "VIFExemptedInterim")] - [TestCase(VIFTests.exempted_primary_vif, TestName="Exempted")] + [TestCase(TestData.NewVifCompletedConventional, TestName = "VIFConventionalCompleted")] + [TestCase(TestData.NewVifInterimDiesel, TestName="VIFConventionalInterim")] + [TestCase(TestData.NewVifExempted, TestName = "VIFExempted")] + [TestCase(TestData.NewVifExemptedIncomplete, TestName = "VIFExemptedInterim")] public async Task AddJobAsyncTest(string fileName) { - var path = GetTestDataPath(fileName); - Assert.AreEqual(0, _jobListViewModel.Jobs.Count); - await DoAddJobAsync(path); + AssertHelper.FileExists(Path.GetFullPath(fileName)); + await DoAddJobAsync(Path.GetFullPath(fileName)); + Assert.That(_jobListViewModel.Jobs.Count == 1); + _dialogHelper.AssertNoErrorDialogs(); + } + + + [TestCase("TestData/XML/SchemaVersionMultistage.0.1/vecto_multistage_consolidated_multiple_stages.xml")] + public async Task AddVIF(string fileName) + { + var documentViewModel = await DoAddJobAsync(Path.GetFullPath(fileName)); + _dialogHelper.AssertNoErrorDialogs(); + Assert.That(documentViewModel is MultiStageJobViewModel_v0_1); + + } + [TestCase(@"TestData\XML\vecto_vehicle-stage_input_full-sample.xml")] + public async Task AddStepInput(string fileName) + { + var documentViewModel = await DoAddJobAsync(Path.GetFullPath(fileName)); + Assert.That(documentViewModel is StageInputViewModel, $"expected {typeof(StageInputViewModel)} got {documentViewModel.GetType()}"); + } + + [TestCase(@"TestData\Case1\special_case_1.vecto", "Special Case I")] + [TestCase(@"TestData\Case2\special_case_2.vecto", "Special Case II")] + public async Task AddNewVIFJob(string fileName, string specialCase) + { + var documentViewModel = await DoAddJobAsync(Path.GetFullPath(fileName)); + var createVifViewModel = documentViewModel as CreateVifViewModel; + Assert.That(createVifViewModel != null); + + Assert.That(_jobListViewModel.Jobs.Count == 1); + switch (specialCase) { + case "Special Case I": + Assert.False(createVifViewModel.RunSimulation); + + + break; + case "Special Case II": + Assert.True(createVifViewModel.RunSimulation); + + + break; + default: + Assert.Fail(); + break; + } + } + + + #region New Files + [Test, Description("File -> Create Interim/Completed Input")] + public void CreateStepInput() + { + _jobListViewModel.NewCompletedInputCommand.Execute(null); + Assert.That(!_jobListViewModel.Jobs[0].DocumentName.Contains("exempted")); + Assert.That(_jobListViewModel.Jobs.Count == 1); + } + + [Test, Description("File -> Create Exempted Interim/Completed Input")] + [Ignore("Command removed")] + public void CreateExemptedStepInput() + { + _jobListViewModel.NewExemptedCompletedInputCommand.Execute(null); + Assert.That(_jobListViewModel.Jobs[0].DocumentName.Contains("exempted")); + Assert.That(_jobListViewModel.Jobs.Count == 1); } + [Test, Description("File -> New Completed Job")] + public void CreateSpecialCaseCompletedVIF() + { + _jobListViewModel.NewVifCommand.Execute(true); + Assert.That(_jobListViewModel.Jobs.Count == 1); + } + + [Test, Description("File -> New Primary job with Interim Input")] + public void CreateSpecialCaseVIF() + { + _jobListViewModel.NewVifCommand.Execute(false); + Assert.That(_jobListViewModel.Jobs.Count == 1); + } + + [Test, Description("File -> New Interim/Completed Job")] + public void CreateStep() + { + _jobListViewModel.NewManufacturingStageFileCommand.Execute(null); + var openedViewModel = _mockWindowHelper.Windows[0] as NewMultiStageJobViewModel; + Assert.That(openedViewModel != null); + + //Assert.That(_jobListViewModel.Jobs.Count == 1); + } + #endregion + + [TestCase(TestData.PrimaryHeavybusSampleXML)] + [TestCase(TestData.HeavylorryHevSHeavylorryS3XML)] + public async Task AddSimulationOnlyJob(string fileName) + { + var documentViewModel = await DoAddJobAsync(Path.GetFullPath(fileName)); + Assert.That(documentViewModel is SimulationOnlyDeclarationJob); + _dialogHelper.AssertNoErrorDialogs(); + } - private async Task DoAddJobAsync(string filepath) { - await _jobListViewModel.AddJobAsync(filepath); + + private async Task<IDocumentViewModel> DoAddJobAsync(string filepath) { + AssertHelper.FileExists(filepath); + Assert.AreEqual(0, _jobListViewModel.Jobs.Count); + var documentViewModel = await _jobListViewModel.AddJobAsync(filepath); Assert.AreEqual(1, _jobListViewModel.Jobs.Count); Assert.AreEqual(filepath, _jobListViewModel.Jobs[0].DataSource.SourceFile); + return documentViewModel; } [TestCase(true, TestName = "Exempted")] - [TestCase(false, TestName = "NotExempted")] public void addNewFilesToJobList(bool exempted) { - if (exempted) - { - _jobListViewModel.NewExemptedCompletedInputCommand.Execute(null); - } - else - { - _jobListViewModel.NewCompletedInputCommand.Execute(null); - } - + _jobListViewModel.NewCompletedInputCommand.Execute(null); Assert.AreEqual(1, _jobListViewModel.Jobs.Count); } @@ -101,8 +201,9 @@ namespace Vecto3GUI2020Test.ViewModelTests watch.Start(); //load final vif - var loadedFile = await _jobListViewModel.AddJobAsync(GetTestDataPath(finalVIF)).ConfigureAwait(false); + var loadedFile = await _jobListViewModel.AddJobAsync(Path.GetFullPath(TestData.FinalVif)).ConfigureAwait(false); + _dialogHelper.AssertNoErrorDialogs(); //select vif for simulation Assert.AreNotEqual(0, _jobListViewModel.Jobs.Count); @@ -113,10 +214,17 @@ namespace Vecto3GUI2020Test.ViewModelTests //Simulate for a while var outputVm = _kernel.Get<IOutputViewModel>(); // SINGLETON var simulationTask = _jobListViewModel.RunSimulationExecute(); - Assert.That(() => outputVm.Progress, Is.GreaterThanOrEqualTo(25).After(1 * 60 * 1000, 1), - () => $"Simulation reached {outputVm.Progress}%"); + //Wait until simulation reached 2% + Assert.IsTrue(_jobListViewModel.SimulationRunning); + while (outputVm.Progress < 4 && (!outputVm.StatusMessage?.Contains("finished") ?? false)) { + //DO nothing + } - TestContext.Write("Canceling Simulation ... "); + + // Assert.That(() => outputVm.Progress, Is.GreaterThanOrEqualTo(25).After(1 * 60 * 1000, 1), + // () => $"Simulation reached {outputVm.Progress}%"); + //_dialogHelper.AssertNoErrorDialogs(); + TestContext.Write("Canceling Simulation ... "); Assert.IsTrue(_jobListViewModel.SimulationRunning); _jobListViewModel.CancelSimulation.Execute(null); Assert.That(() => _jobListViewModel.SimulationRunning, Is.False.After(20*1000, 50) ); @@ -126,15 +234,19 @@ namespace Vecto3GUI2020Test.ViewModelTests TestContext.WriteLine($"ExecutionTime {watch.Elapsed.TotalSeconds}s"); } - [Test] - public async Task LoadStageInputOnly() - { - var documentViewModel = await _jobListViewModel.AddJobAsync(GetTestDataPath(stageInputFullSample)); - Assert.AreEqual(typeof(StageInputViewModel), documentViewModel.GetType()); - - var stageInputDocumentViewModel = documentViewModel.EditViewModel as StageInputViewModel; - Assert.NotNull(stageInputDocumentViewModel); - } + + // public async Task LoadStageInputOnly(string file) + //{ + // var path = GetTestDataPath(file); + // _dialogHelper.AssertNoErrorDialogs(); + // AssertHelper.FileExists(path); + + // var documentViewModel = await _jobListViewModel.AddJobAsync(path); + // Assert.AreEqual(typeof(StageInputViewModel), documentViewModel.GetType()); + + // var stageInputDocumentViewModel = documentViewModel.EditViewModel as StageInputViewModel; + // Assert.NotNull(stageInputDocumentViewModel); + //} } } \ No newline at end of file diff --git a/Vecto3GUI2020Test/ViewModelTests/LoadAndSaveVehicleData.cs b/Vecto3GUI2020Test/ViewModelTests/LoadAndSaveVehicleData.cs index 082182fb8a8eb31c6d1ca3f68c59caaa70635f16..f3631169878d0b2804ef320b19d48ed60694b921 100644 --- a/Vecto3GUI2020Test/ViewModelTests/LoadAndSaveVehicleData.cs +++ b/Vecto3GUI2020Test/ViewModelTests/LoadAndSaveVehicleData.cs @@ -1,5 +1,7 @@ using System; using System.IO; +using System.Xml.Linq; +using Moq; using Ninject; using NUnit.Framework; using TUGraz.VectoCommon.BusAuxiliaries; @@ -7,7 +9,13 @@ using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.FileIO.XML; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.Resources.XML; +using VECTO3GUI2020.Util.XML; using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; +using Vecto3GUI2020Test.MockInput; +using Vecto3GUI2020Test.Utils; namespace Vecto3GUI2020Test { @@ -17,7 +25,7 @@ namespace Vecto3GUI2020Test [Test] public void LoadInputFileMultipleStage() { - Assert.NotNull(LoadFileFromTestDirectory(consolidated_multiple_stages)); + Assert.NotNull(LoadFileFromPath(TestData.consolidated_multiple_stages)); } @@ -26,8 +34,8 @@ namespace Vecto3GUI2020Test public void LoadPrimaryAndSaveVehicleData() { //Load Primary Vehicle VIF - var newMultiStageJob = LoadFileFromTestDirectory(primary_vehicle_only); - var vehicle = newMultiStageJob.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel_v2_8; + var newMultiStageJob = LoadFileFromPath(TestData.primary_vehicle_only); + var vehicle = newMultiStageJob.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel; Assert.NotNull(vehicle); vehicle.Manufacturer = "test1"; vehicle.ManufacturerAddress = "testAddress2"; @@ -41,18 +49,18 @@ namespace Vecto3GUI2020Test Assert.NotNull(multistageJobViewModel); - var fileName = primary_vehicle_only.Replace(".xml", "") + "_output.xml"; + var fileName = TestData.primary_vehicle_only.Replace(".xml", "") + "_output.xml"; - multistageJobViewModel.ManufacturingStageViewModel.SaveInputDataExecute(GetFullPath(fileName)); - Assert.True(checkFileNameExists(fileName)); + multistageJobViewModel.ManufacturingStageViewModel.SaveInputDataExecute(Path.GetFullPath(fileName)); + AssertHelper.FileExists(fileName); } [Test] public void LoadPrimaryAndSaveAsVif() { //load file - var newMultiStageJob = LoadFileFromTestDirectory(primary_vehicle_only); - var vehicle = newMultiStageJob.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel_v2_8; + var newMultiStageJob = LoadFileFromPath(TestData.primary_vehicle_only); + var vehicle = newMultiStageJob.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel; } @@ -61,19 +69,19 @@ namespace Vecto3GUI2020Test [Test] public void ReloadInputFile() { - var newMultistageJobViewModel = LoadFileFromTestDirectory(consolidated_multiple_stages_airdrag) as NewMultiStageJobViewModel; + var newMultistageJobViewModel = LoadFileFromPath(TestData.consolidated_multiple_stages_airdrag) as NewMultiStageJobViewModel; var vehicle = newMultistageJobViewModel.MultiStageJobViewModel.VehicleInputData as - InterimStageBusVehicleViewModel_v2_8; + InterimStageBusVehicleViewModel; Assert.NotNull(vehicle); Assert.True(vehicle.AirdragModifiedMultistepEditingEnabled); - newMultistageJobViewModel.AddVifFile(GetTestDataPath(consolidated_multiple_stages_hev)); - Assert.AreEqual(GetTestDataPath(consolidated_multiple_stages_hev), newMultistageJobViewModel.VifPath); - vehicle = newMultistageJobViewModel.MultiStageJobViewModel.VehicleInputData as InterimStageBusVehicleViewModel_v2_8; + newMultistageJobViewModel.AddVifFile(Path.GetFullPath(TestData.consolidated_multiple_stages_hev)); + Assert.AreEqual(Path.GetFullPath(TestData.consolidated_multiple_stages_hev), newMultistageJobViewModel.VifPath); + vehicle = newMultistageJobViewModel.MultiStageJobViewModel.VehicleInputData as InterimStageBusVehicleViewModel; Assert.IsFalse(vehicle.AirdragModifiedMultistepEditingEnabled); } @@ -82,27 +90,26 @@ namespace Vecto3GUI2020Test [Test] public void LoadInputFileMultipleStageAirdrag() { - LoadFileFromTestDirectory(consolidated_multiple_stages_airdrag); + LoadFileFromPath(TestData.consolidated_multiple_stages_airdrag); } [Ignore("incomplete")] [Test] public void LoadAndSaveFullInputDataSample() { - var vm = LoadFileFromTestDirectory(primary_vehicle_only); + var vm = LoadFileFromPath(TestData.primary_vehicle_only); var multiStageJobViewModel = vm.MultiStageJobViewModel as MultiStageJobViewModel_v0_1; var fileToSave = "loadAndSaveFullInputDataTest.xml"; - var mockDialogHelper = SetMockDialogHelper(stageInputFullSample, fileToSave); - multiStageJobViewModel.ManufacturingStageViewModel.LoadStageInputData(GetFullPath(stageInputFullSample)); + multiStageJobViewModel.ManufacturingStageViewModel.LoadStageInputData(Path.GetFullPath(TestData.stageInputFullSample)); var manufacturingStageViewModel = multiStageJobViewModel.ManufacturingStageViewModel as ManufacturingStageViewModel_v0_1; var vehicleViewModel = - manufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel_v2_8; + manufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel; @@ -113,7 +120,7 @@ namespace Vecto3GUI2020Test [Test] public void loadVehicleInputDataOnly() { - string inputPath = GetTestDataPath(stageInputFullSample); + string inputPath = Path.GetFullPath(TestData.stageInputFullSample); var inputDataReader = _kernel.Get<IXMLInputDataReader>(); var inputData = (IDeclarationInputDataProvider)inputDataReader.Create(inputPath); var vehicleInputData = inputData.JobInputData.Vehicle; @@ -126,13 +133,13 @@ namespace Vecto3GUI2020Test [Test] public void loadInputFileConsolidatedOneStage() { - LoadFileFromTestDirectory(consolidated_one_stage); + LoadFileFromPath(TestData.consolidated_one_stage); } [Test] public void loadInputFilePrimaryOnly() { - var vm = LoadFileFromTestDirectory(primary_vehicle_only); + var vm = LoadFileFromPath(TestData.primary_vehicle_only); Assert.AreEqual(2, vm.MultiStageJobViewModel.ManufacturingStageViewModel.StepCount); var primaryVehicle = vm.MultiStageJobViewModel.PrimaryVehicle; @@ -146,7 +153,7 @@ namespace Vecto3GUI2020Test Assert.IsTrue(string.IsNullOrEmpty(vehicleViewModel.VIN)); Assert.IsNull(vehicleViewModel.Model); - var vehicleViewModelV28 = vehicleViewModel as InterimStageBusVehicleViewModel_v2_8; + var vehicleViewModelV28 = vehicleViewModel as InterimStageBusVehicleViewModel; Assert.NotNull(vehicleViewModelV28); Assert.Null(vehicleViewModelV28.HeightInMm); @@ -186,20 +193,24 @@ namespace Vecto3GUI2020Test - [TestCase(consolidated_multiple_stages_airdrag, true, TestName="LoadAirdragComponentConsolidatedMultipleStages")] - [TestCase(consolidated_multiple_stages, null, TestName="LoadAirdragConsolidatedMultipleStage")] - [TestCase(consolidated_one_stage, null, TestName="LoadAirdragOneStage")] - [TestCase(primary_vehicle_only, null, TestName= "LoadAirdragPrimaryVehicle")] - public void LoadAirdragComponentAndSaveVehicleData(string fileName, object expectedAirdragModifiedValue) + [TestCase(TestData.consolidated_multiple_stages_airdrag, true, TestData.airdragLoadTestFile, TestName ="LoadAirdragComponentConsolidatedMultipleStages")] + [TestCase(TestData.consolidated_multiple_stages, null, TestData.airdragLoadTestFile, TestName ="LoadAirdragConsolidatedMultipleStage")] + [TestCase(TestData.consolidated_one_stage, null, TestData.airdragLoadTestFile, TestName ="LoadAirdragOneStage")] + [TestCase(TestData.primary_vehicle_only, null, TestData.airdragLoadTestFile, TestName = "LoadAirdragPrimaryVehicle")] + [TestCase(TestData.consolidated_multiple_stages_airdrag, true, TestData.airdragLoadTestFilev2, TestName = "LoadAirdragComponentConsolidatedMultipleStages")] + [TestCase(TestData.consolidated_multiple_stages, null, TestData.airdragLoadTestFilev2, TestName = "LoadAirdragConsolidatedMultipleStage")] + [TestCase(TestData.consolidated_one_stage, null, TestData.airdragLoadTestFilev2, TestName = "LoadAirdragOneStage")] + [TestCase(TestData.primary_vehicle_only, null, TestData.airdragLoadTestFilev2, TestName = "LoadAirdragPrimaryVehicle")] + public void LoadAirdragComponentAndSaveVehicleData(string fileName, object expectedAirdragModifiedValue, string airdragFile) { - var vm = LoadFileFromTestDirectory(fileName); + var vm = LoadFileFromPath(fileName); var vehicleVm = vm.MultiStageJobViewModel.ManufacturingStageViewModel.VehicleViewModel as - InterimStageBusVehicleViewModel_v2_8; + InterimStageBusVehicleViewModel; - var airdragLoadResult = vehicleVm.MultistageAirdragViewModel.LoadAirdragFile(GetTestDataPath(airdragLoadTestFile)); + var airdragLoadResult = vehicleVm.MultistageAirdragViewModel.LoadAirdragFile(Path.GetFullPath(airdragFile)); Assert.IsTrue(airdragLoadResult, "Airdrag file not loaded"); @@ -212,11 +223,10 @@ namespace Vecto3GUI2020Test var fileToSave = "stageInput.xml"; - var mockDialogHelper = SetMockDialogHelper(null, fileToSave: fileToSave); TestContext.Write("Saving file with loaded Airdrag Component ... "); var multistageJobViewModel = vm.MultiStageJobViewModel as MultiStageJobViewModel_v0_1; - var savePath = GetFullPath($"{TestContext.CurrentContext.Test.Name}.xml"); + var savePath = Path.GetFullPath($"{TestContext.CurrentContext.Test.Name}.xml"); multistageJobViewModel.ManufacturingStageViewModel.SaveInputDataExecute(savePath); Assert.IsTrue(File.Exists(savePath)); @@ -241,9 +251,9 @@ namespace Vecto3GUI2020Test { - TestContext.WriteLine($"Loading {consolidated_multiple_stages}"); + TestContext.WriteLine($"Loading {TestData.consolidated_multiple_stages}"); //New Manufacturing Stage - var newMultistageJobViewModel = LoadFileFromTestDirectory(consolidated_multiple_stages); + var newMultistageJobViewModel = LoadFileFromPath(TestData.consolidated_multiple_stages); Assert.NotNull(newMultistageJobViewModel.MultiStageJobViewModel); var manstageVehicleViewModel = newMultistageJobViewModel.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as IMultistageVehicleViewModel; Assert.NotNull(manstageVehicleViewModel); @@ -257,24 +267,39 @@ namespace Vecto3GUI2020Test //Load Stage InputData - var vehicleInputDataFilePath = GetTestDataPath(stageInputFullSample); - TestContext.WriteLine($"Loading {vehicleInputDataFilePath}"); - Assert.IsTrue(File.Exists(vehicleInputDataFilePath)); - manStageViewModel.LoadStageInputData(vehicleInputDataFilePath); + //var vehicleInputDataFilePath = GetTestDataPath(stageInputFullSample); + //TestContext.WriteLine($"Loading {vehicleInputDataFilePath}"); + //Assert.IsTrue(File.Exists(vehicleInputDataFilePath), $"File {vehicleInputDataFilePath} not found"); + //var stepInputData = MockDocument.GetMockVehicle(out var mockStepInput, true); - var vehicleViewModel = manStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel_v2_8; + + var stepInputData = MockDocument.GetStepInput(XMLTypes.Vehicle_Conventional_CompletedBusDeclarationType, XMLNamespaces.V24).Vehicle + .AddADAS(XMLNamespaces.V24, XMLTypes.ADAS_HEV_Type) + .AddAirdragComponent(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V20) + .AddBusAux(XMLNamespaces.V24, XMLTypes.AUX_Conventional_CompletedBusType); + + + manStageViewModel.SetInputData( + stepInputData + ); + + //var airDragMock = Mock.Get(stepInputData.Components.AirdragInputData); + + //manStageViewModel.LoadStageInputData(vehicleInputDataFilePath); + + var vehicleViewModel = manStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel; Assert.NotNull(vehicleViewModel); //Assert.IsFalse(getMockDialogHelper().Verify); Assert.AreEqual("VEH-1234567890", vehicleViewModel.Identifier); Assert.AreEqual("Some Manufacturer", vehicleViewModel.Manufacturer); - Assert.AreEqual("Some Manufacturer Address", vehicleViewModel.ManufacturerAddress); + Assert.AreEqual("Baker Street 221b", vehicleViewModel.ManufacturerAddress); Assert.AreEqual("VEH-1234567890", vehicleViewModel.VIN); Assert.AreEqual(DateTime.Today, vehicleViewModel.Date); - Assert.AreEqual("Sample Bus Model", vehicleViewModel.Model); + Assert.AreEqual("Fillmore", vehicleViewModel.Model); Assert.AreEqual(LegislativeClass.M3, vehicleViewModel.LegislativeClass); - Assert.AreEqual(500, vehicleViewModel.CurbMassChassis.Value());//CorrectedActualMass - Assert.AreEqual(3500, vehicleViewModel.GrossVehicleMassRating.Value());//TechnicalPermissibleMaximumLadenMass + Assert.AreEqual(12000, vehicleViewModel.CurbMassChassis.Value());//CorrectedActualMass + Assert.AreEqual(15000, vehicleViewModel.GrossVehicleMassRating.Value());//TechnicalPermissibleMaximumLadenMass Assert.AreEqual(true, vehicleViewModel.AirdragModifiedMultistep); Assert.AreEqual(AIRDRAGMODIFIED.TRUE, vehicleViewModel.AirdragModifiedEnum); Assert.AreEqual(AIRDRAGMODIFIED.TRUE, vehicleViewModel.ParameterViewModels[nameof(vehicleViewModel.AirdragModifiedEnum)].CurrentContent); @@ -293,9 +318,9 @@ namespace Vecto3GUI2020Test Assert.AreEqual(2500, (vehicleViewModel.ParameterViewModels[nameof(vehicleViewModel.HeightInMm)].CurrentContent as ConvertedSI).Value); Assert.AreEqual(9500, (vehicleViewModel.ParameterViewModels[nameof(vehicleViewModel.LengthInMm)].CurrentContent as ConvertedSI).Value); Assert.AreEqual(2500, (vehicleViewModel.ParameterViewModels[nameof(vehicleViewModel.WidthInMm)].CurrentContent as ConvertedSI).Value); - - - Assert.AreEqual(2, vehicleViewModel.EntranceHeight.Value()); + Assert.AreEqual(150, (vehicleViewModel.ParameterViewModels[nameof(vehicleViewModel.EntranceHeightInMm)].CurrentContent as ConvertedSI).Value); + Assert.AreEqual(false, vehicleViewModel.LowEntry); + Assert.AreEqual(0.15, vehicleViewModel.EntranceHeight.Value()); Assert.AreEqual(ConsumerTechnology.Electrically, vehicleViewModel.DoorDriveTechnology); Assert.AreEqual(VehicleDeclarationType.interim, vehicleViewModel.VehicleDeclarationType); Assert.AreEqual("1234567890", vehicleViewModel.VehicleTypeApprovalNumber); @@ -305,7 +330,7 @@ namespace Vecto3GUI2020Test var airdrag = vehicleViewModel.MultistageAirdragViewModel; - Assert.NotNull(airdrag.AirDragViewModel.XMLSource); + TestAdasInput(vehicleViewModel); @@ -319,9 +344,9 @@ namespace Vecto3GUI2020Test private void TestAdasInput(IVehicleDeclarationInputData vehicle) { Assert.AreEqual(true, vehicle.ADAS.EngineStopStart); - Assert.AreEqual(EcoRollType.None, vehicle.ADAS.EcoRoll); - Assert.AreEqual(PredictiveCruiseControlType.None, vehicle.ADAS.PredictiveCruiseControl); - Assert.AreEqual(true, vehicle.ADAS.ATEcoRollReleaseLockupClutch); + Assert.AreEqual(EcoRollType.WithEngineStop, vehicle.ADAS.EcoRoll); + Assert.AreEqual(PredictiveCruiseControlType.Option_1_2_3, vehicle.ADAS.PredictiveCruiseControl); + Assert.AreEqual(false, vehicle.ADAS.ATEcoRollReleaseLockupClutch); } private void TestComponents(IVehicleComponentsDeclaration components) @@ -332,13 +357,15 @@ namespace Vecto3GUI2020Test private void TestAirdragComponent(IAirdragDeclarationInputData airdrag) { - Assert.AreEqual("Generic Manufacturer", airdrag.Manufacturer); - Assert.AreEqual("Generic Model", airdrag.Model); + Assert.AreEqual("Manufacturer", airdrag.Manufacturer); + Assert.AreEqual("Model", airdrag.Model); Assert.AreEqual("e12*0815/8051*2017/05E0000*00", airdrag.CertificationNumber); - Assert.AreEqual(DateTime.Parse("2017-03-24T15:00:00Z").ToUniversalTime(), airdrag.Date); + Assert.AreEqual(DateTime.Today, airdrag.Date); Assert.AreEqual("Vecto AirDrag x.y", airdrag.AppVersion); - Assert.AreEqual(6.34, airdrag.AirDragArea.Value()); - } + Assert.AreEqual(6.66, airdrag.AirDragArea.Value()); + Assert.AreEqual(7.77, airdrag.AirDragArea_0.Value()); + Assert.AreEqual(8.88, airdrag.TransferredAirDragArea.Value()); + } private void TestAuxiliariesComponent(IBusAuxiliariesDeclarationData busAux) { @@ -348,32 +375,37 @@ namespace Vecto3GUI2020Test private void TestLedLightsComponent(IElectricConsumersDeclarationData electricConsumer) { - Assert.AreEqual(false, electricConsumer.InteriorLightsLED); + Assert.AreEqual(true, electricConsumer.InteriorLightsLED); Assert.AreEqual(true, electricConsumer.DayrunninglightsLED); Assert.AreEqual(true, electricConsumer.PositionlightsLED); Assert.AreEqual(true, electricConsumer.BrakelightsLED); - Assert.AreEqual(false, electricConsumer.HeadlightsLED); + Assert.AreEqual(true, electricConsumer.HeadlightsLED); } private void TestHVACComponent(IHVACBusAuxiliariesDeclarationData hvacAux) { Assert.AreEqual(BusHVACSystemConfiguration.Configuration0, hvacAux.SystemConfiguration); - Assert.AreEqual(HeatPumpType.none, hvacAux.HeatPumpTypeCoolingDriverCompartment); - Assert.AreEqual(HeatPumpType.non_R_744_3_stage, hvacAux.HeatPumpTypeHeatingDriverCompartment); + Assert.AreEqual(HeatPumpType.non_R_744_2_stage, hvacAux.HeatPumpTypeCoolingDriverCompartment); + Assert.AreEqual(HeatPumpType.non_R_744_2_stage, hvacAux.HeatPumpTypeHeatingDriverCompartment); Assert.AreEqual(HeatPumpType.non_R_744_2_stage, hvacAux.HeatPumpTypeCoolingPassengerCompartment); - Assert.AreEqual(HeatPumpType.non_R_744_4_stage, hvacAux.HeatPumpTypeHeatingPassengerCompartment); + Assert.AreEqual(HeatPumpType.non_R_744_2_stage, hvacAux.HeatPumpTypeHeatingPassengerCompartment); Assert.AreEqual(50, hvacAux.AuxHeaterPower.Value()); - Assert.AreEqual(false, hvacAux.DoubleGlazing); + Assert.AreEqual(true, hvacAux.DoubleGlazing); Assert.AreEqual(true, hvacAux.AdjustableAuxiliaryHeater); - Assert.AreEqual(false, hvacAux.SeparateAirDistributionDucts); - Assert.AreEqual(null, hvacAux.WaterElectricHeater); - Assert.AreEqual(null, hvacAux.AirElectricHeater); - Assert.AreEqual(null, hvacAux.OtherHeatingTechnology); + Assert.AreEqual(true, hvacAux.SeparateAirDistributionDucts); + Assert.AreEqual(true, hvacAux.WaterElectricHeater); + Assert.AreEqual(true, hvacAux.AirElectricHeater); + Assert.AreEqual(true, hvacAux.OtherHeatingTechnology); } - + [TearDown] + public void TearDown() + { + _mockDialogHelper.AssertNoErrorDialogs(); + + } diff --git a/Vecto3GUI2020Test/ViewModelTests/MultistageAuxiliariesViewModelTests.cs b/Vecto3GUI2020Test/ViewModelTests/MultistageAuxiliariesViewModelTests.cs index 3a51f0eb107d23ac241809d7562ca0374e67a41c..b528a61fcf01acad829ebe944fdc20493060da87 100644 --- a/Vecto3GUI2020Test/ViewModelTests/MultistageAuxiliariesViewModelTests.cs +++ b/Vecto3GUI2020Test/ViewModelTests/MultistageAuxiliariesViewModelTests.cs @@ -3,26 +3,38 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Ninject; using NUnit.Framework; using TUGraz.VectoCommon.BusAuxiliaries; using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; namespace Vecto3GUI2020Test.ViewModelTests { [TestFixture] public class MultistageAuxiliariesViewModelTests : ViewModelTestBase { + private IMultiStageViewModelFactory _viewModelFactory; + + [SetUp] + public void Setup() + { + _kernel = TestHelper.GetKernel(); + _viewModelFactory = _kernel.Get<IMultiStageViewModelFactory>(); + } + [TestCase(CompletedBusArchitecture.Conventional)] + [TestCase(CompletedBusArchitecture.HEV)] + public void TestAllowedValuesHeatPumpTypeDriver(CompletedBusArchitecture arch) + { + var auxVm = _viewModelFactory.GetAuxiliariesViewModel( + arch) as MultistageAuxiliariesViewModel; - [Test] - public void TestAllowedValuesHeatPumpTypeDriver() - { - var auxVm = new MultistageAuxiliariesViewModel(null); auxVm.SystemConfiguration = BusHVACSystemConfiguration.Configuration6; - Assert.AreEqual(auxVm.HeatPumpTypeDriverAllowedValues.Count,1); - Assert.Contains(HeatPumpType.not_applicable, auxVm.HeatPumpTypeDriverAllowedValues); + Assert.AreEqual(auxVm.HeatPumpTypeDriverAllowedValues.Count, 1); + Assert.Contains(HeatPumpType.not_applicable, auxVm.HeatPumpTypeDriverAllowedValues); auxVm.SystemConfiguration = BusHVACSystemConfiguration.Configuration3; - Assert.IsFalse(auxVm.HeatPumpTypeDriverAllowedValues.Contains(HeatPumpType.not_applicable)); + Assert.IsFalse(auxVm.HeatPumpTypeDriverAllowedValues.Contains(HeatPumpType.not_applicable)); auxVm.SystemConfiguration = BusHVACSystemConfiguration.Configuration10; Assert.AreEqual(auxVm.HeatPumpTypeDriverAllowedValues.Count, 1); @@ -33,25 +45,27 @@ namespace Vecto3GUI2020Test.ViewModelTests } - [Test] - public void TestEnumParameters() + [TestCase(CompletedBusArchitecture.Conventional)] + [TestCase(CompletedBusArchitecture.HEV)] + public void TestEnumParameters(CompletedBusArchitecture arch) { - var auxVm = new MultistageAuxiliariesViewModel(null); - auxVm.HeatPumpTypeCoolingDriverCompartment = HeatPumpType.none; - Assert.IsTrue(auxVm.HeatPumpGroupEditingEnabled); - auxVm.HeatPumpTypeCoolingDriverCompartment = HeatPumpType.R_744; - Assert.IsTrue(auxVm.HeatPumpGroupEditingEnabled); + var auxVm = _viewModelFactory.GetAuxiliariesViewModel( + arch) as MultistageAuxiliariesViewModel; + auxVm.HeatPumpTypeCoolingDriverCompartment = HeatPumpType.none; + Assert.IsTrue(auxVm.HeatPumpGroupEditingEnabled); + auxVm.HeatPumpTypeCoolingDriverCompartment = HeatPumpType.R_744; + Assert.IsTrue(auxVm.HeatPumpGroupEditingEnabled); - auxVm.HeatPumpGroupEditingEnabled = false; - auxVm.ParameterViewModels[nameof(auxVm.HeatPumpTypeCoolingDriverCompartment)].CurrentContent = - HeatPumpType.R_744; - Assert.IsTrue(auxVm.HeatPumpGroupEditingEnabled); + auxVm.HeatPumpGroupEditingEnabled = false; + auxVm.ParameterViewModels[nameof(auxVm.HeatPumpTypeCoolingDriverCompartment)].CurrentContent = + HeatPumpType.R_744; + Assert.IsTrue(auxVm.HeatPumpGroupEditingEnabled); - auxVm.ParameterViewModels[nameof(auxVm.HeatPumpTypeCoolingDriverCompartment)].CurrentContent = - HeatPumpType.none; + auxVm.ParameterViewModels[nameof(auxVm.HeatPumpTypeCoolingDriverCompartment)].CurrentContent = + HeatPumpType.none; - Assert.IsTrue(auxVm.HeatPumpGroupEditingEnabled); + Assert.IsTrue(auxVm.HeatPumpGroupEditingEnabled); } } } diff --git a/Vecto3GUI2020Test/ViewModelTests/StageViewModelTests.cs b/Vecto3GUI2020Test/ViewModelTests/StageViewModelTests.cs deleted file mode 100644 index 9cc2a9cbf596fa3a83052ad18f3e01435bf97fc6..0000000000000000000000000000000000000000 --- a/Vecto3GUI2020Test/ViewModelTests/StageViewModelTests.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System.IO; -using System.Runtime.InteropServices; -using Ninject; -using NUnit.Framework; -using TUGraz.VectoCommon.BusAuxiliaries; -using TUGraz.VectoCommon.InputData; -using TUGraz.VectoCommon.Models; -using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Configuration; -using VECTO3GUI2020.ViewModel.Implementation; -using VECTO3GUI2020.ViewModel.Interfaces; -using VECTO3GUI2020.ViewModel.Interfaces.Document; -using VECTO3GUI2020.ViewModel.Interfaces.JobEdit; -using VECTO3GUI2020.ViewModel.MultiStage.Implementation; -using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; - -namespace Vecto3GUI2020Test.ViewModelTests -{ - [TestFixture] - public class StageViewModelTests : ViewModelTestBase - { - - - [TestCase(true, TestName="Exempted")] - [TestCase(false, TestName="NotExempted")] - public void updateFilePathsWhenSaved(bool exempted) - { - IMultiStageViewModelFactory vmFactory = _kernel.Get<IMultiStageViewModelFactory>(); - - var StageInput = vmFactory.GetStageInputViewModel(exempted) as StageInputViewModel; - var vehicleVm = StageInput.VehicleViewModel as InterimStageBusVehicleViewModel_v2_8; - vehicleVm.Manufacturer = "adsf"; - vehicleVm.ManufacturerAddress = "asdf 123"; - vehicleVm.VIN = "1234567890"; - - var fileName = TestHelper.GetMethodName() + ".xml"; - StageInput.SaveInputDataExecute(GetFullPath(fileName)); - Assert.True(checkFileNameExists(fileName)); - Assert.AreEqual(GetFullPath(fileName), StageInput.VehicleInputDataFilePath); - - //Check if title is updated - StringAssert.Contains(fileName, StageInput.Title); - - //Check datasource - Assert.NotNull(StageInput.DataSource); - - File.Delete(GetFullPath(fileName)); - } - - [Test] - public void SaveFullStageInput() - { - IMultiStageViewModelFactory vmFactory = _kernel.Get<IMultiStageViewModelFactory>(); - - var StageInput = vmFactory.GetStageInputViewModel(false) as StageInputViewModel; - var vehicleVm = StageInput.VehicleViewModel as InterimStageBusVehicleViewModel_v2_8; - vehicleVm.Manufacturer = "adsf"; - vehicleVm.ManufacturerAddress = "asdf 123"; - vehicleVm.VIN = "1234567890"; - vehicleVm.Model = "Model"; - vehicleVm.LegislativeClass = LegislativeClass.M3; - vehicleVm.CurbMassChassis = Kilogram.Create(20000); - vehicleVm.GrossVehicleMassRating = Kilogram.Create(20000); - vehicleVm.RegisteredClass = RegistrationClass.I_II; - vehicleVm.VehicleCode = VehicleCode.CC; - vehicleVm.LowEntry = true; - vehicleVm.Height = Meter.Create(2.6); - vehicleVm.NumberPassengerSeatsUpperDeck = 2; - vehicleVm.NumberPassengersStandingLowerDeck = 13; - vehicleVm.NumberPassengerSeatsLowerDeck = 10; - vehicleVm.NumberPassengersStandingUpperDeck = 12; - - //SETADAS - vehicleVm.EngineStopStartNullable = true; - vehicleVm.EcoRollTypeNullable = EcoRollType.WithEngineStop; - vehicleVm.PredictiveCruiseControlNullable = PredictiveCruiseControlType.Option_1_2_3; - vehicleVm.ATEcoRollReleaseLockupClutch = false; - - - - //SETAUxiliaries - var auxVm = vehicleVm.MultistageAuxiliariesViewModel as MultistageAuxiliariesViewModel; - - - auxVm.InteriorLightsLED = true; - auxVm.DayrunninglightsLED = false; - auxVm.PositionlightsLED = false; - auxVm.BrakelightsLED = true; - auxVm.HeadlightsLED = false; - auxVm.SystemConfiguration = BusHVACSystemConfiguration.Configuration2; - auxVm.HeatPumpTypeCoolingDriverCompartment = HeatPumpType.non_R_744_3_stage; - auxVm.HeatPumpTypeCoolingPassengerCompartment = HeatPumpType.non_R_744_4_stage; - auxVm.HeatPumpTypeHeatingDriverCompartment = HeatPumpType.non_R_744_2_stage; - auxVm.HeatPumpTypeHeatingPassengerCompartment = HeatPumpType.non_R_744_continuous; - auxVm.AuxHeaterPower = SIBase<Watt>.Create(50); - auxVm.DoubleGlazing = true; - auxVm.AdjustableAuxiliaryHeater = false; - auxVm.SeparateAirDistributionDucts = false; - - - - - var fileName = TestHelper.GetMethodName() + ".xml"; - StageInput.SaveInputDataExecute(GetFullPath(fileName)); - Assert.True(checkFileNameExists(fileName)); - Assert.AreEqual(GetFullPath(fileName), StageInput.VehicleInputDataFilePath); - - //Check if title is updated - StringAssert.Contains(fileName, StageInput.Title); - - //Check datasource - Assert.NotNull(StageInput.DataSource); - - File.Delete(GetFullPath(fileName)); - } - - - - - - } -} \ No newline at end of file diff --git a/Vecto3GUI2020Test/ViewModelTests/StepViewModelTests.cs b/Vecto3GUI2020Test/ViewModelTests/StepViewModelTests.cs new file mode 100644 index 0000000000000000000000000000000000000000..8cb18eded07ac46cbd6e7cc2b7071eace950acf6 --- /dev/null +++ b/Vecto3GUI2020Test/ViewModelTests/StepViewModelTests.cs @@ -0,0 +1,221 @@ +using System.IO; +using System.Runtime.InteropServices; +using Moq; +using Ninject; +using NUnit.Framework; +using TUGraz.VectoCommon.BusAuxiliaries; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.Configuration; +using VECTO3GUI2020.ViewModel.Implementation; +using VECTO3GUI2020.ViewModel.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.Document; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; +using Vecto3GUI2020Test.Utils; + +namespace Vecto3GUI2020Test.ViewModelTests +{ + [TestFixture] + public class StepViewModelTests + { + private IKernel _kernel; + private MockWindowHelper _windowHelper; + private MockDialogHelper _dialogHelper; + private IMultiStageViewModelFactory _viewModelFactory; + + [SetUp] + public void Setup() + { + _kernel = TestHelper.GetKernel(out _dialogHelper, out _windowHelper); + _viewModelFactory = _kernel.Get<IMultiStageViewModelFactory>(); + } + + [TestCase(true, TestName="Exempted")] + [TestCase(false, TestName="NotExempted")] + public void updateFilePathsWhenSaved(bool exempted) + { + IMultiStageViewModelFactory vmFactory = _kernel.Get<IMultiStageViewModelFactory>(); + + var StageInput = vmFactory.GetCreateNewStepInputViewModel(exempted) as StageInputViewModel; + var vehicleVm = StageInput.VehicleViewModel as InterimStageBusVehicleViewModel; + vehicleVm.Manufacturer = "adsf"; + vehicleVm.ManufacturerAddress = "asdf 123"; + vehicleVm.VIN = "1234567890"; + + var fileName = TestHelper.GetMethodName() + ".xml"; + var fullPath = Path.GetFullPath(fileName); + StageInput.SaveInputDataExecute(fullPath); + AssertHelper.FileExists(fullPath); + Assert.AreEqual(fullPath, StageInput.VehicleInputDataFilePath); + + //Check if title is updated + StringAssert.Contains(fileName, StageInput.Title); + + //Check datasource + Assert.NotNull(StageInput.DataSource); + + File.Delete(fullPath); + } + + [Test] + public void SaveFullStageInput() + { + IMultiStageViewModelFactory vmFactory = _kernel.Get<IMultiStageViewModelFactory>(); + + var StageInput = vmFactory.GetCreateNewStepInputViewModel(false) as StageInputViewModel; + var vehicleVm = StageInput.VehicleViewModel as InterimStageBusVehicleViewModel; + vehicleVm.Manufacturer = "adsf"; + vehicleVm.ManufacturerAddress = "asdf 123"; + vehicleVm.VIN = "1234567890"; + vehicleVm.Model = "Model"; + vehicleVm.LegislativeClass = LegislativeClass.M3; + vehicleVm.CurbMassChassis = Kilogram.Create(20000); + vehicleVm.GrossVehicleMassRating = Kilogram.Create(20000); + vehicleVm.RegisteredClass = RegistrationClass.I_II; + vehicleVm.VehicleCode = VehicleCode.CC; + vehicleVm.LowEntry = true; + vehicleVm.Height = Meter.Create(2.6); + vehicleVm.NumberPassengerSeatsUpperDeck = 2; + vehicleVm.NumberPassengersStandingLowerDeck = 13; + vehicleVm.NumberPassengerSeatsLowerDeck = 10; + vehicleVm.NumberPassengersStandingUpperDeck = 12; + + //SETADAS + vehicleVm.EngineStopStartNullable = true; + vehicleVm.EcoRollTypeNullable = EcoRollType.WithEngineStop; + vehicleVm.PredictiveCruiseControlNullable = PredictiveCruiseControlType.Option_1_2_3; + vehicleVm.ATEcoRollReleaseLockupClutch = false; + + + + //SETAUxiliaries + var auxVm = vehicleVm.MultistageAuxiliariesViewModel as MultistageAuxiliariesViewModel; + + + auxVm.InteriorLightsLED = true; + auxVm.DayrunninglightsLED = false; + auxVm.PositionlightsLED = false; + auxVm.BrakelightsLED = true; + auxVm.HeadlightsLED = false; + auxVm.SystemConfiguration = BusHVACSystemConfiguration.Configuration2; + auxVm.HeatPumpTypeCoolingDriverCompartment = HeatPumpType.non_R_744_3_stage; + auxVm.HeatPumpTypeCoolingPassengerCompartment = HeatPumpType.non_R_744_4_stage; + auxVm.HeatPumpTypeHeatingDriverCompartment = HeatPumpType.non_R_744_2_stage; + auxVm.HeatPumpTypeHeatingPassengerCompartment = HeatPumpType.non_R_744_continuous; + auxVm.AuxHeaterPower = SIBase<Watt>.Create(50); + auxVm.DoubleGlazing = true; + auxVm.AdjustableAuxiliaryHeater = false; + auxVm.SeparateAirDistributionDucts = false; + + + var fileName = TestHelper.GetMethodName() + ".xml"; + var fullPath = Path.GetFullPath(fileName); + StageInput.SaveInputDataExecute(fullPath); + + AssertHelper.FileExists(fileName); + Assert.AreEqual(fullPath, StageInput.VehicleInputDataFilePath); + + //Check if title is updated + StringAssert.Contains(fileName, StageInput.Title); + + //Check datasource + Assert.NotNull(StageInput.DataSource); + + File.Delete(fullPath); + + _dialogHelper.AssertNoErrorDialogs(); + + } + + + + [Test] + public void CreateStepInput() + { + var stepInput = _viewModelFactory.GetCreateNewStepInputViewModel(false) as StageInputViewModel; + Assert.NotNull(stepInput.VehicleViewModel); + Assert.NotNull(stepInput.VehicleViewModel.MultistageAirdragViewModel); + Assert.NotNull(stepInput.VehicleViewModel.MultistageAuxiliariesViewModel); + Assert.NotNull(stepInput.Architecture == CompletedBusArchitecture.Conventional); + } + + [Test] + public void CreateStepInputForAllArchitectures([Values] CompletedBusArchitecture arch) + { + + var stepInput = _viewModelFactory.GetCreateNewStepInputViewModel(false) as StageInputViewModel; + Assert.NotNull(stepInput.VehicleViewModel); + + var oldVm = stepInput.VehicleViewModel; + if (arch == stepInput.Architecture) { + Assert.Pass("Nothing to see here ..."); + } + stepInput.Architecture = arch; + Assert.NotNull(stepInput.VehicleViewModel); + Assert.AreNotSame(oldVm, stepInput.VehicleViewModel); + Assert.That(stepInput.Title.Contains(arch.ToString())); + } + + [Test] + public void SwitchArchitectures([Values] CompletedBusArchitecture from, + [Values] CompletedBusArchitecture to) + { + + if (from == to) { + Assert.Pass("Nothing to see here ..."); + } + var stepInput = _viewModelFactory.GetCreateNewStepInputViewModel(false) as StageInputViewModel; + Assert.NotNull(stepInput.VehicleViewModel); + + + stepInput.Architecture = from; + var oldVm = stepInput.VehicleViewModel; + Assert.NotNull(stepInput.VehicleViewModel); + + stepInput.Architecture = to; + var newVm = stepInput.VehicleViewModel; + Assert.NotNull(newVm); + Assert.AreNotSame(oldVm, newVm); + Assert.That(stepInput.Title.Contains(to.ToString())); + } + + + [Test] + public void CreateAndSaveMinimalInput([Values] CompletedBusArchitecture arch, [Values] bool addAuxInput, [Values] bool loadAirdrag, [Values(TestData.airdragLoadTestFile, TestData.airdragLoadTestFilev2)] string airdragFile) + { + var stepInput = _viewModelFactory.GetCreateNewStepInputViewModel(false) as StageInputViewModel; + Assert.NotNull(stepInput.VehicleViewModel); + + var oldVm = stepInput.VehicleViewModel; + stepInput.Architecture = arch; + Assert.NotNull(stepInput.VehicleViewModel); + Assert.That(stepInput.Title.Contains(arch.ToString())); + + + var vehicleVm = stepInput.VehicleViewModel as InterimStageBusVehicleViewModel; + vehicleVm.Manufacturer = $"A {arch}_manufacturer"; + vehicleVm.VIN = "1234567890"; + vehicleVm.Manufacturer = $"{arch}-avenue 42"; + + + if (addAuxInput && arch != CompletedBusArchitecture.Exempted) { + var auxVm = vehicleVm.MultistageAuxiliariesViewModel as MultistageAuxiliariesViewModel; + auxVm.BrakelightsLED = true; + } + + if (loadAirdrag && arch != CompletedBusArchitecture.Exempted) { + var airdragVm = vehicleVm.MultistageAirdragViewModel as MultistageAirdragViewModel; + airdragVm.LoadAirdragFile(Path.GetFullPath(airdragFile)); + + } + + stepInput.SaveInputDataExecute($"{arch}_step_input.xml"); + _dialogHelper.AssertNoErrorDialogs(); + } + + + } +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/ViewModelTests/VIFTests.cs b/Vecto3GUI2020Test/ViewModelTests/VIFTests.cs index da2385bc41057e53bea7e1e3d0eb9d67b56ef7f7..5f7c3ead888f0586ba400379a34f627c49f80e89 100644 --- a/Vecto3GUI2020Test/ViewModelTests/VIFTests.cs +++ b/Vecto3GUI2020Test/ViewModelTests/VIFTests.cs @@ -18,6 +18,8 @@ using VECTO3GUI2020.ViewModel.Implementation; using VECTO3GUI2020.ViewModel.Implementation.Common; using VECTO3GUI2020.ViewModel.Interfaces; using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; +using Vecto3GUI2020Test.Utils; namespace Vecto3GUI2020Test.ViewModelTests { @@ -25,31 +27,29 @@ namespace Vecto3GUI2020Test.ViewModelTests public class VIFTests : ViewModelTestBase { - public const string _finalVif = "vecto_multistage_conventional_final_vif.VIF_Report_1.xml"; - public const string _vectoMultistageOneStage = "vecto_multistage_consolidated_one_stage.xml"; + [Test] public void loadPrimaryVehicleOnlyAndCreateNewVIF() { - var multistagevm = LoadFileFromTestDirectory(primary_vehicle_only).MultiStageJobViewModel as MultiStageJobViewModel_v0_1; + + var multistagevm = LoadFileFromPath(TestData.primary_vehicle_only).MultiStageJobViewModel as MultiStageJobViewModel_v0_1; var stage = multistagevm.ManufacturingStageViewModel.StepCount; - Assert.AreEqual(2, stage); + Assert.AreEqual(2, stage, "Should the first manufacturing stage be labeled as \"1\" or \"2\""); //Set Mandatory Fields var vehicle = - multistagevm.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel_v2_8; + multistagevm.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel; vehicle.ManufacturerAddress = "Address"; vehicle.Manufacturer = "Manufacturer"; vehicle.VIN = "VIN12345678"; var writer = GetFileOutputVIFWriter(multistagevm); - deleteFile(writer.XMLMultistageReportFileName); - SetMockDialogHelper(null, writer.XMLMultistageReportFileName); - _kernel.Rebind<IDialogHelper>().ToConstant(SetMockDialogHelper(null, writer.XMLMultistageReportFileName).Object); + File.Delete(writer.XMLMultistageReportFileName); - multistagevm.SaveVif(multistagevm, writer); + multistagevm.SaveVif(multistagevm, writer, _mockDialogHelper); Assert.IsTrue(File.Exists(writer.XMLMultistageReportFileName)); @@ -62,14 +62,14 @@ namespace Vecto3GUI2020Test.ViewModelTests [Values("manufacturer")] string manufacturer, [Values(LegislativeClass.M3)] LegislativeClass legCategory) { - var multistagevm = LoadFileFromTestDirectory(primary_vehicle_only).MultiStageJobViewModel as MultiStageJobViewModel_v0_1; + var multistagevm = LoadFileFromPath(TestData.primary_vehicle_only).MultiStageJobViewModel as MultiStageJobViewModel_v0_1; var stage = multistagevm.ManufacturingStageViewModel.StepCount; Assert.AreEqual(2, stage); //Set Necessary Fields var vehicleVm = - multistagevm.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel_v2_8; + multistagevm.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel; vehicleVm.Manufacturer = "adsf"; vehicleVm.ManufacturerAddress = "asdf 123"; @@ -114,7 +114,7 @@ namespace Vecto3GUI2020Test.ViewModelTests auxVm.AdjustableAuxiliaryHeater = false; auxVm.SeparateAirDistributionDucts = false; - var resultFile = multistagevm.SaveVif(GetFullPath( + var resultFile = multistagevm.SaveVif(Path.GetFullPath( "completed_final" + ".xml")); @@ -128,12 +128,10 @@ namespace Vecto3GUI2020Test.ViewModelTests [TestCase(false, 0, TestName="Without Airdrag Component")] public void CreateCompletedFinalVIFWithAirdrag(bool loadAirdrag, int airdragVersion) { - GetMockDialogHelper().Setup(dialogHelper => dialogHelper.ShowMessageBox(It.IsAny<string>(), - It.IsAny<string>(), MessageBoxButton.YesNo, It.IsAny<MessageBoxImage>())).Returns(MessageBoxResult.No); - var multistagevm = LoadFileFromTestDirectory(_finalVif); + var multistagevm = LoadFileFromPath(TestData.FinalVif); - var VehicleViewModel = multistagevm.MultiStageJobViewModel.ManufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel_v2_8; + var VehicleViewModel = multistagevm.MultiStageJobViewModel.ManufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel; VehicleViewModel.Manufacturer = "Manufacturer"; VehicleViewModel.ManufacturerAddress = "Manufacturer Address"; @@ -150,15 +148,15 @@ namespace Vecto3GUI2020Test.ViewModelTests if (loadAirdrag) { - var airdragTestFile = airdragVersion == 2 ? airdragLoadTestFilev2 : airdragLoadTestFile; - Assert.IsTrue(VehicleViewModel.MultistageAirdragViewModel.LoadAirdragFile(GetTestDataPath(airdragTestFile))); + var airdragTestFile = airdragVersion == 2 ? TestData.airdragLoadTestFilev2 : TestData.airdragLoadTestFile; + Assert.IsTrue(VehicleViewModel.MultistageAirdragViewModel.LoadAirdragFile(Path.GetFullPath(airdragTestFile))); } - var resultFile = multistagevm.MultiStageJobViewModel.SaveVif(GetFullPath( + var resultFile = multistagevm.MultiStageJobViewModel.SaveVif(Path.GetFullPath( "completed_final" + ".xml")); + _mockDialogHelper.AssertNoErrorDialogs(); - - var jobListVm = _kernel.Get<IJobListViewModel>(); + var jobListVm = _kernel.Get<IJobListViewModel>(); Assert.That(() => jobListVm.Jobs.Count, Is.EqualTo(2)); Assert.IsTrue(jobListVm.Jobs[1].CanBeSimulated, String.Join("\n",((AdditionalJobInfoViewModelMultiStage) jobListVm.Jobs[1].AdditionalJobInfoVm).InvalidEntries)); @@ -167,11 +165,11 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void CreateCompletedExemptedVif() { - var multistagevm = LoadFileFromTestDirectory(exempted_primary_vif).MultiStageJobViewModel as MultiStageJobViewModel_v0_1; + var multistagevm = LoadFileFromPath(TestData.exempted_primary_vif).MultiStageJobViewModel as MultiStageJobViewModel_v0_1; var jobListVm = _kernel.Get<IJobListViewModel>(); var vehicleVm = - multistagevm.ManufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel_v2_8; + multistagevm.ManufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel; Assert.IsTrue(vehicleVm.ExemptedVehicle); vehicleVm.Manufacturer = "Test Manufacturer 1"; @@ -196,8 +194,8 @@ namespace Vecto3GUI2020Test.ViewModelTests var vifName = multistagevm.SaveVif(TestHelper.GetMethodName() + ".xml"); Assert.NotNull(vifName); - WriteLine($"Written to {vifName}"); - Assert.IsTrue(checkFileNameExists(vifName)); + TestContext.WriteLine($"Written to {vifName}"); + AssertHelper.FileExists(vifName); Assert.AreEqual(2, jobListVm.Jobs.Count); @@ -208,11 +206,11 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void CreateIncompletedExemptedVif() { - var multistagevm = LoadFileFromTestDirectory(exempted_primary_vif).MultiStageJobViewModel as MultiStageJobViewModel_v0_1; + var multistagevm = LoadFileFromPath(TestData.exempted_primary_vif).MultiStageJobViewModel as MultiStageJobViewModel_v0_1; var jobListVm = _kernel.Get<IJobListViewModel>(); var vehicleVm = - multistagevm.ManufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel_v2_8; + multistagevm.ManufacturingStageViewModel.VehicleViewModel as InterimStageBusVehicleViewModel; Assert.IsTrue(vehicleVm.ExemptedVehicle); vehicleVm.Manufacturer = "Test Manufacturer 1"; @@ -235,8 +233,8 @@ namespace Vecto3GUI2020Test.ViewModelTests var vifName = multistagevm.SaveVif(TestHelper.GetMethodName() + ".xml"); Assert.NotNull(vifName); - WriteLine($"Written to {vifName}"); - Assert.IsTrue(checkFileNameExists(vifName)); + TestContext.WriteLine($"Written to {vifName}"); + AssertHelper.FileExists(vifName); Assert.AreEqual(2, jobListVm.Jobs.Count); @@ -250,7 +248,7 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void TestAirdragLoadAndSave() { - var newMultistageJobViewModel = LoadFileFromTestDirectory(consolidated_multiple_stages); + var newMultistageJobViewModel = LoadFileFromPath(TestData.consolidated_multiple_stages); Assert.NotNull(newMultistageJobViewModel.MultiStageJobViewModel); var manstageVehicleViewModel = newMultistageJobViewModel.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as IMultistageVehicleViewModel; @@ -262,12 +260,11 @@ namespace Vecto3GUI2020Test.ViewModelTests var multiStageViewModel = newMultistageJobViewModel.MultiStageJobViewModel as MultiStageJobViewModel_v0_1; Assert.NotNull(multiStageViewModel); - SetMockDialogHelper(stageInputFullSample, null); - multiStageViewModel.ManufacturingStageViewModel.LoadStageInputData(GetTestDataPath(stageInputFullSample)); + multiStageViewModel.ManufacturingStageViewModel.LoadStageInputData(Path.GetFullPath(TestData.stageInputFullSample)); var vehicle = - multiStageViewModel.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel_v2_8; + multiStageViewModel.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel; vehicle.ManufacturerAddress = "Address"; vehicle.Manufacturer = "Manufacturer"; vehicle.VIN = "VIN12345678"; @@ -276,10 +273,10 @@ namespace Vecto3GUI2020Test.ViewModelTests var writer = GetFileOutputVIFWriter(multiStageViewModel); - deleteFile(writer.XMLMultistageReportFileName); - SetMockDialogHelper(null, writer.XMLMultistageReportFileName); + File.Delete(writer.XMLMultistageReportFileName); - multiStageViewModel.SaveVif(multiStageViewModel, writer); + multiStageViewModel.SaveVif(multiStageViewModel, writer, _mockDialogHelper); + _mockDialogHelper.AssertNoErrorDialogs(); var validator = new XMLValidator(XmlReader.Create(writer.XMLMultistageReportFileName)); Assert.True(validator.ValidateXML(TUGraz.VectoCore.Utils.XmlDocumentType.MultistepOutputData)); @@ -288,12 +285,11 @@ namespace Vecto3GUI2020Test.ViewModelTests private FileOutputVIFWriter GetFileOutputVIFWriter(IMultiStageJobViewModel multistageViewModel) { - var outputFileName = primary_vehicle_only.Replace(".xml", "_vif_output_mandatory_fields.xml"); - var outputFilePath = GetFullPath(outputFileName); + var outputFileName = TestData.primary_vehicle_only.Replace(".xml", "_vif_output_mandatory_fields.xml"); + var outputFilePath = Path.GetFullPath(outputFileName); var currentStageCount = multistageViewModel.MultistageJobInputData.JobInputData.ManufacturingStages?.Count ?? 0; return new FileOutputVIFWriter(outputFilePath, currentStageCount); } - } } diff --git a/Vecto3GUI2020Test/ViewModelTests/VehicleViewModelTests.cs b/Vecto3GUI2020Test/ViewModelTests/VehicleViewModelTests.cs index e733421e900bf80bfa4249cccb61011b3c006638..b87145048f14d137a51b8bc06e9003662db436e9 100644 --- a/Vecto3GUI2020Test/ViewModelTests/VehicleViewModelTests.cs +++ b/Vecto3GUI2020Test/ViewModelTests/VehicleViewModelTests.cs @@ -1,4 +1,6 @@ -using NUnit.Framework; +using System; +using System.Diagnostics; +using NUnit.Framework; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Utils; using VECTO3GUI2020.ViewModel.MultiStage.Implementation; @@ -11,10 +13,10 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void restoreValuesWhenEditingAgain() { - var vm = LoadFileFromTestDirectory(primary_vehicle_only); + var vm = LoadFileFromPath(TestData.primary_vehicle_only); var vehicleVM = vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as - InterimStageBusVehicleViewModel_v2_8; + InterimStageBusVehicleViewModel; var enteredString = "test"; var modelParam = vehicleVM.ParameterViewModels[nameof(vehicleVM.Model)]; //Null after loading @@ -63,10 +65,10 @@ namespace Vecto3GUI2020Test.ViewModelTests public void SIDummyCreation() { - var vm = LoadFileFromTestDirectory(primary_vehicle_only); + var vm = LoadFileFromPath(TestData.primary_vehicle_only); var vehicleVM = vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as - InterimStageBusVehicleViewModel_v2_8; + InterimStageBusVehicleViewModel; Assert.IsNull(vehicleVM.CurbMassChassis?.Value()); var curbMassParameter = vehicleVM.ParameterViewModels[nameof(vehicleVM.CurbMassChassis)]; @@ -83,12 +85,12 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void NoErrorAfterDataLoading() { - var vm = LoadFileFromTestDirectory(primary_vehicle_only); + var vm = LoadFileFromPath(TestData.primary_vehicle_only); var vehicleVM = vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as - InterimStageBusVehicleViewModel_v2_8; + InterimStageBusVehicleViewModel; var vmConc = vm.MultiStageJobViewModel as MultiStageJobViewModel_v0_1; - vmConc.ManufacturingStageViewModel.LoadStageInputData(stageInputFullSample); + vmConc.ManufacturingStageViewModel.LoadStageInputData(TestData.stageInputFullSample); Assert.IsFalse(vmConc.ManufacturingStageViewModel.VehicleViewModel.HasErrors); } @@ -99,12 +101,12 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void LoadPrimaryAndEdit() { - var vm = LoadFileFromTestDirectory(primary_vehicle_only); + var vm = LoadFileFromPath(TestData.primary_vehicle_only); Assert.NotNull(vm); var vehicleViewModel = vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as - InterimStageBusVehicleViewModel_v2_8; + InterimStageBusVehicleViewModel; var vehicleData = vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle; @@ -125,23 +127,37 @@ namespace Vecto3GUI2020Test.ViewModelTests [Test] public void ConsolidatedADASandTPMLMFromPrimaryVehicle() { + - var vm = LoadFileFromTestDirectory(primary_vehicle_only); + var vm = LoadFileFromPath(TestData.primary_vehicle_only); Assert.NotNull(vm); var vehicleViewModel = - vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel_v2_8; + vm.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel; - Assert.NotNull(vm.MultiStageJobViewModel.ManufacturingStages); - Assert.IsNotEmpty(vm.MultiStageJobViewModel.ManufacturingStages); + //Assert.NotNull(vm.MultiStageJobViewModel.ManufacturingStages); + //Assert.IsNotEmpty(vm.MultiStageJobViewModel.ManufacturingStages); Assert.NotNull(vehicleViewModel.ConsolidatedVehicleData); var consolidatedADAS = vehicleViewModel.ConsolidatedVehicleData.ADAS; + + var primaryAdas = vm.MultiStageJobViewModel.PrimaryVehicle.Vehicle.ADAS; Assert.NotNull(consolidatedADAS); + Assert.NotNull(primaryAdas); + Assert.AreEqual(primaryAdas.ATEcoRollReleaseLockupClutch, consolidatedADAS.ATEcoRollReleaseLockupClutch); + Assert.AreEqual(primaryAdas.EcoRoll, consolidatedADAS.EcoRoll); + Assert.AreEqual(primaryAdas.EngineStopStart, consolidatedADAS.EngineStopStart); + Assert.AreEqual(primaryAdas.PredictiveCruiseControl, consolidatedADAS.PredictiveCruiseControl); + + + + Assert.NotNull(vehicleViewModel.ConsolidatedVehicleData.GrossVehicleMassRating); + Assert.AreEqual(vm.MultiStageJobViewModel.PrimaryVehicle.Vehicle.GrossVehicleMassRating, vehicleViewModel.ConsolidatedVehicleData.GrossVehicleMassRating); } + } } diff --git a/Vecto3GUI2020Test/ViewModelTests/ViewModelTestBase.cs b/Vecto3GUI2020Test/ViewModelTests/ViewModelTestBase.cs index a041a6339fcb9d3ccae57f0e3f6788417098fd34..06239d9eb9a3349bf3f9edf30aa0066381ee41a1 100644 --- a/Vecto3GUI2020Test/ViewModelTests/ViewModelTestBase.cs +++ b/Vecto3GUI2020Test/ViewModelTests/ViewModelTestBase.cs @@ -12,161 +12,42 @@ using VECTO3GUI2020.Helper; using VECTO3GUI2020.Ninject; using VECTO3GUI2020.Ninject.Vehicle; using VECTO3GUI2020.ViewModel.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.Document; using VECTO3GUI2020.ViewModel.MultiStage.Implementation; using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; +using Vecto3GUI2020Test.Utils; namespace Vecto3GUI2020Test { public class ViewModelTestBase { - protected string TestDataFullPath; - protected string SourceDirectoryRoot; - protected string prevDirectory; - protected const string consolidated_multiple_stages = "vecto_multistage_consolidated_multiple_stages.xml"; - protected const string consolidated_multiple_stages_airdrag = "vecto_multistage_consolidated_multiple_stages_airdrag.xml"; - protected const string consolidated_multiple_stages_hev = "vecto_multistage_consolidated_multiple_stages_hev.xml"; - protected const string consolidated_one_stage = "vecto_multistage_consolidated_one_stage.xml"; - protected const string primary_vehicle_only = "vecto_multistage_primary_vehicle_only.xml"; - protected const string exempted_primary_vif = "exempted_primary_heavyBus.VIF.xml"; - protected const string stageInputFullSample = "vecto_vehicle-stage_input_full-sample.xml"; - protected const string airdragLoadTestFile = "AirdragLoadTestFile.xml"; - protected const string airdragLoadTestFilev2 = "AirdragLoadTestFilev2.xml"; //protected IXMLInputDataReader xmlInputReader; protected IKernel _kernel; - private Mock<IDialogHelper> _mockDialogHelper; - - + protected MockDialogHelper _mockDialogHelper; protected TestHelper _testHelper; - [OneTimeSetUp] - public void OneTimeSetup() - { - prevDirectory = Environment.CurrentDirectory; - SourceDirectoryRoot = Directory.GetParent(prevDirectory).Parent.Parent.FullName; - TestDataFullPath = Path.Combine(SourceDirectoryRoot + "\\Testdata\\"); - } - - - [SetUp] public void SetUp() { - _kernel = new StandardKernel( - new VectoNinjectModule(), - new JobEditModule(), - new ComponentModule(), - new DocumentModule(), - new XMLWriterFactoryModule(), - new FactoryModule(), - new MultistageModule(), - new Vecto3GUI2020Module() - ); - //xmlInputReader = _kernel.Get<IXMLInputDataReader>(); - _kernel.Rebind<IDialogHelper>().ToConstant(SetMockDialogHelper().Object); - _kernel.Rebind<IWindowHelper>().ToConstant(GetMockWindowHelper()); + _kernel = TestHelper.GetKernel(out _mockDialogHelper, out _); _testHelper = new TestHelper(_kernel.Get<IXMLInputDataReader>()); - - - SetOutputDirectory(); - } - - private void SetOutputDirectory() - { - - prevDirectory = Environment.CurrentDirectory; - SourceDirectoryRoot = Directory.GetParent(prevDirectory).Parent.Parent.FullName; - TestDataFullPath = Path.GetFullPath(@"Testdata\"); - - - var className = TestContext.CurrentContext.Test.ClassName.Replace("Vecto3GUI2020Test.", ""); - var testName = TestContext.CurrentContext.Test.Name; - var invalidPathChars = Path.GetInvalidPathChars(); - foreach (var invalidPathChar in invalidPathChars) { - testName = testName.Replace(invalidPathChar, '_'); - } - - var testOutputDirPath = Path.Combine(SourceDirectoryRoot + @"\Testdata\output\" + className + "\\" + testName); - - //Create output directory - - if (Directory.Exists(testOutputDirPath)) { - Directory.Delete(testOutputDirPath, true); - } - Directory.CreateDirectory(testOutputDirPath); - _kernel.Get<ISettingsViewModel>().DefaultOutputPath = testOutputDirPath; - Directory.SetCurrentDirectory(testOutputDirPath); - - //var currentContext = TestContext.CurrentContext; - - //var outputPath = Path.GetFullPath(TestDataDirPath + CurrentTestOutputPath); - //TestContext.CurrentContext.Test.Name = currentContext. - //var SettingsVm = _kernel.Get<ISettingsViewModel>(); - //SettingsVm.DefaultOutputPath = - } - - protected string GetFullPath(string fileName) - { - return Path.GetFullPath(fileName); - } - - private IWindowHelper GetMockWindowHelper() - { - Mock<IWindowHelper> mockWindowHelper = new Mock<IWindowHelper>(); - mockWindowHelper.Setup(windowHelper => windowHelper.ShowWindow(It.IsAny<object>())) - .Callback<object>((obj) => WriteLine($"Window containing {obj.GetType().ToString()} was opened")); - - return mockWindowHelper.Object; - } - - - [TearDown] - public void TearDown() - { - _kernel.Dispose(); - _kernel = null; - - Directory.SetCurrentDirectory(prevDirectory); - } - - public bool checkFileNameExists(string fileName) - { - var filePath = Path.GetFullPath(fileName); - return checkFilePathExists(filePath); - } - - public bool checkFilePathExists(string filePath) - { - var exists = File.Exists(filePath); - if (exists) - { - Console.WriteLine(filePath + @" exists"); - } - else - { - Console.WriteLine(filePath + @" not existing"); - } - - return exists; - } - - public void deleteFile(string fileName) - { - var filePath = Path.GetFullPath(fileName); - File.Delete(fileName); } public virtual NewMultiStageJobViewModel LoadFileFromPath(string filePath) { + AssertHelper.FileExists(filePath); + var documentFactory = _kernel.Get<IDocumentViewModelFactory>(); + var newMultistageJobViewModel = _kernel.Get<NewMultiStageJobViewModel>(); - WriteLine("Loading" + filePath); + TestContext.WriteLine("Loading " + filePath); newMultistageJobViewModel.AddVifFile(filePath); Assert.NotNull(newMultistageJobViewModel.MultiStageJobViewModel); - var manstageVehicleViewModel = newMultistageJobViewModel.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel_v2_8; + var manstageVehicleViewModel = newMultistageJobViewModel.MultiStageJobViewModel.ManufacturingStageViewModel.Vehicle as InterimStageBusVehicleViewModel; Assert.NotNull(manstageVehicleViewModel); //Assert.AreEqual(GetTestDataPath(fileName), newMultistageJobViewModel.VifPath); @@ -176,92 +57,10 @@ namespace Vecto3GUI2020Test var auxiliariesViewModel = manstageVehicleViewModel.MultistageAuxiliariesViewModel; Assert.NotNull(auxiliariesViewModel); - var airdragViewModel = (manstageVehicleViewModel as InterimStageBusVehicleViewModel_v2_8)?.MultistageAirdragViewModel; + var airdragViewModel = (manstageVehicleViewModel as InterimStageBusVehicleViewModel)?.MultistageAirdragViewModel; Assert.NotNull(airdragViewModel); } return newMultistageJobViewModel; } - - public virtual NewMultiStageJobViewModel LoadFileFromTestDirectory(string fileName) - { - var filePath = GetTestDataPath(fileName); - - return LoadFileFromPath(filePath); - } - - - protected virtual Mock<IDialogHelper> SetMockDialogHelper(string fileToLoad = null, string fileToSave = null) - { - if (_mockDialogHelper == null) { - _mockDialogHelper = new Mock<IDialogHelper>(); - _mockDialogHelper.Setup(dialogHelper => dialogHelper.ShowMessageBox(It.IsAny<string>(), - It.IsAny<string>(), - It.IsAny<MessageBoxButton>(), - It.IsAny<MessageBoxImage>())).Returns(MessageBoxResult.OK) - .Callback<string, string, MessageBoxButton, MessageBoxImage>(( - (message, caption, button, image) => { - TestContext.WriteLine($"{caption}\n {message}"); - })); - - _mockDialogHelper.Setup(dialogHelper => - dialogHelper.ShowMessageBox(It.IsAny<string>(), It.IsAny<string>())) - .Callback<string, string>((message, caption) => - TestContext.WriteLine($"{{caption}}\n {message}")); - - _mockDialogHelper.Setup(dialogHelper => - dialogHelper.ShowErrorMessage(It.IsAny<string>(), It.IsAny<string>())) - .Callback<string, string>((message, caption) => - TestContext.WriteLine($"{{caption}}\n {message}")); - - _mockDialogHelper.Setup(dialogHelper => - dialogHelper.ShowErrorMessage(It.IsAny<string>())) - .Callback<string>((message) => - TestContext.WriteLine($"{{Error}}\n {message}")); - - - } - if (fileToLoad != null) { - var filePath = fileToLoad; - - Assert.NotNull(filePath); - _mockDialogHelper.Setup(dialogHelper => dialogHelper.OpenXMLFileDialog(It.IsAny<string>())).Returns(filePath); - _mockDialogHelper.Setup(dialogHelper => dialogHelper.OpenXMLFileDialog()).Returns(filePath); - - TestContext.WriteLine($"Created MOCKDIALOGHELPER, returns {filePath} for OpenXMLFileDialog()"); - } - - if (fileToSave != null) { - var filePath = fileToLoad; - _mockDialogHelper.Setup(dialogHelper => - dialogHelper.SaveToXMLDialog(It.IsAny<string>())).Returns(filePath); - _mockDialogHelper.Setup(dialogHelper => - dialogHelper.SaveToXMLDialog(null)).Returns(filePath); - - TestContext.WriteLine($"Created MOCKDIALOGHELPER, returns {filePath} for SaveToXMLFileDialog()"); - } - - - return _mockDialogHelper; - } - - protected Mock<IDialogHelper> GetMockDialogHelper() - { - return _mockDialogHelper; - } - - protected virtual string GetTestDataPath(string fileName) - { - var path = Path.Combine(TestDataFullPath + fileName); - return path; - } - - protected void Write(string outputMessage) - { - TestContext.Write(outputMessage); - } - protected void WriteLine(string outputMessage) - { - TestContext.WriteLine(outputMessage); - } } } \ No newline at end of file diff --git a/Vecto3GUI2020Test/XML/XMLInput/AirdragTest.cs b/Vecto3GUI2020Test/XML/XMLInput/AirdragTest.cs new file mode 100644 index 0000000000000000000000000000000000000000..4db9c2b48cd458dc906b3444d7cdffda9eced714 --- /dev/null +++ b/Vecto3GUI2020Test/XML/XMLInput/AirdragTest.cs @@ -0,0 +1,46 @@ +using System.IO; +using System.Runtime.Intrinsics; +using Ninject; +using Ninject.Injection; +using NUnit.Framework; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Factory; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader; +using Vecto3GUI2020Test.Utils; + +namespace Vecto3GUI2020Test.XML.XMLInput; + +[TestFixture] +public class AirdragTest +{ + private IKernel _kernel; + private IXMLInputDataReader _inputDataReader; + private IXMLComponentInputReader _componentReader; + private IDeclarationInjectFactory _injectFactory; + + [SetUp] + public void Setup() + { + _kernel = TestHelper.GetKernel(); + _inputDataReader = _kernel.Get<IXMLInputDataReader>(); + _componentReader = _kernel.Get<IXMLComponentInputReader>(); + _injectFactory = _kernel.Get<IDeclarationInjectFactory>(); + } + + [TestCase(TestData.airdragLoadTestFile, "1.0")] + [TestCase(TestData.airdragLoadTestFilev2, "2.0")] + public void LoadAirdragFile(string fileName, string expVersion) + { + var filePath = Path.GetFullPath(fileName); + AssertHelper.FileExists(filePath); + + + IAirdragDeclarationInputData airdragData = _componentReader.CreateAirdrag(fileName); + Assert.NotNull(airdragData); + Assert.NotNull(airdragData.DataSource); + Assert.AreEqual("AirDragDataDeclarationType",airdragData.DataSource.Type); + Assert.NotNull(airdragData.DigestValue.Reference); + Assert.AreEqual(expVersion, airdragData.DataSource.SourceVersion); + } +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/XML/XMLWritingTest/XMLCompletedBusVehicleWriterTest.cs b/Vecto3GUI2020Test/XML/XMLWritingTest/XMLCompletedBusVehicleWriterTest.cs new file mode 100644 index 0000000000000000000000000000000000000000..098d1fc90f6cc8eaa9b5fa7e9c8336da9b337f9c --- /dev/null +++ b/Vecto3GUI2020Test/XML/XMLWritingTest/XMLCompletedBusVehicleWriterTest.cs @@ -0,0 +1,262 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Windows.Documents; +using System.Xml; +using System.Xml.Linq; +using Castle.Components.DictionaryAdapter.Xml; +using Ninject; +using NUnit.Framework; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCore.InputData.FileIO.XML; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider.v24; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.Util.XML; +using VECTO3GUI2020.Util.XML.Vehicle; +using Vecto3GUI2020Test.MockInput; +using Vecto3GUI2020Test.Utils; + +namespace Vecto3GUI2020Test.XML.XMLWritingTest; + +[TestFixture] +public class XMLCompletedBusVehicleWriterTest +{ + private MockDialogHelper _mockDialogHelper; + private IKernel _kernel; + private IXMLWriterFactory _xmlWriterFactory; + + + + + [OneTimeSetUp()] + public void Setup() + { + _kernel = TestHelper.GetKernel(out _mockDialogHelper, out _); + _xmlWriterFactory = _kernel.Get<IXMLWriterFactory>(); + _xmlInputDataReader = _kernel.Get<IXMLInputDataReader>(); + } + + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationConventionalCompletedBusDataProviderV24.XSD_TYPE, typeof(XMLCompletedBusVehicleWriterConventional))] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationExemptedCompletedBusDataProviderV24.XSD_TYPE, typeof(XMLCompletedBusVehicleWriterExempted))] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationHevCompletedBusDataProviderV24.XSD_TYPE, typeof(XMLCompletedBusVehicleWriterHEV))] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationPEVCompletedBusDataProviderV24.XSD_TYPE, typeof(XMLCompletedBusVehicleWriterPEV))] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLDeclarationIepcCompletedBusDataProviderV24.XSD_TYPE, typeof(XMLCompletedBusVehicleWriterIEPC))] + public void WriteVehicle(string version, string type, Type expectedWriter) + { + + var vehicleData = MockVehicle.GetMockVehicle(type, version); + var writer = _xmlWriterFactory.CreateVehicleWriter(vehicleData); + Assert.NotNull(writer); + Assert.AreEqual(expectedWriter, writer.GetType()); + + var xElement = writer.GetElement(); + + + + + + var doc = CreateDocumentWithVehicle(xElement); + WriteDocument(doc, out _); + + } + protected string LocalSchemaLocation = @"V:\VectoCore\VectoCore\Resources\XSD\"; + private IXMLInputDataReader _xmlInputDataReader; + + public XDocument CreateDocumentWithVehicle(XElement vehicleElement) + { + + var schemaVersion = "2.0"; + var xDocument = new XDocument(); + + var xElement = new XElement(XMLNamespaces.Tns_v20 + XMLNames.VectoInputDeclaration); + xDocument.Add(xElement); + + xElement.Add(new XAttribute("schemaVersion", schemaVersion)); + xElement.Add(new XAttribute(XNamespace.Xmlns + "xsi", XMLNamespaces.Xsi.NamespaceName)); + xElement.Add(new XAttribute(XNamespace.Xmlns + "tns", XMLNamespaces.Tns_v20)); + xElement.Add(new XAttribute(XNamespace.Xmlns + "v2.0", XMLNamespaces.V20)); + xElement.Add(new XAttribute(XMLNamespaces.Xsi + "schemaLocation", + $"{XMLNamespaces.DeclarationRootNamespace} {LocalSchemaLocation}VectoDeclarationJob.xsd")); + xElement.Add(vehicleElement); + return xDocument; + } + + + public static List<string> GetXMLJobs(params string[] path) + { + List<string> files = new List<string>(); + foreach (var pathItem in path) { + files.AddRange(GetFiles(pathItem, "*.xml")); + } + + return files; + } + + public static List<string> GetFiles(string path, string searchPattern) + { + var dirPath = Path.GetFullPath(path); + List<string> vectoJobs = new List<string>(); + foreach (var fileName in Directory.EnumerateFiles(dirPath, searchPattern, SearchOption.AllDirectories)) + { + vectoJobs.Add(fileName); + } + return vectoJobs; + } + + + + [TestCaseSource(nameof(GetDistributedCompletedVehicleFiles))] + [TestCaseSource(nameof(GetCompletedBusDistributedSchema24))] + [TestCase("TestData\\XML\\SchemaVersion2.4\\Distributed\\CompletedBus\\Conventional_completedBus_1.xml", TestName="Conventional")] + public void LoadAndWriteFiles(string file) + { + var stepInput = _xmlInputDataReader.CreateDeclaration(file); + Assert.NotNull(stepInput); + + var writer = _xmlWriterFactory.CreateVehicleWriter(stepInput.JobInputData.Vehicle); + Assert.NotNull(writer); + + + var document = CreateDocumentWithVehicle(writer.GetElement()); + WriteDocument(document, out var result); + + IDeclarationInputDataProvider writtenInput; + using (var tr = new StringReader(result)) { + using (var xmlReader = new XmlTextReader(tr)) + writtenInput = _xmlInputDataReader.CreateDeclaration(xmlReader); + } + + + Compare(stepInput, writtenInput); + } + + public void Compare(IDeclarationInputDataProvider a, IDeclarationInputDataProvider b) + { + var vehA = a.JobInputData.Vehicle; + var vehB = b.JobInputData.Vehicle; + Assert.AreEqual(vehA.Manufacturer, vehB.Manufacturer); + Assert.AreEqual(vehA.ManufacturerAddress, vehB.ManufacturerAddress); + //TODO: add all relevant properties + + + Assert.AreEqual(vehA.Components?.AirdragInputData?.DigestValue.DigestValue, vehB.Components?.AirdragInputData?.DigestValue.DigestValue); + + + CompareBusAux(vehA.Components?.BusAuxiliaries, vehB.Components?.BusAuxiliaries); + } + + private void CompareBusAux(IBusAuxiliariesDeclarationData busAuxA, IBusAuxiliariesDeclarationData busAuxB) + { + if (busAuxA == null && busAuxB == null) { + return; + } + + Assert.NotNull(busAuxB); + Assert.NotNull(busAuxA); + + CompareHVAC(busAuxA?.HVACAux, busAuxB?.HVACAux); + CompareElectricConsumers( busAuxA?.ElectricConsumers, busAuxB?.ElectricConsumers); + } + + private static void CompareElectricConsumers(IElectricConsumersDeclarationData consumerA, IElectricConsumersDeclarationData consumerB) + { + if (consumerA == null && consumerB == null) { + return; + } + Assert.AreEqual(consumerA.BrakelightsLED, consumerB.BrakelightsLED); + Assert.AreEqual(consumerA.DayrunninglightsLED, consumerB.DayrunninglightsLED); + Assert.AreEqual(consumerA.HeadlightsLED, consumerB.HeadlightsLED); + Assert.AreEqual(consumerA.InteriorLightsLED, consumerB.InteriorLightsLED); + Assert.AreEqual(consumerA.PositionlightsLED, consumerB.PositionlightsLED); + } + + private static void CompareHVAC(IHVACBusAuxiliariesDeclarationData hvacA, IHVACBusAuxiliariesDeclarationData hvacB) + { + if (hvacA == null && hvacB == null) { + return; + } + + Assert.AreEqual(hvacA.SystemConfiguration, hvacB.SystemConfiguration); + Assert.AreEqual(hvacA.HeatPumpTypeCoolingDriverCompartment, hvacB.HeatPumpTypeCoolingDriverCompartment); + Assert.AreEqual(hvacA.HeatPumpTypeHeatingDriverCompartment, hvacB.HeatPumpTypeHeatingDriverCompartment); + Assert.AreEqual(hvacA.HeatPumpTypeCoolingPassengerCompartment, hvacB.HeatPumpTypeCoolingPassengerCompartment); + Assert.AreEqual(hvacA.HeatPumpTypeHeatingPassengerCompartment, hvacB.HeatPumpTypeHeatingPassengerCompartment); + Assert.AreEqual(hvacA.AuxHeaterPower, hvacB.AuxHeaterPower); + Assert.AreEqual(hvacA.DoubleGlazing, hvacB.DoubleGlazing); + Assert.AreEqual(hvacA.AdjustableAuxiliaryHeater, hvacB.AdjustableAuxiliaryHeater); + Assert.AreEqual(hvacA.SeparateAirDistributionDucts, hvacB.SeparateAirDistributionDucts); + } + + + public static void WriteDocument(XDocument document, out string writtenXml) + { + string documentString = ""; + using (var memoryWriter = new MemoryStream()) + { + using (var xmlWriter = new XmlTextWriter(memoryWriter, Encoding.UTF8)) + { + xmlWriter.Formatting = Formatting.Indented; + xmlWriter.Namespaces = true; + document.WriteTo(xmlWriter); + + xmlWriter.Flush(); + + memoryWriter.Seek(0, SeekOrigin.Begin); + using (var streamReader = new StreamReader(memoryWriter)) { + writtenXml = streamReader.ReadToEnd(); + TestContext.WriteLine(writtenXml); + } + + xmlWriter.Close(); + + } + + } + } + + + public static string[] GetDistributedCompletedVehicleFiles() + { + var _completedBusDistributed = "TestData\\XML\\SchemaVersion2.4\\Distributed\\CompletedBus"; + return GetFiles(Path.GetFullPath(_completedBusDistributed), "*.xml").ToArray(); + } + [DebuggerStepThrough] + public static string[] GetCompletedBusDistributedSchema24() + { + var _completedBusDistributed = "TestData\\XML\\SchemaVersion2.4"; + var inputDataReader = TestHelper.GetKernel().Get<IXMLInputDataReader>(); + var files = GetFiles(Path.GetFullPath(_completedBusDistributed), "*.xml").ToArray(); + var completedBusFiles = new List<string>(); + foreach (var file in files) { + try { + var completedInput = inputDataReader.CreateDeclaration(file); + if(completedInput.JobInputData.Vehicle is AbstractXMLDeclarationCompletedBusDataProviderV24) + { + completedBusFiles.Add(file); + } + } catch (Exception ex) { + //ignore; + } + } + + return completedBusFiles.ToArray(); + } + + + [TearDown] + public void AfterTestChecks() + { + _mockDialogHelper.AssertNoErrorDialogs(); + } + + + + + + + +} \ No newline at end of file diff --git a/Vecto3GUI2020Test/XML/XMLWritingTest/XMLComponentsWriterFactoryTest.cs b/Vecto3GUI2020Test/XML/XMLWritingTest/XMLComponentsWriterFactoryTest.cs new file mode 100644 index 0000000000000000000000000000000000000000..112c45644c4e417f701b3c1059b43d717883d4d9 --- /dev/null +++ b/Vecto3GUI2020Test/XML/XMLWritingTest/XMLComponentsWriterFactoryTest.cs @@ -0,0 +1,68 @@ +using System; +using System.Security.RightsManagement; +using System.Xml.Linq; +using Castle.Components.DictionaryAdapter.Xml; +using Ninject; +using NUnit.Framework; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.Resources.XML; +using VECTO3GUI2020.Util.XML; +using VECTO3GUI2020.Util.XML.Components; +using Vecto3GUI2020Test.Utils; + +namespace Vecto3GUI2020Test.XML.XMLWritingTest; + +[TestFixture] +public class XMLComponentsWriterFactoryTest +{ + private MockDialogHelper _mockDialogHelper; + private IKernel _kernel; + private IXMLWriterFactory _xmlWriterFactory; + + + [SetUp] + public void Setup() + { + _kernel = TestHelper.GetKernel(out _mockDialogHelper, out _); + _xmlWriterFactory = _kernel.Get<IXMLWriterFactory>(); + } + + + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLTypes.Components_Conventional_CompletedBusType, typeof(XMLCompletedBusComponentWriter_Conventional))] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLTypes.Components_xEV_CompletedBusType, typeof(XMLCompletedBusComponentsWriter_xEV))] + public void CreateComponentsWriter(string version, string type, Type expectedType) + { + XNamespace ns = version; + + + var writer = _xmlWriterFactory.CreateComponentsWriterWithVersion(ns, type); + Assert.AreEqual(expectedType, writer.GetType()); + + + } + + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V20, XMLTypes.AirDragDataDeclarationType, typeof(XMLAirDragWriter_v2_0))] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V10, XMLTypes.AirDragDataDeclarationType, typeof(XMLAirDragWriter_v1_0))] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLTypes.AirDragModifiedUseStandardValueType, typeof(XMLAirDragWriter_v2_4))] + public void CreateAirdragComponentWriter(string version, string type, Type expectedType) + { + + XNamespace ns = version; + var writer = _xmlWriterFactory.CreateComponentWriterWithVersion<IXMLComponentWriter>(ns, type); + + Assert.AreEqual(expectedType, writer.GetType()); + } + + + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLTypes.AUX_Conventional_CompletedBusType, typeof(XMLCompletedBusAuxiliariesWriterConventional))] + [TestCase(XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24, XMLTypes.AUX_xEV_CompletedBusType, typeof(XMLCompletedBusAuxiliariesWriter_xEV))] + public void CreateBusAuxiliariesWriter(string version, string type, Type expectedType) + { + + XNamespace ns = version; + var writer = _xmlWriterFactory.CreateComponentWriterWithVersion<IXMLBusAuxiliariesWriter>(ns, type); + + Assert.AreEqual(expectedType, writer.GetType()); + } + +} \ No newline at end of file diff --git a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs index 7d59784ffbadbd2145169249c52cb12bbae5edc7..03fc4d0652b38c16bbfb58b92f79b4de3c0b349d 100644 --- a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs +++ b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs @@ -80,8 +80,18 @@ namespace TUGraz.VectoCommon.InputData public string SourceFile { get; set; } + /// <summary> + /// returns the version of the namespace uri + /// </summary> public string SourceVersion { get; set; } + /// <summary> + /// In case of components loaded from XML files, this is the name of the XSD Type + /// </summary> + public string Type { get; set; } + + public string TypeVersion { get; set; } + public string SourcePath => SourceFile != null ? Path.GetDirectoryName(Path.GetFullPath(SourceFile)) : null; } @@ -1025,6 +1035,8 @@ namespace TUGraz.VectoCommon.InputData public interface IBusAuxiliariesDeclarationData { + DataSource DataSource { get; } + XmlNode XMLSource { get; } string FanTechnology { get; } @@ -1299,7 +1311,7 @@ namespace TUGraz.VectoCommon.InputData E4, E_IEPC, P1, - P2, + P2,P, P2_5, P3, P4, diff --git a/VectoCommon/VectoCommon/InputData/IInputDataProvider.cs b/VectoCommon/VectoCommon/InputData/IInputDataProvider.cs index 41423d6a0b2c19581000abeee775369a6caa249d..c8b8ce7c3392f18aab59d231bdd402b6f1386a90 100644 --- a/VectoCommon/VectoCommon/InputData/IInputDataProvider.cs +++ b/VectoCommon/VectoCommon/InputData/IInputDataProvider.cs @@ -103,6 +103,7 @@ namespace TUGraz.VectoCommon.InputData IVehicleDeclarationInputData StageInputData { get; } bool SimulateResultingVIF { get; } + bool? Completed { get; } } diff --git a/VectoCommon/VectoCommon/Utils/SI.cs b/VectoCommon/VectoCommon/Utils/SI.cs index c6c6e8a21eb810433a9ee923b9fb5dd2396f5421..d846e12500f40c63b800c16f7adc0feceb0a6ef9 100644 --- a/VectoCommon/VectoCommon/Utils/SI.cs +++ b/VectoCommon/VectoCommon/Utils/SI.cs @@ -220,7 +220,12 @@ namespace TUGraz.VectoCommon.Utils return SIBase<Second>.Create(second.Val / meterPerSecond.Value()); } - public static SquareMeter operator *(Meter m1, Meter m2) + public static Kilogram operator *(KilogramPerMeter kilogramPerMeter, Meter meter) + { + return SIBase<Kilogram>.Create(kilogramPerMeter.Value() * meter.Value()); + } + + public static SquareMeter operator *(Meter m1, Meter m2) { return SIBase<SquareMeter>.Create(m1.Val * m2.Val); } @@ -364,6 +369,9 @@ namespace TUGraz.VectoCommon.Utils return SIBase<CubicMeter>.Create(kilogram.Value() / kilogramPerCubicMeter.Value()); } + + + public static KilogramPerCubicMeter operator /(Kilogram kg, CubicMeter m3) { return SIBase<KilogramPerCubicMeter>.Create(kg.Val / m3.Value()); diff --git a/VectoCore/ModelbasedTests/ModelbasedTests.csproj b/VectoCore/ModelbasedTests/ModelbasedTests.csproj index b547fa8f6f44ba3421888e9f7153b3617aeea0bc..db094bcfaea74d3df5251734c29f9443a8bacc4f 100644 --- a/VectoCore/ModelbasedTests/ModelbasedTests.csproj +++ b/VectoCore/ModelbasedTests/ModelbasedTests.csproj @@ -2,7 +2,7 @@ <PropertyGroup> <RootNamespace>TUGraz.VectoCore.ModelbasedTests</RootNamespace> <AssemblyName>ModelbasedTests</AssemblyName> - <TargetFrameworks>net6.0-windows</TargetFrameworks> + <TargetFrameworks>net6.0</TargetFrameworks> <DefineConstants /> </PropertyGroup> diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Common/AbstractXMLResource.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Common/AbstractXMLResource.cs index 057b4afd1e194aada2be9680a066c399ac4667fb..71abcfde418c7601e20a512e6d7415dd76f21f22 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Common/AbstractXMLResource.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Common/AbstractXMLResource.cs @@ -33,6 +33,7 @@ using System.Xml; using System.Xml.Linq; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCore.Utils; +using XmlDocumentType = TUGraz.VectoCore.Utils.XmlDocumentType; namespace TUGraz.VectoCore.InputData.FileIO.XML.Common { public abstract class AbstractXMLResource : AbstractXMLType, IXMLResource @@ -44,13 +45,23 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Common { SourceFile = source; } - public virtual DataSource DataSource => new DataSource() { SourceFile = SourceFile, SourceVersion = SourceVersion, SourceType = SourceType }; + public virtual DataSource DataSource => new DataSource() { - protected string SourceVersion => XMLHelper.GetVersionFromNamespaceUri(SchemaNamespace); + Type = SchemaType, + TypeVersion = QualifiedName.Namespace, + SourceFile = SourceFile, + SourceVersion = SourceVersion, + SourceType = SourceType, + }; + + public string SourceTypeVersion { get; } + + protected string SourceVersion => SchemaNamespace.GetVersionFromNamespaceUri(); protected abstract XNamespace SchemaNamespace { get; } + protected abstract DataSourceType SourceType { get; } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Common/AbstractXMLType.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Common/AbstractXMLType.cs index aaf93c05a5982a2877a06e26a5f7036468896ed3..afafc12f6c3fdc5790e6bae964ecb50a87363343 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Common/AbstractXMLType.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Common/AbstractXMLType.cs @@ -32,6 +32,7 @@ using System; using System.Collections.Generic; using System.Xml; +using System.Xml.Schema; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; @@ -42,9 +43,16 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Common { public abstract class AbstractXMLType : LoggingObject { protected readonly XmlNode BaseNode; - + protected readonly string SchemaType; + protected readonly XmlQualifiedName QualifiedName; protected AbstractXMLType(XmlNode node) { + var schemaType = XMLHelper.GetSchemaType(node); + + SchemaType = schemaType?.Name; + + + QualifiedName = schemaType?.QualifiedName; BaseNode = node; } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/AbstractCommonComponentType.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/AbstractCommonComponentType.cs index 66c2a3d2c0549a660819c8baaaebb7db7ff9e6d0..629c90a1d758f5713fd67ad643ca3db6c5c3fb72 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/AbstractCommonComponentType.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/AbstractCommonComponentType.cs @@ -49,22 +49,32 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider { public virtual string Model => GetString(XMLNames.Component_Model); - public virtual DateTime Date => XmlConvert.ToDateTime(GetString(XMLNames.Component_Date), XmlDateTimeSerializationMode.Utc); + public virtual DateTime Date => + XmlConvert.ToDateTime(GetString(XMLNames.Component_Date), XmlDateTimeSerializationMode.Utc); public virtual string AppVersion => GetString(XMLNames.Component_AppVersion); public virtual CertificationMethod CertificationMethod { - get { - var certMethod = GetString(XMLNames.Component_Gearbox_CertificationMethod, required:false) ?? GetString(XMLNames.Component_CertificationMethod, required:false); - return certMethod != null ? EnumHelper.ParseEnum<CertificationMethod>(certMethod) : CertificationMethod.Measured; + get + { + var certMethod = GetString(XMLNames.Component_Gearbox_CertificationMethod, required: false) ?? + GetString(XMLNames.Component_CertificationMethod, required: false); + return certMethod != null + ? EnumHelper.ParseEnum<CertificationMethod>(certMethod) + : CertificationMethod.Measured; } } public virtual string CertificationNumber => GetString(XMLNames.Component_CertificationNumber); - public virtual DigestData DigestValue => new DigestData(GetNode(XMLNames.DI_Signature, required:false)); + public virtual DigestData DigestValue { + get + { + return new DigestData(GetNode(XMLNames.DI_Signature, required: false)); + } + } - public virtual XmlNode XMLSource => BaseNode; + public virtual XmlNode XMLSource => BaseNode; } } \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs index 38fd3b639d878ffef1b5183711ad20fc5a9eb2df..9d45092f086ebda9f3f8cc3db3f26d5da7a23c73 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationBusAuxiliariesDataProvider.cs @@ -22,10 +22,17 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_DEFINITIONS_NAMESPACE_URI_V24; public AbstractXMLDeclarationPrimaryBusAuxiliariesDataProviderV24( - XmlNode componentNode) : base(componentNode) { } + XmlNode componentNode) : base(componentNode) + { + + } #region Implementation of IBusAuxiliariesDeclarationData + public DataSource DataSource => new DataSource() { + Type = SchemaType, + TypeVersion = QualifiedName.Namespace + }; public virtual XmlNode XMLSource => BaseNode; public virtual string FanTechnology @@ -227,9 +234,12 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - + public XMLDeclarationPrimaryBusAuxiliariesConventionalDataProviderV24( - IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(componentNode) { } + IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(componentNode) + { + + } public override bool ESSupplyFromHEVREESS => false; } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs index 9aa31ddba2156cd27039ceed43686c971f33d0e3..fd9442b0e63ee28ce22c12c54a75fd3841914c4b 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs @@ -69,7 +69,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider private IPrimaryVehicleInformationInputDataProvider _primaryVehicle; private IList<IManufacturingStageInputData> _manufacturingStages; - private IManufacturingStageInputData _concolidateManfacturingStage; + private IManufacturingStageInputData _consolidatedManufacturingStage; public XMLDeclarationMultistageJobInputDataV01(XmlNode node, IXMLMultistageInputDataProvider inputProvider, @@ -83,7 +83,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public IList<IManufacturingStageInputData> ManufacturingStages => _manufacturingStages ?? (_manufacturingStages = Reader.ManufacturingStages); - public IManufacturingStageInputData ConsolidateManufacturingStage => _concolidateManfacturingStage ?? (_concolidateManfacturingStage = Reader.ConsolidateManufacturingStage); + public IManufacturingStageInputData ConsolidateManufacturingStage => _consolidatedManufacturingStage ?? (_consolidatedManufacturingStage = Reader.ConsolidateManufacturingStage); public VectoSimulationJobType JobType => ConsolidateManufacturingStage.Vehicle.VehicleType; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Factory/IDeclarationInjectFactory.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Factory/IDeclarationInjectFactory.cs index ec51872e68a67d07e3c9103d5a684a0a29b39107..5ced569716b195aec07fc91bdbdc380bb50b7f11 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Factory/IDeclarationInjectFactory.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Factory/IDeclarationInjectFactory.cs @@ -83,6 +83,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Factory IXMLAirdragDeclarationInputData CreateAirdragData( string version, IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile); + IComponentInputData CreateComponentData(string version, XmlNode componentNode, string sourceFile); + IXMLGearboxDeclarationInputData CreateGearboxData( string version, IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile); diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV10InjectModule.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV10InjectModule.cs index d71b801640c119b40805c719d6d8d577c3623888..afc6c3ab92562c2c1369dd1217bc4138d5c97c62 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV10InjectModule.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV10InjectModule.cs @@ -29,7 +29,9 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ +using System.Xml; using Ninject.Modules; +using TUGraz.VectoCommon.InputData; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader; @@ -57,6 +59,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules Bind<IXMLAirdragDeclarationInputData>().To<XMLDeclarationAirdragDataProviderV10>().Named( XMLDeclarationAirdragDataProviderV10.QUALIFIED_XSD_TYPE); + Bind<IComponentInputData>().ToConstructor<XMLDeclarationAirdragDataProviderV10>((syntax) => new XMLDeclarationAirdragDataProviderV10(null, syntax.Inject<XmlNode>(), syntax.Inject<string>())) + .Named(XMLDeclarationAirdragDataProviderV10.QUALIFIED_XSD_TYPE); Bind<IXMLAngledriveInputData>().To<XMLDeclarationAngledriveDataProviderV10>().Named( XMLDeclarationAngledriveDataProviderV10.QUALIFIED_XSD_TYPE); diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV20InjectModule.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV20InjectModule.cs index 30ba2d032e1c8f7e64ab3bcc5b376387db854741..a944bc65071b79479efaec852da3d9f8dfc139fa 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV20InjectModule.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataV20InjectModule.cs @@ -29,7 +29,9 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ +using System.Xml; using Ninject.Modules; +using TUGraz.VectoCommon.InputData; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader; @@ -57,6 +59,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules Bind<IXMLAirdragDeclarationInputData>().To<XMLDeclarationAirdragDataProviderV20>().Named( XMLDeclarationAirdragDataProviderV20.QUALIFIED_XSD_TYPE); + Bind<IComponentInputData>().ToConstructor<XMLDeclarationAirdragDataProviderV20>((args) => + new XMLDeclarationAirdragDataProviderV20(null, args.Inject<XmlNode>(), args.Inject<string>()) + ).Named(XMLDeclarationAirdragDataProviderV20.QUALIFIED_XSD_TYPE); + Bind<IXMLAngledriveInputData>().To<XMLDeclarationAngledriveDataProviderV20>().Named( XMLDeclarationAngledriveDataProviderV20.QUALIFIED_XSD_TYPE); diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs index 6020d368628a661c9c43b8aee3eec88548fd3942..12e8fff970aa0d75fddfbd548665ceb251ab43cf 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs @@ -78,6 +78,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl protected IElectricStorageSystemDeclarationInputData _electricStorageSystemInputData; protected IIEPCDeclarationInputData _iepcDeclarationInputData; + + [Inject] public IDeclarationInjectFactory Factory { protected get; set; } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs index b7845fc8947091c0ef8f17231f5a166b9992a000..96c72768263351d0b63e9c37d0a1d0da2f2b2fd1 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs @@ -1113,6 +1113,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl public ConsolidatedBusAuxiliariesData(IEnumerable<IManufacturingStageInputData> manufacturingStages) : base(manufacturingStages) { } + public DataSource DataSource + { + get => _manufacturingStages.Select(s => s.Vehicle.Components.BusAuxiliaries.DataSource).FirstOrDefault(); + } public XmlNode XMLSource => _xmlNode ?? (_xmlNode = GetBusAuxXMLSource()); public string FanTechnology => null; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/IXMLInputDataReader.cs b/VectoCore/VectoCore/InputData/FileIO/XML/IXMLInputDataReader.cs index e85b0744d5246605eab517b25b25cb19ca01691a..5fa0623ad8219dcbee74003cfb129df91bdc2082 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/IXMLInputDataReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/IXMLInputDataReader.cs @@ -53,4 +53,14 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML IDeclarationInputDataProvider CreateDeclaration(XmlReader inputData); } + + /// <summary> + /// Create a single Component from an XMLSource + /// </summary> + public interface IXMLComponentInputReader + { + IAirdragDeclarationInputData CreateAirdrag(string filename); + IAirdragDeclarationInputData CreateAirdrag(Stream inputData); + IAirdragDeclarationInputData CreateAirdrag(XmlReader inputData); + } } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/XMLInputDataFactory.cs b/VectoCore/VectoCore/InputData/FileIO/XML/XMLInputDataFactory.cs index 0a144792ccb442b556c992178fb3ad4566311877..0cd61c7089c286b3db748406cc9440159bca15bf 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/XMLInputDataFactory.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/XMLInputDataFactory.cs @@ -37,6 +37,7 @@ using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Factory; using TUGraz.VectoCore.InputData.FileIO.XML.Engineering.Factory; +using TUGraz.VectoCore.Models.Connector.Ports; using TUGraz.VectoCore.Utils; using XmlDocumentType = TUGraz.VectoCore.Utils.XmlDocumentType; @@ -131,7 +132,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML throw new VectoException("empty xml document!"); } - var documentType = XMLHelper.GetDocumentType(xmlDoc.DocumentElement.LocalName); + var documentType = XMLHelper.GetDocumentTypeFromRootElement(xmlDoc.DocumentElement.LocalName); if (documentType == null) { throw new VectoException("unknown xml file! {0}", xmlDoc.DocumentElement.LocalName); } @@ -203,4 +204,101 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML } + + public class XMLComponentInputDataFactory : IXMLComponentInputReader + { + private readonly IDeclarationInjectFactory _declarationFactory; + + public XMLComponentInputDataFactory(IDeclarationInjectFactory declFactory) + { + _declarationFactory = declFactory; + } + #region Implementation of IXMLComponentInputReader + + public IAirdragDeclarationInputData CreateAirdrag(string filename) + { + return CreateFromFile<IAirdragDeclarationInputData>(filename); + } + + private TOut CreateFromFile<TOut>(string filename) where TOut : class + { + using (var reader = XmlReader.Create(filename)) { + return CreateFromXmlReader<TOut>(reader, filename); + } + } + + private TOut CreateFromStream<TOut>(Stream inputData) where TOut : class + { + using (var reader = XmlReader.Create(inputData)) { + return CreateFromXmlReader<TOut>(reader, null); + } + } + + private TOut CreateFromXmlReader<TOut>(XmlReader reader, string filename) where TOut : class + { + var result = ReadXMLDoc(reader, filename); + var typedResult = result as TOut; + if (typedResult is null) + { + throw new VectoException("Error creating XMLComponentInput {0}", filename); + } + + return typedResult; + } + + public IAirdragDeclarationInputData CreateAirdrag(Stream inputData) + { + throw new NotImplementedException(); + } + + public IAirdragDeclarationInputData CreateAirdrag(XmlReader inputData) + { + throw new NotImplementedException(); + } + + #endregion + + private IComponentInputData ReadXMLDoc(XmlReader inputData, string fileName) + { + var xmlDoc = new XmlDocument(); + xmlDoc.Load(inputData); + if (xmlDoc.DocumentElement == null) + { + throw new VectoException("empty xml document!"); + } + + var documentType = XmlDocumentType.DeclarationComponentData; //<- TODO HM 27.03.23: remove hardcoding + + //Cannot handle Declaration Component + //var documentType = XMLHelper.GetDocumentTypeFromRootElement(xmlDoc.DocumentElement.LocalName); + //if (documentType == null) + //{ + // throw new VectoException("unknown xml file! {0}", xmlDoc.DocumentElement.LocalName); + //} + + + + bool valid = new XMLValidator(xmlDoc, null, XMLValidator.CallBackExceptionOnError).ValidateXML(documentType); + var xNode = xmlDoc.DocumentElement?.FirstChild; + //Document -> Component -> ComponentData + var versionNumber = XMLHelper.GetXsdType(xNode?.FirstChild?.SchemaInfo.SchemaType); + try + { + var input = _declarationFactory.CreateComponentData(versionNumber, xNode, fileName); + //input.Reader = _declarationFactory.CreateInputReader(versionNumber, input, xmlDoc.FirstChild); + return input; + } + catch (Exception e) + { + throw new VectoException("Failed to read Declaration job version {0}", e, versionNumber); + } + + + + + + return null; + } + + } } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/XMLInputDataNinjectModule.cs b/VectoCore/VectoCore/InputData/FileIO/XML/XMLInputDataNinjectModule.cs index 522c1303247bc52bf082cc0967850c22c7176c07..ebfec723fa3ac3dd2e48e761770171f770d27647 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/XMLInputDataNinjectModule.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/XMLInputDataNinjectModule.cs @@ -41,6 +41,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML public override void Load() { Bind<IXMLInputDataReader>().To<XMLInputDataFactory>(); + Bind<IXMLComponentInputReader>().To<XMLComponentInputDataFactory>(); LoadModule<XMLDeclarationReaderInjectModule>(); diff --git a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeMultistageBusVectoRunDataFactory.cs b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeMultistageBusVectoRunDataFactory.cs index 2e47fddbc75f6d73c72dd5c207c494eefcc9f550..a8e816a0559025f3670ac2129d42138aee4332ff 100644 --- a/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeMultistageBusVectoRunDataFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/Impl/DeclarationModeMultistageBusVectoRunDataFactory.cs @@ -32,7 +32,7 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl Report = Report, Mission = new Mission { MissionType = MissionType.ExemptedMission }, VehicleData = CreateVehicleData(InputDataProvider.MultistageJobInputData.JobInputData.PrimaryVehicle.Vehicle), - MultistageVIFInputData = InputDataProvider, + MultistageVifInputData = InputDataProvider, }; } diff --git a/VectoCore/VectoCore/InputData/Reader/VectoRunDataFactoryFactory.cs b/VectoCore/VectoCore/InputData/Reader/VectoRunDataFactoryFactory.cs index 928e8753beeea07e8000511b3ce53ffce8d956dd..59046d5471c768d947a3cc08e26db4d7fcaa868a 100644 --- a/VectoCore/VectoCore/InputData/Reader/VectoRunDataFactoryFactory.cs +++ b/VectoCore/VectoCore/InputData/Reader/VectoRunDataFactoryFactory.cs @@ -72,15 +72,15 @@ namespace TUGraz.VectoCore.InputData.Reader } - private IVectoRunDataFactory CreateRunDataReader(IMultistageVIFInputData multistageVifInputData, IDeclarationReport report) + private IVectoRunDataFactory CreateRunDataReader(IMultistageVIFInputData multiStepVifInputData, IDeclarationReport report) { - if (multistageVifInputData.VehicleInputData == null) { + if (multiStepVifInputData.VehicleInputData == null) { return _internalFactory.CreateDeclarationCompletedBusRunDataFactory( new VehicleTypeAndArchitectureStringHelperRundata.VehicleClassification( - multistageVifInputData), multistageVifInputData, report); + multiStepVifInputData), multiStepVifInputData, report); } else { - return new DeclarationModeMultistageBusVectoRunDataFactory(multistageVifInputData, report); + return new DeclarationModeMultistageBusVectoRunDataFactory(multiStepVifInputData, report); } } diff --git a/VectoCore/VectoCore/Mockup/Reports/MockupReportFactory.cs b/VectoCore/VectoCore/Mockup/Reports/MockupReportFactory.cs index e841f6e9fc8155059206e663083117772cd31ba2..f664fe115d975a9f8e90f881deb626915d32640d 100644 --- a/VectoCore/VectoCore/Mockup/Reports/MockupReportFactory.cs +++ b/VectoCore/VectoCore/Mockup/Reports/MockupReportFactory.cs @@ -72,21 +72,21 @@ namespace TUGraz.VectoMockup.Reports : null; } - private IDeclarationReport CreateDeclarationReport(IMultistageVIFInputData multistageVifInputData, IOutputDataWriter outputDataWriter) + private IDeclarationReport CreateDeclarationReport(IMultistageVIFInputData multiStepVifInputData, IOutputDataWriter outputDataWriter) { - if (multistageVifInputData.VehicleInputData == null) + if (multiStepVifInputData.VehicleInputData == null) { var reportCompleted = new XMLDeclarationMockupReportCompletedVehicle(outputDataWriter, _mrfFactory, _cifFactory, _vifFactory, - multistageVifInputData.MultistageJobInputData.JobInputData.PrimaryVehicle.Vehicle.ExemptedVehicle) + multiStepVifInputData.MultistageJobInputData.JobInputData.PrimaryVehicle.Vehicle.ExemptedVehicle) { - PrimaryVehicleReportInputData = multistageVifInputData.MultistageJobInputData.JobInputData.PrimaryVehicle, + PrimaryVehicleReportInputData = multiStepVifInputData.MultistageJobInputData.JobInputData.PrimaryVehicle, }; return reportCompleted; } else { var report = new XMLDeclarationMockupReportInterimVehicle(outputDataWriter, _mrfFactory, _cifFactory, _vifFactory, _interimFactory, - multistageVifInputData.MultistageJobInputData.JobInputData.PrimaryVehicle.Vehicle.ExemptedVehicle); + multiStepVifInputData.MultistageJobInputData.JobInputData.PrimaryVehicle.Vehicle.ExemptedVehicle); return report; } } diff --git a/VectoCore/VectoCore/Mockup/Simulation/RundataFactories/VectoMockupRunDataFactoryFactory.cs b/VectoCore/VectoCore/Mockup/Simulation/RundataFactories/VectoMockupRunDataFactoryFactory.cs index b31d36464034497218755f96ba0c22369d52a7b2..95d0b32d16ee7094f76429c83cef410d75f67f13 100644 --- a/VectoCore/VectoCore/Mockup/Simulation/RundataFactories/VectoMockupRunDataFactoryFactory.cs +++ b/VectoCore/VectoCore/Mockup/Simulation/RundataFactories/VectoMockupRunDataFactoryFactory.cs @@ -47,18 +47,18 @@ namespace TUGraz.VectoMockup.Simulation.RundataFactories throw new VectoException("Unknown InputData for Declaration Mode!"); } - private IVectoRunDataFactory CreateRunDataReader(IMultistageVIFInputData multistageVifInputData, IDeclarationReport report) + private IVectoRunDataFactory CreateRunDataReader(IMultistageVIFInputData multiStepVifInputData, IDeclarationReport report) { - if (multistageVifInputData.VehicleInputData == null) + if (multiStepVifInputData.VehicleInputData == null) { return new MockupMultistageCompletedBusRunDataFactory( - multistageVifInputData, + multiStepVifInputData, report, new DeclarationDataAdapterSpecificCompletedBus.Conventional(), new DeclarationDeclarationDataAdapterGenericCompletedBusDeclaration.Conventional(), null, null); } else { - return new DeclarationModeMultistageBusVectoRunDataFactory(multistageVifInputData, report); + return new DeclarationModeMultistageBusVectoRunDataFactory(multiStepVifInputData, report); } } diff --git a/VectoCore/VectoCore/Models/BusAuxiliaries/Interfaces/IBusAuxiliaries.cs b/VectoCore/VectoCore/Models/BusAuxiliaries/Interfaces/IBusAuxiliaries.cs index 7c288f190e4c1c910a34c4d69fd98f449200b404..faf4a3ea7f8e44abb7459958b474951b6c58e2dc 100644 --- a/VectoCore/VectoCore/Models/BusAuxiliaries/Interfaces/IBusAuxiliaries.cs +++ b/VectoCore/VectoCore/Models/BusAuxiliaries/Interfaces/IBusAuxiliaries.cs @@ -161,6 +161,9 @@ namespace TUGraz.VectoCore.Models.BusAuxiliaries.Interfaces public class HeaterDemandResult { + /// <summary> + /// Fuel heater (Diesel) + /// </summary> public Joule AuxHeater => HeaterPower.AuxHeaterPower * CycleTime; public WattSecond HeatPumpElectricEnergy => HeaterPower.HeatPumpPowerEl * CycleTime; diff --git a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs index d42e97432aa8977b7cbd6567a622dc1b1ea2d9b0..bfa446619b33b9b6bfd0e96f5e253ce06a989f0b 100644 --- a/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs +++ b/VectoCore/VectoCore/Models/Declaration/DeclarationData.cs @@ -1432,6 +1432,24 @@ namespace TUGraz.VectoCore.Models.Declaration } public static IWeightedResult CalculateWeightedResult(IResultEntry cdResult, IResultEntry csResult) + { + var vehicleOperation = VehicleOperation.LookupVehicleOperation(cdResult.VehicleClass, cdResult.Mission); + var chgEfficiency = CalculateChargingEfficiencyOVCHEV(cdResult.MaxChargingPower, vehicleOperation, cdResult.BatteryData); + CalculateChargingEfficiencyOVCHEV(cdResult.MaxChargingPower, vehicleOperation, cdResult.BatteryData); + return CalculateWeightedResult(cdResult, csResult, vehicleOperation, chgEfficiency); + } + + public static IWeightedResult CalculateWeightedResultCompletedBus(IResultEntry cdResult, IResultEntry csResult) + { + var vehicleOperation = VehicleOperation.LookupVehicleOperation(cdResult.VehicleClass, cdResult.Mission); + return CalculateWeightedResult(cdResult, csResult, vehicleOperation, (1, 1, 1)); + } + + + private static IWeightedResult CalculateWeightedResult(IResultEntry cdResult, + IResultEntry csResult, + VehicleOperationLookup.VehicleOperationData vehicleOperation, + (double etaChgBatDepot, double etaChgBatInMission, double etaChtBatWeighted) chargingEfficiency) { if (cdResult.Status != VectoRun.Status.Success || csResult.Status != VectoRun.Status.Success) { return null; @@ -1440,7 +1458,6 @@ namespace TUGraz.VectoCore.Models.Declaration if (batteryData == null) { throw new VectoException("Battery Data is required for OVC post-processing"); } - var vehicleOperation = VehicleOperation.LookupVehicleOperation(cdResult.VehicleClass, cdResult.Mission); var D9_dailySpecificMileage = vehicleOperation.Mileage.DailyMileage; var D10_stationarychargingDuringMissionMaxPwrInfastructure = vehicleOperation.StationaryChargingMaxPwrInfrastructure; @@ -1449,7 +1466,8 @@ namespace TUGraz.VectoCore.Models.Declaration var D13_realWorldFactorUsageStartSoC = vehicleOperation.RealWorldUsageFactors.StartSoCBeforeMission; var D14_realWorldFactorChargeDuringMission = vehicleOperation.RealWorldUsageFactors.StationaryChargingDuringMission; - var (etaChgBatDepot, etaChgBatInMission, etaChtBatWeighted) = CalculateChargingEfficiencyOVCHEV(cdResult.MaxChargingPower, vehicleOperation, batteryData); + var (etaChgBatDepot, etaChgBatInMission, etaChtBatWeighted) = chargingEfficiency; + //var (etaChgBatDepot, etaChgBatInMission, etaChtBatWeighted) = CalculateChargingEfficiencyOVCHEV(cdResult.MaxChargingPower, vehicleOperation, batteryData); var D17_maxStatChargingPower = cdResult.MaxChargingPower; @@ -1515,6 +1533,7 @@ namespace TUGraz.VectoCore.Models.Declaration return retVal; } + public static (double, double, double) CalculateChargingEfficiencyOVCHEV(Watt maxChargingPwrVeh, VehicleOperationLookup.VehicleOperationData vehicleOperation, BatterySystemData batteryData) { @@ -1547,6 +1566,7 @@ namespace TUGraz.VectoCore.Models.Declaration totalChargedEnergy); } + public static double CalculateChargingEfficiencyPEV(VectoRunData runData) { var batteryData = runData.BatteryData; @@ -1632,18 +1652,32 @@ namespace TUGraz.VectoCore.Models.Declaration }; } + public static ElectricRangesPEV CalculateElectricRangesPEV(VectoRunData runData, IModalDataContainer data) { - var batteryData = runData.BatteryData; + return DoCalculateElectricRangesPEV(data.CorrectedModalData.ElectricEnergyConsumption_SoC_Corr, + data.Distance, CalculateChargingEfficiencyPEV(runData), runData.BatteryData); + } + + public static ElectricRangesPEV CalculateElectricRangesPEVCompletedBus(BatterySystemData batteryData, + WattSecond ElectricEnergyConsumptionSoc, Meter distance) + { + return DoCalculateElectricRangesPEV(electricEnergyConsumptionSoCCorr: ElectricEnergyConsumptionSoc, + distance: distance, chargingEfficiencyBattery: 1, batteryData); + } + + private static ElectricRangesPEV DoCalculateElectricRangesPEV(WattSecond electricEnergyConsumptionSoCCorr, Meter distance, double chargingEfficiencyBattery, BatterySystemData runDataBatteryData) + { + var batteryData = runDataBatteryData; if (batteryData == null) { throw new VectoException("Battery Data is required for PEV range calculation"); } - var D9_chargingEfficiencyBattery = CalculateChargingEfficiencyPEV(runData); + var D9_chargingEfficiencyBattery = chargingEfficiencyBattery; var D15_useableBatteryCapacityForR_CDA = batteryData.UseableStoredEnergy; - var D13_electricEnergyConsumption = data.CorrectedModalData.ElectricEnergyConsumption_SoC_Corr; + var D13_electricEnergyConsumption = electricEnergyConsumptionSoCCorr; - var D16_actualChargeDepletingRange = D15_useableBatteryCapacityForR_CDA / D13_electricEnergyConsumption * data.Distance; + var D16_actualChargeDepletingRange = D15_useableBatteryCapacityForR_CDA / D13_electricEnergyConsumption * distance; var D17_equivalentAllElectricRange = D16_actualChargeDepletingRange; var D18_zeroCO2EmissionsRange = D17_equivalentAllElectricRange; diff --git a/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs b/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs index d82e11845b67bdf7b515785df500c3e1fdc5aa60..ee52a2d339444dc9200caf9845f32ec4bb8a33b4 100644 --- a/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs +++ b/VectoCore/VectoCore/Models/Simulation/Data/VectoRunData.cs @@ -168,7 +168,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Data public Watt ElectricAuxDemand { get; internal set; } [JsonIgnore] - public IMultistageVIFInputData MultistageVIFInputData { get; internal set; } + public IMultistageVIFInputData MultistageVifInputData { get; internal set; } // container to pass genset data from powertrain to post-processing, not filled by dataadapter/rundatafactory public GenSetData GenSet { get; set; } diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/SimulatorFactory.cs b/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/SimulatorFactory.cs index 5d04db58d4d3f1fe1951caf7043827c057b46704..f26acf000000d84bacf99e436dfd2255cda310d3 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/SimulatorFactory.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/SimulatorFactory/SimulatorFactory.cs @@ -31,6 +31,7 @@ using System; using System.Collections.Generic; +using System.Configuration; using System.IO; using System.Linq; using System.Reflection; @@ -71,11 +72,16 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl.SimulatorFactory { get { - + var factory = _followUpSimulatorFactoryCreator?.GetNextFactory(); + if (factory != null) { + factory.WriteModalResults = this.WriteModalResults; + //factory.SerializeVectoRunData = this.SerializeVectoRunData; + } + - return _followUpSimulatorFactoryCreator?.GetNextFactory(); + return factory; } } diff --git a/VectoCore/VectoCore/OutputData/ModDataPostprocessing/IModalDataPostProcessor.cs b/VectoCore/VectoCore/OutputData/ModDataPostprocessing/IModalDataPostProcessor.cs index d0e3c60d49108d321634191ba85159d6c99d86b4..e1a932b3e8d2b8f188c534345473017bfadf692b 100644 --- a/VectoCore/VectoCore/OutputData/ModDataPostprocessing/IModalDataPostProcessor.cs +++ b/VectoCore/VectoCore/OutputData/ModDataPostprocessing/IModalDataPostProcessor.cs @@ -16,5 +16,6 @@ namespace TUGraz.VectoCore.OutputData.ModDataPostprocessing public interface IModalDataPostProcessor { ICorrectedModalData ApplyCorrection(IModalDataContainer modData, VectoRunData runData); - } + + } } \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/BatteryElectricPostprocessingCorrection.cs b/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/BatteryElectricPostprocessingCorrection.cs index 93c82e9ed057cff56258acd28dcdca7d63c1ec0d..dd358d499f721b75281f496a8e94a515e61f01b9 100644 --- a/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/BatteryElectricPostprocessingCorrection.cs +++ b/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/BatteryElectricPostprocessingCorrection.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; +using System.Linq; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.Reader.Impl.DeclarationMode.CompletedBusRunDataFactory; using TUGraz.VectoCore.Models.BusAuxiliaries; using TUGraz.VectoCore.Models.BusAuxiliaries.DownstreamModules.Impl.Pneumatics; using TUGraz.VectoCore.Models.Declaration; @@ -9,11 +11,11 @@ using TUGraz.VectoCore.OutputData.ModDataPostprocessing; namespace TUGraz.VectoCore.OutputData.ModDataPostprocessing.Impl { - public class BatteryElectricPostprocessingCorrection : IModalDataPostProcessor + public class BatteryElectricPostprocessingCorrection : ModalDataPostProcessingCorrectionBase { #region Implementation of IModalDataPostProcessor - public ICorrectedModalData ApplyCorrection(IModalDataContainer modData, VectoRunData runData) + public override ICorrectedModalData ApplyCorrection(IModalDataContainer modData, VectoRunData runData) { var chgEfficiency = DeclarationData.CalculateChargingEfficiencyPEV(runData); @@ -34,15 +36,34 @@ namespace TUGraz.VectoCore.OutputData.ModDataPostprocessing.Impl runData.DCDCData.DCDCEfficiency; } + var corrected = new PEVCorrectedModalData(modData) + { + CorrectedAirDemand = airDemandCorr, + DeltaAir = deltaAir, + WorkBusAux_elPS_SoC_ElRange = deltaEPSel, + ElectricEnergyConsumption_SoC = -modData.TimeIntegral<WattSecond>(ModalResultField.P_reess_int), + ElectricEnergyConsumption_Final = (-modData.TimeIntegral<WattSecond>(ModalResultField.P_reess_int) + deltaEPSel) / chgEfficiency, + }; - return new PEVCorrectedModalData(modData) { - CorrectedAirDemand = airDemandCorr, - DeltaAir = deltaAir, - WorkBusAux_elPS_SoC_ElRange = deltaEPSel, - ElectricEnergyConsumption_SoC = -modData.TimeIntegral<WattSecond>(ModalResultField.P_reess_int), - ElectricEnergyConsumption_Final = (-modData.TimeIntegral<WattSecond>(ModalResultField.P_reess_int) + deltaEPSel) / chgEfficiency, - }; - } + SetAuxHeaterDemand(modData, runData, corrected); + if (corrected.AuxHeaterDemand?.IsGreater(0) ?? false) { + + var f = FuelData.Diesel; + + var fc = new PEVFuelConsumptionCorrection( + fuel: f, + distance: modData.Distance, + duration: modData.Duration, + fcAuxHeater: corrected.AuxHeaterDemand / f.LowerHeatingValueVecto); + + + corrected.FuelCorrection[f.FuelType] = fc; + } + + + + return corrected; + } #endregion } diff --git a/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/ConventionalModalDataPostprocessingCorrection.cs b/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/ConventionalModalDataPostprocessingCorrection.cs index 28d1fe9724acb9a550caef4020951af829ccc23f..ad52825fa0789d1cfab31b7993234673f0807dc4 100644 --- a/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/ConventionalModalDataPostprocessingCorrection.cs +++ b/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/ConventionalModalDataPostprocessingCorrection.cs @@ -14,12 +14,62 @@ using TUGraz.VectoCore.Models.SimulationComponent.Data; namespace TUGraz.VectoCore.OutputData.ModDataPostprocessing.Impl { - public class ConventionalModalDataPostprocessingCorrection : IModalDataPostProcessor + public abstract class ModalDataPostProcessingCorrectionBase : IModalDataPostProcessor + { + #region Implementation of IModalDataPostProcessor + + public abstract ICorrectedModalData ApplyCorrection(IModalDataContainer modData, VectoRunData runData); + + protected virtual void SetAuxHeaterDemand(IModalDataContainer modData, VectoRunData runData, AbstractCorrectedModalData r) + { + + if (modData.AuxHeaterDemandCalc == null) + { + r.AuxHeaterDemand = 0.SI<Joule>(); + r.WorkBusAuxHeatPumpHeatingMech = 0.SI<WattSecond>(); + r.WorkBusAuxHeatPumpHeatingElMech = 0.SI<WattSecond>(); + r.WorkBusAuxElectricHeater = 0.SI<WattSecond>(); + return; + } + var duration = modData.Duration; + var engineWasteheatSum = modData.FuelData.Aggregate( + 0.SI<Joule>(), + (current, fuel) => current + modData.TotalFuelConsumption(ModalResultField.FCFinal, fuel) * + fuel.LowerHeatingValueVecto); + var emLossEnergy = 0.SI<Joule>(); + //if (runData.ElectricMachinesData.Count > 0) { + foreach (var em in runData.ElectricMachinesData) + { + var emPos = em.Item1; //runData.ElectricMachinesData.First().Item1; + var colName = modData.GetColumnName(emPos, ModalResultField.P_EM_electricMotorLoss_); + if (emPos == PowertrainPosition.IEPC) + { + colName = modData.GetColumnName(emPos, ModalResultField.P_IEPC_electricMotorLoss_); + } + emLossEnergy += modData.TimeIntegral<WattSecond>(colName).Cast<Joule>(); + } + + //r.WorkBusAuxHeatPumpHeatingElMech = workBusAuxES / + // runData.BusAuxiliaries.ElectricalUserInputsConfig.AlternatorMap.GetEfficiency(0.RPMtoRad(), 0.SI<Ampere>()) / + // runData.BusAuxiliaries.ElectricalUserInputsConfig.AlternatorGearEfficiency; + var heatingDemand = modData.AuxHeaterDemandCalc(duration, engineWasteheatSum, emLossEnergy); + + r.WorkBusAuxHeatPumpHeatingMech = heatingDemand.HeatPumpMechanicalEnergy; + r.WorkBusAuxHeatPumpHeatingElMech = heatingDemand.HeatPumpElectricEnergy / + runData.BusAuxiliaries.ElectricalUserInputsConfig.AlternatorMap.GetEfficiency(0.RPMtoRad(), 0.SI<Ampere>()) / + runData.BusAuxiliaries.ElectricalUserInputsConfig.AlternatorGearEfficiency; + r.AuxHeaterDemand = heatingDemand.AuxHeater; + r.WorkBusAuxElectricHeater = heatingDemand.ElectricHeaterEnergy; + } + #endregion + } + + public class ConventionalModalDataPostprocessingCorrection : ModalDataPostProcessingCorrectionBase { #region Implementation of IModalDataPostProcessor - public virtual ICorrectedModalData ApplyCorrection(IModalDataContainer modData, VectoRunData runData) + public override ICorrectedModalData ApplyCorrection(IModalDataContainer modData, VectoRunData runData) { return DoApplyCorrection(modData, runData); } @@ -173,44 +223,7 @@ namespace TUGraz.VectoCore.OutputData.ModDataPostprocessing.Impl return f; } - protected virtual void SetAuxHeaterDemand(IModalDataContainer modData, VectoRunData runData, CorrectedModalData r) - { - - if (modData.AuxHeaterDemandCalc == null) { - r.AuxHeaterDemand = 0.SI<Joule>(); - r.WorkBusAuxHeatPumpHeatingMech = 0.SI<WattSecond>(); - r.WorkBusAuxHeatPumpHeatingElMech = 0.SI<WattSecond>(); - r.WorkBusAuxElectricHeater = 0.SI<WattSecond>(); - return; - } - var duration = modData.Duration; - var engineWasteheatSum = modData.FuelData.Aggregate( - 0.SI<Joule>(), - (current, fuel) => current + modData.TotalFuelConsumption(ModalResultField.FCFinal, fuel) * - fuel.LowerHeatingValueVecto); - var emLossEnergy = 0.SI<Joule>(); - //if (runData.ElectricMachinesData.Count > 0) { - foreach (var em in runData.ElectricMachinesData) { - var emPos = em.Item1; //runData.ElectricMachinesData.First().Item1; - var colName = modData.GetColumnName(emPos, ModalResultField.P_EM_electricMotorLoss_); - if (emPos == PowertrainPosition.IEPC) { - colName = modData.GetColumnName(emPos, ModalResultField.P_IEPC_electricMotorLoss_); - } - emLossEnergy += modData.TimeIntegral<WattSecond>(colName).Cast<Joule>(); - } - - //r.WorkBusAuxHeatPumpHeatingElMech = workBusAuxES / - // runData.BusAuxiliaries.ElectricalUserInputsConfig.AlternatorMap.GetEfficiency(0.RPMtoRad(), 0.SI<Ampere>()) / - // runData.BusAuxiliaries.ElectricalUserInputsConfig.AlternatorGearEfficiency; - var heatingDemand = modData.AuxHeaterDemandCalc(duration, engineWasteheatSum, emLossEnergy); - r.WorkBusAuxHeatPumpHeatingMech = heatingDemand.HeatPumpMechanicalEnergy; - r.WorkBusAuxHeatPumpHeatingElMech = heatingDemand.HeatPumpElectricEnergy / - runData.BusAuxiliaries.ElectricalUserInputsConfig.AlternatorMap.GetEfficiency(0.RPMtoRad(), 0.SI<Ampere>()) / - runData.BusAuxiliaries.ElectricalUserInputsConfig.AlternatorGearEfficiency; - r.AuxHeaterDemand = heatingDemand.AuxHeater; - r.WorkBusAuxElectricHeater = heatingDemand.ElectricHeaterEnergy; - } protected virtual void SetMissingDCDCEnergy(IModalDataContainer modData, VectoRunData runData, CorrectedModalData r) { diff --git a/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/CorrectedModalData.cs b/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/CorrectedModalData.cs index 579cedc96605c7b2bd4f108cacdbaa83c0de6b37..7e3c2a765a6ab8ccc0587a94addc9d7358b6d801 100644 --- a/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/CorrectedModalData.cs +++ b/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/CorrectedModalData.cs @@ -78,7 +78,7 @@ namespace TUGraz.VectoCore.OutputData.ModDataPostprocessing.Impl public CorrectedModalData(IModalDataContainer modData) : base(modData) { - FuelCorrection = new Dictionary<FuelType, IFuelConsumptionCorrection>(); + //FuelCorrection = new Dictionary<FuelType, IFuelConsumptionCorrection>(); } public override IFuelConsumptionCorrection FuelConsumptionCorrection(IFuelProperties fuel) diff --git a/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/FuelConsumptionCorrection.cs b/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/FuelConsumptionCorrection.cs index 63fead479ed56fdd046d2ffaf4838336d9941684..1f3c6159d1faba02f699aa3b319339dae275b14b 100644 --- a/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/FuelConsumptionCorrection.cs +++ b/VectoCore/VectoCore/OutputData/ModDataPostprocessing/Impl/FuelConsumptionCorrection.cs @@ -1,5 +1,6 @@ using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.Models.SimulationComponent.Impl; namespace TUGraz.VectoCore.OutputData.ModDataPostprocessing.Impl { @@ -127,4 +128,85 @@ namespace TUGraz.VectoCore.OutputData.ModDataPostprocessing.Impl #endregion } + + + /// <summary> + /// Used for aux heaters + /// </summary> + public class PEVFuelConsumptionCorrection : IFuelConsumptionCorrection + { + private readonly Second _duration; + private readonly Meter _distance; + private readonly Kilogram _fcAuxHeater; + private readonly IFuelProperties _fuel; + + public PEVFuelConsumptionCorrection( + IFuelProperties fuel, + Second duration, + Meter distance, + Kilogram fcAuxHeater + ) + { + _fuel = fuel; + _duration = duration; + _distance = distance; + _fcAuxHeater = fcAuxHeater; + } + + #region Implementation of IFuelConsumptionCorrection + + public IFuelProperties Fuel => _fuel; + + public KilogramPerWattSecond EngineLineCorrectionFactor => throw new System.NotImplementedException(); + + public KilogramPerWattSecond VehicleLine => throw new System.NotImplementedException(); + + public KilogramPerSecond FC_ESS_H => throw new System.NotImplementedException(); + + public KilogramPerSecond FC_ESS_CORR_H => throw new System.NotImplementedException(); + + public KilogramPerSecond FC_BusAux_PS_CORR_H => throw new System.NotImplementedException(); + + public KilogramPerSecond FC_BusAux_ES_CORR_H => throw new System.NotImplementedException(); + + public KilogramPerSecond FC_WHR_CORR_H => throw new System.NotImplementedException(); + + public KilogramPerSecond FC_AUXHTR_H => _fcAuxHeater / _duration; + + public KilogramPerSecond FC_AUXHTR_H_CORR => FC_AUXHTR_H; + + public KilogramPerSecond FC_REESS_SOC_H => throw new System.NotImplementedException(); + + public KilogramPerSecond FC_REESS_SOC_CORR_H => throw new System.NotImplementedException(); + + public KilogramPerSecond FC_FINAL_H => throw new System.NotImplementedException(); + + public KilogramPerMeter FC_WHR_CORR_KM => throw new System.NotImplementedException(); + + public KilogramPerMeter FC_BusAux_PS_CORR_KM => throw new System.NotImplementedException(); + + public KilogramPerMeter FC_BusAux_ES_CORR_KM => throw new System.NotImplementedException(); + + public KilogramPerMeter FC_AUXHTR_KM => _fcAuxHeater / _distance; + + public KilogramPerMeter FC_AUXHTR_KM_CORR => FC_AUXHTR_KM; + + public KilogramPerMeter FC_REESS_SOC_KM => throw new System.NotImplementedException(); + + public KilogramPerMeter FC_REESS_SOC_CORR_KM => throw new System.NotImplementedException(); + + public KilogramPerMeter FC_ESS_KM => throw new System.NotImplementedException(); + + public KilogramPerMeter FC_ESS_CORR_KM => throw new System.NotImplementedException(); + + public KilogramPerMeter FC_FINAL_KM => throw new System.NotImplementedException(); + + public VolumePerMeter FuelVolumePerMeter => throw new System.NotImplementedException(); + + public Kilogram TotalFuelConsumptionCorrected => FC_AUXHTR_KM_CORR * _distance; + + public Joule EnergyDemand => throw new System.NotImplementedException(); + + #endregion + } } \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/ModDataPostprocessing/PostProcessingNinjectModule.cs b/VectoCore/VectoCore/OutputData/ModDataPostprocessing/PostProcessingNinjectModule.cs index 512d0e4c3b7c36f0d05ee9b807812b1a84fbce76..3cf6c760745d7dea820f831775d683c0ee5da80e 100644 --- a/VectoCore/VectoCore/OutputData/ModDataPostprocessing/PostProcessingNinjectModule.cs +++ b/VectoCore/VectoCore/OutputData/ModDataPostprocessing/PostProcessingNinjectModule.cs @@ -12,7 +12,6 @@ namespace TUGraz.VectoCore.OutputData.ModDataPostprocessing public override void Load() { - Bind<IModalDataPostProcessorFactory>().ToFactory(() => new UseFirstArgumentAsInstanceProvider()); Bind<IModalDataPostProcessor>().To<BatteryElectricPostprocessingCorrection>() @@ -35,7 +34,6 @@ namespace TUGraz.VectoCore.OutputData.ModDataPostprocessing Bind<IModalDataPostProcessor>().To<ConventionalModalDataPostprocessingCorrection>() .Named(VectoSimulationJobType.ConventionalVehicle.ToString()); - } #endregion diff --git a/VectoCore/VectoCore/OutputData/XML/ComponentWriter/ComponentWriterNinjectModule.cs b/VectoCore/VectoCore/OutputData/XML/ComponentWriter/ComponentWriterNinjectModule.cs index 015197523b60bc480e6c83c7d20e26d9aa617ece..4bf5cf6cdee988228fd63ed63295e1ef76f2594a 100644 --- a/VectoCore/VectoCore/OutputData/XML/ComponentWriter/ComponentWriterNinjectModule.cs +++ b/VectoCore/VectoCore/OutputData/XML/ComponentWriter/ComponentWriterNinjectModule.cs @@ -1,6 +1,7 @@ using System.Xml.Linq; using Ninject.Extensions.Factory; using TUGraz.VectoCore.OutputData.XML.GroupWriter; +using TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration; using TUGraz.VectoCore.Utils.Ninject; namespace TUGraz.VectoCore.OutputData.XML.ComponentWriter @@ -20,13 +21,21 @@ namespace TUGraz.VectoCore.OutputData.XML.ComponentWriter //ADASTypes - var v2102 = XMLDeclarationNamespaces.V24; + var v24 = XMLDeclarationNamespaces.V24; Bind<IDeclarationAdasWriter>().To<AdasConventionalWriter>(). - Named(GetName(GroupNames.ADAS_Conventional_Type, v2102)); + Named(GetName(GroupNames.ADAS_Conventional_Type, v24)); + Bind<IDeclarationAdasWriter>().To<AdasHEVWriter>(). + Named(GetName(GroupNames.ADAS_HEV_Type, v24)); + Bind<IDeclarationAdasWriter>().To<AdasPEVWriter>(). + Named(GetName(GroupNames.ADAS_PEV_Type, v24)); + Bind<IDeclarationAdasWriter>().To<AdasIEPCWriter>(). + Named(GetName(GroupNames.ADAS_IEPC_Type, v24)); - } + + + } #endregion } diff --git a/VectoCore/VectoCore/OutputData/XML/ComponentWriter/Declaration/ADAS_Writer.cs b/VectoCore/VectoCore/OutputData/XML/ComponentWriter/Declaration/ADAS_Writer.cs index 2160ebc6ceb4d461ad8b1b5caa3552f95997706a..7a6091d41930f82f142866a1608015da467af9b7 100644 --- a/VectoCore/VectoCore/OutputData/XML/ComponentWriter/Declaration/ADAS_Writer.cs +++ b/VectoCore/VectoCore/OutputData/XML/ComponentWriter/Declaration/ADAS_Writer.cs @@ -7,6 +7,7 @@ using System.Xml.Linq; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration; namespace TUGraz.VectoCore.OutputData.XML.ComponentWriter { @@ -17,13 +18,38 @@ namespace TUGraz.VectoCore.OutputData.XML.ComponentWriter XElement GetComponent(IAdvancedDriverAssistantSystemDeclarationInputData adas); } - public class AdasConventionalWriter : ComponentWriter, IDeclarationAdasWriter + public abstract class AdasWriter : ComponentWriter, IDeclarationAdasWriter + { + protected abstract string AdasType { get; } + + protected AdasWriter(XNamespace writerNamespace) : base(writerNamespace) + { + } + + #region Implementation of IDeclarationAdasWriter + + public abstract XElement[] GetComponentElements(IAdvancedDriverAssistantSystemDeclarationInputData adas); + + public XElement GetComponent(IAdvancedDriverAssistantSystemDeclarationInputData adas) + { + return new XElement(_writerNamespace + XMLNames.Vehicle_ADAS, + new XAttribute(XMLDeclarationNamespaces.Xsi + XMLNames.Attr_Type, AdasType), + GetComponentElements(adas)); + } + + #endregion + } + + + public class AdasConventionalWriter : AdasWriter { public AdasConventionalWriter(XNamespace writerNamespace) : base(writerNamespace) { } #region Implementation of IADASWriter - public XElement[] GetComponentElements(IAdvancedDriverAssistantSystemDeclarationInputData adas) + protected override string AdasType => GroupNames.ADAS_Conventional_Type; + + public override XElement[] GetComponentElements(IAdvancedDriverAssistantSystemDeclarationInputData adas) { var elements = new List<XElement>(); @@ -38,13 +64,63 @@ namespace TUGraz.VectoCore.OutputData.XML.ComponentWriter return elements.ToArray(); } - public XElement GetComponent(IAdvancedDriverAssistantSystemDeclarationInputData adas) + + + #endregion + } + + public class AdasHEVWriter : AdasWriter + { + protected override string AdasType => GroupNames.ADAS_HEV_Type; + public AdasHEVWriter(XNamespace writerNamespace) : base(writerNamespace) { } + + #region Implementation of IADASWriter + + public override XElement[] GetComponentElements(IAdvancedDriverAssistantSystemDeclarationInputData adas) { - return new XElement(_writerNamespace + XMLNames.Vehicle_ADAS, - new XAttribute(XMLDeclarationNamespaces.Xsi + XMLNames.Attr_Type, "ADAS_Conventional_Type"), - GetComponentElements(adas)); + var elements = new List<XElement>(); + + elements.Add(new XElement(_writerNamespace + XMLNames.Vehicle_ADAS_EngineStopStart, adas.EngineStopStart)); + elements.Add(new XElement(_writerNamespace + XMLNames.Vehicle_ADAS_PCC, adas.PredictiveCruiseControl.ToXMLFormat())); + + return elements.ToArray(); } #endregion } + + public class AdasPEVWriter : AdasWriter + { + protected override string AdasType => GroupNames.ADAS_PEV_Type; + public AdasPEVWriter(XNamespace writerNamespace) : base(writerNamespace) { } + + #region Implementation of IADASWriter + + public override XElement[] GetComponentElements(IAdvancedDriverAssistantSystemDeclarationInputData adas) + { + var elements = new List<XElement>(); + elements.Add(new XElement(_writerNamespace + XMLNames.Vehicle_ADAS_PCC, adas.PredictiveCruiseControl.ToXMLFormat())); + return elements.ToArray(); + } + + #endregion + } + + public class AdasIEPCWriter : AdasWriter + { + protected override string AdasType => GroupNames.ADAS_IEPC_Type; + public AdasIEPCWriter(XNamespace writerNamespace) : base(writerNamespace) { } + + #region Implementation of IADASWriter + + public override XElement[] GetComponentElements(IAdvancedDriverAssistantSystemDeclarationInputData adas) + { + var elements = new List<XElement>(); + elements.Add(new XElement(_writerNamespace + XMLNames.Vehicle_ADAS_PCC, adas.PredictiveCruiseControl.ToXMLFormat())); + return elements.ToArray(); + } + + #endregion + } + } diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/AbstractResultsWriter.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/AbstractResultsWriter.cs index 140c9e3b7ca195b0568934dc6945f4d92a48dc09..8836194dbafb5b9210967bb4d7bb6f02e7ef3f96 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/AbstractResultsWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/AbstractResultsWriter.cs @@ -75,15 +75,24 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.Common $"no matching result for {cdEntry.Mission}, {cdEntry.LoadingType}, {cdEntry.FuelMode} found!"); } - var combined = new OvcResultEntry() { - ChargeSustainingResult = csEntry, - ChargeDepletingResult = cdEntry, - Weighted = DeclarationData.CalculateWeightedResult(cdEntry, csEntry) - }; - retVal.Add(combined); + + var weightedResult = cdEntry.VehicleClass.IsCompletedBus() ? + DeclarationData.CalculateWeightedResultCompletedBus(cdEntry, csEntry) : + DeclarationData.CalculateWeightedResult(cdEntry, csEntry); + + var combined = new OvcResultEntry() + { + ChargeSustainingResult = csEntry, + ChargeDepletingResult = cdEntry, + Weighted = weightedResult + }; + retVal.Add(combined); } return retVal; } - } + + + + } } \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/FuelConsumptionWriter.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/FuelConsumptionWriter.cs index 2a947aee113886b370e88125784f6f426525eb5a..b89bb3c4d75ffb99463e695a988d0ee42a71eac9 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/FuelConsumptionWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/FuelConsumptionWriter.cs @@ -20,18 +20,20 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.Common public XElement GetElement(IResultEntry entry, IFuelConsumptionCorrection fc) { - return new XElement(TNS + XMLNames.Report_Results_Fuel, - new XAttribute(XMLNames.Report_Results_Fuel_Type_Attr, fc.Fuel.FuelType.ToXMLFormat()), - GetFuelConsumptionEntries(fc.TotalFuelConsumptionCorrected, fc.Fuel, entry.Distance, entry.Payload, entry.CargoVolume, entry.PassengerCount).Select(x => new XElement(TNS + XMLNames.Report_Results_FuelConsumption, x.ValueAsUnit(3, 1))) - ); + return GetElement(fc.TotalFuelConsumptionCorrected, fc.Fuel, entry.Distance, entry.Payload, entry.CargoVolume, entry.PassengerCount); } public XElement GetElement(IWeightedResult entry, IFuelProperties fuel, Kilogram consumption) - { - return new XElement(TNS + XMLNames.Report_Results_Fuel, - new XAttribute(XMLNames.Report_Results_Fuel_Type_Attr, fuel.FuelType.ToXMLFormat()), - GetFuelConsumptionEntries(consumption, fuel, entry.Distance, entry.Payload, entry.CargoVolume, entry.PassengerCount).Select(x => new XElement(TNS + XMLNames.Report_Results_FuelConsumption, x.ValueAsUnit(3, 1))) - ); + { + return GetElement(consumption, fuel, entry.Distance, entry.Payload, entry.CargoVolume, entry.PassengerCount); + } + + protected virtual XElement GetElement(Kilogram consumption, IFuelProperties fuel, Meter distance, Kilogram payLoad, CubicMeter cargoVolume, double? passengerCount) + { + return new XElement(TNS + XMLNames.Report_Results_Fuel, + new XAttribute(XMLNames.Report_Results_Fuel_Type_Attr, fuel.FuelType.ToXMLFormat()), + GetFuelConsumptionEntries(consumption, fuel, distance, payLoad, cargoVolume, passengerCount).Select(x => new XElement(TNS + XMLNames.Report_Results_FuelConsumption, x.ValueAsUnit(3, 1))) + ); } #endregion @@ -114,5 +116,4 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.Common #endregion } - } \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/IResultsWriter.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/IResultsWriter.cs index da451d48a48d6310c9bbbe972b167b7f8ef3f07f..b506435e5cfe6e6a286269fc5b479be601095304 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/IResultsWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/IResultsWriter.cs @@ -75,7 +75,8 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.Common IResultGroupWriter GetBusSimulationParameterWriter(ICommonResultsWriterFactory factory, XNamespace ns); IFuelConsumptionWriter GetFuelConsumptionBus(ICommonResultsWriterFactory factory, XNamespace ns); - IElectricEnergyConsumptionWriter GetElectricEnergyConsumptionBus(ICommonResultsWriterFactory factory, XNamespace ns); + + IElectricEnergyConsumptionWriter GetElectricEnergyConsumptionBus(ICommonResultsWriterFactory factory, XNamespace ns); ICO2Writer GetCO2ResultBus(ICommonResultsWriterFactory factory, XNamespace ns); ICO2Writer GetCO2ResultPEVBus(ICommonResultsWriterFactory factory, XNamespace ns); diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/ResultTotalWriter.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/ResultTotalWriter.cs index fb1e35a525791ecc9fc3e59a4756bd5caab7160f..caef6f1b763a04f8b9aba643aba85116ab515b04 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/ResultTotalWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/Common/ResultTotalWriter.cs @@ -16,12 +16,12 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.Common public override XElement GetElement(IResultEntry entry) { - var fcWrtier = FuelConsumptionWriter; + var fcWriter = FuelConsumptionWriter; return new XElement(TNS + XMLNames.Report_ResultEntry_Total, VehiclePerformanceWriter.GetElement(entry), - fcWrtier != null + fcWriter != null ? entry.FuelData.Select(f => - fcWrtier.GetElement(entry, entry.FuelConsumptionFinal(f.FuelType))) + fcWriter.GetElement(entry, entry.FuelConsumptionFinal(f.FuelType))) : null, ElectricEnergyConsumptionWriter?.GetElement(entry), CO2Writer?.GetElements(entry), @@ -92,7 +92,8 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.Common protected override IResultGroupWriter VehiclePerformanceWriter => _factory.GetVehiclePerformancePEVLorry(_factory, TNS); - protected override IFuelConsumptionWriter FuelConsumptionWriter => null; + protected override IFuelConsumptionWriter FuelConsumptionWriter => null; + protected override IElectricEnergyConsumptionWriter ElectricEnergyConsumptionWriter => _factory.GetElectricEnergyConsumptionLorry(_factory, TNS); @@ -180,7 +181,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.Common #endregion } - + public class BusHEVNonOVCTotalWriter : NonOVCTotalWriterBase { public BusHEVNonOVCTotalWriter(ICommonResultsWriterFactory factory, XNamespace ns) : base(factory, ns) { } @@ -203,8 +204,8 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.Common #region Overrides of NonOVCTotalWriterBase protected override IResultGroupWriter VehiclePerformanceWriter => _factory.GetVehiclePerformancePEVBus(_factory, TNS); - protected override IFuelConsumptionWriter FuelConsumptionWriter => null; - + //protected override IFuelConsumptionWriter FuelConsumptionWriter => _factory.GetZEVFuelConsumptionBus(_factory, TNS); + protected override IFuelConsumptionWriter FuelConsumptionWriter => null; protected override IElectricEnergyConsumptionWriter ElectricEnergyConsumptionWriter => _factory.GetElectricEnergyConsumptionBus(_factory, TNS); protected override ICO2Writer CO2Writer => _factory.GetCO2ResultPEVBus(_factory, TNS); protected override IElectricRangeWriter ElectricRangeWriter => _factory.GetElectricRangeWriter(_factory, TNS); diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFResultsNinjectModule.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFResultsNinjectModule.cs index da90cf8a5a25aa16511c1f0967abf06304d48ecd..125bafca30fc9bad442e6d28dd487d2420eca9c6 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFResultsNinjectModule.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/CustomerInformationFile/CustomerInformationFile_0_9/CIFResultsNinjectModule.cs @@ -1,4 +1,5 @@ -using System.Xml.Linq; +using System.Diagnostics; +using System.Xml.Linq; using Ninject.Activation; using Ninject.Extensions.Factory; using Ninject.Modules; @@ -170,7 +171,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation .NamedLikeFactoryMethod((ICIFResultsWriterFactory c) => c.GetErrorDetailsWriter(null, XNamespace.None)); } - + [DebuggerStepThrough] private bool AccessedViaCIFResultsWriterFactory(IRequest request) { if (request.ParentRequest == null) { diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/MRFResultsNinjectModule.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/MRFResultsNinjectModule.cs index 30038bd8c05dfd1310d5972cc8a5254e7d241986..17be243e6490278eeabd0acabebe9d1ff897876b 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/MRFResultsNinjectModule.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/MRFResultsNinjectModule.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Xml.Linq; using Ninject.Activation; using Ninject.Extensions.Factory; @@ -156,7 +157,9 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation Bind<IFuelConsumptionWriter>().To<BusFuelConsumptionWriter>().When(AccessedViaMRFResultsWriterFactory) .NamedLikeFactoryMethod((IMRFResultsWriterFactory c) => c.GetFuelConsumptionBus(null, XNamespace.None)); - Bind<IElectricEnergyConsumptionWriter>().To<BusElectricEnergyConsumptionWriter>().When(AccessedViaMRFResultsWriterFactory) + + + Bind<IElectricEnergyConsumptionWriter>().To<BusElectricEnergyConsumptionWriter>().When(AccessedViaMRFResultsWriterFactory) .NamedLikeFactoryMethod((IMRFResultsWriterFactory c) => c.GetElectricEnergyConsumptionBus(null, XNamespace.None)); Bind<ICO2Writer>().To<BusCO2Writer>().When(AccessedViaMRFResultsWriterFactory) .NamedLikeFactoryMethod((IMRFResultsWriterFactory c) => c.GetCO2ResultBus(null, XNamespace.None)); @@ -178,6 +181,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.CustomerInformation .NamedLikeFactoryMethod((ICIFResultsWriterFactory c) => c.GetErrorDetailsWriter(null, XNamespace.None)); } + [DebuggerStepThrough] private bool AccessedViaMRFResultsWriterFactory(IRequest request) { if (request.ParentRequest == null) { diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReport/CompletedBusManufacturerReport.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReport/CompletedBusManufacturerReport.cs index aa0bc7bdc48991dc7828d4a1ca1bd2c18333e639..f8daf58789c4bd3198af3a5e8578654d8905ae49 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReport/CompletedBusManufacturerReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/ManufacturerReport/ManufacturerReport_0_9/ManufacturerReport/CompletedBusManufacturerReport.cs @@ -75,20 +75,25 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. public Meter ActualChargeDepletingRange { get; set; } public Meter EquivalentAllElectricRange { get; set; } public Meter ZeroCO2EmissionsRange { get; set; } - public IFuelProperties AuxHeaterFuel { get; } + public IFuelProperties AuxHeaterFuel { get; set; } public Kilogram ZEV_FuelConsumption_AuxHtr { get; set; } - public Kilogram ZEV_CO2 { get; } + public Kilogram ZEV_CO2 { get; set; } + public void SetResultData(VectoRunData runData, IModalDataContainer data, double weightingFactor) { throw new NotImplementedException(); } - public string Error { get; } - public string StackTrace { get; } - public BatterySystemData BatteryData { get; set; } + public string Error => throw new NotImplementedException(); + public string StackTrace => throw new NotImplementedException(); + public BatterySystemData BatteryData + { + get; + set; + } - #endregion - } + #endregion + } private class CompletedBusFuelConsumption : IFuelConsumptionCorrection { #region Implementation of IFuelConsumptionCorrection @@ -206,7 +211,7 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. if (genericResult.OVCMode != specificResult.OVCMode) { throw new VectoException($"generic OVC Mode must be equal to specific OVC Mode! but was gen_ovc = {genericResult.OVCMode} != {specificResult.OVCMode} = spec_ovc"); } - result.BatteryData = genericResult.BatteryData; + result.BatteryData = specificResult.BatteryData; result.Mission = genericResult.Mission; result.Distance = genericResult.Distance; result.TotalVehicleMass = specificResult.TotalVehicleMass; @@ -249,10 +254,12 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. //Fuels result.FuelData = specificResult.FuelData; var co2Sum = 0.SI<Kilogram>(); - foreach (var fuel in specificResult.CorrectedFinalFuelConsumption.Keys) { + + foreach (var fuel in genericResult.CorrectedFinalFuelConsumption.Keys) { + var fuelFactor = CalculateFactor(combinedResults, r => r.FuelConsumptionFinal(fuel).TotalFuelConsumptionCorrected); var completedFuelConsumption = - fuelFactor * (primaryResult.EnergyConsumption[fuel] * specificResult.Distance ); + fuelFactor * (primaryResult.EnergyConsumption[fuel] * specificResult.Distance); var fuelConsumption = new CompletedBusFuelConsumption() { Fuel = specificResult.FuelData.Single(f => f.FuelType == fuel), EnergyDemand = completedFuelConsumption, @@ -260,32 +267,47 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.ManufacturerReport. co2Sum += fuelConsumption.TotalFuelConsumptionCorrected * fuelConsumption.Fuel.CO2PerFuelWeight; result.CorrectedFinalFuelConsumption.Add(fuel, fuelConsumption); } - - //primaryResult.CO2. result.CO2Total = co2Sum; + result.ElectricEnergyConsumption = null; + + if (!(primaryResult.ElectricEnergyConsumption?.IsEqual(0) ?? true)){ + var electricEnergyFactor = CalculateFactor(combinedResults, + r => r.ElectricEnergyConsumption); + result.ElectricEnergyConsumption = + electricEnergyFactor * primaryResult.ElectricEnergyConsumption * specificResult.Distance; + + } + - result.ElectricEnergyConsumption = 42.SI<WattSecond>(); - result.ZEV_FuelConsumption_AuxHtr = 42.SI<Kilogram>(); - result.ActualChargeDepletingRange = 3.SI<Meter>(); - result.EquivalentAllElectricRange = 300.SI<Meter>(); - result.ZeroCO2EmissionsRange = 400.SI<Meter>(); + if (specificResult.ZEV_FuelConsumption_AuxHtr?.IsGreaterOrEqual(0) ?? false) { + result.ZEV_FuelConsumption_AuxHtr = specificResult.ZEV_FuelConsumption_AuxHtr; + var auxHeaterFuel = specificResult.AuxHeaterFuel; - _results.Add(result); - } + result.AuxHeaterFuel = auxHeaterFuel; + result.FuelData.Add(auxHeaterFuel); + result.ZEV_CO2 = result.ZEV_FuelConsumption_AuxHtr * auxHeaterFuel.CO2PerFuelWeight; + } - private double CalculateEnergyFactor(XMLDeclarationReport.ResultEntry specific, - XMLDeclarationReport.ResultEntry generic) - { - return specific.EnergyConsumptionTotal.Value() / generic.EnergyConsumptionTotal.Value(); - } + if (genericResult.VectoRunData.JobType.IsOneOf(VectoSimulationJobType.BatteryElectricVehicle, + VectoSimulationJobType.IEPC_E)) { + var elRanges = DeclarationData.CalculateElectricRangesPEVCompletedBus(batteryData: result.BatteryData, + result.ElectricEnergyConsumption, result.Distance); + + result.EquivalentAllElectricRange = elRanges.EquivalentAllElectricRange; + result.ActualChargeDepletingRange = elRanges.ActualChargeDepletingRange; + result.ZeroCO2EmissionsRange = elRanges.ZeroCO2EmissionsRange; + } + + _results.Add(result); + } #endregion } diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimAirdragType.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimAirdragType.cs index 2c4d5a6fe1580bf18e98cce39c92b345bb04641a..03cb5a81197f94ba296ceb24d1a2747fdb924995 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimAirdragType.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/InterimComponents/InterimAirdragType.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Xml; using System.Xml.Linq; using System.Xml.XPath; @@ -6,6 +7,7 @@ using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Hashing; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; using TUGraz.VectoCore.Utils; @@ -65,6 +67,24 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF return retVal; } + protected XElement GetAirdragElement(IAirdragDeclarationInputData inputData, string version) + { + var retVal = new XElement(v24 + XMLNames.Component_AirDrag); + + var tmp = XElement.Load(inputData.XMLSource.ParentNode.CreateNavigator().ReadSubtree()); + var dataElement = tmp.Descendants().Where(e => e.Name.LocalName == XMLNames.ComponentDataWrapper).First(); + dataElement.Name = + v20 + XMLNames.ComponentDataWrapper; + dataElement.Add(new XAttribute("xmlns", inputData.DataSource.TypeVersion)); + + var signatureElement = tmp.Descendants().Where(e => e.Name.LocalName == XMLNames.DI_Signature).First(); + signatureElement.Name = v20 + XMLNames.DI_Signature; + + + retVal.Add(dataElement, signatureElement); + return retVal; + } + protected XElement GetAirdragElement(IAirdragDeclarationInputData airdrag) { switch (airdrag) { @@ -75,6 +95,16 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF case XMLDeclarationAirdragDataProviderV10 av10: return GetAirdragElement(av10); } + + + var sourceVersion = airdrag.DataSource.SourceVersion; + if (sourceVersion.IsOneOf(v10.GetVersionFromNamespaceUri(), v20.GetVersionFromNamespaceUri(), + v24.GetVersionFromNamespaceUri())) { + return GetAirdragElement(airdrag, ""); + } + + + throw new VectoException( $"Specific implementation for Airdrag Data (Interim Stage) missing {airdrag.GetType().Name}"); diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VehicleInformationFile/VehicleInformationFile_Interim.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VehicleInformationFile/VehicleInformationFile_Interim.cs index 287f6703d2d5e8d2b4c0664a1155444856328523..da27bb082276e684474a44d96d33598f9cf7ed76 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VehicleInformationFile/VehicleInformationFile_Interim.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/VehicleInformationFile_0_1/VehicleInformationFile/VehicleInformationFile_Interim.cs @@ -47,14 +47,14 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF public void Initialize(VectoRunData modelData) { - //InitializeVehicleData(modelData.MultistageVIFInputData); + //InitializeVehicleData(modelData.MultistageVifInputData); - _primaryVehicleInputData = modelData.MultistageVIFInputData.MultistageJobInputData.JobInputData.PrimaryVehicle; - _manufacturingStageInputData = modelData.MultistageVIFInputData.MultistageJobInputData.JobInputData.ManufacturingStages; - _consolidatedInputData = modelData.MultistageVIFInputData.MultistageJobInputData.JobInputData.ConsolidateManufacturingStage; - _vehicleInputData = modelData.MultistageVIFInputData.VehicleInputData; + _primaryVehicleInputData = modelData.MultistageVifInputData.MultistageJobInputData.JobInputData.PrimaryVehicle; + _manufacturingStageInputData = modelData.MultistageVifInputData.MultistageJobInputData.JobInputData.ManufacturingStages; + _consolidatedInputData = modelData.MultistageVifInputData.MultistageJobInputData.JobInputData.ConsolidateManufacturingStage; + _vehicleInputData = modelData.MultistageVifInputData.VehicleInputData; - _inputData = modelData.MultistageVIFInputData; + _inputData = modelData.MultistageVifInputData; SetInputXMLData(_primaryVehicleInputData.Vehicle.XMLSource); } diff --git a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/XMLMultistageBusReport.cs b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/XMLMultistageBusReport.cs index 8014f54f467732810739382b03926e1f6967addc..fded14e85c6599807f2f48f95d15fb96424570da 100644 --- a/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/XMLMultistageBusReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/DeclarationReports/VehicleInformationFile/XMLMultistageBusReport.cs @@ -96,10 +96,10 @@ namespace TUGraz.VectoCore.OutputData.XML.DeclarationReports.VehicleInformationF public virtual void Initialize(VectoRunData modelData) { - _primaryVehicleInputData = modelData.MultistageVIFInputData.MultistageJobInputData.JobInputData.PrimaryVehicle; - _manufacturingStageInputData = modelData.MultistageVIFInputData.MultistageJobInputData.JobInputData.ManufacturingStages; - _consolidatedInputData = modelData.MultistageVIFInputData.MultistageJobInputData.JobInputData.ConsolidateManufacturingStage; - _vehicleInputData = modelData.MultistageVIFInputData.VehicleInputData; + _primaryVehicleInputData = modelData.MultistageVifInputData.MultistageJobInputData.JobInputData.PrimaryVehicle; + _manufacturingStageInputData = modelData.MultistageVifInputData.MultistageJobInputData.JobInputData.ManufacturingStages; + _consolidatedInputData = modelData.MultistageVifInputData.MultistageJobInputData.JobInputData.ConsolidateManufacturingStage; + _vehicleInputData = modelData.MultistageVifInputData.VehicleInputData; SetInputXMLData(_primaryVehicleInputData.Vehicle.XMLSource); } diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/GroupNames.Designer.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/GroupNames.Designer.cs similarity index 69% rename from VectoCore/VectoCore/OutputData/XML/GroupWriter/GroupNames.Designer.cs rename to VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/GroupNames.Designer.cs index 0ae30203aab29273aa37cac01521f77a1250c101..dc2f57c8675e1500af94ee123f0ab2cc11171ad5 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/GroupNames.Designer.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/GroupNames.Designer.cs @@ -8,7 +8,7 @@ // </auto-generated> //------------------------------------------------------------------------------ -namespace TUGraz.VectoCore.OutputData.XML.GroupWriter { +namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration { using System; @@ -19,10 +19,10 @@ namespace TUGraz.VectoCore.OutputData.XML.GroupWriter { // 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", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class GroupNames { + public class GroupNames { private static global::System.Resources.ResourceManager resourceMan; @@ -36,10 +36,10 @@ namespace TUGraz.VectoCore.OutputData.XML.GroupWriter { /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TUGraz.VectoCore.OutputData.XML.GroupWriter.GroupNames", typeof(GroupNames).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.GroupNames", typeof(GroupNames).Assembly); resourceMan = temp; } return resourceMan; @@ -51,7 +51,7 @@ namespace TUGraz.VectoCore.OutputData.XML.GroupWriter { /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -63,16 +63,43 @@ namespace TUGraz.VectoCore.OutputData.XML.GroupWriter { /// <summary> /// Looks up a localized string similar to ADAS_Conventional_Type. /// </summary> - internal static string ADAS_Conventional_Type { + public static string ADAS_Conventional_Type { get { return ResourceManager.GetString("ADAS_Conventional_Type", resourceCulture); } } + /// <summary> + /// Looks up a localized string similar to ADAS_HEV_Type. + /// </summary> + public static string ADAS_HEV_Type { + get { + return ResourceManager.GetString("ADAS_HEV_Type", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to ADAS_IEPC_Type. + /// </summary> + public static string ADAS_IEPC_Type { + get { + return ResourceManager.GetString("ADAS_IEPC_Type", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to ADAS_PEV_Type. + /// </summary> + public static string ADAS_PEV_Type { + get { + return ResourceManager.GetString("ADAS_PEV_Type", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to BusAuxElectricSystemLightsGroup. /// </summary> - internal static string BusAuxElectricSystemLightsGroup { + public static string BusAuxElectricSystemLightsGroup { get { return ResourceManager.GetString("BusAuxElectricSystemLightsGroup", resourceCulture); } @@ -81,7 +108,7 @@ namespace TUGraz.VectoCore.OutputData.XML.GroupWriter { /// <summary> /// Looks up a localized string similar to BusAuxElectricSystemSupplySequenceGroup. /// </summary> - internal static string BusAuxElectricSystemSupplySequenceGroup { + public static string BusAuxElectricSystemSupplySequenceGroup { get { return ResourceManager.GetString("BusAuxElectricSystemSupplySequenceGroup", resourceCulture); } @@ -90,7 +117,7 @@ namespace TUGraz.VectoCore.OutputData.XML.GroupWriter { /// <summary> /// Looks up a localized string similar to BusAuxHVACConventionalSequenceGroup. /// </summary> - internal static string BusAuxHVACConventionalSequenceGroup { + public static string BusAuxHVACConventionalSequenceGroup { get { return ResourceManager.GetString("BusAuxHVACConventionalSequenceGroup", resourceCulture); } @@ -99,16 +126,25 @@ namespace TUGraz.VectoCore.OutputData.XML.GroupWriter { /// <summary> /// Looks up a localized string similar to BusAuxHVACHeatPumpSequenceGroup. /// </summary> - internal static string BusAuxHVACHeatPumpSequenceGroup { + public static string BusAuxHVACHeatPumpSequenceGroup { get { return ResourceManager.GetString("BusAuxHVACHeatPumpSequenceGroup", resourceCulture); } } + /// <summary> + /// Looks up a localized string similar to BusAuxHVACxEVSequenceGroup. + /// </summary> + public static string BusAuxHVACxEVSequenceGroup { + get { + return ResourceManager.GetString("BusAuxHVACxEVSequenceGroup", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to Vehicle_CompletedBus_DimensionsSequenceGroup. /// </summary> - internal static string Vehicle_CompletedBus_DimensionsSequenceGroup { + public static string Vehicle_CompletedBus_DimensionsSequenceGroup { get { return ResourceManager.GetString("Vehicle_CompletedBus_DimensionsSequenceGroup", resourceCulture); } @@ -117,7 +153,7 @@ namespace TUGraz.VectoCore.OutputData.XML.GroupWriter { /// <summary> /// Looks up a localized string similar to Vehicle_CompletedBus_GeneralParametersSequenceGroup. /// </summary> - internal static string Vehicle_CompletedBus_GeneralParametersSequenceGroup { + public static string Vehicle_CompletedBus_GeneralParametersSequenceGroup { get { return ResourceManager.GetString("Vehicle_CompletedBus_GeneralParametersSequenceGroup", resourceCulture); } @@ -126,7 +162,7 @@ namespace TUGraz.VectoCore.OutputData.XML.GroupWriter { /// <summary> /// Looks up a localized string similar to Vehicle_CompletedBus_PassengerCountSequenceGroup. /// </summary> - internal static string Vehicle_CompletedBus_PassengerCountSequenceGroup { + public static string Vehicle_CompletedBus_PassengerCountSequenceGroup { get { return ResourceManager.GetString("Vehicle_CompletedBus_PassengerCountSequenceGroup", resourceCulture); } @@ -135,7 +171,7 @@ namespace TUGraz.VectoCore.OutputData.XML.GroupWriter { /// <summary> /// Looks up a localized string similar to Vehicle_CompletedBusParametersSequenceGroup. /// </summary> - internal static string Vehicle_CompletedBusParametersSequenceGroup { + public static string Vehicle_CompletedBusParametersSequenceGroup { get { return ResourceManager.GetString("Vehicle_CompletedBusParametersSequenceGroup", resourceCulture); } diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/GroupNames.resx b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/GroupNames.resx new file mode 100644 index 0000000000000000000000000000000000000000..bdb64d3d903c2b236b31a0142feb5962558902cb --- /dev/null +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/GroupNames.resx @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="ADAS_Conventional_Type" xml:space="preserve"> + <value>ADAS_Conventional_Type</value> + </data> + <data name="ADAS_HEV_Type" xml:space="preserve"> + <value>ADAS_HEV_Type</value> + </data> + <data name="ADAS_IEPC_Type" xml:space="preserve"> + <value>ADAS_IEPC_Type</value> + </data> + <data name="ADAS_PEV_Type" xml:space="preserve"> + <value>ADAS_PEV_Type</value> + </data> + <data name="BusAuxElectricSystemLightsGroup" xml:space="preserve"> + <value>BusAuxElectricSystemLightsGroup</value> + </data> + <data name="BusAuxElectricSystemSupplySequenceGroup" xml:space="preserve"> + <value>BusAuxElectricSystemSupplySequenceGroup</value> + </data> + <data name="BusAuxHVACConventionalSequenceGroup" xml:space="preserve"> + <value>BusAuxHVACConventionalSequenceGroup</value> + </data> + <data name="BusAuxHVACHeatPumpSequenceGroup" xml:space="preserve"> + <value>BusAuxHVACHeatPumpSequenceGroup</value> + </data> + <data name="BusAuxHVACxEVSequenceGroup" xml:space="preserve"> + <value>BusAuxHVACxEVSequenceGroup</value> + </data> + <data name="Vehicle_CompletedBusParametersSequenceGroup" xml:space="preserve"> + <value>Vehicle_CompletedBusParametersSequenceGroup</value> + </data> + <data name="Vehicle_CompletedBus_DimensionsSequenceGroup" xml:space="preserve"> + <value>Vehicle_CompletedBus_DimensionsSequenceGroup</value> + </data> + <data name="Vehicle_CompletedBus_GeneralParametersSequenceGroup" xml:space="preserve"> + <value>Vehicle_CompletedBus_GeneralParametersSequenceGroup</value> + </data> + <data name="Vehicle_CompletedBus_PassengerCountSequenceGroup" xml:space="preserve"> + <value>Vehicle_CompletedBus_PassengerCountSequenceGroup</value> + </data> +</root> \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusDimensionsWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusDimensionsWriter.cs index f859fc1bf2953cef3cf42fac0f948dcfa27e52fa..77f0c5aa6fcb2b247c0c0059474746b856f9b224 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusDimensionsWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusDimensionsWriter.cs @@ -6,9 +6,9 @@ using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.Vehicle.CompletedBus { - class CompletedBusDimensionsWriter_V2_10_2 : GroupWriter, IVehicleDeclarationGroupWriter + class CompletedBusDimensionsWriter_V2_4 : GroupWriter, IVehicleDeclarationGroupWriter { - public CompletedBusDimensionsWriter_V2_10_2(XNamespace writerNamespace) : base(writerNamespace) { } + public CompletedBusDimensionsWriter_V2_4(XNamespace writerNamespace) : base(writerNamespace) { } public static XElement[] GetGroupElements(IVehicleDeclarationInputData vehicle, XNamespace writerNamespace) { diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusGeneralParametersWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusGeneralParametersWriter.cs index dcc05754ef4298df12451302a3db203a86ba65c4..d490bb66ae5d1f6f6f40f1dbc9688fe9fbadc4df 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusGeneralParametersWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusGeneralParametersWriter.cs @@ -5,9 +5,9 @@ using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.Vehicle.CompletedBus { - public class CompletedBusGeneralParametersWriterV2_10_2 : GroupWriter, IVehicleDeclarationGroupWriter + public class CompletedBusGeneralParametersWriterV2_4 : GroupWriter, IVehicleDeclarationGroupWriter { - public CompletedBusGeneralParametersWriterV2_10_2(XNamespace writerNamespace) : base(writerNamespace) + public CompletedBusGeneralParametersWriterV2_4(XNamespace writerNamespace) : base(writerNamespace) { } diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusParametersWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusParametersWriter.cs index 4de8ce5d7b280829e1df71cfcfec10053addf0be..8e90578ad1d115a294880c8fb3e15313ad7419d6 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusParametersWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusParametersWriter.cs @@ -6,9 +6,9 @@ using TUGraz.VectoCommon.Resources; namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.Vehicle.CompletedBus { - class CompletedBusParametersWriterV2_10_2 : GroupWriter, IVehicleDeclarationGroupWriter + class CompletedBusParametersWriterV2_4 : GroupWriter, IVehicleDeclarationGroupWriter { - public CompletedBusParametersWriterV2_10_2(XNamespace writerNamespace) : base(writerNamespace) { } + public CompletedBusParametersWriterV2_4(XNamespace writerNamespace) : base(writerNamespace) { } public static XElement[] GetGroupElements(IVehicleDeclarationInputData vehicle, XNamespace writerNamespace) diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusPassengerCountWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusPassengerCountWriter.cs index d9eb80284c982e61a129083eb2561a6282b7b0ac..c1b011455d0edda3e8a98611ec04b0b40ab022ee 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusPassengerCountWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/CompletedBus/CompletedBusPassengerCountWriter.cs @@ -5,9 +5,9 @@ using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.Vehicle.CompletedBus { - class CompletedBusPassengerCountWriter_V2_10_2 : GroupWriter, IVehicleDeclarationGroupWriter + class CompletedBusPassengerCountWriter_V2_4 : GroupWriter, IVehicleDeclarationGroupWriter { - public CompletedBusPassengerCountWriter_V2_10_2(XNamespace writerNamespace) : base(writerNamespace) { } + public CompletedBusPassengerCountWriter_V2_4(XNamespace writerNamespace) : base(writerNamespace) { } diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemLightsGroupWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemLightsGroupWriter.cs index ef235c4a944bda8429943f5d97151b3e28e909e4..e67c9ab54fc70702ef8f4a1a624e8c624ff0366a 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemLightsGroupWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemLightsGroupWriter.cs @@ -1,25 +1,27 @@ -using System.Xml.Linq; +using System.Linq; +using System.Xml.Linq; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.Vehicle.Components.Auxiliaries { - class BusAuxElectricSystemLightsGroupWriter_v2_10_2 : GroupWriter, IBusAuxiliariesDeclarationGroupWriter + class BusAuxElectricSystemLightsGroupWriter_v2_4 : GroupWriter, IBusAuxiliariesDeclarationGroupWriter { - public BusAuxElectricSystemLightsGroupWriter_v2_10_2(XNamespace writerNamespace) : base(writerNamespace) { } + public BusAuxElectricSystemLightsGroupWriter_v2_4(XNamespace writerNamespace) : base(writerNamespace) { } #region Overrides of GroupWriter public XElement[] GetGroupElements(IBusAuxiliariesDeclarationData aux) { - return new XElement[] { + var elements = new XElement[] { new XElement(_writerNamespace + XMLNames.Bus_Interiorlights, aux.ElectricConsumers.InteriorLightsLED), - new XElement(_writerNamespace + XMLNames.Bus_Dayrunninglights, - aux.ElectricConsumers.DayrunninglightsLED), + new XElement(_writerNamespace + XMLNames.Bus_Dayrunninglights, aux.ElectricConsumers.DayrunninglightsLED), new XElement(_writerNamespace + XMLNames.Bus_Positionlights, aux.ElectricConsumers.PositionlightsLED), new XElement(_writerNamespace + XMLNames.Bus_Brakelights, aux.ElectricConsumers.BrakelightsLED), new XElement(_writerNamespace + XMLNames.Bus_Headlights, aux.ElectricConsumers.HeadlightsLED), }; + return elements.Where(xel => !xel.Value.IsNullOrEmpty()).ToArray(); } #endregion diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemSupplyGroupWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemSupplyGroupWriter.cs index e6471f322012fa320f56d1eb34697954c7f95999..344c2110e6101a76fa0fbdeed0dfa038c97adb72 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemSupplyGroupWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxElectricSystemSupplyGroupWriter.cs @@ -4,9 +4,9 @@ using TUGraz.VectoCommon.InputData; namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.Vehicle.Components.Auxiliaries { - class BusAuxElectricSystemSupplyGroupWriter_v2_10_2 : GroupWriter, IBusAuxiliariesDeclarationGroupWriter + class BusAuxElectricSystemSupplyGroupWriter_v2_4 : GroupWriter, IBusAuxiliariesDeclarationGroupWriter { - public BusAuxElectricSystemSupplyGroupWriter_v2_10_2(XNamespace writerNamespace) : base(writerNamespace) { } + public BusAuxElectricSystemSupplyGroupWriter_v2_4(XNamespace writerNamespace) : base(writerNamespace) { } #region Implementation of IBusAuxiliariesDeclarationGroupWriter diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACConventionalGroupWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACConventionalGroupWriter.cs index 90246d90b312b4297fcafd2833196bb8b9811702..dda6fb22a7a48328ab244521383483b5de5c63f7 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACConventionalGroupWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACConventionalGroupWriter.cs @@ -1,34 +1,66 @@ using System.Collections.Generic; +using System.Linq; using System.Xml.Linq; using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.Vehicle.Components.Auxiliaries { - public class BusAuxHVACConventionalGroupWriter_v2_10_2 : GroupWriter, IBusAuxiliariesDeclarationGroupWriter - { - private readonly IGroupWriterFactory _groupWriterFactory; + public abstract class BuxAuxHVACGroupWriter_v2_4 : GroupWriter, IBusAuxiliariesDeclarationGroupWriter + { + protected readonly IGroupWriterFactory _groupWriterFactory; - public BusAuxHVACConventionalGroupWriter_v2_10_2(XNamespace writerNamespace, - IGroupWriterFactory groupWriterFactory) : base(writerNamespace) + protected BuxAuxHVACGroupWriter_v2_4(XNamespace writerNamespace, IGroupWriterFactory groupWriterFactory) : base(writerNamespace) { _groupWriterFactory = groupWriterFactory; + } + + #region Implementation of IBusAuxiliariesDeclarationGroupWriter + + public abstract XElement[] GetGroupElements(IBusAuxiliariesDeclarationData aux); + + #endregion + } + + public class BusAuxHVACConventionalGroupWriter_v2_4 : BuxAuxHVACGroupWriter_v2_4 + { + public BusAuxHVACConventionalGroupWriter_v2_4(XNamespace writerNamespace, + IGroupWriterFactory groupWriterFactory) : base(writerNamespace, groupWriterFactory) + { + } #region Implementation of IBusAuxiliariesDeclarationGroupWriter - public XElement[] GetGroupElements(IBusAuxiliariesDeclarationData aux) + public override XElement[] GetGroupElements(IBusAuxiliariesDeclarationData aux) { var elements = new List<XElement>(); - elements.Add(new XElement(_writerNamespace + XMLNames.Bus_SystemConfiguration, - aux.HVACAux.SystemConfiguration.ToXmlFormat())); + //if (aux.HVACAux?.SystemConfiguration != null) { + // elements.Add(new XElement(_writerNamespace + XMLNames.Bus_SystemConfiguration, + // aux.HVACAux.SystemConfiguration.ToXmlFormat())); - elements.AddRange(_groupWriterFactory + // } + + var groupElements = _groupWriterFactory .GetBusAuxiliariesDeclarationGroupWriter(GroupNames.BusAuxHVACHeatPumpSequenceGroup, _writerNamespace) - .GetGroupElements(aux)); - elements.Add(new XElement(_writerNamespace + XMLNames.Bus_AuxiliaryHeaterPower, + .GetGroupElements(aux); + +#if NET45 + foreach (var e in groupElements) { + elements.Add(e); + } +#else + elements.AddRange(groupElements); + +#endif + + + + + elements.Add(new XElement(_writerNamespace + XMLNames.Bus_AuxiliaryHeaterPower, aux.HVACAux.AuxHeaterPower?.ToXMLFormat(0))); elements.Add(new XElement(_writerNamespace + XMLNames.Bus_DoubleGlazing, aux.HVACAux.DoubleGlazing)); elements.Add(new XElement(_writerNamespace + XMLNames.Bus_AdjustableAuxiliaryHeater, @@ -36,7 +68,27 @@ namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.Vehicle.Compon elements.Add(new XElement(_writerNamespace + XMLNames.Bus_SeparateAirDistributionDucts, aux.HVACAux.SeparateAirDistributionDucts)); - return elements.ToArray(); + return elements.Where(xEl => !xEl.Value.IsNullOrEmpty()).ToArray(); + } + +#endregion + } + + public class BusAuxHVACxEVGroupWriter_v2_4 : BuxAuxHVACGroupWriter_v2_4 + { + public BusAuxHVACxEVGroupWriter_v2_4(XNamespace writerNamespace, IGroupWriterFactory groupWriterFactory) : base(writerNamespace, groupWriterFactory) { } + + #region Overrides of BuxAuxHVACGroupWriter_v2_4 + + public override XElement[] GetGroupElements(IBusAuxiliariesDeclarationData aux) + { + var elements = new List<XElement>() { + new XElement(_writerNamespace + XMLNames.Bus_WaterElectricHeater, aux.HVACAux.WaterElectricHeater), + new XElement(_writerNamespace + XMLNames.Bus_AirElectricHeater, aux.HVACAux.AirElectricHeater), + new XElement(_writerNamespace + XMLNames.Bus_OtherHeatingTechnology, aux.HVACAux.OtherHeatingTechnology) + }; + + return elements.Where(xEl => !xEl.Value.IsNullOrEmpty()).ToArray(); } #endregion diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACHeatPumpWriter.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACHeatPumpWriter.cs index 0c1694035f0232e115e095a2260c62d6034431d7..3348ab711fbcd308ac6dc4bacddde73a44d1dd67 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACHeatPumpWriter.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/Declaration/Vehicle/Components/Auxiliaries/BusAuxHVACHeatPumpWriter.cs @@ -1,19 +1,24 @@ -using System.Xml.Linq; +using System.Linq; +using System.Xml.Linq; using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.Vehicle.Components.Auxiliaries { - class BusAuxHVACHeatPumpWriter_v2_10_2 : GroupWriter, IBusAuxiliariesDeclarationGroupWriter + class BusAuxHVACHeatPumpWriter_v2_4 : GroupWriter, IBusAuxiliariesDeclarationGroupWriter { - public BusAuxHVACHeatPumpWriter_v2_10_2(XNamespace writerNamespace) : base(writerNamespace) { } + public BusAuxHVACHeatPumpWriter_v2_4(XNamespace writerNamespace) : base(writerNamespace) { } #region Implementation of IBusAuxiliariesDeclarationGroupWriter public XElement[] GetGroupElements(IBusAuxiliariesDeclarationData aux) { - return new XElement[] { + var elements = new XElement[] { + new XElement(_writerNamespace + XMLNames.Bus_SystemConfiguration, aux.HVACAux.SystemConfiguration?.ToXmlFormat()), + + GetHeatPumpGroupElement( xmlNameWrapper: XMLNames.Bus_HeatPumpTypeDriver, xmlNameFirstComponent: XMLNames.BusHVACHeatPumpCooling, @@ -28,6 +33,7 @@ namespace TUGraz.VectoCore.OutputData.XML.GroupWriter.Declaration.Vehicle.Compon xmlNameSecondComponent: XMLNames.BusHVACHeatPumpHeating, secondValue: aux.HVACAux.HeatPumpTypeHeatingPassengerCompartment.GetLabel()) }; + return elements.Where(xEl => !xEl.Value.IsNullOrEmpty()).ToArray(); } diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/GroupNames.resx b/VectoCore/VectoCore/OutputData/XML/GroupWriter/GroupNames.resx deleted file mode 100644 index a6e98f3e166f325a4d47f8cb4e10e1290eacfdcf..0000000000000000000000000000000000000000 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/GroupNames.resx +++ /dev/null @@ -1,128 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 1.3 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">1.3</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1">this is my long string</data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - [base64 mime encoded serialized .NET Framework object] - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - [base64 mime encoded string representing a byte array form of the .NET Framework object] - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>1.3</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <data name="Vehicle_CompletedBus_GeneralParametersSequenceGroup" xml:space="preserve"> - <value>Vehicle_CompletedBus_GeneralParametersSequenceGroup</value> - </data> - <data name="Vehicle_CompletedBusParametersSequenceGroup" xml:space="preserve"> - <value>Vehicle_CompletedBusParametersSequenceGroup</value> - </data> - <data name="Vehicle_CompletedBus_DimensionsSequenceGroup" xml:space="preserve"> - <value>Vehicle_CompletedBus_DimensionsSequenceGroup</value> - </data> - <data name="Vehicle_CompletedBus_PassengerCountSequenceGroup" xml:space="preserve"> - <value>Vehicle_CompletedBus_PassengerCountSequenceGroup</value> - </data> - <data name="BusAuxElectricSystemLightsGroup" xml:space="preserve"> - <value>BusAuxElectricSystemLightsGroup</value> - </data> - <data name="BusAuxElectricSystemSupplySequenceGroup" xml:space="preserve"> - <value>BusAuxElectricSystemSupplySequenceGroup</value> - </data> - <data name="BusAuxHVACConventionalSequenceGroup" xml:space="preserve"> - <value>BusAuxHVACConventionalSequenceGroup</value> - </data> - <data name="BusAuxHVACHeatPumpSequenceGroup" xml:space="preserve"> - <value>BusAuxHVACHeatPumpSequenceGroup</value> - </data> - <data name="ADAS_Conventional_Type" xml:space="preserve"> - <value>ADAS_Conventional_Type</value> - </data> -</root> \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/XML/GroupWriter/XMLGroupWriterNinjectModule.cs b/VectoCore/VectoCore/OutputData/XML/GroupWriter/XMLGroupWriterNinjectModule.cs index 084c13b344a0414f3707190a63d4f11e788af428..f81681cc05d8238ad5000e2257c78f7ee0f2936e 100644 --- a/VectoCore/VectoCore/OutputData/XML/GroupWriter/XMLGroupWriterNinjectModule.cs +++ b/VectoCore/VectoCore/OutputData/XML/GroupWriter/XMLGroupWriterNinjectModule.cs @@ -21,26 +21,28 @@ namespace TUGraz.VectoCore.OutputData.XML.GroupWriter { Bind<IGroupWriterFactory>().ToFactory(() => new UseFirstTwoArgumentsAsInstanceProvider(1, false)).InSingletonScope(); - ///Vehicle V2_10_2 - var v2102 = XMLDeclarationNamespaces.V24; - Bind<IVehicleDeclarationGroupWriter>().To<CompletedBusGeneralParametersWriterV2_10_2>().InSingletonScope(). - Named(GetName(GroupNames.Vehicle_CompletedBus_GeneralParametersSequenceGroup, v2102)); - Bind<IVehicleDeclarationGroupWriter>().To<CompletedBusParametersWriterV2_10_2>().InSingletonScope(). - Named(GetName(GroupNames.Vehicle_CompletedBusParametersSequenceGroup, v2102)); - Bind<IVehicleDeclarationGroupWriter>().To<CompletedBusDimensionsWriter_V2_10_2>().InSingletonScope(). - Named(GetName(GroupNames.Vehicle_CompletedBus_DimensionsSequenceGroup, v2102)); - Bind<IVehicleDeclarationGroupWriter>().To<CompletedBusPassengerCountWriter_V2_10_2>().InSingletonScope(). - Named(GetName(GroupNames.Vehicle_CompletedBus_PassengerCountSequenceGroup, v2102)); + ///Vehicle V2_4 + var v24 = XMLDeclarationNamespaces.V24; + Bind<IVehicleDeclarationGroupWriter>().To<CompletedBusGeneralParametersWriterV2_4>().InSingletonScope(). + Named(GetName(GroupNames.Vehicle_CompletedBus_GeneralParametersSequenceGroup, v24)); + Bind<IVehicleDeclarationGroupWriter>().To<CompletedBusParametersWriterV2_4>().InSingletonScope(). + Named(GetName(GroupNames.Vehicle_CompletedBusParametersSequenceGroup, v24)); + Bind<IVehicleDeclarationGroupWriter>().To<CompletedBusDimensionsWriter_V2_4>().InSingletonScope(). + Named(GetName(GroupNames.Vehicle_CompletedBus_DimensionsSequenceGroup, v24)); + Bind<IVehicleDeclarationGroupWriter>().To<CompletedBusPassengerCountWriter_V2_4>().InSingletonScope(). + Named(GetName(GroupNames.Vehicle_CompletedBus_PassengerCountSequenceGroup, v24)); - ///BusAuxiliaries_V2_10_2 - Bind<IBusAuxiliariesDeclarationGroupWriter>().To<BusAuxElectricSystemLightsGroupWriter_v2_10_2>().InSingletonScope(). - Named(GetName(GroupNames.BusAuxElectricSystemLightsGroup, v2102)); - Bind<IBusAuxiliariesDeclarationGroupWriter>().To<BusAuxElectricSystemSupplyGroupWriter_v2_10_2>().InSingletonScope() - .Named(GetName(GroupNames.BusAuxElectricSystemSupplySequenceGroup, v2102)); - Bind<IBusAuxiliariesDeclarationGroupWriter>().To<BusAuxHVACConventionalGroupWriter_v2_10_2>().InSingletonScope() - .Named(GetName(GroupNames.BusAuxHVACConventionalSequenceGroup, v2102)); - Bind<IBusAuxiliariesDeclarationGroupWriter>().To<BusAuxHVACHeatPumpWriter_v2_10_2>().InSingletonScope() - .Named(GetName(GroupNames.BusAuxHVACHeatPumpSequenceGroup, v2102)); + ///BusAuxiliaries_V2_4 + Bind<IBusAuxiliariesDeclarationGroupWriter>().To<BusAuxElectricSystemLightsGroupWriter_v2_4>().InSingletonScope(). + Named(GetName(GroupNames.BusAuxElectricSystemLightsGroup, v24)); + Bind<IBusAuxiliariesDeclarationGroupWriter>().To<BusAuxElectricSystemSupplyGroupWriter_v2_4>().InSingletonScope() + .Named(GetName(GroupNames.BusAuxElectricSystemSupplySequenceGroup, v24)); + Bind<IBusAuxiliariesDeclarationGroupWriter>().To<BusAuxHVACConventionalGroupWriter_v2_4>().InSingletonScope() + .Named(GetName(GroupNames.BusAuxHVACConventionalSequenceGroup, v24)); + Bind<IBusAuxiliariesDeclarationGroupWriter>().To<BusAuxHVACxEVGroupWriter_v2_4>().InSingletonScope() + .Named(GetName(GroupNames.BusAuxHVACxEVSequenceGroup, v24)); + Bind<IBusAuxiliariesDeclarationGroupWriter>().To<BusAuxHVACHeatPumpWriter_v2_4>().InSingletonScope() + .Named(GetName(GroupNames.BusAuxHVACHeatPumpSequenceGroup, v24)); } diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs index d637e284fbdf65d722d64a435705724a899820d4..4b5fd91f5336b4c658faf616d0c4ef42427a5a4a 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReport.cs @@ -34,7 +34,6 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Data; using System.Linq; -using System.Xml; using System.Xml.Linq; using System.Xml.XPath; using TUGraz.VectoCommon.BusAuxiliaries; @@ -230,6 +229,13 @@ namespace TUGraz.VectoCore.OutputData.XML EquivalentAllElectricRange = ranges.EquivalentAllElectricRange; ZeroCO2EmissionsRange = ranges.ZeroCO2EmissionsRange; ElectricEnergyConsumption = ranges.ElectricEnergyConsumption; + + var fc = data.CorrectedModalData.FuelCorrection.Values.FirstOrDefault(); + if (fc != null) { + ZEV_FuelConsumption_AuxHtr = fc.FC_AUXHTR_KM * Distance; + AuxHeaterFuel = fc.Fuel; + + } } if (data.HasGearbox && !runData.JobType.IsOneOf(VectoSimulationJobType.IEPC_E, VectoSimulationJobType.IEPC_S)) { diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportCompletedVehicle.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportCompletedVehicle.cs index 6d362fb244a4f0b50bbde67ec61c3e9a75622dc6..fcd9e4c1369febdfbeef31ab7f1edbfadb3eec6a 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportCompletedVehicle.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportCompletedVehicle.cs @@ -103,12 +103,15 @@ namespace TUGraz.VectoCore.OutputData.XML protected internal override void DoWriteReport() { - foreach (var specificResult in Results.Where(x => VehicleClassHelper.IsCompletedBus(x.VehicleClass)).OrderBy(x => x.VehicleClass) + foreach (var specificResult in Results.Where(x => x.VehicleClass.IsCompletedBus()).OrderBy(x => x.VehicleClass) .ThenBy(x => x.FuelMode).ThenBy(x => x.Mission)) { - var genericResult = Results.First(x => x.VehicleClass.IsPrimaryBus() && x.FuelMode == specificResult.FuelMode && - x.Mission == specificResult.Mission && x.LoadingType == specificResult.LoadingType && x.OVCMode == specificResult.OVCMode); + var genericResult = Results.First(x => x.VehicleClass.IsPrimaryBus() + && x.FuelMode == specificResult.FuelMode + && x.Mission == specificResult.Mission + && x.LoadingType == specificResult.LoadingType + && x.OVCMode == specificResult.OVCMode); var primaryResult = genericResult.PrimaryResult ?? specificResult.PrimaryResult; if (primaryResult == null) { diff --git a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportFactory.cs b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportFactory.cs index 0d6cd5e7927b13329e0c4e804aad9501d156ed09..e22acbc95d7e3cd5fa06787cf62fd262958be4ec 100644 --- a/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportFactory.cs +++ b/VectoCore/VectoCore/OutputData/XML/XMLDeclarationReportFactory.cs @@ -67,13 +67,13 @@ namespace TUGraz.VectoCore.OutputData.XML : null; } - private IDeclarationReport CreateDeclarationReport(IMultistageVIFInputData multistageVifInputData, IOutputDataWriter outputDataWriter) + private IDeclarationReport CreateDeclarationReport(IMultistageVIFInputData multiStepVifInputData, IOutputDataWriter outputDataWriter) { - if (multistageVifInputData.VehicleInputData == null) + if (multiStepVifInputData.VehicleInputData == null) { var reportCompleted = new XMLDeclarationReportCompletedVehicle(outputDataWriter, _mrfFactory, _cifFactory, _vifFactory) { - PrimaryVehicleReportInputData = multistageVifInputData.MultistageJobInputData.JobInputData.PrimaryVehicle, + PrimaryVehicleReportInputData = multiStepVifInputData.MultistageJobInputData.JobInputData.PrimaryVehicle, }; return reportCompleted; } diff --git a/VectoCore/VectoCore/Utils/Ninject/CombineArgumentsToNameInstanceProviders.cs b/VectoCore/VectoCore/Utils/Ninject/CombineArgumentsToNameInstanceProviders.cs index 5916afc3abf2a9e14b510b98d12bf9f84c45fc82..f6142ac19dee179c1a3da45165d6ef4264354b67 100644 --- a/VectoCore/VectoCore/Utils/Ninject/CombineArgumentsToNameInstanceProviders.cs +++ b/VectoCore/VectoCore/Utils/Ninject/CombineArgumentsToNameInstanceProviders.cs @@ -21,17 +21,22 @@ namespace TUGraz.VectoCore.Utils.Ninject /// </summary> public CombineToName combineToNameDelegate; /// <summary> - /// Specifies the number of arguments that not passed to the constructor + /// Specifies the number of arguments that are NOT passed to the constructor /// </summary> public int skipArguments; /// <summary> /// Specifies the number of arguments that are passed to the <see cref="combineToNameDelegate"/> /// </summary> public int takeArguments; - /// <summary> - /// Sets the methods for which these settings apply, leave empty for default settings - /// </summary> - public MethodInfo[] methods; + + //TODO: use expressions instead of method info + // Expression<Func<int, string>> expression = i => i.ToString(); + // MethodInfo method = ((MethodCallExpression)expression.Body).Method; + + /// <summary> + /// Sets the methods for which these settings apply, leave empty for default settings + /// </summary> + public MethodInfo[] methods; } public delegate string CombineToName(params object[] arguments); @@ -41,22 +46,32 @@ namespace TUGraz.VectoCore.Utils.Ninject /// Constructor for CombineArgumentsToNameInstanceProvider /// </summary> - public CombineArgumentsToNameInstanceProvider(params MethodSettings[] settings) + public CombineArgumentsToNameInstanceProvider(params MethodSettings[] settings) : this(false, settings) { - if (settings != null && settings.Any(s => s.methods == null)) { + + } + + public CombineArgumentsToNameInstanceProvider(bool fallback, params MethodSettings[] settings) + { + Fallback = fallback; + if (settings != null && settings.Any(s => s.methods == null)) + { throw new ArgumentException($"At least one method has to be specified in the MethodSetting"); } - if (settings != null) { - foreach (var setting in settings) { - foreach (var method in setting.methods) { + if (settings != null) + { + foreach (var setting in settings) + { + foreach (var method in setting.methods) + { _methodSettings.Add(method, setting); } } - + } - } + } #region Overrides of StandardInstanceProvider @@ -68,7 +83,7 @@ namespace TUGraz.VectoCore.Utils.Ninject } catch (Exception e) { var name = GetName(methodInfo, arguments); - throw new VectoException("failed to create instance for '{1}' via '{0}' version '{2}' name'{3}'", e, methodInfo.Name, methodInfo.ReturnType.Name, arguments[0].ToString(), name); + throw new VectoException("failed to create instance for '{1}' via '{0}' version '{2}' name'{3}'", e, methodInfo, methodInfo.ReturnType.Name, arguments[0].ToString(), name); //throw e; } @@ -76,7 +91,7 @@ namespace TUGraz.VectoCore.Utils.Ninject protected override string GetName(MethodInfo methodInfo, object[] arguments) { - if (!_methodSettings.TryGetValue(methodInfo, out var methodSettings)) { + if (!GetMethodSettings(methodInfo, arguments, out var methodSettings)) { return base.GetName(methodInfo, arguments); } @@ -84,9 +99,26 @@ namespace TUGraz.VectoCore.Utils.Ninject } + bool GetMethodSettings(MethodInfo methodInfo, object[] arguments, out MethodSettings methodSettings) + { + if (!_methodSettings.TryGetValue(methodInfo, out methodSettings)) { + //Fall back to name + var methodInfos = _methodSettings.Keys.Where(method => method.Name == methodInfo.Name); + var methodInfoByName = methodInfos.FirstOrDefault(); + if (methodInfoByName != null) { + methodSettings = _methodSettings[methodInfoByName]; + } else { + return false; + } + } + + return true; + } + protected override IConstructorArgument[] GetConstructorArguments(MethodInfo methodInfo, object[] arguments) { - if (!_methodSettings.TryGetValue(methodInfo, out var methodSettings)) { + + if (!GetMethodSettings(methodInfo, arguments, out var methodSettings)) { return base.GetConstructorArguments(methodInfo, arguments); } diff --git a/VectoCore/VectoCore/Utils/XMLHelper.cs b/VectoCore/VectoCore/Utils/XMLHelper.cs index c1f32817cea422163b809fc09c54d71e8f1548b8..490774e011bd74f44391b9c83797774edc4510f9 100644 --- a/VectoCore/VectoCore/Utils/XMLHelper.cs +++ b/VectoCore/VectoCore/Utils/XMLHelper.cs @@ -47,7 +47,7 @@ namespace TUGraz.VectoCore.Utils { public static class XMLHelper { - public static XmlDocumentType? GetDocumentType(string rootElement) + public static XmlDocumentType? GetDocumentTypeFromRootElement(string rootElement) { switch (rootElement) { case "VectoInputDeclaration": return XmlDocumentType.DeclarationJobData; @@ -60,17 +60,26 @@ namespace TUGraz.VectoCore.Utils return null; } - //internal static string GetSchemaVersion(XmlSchemaType type) - //{ - // return GetVersionFromNamespaceUri(type.QualifiedName.Namespace); - //} + public static XmlDocumentType? GetDocumentTypeFromFile(string filePath) + { + var xElement = new System.Xml.XmlDocument(); + xElement.Load(filePath); + return XMLHelper.GetDocumentTypeFromRootElement(xElement?.DocumentElement?.LocalName); + + } + - //public static string GetSchemaVersion(XmlElement node) - //{ - // return GetVersionFromNamespaceUri(node.NamespaceURI); - //} + //internal static string GetSchemaVersion(XmlSchemaType type) + //{ + // return GetVersionFromNamespaceUri(type.QualifiedName.Namespace); + //} - public static string GetVersionFromNamespaceUri(XNamespace namespaceUri) + //public static string GetSchemaVersion(XmlElement node) + //{ + // return GetVersionFromNamespaceUri(node.NamespaceURI); + //} + + public static string GetVersionFromNamespaceUri(this XNamespace namespaceUri) { const string versionPrefix = "v"; return namespaceUri.NamespaceName.Split(':').Last(x => x.StartsWith(versionPrefix)) @@ -389,5 +398,18 @@ namespace TUGraz.VectoCore.Utils { return Guid.NewGuid().ToString("n").Substring(0, 20); } + + + public static XmlSchemaType GetSchemaType(XmlNode componentNode) + { + var dataNode = + componentNode?.SelectSingleNode($"./*[local-name()='{XMLNames.ComponentDataWrapper}']"); + + var type = (dataNode ?? componentNode)?.SchemaInfo.SchemaType; + return type; + } + + + } } \ No newline at end of file diff --git a/VectoCore/VectoCore/VectoCore.csproj b/VectoCore/VectoCore/VectoCore.csproj index f9351dbe3949a39289485c736cf750f39cd934d3..a8a91d5aebdecd382e85ca0b1972c5ac6f497f8d 100644 --- a/VectoCore/VectoCore/VectoCore.csproj +++ b/VectoCore/VectoCore/VectoCore.csproj @@ -97,6 +97,7 @@ <PackageReference Include="Ninject.Extensions.ContextPreservation" Version="3.3.1" /> <PackageReference Include="Ninject.Extensions.Factory" Version="3.3.3" /> <PackageReference Include="NLog" Version="4.7.13" /> + <PackageReference Include="System.Collections" Version="4.3.0" /> <PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" /> </ItemGroup> @@ -182,10 +183,19 @@ <AutoGen>True</AutoGen> <DependentUpon>JSONKeys.resx</DependentUpon> </Compile> + <Compile Update="OutputData\XML\GroupWriter\Declaration\GroupNames.Designer.cs"> + <DesignTime>True</DesignTime> + <AutoGen>True</AutoGen> + <DependentUpon>GroupNames.resx</DependentUpon> + </Compile> <EmbeddedResource Update="JSONKeys.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>JSONKeys.Designer.cs</LastGenOutput> </EmbeddedResource> + <EmbeddedResource Update="OutputData\XML\GroupWriter\Declaration\GroupNames.resx"> + <Generator>PublicResXFileCodeGenerator</Generator> + <LastGenOutput>GroupNames.Designer.cs</LastGenOutput> + </EmbeddedResource> </ItemGroup> <ItemGroup> diff --git a/VectoCore/VectoCoreTest/Integration/Declaration/PrimaryBus/PrimaryBusSimulation.cs b/VectoCore/VectoCoreTest/Integration/Declaration/PrimaryBus/PrimaryBusSimulation.cs index 2fac7dba950ae9e53d34895990729c7c7e661460..9ba4727c067b2bc79d1243d18199f3f4a2652dac 100644 --- a/VectoCore/VectoCoreTest/Integration/Declaration/PrimaryBus/PrimaryBusSimulation.cs +++ b/VectoCore/VectoCoreTest/Integration/Declaration/PrimaryBus/PrimaryBusSimulation.cs @@ -38,7 +38,9 @@ public class PrimaryBusSimulation private const string BASE_DIR = @"TestData\Integration\DeclarationMode\2nd_AmendmDeclMode\"; private const string BASE_DIR_COMPLETED = @"TestData\Integration\DeclarationMode\2nd_AmendmDeclMode\CompletedBus"; - private const string BASE_DIR_VIF = @"TestData\Integration\DeclarationMode\2nd_AmendmDeclMode\CompletedBus\VIF"; + + private const string BASE_DIR_FACTOR_METHOD_MODEL_DATA = @"TestData\Integration\DeclarationMode\2nd_AmendmDeclMode\CompletedBus\FactorMethod"; + private const string BASE_DIR_VIF = @"TestData\Integration\DeclarationMode\2nd_AmendmDeclMode\CompletedBus\VIF"; private ThreadLocal<StandardKernel> _kernel; private StandardKernel Kernel => _kernel.Value; @@ -268,6 +270,7 @@ public class PrimaryBusSimulation TestName = "2nd Amendment FactorMethodRunData P-HEV P2 SmartES_elFan_elSteer spez_Dim_HVAC"), + ] public void TestFactorMethodRunData(string primary, string completed, string vifFile, MissionType mission, LoadingType loading) { @@ -320,6 +323,31 @@ public class PrimaryBusSimulation SerializeRunData(runsFactoryFinal, outputPath); } + + + + [TestCase()] + public void TestFactorMethodRunDataFromDedicatedFolder(string subfolder, string primary, string completed, MissionType mission, LoadingType loading, string testName) + { + + bool createVif = true; + + string vif = ""; + var testMissionFilter = GetTestMissionFilter(); + testMissionFilter.SetMissions((mission, loading)); + + + RunSimulationPrimary(primary, -1, out vif); + + + TestFactorMethodRunData(primary, completed, vif, mission, loading); + } + + public TestMissionFilter GetTestMissionFilter() + { + Kernel.Rebind<IMissionFilter>().To<TestMissionFilter>(); + return Kernel.Get<TestMissionFilter>(); + } private static void SerializeRunData(ISimulatorFactory runsFactorySingle, string outputPath) { @@ -402,7 +430,7 @@ public class PrimaryBusSimulation var runsFactory = simFactory.Factory(ExecutionMode.Declaration, dataProvider, fileWriter, null, null); - //runsFactory.WriteModalResults = true; + runsFactory.WriteModalResults = true; //runsFactory.SerializeVectoRunData = true; var jobContainer = new JobContainer(new SummaryDataContainer(fileWriter)) { }; //var jobContainer = new JobContainer(new MockSumWriter()) { }; @@ -421,6 +449,10 @@ public class PrimaryBusSimulation } public void RunSimulationPrimary(string jobFile, int runIdx) + { + RunSimulationPrimary(jobFile, runIdx, out var _); + } + public void RunSimulationPrimary(string jobFile, int runIdx, out string vifFile) { var filePath = Path.Combine(BASE_DIR, jobFile); var dataProvider = _xmlReader.CreateDeclaration(filePath); @@ -460,7 +492,7 @@ public class PrimaryBusSimulation jobContainer.WaitFinished(); Assert.IsTrue(jobContainer.AllCompleted); Assert.IsTrue(jobContainer.Runs.TrueForAll(runEntry => runEntry.Success)); - + vifFile = fileWriter.XMLMultistageReportFileName; PrintRuns(jobContainer, fileWriter); PrintFiles(fileWriter); } diff --git a/VectoCore/VectoCoreTest/TestData/Integration/Multistage/newVifCompletedConventional.vecto b/VectoCore/VectoCoreTest/TestData/Integration/Multistage/newVifCompletedConventional.vecto index 7d11c94cf606e0289f93183ec9501405a3a15cd2..fa253ec151f35339deb9bc2d0424326921cb151b 100644 --- a/VectoCore/VectoCoreTest/TestData/Integration/Multistage/newVifCompletedConventional.vecto +++ b/VectoCore/VectoCoreTest/TestData/Integration/Multistage/newVifCompletedConventional.vecto @@ -1,7 +1,7 @@ { "Header": { - "CreatedBy": "Harry", - "Date": "2021-08-25T00:00:00+02:00", + "CreatedBy": "haraldmartini", + "Date": "2023-03-23T00:00:00+01:00", "AppVersion": "Vecto3GUI2020", "FileVersion": 10 }, diff --git a/VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration/SchemaVersionMultistage.0.1/AirdragLoadTestFilev2.xml b/VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration/SchemaVersionMultistage.0.1/AirdragLoadTestFilev2.xml index f23081c95c253aa94db05313e647a0d1193dbc87..62309d37c9d68f3b5f10144436ec4568b490238e 100644 --- a/VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration/SchemaVersionMultistage.0.1/AirdragLoadTestFilev2.xml +++ b/VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration/SchemaVersionMultistage.0.1/AirdragLoadTestFilev2.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<tns:VectoInputDeclaration xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v1.0" xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationComponent:v1.0" xmlns:di="http://www.w3.org/2000/09/xmldsig#" schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationComponent:v1.0 https://citnet.tech.ec.europa.eu/CITnet/svn/VECTO/trunk/Share/XML/XSD/VectoComponent.xsd"> +<tns:VectoInputDeclaration xmlns="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" xmlns:tns="urn:tugraz:ivt:VectoAPI:DeclarationComponent:v2.0" xmlns:di="http://www.w3.org/2000/09/xmldsig#" schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationComponent V:\\VectoCore\VectoCore\Resources\XSD/VectoDeclarationComponent.xsd"> <tns:AirDrag> <Data id="TestAirDrag1234" xsi:type="AirDragDataDeclarationType"> <Manufacturer>Test AirDrag Manufacturer</Manufacturer> diff --git a/VectoMockup/VectoMockupTest/VectoMockupTest.csproj b/VectoMockup/VectoMockupTest/VectoMockupTest.csproj index f200aafcbd3de55708c0171f0e79d84ba468cd06..478b7b51e6663ec322317046ec04c826c0b20b04 100644 --- a/VectoMockup/VectoMockupTest/VectoMockupTest.csproj +++ b/VectoMockup/VectoMockupTest/VectoMockupTest.csproj @@ -2,7 +2,7 @@ <PropertyGroup> - <TargetFrameworks>net6.0-windows</TargetFrameworks> + <TargetFrameworks>net6.0</TargetFrameworks> <Nullable>enable</Nullable> <IsPackable>false</IsPackable>