diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationAngledriveDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationAngledriveDataProvider.cs index dfc920f986a3e4289b3ea6bde190975f80a5a09f..5063afe6387f692e0c22fba866f3bb0733a53a65 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationAngledriveDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationAngledriveDataProvider.cs @@ -94,19 +94,17 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider } } - // --------------------------------------------------------------------------------------- - public class XMLDeclarationPrimaryVehicleBusAngledriveDataProviderV01 : XMLDeclarationAngledriveDataProviderV10 + public class XMLDeclarationMultistagePrimaryVehicleBusAngledriveDataProviderV01 : XMLDeclarationAngledriveDataProviderV10 { - public new static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_URI_V01; + public new static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; public new const string XSD_TYPE = "AngledriveDataPIFType"; public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - - - public XMLDeclarationPrimaryVehicleBusAngledriveDataProviderV01( + + public XMLDeclarationMultistagePrimaryVehicleBusAngledriveDataProviderV01( IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationAxlegearDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationAxlegearDataProvider.cs index b48d96e40675238576c416f5f375d061404961c7..f0891b027b63c71ed24f0c6e26bf60e5b33faf86 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationAxlegearDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationAxlegearDataProvider.cs @@ -96,27 +96,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider } - // --------------------------------------------------------------------------------------- - - public class XMLDeclarationPrimaryVehicleBusAxlegearDataProviderV01 : XMLDeclarationAxlegearDataProviderV10 - { - public new static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_URI_V01; - - public new const string XSD_TYPE = "AxlegearDataPIFType"; - - public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - - - public XMLDeclarationPrimaryVehicleBusAxlegearDataProviderV01( - IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) - : base(vehicle, componentNode, sourceFile) { } - - protected override XNamespace SchemaNamespace - { - get { return NAMESPACE_URI; } - } - } - // --------------------------------------------------------------------------------------- public class XMLDeclarationMultistagePrimaryVehicleBusAxlegearDataProviderV01 : XMLDeclarationAxlegearDataProviderV10 diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs index 3beb5371340735ee3ab8b7b4f9387fb4a1b20dc3..d504f3488f5176bb92e87b638ab5ff341fb68824 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationComponentsDataProvider.cs @@ -50,7 +50,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider get { return _gearboxInputData ?? (_gearboxInputData = ComponentReader.GearboxInputData); } } - + public virtual ITorqueConverterDeclarationInputData TorqueConverterInputData { get { return _torqueconverterInputData ?? (_torqueconverterInputData = ComponentReader.TorqueConverterInputData); } @@ -128,7 +128,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public XMLDeclarationComponentsDataProviderV20( IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base( - vehicle, componentNode, sourceFile) { } + vehicle, componentNode, sourceFile) + { } protected override XNamespace SchemaNamespace { @@ -184,10 +185,14 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider #region Overrides of XMLDeclarationComponentsDataProviderV10 - public override IAxleGearInputData AxleGearInputData { get { - return null; + public override IAxleGearInputData AxleGearInputData + { + get + { + return null; //throw new NotSupportedException("No Axlegeardata available"); - } } + } + } #endregion @@ -219,7 +224,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider { get { return null; } } - + IAuxiliariesDeclarationInputData IVehicleComponentsDeclaration.AuxiliaryInputData { get { return null; } @@ -237,11 +242,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider // --------------------------------------------------------------------------------------- - public class XMLDeclarationComponentsPrimaryVehicleBusDataProviderV01 : XMLDeclarationComponentsDataProviderV10, IXMLVehicleComponentsDeclaration, - IRetarderInputData - + public class XMLDeclarationComponentsMultistagePrimaryVehicleBusDataProviderV01 : XMLDeclarationComponentsDataProviderV10, + IXMLVehicleComponentsDeclaration, IRetarderInputData { - public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_URI_V01; + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; public new const string XSD_TYPE = "VehicleComponentsPIFType"; @@ -249,8 +253,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider private IBusAuxiliariesDeclarationData _busAuxiliaries; - - public XMLDeclarationComponentsPrimaryVehicleBusDataProviderV01(IXMLDeclarationVehicleData vehicle, + public XMLDeclarationComponentsMultistagePrimaryVehicleBusDataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } @@ -263,7 +266,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider { get { return null; } } - + IAuxiliariesDeclarationInputData IVehicleComponentsDeclaration.AuxiliaryInputData { get { return null; } @@ -281,34 +284,14 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider #region IRetarderInputData Interface Implementation - public RetarderType Type { get{ return _vehicle.RetarderType; }} - public double Ratio { get { return _vehicle.RetarderRatio; }} + public RetarderType Type { get { return _vehicle.RetarderType; } } + public double Ratio { get { return _vehicle.RetarderRatio; } } public TableData LossMap { get; } #endregion } - // --------------------------------------------------------------------------------------- - - public class XMLDeclarationComponentsMultistagePrimaryVehicleBusDataProviderV01 : XMLDeclarationComponentsPrimaryVehicleBusDataProviderV01 - { - public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; - - public new const string XSD_TYPE = "VehicleComponentsPIFType"; - - public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - - public XMLDeclarationComponentsMultistagePrimaryVehicleBusDataProviderV01(IXMLDeclarationVehicleData vehicle, - XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } - - protected override XNamespace SchemaNamespace - { - get { return NAMESPACE_URI; } - } - } - - // --------------------------------------------------------------------------------------- public class XMLDeclarationInterimStageBusComponentsDataProviderV28 : XMLDeclarationComponentsDataProviderV10, @@ -322,12 +305,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider private IBusAuxiliariesDeclarationData _busAuxiliaries; - + public XMLDeclarationInterimStageBusComponentsDataProviderV28(IXMLDeclarationVehicleData vehicle, - XmlNode componentNode, string sourceFile) - : base(vehicle, componentNode, sourceFile) { } - + XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } + public override IGearboxDeclarationInputData GearboxInputData { get { return null; } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationEngineDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationEngineDataProvider.cs index f07a6087fb6d5d5cfa4d0cfb33a05c9640d4980d..42102242be2db70a5fd956ea7921d1536cc6789e 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationEngineDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationEngineDataProvider.cs @@ -471,19 +471,18 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider // --------------------------------------------------------------------------------------- - public class XMLDeclarationPrimaryVehicleBusEngineDataProviderV01 : XMLDeclarationEngineDataProviderV23 + public class XMLDeclarationMultistagePrimaryVehicleBusEngineDataProviderV01 : XMLDeclarationEngineDataProviderV23 { - - public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_URI_V01; + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; public new const string XSD_TYPE = "EngineDataPIFType"; public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - public XMLDeclarationPrimaryVehicleBusEngineDataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, + public XMLDeclarationMultistagePrimaryVehicleBusEngineDataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } - + public override IList<IEngineModeDeclarationInputData> EngineModes { get @@ -498,19 +497,4 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider get { return NAMESPACE_URI; } } } - - // --------------------------------------------------------------------------------------- - - public class XMLDeclarationMultistagePrimaryVehicleBusEngineDataProviderV01 : XMLDeclarationPrimaryVehicleBusEngineDataProviderV01 - { - public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; - - public new const string XSD_TYPE = "EngineDataPIFType"; - - public new static readonly string QUALIFIED_XSD_TYPE = - XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - - public XMLDeclarationMultistagePrimaryVehicleBusEngineDataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, - string sourceFile) : base(vehicle, componentNode, sourceFile) { } - } } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationGearboxDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationGearboxDataProvider.cs index 656f5283115455f61b0069828f0a952c79f52e7c..8594109dd3c8d2464416e039003f2e5bd55f0c60 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationGearboxDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationGearboxDataProvider.cs @@ -146,29 +146,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider get { return NAMESPACE_URI; } } } - - // --------------------------------------------------------------------------------------- - - public class XMLDeclarationPrimaryVehicleBusGearboxDataProviderV01 : XMLDeclarationGearboxDataProviderV10 - { - public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_URI_V01; - - public new const string XSD_TYPE = "TransmissionDataPIFType"; - - public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - - public XMLDeclarationPrimaryVehicleBusGearboxDataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) - : base(vehicle, componentNode, sourceFile) { } - - protected override XNamespace SchemaNamespace - { - get { return NAMESPACE_URI; } - } - } // --------------------------------------------------------------------------------------- - public class XMLDeclarationMultistagePrimaryVehicleBusGearboxDataProviderV01 : XMLDeclarationPrimaryVehicleBusGearboxDataProviderV01 + public class XMLDeclarationMultistagePrimaryVehicleBusGearboxDataProviderV01 : XMLDeclarationGearboxDataProviderV10 { public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationInputDataProvider.cs index 1705f01b4c5d33958dce33f5cfc1e13ad7becb0f..73e3fa6d616312e7ce90e3e329d77fafdf76ff46 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationInputDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationInputDataProvider.cs @@ -112,120 +112,4 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration } - - // --------------------------------------------------------------------------------------- - - public class XMLPrimaryVehicleBusInputDataV01 : AbstractXMLResource, IXMLPrimaryVehicleBusInputData - { - public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_NAMESPACE; - - public const string XSD_TYPE = "PrimaryVehicleHeavyBusType"; - - public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - - protected readonly XmlDocument Document; - protected IDeclarationJobInputData JobData; - - private IVehicleDeclarationInputData _vehicle; - private IApplicationInformation _applicationInformation; - private IResultsInputData _resultsInputData; - - - public XMLPrimaryVehicleBusInputDataV01(XmlDocument xmlDoc, string fileName) : base(xmlDoc, fileName) - { - Document = xmlDoc; - SourceType = DataSourceType.XMLFile; - - var h = VectoHash.Load(xmlDoc); - XMLHash = h.ComputeXmlHash(); - } - - - #region IPrimaryVehicleInputDataProvider interface - - public IVehicleDeclarationInputData Vehicle - { - get { return _vehicle ?? (_vehicle = Reader.JobData.Vehicle); } - } - - public DigestData PrimaryVehicleInputDataHash - { - get { return Reader.GetDigestData(GetNode("InputDataSignature")); } - } - - public DigestData VehicleSignatureHash { get { return null; } } - - public DigestData ManufacturerRecordHash - { - get { return Reader.GetDigestData(GetNode("ManufacturerRecordSignature")); } - } - - public IApplicationInformation ApplicationInformation - { - get { return _applicationInformation ?? (_applicationInformation = Reader.ApplicationInformation); } - } - - public IResult GetResult(VehicleClass vehicleClass, MissionType mission, string fuelMode, Kilogram payload) - { - return ResultsInputData.Results.FirstOrDefault( - x => x.VehicleGroup == vehicleClass && - (x.SimulationParameter.Payload - payload).IsEqual(0, 1) && x.Mission == mission && - x.SimulationParameter.FuelMode.Equals(fuelMode, StringComparison.InvariantCultureIgnoreCase)); - } - - public XElement XMLHash { get; } - - public IResultsInputData ResultsInputData - { - get { return _resultsInputData ?? (_resultsInputData = Reader.ResultsInputData); } - } - - #endregion - - - - #region IXMLPrimaryVehicleBusInputData interface - - public IXMLDeclarationPrimaryVehicleBusInputDataReader Reader { protected get; set; } - - public XmlNode ResultsNode - { - get { return GetNode(XMLNames.Report_Results); } - } - - public XmlNode ApplicationInformationNode - { - get { return GetNode(XMLNames.Tag_ApplicationInformation); } - } - - #endregion - - - #region AbstractXMLResource class - - protected override XNamespace SchemaNamespace - { - get { return NAMESPACE_URI; } - } - - public override DataSource DataSource - { - get { return new DataSource { SourceFile = SourceFile, SourceVersion = "", SourceType = SourceType }; } - } - - protected override DataSourceType SourceType { get; } - - #endregion - - public virtual IDeclarationJobInputData JobInputData - { - get { return JobData ?? (JobData = Reader.JobData); } - } - - } - - - - - } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationJobInputDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationJobInputDataProvider.cs index 4ec71bf1223bf01c1d66a51284c23de3f1d36fc3..9f9a1a6051c201d484f9603eb300e45c7eafb960 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationJobInputDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationJobInputDataProvider.cs @@ -85,63 +85,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider get { return NAMESPACE_URI; } } } - - // --------------------------------------------------------------------------------------- - - public class XMLDeclarationPrimaryVehicleBusJobInputDataProviderV01 : AbstractXMLResource, IXMLPrimaryVehicleBusJobInputData - { - - public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_URI_V01; - - public const string XSD_TYPE = "PrimaryVehicleHeavyBusDataType"; - - public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - - - protected IVehicleDeclarationInputData _vehicle; - - - public XMLDeclarationPrimaryVehicleBusJobInputDataProviderV01(XmlNode node, IXMLPrimaryVehicleBusInputData inputProvider, - string fileName) : base(node, fileName) - { - InputData = inputProvider; - } - - protected override XNamespace SchemaNamespace - { - get { return NAMESPACE_URI; } - } - - public string ShiftStrategy - { - get { return null; } - } - - public bool SavedInDeclarationMode - { - get { return true; } - } - - public string JobName - { - get { return Vehicle.Identifier; } - } - - protected override DataSourceType SourceType - { - get { return DataSourceType.XMLFile; } - } - - public IVehicleDeclarationInputData Vehicle - { - get { return _vehicle ?? (_vehicle = Reader.CreateVehicle); } - } - - public IXMLJobDataReader Reader { protected get; set; } - public IXMLPrimaryVehicleBusInputData InputData { get; } - } - - + // --------------------------------------------------------------------------------------- public class XMLDeclarationMultistagePrimaryVehicleBusJobInputDataProviderV01 : AbstractXMLResource, diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs index a409a46353bbd2882e4d88b381ac93e96ec90091..25587a80535da561d7c04227487ba4ebbe449edf 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationMultistageInputData.cs @@ -23,11 +23,16 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); protected IDeclarationMultistageJobInputData JobData; + protected readonly XmlDocument Document; - - public XMLDeclarationInputDataProviderMultistageV01(XmlDocument xmlDoc, string fileName) : base(xmlDoc.DocumentElement, fileName) + public XMLDeclarationInputDataProviderMultistageV01(XmlDocument xmlDoc, string fileName) + : base(xmlDoc.DocumentElement, fileName) { + Document = xmlDoc; + SourceType = DataSourceType.XMLFile; + var h = VectoHash.Load(xmlDoc); + XMLHash = h.ComputeXmlHash(); } protected override XNamespace SchemaNamespace { @@ -70,6 +75,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public XMLDeclarationMultistageJobInputDataV01(XmlNode node, IXMLMultistageInputDataProvider inputProvider, string fileName) : base(node, fileName) { InputData = inputProvider; + SourceType = DataSourceType.XMLFile; } public IPrimaryVehicleInformationInputDataProvider PrimaryVehicle @@ -102,10 +108,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + private readonly XmlNode _signatureNode; private IVehicleDeclarationInputData _vehicle; private IApplicationInformation _applicationInformation; private IResultsInputData _resultsInputData; - private XmlNode _signatureNode; + public XMLDeclarationMultistagePrimaryVehicleInputDataV01(XmlNode xmlNode, string fileName) : base(xmlNode, fileName) diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationPrimaryVehicleBusApplicationInformationDataProviderV01.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationPrimaryVehicleBusApplicationInformationDataProviderV01.cs index 7ab263b7fe27607ec1bf84acbbcacad8fb896e8f..8c6ea37fca75d78cb60f5268afd4990336189229 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationPrimaryVehicleBusApplicationInformationDataProviderV01.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationPrimaryVehicleBusApplicationInformationDataProviderV01.cs @@ -1,12 +1,6 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml; using System.Xml.Linq; -using Castle.Components.DictionaryAdapter.Xml; -using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Resources; using TUGraz.VectoCore.InputData.FileIO.XML.Common; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; @@ -14,15 +8,16 @@ using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider { - public class XMLDeclarationPrimaryVehicleBusApplicationInformationDataProviderV01 : AbstractXMLType, IXMLApplicationInformationData + public class XMLDeclarationMultistagePrimaryVehicleBusApplicationInformationDataProviderV01 : + AbstractXMLType, IXMLApplicationInformationData { - public static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_URI_V01; + public static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; - public const string XSD_TYPE = "ApplicationInformationPIFType"; + public const string XSD_TYPE = "ApplicationInformationPrimaryVehicleType"; public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - public XMLDeclarationPrimaryVehicleBusApplicationInformationDataProviderV01(XmlNode applicationNode) + public XMLDeclarationMultistagePrimaryVehicleBusApplicationInformationDataProviderV01(XmlNode applicationNode) : base(applicationNode) { } public string SimulationToolVersion @@ -35,17 +30,4 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider get { return XmlConvert.ToDateTime(GetString(XMLNames.Report_ApplicationInfo_Date), XmlDateTimeSerializationMode.Utc); } } } - - public class XMLDeclarationMultistagePrimaryVehicleBusApplicationInformationDataProviderV01 : - XMLDeclarationPrimaryVehicleBusApplicationInformationDataProviderV01 - { - public new static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; - - public new const string XSD_TYPE = "ApplicationInformationPrimaryVehicleType"; - - public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - - public XMLDeclarationMultistagePrimaryVehicleBusApplicationInformationDataProviderV01(XmlNode applicationNode) - : base(applicationNode) { } - } } \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationPrimaryVehicleBusResultsInputDataProviderV01.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationPrimaryVehicleBusResultsInputDataProviderV01.cs index 61d93e7262f988caf859fc0c60bf0e7248e4099c..e2d0b0065b4362cc106bd34ce79a2cdab37090ff 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationPrimaryVehicleBusResultsInputDataProviderV01.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationPrimaryVehicleBusResultsInputDataProviderV01.cs @@ -13,18 +13,18 @@ using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider { - public class XMLDeclarationPrimaryVehicleBusResultsInputDataProviderV01 : AbstractXMLType, IXMLResultsInputData + public class XMLDeclarationMultistagePrimaryVehicleBusResultsInputDataProviderV01 : AbstractXMLType, IXMLResultsInputData { - public static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_URI_V01; + public static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; - public const string XSD_TYPE = "ResultsPIFType"; + public const string XSD_TYPE = "ResultsPrimaryVehicleType"; public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); private XmlNode _resultsNode; private IList<IResult> _results; - public XMLDeclarationPrimaryVehicleBusResultsInputDataProviderV01(XmlNode resultsNode) : base(resultsNode) + public XMLDeclarationMultistagePrimaryVehicleBusResultsInputDataProviderV01(XmlNode resultsNode) : base(resultsNode) { _resultsNode = resultsNode; } @@ -35,9 +35,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public IList<IResult> Results { - get { return _results ?? (_results = ReadResults()); } + get { return _results ?? (_results = ReadResults()); } } - + private IList<IResult> ReadResults() { @@ -46,11 +46,12 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider var results = new List<IResult>(); - foreach (XmlNode resultNode in _resultsNode.ChildNodes) { - if(resultNode.Name == XMLNames.Report_Result_Result) + foreach (XmlNode resultNode in _resultsNode.ChildNodes) + { + if (resultNode.Name == XMLNames.Report_Result_Result) results.Add(GetResult(resultNode)); } - + return results; } @@ -69,7 +70,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider string.Format(".//*[local-name()='{0}' and @unit='MJ/km']", XMLNames.Report_Result_EnergyConsumption))?.InnerText .ToDouble().SI(Unit.SI.Mega.Joule.Per.Kilo.Meter).Cast<JoulePerMeter>())).ToDictionary(x => x.Key, x => x.Value); - return new Result { + return new Result + { ResultStatus = resultStatus, Mission = mission, VehicleGroup = VehicleClassHelper.Parse(vehicleGroup), @@ -86,24 +88,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider { TotalVehicleMass = GetString(XMLNames.Report_ResultEntry_TotalVehicleMass, xmlNode).ToDouble().SI<Kilogram>(), Payload = GetString(XMLNames.Report_Result_Payload, xmlNode).ToDouble().SI<Kilogram>(), - PassengerCount = GetString(XMLNames.Bus_PassengerCount, xmlNode).ToDouble(), - FuelMode = GetString(XMLNames.Report_Result_FuelMode, xmlNode) + PassengerCount = GetString(XMLNames.Bus_PassengerCount, xmlNode).ToDouble(), + FuelMode = GetString(XMLNames.Report_Result_FuelMode, xmlNode) }; } } - - // --------------------------------------------------------------------------------------- - - public class XMLDeclarationMultistagePrimaryVehicleBusResultsInputDataProviderV01 : - XMLDeclarationPrimaryVehicleBusResultsInputDataProviderV01 - { - public new static XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; - - public new const string XSD_TYPE = "ResultsPrimaryVehicleType"; - - public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - - public XMLDeclarationMultistagePrimaryVehicleBusResultsInputDataProviderV01(XmlNode resultsNode) - : base(resultsNode) { } - } } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationTorqueConverterDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationTorqueConverterDataProvider.cs index 09a7e15eb0e38ec46ac601f76427bcaf694e3d25..6351eaec0b24d35a1cd781b96ab250db2865a558 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationTorqueConverterDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationTorqueConverterDataProvider.cs @@ -68,20 +68,20 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider } } - public class XMLDeclarationTorqueConverterDataProviderPIF01 : XMLDeclarationTorqueConverterDataProviderV20 + // --------------------------------------------------------------------------------------- + public class XMLDeclarationMultistagePrimaryTorqueConverterDataProviderV01 : XMLDeclarationTorqueConverterDataProviderV20 { - public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_URI_V01; + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; public new const string XSD_TYPE = "TorqueConverterDataPIFType"; public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - public XMLDeclarationTorqueConverterDataProviderPIF01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } + public XMLDeclarationMultistagePrimaryTorqueConverterDataProviderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentNode, string sourceFile) : base(vehicle, componentNode, sourceFile) { } protected override XNamespace SchemaNamespace { get { return NAMESPACE_URI; } } } - } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs index 4be0c766b4bd4928a846c7b3b8eb037af25a276c..eaf6bf65bd75f7079ad8cee34d45aa89652be718 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationVehicleDataProvider.cs @@ -912,11 +912,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider } - // --------------------------------------------------------------------------------------- - - public class XMLDeclarationPrimaryVehicleBusDataProviderV01 : AbstractCommonComponentType, IXMLDeclarationVehicleData + public class XMLDeclarationMultistagePrimaryVehicleBusDataProviderV01 : AbstractCommonComponentType, IXMLDeclarationVehicleData { - public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_URI_V01; + + public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; public const string XSD_TYPE = "VehiclePIFType"; @@ -927,9 +926,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider private IAdvancedDriverAssistantSystemDeclarationInputData _adas; private XmlElement _componentNode; private IVehicleComponentsDeclaration _components; - - - public XMLDeclarationPrimaryVehicleBusDataProviderV01( + + public XMLDeclarationMultistagePrimaryVehicleBusDataProviderV01( IXMLPrimaryVehicleBusJobInputData busJobData, XmlNode xmlNode, string sourceFile) : base(xmlNode, sourceFile) { @@ -1020,8 +1018,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public XmlElement ComponentNode { - get { - if (ExemptedVehicle) { + get + { + if (ExemptedVehicle) + { return null; } @@ -1039,7 +1039,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider } public StateOfCompletion StateOfCompletion { get; } - + public IVehicleComponentsDeclaration Components { @@ -1103,10 +1103,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider { var torqueLimits = new List<ITorqueLimitInputData>(); var limits = GetNodes(new[] { XMLNames.Vehicle_TorqueLimits, XMLNames.Vehicle_TorqueLimits_Entry }); - foreach (XmlNode current in limits) { - if (current.Attributes != null) { + foreach (XmlNode current in limits) + { + if (current.Attributes != null) + { torqueLimits.Add( - new TorqueLimitInputData() { + new TorqueLimitInputData() + { Gear = GetAttribute(current, XMLNames.Vehicle_TorqueLimits_Entry_Gear_Attr).ToInt(), MaxTorque = GetAttribute(current, XMLNames.Vehicle_TorqueLimits_Entry_MaxTorque_Attr) .ToDouble().SI<NewtonMeter>() @@ -1118,27 +1121,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider } } - // --------------------------------------------------------------------------------------- - - public class XMLDeclarationMultistagePrimaryVehicleBusDataProviderV01 : XMLDeclarationPrimaryVehicleBusDataProviderV01 - { - public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; - - public new const string XSD_TYPE = "VehiclePIFType"; - - public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - - public XMLDeclarationMultistagePrimaryVehicleBusDataProviderV01(IXMLPrimaryVehicleBusJobInputData busJobData, - XmlNode xmlNode, string sourceFile) - : base(busJobData, xmlNode, sourceFile) { } - - protected override XNamespace SchemaNamespace - { - get { return NAMESPACE_URI; } - } - protected override DataSourceType SourceType { get; } - } - // --------------------------------------------------------------------------------------- diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLGearData.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLGearData.cs index 982a95e1d4fd6b060fd72f3631bd22adb113e5bc..14c8039aaa3acd343553bd75ecc09bc8386c0ddb 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLGearData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLGearData.cs @@ -124,28 +124,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider } } - // --------------------------------------------------------------------------------------- - - public class XMLPrimaryVehicleBusTransmissionDataV01 : XMLGearDataV10 - { - public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_URI_V01; - - public new const string XSD_TYPE = "TransmissionGearPIFType"; - - public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - - public XMLPrimaryVehicleBusTransmissionDataV01(XmlNode gearNode, string sourceFile) - : base(gearNode, sourceFile) { } - - protected override XNamespace SchemaNamespace - { - get { return NAMESPACE_URI; } - } - } // --------------------------------------------------------------------------------------- - - + public class XMLMultistagePrimaryVehicleBusTransmissionDataV01 : XMLGearDataV10 { public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Factory/IDeclarationInjectFactory.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Factory/IDeclarationInjectFactory.cs index 451a81949cab1aaff23349539785fa99995b56f9..438d320d11f13eaeb91d8f03ac77f377b0030932 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Factory/IDeclarationInjectFactory.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Factory/IDeclarationInjectFactory.cs @@ -25,10 +25,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Factory IXMLDeclarationJobInputData CreateJobData( string version, XmlNode node, IXMLDeclarationInputData inputProvider, string fileName); - IXMLDeclarationMultistageJobInputData CreateMultiStageJobData( - string version, XmlNode node, IXMLMultistageInputDataProvider inputProvider, string fileName); + IXMLDeclarationMultistageJobInputData CreateMultiStageJobData( + string version, XmlNode node, IXMLMultistageInputDataProvider inputProvider, string fileName); - IXMLPrimaryVehicleBusJobInputData CreatePrimaryVehicleJobData( + IXMLPrimaryVehicleBusJobInputData CreatePrimaryVehicleJobData( string version, XmlNode node, IXMLPrimaryVehicleBusInputData inputProvider, string fileName); diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/IXMLDeclarationInputDataReader.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/IXMLDeclarationInputDataReader.cs index 3d5fb12f53328d96587def679a755fe0f953acb5..bb33e3e9b3588bf8c89f7de55f57970ea45fe7b4 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/IXMLDeclarationInputDataReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/IXMLDeclarationInputDataReader.cs @@ -25,8 +25,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration public interface IXMLMultistageJobReader { - IPrimaryVehicleInformationInputDataProvider PrimaryVehicle { get; } + IPrimaryVehicleInformationInputDataProvider PrimaryVehicle { get; } - IList<IManufacturingStageInputData> ManufacturingStages { get; } - } + IList<IManufacturingStageInputData> ManufacturingStages { get; } + } } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataMultistageV01InjectModule.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataMultistageV01InjectModule.cs index 9458e0723c59bc590fe4a2e0ff6cf650809ebf5e..efb219b37b307140796f8d8014258bb088735f9c 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataMultistageV01InjectModule.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationInputDataMultistageV01InjectModule.cs @@ -68,6 +68,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules Bind<IXMLGearData>().To<XMLMultistagePrimaryVehicleBusTransmissionDataV01>() .Named(XMLMultistagePrimaryVehicleBusTransmissionDataV01.QUALIFIED_XSD_TYPE); + + Bind<IXMLAngledriveInputData>().To<XMLDeclarationMultistagePrimaryVehicleBusAngledriveDataProviderV01>() + .Named(XMLDeclarationMultistagePrimaryVehicleBusAngledriveDataProviderV01.QUALIFIED_XSD_TYPE); + + Bind<IXMLTorqueConverterDeclarationInputData>() + .To<XMLDeclarationMultistagePrimaryTorqueConverterDataProviderV01>() + .Named(XMLDeclarationMultistagePrimaryTorqueConverterDataProviderV01.QUALIFIED_XSD_TYPE); Bind<IXMLAxleGearInputData>().To<XMLDeclarationMultistagePrimaryVehicleBusAxlegearDataProviderV01>().Named( XMLDeclarationMultistagePrimaryVehicleBusAxlegearDataProviderV01.QUALIFIED_XSD_TYPE); diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationPrimaryVehicleBusV01InjectModule.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationPrimaryVehicleBusV01InjectModule.cs deleted file mode 100644 index cae1a0cf7b993f861c1ce77999a8ab65eeecfa85..0000000000000000000000000000000000000000 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationPrimaryVehicleBusV01InjectModule.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Ninject.Modules; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader; -using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl; - -namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.NinjectModules -{ - public class XMLDeclarationPrimaryVehicleBusV01InjectModule : NinjectModule - { - #region Overrides of NinjectModule - - public override void Load() - { - - Bind<IXMLPrimaryVehicleBusInputData>().To<XMLPrimaryVehicleBusInputDataV01>() - .Named(XMLPrimaryVehicleBusInputDataV01.QUALIFIED_XSD_TYPE); - - Bind<IXMLPrimaryVehicleBusJobInputData>().To<XMLDeclarationPrimaryVehicleBusJobInputDataProviderV01>() - .Named(XMLDeclarationPrimaryVehicleBusJobInputDataProviderV01.QUALIFIED_XSD_TYPE); - - Bind<IXMLJobDataReader>().To<XMLJobDataPrimaryVehicleReaderV01>() - .Named(XMLJobDataPrimaryVehicleReaderV01.QUALIFIED_XSD_TYPE); - - Bind<IXMLDeclarationVehicleData>().To<XMLDeclarationPrimaryVehicleBusDataProviderV01>() - .Named(XMLDeclarationPrimaryVehicleBusDataProviderV01.QUALIFIED_XSD_TYPE); - - Bind<IXMLDeclarationPrimaryVehicleBusInputDataReader>().To<XMLPrimaryVehicleBusInputReaderV01>() - .Named(XMLPrimaryVehicleBusInputReaderV01.QUALIFIED_XSD_TYPE); - - Bind<IXMLComponentReader>().To<XMLPrimaryVehicleBusComponentReaderV01>() - .Named(XMLPrimaryVehicleBusComponentReaderV01.QUALIFIED_XSD_TYPE); - - Bind<IXMLVehicleComponentsDeclaration>().To<XMLDeclarationComponentsPrimaryVehicleBusDataProviderV01>() - .Named(XMLDeclarationComponentsPrimaryVehicleBusDataProviderV01.QUALIFIED_XSD_TYPE); - - Bind<IXMLEngineDeclarationInputData>().To<XMLDeclarationPrimaryVehicleBusEngineDataProviderV01>() - .Named(XMLDeclarationPrimaryVehicleBusEngineDataProviderV01.QUALIFIED_XSD_TYPE); - - Bind<IXMLGearboxDeclarationInputData>().To<XMLDeclarationPrimaryVehicleBusGearboxDataProviderV01>() - .Named(XMLDeclarationPrimaryVehicleBusGearboxDataProviderV01.QUALIFIED_XSD_TYPE); - - Bind<IXMLGearboxReader>().To<XMLPrimaryVehicleBusComponentReaderV01>() - .Named(XMLPrimaryVehicleBusComponentReaderV01.GEARBOX_READER_QUALIFIED_XSD_TYPE); - - Bind<IXMLGearData>().To<XMLPrimaryVehicleBusTransmissionDataV01>() - .Named(XMLPrimaryVehicleBusTransmissionDataV01.QUALIFIED_XSD_TYPE); - - Bind<IXMLTorqueConverterDeclarationInputData>() - .To<XMLDeclarationTorqueConverterDataProviderPIF01>() - .Named(XMLDeclarationTorqueConverterDataProviderPIF01.QUALIFIED_XSD_TYPE); - - Bind<IXMLAngledriveInputData>().To<XMLDeclarationPrimaryVehicleBusAngledriveDataProviderV01>() - .Named(XMLDeclarationPrimaryVehicleBusAngledriveDataProviderV01.QUALIFIED_XSD_TYPE); - - Bind<IXMLAxleGearInputData>().To<XMLDeclarationPrimaryVehicleBusAxlegearDataProviderV01>().Named( - XMLDeclarationPrimaryVehicleBusAxlegearDataProviderV01.QUALIFIED_XSD_TYPE); - - Bind<IXMLApplicationInformationData>().To<XMLDeclarationPrimaryVehicleBusApplicationInformationDataProviderV01>() - .Named(XMLDeclarationPrimaryVehicleBusApplicationInformationDataProviderV01.QUALIFIED_XSD_TYPE); - - Bind<IXMLResultsInputData>().To<XMLDeclarationPrimaryVehicleBusResultsInputDataProviderV01>() - .Named(XMLDeclarationPrimaryVehicleBusResultsInputDataProviderV01.QUALIFIED_XSD_TYPE); - - - } - - #endregion - - } -} diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationReaderInjectModule.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationReaderInjectModule.cs index add872db3af81ed52f3f2364671433524ad74b44..c990147cd57234f0af50dc1488ad6186cac8bcbe 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationReaderInjectModule.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/NinjectModules/XMLDeclarationReaderInjectModule.cs @@ -21,7 +21,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration new XMLDeclarationInputDataV22InjectModule(), new XMLDeclarationInputDataV23InjectModule(), new XMLDeclarationInputDataV26InjectModule(), - new XMLDeclarationPrimaryVehicleBusV01InjectModule(), new XMLDeclarationInputDataV28InjectModule(), new XMLDeclarationInputDataMultistageV01InjectModule(), }); 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 cfd6db1ef7485da9cec844d9e8a4c174575f872a..04878c76668e60e46a080be0339bfa50f4d714d1 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLComponentReader.cs @@ -361,10 +361,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl } } + // --------------------------------------------------------------------------------------- - public class XMLPrimaryVehicleBusComponentReaderV01 : XMLComponentReaderV20 + public class XMLMultistagePrimaryVehicleBusComponentReaderV01 : XMLComponentReaderV20 { - public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_URI_V01; + public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; public new const string XSD_TYPE = "VehicleComponentsPIFType"; public new const string GEARBOX_READER_TYPE = "TransmissionDataPIFType"; @@ -373,9 +374,8 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl public new static readonly string GEARBOX_READER_QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI, GEARBOX_READER_TYPE); protected IBusAuxiliariesDeclarationData _busAuxInputData; - - - public XMLPrimaryVehicleBusComponentReaderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentsNode) + + public XMLMultistagePrimaryVehicleBusComponentReaderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentsNode) : base(vehicle, componentsNode) { } public override IGearboxDeclarationInputData GearboxInputData @@ -385,22 +385,22 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl return _gearboxInputData ?? (_gearboxInputData = CreateComponent(XMLNames.Component_Transmission, GearboxCreator)); } } - + public override IRetarderInputData RetarderInputData { get { return null; } } - + public override IAirdragDeclarationInputData AirdragInputData { get { return null; } } - + public override IAuxiliariesDeclarationInputData AuxiliaryData { get { return null; } } - + public override IBusAuxiliariesDeclarationData BusAuxiliariesInputData { get { return _busAuxInputData ?? (_busAuxInputData = CreateComponent(XMLNames.Component_Auxiliaries, BusAuxCreator)); } @@ -411,22 +411,6 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl return Factory.CreateBusAuxiliaires(version, Vehicle, componentNode, sourceFile); } } - - // --------------------------------------------------------------------------------------- - - public class XMLMultistagePrimaryVehicleBusComponentReaderV01 : XMLPrimaryVehicleBusComponentReaderV01 - { - public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; - - public new const string XSD_TYPE = "VehicleComponentsPIFType"; - public new const string GEARBOX_READER_TYPE = "TransmissionDataPIFType"; - - public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - public new static readonly string GEARBOX_READER_QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI, GEARBOX_READER_TYPE); - - public XMLMultistagePrimaryVehicleBusComponentReaderV01(IXMLDeclarationVehicleData vehicle, XmlNode componentsNode) - : base(vehicle, componentsNode) { } - } // --------------------------------------------------------------------------------------- diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationInputReader.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationInputReader.cs index 044778c99194fc34d4a745551a904885481ab7a0..a66467972b07fa07ca943d19ee1708b95046f4fc 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationInputReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationInputReader.cs @@ -64,82 +64,4 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl public XMLDeclarationInputReaderV20(IXMLDeclarationInputData inputData, XmlNode baseNode) : base(inputData, baseNode) { } } - - - // --------------------------------------------------------------------------------------- - - public class XMLPrimaryVehicleBusInputReaderV01 : AbstractComponentReader, IXMLDeclarationPrimaryVehicleBusInputDataReader - { - - public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_NAMESPACE; - - public const string XSD_TYPE = "PrimaryVehicleHeavyBusType"; - - public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - - - protected XmlNode JobNode; - protected IDeclarationJobInputData _jobData; - protected IXMLPrimaryVehicleBusInputData _primaryInputData; - protected IApplicationInformation _applicationInformation; - protected IResultsInputData _resultsInputData; - - [Inject] - public IDeclarationInjectFactory Factory { protected get; set; } - - - public XMLPrimaryVehicleBusInputReaderV01(IXMLPrimaryVehicleBusInputData inputData, XmlNode baseNode) : base(inputData, baseNode) - { - JobNode = baseNode; - _primaryInputData = inputData; - } - - public virtual IDeclarationJobInputData JobData - { - get - { - return _jobData ?? (_jobData = CreateComponent(XMLNames.VectoPrimaryVehicleReport, JobCreator)); - } - } - - - protected IDeclarationJobInputData JobCreator(string version, XmlNode node, string arg3) - { - var job = Factory.CreatePrimaryVehicleJobData(version, BaseNode, _primaryInputData, - (_primaryInputData as IXMLResource).DataSource.SourceFile); - job.Reader = Factory.CreatePrimaryVehicleJobReader(version, job, JobNode); - return job; - } - - - public IResultsInputData ResultsInputData - { - get{ return _resultsInputData ?? - (_resultsInputData = CreateComponent(XMLNames.Report_Results, ResultsInputDataCreator)); } - } - - protected IResultsInputData ResultsInputDataCreator(string version, XmlNode node, string arg3) - { - return Factory.CreateResultsInputDataReader(version, node); - } - - - public DigestData GetDigestData(XmlNode xmlNode) - { - return xmlNode == null ? null : new DigestData(xmlNode); - } - - - protected IApplicationInformation ApplicationCreator(string version, XmlNode node, string agr3) - { - return Factory.CreateApplicationInformationReader(version, node); - } - - - public IApplicationInformation ApplicationInformation - { - get { return _applicationInformation ?? - (_applicationInformation = CreateComponent(XMLNames.Tag_ApplicationInformation, ApplicationCreator)); } - } - } } 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 0ce7ed3a3eeea4c64dc215b37e21cc6f8f69dc7a..dea2bb6d8c50ff3e99e2b9f708176151de35a007 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLDeclarationMultistageInputReader.cs @@ -100,23 +100,84 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl // --------------------------------------------------------------------------------------- - public class XMLMultistagePrimaryVehicleReaderV01 : XMLPrimaryVehicleBusInputReaderV01 + public class XMLMultistagePrimaryVehicleReaderV01 : AbstractComponentReader, IXMLDeclarationPrimaryVehicleBusInputDataReader { - public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; - public new const string XSD_TYPE = "PrimaryVehicleDataType"; + public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; + + public const string XSD_TYPE = "PrimaryVehicleDataType"; + + public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + - public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); + protected XmlNode JobNode; + protected IDeclarationJobInputData _jobData; + protected IXMLPrimaryVehicleBusInputData _primaryInputData; + protected IApplicationInformation _applicationInformation; + protected IResultsInputData _resultsInputData; - public XMLMultistagePrimaryVehicleReaderV01(IXMLPrimaryVehicleBusInputData inputData, XmlNode baseNode) - : base(inputData, baseNode) { } + [Inject] + public IDeclarationInjectFactory Factory { protected get; set; } + + + public XMLMultistagePrimaryVehicleReaderV01(IXMLPrimaryVehicleBusInputData inputData, XmlNode baseNode) : base(inputData, baseNode) + { + JobNode = baseNode; + _primaryInputData = inputData; + } - public override IDeclarationJobInputData JobData + public virtual IDeclarationJobInputData JobData { get { return _jobData ?? (_jobData = CreateComponent(XMLNames.Tag_Vehicle, JobCreator)); } } + + + protected IDeclarationJobInputData JobCreator(string version, XmlNode node, string arg3) + { + var job = Factory.CreatePrimaryVehicleJobData(version, BaseNode, _primaryInputData, + (_primaryInputData as IXMLResource).DataSource.SourceFile); + job.Reader = Factory.CreatePrimaryVehicleJobReader(version, job, JobNode); + return job; + } + + + public IResultsInputData ResultsInputData + { + get + { + return _resultsInputData ?? + (_resultsInputData = CreateComponent(XMLNames.Report_Results, ResultsInputDataCreator)); + } + } + + protected IResultsInputData ResultsInputDataCreator(string version, XmlNode node, string arg3) + { + return Factory.CreateResultsInputDataReader(version, node); + } + + + public DigestData GetDigestData(XmlNode xmlNode) + { + return xmlNode == null ? null : new DigestData(xmlNode); + } + + + protected IApplicationInformation ApplicationCreator(string version, XmlNode node, string agr3) + { + return Factory.CreateApplicationInformationReader(version, node); + } + + + public IApplicationInformation ApplicationInformation + { + get + { + return _applicationInformation ?? + (_applicationInformation = CreateComponent(XMLNames.Tag_ApplicationInformation, ApplicationCreator)); + } + } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLJobDataReader.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLJobDataReader.cs index aabcb27d14b0b58f8b7ad25a0d62ee5bc579ee1c..7b9a8fe7f2b76963fa915a71aba24b31165f615d 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLJobDataReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Reader/Impl/XMLJobDataReader.cs @@ -105,16 +105,15 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl return vehicle; } } - + // --------------------------------------------------------------------------------------- - - public class XMLJobDataPrimaryVehicleReaderV01 : AbstractComponentReader, IXMLJobDataReader + + public class XMLJobDataMultistagePrimaryVehicleReaderV01 : AbstractComponentReader, IXMLJobDataReader { + public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; - public static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_PRIMARY_BUS_VEHICLE_URI_V01; - - public const string XSD_TYPE = "PrimaryVehicleHeavyBusDataType"; + public const string XSD_TYPE = "VehiclePIFType"; public static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); @@ -125,13 +124,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl protected IVehicleDeclarationInputData _vehicle; private readonly IXMLPrimaryVehicleBusJobInputData _primaryBusJobData; - - public XMLJobDataPrimaryVehicleReaderV01(IXMLPrimaryVehicleBusJobInputData busJobData, XmlNode jobNode) + + public XMLJobDataMultistagePrimaryVehicleReaderV01(IXMLPrimaryVehicleBusJobInputData busJobData, XmlNode jobNode) : base(busJobData, jobNode) { _primaryBusJobData = busJobData; } - + public IVehicleDeclarationInputData CreateVehicle { get { return _vehicle ?? (_vehicle = CreateComponent(XMLNames.Component_Vehicle, VehicleCreator)); } @@ -142,25 +141,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader.Impl var vehicle = Factory.CreatePrimaryVehicleData(version, _primaryBusJobData, vehicleNode, sourceFile); vehicle.ComponentReader = GetReader(vehicle, vehicle.ComponentNode, Factory.CreateComponentReader); vehicle.ADASReader = GetReader(vehicle, vehicle.ADASNode, Factory.CreateADASReader); - + return vehicle; } } - - // --------------------------------------------------------------------------------------- - - - public class XMLJobDataMultistagePrimaryVehicleReaderV01 : XMLJobDataPrimaryVehicleReaderV01 - { - public new static readonly XNamespace NAMESPACE_URI = XMLDefinitions.DECLARATION_MULTISTAGE_BUS_VEHICLE_NAMESPACE_VO1; - - public new const string XSD_TYPE = "VehiclePIFType"; - - public new static readonly string QUALIFIED_XSD_TYPE = XMLHelper.CombineNamespace(NAMESPACE_URI.NamespaceName, XSD_TYPE); - - public XMLJobDataMultistagePrimaryVehicleReaderV01(IXMLPrimaryVehicleBusJobInputData busJobData, - XmlNode jobNode) : base(busJobData, jobNode) { } - } - } diff --git a/VectoCore/VectoCore/VectoCore.csproj b/VectoCore/VectoCore/VectoCore.csproj index 491aedc93508a666d83a6b2beb05b99fd91cd7ff..4562aedbc4f3ad4894e6320a3193f0c7d75f2e33 100644 --- a/VectoCore/VectoCore/VectoCore.csproj +++ b/VectoCore/VectoCore/VectoCore.csproj @@ -197,7 +197,6 @@ <Compile Include="InputData\FileIO\XML\Declaration\NinjectModules\XMLDeclarationInputDataV23InjectModule.cs" /> <Compile Include="InputData\FileIO\XML\Declaration\NinjectModules\XMLDeclarationInputDataV26InjectModule.cs" /> <Compile Include="InputData\FileIO\XML\Declaration\NinjectModules\XMLDeclarationInputDataV28InjectModule.cs" /> - <Compile Include="InputData\FileIO\XML\Declaration\NinjectModules\XMLDeclarationPrimaryVehicleBusV01InjectModule.cs" /> <Compile Include="InputData\FileIO\XML\Declaration\Reader\Impl\AbstractComponentReader.cs" /> <Compile Include="InputData\FileIO\XML\Declaration\Reader\Impl\XMLADASReader.cs" /> <Compile Include="InputData\FileIO\XML\Declaration\Reader\Impl\XMLComponentReader.cs" />