From b68481b9b3d640d2f1618f1e050505f82dc674e0 Mon Sep 17 00:00:00 2001 From: "VKMTHD\\franzjosefkober" <franz.josef.kober@ivt.tugraz.at> Date: Fri, 17 Apr 2020 17:18:44 +0200 Subject: [PATCH] gui changes, refactoring --- VECTO3GUI/Helper/ComponentTitleConverter.cs | 57 ------------ .../Helper/{ => Converter}/BaseConverter.cs | 2 +- .../Converter/ComponentTitleConverter.cs | 29 ++++++ .../JobEntrySelectedConverter.cs | 2 +- .../{ => Converter}/SIValueConverter.cs | 2 +- .../Converter/SaveButtonLabelConverter.cs | 30 ++++++ .../{ => Converter}/VehicleClassConverter.cs | 2 +- .../TempDataObject/VehicleBusComponentData.cs | 1 + VECTO3GUI/Util/Component.cs | 39 ++++++++ VECTO3GUI/VECTO3GUI.csproj | 11 ++- .../ViewModel/Impl/AbstractJobViewModel.cs | 2 - VECTO3GUI/ViewModel/Impl/AbstractViewModel.cs | 6 ++ .../ViewModel/Impl/AuxiliariesViewModel.cs | 11 +++ .../Impl/CompleteVehicleBusJobViewModel.cs | 51 +++++++++-- .../Impl/CompleteVehicleBusViewModel.cs | 13 +++ VECTO3GUI/ViewModel/Impl/JoblistViewModel.cs | 6 +- .../Interfaces/IComponentViewModel.cs | 2 + .../Declaration/AirdragDeclarationView.xaml | 3 +- .../AngledriveDeclarationView.xaml | 7 +- .../AuxiliariesDeclarationView.xaml | 3 +- .../Declaration/AxlegearDeclarationView.xaml | 7 +- .../Declaration/CompleteVehicleBusView.xaml | 13 +-- .../Declaration/EngineDeclarationView.xaml | 11 ++- .../Declaration/GearboxDeclarationView.xaml | 5 +- .../Declaration/PrimaryVehicleBusView.xaml | 5 +- .../Declaration/RetarderDeclarationView.xaml | 5 +- .../TorqueConverterDeclarationView.xaml | 3 +- .../Declaration/TyreDeclarationView.xaml | 3 +- .../Declaration/VehicleDeclarationView.xaml | 11 ++- .../Engineering/EngineEngineeringView.xaml | 5 +- VECTO3GUI/Views/JoblistTabView.xaml | 91 ++++++++++++------- VectoCore/VectoCore/VectoCore.csproj | 4 +- 32 files changed, 294 insertions(+), 148 deletions(-) delete mode 100644 VECTO3GUI/Helper/ComponentTitleConverter.cs rename VECTO3GUI/Helper/{ => Converter}/BaseConverter.cs (86%) create mode 100644 VECTO3GUI/Helper/Converter/ComponentTitleConverter.cs rename VECTO3GUI/Helper/{ => Converter}/JobEntrySelectedConverter.cs (94%) rename VECTO3GUI/Helper/{ => Converter}/SIValueConverter.cs (98%) create mode 100644 VECTO3GUI/Helper/Converter/SaveButtonLabelConverter.cs rename VECTO3GUI/Helper/{ => Converter}/VehicleClassConverter.cs (95%) diff --git a/VECTO3GUI/Helper/ComponentTitleConverter.cs b/VECTO3GUI/Helper/ComponentTitleConverter.cs deleted file mode 100644 index a32ba20a5b..0000000000 --- a/VECTO3GUI/Helper/ComponentTitleConverter.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Data; -using VECTO3GUI.Util; - -namespace VECTO3GUI.Helper -{ - public class ComponentTitleConverter : BaseConverter, IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is Component) { - var component = (Component)value; - switch (component) { - case Component.Vehicle: - case Component.PrimaryBusVehicle: - case Component.CompleteBusVehicle: - return nameof(Component.Vehicle); - case Component.Engine: - return nameof(Component.Engine); - case Component.Gearbox: - return nameof(Component.Gearbox); - case Component.TorqueConverter: - return "Torque Converter"; - case Component.Retarder: - return "Retarder"; - case Component.Angledrive: - return "Angle Drive"; - case Component.Axlegear: - return "Axle Gear"; - case Component.PTO: - return "Power Take Off"; - case Component.Airdrag: - return "Air Drag"; - case Component.Axles: - return "Axle"; - case Component.Auxiliaries: - case Component.BusAuxiliaries: - return "Auxiliary"; - case Component.Cycle: - return nameof(Component.Cycle); - } - } - - return value; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/VECTO3GUI/Helper/BaseConverter.cs b/VECTO3GUI/Helper/Converter/BaseConverter.cs similarity index 86% rename from VECTO3GUI/Helper/BaseConverter.cs rename to VECTO3GUI/Helper/Converter/BaseConverter.cs index d1291d131f..268ce1a1d6 100644 --- a/VECTO3GUI/Helper/BaseConverter.cs +++ b/VECTO3GUI/Helper/Converter/BaseConverter.cs @@ -1,7 +1,7 @@ using System; using System.Windows.Markup; -namespace VECTO3GUI.Helper { +namespace VECTO3GUI.Helper.Converter { public class BaseConverter : MarkupExtension { #region Overrides of MarkupExtension diff --git a/VECTO3GUI/Helper/Converter/ComponentTitleConverter.cs b/VECTO3GUI/Helper/Converter/ComponentTitleConverter.cs new file mode 100644 index 0000000000..fd4dc4aabe --- /dev/null +++ b/VECTO3GUI/Helper/Converter/ComponentTitleConverter.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using VECTO3GUI.Util; + +namespace VECTO3GUI.Helper.Converter +{ + public class ComponentTitleConverter : BaseConverter, IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is Component) { + var component = (Component)value; + return component.GetLabel(); + } + + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/VECTO3GUI/Helper/JobEntrySelectedConverter.cs b/VECTO3GUI/Helper/Converter/JobEntrySelectedConverter.cs similarity index 94% rename from VECTO3GUI/Helper/JobEntrySelectedConverter.cs rename to VECTO3GUI/Helper/Converter/JobEntrySelectedConverter.cs index 58382962a4..e34b9b0f06 100644 --- a/VECTO3GUI/Helper/JobEntrySelectedConverter.cs +++ b/VECTO3GUI/Helper/Converter/JobEntrySelectedConverter.cs @@ -3,7 +3,7 @@ using System.Globalization; using System.Windows.Controls; using System.Windows.Data; -namespace VECTO3GUI.Helper +namespace VECTO3GUI.Helper.Converter { public class JobEntrySelectedConverter : IValueConverter { diff --git a/VECTO3GUI/Helper/SIValueConverter.cs b/VECTO3GUI/Helper/Converter/SIValueConverter.cs similarity index 98% rename from VECTO3GUI/Helper/SIValueConverter.cs rename to VECTO3GUI/Helper/Converter/SIValueConverter.cs index 494cb8f52d..79a71f0bab 100644 --- a/VECTO3GUI/Helper/SIValueConverter.cs +++ b/VECTO3GUI/Helper/Converter/SIValueConverter.cs @@ -7,7 +7,7 @@ using TUGraz.VectoCommon.Utils; using Expression = System.Linq.Expressions.Expression; using SIUtils = VECTO3GUI.Util.SIUtils; -namespace VECTO3GUI.Helper +namespace VECTO3GUI.Helper.Converter { public class SIValueConverter : BaseConverter, IValueConverter { diff --git a/VECTO3GUI/Helper/Converter/SaveButtonLabelConverter.cs b/VECTO3GUI/Helper/Converter/SaveButtonLabelConverter.cs new file mode 100644 index 0000000000..7bf7e142c5 --- /dev/null +++ b/VECTO3GUI/Helper/Converter/SaveButtonLabelConverter.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using VECTO3GUI.Util; + +namespace VECTO3GUI.Helper.Converter +{ + public class SaveButtonLabelConverter : BaseConverter, IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is Component) + { + var component = (Component)value; + return $"Save {component.GetLabel()} Changes"; + } + + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/VECTO3GUI/Helper/VehicleClassConverter.cs b/VECTO3GUI/Helper/Converter/VehicleClassConverter.cs similarity index 95% rename from VECTO3GUI/Helper/VehicleClassConverter.cs rename to VECTO3GUI/Helper/Converter/VehicleClassConverter.cs index b164b376b8..f9583205e8 100644 --- a/VECTO3GUI/Helper/VehicleClassConverter.cs +++ b/VECTO3GUI/Helper/Converter/VehicleClassConverter.cs @@ -3,7 +3,7 @@ using System.Globalization; using System.Windows.Data; using TUGraz.VectoCore.Models.Declaration; -namespace VECTO3GUI.Helper +namespace VECTO3GUI.Helper.Converter { public class VehicleClassConverter : BaseConverter, IValueConverter { diff --git a/VECTO3GUI/Model/TempDataObject/VehicleBusComponentData.cs b/VECTO3GUI/Model/TempDataObject/VehicleBusComponentData.cs index b5989b6f2c..3e9303cbfe 100644 --- a/VECTO3GUI/Model/TempDataObject/VehicleBusComponentData.cs +++ b/VECTO3GUI/Model/TempDataObject/VehicleBusComponentData.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using TUGraz.VectoCommon.BusAuxiliaries; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; +using VECTO3GUI.ViewModel.Impl; using VECTO3GUI.ViewModel.Interfaces; namespace VECTO3GUI.Model.TempDataObject diff --git a/VECTO3GUI/Util/Component.cs b/VECTO3GUI/Util/Component.cs index e183731df4..62391d60f2 100644 --- a/VECTO3GUI/Util/Component.cs +++ b/VECTO3GUI/Util/Component.cs @@ -17,4 +17,43 @@ Cycle, CompleteBusVehicle } + + public static class ComponentHelper + { + public static string GetLabel(this Component component) + { + switch (component) + { + case Component.Vehicle: + case Component.PrimaryBusVehicle: + case Component.CompleteBusVehicle: + return nameof(Component.Vehicle); + case Component.Engine: + return nameof(Component.Engine); + case Component.Gearbox: + return nameof(Component.Gearbox); + case Component.TorqueConverter: + return "Torque Converter"; + case Component.Retarder: + return "Retarder"; + case Component.Angledrive: + return "Angle Drive"; + case Component.Axlegear: + return "Axle Gear"; + case Component.PTO: + return "Power Take Off"; + case Component.Airdrag: + return "Air Drag"; + case Component.Axles: + return "Axle"; + case Component.Auxiliaries: + case Component.BusAuxiliaries: + return "Auxiliary"; + case Component.Cycle: + return nameof(Component.Cycle); + } + + return string.Empty; + } + } } \ No newline at end of file diff --git a/VECTO3GUI/VECTO3GUI.csproj b/VECTO3GUI/VECTO3GUI.csproj index f93827eae6..3498ba36f2 100644 --- a/VECTO3GUI/VECTO3GUI.csproj +++ b/VECTO3GUI/VECTO3GUI.csproj @@ -158,9 +158,10 @@ <SubType>Designer</SubType> </ApplicationDefinition> <Compile Include="Helper\AvalonEditBehaviour.cs" /> - <Compile Include="Helper\ComponentTitleConverter.cs" /> + <Compile Include="Helper\Converter\ComponentTitleConverter.cs" /> <Compile Include="Helper\FileDialogHelper.cs" /> <Compile Include="Helper\OutputWindowHelper.cs" /> + <Compile Include="Helper\Converter\SaveButtonLabelConverter.cs" /> <Compile Include="Model\InterfacesImpl.cs" /> <Compile Include="Model\SettingsModel.cs" /> <Compile Include="Model\TempDataObject\AirdragComponentData.cs" /> @@ -382,12 +383,12 @@ <DependentUpon>App.xaml</DependentUpon> <SubType>Code</SubType> </Compile> - <Compile Include="Helper\BaseConverter.cs" /> + <Compile Include="Helper\Converter\BaseConverter.cs" /> <Compile Include="Helper\DataContextBaseExtension.cs" /> - <Compile Include="Helper\JobEntrySelectedConverter.cs" /> + <Compile Include="Helper\Converter\JobEntrySelectedConverter.cs" /> <Compile Include="Helper\SIUnit.cs" /> - <Compile Include="Helper\SIValueConverter.cs" /> - <Compile Include="Helper\VehicleClassConverter.cs" /> + <Compile Include="Helper\Converter\SIValueConverter.cs" /> + <Compile Include="Helper\Converter\VehicleClassConverter.cs" /> <Compile Include="MainWindow.xaml.cs"> <DependentUpon>MainWindow.xaml</DependentUpon> <SubType>Code</SubType> diff --git a/VECTO3GUI/ViewModel/Impl/AbstractJobViewModel.cs b/VECTO3GUI/ViewModel/Impl/AbstractJobViewModel.cs index cbb8288863..89188b1085 100644 --- a/VECTO3GUI/ViewModel/Impl/AbstractJobViewModel.cs +++ b/VECTO3GUI/ViewModel/Impl/AbstractJobViewModel.cs @@ -44,9 +44,7 @@ namespace VECTO3GUI.ViewModel.Impl protected virtual void DoEditComponent(Component component) { var nextView = GetComponentViewModel(component); - CurrentComponent = nextView ?? Kernel.Get<INoneViewModel>(); - } protected void CreateComponentModel(Component component) diff --git a/VECTO3GUI/ViewModel/Impl/AbstractViewModel.cs b/VECTO3GUI/ViewModel/Impl/AbstractViewModel.cs index e2ab7b0a42..3c2880ce51 100644 --- a/VECTO3GUI/ViewModel/Impl/AbstractViewModel.cs +++ b/VECTO3GUI/ViewModel/Impl/AbstractViewModel.cs @@ -5,6 +5,7 @@ using System.ComponentModel; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; using TUGraz.VectoCommon.InputData; +using VECTO3GUI.Model.TempDataObject; using VECTO3GUI.ViewModel.Interfaces; using Component = VECTO3GUI.Util.Component; @@ -71,6 +72,11 @@ namespace VECTO3GUI.ViewModel.Impl public virtual void ResetComponentData() {} + public virtual object SaveComponentData() + { + return null; + } + #region Submodule Handling protected IEnumerable<Component> GetSubmodels() { diff --git a/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs b/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs index 604dfe9d8f..7596d106fc 100644 --- a/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs +++ b/VECTO3GUI/ViewModel/Impl/AuxiliariesViewModel.cs @@ -15,6 +15,7 @@ using VECTO3GUI.Util; using VECTO3GUI.ViewModel.Adapter; using VECTO3GUI.ViewModel.Interfaces; using VECTO3GUI.Model; +using VECTO3GUI.Model.TempDataObject; using Component = VECTO3GUI.Util.Component; namespace VECTO3GUI.ViewModel.Impl @@ -47,6 +48,7 @@ namespace VECTO3GUI.ViewModel.Impl private bool _adjustableAuxiliaryHeater; private bool _separateAirDistributionDucts; + private AuxiliariesBusComponentData _componentData; #endregion @@ -481,5 +483,14 @@ namespace VECTO3GUI.ViewModel.Impl { SetValues(_busAuxiliaries); } + + public override object SaveComponentData() + { + if(_componentData == null) + _componentData = new AuxiliariesBusComponentData(this); + else + _componentData.UpdateCurrentValues(this); + return _componentData; + } } } \ No newline at end of file diff --git a/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusJobViewModel.cs b/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusJobViewModel.cs index ea9f6eecfc..388455e30c 100644 --- a/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusJobViewModel.cs +++ b/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusJobViewModel.cs @@ -6,6 +6,8 @@ using System.Threading.Tasks; using System.Windows.Input; using Ninject; using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.Models.SimulationComponent.Impl; +using VECTO3GUI.Model.TempDataObject; using VECTO3GUI.ViewModel.Interfaces; using VECTO3GUI.Util; @@ -13,14 +15,21 @@ namespace VECTO3GUI.ViewModel.Impl { public class CompleteVehicleBusJobViewModel : AbstractJobViewModel, IJobEditViewModel { - - #region Commands - + #region Members + private ICommand _saveComponentCommand; private ICommand _resetComponentCommand; + private ICommand _saveJobCommand; + private ICommand _saveJobToCommand; + private ICommand _exitCommand; #endregion + #region Properties + + public Dictionary<Component, object> CompleteVehicleBusData { get; private set; } + + #endregion public CompleteVehicleBusJobViewModel(IKernel kernel, IDeclarationInputDataProvider inputData) { @@ -33,10 +42,26 @@ namespace VECTO3GUI.ViewModel.Impl CurrentComponent = GetComponentViewModel(Component.CompleteBusVehicle); } - + + #region Commands + + + + + public ICommand SaveJobCommand + { + get { + return _saveJobCommand ?? + (_saveJobCommand = new RelayCommand(DoSaveJob));} + } + protected override void DoSaveJob() { - throw new NotImplementedException(); + CompleteVehicleBusData = new Dictionary<Component, object> { + { Component.CompleteBusVehicle, _subModels[Component.CompleteBusVehicle].SaveComponentData()}, + { Component.Airdrag, _subModels[Component.Airdrag].SaveComponentData()}, + { Component.Auxiliaries, _subModels[Component.Auxiliaries].SaveComponentData()} + }; } public ICommand SaveComponent @@ -52,7 +77,17 @@ namespace VECTO3GUI.ViewModel.Impl private void DoSaveComponent(Component component) { - + switch (component) { + case Component.CompleteBusVehicle: + _subModels[Component.CompleteBusVehicle].SaveComponentData(); + break; + case Component.Airdrag: + _subModels[Component.Airdrag].SaveComponentData(); + break; + case Component.Auxiliaries: + _subModels[Component.Auxiliaries].SaveComponentData(); + break; + } } @@ -84,7 +119,9 @@ namespace VECTO3GUI.ViewModel.Impl } } - + #endregion + + private bool ComponentsChanged(Component component) { switch (component) { diff --git a/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusViewModel.cs b/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusViewModel.cs index 00bc026577..4453abe3e3 100644 --- a/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusViewModel.cs +++ b/VECTO3GUI/ViewModel/Impl/CompleteVehicleBusViewModel.cs @@ -10,6 +10,7 @@ using TUGraz.VectoCommon.InputData; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using VECTO3GUI.Model.TempDataObject; using VECTO3GUI.Util; using VECTO3GUI.ViewModel.Interfaces; @@ -20,6 +21,7 @@ namespace VECTO3GUI.ViewModel.Impl #region Members private IVehicleDeclarationInputData _vehicle; + private VehicleBusComponentData _componentData; private string _manufacturer; private string _manufacturerAddress; @@ -342,6 +344,17 @@ namespace VECTO3GUI.ViewModel.Impl #endregion + public override object SaveComponentData() + { + if(_componentData == null) + _componentData = new VehicleBusComponentData(this); + else + _componentData.UpdateCurrentValues(this); + + return _componentData; + } + + public override bool IsComponentDataChanged() { return _changedInput.Count > 0; diff --git a/VECTO3GUI/ViewModel/Impl/JoblistViewModel.cs b/VECTO3GUI/ViewModel/Impl/JoblistViewModel.cs index 22ac2c44e7..88b74148bc 100644 --- a/VECTO3GUI/ViewModel/Impl/JoblistViewModel.cs +++ b/VECTO3GUI/ViewModel/Impl/JoblistViewModel.cs @@ -71,13 +71,9 @@ namespace VECTO3GUI.ViewModel.Impl #endregion - - + public JoblistViewModel() { - // AddJobEntry(@"~\..\..\..\..\VectoCore\VectoCoreTest\TestData\XML\XMLReaderDeclaration\SchemaVersion2.6_Buses\PIF-heavyBus-sample.xml"); - // AddJobEntry(@"~\..\..\..\..\VectoCore\VectoCoreTest\TestData\XML\XMLReaderDeclaration\SchemaVersion2.6_Buses\vecto_vehicle-completed_heavyBus-sample.xml"); - _settings = new SettingsModel(); SetJobEntries(); } diff --git a/VECTO3GUI/ViewModel/Interfaces/IComponentViewModel.cs b/VECTO3GUI/ViewModel/Interfaces/IComponentViewModel.cs index 174b1f4aef..6dfd1cb5cb 100644 --- a/VECTO3GUI/ViewModel/Interfaces/IComponentViewModel.cs +++ b/VECTO3GUI/ViewModel/Interfaces/IComponentViewModel.cs @@ -1,5 +1,6 @@ using System.Collections.ObjectModel; using TUGraz.VectoCommon.InputData; +using VECTO3GUI.Model.TempDataObject; using VECTO3GUI.Util; using VECTO3GUI.ViewModel.Impl; @@ -19,6 +20,7 @@ namespace VECTO3GUI.ViewModel.Interfaces { bool IsComponentDataChanged(); void ResetComponentData(); + object SaveComponentData(); } diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/AirdragDeclarationView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/AirdragDeclarationView.xaml index 5c654e3ad8..5f27960723 100644 --- a/VECTO3GUI/Views/ComponentViews/Declaration/AirdragDeclarationView.xaml +++ b/VECTO3GUI/Views/ComponentViews/Declaration/AirdragDeclarationView.xaml @@ -6,6 +6,7 @@ xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces" xmlns:customControls="clr-namespace:VECTO3GUI.Views.CustomControls" xmlns:helper="clr-namespace:VECTO3GUI.Helper" + xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter" mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="800"> @@ -43,7 +44,7 @@ <customControls:VectoParameterControl Caption="DeclaredCd x A 0" CaptionWidthGroup="lblWidth" Unit="{helper:SIUnit DeclaredCdxA}" UnitWidthGroup="unitWidth" - Value="{Binding DeclaredCdxA, Converter={helper:SIValueConverter}, ConverterParameter=double}" + Value="{Binding DeclaredCdxA, Converter={converter:SIValueConverter}, ConverterParameter=double}" IsEnabled="{Binding UseMeasuredValues}"/> </StackPanel> diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/AngledriveDeclarationView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/AngledriveDeclarationView.xaml index aa8d9585aa..5d2f75ba26 100644 --- a/VECTO3GUI/Views/ComponentViews/Declaration/AngledriveDeclarationView.xaml +++ b/VECTO3GUI/Views/ComponentViews/Declaration/AngledriveDeclarationView.xaml @@ -6,6 +6,7 @@ xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces" xmlns:customControls="clr-namespace:VECTO3GUI.Views.CustomControls" xmlns:helper="clr-namespace:VECTO3GUI.Helper" + xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter" mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="800"> <d:AngledriveDeclarationView.DataContext> @@ -42,7 +43,7 @@ <DataTemplate DataType="interfaces:GearLossMapEntry"> <DockPanel> <TextBlock DockPanel.Dock="Right" Text="rpm"/> - <TextBox DockPanel.Dock="Right" Text="{Binding InputSpeed, Converter={helper:SIValueConverter}, ConverterParameter=AsRPM|double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> + <TextBox DockPanel.Dock="Right" Text="{Binding InputSpeed, Converter={converter:SIValueConverter}, ConverterParameter=AsRPM|double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> </DockPanel> </DataTemplate> </GridViewColumn.CellTemplate> @@ -53,7 +54,7 @@ <DataTemplate DataType="interfaces:GearLossMapEntry"> <DockPanel> <TextBlock DockPanel.Dock="Right" Text="Nm"/> - <TextBox DockPanel.Dock="Right" Text="{Binding InputTorque, Converter={helper:SIValueConverter}, ConverterParameter=double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> + <TextBox DockPanel.Dock="Right" Text="{Binding InputTorque, Converter={converter:SIValueConverter}, ConverterParameter=double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> </DockPanel> </DataTemplate> </GridViewColumn.CellTemplate> @@ -64,7 +65,7 @@ <DataTemplate DataType="interfaces:GearLossMapEntry"> <DockPanel> <TextBlock DockPanel.Dock="Right" Text="Nm"/> - <TextBox DockPanel.Dock="Right" Text="{Binding TorqueLoss, Converter={helper:SIValueConverter}, ConverterParameter=double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> + <TextBox DockPanel.Dock="Right" Text="{Binding TorqueLoss, Converter={converter:SIValueConverter}, ConverterParameter=double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> </DockPanel> </DataTemplate> </GridViewColumn.CellTemplate> diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/AuxiliariesDeclarationView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/AuxiliariesDeclarationView.xaml index 7edbcffce6..42270d3adb 100644 --- a/VECTO3GUI/Views/ComponentViews/Declaration/AuxiliariesDeclarationView.xaml +++ b/VECTO3GUI/Views/ComponentViews/Declaration/AuxiliariesDeclarationView.xaml @@ -6,6 +6,7 @@ xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces" xmlns:customControls="clr-namespace:VECTO3GUI.Views.CustomControls" xmlns:helper="clr-namespace:VECTO3GUI.Helper" + xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter" mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="800"> <d:EditCyclesView.DataContext> @@ -86,7 +87,7 @@ <customControls:VectoParameterControl Caption="Height Integrated Body" Unit="{helper:SIUnit AuxHeaterPower}" CaptionWidthGroup="lblWidth" UnitWidthGroup="unitWidth" - Value="{Binding AuxHeaterPower, Converter={helper:SIValueConverter}, ConverterParameter=double}" /> + Value="{Binding AuxHeaterPower, Converter={converter:SIValueConverter}, ConverterParameter=double}" /> <customControls:CheckboxParameter Caption="Double Glasing" CaptionWidthGroup="lblWidth" diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/AxlegearDeclarationView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/AxlegearDeclarationView.xaml index 2acefa2eb2..13b1b3ac99 100644 --- a/VECTO3GUI/Views/ComponentViews/Declaration/AxlegearDeclarationView.xaml +++ b/VECTO3GUI/Views/ComponentViews/Declaration/AxlegearDeclarationView.xaml @@ -6,6 +6,7 @@ xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces" xmlns:helper="clr-namespace:VECTO3GUI.Helper" xmlns:customControls="clr-namespace:VECTO3GUI.Views.CustomControls" + xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter" mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="800"> <d:AxlegearDeclarationView.DataContext> @@ -46,7 +47,7 @@ <DataTemplate DataType="interfaces:GearLossMapEntry"> <DockPanel> <TextBlock DockPanel.Dock="Right" Text="rpm"/> - <TextBox DockPanel.Dock="Right" Text="{Binding InputSpeed, Converter={helper:SIValueConverter}, ConverterParameter=AsRPM|double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> + <TextBox DockPanel.Dock="Right" Text="{Binding InputSpeed, Converter={converter:SIValueConverter}, ConverterParameter=AsRPM|double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> </DockPanel> </DataTemplate> </GridViewColumn.CellTemplate> @@ -57,7 +58,7 @@ <DataTemplate DataType="interfaces:GearLossMapEntry"> <DockPanel> <TextBlock DockPanel.Dock="Right" Text="Nm"/> - <TextBox DockPanel.Dock="Right" Text="{Binding InputTorque, Converter={helper:SIValueConverter}, ConverterParameter=double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> + <TextBox DockPanel.Dock="Right" Text="{Binding InputTorque, Converter={converter:SIValueConverter}, ConverterParameter=double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> </DockPanel> </DataTemplate> </GridViewColumn.CellTemplate> @@ -68,7 +69,7 @@ <DataTemplate DataType="interfaces:GearLossMapEntry"> <DockPanel> <TextBlock DockPanel.Dock="Right" Text="Nm"/> - <TextBox DockPanel.Dock="Right" Text="{Binding TorqueLoss, Converter={helper:SIValueConverter}, ConverterParameter=double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> + <TextBox DockPanel.Dock="Right" Text="{Binding TorqueLoss, Converter={converter:SIValueConverter}, ConverterParameter=double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> </DockPanel> </DataTemplate> </GridViewColumn.CellTemplate> diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/CompleteVehicleBusView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/CompleteVehicleBusView.xaml index 5b65845e2c..41a5fba49e 100644 --- a/VECTO3GUI/Views/ComponentViews/Declaration/CompleteVehicleBusView.xaml +++ b/VECTO3GUI/Views/ComponentViews/Declaration/CompleteVehicleBusView.xaml @@ -7,6 +7,7 @@ xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces" xmlns:customControls="clr-namespace:VECTO3GUI.Views.CustomControls" xmlns:helper="clr-namespace:VECTO3GUI.Helper" + xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter" mc:Ignorable="d" d:DesignHeight="500" d:DesignWidth="500"> @@ -49,11 +50,11 @@ <customControls:VectoParameterControl Caption="Curb Mass Chassis" Unit="{helper:SIUnit CurbMassChassis}" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth" - Value="{Binding CurbMassChassis, Converter={helper:SIValueConverter}, ConverterParameter=int}" /> + Value="{Binding CurbMassChassis, Converter={converter:SIValueConverter}, ConverterParameter=int}" /> <customControls:VectoParameterControl Caption="Permissible Maximum Laden Mass" Unit="{helper:SIUnit TechnicalPermissibleMaximumLadenMass}" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth" - Value="{Binding TechnicalPermissibleMaximumLadenMass, Converter={helper:SIValueConverter}, ConverterParameter=int}" /> + Value="{Binding TechnicalPermissibleMaximumLadenMass, Converter={converter:SIValueConverter}, ConverterParameter=int}" /> <customControls:VectoParameterControl Caption="Passengers Lower Deck" Unit="" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth" @@ -71,19 +72,19 @@ <customControls:VectoParameterControl Caption="Height Integrated Body" Unit="{helper:SIUnit HeightIntegratedBody}" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth" - Value="{Binding HeightIntegratedBody, Converter={helper:SIValueConverter}, ConverterParameter=double}" /> + Value="{Binding HeightIntegratedBody, Converter={converter:SIValueConverter}, ConverterParameter=double}" /> <customControls:VectoParameterControl Caption="Vehicle Length" Unit="{helper:SIUnit VehicleLength}" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth" - Value="{Binding VehicleLength, Converter={helper:SIValueConverter}, ConverterParameter=double}" /> + Value="{Binding VehicleLength, Converter={converter:SIValueConverter}, ConverterParameter=double}" /> <customControls:VectoParameterControl Caption="Vehicle Width" Unit="{helper:SIUnit VehicleWidth}" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth" - Value="{Binding VehicleWidth, Converter={helper:SIValueConverter}, ConverterParameter=double}" /> + Value="{Binding VehicleWidth, Converter={converter:SIValueConverter}, ConverterParameter=double}" /> <customControls:VectoParameterControl Caption="Entrance Height" Unit="{helper:SIUnit EntranceHeight}" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth" - Value="{Binding EntranceHeight, Converter={helper:SIValueConverter}, ConverterParameter=double}" /> + Value="{Binding EntranceHeight, Converter={converter:SIValueConverter}, ConverterParameter=double}" /> <customControls:ComboParameter diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/EngineDeclarationView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/EngineDeclarationView.xaml index ea66883d1b..2a6c4ab49e 100644 --- a/VECTO3GUI/Views/ComponentViews/Declaration/EngineDeclarationView.xaml +++ b/VECTO3GUI/Views/ComponentViews/Declaration/EngineDeclarationView.xaml @@ -6,6 +6,7 @@ xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces" xmlns:customControls="clr-namespace:VECTO3GUI.Views.CustomControls" xmlns:helper="clr-namespace:VECTO3GUI.Helper" + xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter" mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="600"> <d:EngineDeclarationView.DataContext> @@ -20,27 +21,27 @@ CertificationNumber="{Binding CertificationNumber}" /> <customControls:VectoParameterControl Caption="Displacement" CaptionWidthGroup="lblWidth" - Value="{Binding Displacement, Converter={helper:SIValueConverter}, ConverterParameter=AsCubicCentimeter|int}" + Value="{Binding Displacement, Converter={converter:SIValueConverter}, ConverterParameter=AsCubicCentimeter|int}" ValueAlign="right" Unit="cm³" UnitWidthGroup="unitWidth"/> <customControls:VectoParameterControl Caption="Idling Speed" CaptionWidthGroup="lblWidth" - Value="{Binding IdlingSpeed, Converter={helper:SIValueConverter}, ConverterParameter=AsRPM|int}" + Value="{Binding IdlingSpeed, Converter={converter:SIValueConverter}, ConverterParameter=AsRPM|int}" ValueAlign="right" Unit="rpm" UnitWidthGroup="unitWidth"/> <customControls:VectoParameterControl Caption="Rated Speed" CaptionWidthGroup="lblWidth" - Value="{Binding RatedSpeed, Converter={helper:SIValueConverter}, ConverterParameter=AsRPM|int}" + Value="{Binding RatedSpeed, Converter={converter:SIValueConverter}, ConverterParameter=AsRPM|int}" ValueAlign="right" Unit="rpm" UnitWidthGroup="unitWidth"/> <customControls:VectoParameterControl Caption="Rated Power" CaptionWidthGroup="lblWidth" - Value="{Binding RatedPower, Converter={helper:SIValueConverter}, ConverterParameter=int}" + Value="{Binding RatedPower, Converter={converter:SIValueConverter}, ConverterParameter=int}" ValueAlign="right" Unit="{helper:SIUnit RatedPower}" UnitWidthGroup="unitWidth"/> <customControls:VectoParameterControl Caption="Max. Engine Torque" CaptionWidthGroup="lblWidth" - Value="{Binding MaxEngineTorque, Converter={helper:SIValueConverter}, ConverterParameter=int}" + Value="{Binding MaxEngineTorque, Converter={converter:SIValueConverter}, ConverterParameter=int}" ValueAlign="right" Unit="{helper:SIUnit MaxEngineTorque}" UnitWidthGroup="unitWidth"/> <customControls:VectoParameterControl diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/GearboxDeclarationView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/GearboxDeclarationView.xaml index de40200a79..203309b4c5 100644 --- a/VECTO3GUI/Views/ComponentViews/Declaration/GearboxDeclarationView.xaml +++ b/VECTO3GUI/Views/ComponentViews/Declaration/GearboxDeclarationView.xaml @@ -6,6 +6,7 @@ xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces" xmlns:customControls="clr-namespace:VECTO3GUI.Views.CustomControls" xmlns:helper="clr-namespace:VECTO3GUI.Helper" + xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter" mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="800"> <d:GearboxDeclarationView.DataContext> @@ -72,11 +73,11 @@ Unit="-" UnitWidthGroup="unitWidth"/> <customControls:VectoParameterControl Caption="Max Torque" CaptionWidthGroup="lblGWidth" - Value="{Binding SelectedGear.MaxTorque, Converter={helper:SIValueConverter}, ConverterParameter=int}" ValueAlign="right" + Value="{Binding SelectedGear.MaxTorque, Converter={converter:SIValueConverter}, ConverterParameter=int}" ValueAlign="right" Unit="Nm" UnitWidthGroup="unitWidth"/> <customControls:VectoParameterControl Caption="Max Speed" CaptionWidthGroup="lblGWidth" - Value="{Binding SelectedGear.MaxSpeed, Converter={helper:SIValueConverter}, ConverterParameter=AsRPM|int}" + Value="{Binding SelectedGear.MaxSpeed, Converter={converter:SIValueConverter}, ConverterParameter=AsRPM|int}" ValueAlign="right" Unit="rpm" UnitWidthGroup="unitWidth" /> diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/PrimaryVehicleBusView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/PrimaryVehicleBusView.xaml index 12d4024e46..8948d099b6 100644 --- a/VECTO3GUI/Views/ComponentViews/Declaration/PrimaryVehicleBusView.xaml +++ b/VECTO3GUI/Views/ComponentViews/Declaration/PrimaryVehicleBusView.xaml @@ -7,6 +7,7 @@ xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces" xmlns:customControls="clr-namespace:VECTO3GUI.Views.CustomControls" xmlns:helper="clr-namespace:VECTO3GUI.Helper" + xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter" mc:Ignorable="d" d:DesignHeight="600" d:DesignWidth="600"> @@ -50,11 +51,11 @@ <customControls:VectoParameterControl Caption="Permissible Maximum Laden Mass" Unit="{helper:SIUnit TechnicalPermissibleMaximumLadenMass}" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth" - Value="{Binding TechnicalPermissibleMaximumLadenMass, Converter={helper:SIValueConverter}, ConverterParameter=int}" /> + Value="{Binding TechnicalPermissibleMaximumLadenMass, Converter={converter:SIValueConverter}, ConverterParameter=int}" /> <customControls:VectoParameterControl Caption="Idling Speed" Unit="{helper:SIUnit IdlingSpeed}" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth" - Value="{Binding IdlingSpeed, Converter={helper:SIValueConverter}, ConverterParameter=int}" /> + Value="{Binding IdlingSpeed, Converter={converter:SIValueConverter}, ConverterParameter=int}" /> <customControls:ComboParameter Caption="Retarder Type" diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/RetarderDeclarationView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/RetarderDeclarationView.xaml index 7dd50b9004..695a0cb769 100644 --- a/VECTO3GUI/Views/ComponentViews/Declaration/RetarderDeclarationView.xaml +++ b/VECTO3GUI/Views/ComponentViews/Declaration/RetarderDeclarationView.xaml @@ -7,6 +7,7 @@ xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces" xmlns:customControls="clr-namespace:VECTO3GUI.Views.CustomControls" xmlns:helper="clr-namespace:VECTO3GUI.Helper" + xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter" mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="800"> <d:RetarderDeclarationView.DataContext> @@ -38,7 +39,7 @@ <DataTemplate DataType="interfaces:RetarderLossMapEntry"> <DockPanel> <TextBlock DockPanel.Dock="Right" Text="rpm"/> - <TextBox DockPanel.Dock="Right" Text="{Binding RetarderSpeed, Converter={helper:SIValueConverter}, ConverterParameter=AsRPM|double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> + <TextBox DockPanel.Dock="Right" Text="{Binding RetarderSpeed, Converter={converter:SIValueConverter}, ConverterParameter=AsRPM|double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> </DockPanel> </DataTemplate> </GridViewColumn.CellTemplate> @@ -49,7 +50,7 @@ <DataTemplate DataType="interfaces:RetarderLossMapEntry"> <DockPanel> <TextBlock DockPanel.Dock="Right" Text="Nm"/> - <TextBox DockPanel.Dock="Right" Text="{Binding TorqueLoss, Converter={helper:SIValueConverter}, ConverterParameter=double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> + <TextBox DockPanel.Dock="Right" Text="{Binding TorqueLoss, Converter={converter:SIValueConverter}, ConverterParameter=double2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> </DockPanel> </DataTemplate> </GridViewColumn.CellTemplate> diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/TorqueConverterDeclarationView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/TorqueConverterDeclarationView.xaml index 77e6f13e5c..527a55d0ce 100644 --- a/VECTO3GUI/Views/ComponentViews/Declaration/TorqueConverterDeclarationView.xaml +++ b/VECTO3GUI/Views/ComponentViews/Declaration/TorqueConverterDeclarationView.xaml @@ -7,6 +7,7 @@ xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces" xmlns:customControls="clr-namespace:VECTO3GUI.Views.CustomControls" xmlns:helper="clr-namespace:VECTO3GUI.Helper" + xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter" mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="800"> <d:TorqueConverterDeclarationView.DataContext> @@ -57,7 +58,7 @@ <DataTemplate DataType="interfaces:TorqueConverterCharacteristics"> <DockPanel> <TextBlock DockPanel.Dock="Right" TextAlignment="Right" Text="{helper:SIUnit InputTorqueRef}"></TextBlock> - <TextBox DockPanel.Dock="Right" TextAlignment="Right" Text="{Binding InputTorqueRef, Converter={helper:SIValueConverter}, ConverterParameter=double2, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent"/> + <TextBox DockPanel.Dock="Right" TextAlignment="Right" Text="{Binding InputTorqueRef, Converter={converter:SIValueConverter}, ConverterParameter=double2, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent"/> </DockPanel> </DataTemplate> </GridViewColumn.CellTemplate> diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/TyreDeclarationView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/TyreDeclarationView.xaml index 3639230080..b481da2175 100644 --- a/VECTO3GUI/Views/ComponentViews/Declaration/TyreDeclarationView.xaml +++ b/VECTO3GUI/Views/ComponentViews/Declaration/TyreDeclarationView.xaml @@ -6,6 +6,7 @@ xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces" xmlns:customControls="clr-namespace:VECTO3GUI.Views.CustomControls" xmlns:helper="clr-namespace:VECTO3GUI.Helper" + xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> <d:TyreDeclarationView.DataContext> @@ -31,7 +32,7 @@ <customControls:VectoParameterControl Caption="Fz ISO" CaptionWidthGroup="lblWidth" Unit="{helper:SIUnit FzISO}" UnitWidthGroup="unitWidth" - Value="{Binding FzISO, Converter={helper:SIValueConverter}}" + Value="{Binding FzISO, Converter={converter:SIValueConverter}}" /> </StackPanel> </UserControl> diff --git a/VECTO3GUI/Views/ComponentViews/Declaration/VehicleDeclarationView.xaml b/VECTO3GUI/Views/ComponentViews/Declaration/VehicleDeclarationView.xaml index 2803c33b2b..78bd8d667a 100644 --- a/VECTO3GUI/Views/ComponentViews/Declaration/VehicleDeclarationView.xaml +++ b/VECTO3GUI/Views/ComponentViews/Declaration/VehicleDeclarationView.xaml @@ -8,6 +8,7 @@ xmlns:customControls="clr-namespace:VECTO3GUI.Views.CustomControls" xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces" xmlns:impl="clr-namespace:VECTO3GUI.ViewModel.Impl" + xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter" mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="800"> <d:VehicleDeclarationView.DataContext> @@ -57,20 +58,20 @@ UnitWidthGroup="unitWidth" Caption="Gross Vehicle Mass" Unit="{helper:SIUnit GrossVehicleMass}" - Value="{Binding GrossVehicleMass, Converter={helper:SIValueConverter}, ConverterParameter=int}" /> + Value="{Binding GrossVehicleMass, Converter={converter:SIValueConverter}, ConverterParameter=int}" /> <customControls:VectoParameterControl ValueAlign="center" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth" Caption="HDV Group" - Value="{Binding VehicleClass, Converter={helper:VehicleClassConverter}}" IsEnabled="False" /> + Value="{Binding VehicleClass, Converter={converter:VehicleClassConverter}}" IsEnabled="False" /> <customControls:VectoParameterControl ValueAlign="right" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth" Caption="Curb Mass Chassis" Unit="{helper:SIUnit CurbMassChassis}" - Value="{Binding CurbMassChassis, Converter={helper:SIValueConverter}, ConverterParameter=int}" /> + Value="{Binding CurbMassChassis, Converter={converter:SIValueConverter}, ConverterParameter=int}" /> <customControls:VectoParameterControl Caption="Engine Idling Speed" Unit="rpm" ValueAlign="right" CaptionWidthGroup="vehicleLbl" UnitWidthGroup="unitWidth" - Value="{Binding IdlingSpeed, Converter={helper:SIValueConverter}, ConverterParameter=AsRPM|int}" /> + Value="{Binding IdlingSpeed, Converter={converter:SIValueConverter}, ConverterParameter=AsRPM|int}" /> </StackPanel> @@ -123,7 +124,7 @@ <DataTemplate DataType="interfaces:TorqueEntry"> <DockPanel> <TextBlock DockPanel.Dock="Right" Text="{helper:SIUnit MaxTorque}" Margin="5,0,0,0"/> - <TextBox DockPanel.Dock="Right" Margin="20,0,0,0" Text="{Binding MaxTorque, Converter={helper:SIValueConverter}, ConverterParameter=int, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> + <TextBox DockPanel.Dock="Right" Margin="20,0,0,0" Text="{Binding MaxTorque, Converter={converter:SIValueConverter}, ConverterParameter=int, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" BorderThickness="0" Background="Transparent" TextAlignment="Right"/> </DockPanel> </DataTemplate> </GridViewColumn.CellTemplate> diff --git a/VECTO3GUI/Views/ComponentViews/Engineering/EngineEngineeringView.xaml b/VECTO3GUI/Views/ComponentViews/Engineering/EngineEngineeringView.xaml index 7ed2ecb7cb..5644edec14 100644 --- a/VECTO3GUI/Views/ComponentViews/Engineering/EngineEngineeringView.xaml +++ b/VECTO3GUI/Views/ComponentViews/Engineering/EngineEngineeringView.xaml @@ -7,6 +7,7 @@ xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces" xmlns:customControls="clr-namespace:VECTO3GUI.Views.CustomControls" xmlns:helper="clr-namespace:VECTO3GUI.Helper" + xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter" mc:Ignorable="d" d:DesignHeight="500" d:DesignWidth="500"> <d:EngineDeclarationView.DataContext> @@ -20,12 +21,12 @@ CertificationNumber="{Binding CertificationNumber}" /> <customControls:VectoParameterControl Caption="Displacement" CaptionWidthGroup="lblWidth" - Value="{Binding Displacement, Converter={helper:SIValueConverter}, ConverterParameter=AsCubicCentimeter|int}" + Value="{Binding Displacement, Converter={converter:SIValueConverter}, ConverterParameter=AsCubicCentimeter|int}" ValueAlign="right" Unit="cm³" UnitWidthGroup="unitWidth"/> <customControls:VectoParameterControl Caption="Idling Speed" CaptionWidthGroup="lblWidth" - Value="{Binding IdlingSpeed, Converter={helper:SIValueConverter}, ConverterParameter=AsRPM|int}" + Value="{Binding IdlingSpeed, Converter={converter:SIValueConverter}, ConverterParameter=AsRPM|int}" ValueAlign="right" Unit="rpm" UnitWidthGroup="unitWidth"/> <customControls:VectoParameterControl diff --git a/VECTO3GUI/Views/JoblistTabView.xaml b/VECTO3GUI/Views/JoblistTabView.xaml index a8a54e59bb..d46a64eb0f 100644 --- a/VECTO3GUI/Views/JoblistTabView.xaml +++ b/VECTO3GUI/Views/JoblistTabView.xaml @@ -4,10 +4,8 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:VECTO3GUI.Views" - xmlns:interfaces="clr-namespace:VECTO3GUI.ViewModel.Interfaces" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" - xmlns:impl="clr-namespace:VECTO3GUI.ViewModel.Impl" - xmlns:helper="clr-namespace:VECTO3GUI.Helper" + xmlns:converter="clr-namespace:VECTO3GUI.Helper.Converter" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> @@ -19,51 +17,78 @@ <Grid> <Grid.RowDefinitions> - <RowDefinition Height="30"/> + <RowDefinition Height="50"/> <RowDefinition/> - <RowDefinition Height="30"/> + <RowDefinition Height="36"/> </Grid.RowDefinitions> + <Grid Grid.Row="0"> + <StackPanel Orientation="Vertical"> + <Menu> + <MenuItem Header="File"> + <MenuItem Header="Save"/> + <MenuItem Header="Save to"/> + <Separator HorizontalAlignment="Stretch" Background="Gray"/> + <MenuItem Header="Exit"/> + </MenuItem> + </Menu> + <Separator HorizontalAlignment="Stretch" Background="Gray"/> + </StackPanel> + + </Grid> <Grid Grid.Row="1"> - <TabControl TabStripPlacement="Top" ItemsSource="{Binding Components}" x:Name="ComponentsTab" SelectedIndex="0"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="15"/> + <ColumnDefinition/> + </Grid.ColumnDefinitions> + + <Grid Grid.Column="1"> - <i:Interaction.Triggers> - <i:EventTrigger EventName="SelectionChanged"> - <i:InvokeCommandAction + <TabControl TabStripPlacement="Top" ItemsSource="{Binding Components}" x:Name="ComponentsTab" SelectedIndex="0"> + + <i:Interaction.Triggers> + <i:EventTrigger EventName="SelectionChanged"> + <i:InvokeCommandAction Command="{Binding EditComponent}" CommandParameter="{Binding ElementName=ComponentsTab, Path=SelectedItem}"> - </i:InvokeCommandAction> - </i:EventTrigger> - </i:Interaction.Triggers> - - <TabControl.ItemTemplate> - <DataTemplate> - <TextBlock Text="{Binding Converter={helper:ComponentTitleConverter}}" /> - </DataTemplate> - </TabControl.ItemTemplate> - - <TabControl.ContentTemplate> - <DataTemplate> - <ScrollViewer DockPanel.Dock="Top"> - <ContentControl Content="{Binding DataContext.CurrentComponent, + </i:InvokeCommandAction> + </i:EventTrigger> + </i:Interaction.Triggers> + + <TabControl.ItemTemplate> + <DataTemplate> + <TextBlock Text="{Binding Converter={converter:ComponentTitleConverter}}" /> + </DataTemplate> + </TabControl.ItemTemplate> + + <TabControl.ContentTemplate> + <DataTemplate> + <ScrollViewer DockPanel.Dock="Top"> + <ContentControl Content="{Binding DataContext.CurrentComponent, RelativeSource={RelativeSource AncestorType=local:JoblistTabView}}" Margin="0,20,0,10"/> - </ScrollViewer> - </DataTemplate> - </TabControl.ContentTemplate> + </ScrollViewer> + </DataTemplate> + </TabControl.ContentTemplate> + + </TabControl> - </TabControl> + </Grid> </Grid> <Grid Grid.Row="2"> - <Grid> - <Button Content="Save Changes" HorizontalAlignment="Right" - Command="{Binding SaveComponent}" CommandParameter="{Binding ElementName=ComponentsTab, Path=SelectedItem}"/> - <Button Content="Reset" HorizontalAlignment="Left" - Command="{Binding ResetComponent}" CommandParameter="{Binding ElementName=ComponentsTab, Path=SelectedItem}"/> - </Grid> + <StackPanel Orientation="Vertical" VerticalAlignment="Center"> + <Separator HorizontalAlignment="Stretch" Background="Gray"/> + <Grid> + <Button Content="{Binding ElementName=ComponentsTab, Path=SelectedItem, Converter={converter:SaveButtonLabelConverter}}" + HorizontalAlignment="Right" Margin="0,0,15,0" + Command="{Binding SaveComponent}" CommandParameter="{Binding ElementName=ComponentsTab, Path=SelectedItem}"/> + <Button Content="Reset" HorizontalAlignment="Left" Margin="15,0,0,0" + Command="{Binding ResetComponent}" CommandParameter="{Binding ElementName=ComponentsTab, Path=SelectedItem}"/> + </Grid> + </StackPanel> </Grid> </Grid> </UserControl> diff --git a/VectoCore/VectoCore/VectoCore.csproj b/VectoCore/VectoCore/VectoCore.csproj index 2f8f9f4b95..7e0866e6ed 100644 --- a/VectoCore/VectoCore/VectoCore.csproj +++ b/VectoCore/VectoCore/VectoCore.csproj @@ -942,7 +942,9 @@ <Name>VectoHashing</Name> </ProjectReference> </ItemGroup> - <ItemGroup /> + <ItemGroup> + <Folder Include="OutputData\XML\DeclarationJobs\" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. -- GitLab