diff --git a/VECTO3GUI2020/Helper/Converter/SIValueToStringConverter.cs b/VECTO3GUI2020/Helper/Converter/SIValueToStringConverter.cs index e6ca987cfa087287b299f88a4dad161d4a90c4c7..7ce0d82a2a8388f2c654b2cc906ac1b7d4d55674 100644 --- a/VECTO3GUI2020/Helper/Converter/SIValueToStringConverter.cs +++ b/VECTO3GUI2020/Helper/Converter/SIValueToStringConverter.cs @@ -15,7 +15,7 @@ namespace VECTO3GUI2020.Helper.Converter private SI _si; private ConvertedSI _convertedSI; public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { + { if (value == null) { _si = null; _convertedSI = null; @@ -28,7 +28,7 @@ namespace VECTO3GUI2020.Helper.Converter if (value is ConvertedSI convertedSI) { _convertedSI = convertedSI; - return convertedSI.ToOutputFormat(showUnit: false, decimals: 1); + return convertedSI.ToOutputFormat(showUnit: false, decimals:0); } return value?.ToString(); diff --git a/VECTO3GUI2020/Ninject/IMultistageDependencies.cs b/VECTO3GUI2020/Ninject/IMultistageDependencies.cs new file mode 100644 index 0000000000000000000000000000000000000000..78088869d1c3860ea23748bb66a71f52f1255294 --- /dev/null +++ b/VECTO3GUI2020/Ninject/IMultistageDependencies.cs @@ -0,0 +1,20 @@ +using System; +using TUGraz.VectoCore.InputData.FileIO.XML; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Factory; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.Ninject +{ + public interface IMultistageDependencies + { + Lazy<IDialogHelper> DialogHelperLazy { get; } + Lazy<IXMLInputDataReader> InputDataReaderLazy { get; } + + IDialogHelper DialogHelper { get; } + IXMLInputDataReader InputDataReader { get; } + IDeclarationInjectFactory InjectFactory { get; } + IComponentViewModelFactory ComponentViewModelFactory { get; } + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/Ninject/MultistageLazyDependencies.cs b/VECTO3GUI2020/Ninject/MultistageLazyDependencies.cs new file mode 100644 index 0000000000000000000000000000000000000000..d21990434ae41bf8ccdabdf079d4c71ca1554e18 --- /dev/null +++ b/VECTO3GUI2020/Ninject/MultistageLazyDependencies.cs @@ -0,0 +1,41 @@ +using System; +using TUGraz.VectoCore.InputData.FileIO.XML; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Factory; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.Ninject +{ + public class MultistageLazyDependencies : IMultistageDependencies + { + + private readonly Lazy<IDialogHelper> _dialogHelper; + public Lazy<IDialogHelper> DialogHelperLazy => _dialogHelper; + public IDialogHelper DialogHelper => _dialogHelper.Value; + + + private readonly Lazy<IXMLInputDataReader> _inputDataReader; + public Lazy<IXMLInputDataReader> InputDataReaderLazy => _inputDataReader; + public IXMLInputDataReader InputDataReader => _inputDataReader.Value; + + //private readonly Lazy<XMLValidator> _xmlValidator = new Lazy<XMLValidator>(() => {return }); + //public Lazy<XMLValidator> XMLValidatorLazy => _xmlValidator; + //public XMLValidator XMLValidator => _xmlValidator.Value; + + + public IDeclarationInjectFactory InjectFactory => _injectFactory.Value; + public IComponentViewModelFactory ComponentViewModelFactory => _componentViewModelFactory.Value; + + + private readonly Lazy<IDeclarationInjectFactory> _injectFactory; + private readonly Lazy<IComponentViewModelFactory> _componentViewModelFactory; + public MultistageLazyDependencies(Lazy<IDialogHelper> dialogHelper, Lazy<IXMLInputDataReader> inputDataReader, Lazy<IDeclarationInjectFactory> injectFactory, Lazy<IComponentViewModelFactory> componentViewModelFactory) + { + _dialogHelper = dialogHelper; + _inputDataReader = inputDataReader; + _componentViewModelFactory = componentViewModelFactory; + _injectFactory = injectFactory; + } + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/Ninject/MultistageModule.cs b/VECTO3GUI2020/Ninject/MultistageModule.cs index 4c4ac8adc716055d22e912a4cda6f888137ce3f5..c36e13772ffe0bc172f7b9eb92b7bbd1cc8c750b 100644 --- a/VECTO3GUI2020/Ninject/MultistageModule.cs +++ b/VECTO3GUI2020/Ninject/MultistageModule.cs @@ -37,6 +37,8 @@ namespace VECTO3GUI2020.Ninject Bind<IMultistageAuxiliariesViewModel>().To<MultistageAuxiliariesViewModel>(). NamedLikeFactoryMethod((IMultiStageViewModelFactory f) => f.GetAuxiliariesViewModel(null)); + + Bind<IMultistageDependencies>().To<MultistageLazyDependencies>(); } } } diff --git a/VECTO3GUI2020/Resources/Styles/ButtonStyles.xaml b/VECTO3GUI2020/Resources/Styles/ButtonStyles.xaml index de0165126f4d8893796ceefc34f3bbc9c2e2410b..b5b95eb545e5061c7af04fcb4599cfaba6de5a33 100644 --- a/VECTO3GUI2020/Resources/Styles/ButtonStyles.xaml +++ b/VECTO3GUI2020/Resources/Styles/ButtonStyles.xaml @@ -3,6 +3,8 @@ <SolidColorBrush x:Key="Button.Static.Background2" Color="#FFDDDDDD"/> <SolidColorBrush x:Key="Button.Static.Border2" Color="#FF707070"/> <SolidColorBrush x:Key="MultiStageButtonMouseOverBackGround" Color="#FFBEE6FD"/> + + <Style x:Key="MultiStageButtonStyle1" TargetType="{x:Type Button}"> <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/> <Setter Property="Background" Value="{StaticResource Button.Static.Background2}"/> diff --git a/VECTO3GUI2020/VECTO3GUI2020.csproj b/VECTO3GUI2020/VECTO3GUI2020.csproj index 83af6944d2ca93381693e6473e6255de4319c998..4a0859e6219450cfd318afba00d70bfc0ab4920a 100644 --- a/VECTO3GUI2020/VECTO3GUI2020.csproj +++ b/VECTO3GUI2020/VECTO3GUI2020.csproj @@ -141,6 +141,8 @@ <Compile Include="Helper\XMLExtension.cs" /> <Compile Include="Helper\XmlHelper.cs" /> <Compile Include="Ninject\FactoryModule.cs" /> + <Compile Include="Ninject\IMultistageDependencies.cs" /> + <Compile Include="Ninject\MultistageLazyDependencies.cs" /> <Compile Include="Ninject\MultistageModule.cs" /> <Compile Include="Test.xaml.cs"> <DependentUpon>Test.xaml</DependentUpon> diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AirDragViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AirDragViewModel.cs index d0af0de58898daabcef66995e4c9329ca4bf8ae0..c8f07cabca58b4f250795bcb331ae59c4da5f387 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AirDragViewModel.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AirDragViewModel.cs @@ -164,6 +164,8 @@ namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components public override void SetProperties() { _airDragArea = _inputData.AirDragArea; + _airDragArea_0 = _inputData.AirDragArea_0; + _transferredAirDragArea = _inputData.TransferredAirDragArea; } public override SquareMeter AirDragArea @@ -171,11 +173,22 @@ namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components get => _airDragArea; set => SetProperty(ref _airDragArea, value); } + + public override SquareMeter TransferredAirDragArea { + get => _transferredAirDragArea; + set => SetProperty(ref _transferredAirDragArea, value); + } + + public override SquareMeter AirDragArea_0 + { + get => _airDragArea_0; + set => SetProperty(ref _airDragArea_0, value); + } } public class AirDragViewModel_v2_8 : AirDragViewModel_v2_0 { - public static new readonly string VERSION = typeof(XMLDeclarationAirdragDataProviderV28).FullName; + public new static readonly string VERSION = typeof(XMLDeclarationAirdragDataProviderV28).FullName; public AirDragViewModel_v2_8(IXMLAirdragDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) { @@ -185,27 +198,8 @@ namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components public override void SetProperties() { - _airDragArea = _inputData.AirDragArea; - _airDragArea_0 = _inputData.AirDragArea_0; - _transferredAirDragArea = _inputData.TransferredAirDragArea; + base.SetProperties(); } - - public override SquareMeter AirDragArea - { - get => _airDragArea; - set => SetProperty(ref _airDragArea, value); - } - - public override SquareMeter TransferredAirDragArea { - get => _transferredAirDragArea; - set => SetProperty(ref _transferredAirDragArea, value); - } - - public override SquareMeter AirDragArea_0 - { - get => _airDragArea_0; - set => SetProperty(ref _airDragArea_0, value); - } } } diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs index b9a0b59d85cc5510e22da02ae8015569fd2077b2..248bf91e4481d1ff01cbfde1cb5d099243f3980a 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/InterimStageBusVehicleViewModel_v2_8.cs @@ -18,20 +18,58 @@ using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; using VECTO3GUI2020.ViewModel.MultiStage.Implementation; using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; +using Convert = System.Convert; namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation { + public enum AirdragModifiedEnum + { + [GuiLabel("Unknown")] + UNKNOWN = -1, + [GuiLabel("True")] + TRUE = 1, + [GuiLabel("False")] + FALSE = 0, + + } + + public static class AirdragModifiedEnumHelper + { + public static AirdragModifiedEnum toAirdragModifiedEnum(this bool? nullableBool) + { + if (nullableBool.HasValue) { + return nullableBool.Value == true ? AirdragModifiedEnum.TRUE : AirdragModifiedEnum.FALSE; + + } + return AirdragModifiedEnum.UNKNOWN; + } + + public static bool? toNullableBool(this AirdragModifiedEnum airdragModified) + { + switch (airdragModified) { + case AirdragModifiedEnum.TRUE: + return true; + case AirdragModifiedEnum.FALSE: + return false; + default: + return null; + } + } + } public interface IMultistageVehicleViewModel : IVehicleViewModel { void SetAirdragData(IAirdragDeclarationInputData airdragData); void SetBusAuxiliaries(IBusAuxiliariesDeclarationData busAuxData); + void SetVehicleInputData(IVehicleDeclarationInputData vehicleInputData); } class DeclarationInterimStageBusVehicleViewModel_v2_8 : ViewModelBase, IMultistageVehicleViewModel, - IVehicleComponentsDeclaration + IVehicleComponentsDeclaration, IAdvancedDriverAssistantSystemDeclarationInputData { + + public static readonly string INPUTPROVIDERTYPE = typeof(XMLDeclarationInterimStageBusDataProviderV28).ToString(); @@ -107,7 +145,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation set { SetProperty(ref _manufacturerAddress, value); } } - + #region Measurements public bool MeasurementsGroupEditingEnabled { get { return _measurementsGroupEditingEnabled; } @@ -170,7 +208,26 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation set { SetProperty(ref _width, value); } } + public ConvertedSI ConsolidatedEntranceHeightInMm + { + get { return ConsolidatedVehicleData.EntranceHeight?.ConvertToMilliMeter(); } + set { throw new NotImplementedException(); } + } + + public ConvertedSI EntranceHeightInMm + { + get { return EntranceHeight?.ConvertToMilliMeter(); } + set { EntranceHeight = value?.ConvertToMeter(); } + } + + public Meter EntranceHeight + { + get => _entranceHeight; + set => SetProperty(ref _entranceHeight, value); + } + + #endregion public Kilogram CurbMassChassis //Corrected Actual Mass { get { return _curbMassChassis; } @@ -221,12 +278,35 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation set => SetProperty(ref _legislativeClass, value); } - public bool? AirdragModifiedMultistage + #region AirdragModified + + + public AirdragModifiedEnum AirdragModifiedEnum + { + get => _airdragModifiedMultistage.toAirdragModifiedEnum(); + set { + if (value == AirdragModifiedEnum.UNKNOWN && AirdragModifiedMultistageEditingEnabled) { + throw new ArgumentException(); + } + AirdragModifiedMultistage = value.toNullableBool(); + } + + + } + + public AirdragModifiedEnum ConsolidatedAirdragModifiedEnum + { + get => _consolidatedVehicleData.AirdragModifiedMultistage.toAirdragModifiedEnum(); + set => throw new NotImplementedException(); + } + + public bool? AirdragModifiedMultistage { get => _airdragModifiedMultistage; set => SetProperty(ref _airdragModifiedMultistage, value); } + #endregion; public bool AirdragModifiedMultistageEditingEnabled { get @@ -259,12 +339,9 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation set => SetProperty(ref _lowEntry, value); } + + - public Meter EntranceHeight - { - get => _entranceHeight; - set => SetProperty(ref _entranceHeight, value); - } public VehicleDeclarationType VehicleDeclarationType { @@ -280,6 +357,14 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation private VehicleDeclarationType _vehicleDeclarationType; private IAirdragDeclarationInputData _airdragInputData; private IBusAuxiliariesDeclarationData _busAuxiliaries; + private PredictiveCruiseControlType _predictiveCruiseControl; + private bool? _atEcoRollReleaseLockupClutch; + private EcoRollType _ecoRoll; + private bool _engineStopStart; + private bool _adasEditingEnabled; + private bool? _engineStopStartNullable; + private EcoRollType? _ecoRollTypeNullable; + private PredictiveCruiseControlType? _predictiveCruiseControlNullable; #region implementation of IVehicleComponentsDeclaration @@ -347,6 +432,60 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation set { SetProperty(ref _consolidatedVehicleData, value); } } + #region implementation of IAdvancedDriverAssistantSystemDeclarationInputData + public IAdvancedDriverAssistantSystemDeclarationInputData ADAS + { + get { return _adasEditingEnabled ? this : null; } + } + + public bool AdasEditingEnabled + { + get => _adasEditingEnabled; + set => SetProperty(ref _adasEditingEnabled, value); + } + + public bool? EngineStopStartNullable + { + get => _engineStopStartNullable; + set => SetProperty(ref _engineStopStartNullable, value); + } + + public bool EngineStopStart + { + get => _engineStopStartNullable.HasValue ? _engineStopStartNullable.Value : false; + + } + + public EcoRollType? EcoRollTypeNullable + { + get => _ecoRollTypeNullable; + set => SetProperty(ref _ecoRollTypeNullable, value); + } + + public EcoRollType EcoRoll + { + get => _ecoRollTypeNullable.HasValue ? _ecoRollTypeNullable.Value : EcoRollType.None; + } + + public PredictiveCruiseControlType? PredictiveCruiseControlNullable + { + get => _predictiveCruiseControlNullable; + set => SetProperty(ref _predictiveCruiseControlNullable, value); + } + + public PredictiveCruiseControlType PredictiveCruiseControl + { + get => _predictiveCruiseControlNullable.HasValue ? _predictiveCruiseControlNullable.Value : PredictiveCruiseControlType.None; + } + + public bool? ATEcoRollReleaseLockupClutch + { + get => _atEcoRollReleaseLockupClutch; + set => SetProperty(ref _atEcoRollReleaseLockupClutch, value); + } + + #endregion + #region implementation of IVehicleDeclarationInputData; @@ -425,10 +564,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation - public IAdvancedDriverAssistantSystemDeclarationInputData ADAS - { - get { throw new NotImplementedException(); } - } + public bool ZeroEmissionVehicle { @@ -477,6 +613,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation get { throw new NotImplementedException(); } } + public XmlNode XMLSource { get { throw new NotImplementedException(); } @@ -513,5 +650,34 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation { _busAuxiliaries = busAuxData; } + + public void SetVehicleInputData(IVehicleDeclarationInputData vehicleInputData) + { + Manufacturer = vehicleInputData.Manufacturer; + ManufacturerAddress = vehicleInputData.ManufacturerAddress; + VIN = vehicleInputData.VIN; + Model = vehicleInputData.Model; + LegislativeClass = vehicleInputData.LegislativeClass; + CurbMassChassis = vehicleInputData.CurbMassChassis; + GrossVehicleMassRating = vehicleInputData.GrossVehicleMassRating; + AirdragModifiedMultistage = vehicleInputData.AirdragModifiedMultistage; + TankSystem = vehicleInputData.TankSystem; + RegisteredClass = vehicleInputData.RegisteredClass; + NumberOfPassengersUpperDeck = vehicleInputData.NumberOfPassengersUpperDeck; + NumberOfPassengersLowerDeck = vehicleInputData.NumberOfPassengersLowerDeck; + VehicleCode = vehicleInputData.VehicleCode; + LowEntry = vehicleInputData.LowEntry; + Height = vehicleInputData.Height; + Width = vehicleInputData.Width; + Length = vehicleInputData.Length; + EntranceHeight = vehicleInputData.EntranceHeight; + DoorDriveTechnology = vehicleInputData.DoorDriveTechnology; + VehicleDeclarationType = vehicleInputData.VehicleDeclarationType; + AdasEditingEnabled = vehicleInputData.ADAS != null; + EngineStopStartNullable = vehicleInputData.ADAS?.EngineStopStart; + EcoRollTypeNullable = vehicleInputData.ADAS?.EcoRoll; + PredictiveCruiseControlNullable = vehicleInputData.ADAS?.PredictiveCruiseControl; + ATEcoRollReleaseLockupClutch = vehicleInputData.ADAS?.ATEcoRollReleaseLockupClutch; + } } } \ 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 5e6e3321eb0ed0b7903610126ff36b94d823d8e8..f49293bda99b4c21b88a68a7694347ca21f7e940 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/ManufacturingStageViewModel_v0_1.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/ManufacturingStageViewModel_v0_1.cs @@ -68,6 +68,13 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation } public DigestData Signature => throw new NotImplementedException(); + public void SetInputData(IVehicleDeclarationInputData vehicleInputData) + { + _vehicleViewModel.SetVehicleInputData(vehicleInputData); + _airDragEditViewModel.SetAirdragInputData(vehicleInputData.Components.AirdragInputData); + _auxiliariesViewModel.SetAuxiliariesInputData(vehicleInputData.Components.BusAuxiliaries); + + } public ManufacturingStageViewModel_v0_1(IManufacturingStageInputData consolidatedManufacturingStageInputData, IMultiStageViewModelFactory viewModelFactory) @@ -88,16 +95,16 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation Components.Add(VehicleViewModel.Name, VehicleViewModel as IViewModelBase); - var airDragEditViewModel = viewModelFactory.GetMultistageAirdragViewModel(_consolidatedManufacturingStageInputData.Vehicle.Components.AirdragInputData); - Components.Add("Airdrag", airDragEditViewModel as IViewModelBase); + _airDragEditViewModel = viewModelFactory.GetMultistageAirdragViewModel(_consolidatedManufacturingStageInputData.Vehicle.Components.AirdragInputData); + Components.Add("Airdrag", _airDragEditViewModel as IViewModelBase); - var auxiliariesViewModel = + _auxiliariesViewModel = viewModelFactory.GetAuxiliariesViewModel(consolidatedManufacturingStageInputData.Vehicle.Components .BusAuxiliaries); - Components.Add("Auxiliaries", auxiliariesViewModel as IViewModelBase); + Components.Add("Auxiliaries", _auxiliariesViewModel as IViewModelBase); - VehicleViewModel.SetAirdragData(airDragEditViewModel); - VehicleViewModel.SetBusAuxiliaries(auxiliariesViewModel); + VehicleViewModel.SetAirdragData(_airDragEditViewModel); + VehicleViewModel.SetBusAuxiliaries(_auxiliariesViewModel); } @@ -109,6 +116,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation #region Commands private ICommand _switchComponentViewCommand; + private readonly IMultistageAirdragViewModel _airDragEditViewModel; + private readonly IMultistageAuxiliariesViewModel _auxiliariesViewModel; public ICommand SwitchComponentViewCommand { @@ -138,9 +147,6 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation public interface IManufacturingStageViewModel : IManufacturingStageInputData { - - - - + void SetInputData(IVehicleDeclarationInputData vehicleInputData); } } diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAirdragViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAirdragViewModel.cs index fd8b0e0583572d74e2254d4a23b943a38313dd92..1729b438bfa4c59784970478d8e159a69c42bb7a 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAirdragViewModel.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAirdragViewModel.cs @@ -7,6 +7,7 @@ using System.Windows.Input; using System.Xml; using System.Xml.Linq; using System.Xml.Schema; +using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Resources; @@ -16,21 +17,20 @@ using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Factory; 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; using ViewModelBase = VECTO3GUI2020.ViewModel.Implementation.Common.ViewModelBase; +using XmlDocumentType = System.Xml.XmlDocumentType; namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation { public class MultistageAirdragViewModel : ViewModelBase, IMultistageAirdragViewModel { - private IDialogHelper _dialogHelper; - private IComponentViewModelFactory _componentViewModelFactory; private IAirDragViewModel _airdragViewModel; - private bool _airdragModified; public string AirdragFilePath { @@ -44,6 +44,12 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation set => SetProperty(ref _airdragViewModel, value); } + public void SetAirdragInputData(IAirdragDeclarationInputData airdragInputData) + { + AirDragViewModel = _dependencies.ComponentViewModelFactory.CreateComponentViewModel(airdragInputData) as IAirDragViewModel; + + } + public IAirdragDeclarationInputData ConsolidatedAirdragData { get => _consolidatedAirdragInputData; @@ -58,8 +64,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation private Dictionary<string, string> _validationErrors; private IAirdragDeclarationInputData _consolidatedAirdragInputData; - private readonly IDeclarationInjectFactory _injectFactory; private string _airdragFilePath; + private readonly IMultistageDependencies _dependencies; public ICommand LoadAirdragFileCommand { @@ -68,7 +74,10 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation public void LoadAirdragFileCommandExecute() { - var fileName = _dialogHelper.OpenXMLFileDialog(Settings.Default.DefaultFilePath); + var fileName =_dependencies.DialogHelper.OpenXMLFileDialog(Settings.Default.DefaultFilePath); + if (fileName == null) { + return; + } var success = true; var errorStringBuilder = new StringBuilder(); try { @@ -78,22 +87,32 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation var airdragElements = xDoc.Descendants().Where(e => e.Name.LocalName == XMLNames.Component_AirDrag); if (airdragElements.Count() == 1) { + //GET FROM FILE var dataProviderVersion = XMLDeclarationAirdragDataProviderV28.QUALIFIED_XSD_TYPE; - //var dataProviderVersion = XMLDeclarationAirdragDataProviderV28.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 = _injectFactory.CreateAirdragData(dataProviderVersion, null, airdragNode, fileName); - AirDragViewModel = _componentViewModelFactory.CreateComponentViewModel(airDragInputData) as IAirDragViewModel; + var airDragInputData = _dependencies.InjectFactory.CreateAirdragData(dataProviderVersion, null, airdragNode, fileName); + AirDragViewModel = _dependencies.ComponentViewModelFactory.CreateComponentViewModel(airDragInputData) as IAirDragViewModel; success = false; } else { success = false; } } catch (Exception e) { - _dialogHelper.ShowMessageBox(e.Message, + _dependencies.DialogHelper.ShowMessageBox(e.Message, "Invalid File", MessageBoxButton.OK, MessageBoxImage.Error); @@ -124,18 +143,14 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation - public MultistageAirdragViewModel(IDialogHelper dialogHelper, IDeclarationInjectFactory injectFactory, IComponentViewModelFactory componentViewModelFactory) + public MultistageAirdragViewModel(IMultistageDependencies dependencies) { - _dialogHelper = dialogHelper; - _injectFactory = injectFactory; - _componentViewModelFactory = componentViewModelFactory; + _dependencies = dependencies; _airdragFilePath = "Select Airdrag File - if no file is selected a default Airdrag Component is loaded"; } public MultistageAirdragViewModel(IAirdragDeclarationInputData consolidatedAirdragInputData, - IDialogHelper dialogHelper, - IDeclarationInjectFactory injectFactory, - IComponentViewModelFactory componentViewModelFactory) : this(dialogHelper, injectFactory, componentViewModelFactory) + IMultistageDependencies multistageDependencies) : this(multistageDependencies) { ConsolidatedAirdragData = consolidatedAirdragInputData; } diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs index 16765e555e38ecffc100ddaa0e4b752e2d464ae7..1fa12b36b0df3d4a28faa620a2c67108f89b2778 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAuxiliariesViewModel.cs @@ -17,7 +17,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation IPneumaticConsumersDeclarationData, IHVACBusAuxiliariesDeclarationData { - + void SetAuxiliariesInputData(IBusAuxiliariesDeclarationData componentsAuxiliaryInputData); } @@ -34,6 +34,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation } #region HVAV + private bool _heatPumpGroupEditingEnabled; private BusHVACSystemConfiguration? _systemConfiguration; private HeatPumpType? _heatPumpTypeDriverCompartment; @@ -81,25 +82,25 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation public bool? SeparateAirDistributionDucts { get => _separateAirDistributionDucts; - set => SetProperty(ref _separateAirDistributionDucts , value); + set => SetProperty(ref _separateAirDistributionDucts, value); } public bool? WaterElectricHeater { get => _waterElectricHeater; - set => SetProperty(ref _waterElectricHeater , value); + set => SetProperty(ref _waterElectricHeater, value); } public bool? AirElectricHeater { get => _airElectricHeater; - set => SetProperty(ref _airElectricHeater , value); + set => SetProperty(ref _airElectricHeater, value); } public bool? OtherHeatingTechnology { get => _otherHeatingTechnology; - set => SetProperty(ref _otherHeatingTechnology , value); + set => SetProperty(ref _otherHeatingTechnology, value); } public bool HeatPumpGroupEditingEnabled @@ -111,31 +112,31 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation public BusHVACSystemConfiguration? SystemConfiguration { get => _systemConfiguration; - set => SetProperty(ref _systemConfiguration , value); + set => SetProperty(ref _systemConfiguration, value); } public HeatPumpType? HeatPumpTypeDriverCompartment { get => _heatPumpTypeDriverCompartment; - set => SetProperty(ref _heatPumpTypeDriverCompartment , value); + set => SetProperty(ref _heatPumpTypeDriverCompartment, value); } public HeatPumpMode? HeatPumpModeDriverCompartment { get => _heatPumpModeDriverCompartment; - set => SetProperty(ref _heatPumpModeDriverCompartment , value); + set => SetProperty(ref _heatPumpModeDriverCompartment, value); } public HeatPumpType? HeatPumpTypePassengerCompartment { get => _heatPumpTypePassengerCompartment; - set => SetProperty(ref _heatPumpTypePassengerCompartment , value); + set => SetProperty(ref _heatPumpTypePassengerCompartment, value); } public HeatPumpMode? HeatPumpModePassengerCompartment { get => _heatPumpModePassengerCompartment; - set => SetProperty(ref _heatPumpModePassengerCompartment , value); + set => SetProperty(ref _heatPumpModePassengerCompartment, value); } @@ -179,7 +180,9 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation #endregion + #region Implementation of interfaces; + private XmlNode _xmlSource; private string _fanTechnology; private IList<string> _steeringPumpTechnology; @@ -299,7 +302,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation set => _smartRegeneration = value; } - + public ConsumerTechnology AirsuspensionControl { get => _airsuspensionControl; @@ -312,9 +315,9 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation set => _adBlueDosing = value; } - - + + public bool? AdjustableCoolantThermostat { get => _adjustableCoolantThermostat; @@ -328,8 +331,31 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation } - #endregion + #endregion + public void SetAuxiliariesInputData(IBusAuxiliariesDeclarationData componentsAuxiliaryInputData) + { + _heatPumpGroupEditingEnabled = componentsAuxiliaryInputData.HVACAux != null; + _systemConfiguration = componentsAuxiliaryInputData.HVACAux?.SystemConfiguration; + _heatPumpTypeDriverCompartment = componentsAuxiliaryInputData.HVACAux?.HeatPumpTypeDriverCompartment; + _heatPumpModeDriverCompartment = componentsAuxiliaryInputData.HVACAux?.HeatPumpModeDriverCompartment; + _heatPumpTypePassengerCompartment = componentsAuxiliaryInputData.HVACAux?.HeatPumpTypePassengerCompartment; + _heatPumpModePassengerCompartment = componentsAuxiliaryInputData.HVACAux?.HeatPumpModePassengerCompartment; + + _auxHeaterPower = componentsAuxiliaryInputData.HVACAux?.AuxHeaterPower; + _doubleGlazing = componentsAuxiliaryInputData.HVACAux?.DoubleGlazing; + _adjustableAuxiliaryHeater = componentsAuxiliaryInputData.HVACAux?.AdjustableAuxiliaryHeater; + _separateAirDistributionDucts = componentsAuxiliaryInputData.HVACAux?.SeparateAirDistributionDucts; + _waterElectricHeater = componentsAuxiliaryInputData.HVACAux?.WaterElectricHeater; + _airElectricHeater = componentsAuxiliaryInputData.HVACAux?.AirElectricHeater; + _otherHeatingTechnology = componentsAuxiliaryInputData.HVACAux?.OtherHeatingTechnology; + + _interiorLightsLed = componentsAuxiliaryInputData.ElectricConsumers?.InteriorLightsLED; + _dayrunninglightsLed = componentsAuxiliaryInputData.ElectricConsumers?.DayrunninglightsLED; + _positionlightsLed = componentsAuxiliaryInputData.ElectricConsumers?.PositionlightsLED; + _headlightsLed = componentsAuxiliaryInputData.ElectricConsumers?.HeadlightsLED; + _brakelightsLed = componentsAuxiliaryInputData.ElectricConsumers?.BrakelightsLED; + } public MultistageAuxiliariesViewModel(IBusAuxiliariesDeclarationData consolidatedAuxiliariesInputData) { diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs index c2e2e2e16cb1089d2af390daba7201956f411c4d..e83f56bf937a84da4dfb7c0e699338da6b21d5d5 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs @@ -1,11 +1,15 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Windows; using System.Windows.Input; using System.Xml.Linq; using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; -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; @@ -16,6 +20,8 @@ using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation { + //AGGREGATE MULTISTAGEDEPENDENCIES + public class MultiStageJobViewModel_v0_1 : ViewModelBase, IMultiStageJobViewModel, IMultistageVIFInputData, IMultistageBusInputDataProvider { private IDeclarationMultistageJobInputData _jobInputData; @@ -52,17 +58,61 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation var vifInputData = inputData; } + + + private ICommand _loadVehicleDataCommand; + private readonly Lazy<IDialogHelper> _dialogHelper; + private readonly Lazy<IXMLInputDataReader> _inputDataReader; + private string _vehicleInputDataFilePath = "Select Vehicle Input Data"; + + public ICommand LoadVehicleDataCommand + { + get + { + return _loadVehicleDataCommand ?? new RelayCommand(LoadVehicleDataExecute, () => true); + } + } + + private void LoadVehicleDataExecute() + { + var fileName = _dialogHelper.Value.OpenXMLFileDialog(Settings.Default.DefaultFilePath); + if (fileName == null) { + return; + } + + IDeclarationInputDataProvider inputData; + IVehicleDeclarationInputData vehicleInputData; + try { + inputData = (IDeclarationInputDataProvider)_inputDataReader.Value.CreateDeclaration(fileName); + vehicleInputData = inputData.JobInputData.Vehicle; + _manufacturingStageViewModel.SetInputData(vehicleInputData); + } catch (Exception e) { + _dialogHelper.Value.ShowMessageBox(e.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); + return; + } + + + return; + } + + public string VehicleInputDataFilePath + { + get => _vehicleInputDataFilePath; + set => SetProperty(ref _vehicleInputDataFilePath, value); + } #endregion - public MultiStageJobViewModel_v0_1(IMultistageBusInputDataProvider inputData, IMultiStageViewModelFactory vmFactory) + public MultiStageJobViewModel_v0_1(IMultistageBusInputDataProvider inputData, IMultiStageViewModelFactory vmFactory, IMultistageDependencies multistageDependencies ) { + _jobInputData = inputData.JobInputData; _vmFactory = vmFactory; _consolidateManufacturingStage = _jobInputData.ConsolidateManufacturingStage; _manufacturingStages =_jobInputData.ManufacturingStages; _primaryVehicle = _jobInputData.PrimaryVehicle; - + _dialogHelper = multistageDependencies.DialogHelperLazy; + _inputDataReader = multistageDependencies.InputDataReaderLazy; _manufacturingStageViewModel = vmFactory.GetManufacturingStageViewModel(_consolidateManufacturingStage); } diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/NewMultiStageJobViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/NewMultiStageJobViewModel.cs index a56f7ceec0ff17350395a2f6e3bce2df6aa95129..dba12ed5937b30757461d6c43d2bf44ea062183b 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/NewMultiStageJobViewModel.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/NewMultiStageJobViewModel.cs @@ -46,7 +46,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation _inputDataReader = inputDataReader; _dialogHelper = dialogHelper; _vmFactory = vmFactory; - Title = "New Multistage file"; + Title = "New Multistage File"; VifPath = "Select VIF File"; } @@ -63,6 +63,9 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation { var fileName = _dialogHelper.OpenXMLFileDialog(_settings.DefaultFilePath); + if (fileName == null) { + return; + } IMultistageBusInputDataProvider inputDataProvider = null; try { inputDataProvider = _inputDataReader.Create(fileName) as IMultistageBusInputDataProvider; diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultistageAirdragViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultistageAirdragViewModel.cs index a81df457e7cb85ee0e793d348c9b6e74efb70df6..76374ce4a63e6220041f9b79a23420562b9a3574 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultistageAirdragViewModel.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultistageAirdragViewModel.cs @@ -7,5 +7,6 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Interfaces { IAirDragViewModel AirDragViewModel { get; set; } + void SetAirdragInputData(IAirdragDeclarationInputData airdragInputData); } } \ No newline at end of file diff --git a/VECTO3GUI2020/Views/JoblistView.xaml b/VECTO3GUI2020/Views/JoblistView.xaml index 9f378c0ef4988d4e059134e7c1736a121b4b9488..28f00fe30aa7325c436494b861430eb880705674 100644 --- a/VECTO3GUI2020/Views/JoblistView.xaml +++ b/VECTO3GUI2020/Views/JoblistView.xaml @@ -18,13 +18,13 @@ <Border BorderBrush="Transparent" BorderThickness="1"> <Grid> <StackPanel HorizontalAlignment="Stretch"> - <Button HorizontalAlignment="Stretch" + <Button Margin="4" HorizontalAlignment="Stretch" Style="{StaticResource MultiStageButtonStyle1}" >Simulation</Button> - <Button HorizontalAlignment="Stretch" + <Button Margin="4" HorizontalAlignment="Stretch" Style="{StaticResource MultiStageButtonStyle1}" Command="{Binding moveJobUp}" CommandParameter="{Binding ElementName=JobDataGrid, Path=SelectedItem}">Up</Button> - <Button HorizontalAlignment="Stretch" + <Button Margin="4" HorizontalAlignment="Stretch" Style="{StaticResource MultiStageButtonStyle1}" Command="{Binding moveJobDown}" CommandParameter="{Binding ElementName=JobDataGrid, Path=SelectedItem}">Down</Button> @@ -59,11 +59,10 @@ </DataGrid.Columns> <DataGrid.RowDetailsTemplate> <DataTemplate> - <StackPanel Orientation="Vertical"> - <Label Content="Filename"/> - <TextBlock Text="{Binding DataSource.SourceFile}" TextWrapping="Wrap" Margin="10" /> - </StackPanel> - + <StackPanel Orientation="Vertical"> + <Label Content="Filename"/> + <TextBlock Text="{Binding DataSource.SourceFile}" TextWrapping="Wrap" Margin="10" /> + </StackPanel> </DataTemplate> </DataGrid.RowDetailsTemplate> <DataGrid.InputBindings> @@ -80,17 +79,18 @@ <Grid Grid.Column="2"> <Border BorderBrush="Transparent" BorderThickness="1"> <StackPanel > - <Button HorizontalAlignment="Stretch" + <Button Margin="4" HorizontalAlignment="Stretch" Style="{StaticResource MultiStageButtonStyle1}" - Command="{Binding AddJob}">OpenFile</Button> - <Button HorizontalAlignment="Stretch" + Command="{Binding AddJob}" Background="#FFDDDDDD"> + OpenFile</Button> + <Button Margin ="4" HorizontalAlignment="Stretch" Style="{StaticResource MultiStageButtonStyle1}" Command="{Binding EditJob}" CommandParameter="{Binding ElementName=JobDataGrid, Path=SelectedItem}">EditFile</Button> - <Button HorizontalAlignment="Stretch" + <Button Margin="4" HorizontalAlignment="Stretch" Style="{StaticResource MultiStageButtonStyle1}" Command="{Binding NewManufacturingStageFile}">New Multistage File</Button> - <Button HorizontalAlignment="Stretch" + <Button Margin="4" HorizontalAlignment="Stretch" Style="{StaticResource MultiStageButtonStyle1}" Command="{Binding RemoveJob}" CommandParameter="{Binding ElementName=JobDataGrid, Path=SelectedItem}">DeleteFile</Button> diff --git a/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml b/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml index d46c3adaabf2f9899a97c89e1066d9c9355729a2..56d7cb622886cb5b2284eef810e8f9d9ff5ed297 100644 --- a/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml +++ b/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml @@ -22,7 +22,7 @@ <Label Content="{Binding LabelText, ElementName=MultistageParameterControl}"></Label> <CheckBox Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Name="CheckBox" - Visibility="{Binding Optional, + Visibility="{Binding ShowCheckBox, ElementName=MultistageParameterControl, Converter={StaticResource BooleanToVisibilityConverter}}" IsChecked="{Binding EditingEnabled, @@ -65,7 +65,7 @@ <Label Content="{Binding LabelText, ElementName=MultistageParameterControl}"></Label> <CheckBox Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Name="CheckBoxCombo" - Visibility="{Binding Optional, + Visibility="{Binding ShowCheckBox, ElementName=MultistageParameterControl, Converter={StaticResource BooleanToVisibilityConverter}}" IsChecked="{Binding EditingEnabled, @@ -76,15 +76,7 @@ ElementName=MultistageParameterControl, Converter={StaticResource BooleanToVisibilityConverter}}" IsHitTestVisible="False" Focusable="False" IsEditable="False" SelectedValue="{Binding PreviousContent, Mode=TwoWay, ElementName=MultistageParameterControl}" - ItemsSource="{Binding ListItems, ElementName=MultistageParameterControl}"/> - - <ComboBox Grid.Column="3" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="2 0 2 0" - SelectedValue="{Binding Content, Mode=TwoWay, ElementName=MultistageParameterControl}" - ItemsSource="{Binding ListItems, ElementName=MultistageParameterControl}" - IsHitTestVisible="{Binding ElementName=MultistageParameterControl, - Path=EditingEnabled}" - Focusable="{Binding RelativeSource={RelativeSource Self}, - Path=IsHitTestVisible}" IsEditable="False"> + ItemsSource="{Binding ListItems, ElementName=MultistageParameterControl}"> <ComboBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Converter={StaticResource EnumConverter}}" /> @@ -92,6 +84,19 @@ </ComboBox.ItemTemplate> </ComboBox> + + <ComboBox Grid.Column="3" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="2 0 2 0" + SelectedValue="{Binding Content, Mode=TwoWay, ElementName=MultistageParameterControl, ValidatesOnExceptions=True}" + ItemsSource="{Binding ListItems, ElementName=MultistageParameterControl}" + + IsEnabled="{Binding EditingEnabled, ElementName=MultistageParameterControl}" + IsEditable="False" MouseDoubleClick="Control_OnMouseDoubleClick"> + <ComboBox.ItemTemplate> + <DataTemplate> + <TextBlock Text="{Binding Converter={StaticResource EnumConverter}}" /> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> <Label Grid.Column="4" @@ -113,7 +118,7 @@ <Label Content="{Binding LabelText, ElementName=MultistageParameterControl}"></Label> <CheckBox Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Name="CheckBoxCheckBox" - Visibility="{Binding Optional, + Visibility="{Binding ShowCheckBox, ElementName=MultistageParameterControl, Converter={StaticResource BooleanToVisibilityConverter}}" IsChecked="{Binding EditingEnabled, diff --git a/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml.cs b/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml.cs index ec80c36347d9167c70fc5803b78b5dec27ca0af0..b97980c818cdc77d7d77c72181e9e07f410e0b0f 100644 --- a/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml.cs +++ b/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml.cs @@ -60,13 +60,19 @@ namespace VECTO3GUI2020.Views.Multistage.CustomControls MultiStageParameter multiStageParameter = (MultiStageParameter)d; if ((bool)e.NewValue == false) { multiStageParameter.EditingEnabled = true; + multiStageParameter.ShowCheckBox = false; + } else { + multiStageParameter.ShowCheckBox = true; } } public bool Optional { get { return (bool)GetValue(OptionalProperty); } - set { SetValue(OptionalProperty, value); } + set + { + SetValue(OptionalProperty, value); + } } public static readonly DependencyProperty ModeProperty = DependencyProperty.Register( @@ -97,7 +103,10 @@ namespace VECTO3GUI2020.Views.Multistage.CustomControls public bool EditingEnabled { - get { return (bool)GetValue(EditingEnabledProperty);} + get + { + return (bool)GetValue(EditingEnabledProperty); + } set { SetValue(EditingEnabledProperty, value); @@ -115,13 +124,13 @@ namespace VECTO3GUI2020.Views.Multistage.CustomControls } - public static readonly DependencyProperty HideCheckBoxProperty = DependencyProperty.Register( - "HideCheckBox", typeof(bool), typeof(MultiStageParameter), new PropertyMetadata(default(bool))); + public static readonly DependencyProperty ShowCheckBoxProperty = DependencyProperty.Register( + "ShowCheckBox", typeof(bool), typeof(MultiStageParameter), new PropertyMetadata(true)); - public bool HideCheckBox + public bool ShowCheckBox { - get { return (bool)GetValue(HideCheckBoxProperty); } - set { SetValue(HideCheckBoxProperty, value); } + get { return (bool)GetValue(ShowCheckBoxProperty); } + set { SetValue(ShowCheckBoxProperty, value); } } diff --git a/VECTO3GUI2020/Views/Multistage/ManufacturingStageAuxiliariesView.xaml b/VECTO3GUI2020/Views/Multistage/ManufacturingStageAuxiliariesView.xaml index 828ae1e89b328a99a1cffb671b30974ac4b67566..63b5a17d7798e679c96627b0245f0b74e8b8f2ac 100644 --- a/VECTO3GUI2020/Views/Multistage/ManufacturingStageAuxiliariesView.xaml +++ b/VECTO3GUI2020/Views/Multistage/ManufacturingStageAuxiliariesView.xaml @@ -10,74 +10,79 @@ d:DesignHeight="450" d:DesignWidth="800" BorderBrush="{DynamicResource ButtonHighlightColor}" BorderThickness="2" Margin="4" d:DataContext="{d:DesignInstance impl:MultistageAuxiliariesViewModel}"> <Grid> - <StackPanel> - <Label Background="{DynamicResource ButtonHighlightColor}" HorizontalAlignment="Stretch">AUXILIARIES</Label> - <customControls:MultiStageParameter Mode="COMBOBOX" + <ScrollViewer> + <DockPanel> + <StackPanel DockPanel.Dock="Top"> + <Label Background="{DynamicResource ButtonHighlightColor}" HorizontalAlignment="Stretch">AUXILIARIES</Label> + <customControls:MultiStageParameter Mode="CHECKBOX" + PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.InteriorLightsLED}" + Content="{Binding InteriorLightsLED}"/> + <customControls:MultiStageParameter Mode="CHECKBOX" + PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.DayrunninglightsLED}" + Content="{Binding DayrunninglightsLED}"/> + <customControls:MultiStageParameter Mode="CHECKBOX" + PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.PositionlightsLED}" + Content="{Binding PositionlightsLED}"/> + <customControls:MultiStageParameter Mode="CHECKBOX" + PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.BrakelightsLED}" + Content="{Binding BrakelightsLED}"/> + <customControls:MultiStageParameter Mode="CHECKBOX" + PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.HeadlightsLED}" + Content="{Binding HeadlightsLED}"/> + + <Separator/> + <Label Content="Add configuration check for complete vehicle"></Label> + <customControls:MultiStageParameter Mode="COMBOBOX" EditingEnabled="{Binding HeatPumpGroupEditingEnabled}" PreviousContent="{Binding ConsolidatedInputData.HVACAux.SystemConfiguration}" Content="{Binding HVACAux.SystemConfiguration}"/> - - <customControls:MultiStageParameter Mode="COMBOBOX" + <customControls:MultiStageParameter Mode="COMBOBOX" EditingEnabled="{Binding HeatPumpGroupEditingEnabled}" PreviousContent="{Binding ConsolidatedInputData.HVACAux.HeatPumpTypeDriverCompartment}" - Content="{Binding - HeatPumpTypeDriverCompartment}"/> - <customControls:MultiStageParameter Mode="COMBOBOX" + Content="{Binding HeatPumpTypeDriverCompartment}" + ShowCheckBox="False"/> + <customControls:MultiStageParameter Mode="COMBOBOX" EditingEnabled="{Binding HeatPumpGroupEditingEnabled}" PreviousContent="{Binding ConsolidatedInputData.HVACAux.HeatPumpModeDriverCompartment}" - Content="{Binding - HeatPumpModeDriverCompartment}"/> - <customControls:MultiStageParameter Mode="COMBOBOX" + Content="{Binding HeatPumpModeDriverCompartment}" + ShowCheckBox="False"/> + <customControls:MultiStageParameter Mode="COMBOBOX" EditingEnabled="{Binding HeatPumpGroupEditingEnabled}" PreviousContent="{Binding ConsolidatedInputData.HVACAux.HeatPumpTypePassengerCompartment}" - Content="{Binding - HeatPumpTypePassengerCompartment}"/> - <customControls:MultiStageParameter Mode="COMBOBOX" + Content="{Binding HeatPumpTypePassengerCompartment}" + ShowCheckBox="False"/> + <customControls:MultiStageParameter Mode="COMBOBOX" EditingEnabled="{Binding HeatPumpGroupEditingEnabled}" PreviousContent="{Binding ConsolidatedInputData.HVACAux.HeatPumpModePassengerCompartment}" - Content="{Binding - HeatPumpModePassengerCompartment}"/> - <Separator/> - <customControls:MultiStageParameter Mode="TEXTBOX" + Content="{Binding HeatPumpModePassengerCompartment}" + ShowCheckBox="False"/> + <Separator/> + <customControls:MultiStageParameter Mode="TEXTBOX" PreviousContent="{Binding ConsolidatedInputData.HVACAux.AuxHeaterPower}" Content="{Binding AuxHeaterPower}"/> - <customControls:MultiStageParameter Mode="CHECKBOX" + <customControls:MultiStageParameter Mode="CHECKBOX" PreviousContent="{Binding ConsolidatedInputData.HVACAux.DoubleGlazing}" Content="{Binding DoubleGlazing}"/> - <customControls:MultiStageParameter Mode="CHECKBOX" + <customControls:MultiStageParameter Mode="CHECKBOX" PreviousContent="{Binding ConsolidatedInputData.HVACAux.AdjustableAuxiliaryHeater}" Content="{Binding AdjustableAuxiliaryHeater}"/> - <customControls:MultiStageParameter Mode="CHECKBOX" + <customControls:MultiStageParameter Mode="CHECKBOX" PreviousContent="{Binding ConsolidatedInputData.HVACAux.SeparateAirDistributionDucts}" Content="{Binding SeparateAirDistributionDucts}"/> - <customControls:MultiStageParameter Mode="CHECKBOX" + <customControls:MultiStageParameter Mode="CHECKBOX" PreviousContent="{Binding ConsolidatedInputData.HVACAux.WaterElectricHeater}" Content="{Binding WaterElectricHeater}"/> - <customControls:MultiStageParameter Mode="CHECKBOX" + <customControls:MultiStageParameter Mode="CHECKBOX" PreviousContent="{Binding ConsolidatedInputData.HVACAux.AirElectricHeater}" Content="{Binding AirElectricHeater}"/> - <customControls:MultiStageParameter Mode="CHECKBOX" + <customControls:MultiStageParameter Mode="CHECKBOX" PreviousContent="{Binding ConsolidatedInputData.HVACAux.OtherHeatingTechnology}" Content="{Binding OtherHeatingTechnology}"/> - <Separator/> - <customControls:MultiStageParameter Mode="CHECKBOX" - PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.InteriorLightsLED}" - Content="{Binding InteriorLightsLED}"/> - <customControls:MultiStageParameter Mode="CHECKBOX" - PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.DayrunninglightsLED}" - Content="{Binding DayrunninglightsLED}"/> - <customControls:MultiStageParameter Mode="CHECKBOX" - PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.PositionlightsLED}" - Content="{Binding PositionlightsLED}"/> - <customControls:MultiStageParameter Mode="CHECKBOX" - PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.BrakelightsLED}" - Content="{Binding BrakelightsLED}"/> - <customControls:MultiStageParameter Mode="CHECKBOX" - PreviousContent="{Binding ConsolidatedInputData.ElectricConsumers.HeadlightsLED}" - Content="{Binding HeadlightsLED}"/> - - </StackPanel> + <Separator/> + </StackPanel> + </DockPanel> + </ScrollViewer> </Grid> </UserControl> diff --git a/VECTO3GUI2020/Views/Multistage/MultiStageView.xaml b/VECTO3GUI2020/Views/Multistage/MultiStageView.xaml index d408d0cc3ffe9d8df644a72512f3bc7c5dcd83ca..cfb78aa7444eaa81159b12b89582592a1a23a6df 100644 --- a/VECTO3GUI2020/Views/Multistage/MultiStageView.xaml +++ b/VECTO3GUI2020/Views/Multistage/MultiStageView.xaml @@ -5,10 +5,12 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:VECTO3GUI2020.Views.Multistage" xmlns:implementation="clr-namespace:VECTO3GUI2020.ViewModel.MultiStage.Implementation" + xmlns:customControls="clr-namespace:VECTO3GUI2020.Views.Multistage.CustomControls" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance implementation:MultiStageJobViewModel_v0_1}"> <Grid> <DockPanel> + <customControls:FilePicker Command="{Binding LoadVehicleDataCommand}" DockPanel.Dock="Top" Text="{Binding VehicleInputDataFilePath}"></customControls:FilePicker> <Border BorderThickness="1" BorderBrush="{DynamicResource ButtonHighlightColor}" Height="40" DockPanel.Dock="Bottom"> <DockPanel LastChildFill="False"> <Button DockPanel.Dock="Right" @@ -16,8 +18,9 @@ Command="{Binding SaveCommand}" Style="{DynamicResource MultiStageButtonStyle1}" Margin="4" - Padding="4">Save</Button> - <Button DockPanel.Dock="Right" Width="100" Style="{DynamicResource MultiStageButtonStyle1}" Margin="4" Padding="4">Save as</Button> + Padding="4">Save as new VIF</Button> + <Button DockPanel.Dock="Right" Width="100" Style="{DynamicResource MultiStageButtonStyle1}" Margin="4" Padding="4">Save Input</Button> + <Button DockPanel.Dock="Right" Width="100" Style="{DynamicResource MultiStageButtonStyle1}" Margin="4" Padding="4">Save Input As ... </Button> </DockPanel> </Border> <ContentControl DockPanel.Dock="Top" Content="{Binding ManufacturingStageViewModel}"/> diff --git a/VECTO3GUI2020/Views/Multistage/MultistageAirDragView.xaml b/VECTO3GUI2020/Views/Multistage/MultistageAirDragView.xaml index a9c5fa93df4048d4fb9262f90fbdd5c03d9ba5fc..c15697b01f7890046a0b50cf701fabb2423efa60 100644 --- a/VECTO3GUI2020/Views/Multistage/MultistageAirDragView.xaml +++ b/VECTO3GUI2020/Views/Multistage/MultistageAirDragView.xaml @@ -12,19 +12,27 @@ d:DesignHeight="450" d:DesignWidth="800" BorderBrush="{DynamicResource ButtonHighlightColor}" BorderThickness="2" Margin="4" d:DataContext="{d:DesignInstance impl:MultistageAirdragViewModel}"> <Grid> - <StackPanel> - <Label Content="AIRDRAG" HorizontalAlignment="Stretch" Background="{DynamicResource ButtonHighlightColor}" Style="{DynamicResource LabelStyle1}"/> - <customControlsMultistage:FilePicker Text="{Binding AirdragFilePath}" Command="{Binding LoadAirdragFileCommand}"/> - <StackPanel HorizontalAlignment="Stretch" Margin="4"> - <Label>Consolidated Airdrag Data</Label> - <customControlsMultistage:LabledTextBoxMultistage Content="{Binding ConsolidatedAirdragData.Manufacturer, Mode=OneWay}" ReadOnly="True"/> - <customControlsMultistage:LabledTextBoxMultistage Content="{Binding ConsolidatedAirdragData.Model, Mode=OneWay}" ReadOnly="True"/> - <customControlsMultistage:LabledTextBoxMultistage Content="{Binding ConsolidatedAirdragData.AirDragArea, Mode=OneWay}" ReadOnly="True"/> - <Separator/> - <Label>Data from File</Label> - <ContentControl Margin="0" Padding="0" Content="{Binding AirDragViewModel}"/> - </StackPanel> - </StackPanel> - + <ScrollViewer> + <DockPanel> + <StackPanel DockPanel.Dock="Top"> + <Label Content="AIRDRAG" HorizontalAlignment="Stretch" Background="{DynamicResource ButtonHighlightColor}" Style="{DynamicResource LabelStyle1}"/> + <customControlsMultistage:FilePicker Text="{Binding AirdragFilePath}" Command="{Binding LoadAirdragFileCommand}"/> + <StackPanel HorizontalAlignment="Stretch" Margin="4"> + <Label Style="{DynamicResource LabelStyle1}">Consolidated Airdrag Data</Label> + <customControlsMultistage:LabledTextBoxMultistage Content="{Binding ConsolidatedAirdragData.Manufacturer, Mode=OneWay}" ReadOnly="True"/> + <customControlsMultistage:LabledTextBoxMultistage Content="{Binding ConsolidatedAirdragData.Model, Mode=OneWay}" ReadOnly="True"/> + <customControlsMultistage:LabledTextBoxMultistage Content="{Binding ConsolidatedAirdragData.AirDragArea, Mode=OneWay}" ReadOnly="True"/> + <Label Style="{DynamicResource LabelStyle1}">Data from File</Label> + <ContentControl Content="{Binding AirDragViewModel}"> + <ContentControl.ContentTemplate> + <DataTemplate> + <local:AirDragView_v2_8 DataContext="{Binding }"/> + </DataTemplate> + </ContentControl.ContentTemplate> + </ContentControl> + </StackPanel> + </StackPanel> + </DockPanel> + </ScrollViewer> </Grid> </UserControl> diff --git a/VECTO3GUI2020/Views/Multistage/VehicleView_v2_8.xaml b/VECTO3GUI2020/Views/Multistage/VehicleView_v2_8.xaml index 548910babaafe9184cbac4761d1df49bb9992935..82dbaea629a7c05717c935e262fa43fdddba8e5e 100644 --- a/VECTO3GUI2020/Views/Multistage/VehicleView_v2_8.xaml +++ b/VECTO3GUI2020/Views/Multistage/VehicleView_v2_8.xaml @@ -13,68 +13,144 @@ <StackPanel> <Label Content="VEHICLE DATA" HorizontalAlignment="Stretch" FontSize="15" VerticalAlignment="Stretch" Style="{DynamicResource LabelStyle1}"/> - <!--Background="{Binding Path=BorderBrush, - RelativeSource={RelativeSource Mode=FindAncestor, - AncestorType=Window}}"/>--> - <custom:MultiStageParameter Optional="False" Content="{Binding Manufacturer}"/> - <custom:MultiStageParameter Optional="False" Content="{Binding ManufacturerAddress}"/> - <custom:MultiStageParameter Optional="False" Content="{Binding VIN}"/> <custom:MultiStageParameter - PreviousContent="{Binding ConsolidatedVehicleData.Model}" - Content="{Binding Model}"/> + Optional="False" + Content="{Binding Manufacturer}"/> + <custom:MultiStageParameter + Optional="False" + Content="{Binding ManufacturerAddress}"/> + <custom:MultiStageParameter + Optional="False" + Content="{Binding VIN}"/> + + <custom:MultiStageParameter + PreviousContent="{Binding ConsolidatedVehicleData.Model}" + Content="{Binding Model}"/> + + <custom:MultiStageParameter + LabelText="Date" + Content="Date - todo"/> + + <custom:MultiStageParameter + PreviousContent="{Binding ConsolidatedVehicleData.LegislativeClass}" + Content="{Binding LegislativeClass}" + Mode="COMBOBOX" /> + + <custom:MultiStageParameter + PreviousContent="{Binding ConsolidatedVehicleData.CurbMassChassis}" + Content="{Binding CurbMassChassis}"/> + + <custom:MultiStageParameter + PreviousContent="{Binding ConsolidatedVehicleData.GrossVehicleMassRating}" + Content="{Binding GrossVehicleMassRating}"/> + + + <custom:MultiStageParameter + EditingEnabled="{Binding AirdragModifiedMultistageEditingEnabled}" + PreviousContent="{Binding ConsolidatedAirdragModifiedEnum}" + Content="{Binding AirdragModifiedEnum}" + Mode="COMBOBOX"/> + + <custom:MultiStageParameter + PreviousContent="{Binding ConsolidatedVehicleData.TankSystem}" + Content="{Binding TankSystem}" + Mode="COMBOBOX" /> + + <custom:MultiStageParameter + PreviousContent="{Binding ConsolidatedVehicleData.RegisteredClass}" + Content="{Binding RegisteredClass}" + Mode="COMBOBOX" /> + + <Separator/> + <custom:MultiStageParameter + EditingEnabled="{Binding NumberOfPassengersEditingEnabled}" + PreviousContent="{Binding ConsolidatedVehicleData.NumberOfPassengersUpperDeck}" + Content="{Binding NumberOfPassengersUpperDeck}"/> + <custom:MultiStageParameter + EditingEnabled="{Binding NumberOfPassengersEditingEnabled}" + PreviousContent="{Binding ConsolidatedVehicleData.NumberOfPassengersLowerDeck}" + Content="{Binding NumberOfPassengersLowerDeck}" + ShowCheckBox="False"/> <Separator/> - <custom:MultiStageParameter EditingEnabled="{Binding - MeasurementsGroupEditingEnabled}" - PreviousContent="{Binding ConsolidatedHeightInMm}" - Content="{Binding HeightInMm}" - DummyContent="{Binding Source={StaticResource milimeterDummy}}"/> - <custom:MultiStageParameter EditingEnabled="{Binding - MeasurementsGroupEditingEnabled}" - PreviousContent="{Binding ConsolidatedWidthInMm}" - Content="{Binding WidthInMm}" - HideCheckBox="True" - DummyContent="{Binding Source={StaticResource milimeterDummy}}"/> - <custom:MultiStageParameter EditingEnabled="{Binding - MeasurementsGroupEditingEnabled}" - PreviousContent="{Binding ConsolidatedLengthInMm}" - Content="{Binding LengthInMm}" - HideCheckBox="True" - DummyContent="{Binding Source={StaticResource milimeterDummy}}"/> + <custom:MultiStageParameter + PreviousContent="{Binding ConsolidatedVehicleData.VehicleCode}" + Content="{Binding VehicleCode}" + Mode="COMBOBOX" + /> + + <custom:MultiStageParameter + PreviousContent="{Binding ConsolidatedVehicleData.LowEntry}" + Content="{Binding LowEntry}" + Mode="CHECKBOX" + /> + <Separator/> - <custom:MultiStageParameter EditingEnabled="{Binding - NumberOfPassengersEditingEnabled}" - PreviousContent="{Binding ConsolidatedVehicleData.NumberOfPassengersUpperDeck}" - Content="{Binding NumberOfPassengersUpperDeck}"/> - <custom:MultiStageParameter EditingEnabled="{Binding - NumberOfPassengersEditingEnabled}" - PreviousContent="{Binding ConsolidatedVehicleData.NumberOfPassengersLowerDeck}" - Content="{Binding NumberOfPassengersLowerDeck}" - HideCheckBox="True"/> + <custom:MultiStageParameter + EditingEnabled="{Binding + MeasurementsGroupEditingEnabled}" + PreviousContent="{Binding ConsolidatedHeightInMm}" + Content="{Binding HeightInMm}" + DummyContent="{Binding Source={StaticResource milimeterDummy}}"/> + <custom:MultiStageParameter + EditingEnabled="{Binding MeasurementsGroupEditingEnabled}" + PreviousContent="{Binding ConsolidatedWidthInMm}" + Content="{Binding WidthInMm}" + ShowCheckBox="False" + DummyContent="{Binding Source={StaticResource milimeterDummy}}"/> + <custom:MultiStageParameter + EditingEnabled="{Binding MeasurementsGroupEditingEnabled}" + PreviousContent="{Binding ConsolidatedLengthInMm}" + Content="{Binding LengthInMm}" + ShowCheckBox="False" + DummyContent="{Binding Source={StaticResource milimeterDummy}}"/> + + <custom:MultiStageParameter + EditingEnabled="{Binding MeasurementsGroupEditingEnabled}" + PreviousContent="{Binding ConsolidatedEntranceHeightInMm}" + Content="{Binding EntranceHeightInMm}" + ShowCheckBox="False" + DummyContent="{Binding Source={StaticResource milimeterDummy}}"/> <Separator/> - <custom:MultiStageParameter EditingEnabled="{Binding AirdragModifiedMultistageEditingEnabled}" - PreviousContent="{Binding ConsolidatedVehicleData.AirdragModifiedMultistage}" - Content="{Binding AirdragModifiedMultistage}" Mode="CHECKBOX"/> - - <custom:MultiStageParameter PreviousContent="{Binding ConsolidatedVehicleData.GrossVehicleMassRating}" - Content="{Binding GrossVehicleMassRating}"/> - <custom:MultiStageParameter PreviousContent="{Binding ConsolidatedVehicleData.DoorDriveTechnology}" - Content="{Binding DoorDriveTechnology}" Mode="COMBOBOX" /> - <custom:MultiStageParameter PreviousContent="{Binding ConsolidatedVehicleData.LegislativeClass}" - Content="{Binding LegislativeClass}" Mode="COMBOBOX" /> - <custom:MultiStageParameter PreviousContent="{Binding ConsolidatedVehicleData.RegisteredClass}" - Content="{Binding RegisteredClass}" Mode="COMBOBOX" /> - <custom:MultiStageParameter PreviousContent="{Binding ConsolidatedVehicleData.VehicleCode}" - Content="{Binding VehicleCode}" Mode="COMBOBOX" /> - <custom:MultiStageParameter PreviousContent="{Binding ConsolidatedVehicleData.LowEntry}" - Content="{Binding LowEntry}" Mode="CHECKBOX"/> - <custom:MultiStageParameter PreviousContent="{Binding ConsolidatedVehicleData.EntranceHeight}" - Content="{Binding EntranceHeight}" /> - <custom:MultiStageParameter PreviousContent="{Binding ConsolidatedVehicleData.TankSystem}" - Content="{Binding TankSystem}" Mode="COMBOBOX" /> - <custom:MultiStageParameter PreviousContent="{Binding ConsolidatedVehicleData.VehicleDeclarationType}" - Content="{Binding VehicleDeclarationType}" Mode="COMBOBOX" /> + + + <custom:MultiStageParameter + PreviousContent="{Binding ConsolidatedVehicleData.DoorDriveTechnology}" + + Content="{Binding DoorDriveTechnology}" Mode="COMBOBOX" /> + + + <custom:MultiStageParameter + PreviousContent="{Binding ConsolidatedVehicleData.VehicleDeclarationType}" + + Content="{Binding VehicleDeclarationType}" Mode="COMBOBOX" /> + + <Label Content="ADAS" Style="{DynamicResource LabelStyle1}"/> + <custom:MultiStageParameter + EditingEnabled="{Binding AdasEditingEnabled}" + PreviousContent="{Binding ConsolidatedVehicleData.ADAS.EngineStopStart}" + Content="{Binding EngineStopStartNullable}" + + Mode="CHECKBOX"/> + <custom:MultiStageParameter + EditingEnabled="{Binding AdasEditingEnabled}" + PreviousContent="{Binding ConsolidatedVehicleData.ADAS.EcoRoll}" + Content="{Binding EcoRollTypeNullable}" + ShowCheckBox="False" + Mode="COMBOBOX"/> + <custom:MultiStageParameter + EditingEnabled="{Binding AdasEditingEnabled}" + PreviousContent="{Binding ConsolidatedVehicleData.ADAS.PredictiveCruiseControl}" + Content="{Binding PredictiveCruiseControlNullable}" + ShowCheckBox="False" + Mode="COMBOBOX"/> + <custom:MultiStageParameter + EditingEnabled="{Binding AdasEditingEnabled}" + PreviousContent="{Binding ConsolidatedVehicleData.ADAS.ATEcoRollReleaseLockupClutch}" + Content="{Binding ATEcoRollReleaseLockupClutch}" + ShowCheckBox="False" + Mode="CHECKBOX"/> </StackPanel> </DockPanel> </ScrollViewer> diff --git a/VectoCommon/VectoCommon/BusAuxiliaries/BusHVACSystemConfiguration.cs b/VectoCommon/VectoCommon/BusAuxiliaries/BusHVACSystemConfiguration.cs index d40626c7002ef1bd61aaed7b7e914db26116f629..f0b17871e655b91175246811349a394b7ec0b0c6 100644 --- a/VectoCommon/VectoCommon/BusAuxiliaries/BusHVACSystemConfiguration.cs +++ b/VectoCommon/VectoCommon/BusAuxiliaries/BusHVACSystemConfiguration.cs @@ -5,17 +5,40 @@ using TUGraz.VectoCommon.Utils; namespace TUGraz.VectoCommon.BusAuxiliaries { public enum BusHVACSystemConfiguration { + [GuiLabel("Unknown")] Unknown, + + [GuiLabel("Configuration 0")] Configuration0, + + [GuiLabel("Configuration 1")] Configuration1, + + [GuiLabel("Configuration 2")] Configuration2, + + [GuiLabel("Configuration 3")] Configuration3, + + [GuiLabel("Configuration 4")] Configuration4, + + [GuiLabel("Configuration 5")] Configuration5, + + [GuiLabel("Configuration 6")] Configuration6, + + [GuiLabel("Configuration 7")] Configuration7, + + [GuiLabel("Configuration 8")] Configuration8, + + [GuiLabel("Configuration 9")] Configuration9, + + [GuiLabel("Configuration 10")] Configuration10, } diff --git a/VectoCommon/VectoCommon/BusAuxiliaries/ISSMInputs.cs b/VectoCommon/VectoCommon/BusAuxiliaries/ISSMInputs.cs index 94d5cef6b6b528f00d399a9f76fd8e9c75d913de..2f5a2f8ad2a9c315e943e730f8d3a8293afb5a9c 100644 --- a/VectoCommon/VectoCommon/BusAuxiliaries/ISSMInputs.cs +++ b/VectoCommon/VectoCommon/BusAuxiliaries/ISSMInputs.cs @@ -190,11 +190,22 @@ namespace TUGraz.VectoCommon.BusAuxiliaries public enum HeatPumpType { + [GuiLabel("None")] none, + + [GuiLabel("R 744")] R_744, + + [GuiLabel("non R 744: 2-stage")] non_R_744_2_stage, + + [GuiLabel("non R 744: 3-stage")] non_R_744_3_stage, + + [GuiLabel("non R 744: 4-stage")] non_R_744_4_stage, + + [GuiLabel("non R 744: continuous")] non_R_744_continuous } diff --git a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs index 2fe560df45604dc7bd17c26f27043fb8cec3c991..f1f511f820ff82136e3ea292c607d78b8e473303 100644 --- a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs +++ b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs @@ -255,8 +255,11 @@ namespace TUGraz.VectoCommon.InputData public enum PredictiveCruiseControlType { + [GuiLabel("None")] None, + [GuiLabel("Option I + II")] Option_1_2, + [GuiLabel("Option I + II + III")] Option_1_2_3 } @@ -288,8 +291,11 @@ namespace TUGraz.VectoCommon.InputData public enum EcoRollType { + [GuiLabel("None")] None, + [GuiLabel("Without Engine Stop")] WithoutEngineStop, + [GuiLabel("With Engine Stop")] WithEngineStop } @@ -947,7 +953,9 @@ namespace TUGraz.VectoCommon.InputData public enum VehicleDeclarationType { + [GuiLabel("Interim")] interim, + [GuiLabel("Final")] final } diff --git a/VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration/SchemaVersionMultistage.0.1/AidragComponent.xml b/VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration/SchemaVersionMultistage.0.1/AidragComponent.xml new file mode 100644 index 0000000000000000000000000000000000000000..9bc44b124397a660b40ff7ce3bd6f3fad43a4819 --- /dev/null +++ b/VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration/SchemaVersionMultistage.0.1/AidragComponent.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--Sample XML file generated by XMLSpy v2016 rel. 2 sp1 (x64) (http://www.altova.com)--> +<v2.0:VectoInputDeclaration xmlns:di="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:v2.0="urn:tugraz:ivt:VectoAPI:DeclarationComponent:v2.0" xmlns:vdecdef2.0="urn:tugraz:ivt:VectoAPI:DeclarationDefinitions:v2.0" schemaVersion="1.0" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationComponent:v2.0 VectoComponent.2.0.xsd"> + <v2.0:AirDrag> + <vdecdef2.0:Data xsi:type="vdecdef2.0:AirDragDataDeclarationType" id="a"> + <vdecdef2.0:Manufacturer>a</vdecdef2.0:Manufacturer> + <vdecdef2.0:Model>a</vdecdef2.0:Model> + <vdecdef2.0:CertificationNumber>token</vdecdef2.0:CertificationNumber> + <vdecdef2.0:Date>2017-01-01T00:00:00Z</vdecdef2.0:Date> + <vdecdef2.0:AppVersion>aaaaa</vdecdef2.0:AppVersion> + <vdecdef2.0:CdxA_0>6.66</vdecdef2.0:CdxA_0> + <vdecdef2.0:TransferredCdxA>6.66</vdecdef2.0:TransferredCdxA> + <vdecdef2.0:DeclaredCdxA>6.66</vdecdef2.0:DeclaredCdxA> + </vdecdef2.0:Data> + <vdecdef2.0:Signature> + <di:Reference> + <di:DigestMethod Algorithm="http://www.altova.com/"/> + <di:DigestValue>UjBsR09EbGhjZ0dTQUxNQUFBUUNBRU1tQ1p0dU1GUXhEUzhi</di:DigestValue> + </di:Reference> + </vdecdef2.0:Signature> + </v2.0:AirDrag> +</v2.0:VectoInputDeclaration> diff --git a/VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration/SchemaVersionMultistage.0.1/AirdragLoadTestFile.xml b/VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration/SchemaVersionMultistage.0.1/AirdragLoadTestFile.xml index 1942b81b05fbfe38985c80819d8e76337e948751..3baab2fa609ec00fcb3b5095be0d7a63a5211f9d 100644 --- a/VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration/SchemaVersionMultistage.0.1/AirdragLoadTestFile.xml +++ b/VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration/SchemaVersionMultistage.0.1/AirdragLoadTestFile.xml @@ -1,10 +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="1.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationComponent:v1.0 C:\Users\Harry\source\repos\vecto-dev\VectoCore\VectoCore\Resources\XSD\VectoDeclarationComponent.xsd"> +<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="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:tugraz:ivt:VectoAPI:DeclarationComponent:v1.0 https://webgate.ec.europa.eu/CITnet/svn/VECTO/trunk/Share/XML/XSD/VectoComponent.xsd"> <tns:AirDrag> <Data id="TestAirDrag1234" xsi:type="AirDragDataDeclarationType"> <Manufacturer>Test AirDrag Manufacturer</Manufacturer>