diff --git a/VECTO.sln b/VECTO.sln index c3adf8e9ce45c9a5468af2bbca59910340da89e3..8e434e31ea257b6b7293634cc0b7c2fd4ebb028b 100644 --- a/VECTO.sln +++ b/VECTO.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31112.23 MinimumVisualStudioVersion = 10.0.40219.1 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VECTO", "VECTO\VECTO.vbproj", "{AAC0F132-0A9F-45B3-B682-77AC9B24B352}" ProjectSection(ProjectDependencies) = postProject @@ -72,6 +72,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PluginsDEV", "PluginsDEV", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VectoAPI", "..\VECTO_API_DEV\VectoAPI\VectoAPI.csproj", "{DD260CC4-7978-45E3-8646-AD4F5E6A8FA2}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VECTO3GUI2020", "VECTO3GUI2020\VECTO3GUI2020.csproj", "{7E9172D4-07E3-4077-814E-7117AB2B3E22}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug PerformanceStats|Any CPU = Debug PerformanceStats|Any CPU @@ -864,6 +866,48 @@ Global {DD260CC4-7978-45E3-8646-AD4F5E6A8FA2}.ReleaseTUG|x64.Build.0 = Release|Any CPU {DD260CC4-7978-45E3-8646-AD4F5E6A8FA2}.ReleaseTUG|x86.ActiveCfg = Release|Any CPU {DD260CC4-7978-45E3-8646-AD4F5E6A8FA2}.ReleaseTUG|x86.Build.0 = Release|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug PerformanceStats|Any CPU.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug PerformanceStats|Any CPU.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug PerformanceStats|x64.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug PerformanceStats|x64.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug PerformanceStats|x86.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug PerformanceStats|x86.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug PerformanceTrace|Any CPU.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug PerformanceTrace|Any CPU.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug PerformanceTrace|x64.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug PerformanceTrace|x64.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug PerformanceTrace|x86.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug PerformanceTrace|x86.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug|x64.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug|x64.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug|x86.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Debug|x86.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.DebugTUG|Any CPU.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.DebugTUG|Any CPU.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.DebugTUG|x64.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.DebugTUG|x64.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.DebugTUG|x86.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.DebugTUG|x86.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Deploy|Any CPU.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Deploy|Any CPU.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Deploy|x64.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Deploy|x64.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Deploy|x86.ActiveCfg = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Deploy|x86.Build.0 = Debug|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Release|Any CPU.Build.0 = Release|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Release|x64.ActiveCfg = Release|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Release|x64.Build.0 = Release|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Release|x86.ActiveCfg = Release|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.Release|x86.Build.0 = Release|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.ReleaseTUG|Any CPU.ActiveCfg = Release|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.ReleaseTUG|Any CPU.Build.0 = Release|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.ReleaseTUG|x64.ActiveCfg = Release|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.ReleaseTUG|x64.Build.0 = Release|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.ReleaseTUG|x86.ActiveCfg = Release|Any CPU + {7E9172D4-07E3-4077-814E-7117AB2B3E22}.ReleaseTUG|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -889,4 +933,7 @@ Global {52430C51-892A-4D8E-9189-B6C9D09791C0} = {5DDEEEC2-743F-4395-B058-687B5773E3D2} {DD260CC4-7978-45E3-8646-AD4F5E6A8FA2} = {C4D97EBF-BA80-4943-9D27-33179405D8D5} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B38F3172-132E-43F7-9C4B-5FDC3A28C051} + EndGlobalSection EndGlobal diff --git a/VECTO.sln.DotSettings b/VECTO.sln.DotSettings index 978725d131942d696b1ca1ccaf8106192d064517..24395e4cff50468dfca3a81fd3dbf9dde40ed7ce 100644 --- a/VECTO.sln.DotSettings +++ b/VECTO.sln.DotSettings @@ -120,5 +120,6 @@ <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EFormat_002ESettingsUpgrade_002EAlignmentTabFillStyleMigration/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsParsFormattingSettingsUpgrader/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsWrapperSettingsUpgrader/@EntryIndexedValue">True</s:Boolean> + <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EVB_002ECodeStyle_002ESettingsUpgrade_002EVBSpaceAfterUnaryMigration/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EXml_002ECodeStyle_002EFormatSettingsUpgrade_002EXmlMoveToCommonFormatterSettingsUpgrade/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=RESS/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> diff --git a/VECTO/Input Files/Engine.vb b/VECTO/Input Files/Engine.vb index 95e4b7ee57153feb104b0e2fb016ca8901ea5545..9bc9ac04993380fb8b7e39ac968c2afc792d6e1d 100644 --- a/VECTO/Input Files/Engine.vb +++ b/VECTO/Input Files/Engine.vb @@ -341,9 +341,9 @@ Public Class Engine End Get End Property - Public ReadOnly Property Fuels As IList(Of IEngineFuelDelcarationInputData) Implements IEngineModeDeclarationInputData.Fuels + Public ReadOnly Property Fuels As IList(Of IEngineFuelDeclarationInputData) Implements IEngineModeDeclarationInputData.Fuels Get - Dim retval As List(Of IEngineFuelDelcarationInputData) = New List(Of IEngineFuelDelcarationInputData)({PrimaryEngineFuel}) + Dim retval As List(Of IEngineFuelDeclarationInputData) = New List(Of IEngineFuelDeclarationInputData)({PrimaryEngineFuel}) If (DualFuelInput) Then retval.Add(SecondaryEngineFuel) End If @@ -477,7 +477,7 @@ Public Class WHRData End Class Public Class EngineFuel - Implements IEngineFuelDelcarationInputData, IEngineFuelEngineeringInputData + Implements IEngineFuelDeclarationInputData, IEngineFuelEngineeringInputData ''' <summary> ''' WHTC Urban test results. Saved in input file. @@ -533,37 +533,37 @@ Public Class EngineFuel WHTCEngineeringInput = 1 End Sub - Public ReadOnly Property WHTCMotorway As Double Implements IEngineFuelDelcarationInputData.WHTCMotorway + Public ReadOnly Property WHTCMotorway As Double Implements IEngineFuelDeclarationInputData.WHTCMotorway Get Return WHTCMotorwayInput End Get End Property - Public ReadOnly Property WHTCRural As Double Implements IEngineFuelDelcarationInputData.WHTCRural + Public ReadOnly Property WHTCRural As Double Implements IEngineFuelDeclarationInputData.WHTCRural Get Return WHTCRuralInput End Get End Property - Public ReadOnly Property WHTCUrban As Double Implements IEngineFuelDelcarationInputData.WHTCUrban + Public ReadOnly Property WHTCUrban As Double Implements IEngineFuelDeclarationInputData.WHTCUrban Get Return WHTCUrbanInput End Get End Property - Public ReadOnly Property ColdHotBalancingFactor As Double Implements IEngineFuelDelcarationInputData.ColdHotBalancingFactor + Public ReadOnly Property ColdHotBalancingFactor As Double Implements IEngineFuelDeclarationInputData.ColdHotBalancingFactor Get Return ColdHotBalancingFactorInput End Get End Property - Public ReadOnly Property CorrectionFactorRegPer As Double Implements IEngineFuelDelcarationInputData.CorrectionFactorRegPer + Public ReadOnly Property CorrectionFactorRegPer As Double Implements IEngineFuelDeclarationInputData.CorrectionFactorRegPer Get Return correctionFactorRegPerInput End Get End Property - Public ReadOnly Property FuelType As FuelType Implements IEngineFuelDelcarationInputData.FuelType + Public ReadOnly Property FuelType As FuelType Implements IEngineFuelDeclarationInputData.FuelType Get Return FuelTypeInput End Get @@ -589,7 +589,7 @@ Public Class EngineFuel End Set End Property - Public ReadOnly Property FuelConsumptionMap As TableData Implements IEngineFuelDelcarationInputData.FuelConsumptionMap + Public ReadOnly Property FuelConsumptionMap As TableData Implements IEngineFuelDeclarationInputData.FuelConsumptionMap Get If Not File.Exists(_fuelConsumptionMapPath.FullPath) Then _ Throw New VectoException("FuelConsumptionMap is missing or invalid") diff --git a/VECTO3GUI2020/App.config b/VECTO3GUI2020/App.config new file mode 100644 index 0000000000000000000000000000000000000000..a19dee83ebc8f82210bba163a5e1addf19cd0d25 --- /dev/null +++ b/VECTO3GUI2020/App.config @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <configSections> + <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <section name="VECTO3GUI2020.Properties.Application" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> + <section name="VECTO3GUI2020.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> + </sectionGroup> + </configSections> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> + </startup> + <userSettings> + <VECTO3GUI2020.Properties.Application> + <setting name="Path" serializeAs="String"> + <value /> + </setting> + </VECTO3GUI2020.Properties.Application> + <VECTO3GUI2020.Properties.Settings> + <setting name="EngineeringMode" serializeAs="String"> + <value>False</value> + </setting> + <setting name="DefaultFilePath" serializeAs="String"> + <value>../../../VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration</value> + </setting> + </VECTO3GUI2020.Properties.Settings> + </userSettings> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="Ninject" publicKeyToken="c7192dc5380945e7" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.3.4.0" newVersion="3.3.4.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Reactive.Linq" publicKeyToken="94bc3704cddfc263" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.6000.0" newVersion="3.0.6000.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.6000.0" newVersion="3.0.6000.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration> \ No newline at end of file diff --git a/VECTO3GUI2020/App.xaml b/VECTO3GUI2020/App.xaml new file mode 100644 index 0000000000000000000000000000000000000000..44bd4cf47012233781ed3a2b8b7e533696fc39ca --- /dev/null +++ b/VECTO3GUI2020/App.xaml @@ -0,0 +1,19 @@ +<Application x:Class="VECTO3GUI2020.App" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:VECTO3GUI2020"> + <Application.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <!-- Add new ResourceDictionaries here--> + <ResourceDictionary Source="Resources/ViewModelBindings.xaml"/> + <ResourceDictionary Source="Resources/Converter.xaml"/> + <ResourceDictionary Source="Resources/GlobalStyles.xaml"/> + <ResourceDictionary Source="Resources/Colors.xaml"/> + <ResourceDictionary Source="DataGridStyles.xaml"/> + <ResourceDictionary Source="ButtonTemplates.xaml"/> + <ResourceDictionary Source="ButtonStyles.xaml"/> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </Application.Resources> +</Application> diff --git a/VECTO3GUI2020/App.xaml.cs b/VECTO3GUI2020/App.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..a74dff5f5731900c42404cb38ef88b35ffc23b58 --- /dev/null +++ b/VECTO3GUI2020/App.xaml.cs @@ -0,0 +1,74 @@ +using System.Windows; +using Ninject; +using Ninject.Extensions.ChildKernel; +using VECTO3GUI2020.ViewModel.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation; +using VECTO3GUI2020.Model.Interfaces; +using VECTO3GUI2020.Model; +using TUGraz.VectoCore; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Model.Implementation; +using VECTO3GUI2020.Ninject; +using VECTO3GUI2020.Ninject.Vehicle; + +namespace VECTO3GUI2020 +{ + public partial class App : Application + { + + private IKernel container; + private IKernel multiStageChildContainer; + + protected override void OnStartup(StartupEventArgs e) + { + base.OnStartup(e); + ConfigureContainer(); + ConfigureMainWindow(); + + } + + private void ConfigureContainer() + { + container = new StandardKernel( + new VectoNinjectModule(), + new JobEditModule(), + new ComponentModule(), + new DocumentModule(), + new XMLWriterFactoryModule(), + new FactoryModule(), + new MultistageModule() + ) ; + + + + container.Bind<IJobListViewModel>().To<JobListViewModel>(); + container.Bind<IMainWindowViewModel>().To<MainWindowViewModel>(); + container.Bind<IMainViewModel>().To<JobListViewModel>(); + container.Bind<ISettingsViewModel>().To<SettingsViewModel>(); + + container.Bind<ISettingsModel>().To<SettingsModel>(); + + container.Bind<IDialogHelper>().To<DialogHelper>(); + container.Bind<IWindowHelper>().To<WindowHelper>(); + + } + + private void ConfigureMainWindow() + { + //Windows to test controls + //var testwindow = container.Get<Test>(); + //testwindow.Show(); + + + + var mainwindow = container.Get<MainWindow>(); + this.MainWindow = mainwindow; + this.MainWindow.Show(); + + + + } + + } + +} diff --git a/VECTO3GUI2020/ButtonStyles.xaml b/VECTO3GUI2020/ButtonStyles.xaml new file mode 100644 index 0000000000000000000000000000000000000000..d109e55647522754237bb1f3d332caa7d8fa9052 --- /dev/null +++ b/VECTO3GUI2020/ButtonStyles.xaml @@ -0,0 +1,55 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + <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}"/> + <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border2}"/> + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> + <Setter Property="BorderThickness" Value="1"/> + <Setter Property="HorizontalContentAlignment" Value="Center"/> + <Setter Property="VerticalContentAlignment" Value="Center"/> + <Setter Property="Padding" Value="1"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Button}"> + <Border x:Name="border" BorderBrush="{DynamicResource AccentColorButton}" BorderThickness="0,0,0,1" Background="White" SnapsToDevicePixels="true" Width="80" Height="30"> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup x:Name="CommonStates"> + <VisualStateGroup.Transitions> + <VisualTransition From="Normal" GeneratedDuration="0:0:0.3" To="MouseOver"> + <VisualTransition.GeneratedEasingFunction> + <BackEase EasingMode="EaseIn"/> + </VisualTransition.GeneratedEasingFunction> + </VisualTransition> + </VisualStateGroup.Transitions> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1,0,1,6.02" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Bottom"/> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsDefaulted" Value="true"> + <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> + </Trigger> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="Background" TargetName="border" Value="{StaticResource MultiStageButtonMouseOverBackGround}"/> + <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource AccentColorButton}"/> + </Trigger> + <Trigger Property="IsPressed" Value="true"> + <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/> + <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/> + <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/> + <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary> \ No newline at end of file diff --git a/VECTO3GUI2020/ButtonTemplates.xaml b/VECTO3GUI2020/ButtonTemplates.xaml new file mode 100644 index 0000000000000000000000000000000000000000..825650eb6df891a96416069bcd74d751ad009751 --- /dev/null +++ b/VECTO3GUI2020/ButtonTemplates.xaml @@ -0,0 +1,4 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + +</ResourceDictionary> \ No newline at end of file diff --git a/VECTO3GUI2020/DataGridStyles.xaml b/VECTO3GUI2020/DataGridStyles.xaml new file mode 100644 index 0000000000000000000000000000000000000000..8082415bcfc97d6c0f34d4b69ff8cb847dc3a05b --- /dev/null +++ b/VECTO3GUI2020/DataGridStyles.xaml @@ -0,0 +1,7 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:VECTO3GUI2020" xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"> + + + +</ResourceDictionary> \ No newline at end of file diff --git "a/VECTO3GUI2020/Documentation - Verkn\303\274pfung.lnk" "b/VECTO3GUI2020/Documentation - Verkn\303\274pfung.lnk" new file mode 100644 index 0000000000000000000000000000000000000000..b67320f9a2eebaf55c4c984c8cf03b0f110586ae Binary files /dev/null and "b/VECTO3GUI2020/Documentation - Verkn\303\274pfung.lnk" differ diff --git a/VECTO3GUI2020/Documentation/InputData.cd b/VECTO3GUI2020/Documentation/InputData.cd new file mode 100644 index 0000000000000000000000000000000000000000..f294b40a8783f1e2291a7830af79733b30c4d11e --- /dev/null +++ b/VECTO3GUI2020/Documentation/InputData.cd @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<ClassDiagram MajorVersion="1" MinorVersion="1"> + <Interface Name="TUGraz.VectoCommon.InputData.IMultistageBusInputDataProvider"> + <Position X="0.5" Y="1.5" Width="2.75" /> + <TypeIdentifier /> + <ShowAsAssociation> + <Property Name="JobInputData" /> + </ShowAsAssociation> + </Interface> + <Interface Name="TUGraz.VectoCommon.InputData.IDeclarationMultistageJobInputData"> + <Position X="4" Y="1.5" Width="2.25" /> + <TypeIdentifier /> + <ShowAsAssociation> + <Property Name="PrimaryVehicle" /> + </ShowAsAssociation> + <ShowAsCollectionAssociation> + <Property Name="ManufacturingStages" /> + </ShowAsCollectionAssociation> + </Interface> + <Interface Name="TUGraz.VectoCommon.InputData.IPrimaryVehicleInformationInputDataProvider"> + <Position X="7.25" Y="1.5" Width="3" /> + <TypeIdentifier /> + </Interface> + <Interface Name="TUGraz.VectoCommon.InputData.IManufacturingStageInputData"> + <Position X="4" Y="2.75" Width="2.25" /> + <TypeIdentifier /> + <ShowAsAssociation> + <Property Name="Vehicle" /> + </ShowAsAssociation> + </Interface> + <Interface Name="TUGraz.VectoCommon.InputData.IVehicleDeclarationInputData"> + <Position X="7.25" Y="4.5" Width="3" /> + <TypeIdentifier /> + </Interface> + <Font Name="Segoe UI" Size="9" /> +</ClassDiagram> \ No newline at end of file diff --git a/VECTO3GUI2020/Helper/Converter/AlwaysVisibleConverter.cs b/VECTO3GUI2020/Helper/Converter/AlwaysVisibleConverter.cs new file mode 100644 index 0000000000000000000000000000000000000000..c7218d9ae2a02621b22b19faeb8ca755dda58b8e --- /dev/null +++ b/VECTO3GUI2020/Helper/Converter/AlwaysVisibleConverter.cs @@ -0,0 +1,21 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace VECTO3GUI2020.Helper.Converter +{ + //https://stackoverflow.com/questions/9893825/mvvm-hiding-a-control-when-bound-property-is-not-present + public class AlwaysVisibleConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return Visibility.Visible; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/VECTO3GUI2020/Helper/Converter/BoolToVisibilityConverter.cs b/VECTO3GUI2020/Helper/Converter/BoolToVisibilityConverter.cs new file mode 100644 index 0000000000000000000000000000000000000000..0eb30e7c549784ad287c57a8645066fcf89ebae7 --- /dev/null +++ b/VECTO3GUI2020/Helper/Converter/BoolToVisibilityConverter.cs @@ -0,0 +1,32 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace VECTO3GUI2020.Helper.Converter +{ + public class InvertedBoolToVisibilityConverter : IValueConverter + { + /// <summary> + /// Converts boolean to Visibility + /// </summary> + /// <param name="value"></param> + /// <param name="targetType"></param> + /// <param name="parameter">if set to true the result is inverted</param> + /// <param name="culture"></param> + /// <returns></returns> + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is bool b) { + var visibility = b ? Visibility.Collapsed : Visibility.Visible; + return visibility; + } + return Binding.DoNothing; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotFiniteNumberException(); + } + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/Helper/Converter/InvertBoolConverter.cs b/VECTO3GUI2020/Helper/Converter/InvertBoolConverter.cs new file mode 100644 index 0000000000000000000000000000000000000000..75a4308ca49a4e90e77ac497dd85d7d7d00b2f32 --- /dev/null +++ b/VECTO3GUI2020/Helper/Converter/InvertBoolConverter.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace VECTO3GUI2020.Helper.Converter +{ + public class InvertBoolConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return !(bool)value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return !(bool)value; + } + } +} diff --git a/VECTO3GUI2020/Helper/Converter/JobTypeStringConverter.cs b/VECTO3GUI2020/Helper/Converter/JobTypeStringConverter.cs new file mode 100644 index 0000000000000000000000000000000000000000..b34367fe3f9229dcf75dfacb9172cac0dd9d8453 --- /dev/null +++ b/VECTO3GUI2020/Helper/Converter/JobTypeStringConverter.cs @@ -0,0 +1,52 @@ +using System; +using System.Globalization; +using System.Windows.Data; + +namespace VECTO3GUI2020.Helper.Converter +{ + class JobTypeStringConverter : IValueConverter + { + /* + public string JobTypeToString(JobType jobtype) + { + switch (jobtype) + { + case JobType.CompletedBus: + return "Completed Bus"; + case JobType.HeavyLorry: + return "Heavy Lorry"; + case JobType.PrimaryBus: + return "Primary Bus"; + case JobType.Unknown: + return "Unknown"; + default: + return jobtype.ToString(); + } + } + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (!(value is JobType)) + { + return Binding.DoNothing; + } + JobType jobtype = (JobType)value; + return JobTypeToString(jobtype); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + */ + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/VECTO3GUI2020/Helper/Converter/LabledTextBoxConverter.cs b/VECTO3GUI2020/Helper/Converter/LabledTextBoxConverter.cs new file mode 100644 index 0000000000000000000000000000000000000000..5fe323ec869c2b0c5a62a3b074380494d7ae7619 --- /dev/null +++ b/VECTO3GUI2020/Helper/Converter/LabledTextBoxConverter.cs @@ -0,0 +1,158 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; +using TUGraz.VectoCommon.Utils; +using SIUtils = VECTO3GUI2020.Util.SIUtils; + + +namespace VECTO3GUI2020.Helper.Converter +{ + + class LabledTextBoxConverter : IValueConverter + { + protected const double ToRpm = 60 / (2 * Math.PI); + protected const double ToCubicCentimeter = 1e6; + + private object _originalobject; + public object OriginalObject + { + get { return _originalobject; } + set { _originalobject = value; } + } + + #region Implementation of IValueConverter + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + OriginalObject = value; + if (value == null) + { + return DependencyProperty.UnsetValue; + } + if (!(value is SI)) + { + return value; + //return DependencyProperty.UnsetValue; + //throw new Exception("Can only convert SI types!"); + } + + + + var siValue = value as SI; + var doubleVal = siValue.Value(); + + var conversionFactor = 1.0; + + + if (value is SI SIvalue) + { + if (SIvalue.UnitString == "1/s") + conversionFactor = ToRpm; + } + + var stringParam = parameter as string; + int? decimals = null; + if (!string.IsNullOrEmpty(stringParam)) + { + var args = stringParam.Split('|'); + foreach (var arg in args) + { + GetDecimals(arg, ref decimals); + GetConversionFactor(ref conversionFactor, arg); + } + } + doubleVal *= conversionFactor; + return decimals == null ? doubleVal.ToString(culture) : doubleVal.ToString("F" + decimals.Value, culture); + } + + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + targetType = OriginalObject.GetType(); + + if (!typeof(SI).IsAssignableFrom(targetType)) + { + return value; + //return DependencyProperty.UnsetValue; + } + + if (value == null) + { + return DependencyProperty.UnsetValue; + } + + var stringParam = parameter as string; + int? decimals = null; + var conversionFactor = 1.0; + + if (OriginalObject.GetType() == typeof(PerSecond)) + { + conversionFactor = ToRpm; + } + + + if (!string.IsNullOrEmpty(stringParam)) + { + var args = stringParam.Split('|'); + foreach (var arg in args) + { + GetDecimals(arg, ref decimals); + GetConversionFactor(ref conversionFactor, arg); + } + } + + double doubleVal; + var success = double.TryParse(value.ToString(), NumberStyles.Float, culture, out doubleVal); + if (!success) + { + return DependencyProperty.UnsetValue; + } + + if (decimals != null) + { + doubleVal = Math.Round(doubleVal, decimals.Value, MidpointRounding.AwayFromZero); + } + doubleVal /= conversionFactor; + + return SIUtils.CreateSIValue(targetType, doubleVal); + } + + private void GetConversionFactor(ref double factor, string convertId) + { + switch (convertId.ToLower()) + { + case "asrpm": + factor = ToRpm; + break; + case "ascubiccentimeter": + factor = ToCubicCentimeter; + break; + } + } + + private void GetDecimals(string arg, ref int? decimals) + { + switch (arg.ToLower()) + { + case "int": + decimals = 0; + break; + case "double2": + decimals = 2; + break; + case "double3": + decimals = 3; + break; + case "double4": + decimals = 4; + break; + } + } + #endregion + } + + + +} + diff --git a/VECTO3GUI2020/Helper/Converter/LabledTextBoxLabelConverter.cs b/VECTO3GUI2020/Helper/Converter/LabledTextBoxLabelConverter.cs new file mode 100644 index 0000000000000000000000000000000000000000..a96dc5a3c86fc8ea5eb8edd99356d6205843b048 --- /dev/null +++ b/VECTO3GUI2020/Helper/Converter/LabledTextBoxLabelConverter.cs @@ -0,0 +1,23 @@ +using System; +using System.Globalization; +using System.Windows.Data; + + +namespace VECTO3GUI2020.Helper.Converter +{ + class LabledTextBoxLabelConverter : IValueConverter + { + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + +} diff --git a/VECTO3GUI2020/Helper/Converter/NullToVisibilityConverter.cs b/VECTO3GUI2020/Helper/Converter/NullToVisibilityConverter.cs new file mode 100644 index 0000000000000000000000000000000000000000..ff16a9cd1879495210144c2e44cf3c189c05a3e6 --- /dev/null +++ b/VECTO3GUI2020/Helper/Converter/NullToVisibilityConverter.cs @@ -0,0 +1,27 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace VECTO3GUI2020.Helper.Converter +{ + class NullToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if(value == null) + { + return Visibility.Collapsed; + } + else + { + return Binding.DoNothing; + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/VECTO3GUI2020/Helper/Converter/SIToUnitString.cs b/VECTO3GUI2020/Helper/Converter/SIToUnitString.cs new file mode 100644 index 0000000000000000000000000000000000000000..54701cba7670eff3e1c0a00357e25c191460c6d9 --- /dev/null +++ b/VECTO3GUI2020/Helper/Converter/SIToUnitString.cs @@ -0,0 +1,44 @@ +using System; +using System.Globalization; +using System.Windows.Data; +using TUGraz.VectoCommon.Utils; + +namespace VECTO3GUI2020.Helper.Converter +{ + class SIToUnitString : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + + if(value is SI SIValue) + { + if (SIValue.UnitString == "1/s") + { + return "rpm"; + } + return SIValue.UnitString; + } else { + try { + dynamic type = value?.GetType(); + if (type == null) { + return Binding.DoNothing; + } + return type.GetUnitString(); + } catch { + return Binding.DoNothing; + } + + + } + return Binding.DoNothing; + + + + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/VECTO3GUI2020/Helper/Converter/SIValueToStringConverter.cs b/VECTO3GUI2020/Helper/Converter/SIValueToStringConverter.cs new file mode 100644 index 0000000000000000000000000000000000000000..4ef7af1b466da4534b7685103598a45d988c1bd3 --- /dev/null +++ b/VECTO3GUI2020/Helper/Converter/SIValueToStringConverter.cs @@ -0,0 +1,26 @@ +using System; +using System.Globalization; +using System.Windows.Data; +using TUGraz.VectoCommon.Utils; + +namespace VECTO3GUI2020.Helper.Converter +{ + class SIValueToStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if(value is SI SIvalue) + { + return SIvalue.ToGUIFormat(); + } + + + return Binding.DoNothing; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/VECTO3GUI2020/Helper/Converter/VehicleCategoryToStringConverter.cs b/VECTO3GUI2020/Helper/Converter/VehicleCategoryToStringConverter.cs new file mode 100644 index 0000000000000000000000000000000000000000..6178ad8308651a6fc4542b2308677869b39dcd23 --- /dev/null +++ b/VECTO3GUI2020/Helper/Converter/VehicleCategoryToStringConverter.cs @@ -0,0 +1,6 @@ +namespace VECTO3GUI2020.Helper.Converter +{ + class VehicleCategoryToStringConverter + { + } +} diff --git a/VECTO3GUI2020/Helper/DialogHelper.cs b/VECTO3GUI2020/Helper/DialogHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..1e6c7bdfe2dff2828217665b667bb9fe5f551d00 --- /dev/null +++ b/VECTO3GUI2020/Helper/DialogHelper.cs @@ -0,0 +1,184 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; +using System.Windows.Forms; +using Microsoft.WindowsAPICodePack.Dialogs; +using VECTO3GUI2020.Properties; +using MessageBox = System.Windows.MessageBox; + +namespace VECTO3GUI2020.Helper +{ + public class DialogHelper : IDialogHelper + { + private readonly string _defaultInitialDirectory = System.IO.Path.GetDirectoryName( + System.Reflection.Assembly.GetExecutingAssembly().Location); + + + #region File and Folder Dialogs + private string _xmlFilter = "XML Files (*.xml)|*.xml"; + private string[] OpenFilesDialog(string filter, string initialDirectory, bool multiselect) + { + + using (OpenFileDialog fd = new OpenFileDialog { + InitialDirectory = initialDirectory ?? _defaultInitialDirectory, + Multiselect = multiselect, + Filter = filter + }) { + var result = fd.ShowDialog(); + if (result == DialogResult.OK) + { + return fd.FileNames; + } + } + + + return null; + } + + public string OpenFileDialog(string filter = "All files (*.*)|*.*", string initialDirectory = null) + { + return OpenFilesDialog(filter, initialDirectory)?[0]; + } + + public string[] OpenFilesDialog(string filter, string initialDirectory) + { + return OpenFilesDialog(filter, initialDirectory, true); + } + + public string[] OpenXMLFilesDialog(string initialDirectory) + { + return OpenFilesDialog(_xmlFilter, initialDirectory); + } + + public string OpenXMLFileDialog(string initialDirectory = null) + { + return OpenFilesDialog(_xmlFilter, initialDirectory, false)?[0]; + } + + + public string OpenFolderDialog(string initialDirectory = null) + { + using (var dialog = new CommonOpenFileDialog()) + { + dialog.InitialDirectory = initialDirectory; + dialog.IsFolderPicker = true; + + var result = dialog.ShowDialog(); + if (result == CommonFileDialogResult.Ok) + { + return dialog.FileName; + } + } + return null; + } + + #endregion + + #region Messagebox + + public MessageBoxResult ShowMessageBox(string messageBoxText, + string caption, + MessageBoxButton button, + MessageBoxImage icon) + { + return MessageBox.Show(messageBoxText, caption, button, icon); + } + + public MessageBoxResult ShowMessageBox(string messageBoxTest, string caption) + { + return MessageBox.Show(messageBoxTest, caption); + } + + public string SaveToDialog(string initialDirectory, string filter) + { + using (var saveFileDialog = new SaveFileDialog { + Filter = filter + }) { + saveFileDialog.InitialDirectory = initialDirectory ?? _defaultInitialDirectory; + + return saveFileDialog.ShowDialog() == DialogResult.OK ? saveFileDialog.FileName : null; + } + } + + + public string SaveToXMLDialog(string initialDirectory) + { + return SaveToDialog(initialDirectory, _xmlFilter); + } + + + + #endregion + } + + public interface IDialogHelper + { + /// <summary> + /// Opens a dialog to open a file + /// </summary> + /// <param name="filter"></param> + /// <param name="initialDirectory">If no directory is specified the location of the assembly is used</param> + /// <returns></returns> + string OpenFileDialog(string filter = "All files (*.*)|*.*", string initialDirectory = null); + + /// <summary> + /// Opens a dialog to open files + /// </summary> + /// <param name="filter"></param> + /// <param name="initialDirectory">If no directory is specified the location of the assembly is used</param> + /// <returns></returns> + string[] OpenFilesDialog(string filter = "All files (*.*|*.*", string initialDirectory = null); + + /// <summary> + /// Opens a dialog to open a XML-file + /// </summary> + /// <param name="initialDirectory">If no directory is specified the location of the assembly is used</param> + /// <returns></returns> + string OpenXMLFileDialog(string initialDirectory = null); + + + /// <summary> + /// Opens a dialog to open XML-files + /// </summary> + /// <param name="initialDirectory">If no directory is specified the location of the assembly is used</param> + /// <returns></returns> + string[] OpenXMLFilesDialog(string initialDirectory = null); + + /// <summary> + /// Opens a dialog to pick a folder, if no initialdirectory is specified the location of the assembly is used + /// </summary> + /// <param name="initialDirectory"></param> + /// <returns></returns> + string OpenFolderDialog(string initialDirectory = null); + + /// <summary> + /// Displays a messagebox + /// </summary> + /// <param name="messageBoxText"></param> + /// <param name="caption"></param> + /// <param name="button"></param> + /// <param name="icon"></param> + /// <returns></returns> + MessageBoxResult ShowMessageBox(string messageBoxText, + string caption, + MessageBoxButton button, + MessageBoxImage icon); + + /// <summary> + /// Displays a messagebox + /// </summary> + /// <param name="messageBoxTest"></param> + /// <param name="caption"></param> + /// <returns></returns> + MessageBoxResult ShowMessageBox(string messageBoxTest, string caption); + + + string SaveToDialog(string initialDirectory = null, string filter = "All files (*.*|*.*"); + + string SaveToXMLDialog(string initialDirectory = null); + } +} diff --git a/VECTO3GUI2020/Helper/Extension.cs b/VECTO3GUI2020/Helper/Extension.cs new file mode 100644 index 0000000000000000000000000000000000000000..b7bb02b8f317a41e61c84ba4fe7efe3dd48b3358 --- /dev/null +++ b/VECTO3GUI2020/Helper/Extension.cs @@ -0,0 +1,7 @@ +namespace VECTO3GUI2020.Helper +{ + public class Extension + { + + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/Helper/IWindowHelper.cs b/VECTO3GUI2020/Helper/IWindowHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..c01621543eb5a123b0dc4d987fe9f1e054e7eb8e --- /dev/null +++ b/VECTO3GUI2020/Helper/IWindowHelper.cs @@ -0,0 +1,7 @@ +namespace VECTO3GUI2020.Helper +{ + public interface IWindowHelper + { + void ShowWindow(object viewModel); + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/Helper/WindowHelper.cs b/VECTO3GUI2020/Helper/WindowHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..1e56f7c2a28c96993ea963584e8b4a016b3eaf9b --- /dev/null +++ b/VECTO3GUI2020/Helper/WindowHelper.cs @@ -0,0 +1,29 @@ +using System.Windows; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.Common; + +namespace VECTO3GUI2020.Helper +{ + public class WindowHelper : IWindowHelper + { + + + public void ShowWindow(object viewModel) + { + var window = new Window { + Content = viewModel, + Width = 800, + Height = 600, + WindowStartupLocation = WindowStartupLocation.CenterScreen + }; + + if (viewModel is IViewModelBase vmBase) { + window.Title = vmBase.Title; + } + + window.Show(); + } + + + } +} diff --git a/VECTO3GUI2020/Helper/XMLExtension.cs b/VECTO3GUI2020/Helper/XMLExtension.cs new file mode 100644 index 0000000000000000000000000000000000000000..e9e391f6569f1fea53e142d13abf5be4a6ca1a82 --- /dev/null +++ b/VECTO3GUI2020/Helper/XMLExtension.cs @@ -0,0 +1,43 @@ +using System; +using System.Diagnostics; +using System.Xml.Linq; +using Castle.Core.Resource; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoHashing.Impl; +using VECTO3GUI2020.Util.XML; +using VECTO3GUI2020.Util.XML.Interfaces; + + +namespace VECTO3GUI2020.Helper +{ + public static class XMLExtension + { + + public static XElement CreateSignatureElement(this IXMLComponentWriter componentWriter, XNamespace nameSpace, string uri, DigestData digestData, bool hash = false) + { + var di = XMLNamespaces.Di; + var signatureElement = new XElement(nameSpace + XMLNames.DI_Signature); + signatureElement.Add(new XElement(di + XMLNames.DI_Signature_Reference, new XAttribute(XMLNames.DI_Signature_Reference_URI_Attr, uri))); + + var refElement = signatureElement.FirstNode as XElement; + refElement?.Add(new XElement(di + XMLNames.DI_Signature_Reference_Transforms)); + + var transformsElement = refElement?.FirstNode as XElement; + foreach (var digestDataCanonicalizationMethod in digestData.CanonicalizationMethods) { + transformsElement?.Add(new XElement(di + XMLNames.DI_Signature_Reference_Transforms_Transform, + new XAttribute(XMLNames.DI_Signature_Algorithm_Attr, digestDataCanonicalizationMethod))); + } + + refElement?.Add(new XElement(di + XMLNames.DI_Signature_Reference_DigestMethod, + new XAttribute(XMLNames.DI_Signature_Algorithm_Attr, digestData.DigestMethod))); + if (hash) { + throw new NotImplementedException("Hashing not implemented"); + } + refElement?.Add(new XElement(di + XMLNames.DI_Signature_Reference_DigestValue, "")); + + + return signatureElement; + } + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/Helper/XMLHelper.cs b/VECTO3GUI2020/Helper/XMLHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..de2a0d3088bcf9088e7a444daa8520a93b5edaec --- /dev/null +++ b/VECTO3GUI2020/Helper/XMLHelper.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace VECTO3GUI2020.Helper +{ + public static class XMLHelper + { + } +} diff --git a/VECTO3GUI2020/MainWindow.xaml b/VECTO3GUI2020/MainWindow.xaml new file mode 100644 index 0000000000000000000000000000000000000000..afeefc53a4804071803ec61adb0eae8a52df5e12 --- /dev/null +++ b/VECTO3GUI2020/MainWindow.xaml @@ -0,0 +1,44 @@ +<Window + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:local="clr-namespace:VECTO3GUI2020" + xmlns:Implementation="clr-namespace:VECTO3GUI2020.ViewModel.Implementation" x:Class="VECTO3GUI2020.MainWindow" + mc:Ignorable="d" + Title="Vecto" Height="450" Width="820" + WindowStartupLocation="CenterScreen"> + + + + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="20"/> + <RowDefinition Height="1.5*"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + + <Grid Grid.Row="0" Margin="0,0,0,0"> + <StackPanel Orientation="Vertical"> + <Menu IsMainMenu="True"> + <MenuItem Header="File" VerticalAlignment="Center"> + <MenuItem Header="Settings" Command="{Binding OpenSettings}"/> + <MenuItem Header="New File" Command="{Binding NewInterimFile}"/> + </MenuItem> + </Menu> + </StackPanel> + </Grid> + + <Grid Grid.Row="1" Margin="0,0,0,0"> + <ContentControl Content="{Binding CurrentViewModelTop}"/> + </Grid> + + <Grid Grid.Row="2" Visibility="Collapsed" Margin="0,0,0,0"> + <ContentControl Content="{Binding CurrentViewModelBottom}"/> + </Grid> + + </Grid> +</Window> diff --git a/VECTO3GUI2020/MainWindow.xaml.cs b/VECTO3GUI2020/MainWindow.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..4e8b11eaee2ab358b1ae4d8fdfae1b07f56419be --- /dev/null +++ b/VECTO3GUI2020/MainWindow.xaml.cs @@ -0,0 +1,26 @@ +using System.Windows; +using VECTO3GUI2020.ViewModel.Interfaces; + +namespace VECTO3GUI2020 +{ + /// <summary> + /// Interaktionslogik für MainWindow.xaml + /// </summary> + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + + + + + + public MainWindow(IMainWindowViewModel viewModel) + { + InitializeComponent(); + DataContext = viewModel; + } + } +} diff --git a/VECTO3GUI2020/Model/Implementation/SettingsModel.cs b/VECTO3GUI2020/Model/Implementation/SettingsModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..d22c2f4e121a26c30804ad854e77780d888ba44e --- /dev/null +++ b/VECTO3GUI2020/Model/Implementation/SettingsModel.cs @@ -0,0 +1,8 @@ +using VECTO3GUI2020.Model.Interfaces; + +namespace VECTO3GUI2020.Model.Implementation +{ + public class SettingsModel : ISettingsModel + { + } +} diff --git a/VECTO3GUI2020/Model/Interfaces/IAuxiliaryModelFactory.cs b/VECTO3GUI2020/Model/Interfaces/IAuxiliaryModelFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..208e2631c71c5427072084f101c7fc1bd6986a13 --- /dev/null +++ b/VECTO3GUI2020/Model/Interfaces/IAuxiliaryModelFactory.cs @@ -0,0 +1,15 @@ +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCore.Models.Declaration; + +namespace VECTO3GUI2020.Model.Interfaces +{ + + public interface IAuxiliaryModelFactory + { + /// <summary> + /// Creates a new AuxiliaryModel + /// </summary> + /// <param name="auxiliaryType">Is used to determine wich AuxiliaryModel is created</param> + IDeclarationAuxiliaryTable CreateAuxiliaryModel(AuxiliaryType auxiliaryType); + } +} diff --git a/VECTO3GUI2020/Model/Interfaces/ISettingsModel.cs b/VECTO3GUI2020/Model/Interfaces/ISettingsModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..49f55f27b4ac31bf91608a983e6098e9f4b05e94 --- /dev/null +++ b/VECTO3GUI2020/Model/Interfaces/ISettingsModel.cs @@ -0,0 +1,7 @@ +namespace VECTO3GUI2020.Model.Interfaces +{ + public interface ISettingsModel + { + + } +} diff --git a/VECTO3GUI2020/Ninject/DocumentModule.cs b/VECTO3GUI2020/Ninject/DocumentModule.cs new file mode 100644 index 0000000000000000000000000000000000000000..b989696e777d65d62950502aee7ac1d4c742470f --- /dev/null +++ b/VECTO3GUI2020/Ninject/DocumentModule.cs @@ -0,0 +1,24 @@ +using Ninject.Extensions.Factory; +using Ninject.Modules; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.Model.Interfaces; +using VECTO3GUI2020.Ninject.Util; +using VECTO3GUI2020.Util; +using VECTO3GUI2020.ViewModel.Implementation.Document; +using VECTO3GUI2020.ViewModel.Interfaces.Document; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; + +namespace VECTO3GUI2020.Ninject +{ + public class DocumentModule : NinjectModule + { + public override void Load() + { + + Bind<IDocumentViewModel>().To<DeclarationJobViewModel>().Named(XmlDocumentType.DeclarationJobData.ToString()); + //Bind<IDocumentViewModel>().To<MultistageJobViewModel>().Named(XmlDocumentType.MultistageOutputData.ToString()); + //Bind<IDocumentViewModel>().To<DeclarationTrailerJobDocumentViewModel>().Named(XmlDocumentType.DeclarationTrailerJobData.ToString()); + + } + } +} diff --git a/VECTO3GUI2020/Ninject/FactoryModule.cs b/VECTO3GUI2020/Ninject/FactoryModule.cs new file mode 100644 index 0000000000000000000000000000000000000000..7e127993df48a043e1437ae08ca09501a7f84bf9 --- /dev/null +++ b/VECTO3GUI2020/Ninject/FactoryModule.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Ninject.Extensions.Factory; +using Ninject.Modules; +using VECTO3GUI2020.Ninject.Util; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.Document; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; + +namespace VECTO3GUI2020.Ninject +{ + public class FactoryModule : NinjectModule + { + public override void Load() + { + Bind<IXMLWriterFactory>().ToFactory(() => new UseFirstArgumentTypeAsNameInstanceProvider()); + Bind<IMultiStageViewModelFactory>().ToFactory(() => new UseFirstArgumentAsNameInstanceProvider(skipFirstArgument: true, fallback: true)); + Bind<IJobEditViewModelFactory>().ToFactory(() => new UseFirstArgumentTypeAsNameInstanceProvider()); + Bind<IDocumentViewModelFactory>().ToFactory(() => new UseFirstArgumentAsNameInstanceProvider(false)); + Bind<IComponentViewModelFactory>().ToFactory( + () => new UseFirstArgumentTypeAsNameInstanceProvider(true)); + } + } +} diff --git a/VECTO3GUI2020/Ninject/JobEditModule.cs b/VECTO3GUI2020/Ninject/JobEditModule.cs new file mode 100644 index 0000000000000000000000000000000000000000..817a490777255850e811a0596b05528092aeb000 --- /dev/null +++ b/VECTO3GUI2020/Ninject/JobEditModule.cs @@ -0,0 +1,23 @@ +using Ninject.Extensions.Factory; +using Ninject.Modules; +using VECTO3GUI2020.Ninject.Util; +using VECTO3GUI2020.Util; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Trailer; +using VECTO3GUI2020.ViewModel.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit; + +namespace VECTO3GUI2020.Ninject +{ + public class JobEditModule : NinjectModule + { + public override void Load() + { + + Bind<IJobEditViewModel>().To<DeclarationJobEditViewModel_v1_0>().Named(DeclarationJobEditViewModel_v1_0.VERSION); + Bind<IJobEditViewModel>().To<DeclarationJobEditViewModel_v2_0>().Named(DeclarationJobEditViewModel_v2_0.VERSION); + + } + + } +} diff --git a/VECTO3GUI2020/Ninject/MultistageModule.cs b/VECTO3GUI2020/Ninject/MultistageModule.cs new file mode 100644 index 0000000000000000000000000000000000000000..9a3de4889e5aac7a009fee69d8fd8c3f126fa8ce --- /dev/null +++ b/VECTO3GUI2020/Ninject/MultistageModule.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Ninject.Extensions.Factory; +using Ninject.Modules; +using VECTO3GUI2020.Ninject.Util; +using VECTO3GUI2020.ViewModel.Interfaces.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; + +namespace VECTO3GUI2020.Ninject +{ + public class MultistageModule : NinjectModule + { + public override void Load() + { + + Bind<IViewModelBase>().To<NewMultiStageJobViewModel>(); + + + Bind<IMultiStageJobViewModel>().To<MultiStageJobViewModel_v0_1>() + .Named(MultiStageJobViewModel_v0_1.INPUTPROVIDERTYPE); + + Bind<IVehicleViewModel>().To<DeclarationInterimStageBusVehicleViewModel_v2_8>() + .Named(DeclarationInterimStageBusVehicleViewModel_v2_8.INPUTPROVIDERTYPE); + + Bind<IManufacturingStageViewModel>().To<ManufacturingStageViewModel_v0_1>() + .Named(ManufacturingStageViewModel_v0_1.INPUTPROVIDERTYPE); + + Bind<IMultistageAirdragViewModel>().To<MultistageAirdragViewModel>(); + } + } +} diff --git a/VECTO3GUI2020/Ninject/Util/UseFirstArgumentAsNameInstanceProvider.cs b/VECTO3GUI2020/Ninject/Util/UseFirstArgumentAsNameInstanceProvider.cs new file mode 100644 index 0000000000000000000000000000000000000000..97c89dbee42dae4e3be87b0c04d4244067f89d9b --- /dev/null +++ b/VECTO3GUI2020/Ninject/Util/UseFirstArgumentAsNameInstanceProvider.cs @@ -0,0 +1,57 @@ +using System; +using System.Linq; +using System.Reflection; +using Ninject.Extensions.Factory; +using Ninject.Extensions.Factory.Factory; +using Ninject.Parameters; +using TUGraz.VectoCommon.Exceptions; + +namespace VECTO3GUI2020.Ninject.Util +{ + /// <summary> + /// Ninject Instance Provider uses the first argument as name to resolve a named binding. + /// </summary> + public class UseFirstArgumentAsNameInstanceProvider : StandardInstanceProvider + { + private bool _skipFirstArgument = true; + public UseFirstArgumentAsNameInstanceProvider(bool skipFirstArgument=true, bool fallback=false) : base() + { + _skipFirstArgument = skipFirstArgument; + base.Fallback = fallback; + } + + public UseFirstArgumentAsNameInstanceProvider() : base() + { + + } + + protected override IConstructorArgument[] GetConstructorArguments(MethodInfo methodInfo, object[] arguments) + { + if (arguments.Length == 0) { + return base.GetConstructorArguments(methodInfo, arguments).ToArray(); + } + return base.GetConstructorArguments(methodInfo, arguments).Skip(_skipFirstArgument ? 1 : 0).ToArray(); + } + + protected override string GetName(MethodInfo methodInfo, object[] arguments) + { + if (arguments.Length == 0) { + return ""; + } + return arguments[0].ToString(); + } + + public override object GetInstance(IInstanceResolver instanceResolver, MethodInfo methodInfo, object[] arguments) + { + try + { + return base.GetInstance(instanceResolver, methodInfo, arguments); + } + catch (Exception e) + { + throw new VectoException("failed to create instance for '{1}' via '{0}' version '{2}'", e, methodInfo.Name, methodInfo.ReturnType.Name, arguments[0]); + throw e; + } + } + } +} diff --git a/VECTO3GUI2020/Ninject/Util/UseFirstArgumentTypeAsNameInstanceProvider.cs b/VECTO3GUI2020/Ninject/Util/UseFirstArgumentTypeAsNameInstanceProvider.cs new file mode 100644 index 0000000000000000000000000000000000000000..a2bf886cd28a986538efedf6154759ae06d44d6a --- /dev/null +++ b/VECTO3GUI2020/Ninject/Util/UseFirstArgumentTypeAsNameInstanceProvider.cs @@ -0,0 +1,57 @@ +using System; +using System.Linq; +using System.Reflection; +using Ninject.Extensions.Factory; +using Ninject.Extensions.Factory.Factory; +using Ninject.Parameters; +using Ninject.Planning.Bindings; +using TUGraz.VectoCommon.Exceptions; + +namespace VECTO3GUI2020.Ninject.Util +{ + /// <summary> + /// Ninject Instance Provider + /// uses the type of the first argument as name to resolve a named binding + /// </summary> + public class UseFirstArgumentTypeAsNameInstanceProvider + : StandardInstanceProvider + { + + public UseFirstArgumentTypeAsNameInstanceProvider() : base() + { + + } + /// <summary> + /// Constructor for UseFirstArgumentTypeAsNameInstanceProvider + /// </summary> + /// <param name="fallback">set to true if you want a binding without name as fallback</param> + public UseFirstArgumentTypeAsNameInstanceProvider(bool fallback) : base() + { + base.Fallback = fallback; + } + protected override IConstructorArgument[] GetConstructorArguments(MethodInfo methodInfo, object[] arguments) + { + + return base.GetConstructorArguments(methodInfo, arguments).ToArray(); + } + + protected override string GetName(MethodInfo methodInfo, object[] arguments) + { + var name = arguments[0].GetType().ToString(); + return name; + } + + public override object GetInstance(IInstanceResolver instanceResolver, MethodInfo methodInfo, object[] arguments) + { + try + { + return base.GetInstance(instanceResolver, methodInfo, arguments); + } + catch (Exception e) + { + + throw new VectoException("failed to create instance for '{1}' via '{0}' version '{2}'", e, methodInfo.Name, methodInfo.ReturnType.Name, arguments[0]); + } + } + } +} diff --git a/VECTO3GUI2020/Ninject/Vehicle/ComponentModule.cs b/VECTO3GUI2020/Ninject/Vehicle/ComponentModule.cs new file mode 100644 index 0000000000000000000000000000000000000000..f065c4e26e315c38da7b5e11167467b06a238fc4 --- /dev/null +++ b/VECTO3GUI2020/Ninject/Vehicle/ComponentModule.cs @@ -0,0 +1,121 @@ +using Ninject.Extensions.Factory; +using Ninject.Modules; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCore.Models.Declaration; +using VECTO3GUI2020.Model.Interfaces; +using VECTO3GUI2020.Ninject.Util; +using VECTO3GUI2020.Util; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; + +namespace VECTO3GUI2020.Ninject.Vehicle +{ + public class ComponentModule : NinjectModule + { + public override void Load() + { + + #region IComponentViewModelFactory + + + + Bind<IVehicleViewModel>().To<VehicleViewModel_v1_0>().Named(VehicleViewModel_v1_0.VERSION); + Bind<IVehicleViewModel>().To<VehicleViewModel_v2_0>().Named(VehicleViewModel_v2_0.VERSION); + + //Bind<IVehicleViewModel>().To<DeclarationInterimStageBusVehicleViewModel_v2_8>() + // .Named(DeclarationInterimStageBusVehicleViewModel_v2_8.INPUTPROVIDERTYPE).BindingConfiguration.; + + + Bind<IComponentViewModel>().To<EngineViewModel_v1_0>().Named(EngineViewModel_v1_0.VERSION); + Bind<IComponentViewModel>().To<EngineViewModel_v2_0>().Named(EngineViewModel_v2_0.VERSION); + + Bind<IComponentViewModel>().To<AirDragViewModel_v1_0>().Named(AirDragViewModel_v1_0.VERSION); + Bind<IComponentViewModel>().To<AirDragViewModel_v2_0>().Named(AirDragViewModel_v2_0.VERSION); + + Bind<IComponentViewModel>().To<AxleWheelsViewModel_v1_0>().Named(AxleWheelsViewModel_v1_0.VERSION); + Bind<IComponentViewModel>().To<AxleWheelsViewModel_v2_0>().Named(AxleWheelsViewModel_v2_0.VERSION); + + Bind<IComponentViewModel>().To<AxleGearViewModel_v1_0>().Named(AxleGearViewModel_v1_0.VERSION); + Bind<IComponentViewModel>().To<AxleGearViewModel_v2_0>().Named(AxleGearViewModel_v2_0.VERSION); + + Bind<IComponentViewModel>().To<RetarderViewModel_v1_0>().Named(RetarderViewModel_v1_0.VERSION); + Bind<IComponentViewModel>().To<RetarderViewModel_v2_0>().Named(RetarderViewModel_v2_0.VERSION); + + Bind<IComponentViewModel>().To<GearboxViewModel_v1_0>().Named(GearboxViewModel_v1_0.VERSION); + Bind<IComponentViewModel>().To<GearboxViewModel_v2_0>().Named(GearboxViewModel_v2_0.VERSION); + + Bind<IComponentViewModel>().To<AuxiliariesViewModel_v1_0>().Named(AuxiliariesViewModel_v1_0.VERSION); + Bind<IComponentViewModel>().To<AuxiliariesViewModel_v2_0>().Named(AuxiliariesViewModel_v2_0.VERSION); + + Bind<IComponentViewModel>().To<AxleViewModel_v1_0>().Named(AxleViewModel_v1_0.VERSION); + Bind<IComponentViewModel>().To<AxleViewModel_v2_0>().Named(AxleViewModel_v2_0.VERSION); + + Bind<IComponentViewModel>().To<TyreViewModel_v1_0>().Named(TyreViewModel_v1_0.VERSION); + Bind<IComponentViewModel>().To<TyreViewModel_v2_0>().Named(TyreViewModel_v2_0.VERSION); + Bind<IComponentViewModel>().To<TyreViewModel_v2_2>().Named(TyreViewModel_v2_2.VERSION); + Bind<IComponentViewModel>().To<TyreViewModel_v2_3>().Named(TyreViewModel_v2_3.VERSION); + + Bind<IComponentViewModel>().To<GearViewModel_v1_0>().Named(GearViewModel_v1_0.VERSION); + Bind<IComponentViewModel>().To<GearViewModel_v2_0>().Named(GearViewModel_v2_0.VERSION); + + Bind<IComponentViewModel>().To<PTOViewModel_V1_0>().Named(PTOViewModel_V1_0.VERSION); + Bind<IComponentViewModel>().To<PTOViewModel_V2_0>().Named(PTOViewModel_V2_0.VERSION); + + Bind<IComponentViewModel>().To<AngleDriveViewModel_v1_0>().Named(AngleDriveViewModel_v1_0.VERSION); + Bind<IComponentViewModel>().To<AngleDriveViewModel_v2_0>().Named(AngleDriveViewModel_v2_0.VERSION); + + Bind<IComponentViewModel>().To<AuxiliaryViewModel_v1_0>().Named(AuxiliaryViewModel_v1_0.VERSION); + Bind<IComponentViewModel>().To<AuxiliaryViewModel_v2_0>().Named(AuxiliaryViewModel_v2_0.VERSION); + Bind<IComponentViewModel>().To<AuxiliaryViewModel_v2_3>().Named(AuxiliaryViewModel_v2_3.VERSION); + + Bind<IAdasViewModel>().To<ADASViewModel_v1_0>().Named(ADASViewModel_v1_0.VERSION); + Bind<IAdasViewModel>().To<ADASViewModel_v2_1>().Named(ADASViewModel_v2_1.VERSION); + Bind<IAdasViewModel>().To<ADASViewModel_v2_3>().Named(ADASViewModel_v2_3.VERSION); + Bind<IAdasViewModel>().To<ADASViewModel_v2_3>(); //Default ADAS ViewModel if no matching binding is available; + + Bind<IEngineModeViewModel>().To<EngineModeViewModelSingleFuel>() + .Named(EngineModeViewModelSingleFuel.VERSION); + + Bind<IEngineFuelViewModel>().To<EngineFuelViewModel>(); + + + Bind<IComponentViewModel>().To<TorqueConverterViewModel_v1_0>() + .Named(TorqueConverterViewModel_v1_0.VERSION); + Bind<IComponentViewModel>().To<TorqueConverterViewModel_v2_0>() + .Named(TorqueConverterViewModel_v2_0.VERSION); + + + Bind<IComponentsViewModel>().To<ComponentsViewModel_v1_0>().Named(ComponentsViewModel_v1_0.VERSION); + Bind<IComponentsViewModel>().To<ComponentsViewModel_v2_0>().Named(ComponentsViewModel_v2_0.VERSION); + + Bind<ICommonComponentViewModel>().To<CommonComponentViewModel>(); + #endregion + + + + #region AuxiliaryModelFactory + Bind<IAuxiliaryModelFactory>().ToFactory(() => new UseFirstArgumentAsNameInstanceProvider()); + + Bind<IDeclarationAuxiliaryTable>().To<ElectricSystem>(). + Named(AuxiliaryType.ElectricSystem.ToString()); + + Bind<IDeclarationAuxiliaryTable>().To<Fan>(). + Named(AuxiliaryType.Fan.ToString()); + + Bind<IDeclarationAuxiliaryTable>().To<HeatingVentilationAirConditioning>(). + Named(AuxiliaryType.HVAC.ToString()); + + Bind<IDeclarationAuxiliaryTable>().To<PneumaticSystem>(). + Named(AuxiliaryType.PneumaticSystem.ToString()); + + Bind<IDeclarationAuxiliaryTable>().To<SteeringPump>(). + Named(AuxiliaryType.SteeringPump.ToString()); + + #endregion + } + } +} diff --git a/VECTO3GUI2020/Ninject/XMLWriterFactoryModule.cs b/VECTO3GUI2020/Ninject/XMLWriterFactoryModule.cs new file mode 100644 index 0000000000000000000000000000000000000000..9791fa3362f830d1daddf78578b56ce5e00fa80d --- /dev/null +++ b/VECTO3GUI2020/Ninject/XMLWriterFactoryModule.cs @@ -0,0 +1,100 @@ +using System; +using Ninject.Extensions.Factory; +using Ninject.Modules; +using VECTO3GUI2020.Ninject.Util; +using VECTO3GUI2020.Util.XML.Implementation; +using VECTO3GUI2020.Util.XML.Implementation.ComponentWriter; +using VECTO3GUI2020.Util.XML.Implementation.DocumentWriter; +using VECTO3GUI2020.Util.XML.Interfaces; + +namespace VECTO3GUI2020.Ninject +{ + public class XMLWriterFactoryModule : NinjectModule + { + public override void Load() + { + + + Array.ForEach( + XMLDeclarationJobWriter_v1_0.SUPPORTED_VERSIONS, + (sv=> + Bind<IXMLDeclarationJobWriter>().To<XMLDeclarationJobWriter_v1_0>().Named(sv))); + + Array.ForEach( + XMLDeclarationJobWriter_v2_0.SUPPORTED_VERSIONS, + (sv => + Bind<IXMLDeclarationJobWriter>().To<XMLDeclarationJobWriter_v2_0>().Named(sv))); + + Array.ForEach( + XMLPTOWriter_v1_0.SUPPORTED_VERSIONS, + sv => Bind<IXMLComponentWriter>().To<XMLPTOWriter_v1_0>().Named(sv)); + + Array.ForEach( + XMLPTOWriter_v2_0.SUPPORTED_VERSIONS, + sv => Bind<IXMLComponentWriter>().To<XMLPTOWriter_v2_0>().Named(sv)); + + + Array.ForEach( + XMLVehicleWriter_v1_0.SUPPORTEDVERSIONS, + (sv) => + Bind<IXMLVehicleWriter>().To<XMLVehicleWriter_v1_0>().Named(sv)); + + Array.ForEach( + XMLVehicleWriter_v2_0.SUPPORTEDVERSIONS, + sv => + Bind<IXMLVehicleWriter>().To<XMLVehicleWriter_v2_0>().Named(sv)); + + Array.ForEach( + XMLComponentsWriter_v1_0.SUPPORTED_VERSIONS, + sv => Bind<IXMLComponentsWriter>().To<XMLComponentsWriter_v1_0>().Named(sv)); + + Array.ForEach( + XMLComponentsWriter_v2_0.SUPPORTED_VERSIONS, + sv => Bind<IXMLComponentsWriter>().To<XMLComponentsWriter_v2_0>().Named(sv)); + + Array.ForEach( + XMLEngineWriter_v1_0.SUPPORTED_VERSIONS, + sv => Bind<IXMLComponentWriter>().To<XMLEngineWriter_v1_0>().Named(sv)); + + Array.ForEach( + XMLEngineWriter_v2_0.SUPPORTED_VERSIONS, + sv => Bind<IXMLComponentWriter>().To<XMLEngineWriter_v2_0>().Named(sv)); + + Array.ForEach( + XMLGearboxWriter_v2_0.SUPPORTED_VERSIONS, + sv => Bind<IXMLComponentWriter>().To<XMLGearboxWriter_v2_0>().Named(sv)); + + Array.ForEach( + XMLRetarderWriter_v2_0.SUPPORTED_VERSIONS, + sv => Bind<IXMLComponentWriter>().To<XMLRetarderWriter_v2_0>().Named(sv)); + + Array.ForEach( + XMLAxleGearWriter_v2_0.SUPPORTED_VERSIONS, + sv => Bind<IXMLComponentWriter>().To<XMLAxleGearWriter_v2_0>().Named(sv)); + + Array.ForEach( + XMLAxleWheelsWriter_v2_0.SUPPORTED_VERSIONS, + sv => Bind<IXMLComponentWriter>().To<XMLAxleWheelsWriter_v2_0>().Named(sv)); + + Array.ForEach( + XMLAxleWheelWriter_v2_0.SUPPORTED_VERSIONS, + sv=> Bind<IXMLComponentWriter>().To<XMLAxleWheelWriter_v2_0>().Named(sv)); + + Array.ForEach( + XMLTyreWriter_v2_0.SUPPORTED_VERSIONS, + sv=> Bind<IXMLComponentWriter>().To<XMLTyreWriter_v2_0>().Named(sv)); + + Array.ForEach( + XMLTyreWriter_v2_3.SUPPORTED_VERSIONS, + sv=>Bind<IXMLComponentWriter>().To<XMLTyreWriter_v2_3>().Named(sv)); + + Array.ForEach( + XMLAuxiliariesWriter_v2_0.SUPPORTED_VERSIONS, + sv => Bind<IXMLComponentWriter>().To<XMLAuxiliariesWriter_v2_0>().Named(sv)); + Array.ForEach( + XMLAirDragWriter_v2_0.SUPPORTED_VERSIONS, + sv => Bind<IXMLComponentWriter>().To<XMLAirDragWriter_v2_0>().Named(sv)); + + } + } +} diff --git a/VECTO3GUI2020/Properties/Application.Designer.cs b/VECTO3GUI2020/Properties/Application.Designer.cs new file mode 100644 index 0000000000000000000000000000000000000000..6dc9f161ce435740fe6c6509ef8c1f718445e508 --- /dev/null +++ b/VECTO3GUI2020/Properties/Application.Designer.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace VECTO3GUI2020.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")] + internal sealed partial class Application : global::System.Configuration.ApplicationSettingsBase { + + private static Application defaultInstance = ((Application)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Application()))); + + public static Application Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string Path { + get { + return ((string)(this["Path"])); + } + set { + this["Path"] = value; + } + } + } +} diff --git a/VECTO3GUI2020/Properties/Application.settings b/VECTO3GUI2020/Properties/Application.settings new file mode 100644 index 0000000000000000000000000000000000000000..50a6a808d52539a09dab9357baa512e1f6d5a170 --- /dev/null +++ b/VECTO3GUI2020/Properties/Application.settings @@ -0,0 +1,9 @@ +<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="VECTO3GUI2020.Properties" GeneratedClassName="Application"> + <Profiles /> + <Settings> + <Setting Name="Path" Type="System.String" Scope="User"> + <Value Profile="(Default)" /> + </Setting> + </Settings> +</SettingsFile> \ No newline at end of file diff --git a/VECTO3GUI2020/Properties/AssemblyInfo.cs b/VECTO3GUI2020/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000000000000000000000000000000000..f37064a9b870f31c27572d9137ff1e85d2e68931 --- /dev/null +++ b/VECTO3GUI2020/Properties/AssemblyInfo.cs @@ -0,0 +1,53 @@ +using System.Reflection; +using System.Runtime.InteropServices; +using System.Windows; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("VECTO3GUI2020")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VECTO3GUI2020")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +//Um mit dem Erstellen lokalisierbarer Anwendungen zu beginnen, legen Sie +//<UICulture>ImCodeVerwendeteKultur</UICulture> in der .csproj-Datei +//in einer <PropertyGroup> fest. Wenn Sie in den Quelldateien beispielsweise Deutsch +//(Deutschland) verwenden, legen Sie <UICulture> auf \"de-DE\" fest. Heben Sie dann die Auskommentierung +//des nachstehenden NeutralResourceLanguage-Attributs auf. Aktualisieren Sie "en-US" in der nachstehenden Zeile, +//sodass es mit der UICulture-Einstellung in der Projektdatei übereinstimmt. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //Speicherort der designspezifischen Ressourcenwörterbücher + //(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird, + // oder in den Anwendungsressourcen-Wörterbüchern nicht gefunden werden kann.) + ResourceDictionaryLocation.SourceAssembly //Speicherort des generischen Ressourcenwörterbuchs + //(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird, + // designspezifischen Ressourcenwörterbuch nicht gefunden werden kann.) +)] + + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// indem Sie "*" wie unten gezeigt eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/VECTO3GUI2020/Properties/Resources.Designer.cs b/VECTO3GUI2020/Properties/Resources.Designer.cs new file mode 100644 index 0000000000000000000000000000000000000000..3b10976644a9ab1b1bafce21574716b2d4ba2e71 --- /dev/null +++ b/VECTO3GUI2020/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion: 4.0.30319.42000 +// +// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace VECTO3GUI2020.Properties +{ + + + /// <summary> + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// </summary> + // Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse + // über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// <summary> + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VECTO3GUI2020.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/VECTO3GUI2020/Properties/Resources.resx b/VECTO3GUI2020/Properties/Resources.resx new file mode 100644 index 0000000000000000000000000000000000000000..af7dbebbacef595e3089c01c05671016c21a8304 --- /dev/null +++ b/VECTO3GUI2020/Properties/Resources.resx @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file diff --git a/VECTO3GUI2020/Properties/Settings.Designer.cs b/VECTO3GUI2020/Properties/Settings.Designer.cs new file mode 100644 index 0000000000000000000000000000000000000000..9fa1af07057ef049e7720344f04432358d7cdf46 --- /dev/null +++ b/VECTO3GUI2020/Properties/Settings.Designer.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace VECTO3GUI2020.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")] + public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool EngineeringMode { + get { + return ((bool)(this["EngineeringMode"])); + } + set { + this["EngineeringMode"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("../../../VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration")] + public string DefaultFilePath { + get { + return ((string)(this["DefaultFilePath"])); + } + set { + this["DefaultFilePath"] = value; + } + } + } +} diff --git a/VECTO3GUI2020/Properties/Settings.cs b/VECTO3GUI2020/Properties/Settings.cs new file mode 100644 index 0000000000000000000000000000000000000000..2053405eb12affa998c8f39c78d447922e0d4c65 --- /dev/null +++ b/VECTO3GUI2020/Properties/Settings.cs @@ -0,0 +1,43 @@ +using System; +using System.IO; + +namespace VECTO3GUI2020.Properties { + + + // This class allows you to handle specific events on the settings class: + // The SettingChanging event is raised before a setting's value is changed. + // The PropertyChanged event is raised after a setting's value is changed. + // The SettingsLoaded event is raised after the setting values are loaded. + // The SettingsSaving event is raised before the setting values are saved. + public sealed partial class Settings { + + public Settings() { + // // To add event handlers for saving and changing settings, uncomment the lines below: + // + var relativeFilePath = DefaultFilePath; + + DefaultFilePath = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @relativeFilePath)); + + this.SettingChanging += this.SettingChangingEventHandler; + this.SettingsLoaded += this.SettingsLoadedEventHandler; + // + this.SettingsSaving += this.SettingsSavingEventHandler; + // + } + + private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { + // Add code to handle the SettingChangingEvent event here. + } + + private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { + // Add code to handle the SettingsSaving event here. + } + + private void SettingsLoadedEventHandler(object sender, System.Configuration.SettingsLoadedEventArgs e) + { + var relativeFilePath = DefaultFilePath; + + DefaultFilePath = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @relativeFilePath)); + } + } +} diff --git a/VECTO3GUI2020/Properties/Settings.settings b/VECTO3GUI2020/Properties/Settings.settings new file mode 100644 index 0000000000000000000000000000000000000000..c23c4354162c1e922580b7254f21b4de0167650d --- /dev/null +++ b/VECTO3GUI2020/Properties/Settings.settings @@ -0,0 +1,12 @@ +<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="VECTO3GUI2020.Properties" GeneratedClassName="Settings"> + <Profiles /> + <Settings> + <Setting Name="EngineeringMode" Type="System.Boolean" Scope="User"> + <Value Profile="(Default)">False</Value> + </Setting> + <Setting Name="DefaultFilePath" Type="System.String" Scope="User"> + <Value Profile="(Default)">../../../VectoCore/VectoCoreTest/TestData/XML/XMLReaderDeclaration</Value> + </Setting> + </Settings> +</SettingsFile> \ No newline at end of file diff --git a/VECTO3GUI2020/Properties/Strings.Designer.cs b/VECTO3GUI2020/Properties/Strings.Designer.cs new file mode 100644 index 0000000000000000000000000000000000000000..522ce734b94cd98ad63e2a908fc4ea30da29f80e --- /dev/null +++ b/VECTO3GUI2020/Properties/Strings.Designer.cs @@ -0,0 +1,388 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace VECTO3GUI2020.Properties { + using System; + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Strings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Strings() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VECTO3GUI2020.Properties.Strings", typeof(Strings).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// <summary> + /// Looks up a localized string similar to Airdrag Area. + /// </summary> + public static string AirDragArea { + get { + return ResourceManager.GetString("AirDragArea", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Angledrive Type. + /// </summary> + public static string AngledriveType { + get { + return ResourceManager.GetString("AngledriveType", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Axle Configuration. + /// </summary> + public static string AxleConfiguration { + get { + return ResourceManager.GetString("AxleConfiguration", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Axlegear Ratio. + /// </summary> + public static string AxleGearRatio { + get { + return ResourceManager.GetString("AxleGearRatio", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Certification Number. + /// </summary> + public static string Certification_Number { + get { + return ResourceManager.GetString("Certification Number", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Certification Method. + /// </summary> + public static string CertificationMethod { + get { + return ResourceManager.GetString("CertificationMethod", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Certification Number. + /// </summary> + public static string CertificationNumber { + get { + return ResourceManager.GetString("CertificationNumber", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Curb Mass Chassis. + /// </summary> + public static string CurbMassChassis { + get { + return ResourceManager.GetString("CurbMassChassis", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Dimension. + /// </summary> + public static string Dimension { + get { + return ResourceManager.GetString("Dimension", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Displacement. + /// </summary> + public static string Displacement { + get { + return ResourceManager.GetString("Displacement", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Efficiency. + /// </summary> + public static string Efficiency { + get { + return ResourceManager.GetString("Efficiency", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Engine Idle Speed. + /// </summary> + public static string EngineIdleSpeed { + get { + return ResourceManager.GetString("EngineIdleSpeed", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Gross Vehicle Mass. + /// </summary> + public static string GrossVehicleMass { + get { + return ResourceManager.GetString("GrossVehicleMass", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Gross Vehicle Mass Rating. + /// </summary> + public static string GrossVehicleMassRating { + get { + return ResourceManager.GetString("GrossVehicleMassRating", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Idling Speed. + /// </summary> + public static string IdlingSpeed { + get { + return ResourceManager.GetString("IdlingSpeed", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Legislative Class. + /// </summary> + public static string LegislativeClass { + get { + return ResourceManager.GetString("LegislativeClass", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Manufacturer. + /// </summary> + public static string Manufacturer { + get { + return ResourceManager.GetString("Manufacturer", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Manufacturer Address. + /// </summary> + public static string ManufacturerAddress { + get { + return ResourceManager.GetString("ManufacturerAddress", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Manufacturer Adress. + /// </summary> + public static string ManufacturerAdress { + get { + return ResourceManager.GetString("ManufacturerAdress", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Max. Torque Declared. + /// </summary> + public static string MaxTorqueDeclared { + get { + return ResourceManager.GetString("MaxTorqueDeclared", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Model. + /// </summary> + public static string Model { + get { + return ResourceManager.GetString("Model", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Predictive Cruise Control. + /// </summary> + public static string PredictiveCruiseControl { + get { + return ResourceManager.GetString("PredictiveCruiseControl", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Transmission Type. + /// </summary> + public static string PTOTransmissionType { + get { + return ResourceManager.GetString("PTOTransmissionType", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Rated Power. + /// </summary> + public static string RatedPowerDeclared { + get { + return ResourceManager.GetString("RatedPowerDeclared", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Rated Speed Declared. + /// </summary> + public static string RatedSpeedDeclared { + get { + return ResourceManager.GetString("RatedSpeedDeclared", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Ratio. + /// </summary> + public static string Ratio { + get { + return ResourceManager.GetString("Ratio", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Retarder Ratio. + /// </summary> + public static string RetarderRatio { + get { + return ResourceManager.GetString("RetarderRatio", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Retarder Type. + /// </summary> + public static string RetarderType { + get { + return ResourceManager.GetString("RetarderType", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Roll Resistance Coefficient. + /// </summary> + public static string RRC { + get { + return ResourceManager.GetString("RRC", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Do you want to overwrite + /// . + /// </summary> + public static string SaveExecute_Do_you_want_to_overwrite { + get { + return ResourceManager.GetString("SaveExecute_Do_you_want_to_overwrite", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Transmission Type. + /// </summary> + public static string TransmissionType { + get { + return ResourceManager.GetString("TransmissionType", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Twin Tyres. + /// </summary> + public static string TwinTyres { + get { + return ResourceManager.GetString("TwinTyres", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Vehicle Category. + /// </summary> + public static string VehicleCategory { + get { + return ResourceManager.GetString("VehicleCategory", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Vehicle Identification Number. + /// </summary> + public static string VehicleViewModel_v1_0_VIN { + get { + return ResourceManager.GetString("VehicleViewModel_v1_0_VIN", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Vehicle Identification Number. + /// </summary> + public static string VIN { + get { + return ResourceManager.GetString("VIN", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Waste Heat Recovery. + /// </summary> + public static string WHRType { + get { + return ResourceManager.GetString("WHRType", resourceCulture); + } + } + } +} diff --git a/VECTO3GUI2020/Properties/Strings.resx b/VECTO3GUI2020/Properties/Strings.resx new file mode 100644 index 0000000000000000000000000000000000000000..27a2216137c3bfb8aa5a61496bce1a291f9c8e7c --- /dev/null +++ b/VECTO3GUI2020/Properties/Strings.resx @@ -0,0 +1,229 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="AirDragArea" xml:space="preserve"> + <value>Airdrag Area</value> + </data> + <data name="AngledriveType" xml:space="preserve"> + <value>Angledrive Type</value> + </data> + <data name="AxleConfiguration" xml:space="preserve"> + <value>Axle Configuration</value> + </data> + <data name="AxleGearRatio" xml:space="preserve"> + <value>Axlegear Ratio</value> + </data> + <data name="Certification Number" xml:space="preserve"> + <value>Certification Number</value> + </data> + <data name="CertificationMethod" xml:space="preserve"> + <value>Certification Method</value> + </data> + <data name="CertificationNumber" xml:space="preserve"> + <value>Certification Number</value> + </data> + <data name="CurbMassChassis" xml:space="preserve"> + <value>Curb Mass Chassis</value> + </data> + <data name="Dimension" xml:space="preserve"> + <value>Dimension</value> + </data> + <data name="Displacement" xml:space="preserve"> + <value>Displacement</value> + </data> + <data name="Efficiency" xml:space="preserve"> + <value>Efficiency</value> + </data> + <data name="EngineIdleSpeed" xml:space="preserve"> + <value>Engine Idle Speed</value> + </data> + <data name="GrossVehicleMass" xml:space="preserve"> + <value>Gross Vehicle Mass</value> + </data> + <data name="GrossVehicleMassRating" xml:space="preserve"> + <value>Gross Vehicle Mass Rating</value> + </data> + <data name="IdlingSpeed" xml:space="preserve"> + <value>Idling Speed</value> + </data> + <data name="LegislativeClass" xml:space="preserve"> + <value>Legislative Class</value> + </data> + <data name="Manufacturer" xml:space="preserve"> + <value>Manufacturer</value> + </data> + <data name="ManufacturerAddress" xml:space="preserve"> + <value>Manufacturer Address</value> + </data> + <data name="ManufacturerAdress" xml:space="preserve"> + <value>Manufacturer Adress</value> + </data> + <data name="MaxTorqueDeclared" xml:space="preserve"> + <value>Max. Torque Declared</value> + </data> + <data name="Model" xml:space="preserve"> + <value>Model</value> + </data> + <data name="PredictiveCruiseControl" xml:space="preserve"> + <value>Predictive Cruise Control</value> + </data> + <data name="PTOTransmissionType" xml:space="preserve"> + <value>Transmission Type</value> + </data> + <data name="RatedPowerDeclared" xml:space="preserve"> + <value>Rated Power</value> + </data> + <data name="RatedSpeedDeclared" xml:space="preserve"> + <value>Rated Speed Declared</value> + </data> + <data name="Ratio" xml:space="preserve"> + <value>Ratio</value> + </data> + <data name="RetarderRatio" xml:space="preserve"> + <value>Retarder Ratio</value> + </data> + <data name="RetarderType" xml:space="preserve"> + <value>Retarder Type</value> + </data> + <data name="RRC" xml:space="preserve"> + <value>Roll Resistance Coefficient</value> + </data> + <data name="TransmissionType" xml:space="preserve"> + <value>Transmission Type</value> + </data> + <data name="TwinTyres" xml:space="preserve"> + <value>Twin Tyres</value> + </data> + <data name="VehicleCategory" xml:space="preserve"> + <value>Vehicle Category</value> + </data> + <data name="VehicleViewModel_v1_0_VIN" xml:space="preserve"> + <value>Vehicle Identification Number</value> + </data> + <data name="VIN" xml:space="preserve"> + <value>Vehicle Identification Number</value> + </data> + <data name="WHRType" xml:space="preserve"> + <value>Waste Heat Recovery</value> + </data> + <data name="SaveExecute_Do_you_want_to_overwrite" xml:space="preserve"> + <value>Do you want to overwrite + </value> + </data> +</root> \ No newline at end of file diff --git a/VECTO3GUI2020/Resources/Colors.xaml b/VECTO3GUI2020/Resources/Colors.xaml new file mode 100644 index 0000000000000000000000000000000000000000..3aa47eae7766b209bfa61eaaf78799418cce4e4f --- /dev/null +++ b/VECTO3GUI2020/Resources/Colors.xaml @@ -0,0 +1,12 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:VECTO3GUI2020"> + <SolidColorBrush x:Key="AccentColorButton" Color="#FF10796B"/> + <Color x:Key="ButtonBackgroundColor">White</Color> + <LinearGradientBrush x:Key="ButtonBackgroundBrush" EndPoint="0,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0"> + <GradientStop Color="Black" Offset="1"/> + <GradientStop Color="{DynamicResource ButtonBackgroundColor}" Offset="0.187"/> + <GradientStop Color="#FF494949" Offset="0.906"/> + </LinearGradientBrush> + +</ResourceDictionary> \ No newline at end of file diff --git a/VECTO3GUI2020/Resources/Converter.xaml b/VECTO3GUI2020/Resources/Converter.xaml new file mode 100644 index 0000000000000000000000000000000000000000..361e9aed132af07521cfde8ef0c3ba90b47fb793 --- /dev/null +++ b/VECTO3GUI2020/Resources/Converter.xaml @@ -0,0 +1,15 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:converter="clr-namespace:VECTO3GUI2020.Helper.Converter"> + <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> + + <converter:SIToUnitString x:Key="SIToUnitStringConverter"/> + <converter:SIValueToStringConverter x:Key="SIValueToStringConverter"/> + <converter:NullToVisibilityConverter x:Key="NullToVisibilityConverter"/> + <converter:AlwaysVisibleConverter x:Key="AlwaysVisibleConverter"/> + <converter:LabledTextBoxConverter x:Key="LabledTextBoxConverter" x:Shared="false" /> + <converter:LabledTextBoxLabelConverter x:Key="LabledTextBoxLabelConverter" /> + <converter:InvertBoolConverter x:Key="InvertBoolConverter"/> + <converter:InvertedBoolToVisibilityConverter x:Key="InvertedBoolToVisibilityConverter"></converter:InvertedBoolToVisibilityConverter> +</ResourceDictionary> + diff --git a/VECTO3GUI2020/Resources/GlobalStyles.xaml b/VECTO3GUI2020/Resources/GlobalStyles.xaml new file mode 100644 index 0000000000000000000000000000000000000000..34fc7f3116542fd540da6507dc1ad6601fab2c74 --- /dev/null +++ b/VECTO3GUI2020/Resources/GlobalStyles.xaml @@ -0,0 +1,126 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + + + + <Style x:Key="ListViewStyle" TargetType="ListView"> + <Setter Property="Background" Value="DimGray"/> + <Setter Property="Foreground" Value="White" /> + </Style> + <SolidColorBrush x:Key="Button.Static.Background" Color="#FFDFFFFA"/> + <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/> + <SolidColorBrush x:Key="Button.Static.Border" Color="#FF02888B"/> + + <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/> + <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/> + <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/> + <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/> + <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/> + <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/> + + + <ControlTemplate x:Key="MainViewButtonStyle" TargetType="{x:Type ButtonBase}"> + <Border x:Name="border" SnapsToDevicePixels="True" BorderBrush="{DynamicResource AccentColorButton}" BorderThickness="2" Background="{DynamicResource Button.Static.Background}"> + <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="Button.IsDefaulted" Value="True"> + <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> + </Trigger> + <Trigger Property="IsMouseOver" Value="True"> + <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/> + <Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/> + </Trigger> + <Trigger Property="IsPressed" Value="True"> + <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/> + <Setter Property="BorderBrush" TargetName="border" Value="#FF2C628B"/> + </Trigger> + <Trigger Property="ToggleButton.IsChecked" Value="True"> + <Setter Property="Background" TargetName="border" Value="#FFBCDDEE"/> + <Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/> + </Trigger> + <Trigger Property="IsEnabled" Value="False"> + <Setter Property="Background" TargetName="border" Value="#FFF4F4F4"/> + <Setter Property="BorderBrush" TargetName="border" Value="#FFADB2B5"/> + <!--Setter Property="Foreground" Value="#FF838383"/--> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + <Style x:Key="FocusVisual"> + <Setter Property="Control.Template"> + <Setter.Value> + <ControlTemplate> + <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="MainViewButton" TargetType="{x:Type Button}"> + <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/> + <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/> + <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/> + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> + <Setter Property="BorderThickness" Value="1"/> + <Setter Property="HorizontalContentAlignment" Value="Center"/> + <Setter Property="VerticalContentAlignment" Value="Center"/> + <Setter Property="Padding" Value="1"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Button}"> + <Border x:Name="border" BorderBrush="#FF1E716A" BorderThickness="{TemplateBinding BorderThickness}" Background="White" SnapsToDevicePixels="true"> + <Border.OpacityMask> + <RadialGradientBrush> + <GradientStop Color="Black" Offset="0.133"/> + <GradientStop Color="White" Offset="0.6"/> + </RadialGradientBrush> + </Border.OpacityMask> + <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsDefaulted" Value="true"> + <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> + </Trigger> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/> + <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/> + </Trigger> + <Trigger Property="IsPressed" Value="true"> + <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/> + <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/> + <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/> + <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style x:Key="LabelStyleSubView" TargetType="{x:Type Label}"> + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="Padding" Value="5"/> + <Setter Property="HorizontalContentAlignment" Value="Left"/> + <Setter Property="VerticalContentAlignment" Value="Top"/> + <Setter Property="FontWeight" Value="DemiBold"/> + <Setter Property="FontSize" Value="14"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type Label}"> + <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> + <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary> \ No newline at end of file diff --git a/VECTO3GUI2020/Resources/Icon2.ico b/VECTO3GUI2020/Resources/Icon2.ico new file mode 100644 index 0000000000000000000000000000000000000000..6de7e5cd7ef1e97f70d64cb3eeaa2b7fcc8d604f Binary files /dev/null and b/VECTO3GUI2020/Resources/Icon2.ico differ diff --git a/VECTO3GUI2020/Resources/ViewModelBindings.xaml b/VECTO3GUI2020/Resources/ViewModelBindings.xaml new file mode 100644 index 0000000000000000000000000000000000000000..993c2c434cb59d23be5c9c3ab0b8fd7db5685b8a --- /dev/null +++ b/VECTO3GUI2020/Resources/ViewModelBindings.xaml @@ -0,0 +1,217 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:VECTO3GUI2020" + xmlns:interfaces="clr-namespace:VECTO3GUI2020.ViewModel.Interfaces" + xmlns:views="clr-namespace:VECTO3GUI2020.Views" + xmlns:jobeditviews="clr-namespace:VECTO3GUI2020.Views.JobEditViews" + xmlns:impl="clr-namespace:VECTO3GUI2020.ViewModel.Implementation" + xmlns:jobeditimpl="clr-namespace:VECTO3GUI2020.ViewModel.Implementation.JobEdit" + xmlns:vehicleimpl="clr-namespace:VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle" + xmlns:vehicleviews="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle" + xmlns:multistageviews="clr-namespace:VECTO3GUI2020.Views.Multistage" + xmlns:componentimpl="clr-namespace:VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components" + xmlns:componentviews="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + xmlns:multistageimpl="clr-namespace:VECTO3GUI2020.ViewModel.MultiStage.Implementation"> + <DataTemplate DataType="{x:Type impl:JobListViewModel}"> + <views:JobListView /> + </DataTemplate> + <DataTemplate DataType="{x:Type impl:MessageViewModel}"> + <views:MessageView /> + </DataTemplate> + + <DataTemplate DataType="{x:Type impl:MainWindowViewModel}"> + <local:MainWindow /> + </DataTemplate> + + <DataTemplate DataType="{x:Type impl:SettingsViewModel}"> + <views:SettingsView/> + </DataTemplate> + + + + + <DataTemplate DataType="{x:Type jobeditimpl:DeclarationJobEditViewModel_v1_0}"> + <jobeditviews:DeclarationJobEditView/> + </DataTemplate> + <DataTemplate DataType="{x:Type jobeditimpl:DeclarationJobEditViewModel_v2_0}"> + <jobeditviews:DeclarationJobEditView/> + </DataTemplate> + + + + + <DataTemplate DataType="{x:Type vehicleimpl:VehicleViewModel_v1_0 }"> + <vehicleviews:VehicleView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type vehicleimpl:VehicleViewModel_v2_0}"> + <vehicleviews:VehicleView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:CommonComponentViewModel}"> + <componentviews:CommonComponentView/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:EngineViewModel_v2_0}"> + <componentviews:EngineView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:EngineViewModel_v1_0}"> + <componentviews:EngineView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:AirDragViewModel_v2_0}"> + <componentviews:AirDragView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:AirDragViewModel_v1_0}"> + <componentviews:AirDragView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:AxleWheelsViewModel_v1_0}"> + <componentviews:AxleWheelsView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:AxleWheelsViewModel_v2_0}"> + <componentviews:AxleWheelsView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:AxleGearViewModel_v1_0}"> + <componentviews:AxleGearView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentviews:AxleGearView_v2_0}"> + <componentviews:AxleGearView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:RetarderViewModel_v1_0}"> + <componentviews:RetarderView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:RetarderViewModel_v2_0}"> + <componentviews:RetarderView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:GearboxViewModel_v1_0}"> + <componentviews:GearboxView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:GearboxViewModel_v2_0}"> + <componentviews:GearboxView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:AuxiliariesViewModel_v1_0}"> + <componentviews:AuxiliariesView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:AuxiliariesViewModel_v2_0}"> + <componentviews:AuxiliariesView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:AuxiliariesViewModel_v2_3}"> + <componentviews:AuxiliariesView_v2_0/> + </DataTemplate> + + + <DataTemplate DataType="{x:Type componentimpl:AxleViewModel_v1_0}"> + <componentviews:AxleView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:AxleViewModel_v2_0}"> + <componentviews:AxleView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:TyreViewModel_v1_0}"> + <componentviews:TyreView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:TyreViewModel_v2_0}"> + <componentviews:TyreView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:TyreViewModel_v2_2}"> + <componentviews:TyreView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:TyreViewModel_v2_3}"> + <componentviews:TyreView_v2_3/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:GearViewModel_v1_0}"> + <componentviews:GearView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:GearViewModel_v2_0}"> + <componentviews:GearView_v2_0/> + </DataTemplate> + + + <DataTemplate DataType="{x:Type componentimpl:PTOViewModel_V1_0}"> + <componentviews:PTOView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:PTOViewModel_V2_0}"> + <componentviews:PTOView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:AngleDriveViewModel_v1_0}"> + <componentviews:AngleDriveView_v2_0/> + </DataTemplate> + <DataTemplate DataType="{x:Type componentimpl:AngleDriveViewModel_v2_0}"> + <componentviews:AngleDriveView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:AuxiliaryViewModel_v1_0}"> + <componentviews:AuxiliaryView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:AuxiliaryViewModel_v2_0}"> + <componentviews:AuxiliaryView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:AuxiliaryViewModel_v2_3}"> + <componentviews:AuxiliaryView_v2_0/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:ADASViewModel_v1_0}"> + <componentviews:ADASView_v2_3/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:ADASViewModel_v2_1}"> + <componentviews:ADASView_v2_3/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:ADASViewModel_v2_3}"> + <componentviews:ADASView_v2_3/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:EngineModeViewModelSingleFuel}"> + <componentviews:EngineModeViewSingleFuel/> + </DataTemplate> + + <DataTemplate DataType="{x:Type componentimpl:EngineFuelViewModel}"> + <componentviews:EngineFuelView/> + </DataTemplate> + + + <DataTemplate DataType="{x:Type multistageimpl:NewMultiStageJobViewModel}"> + <multistageviews:NewMultistageFileView/> + </DataTemplate> + + <DataTemplate DataType="{x:Type multistageimpl:ManufacturingStageViewModel_v0_1}"> + <multistageviews:ManufacturingStageView></multistageviews:ManufacturingStageView> + </DataTemplate> + + <DataTemplate DataType="{x:Type multistageimpl:DeclarationInterimStageBusVehicleViewModel_v2_8}"> + <multistageviews:VehicleView_v2_8/> + </DataTemplate> + + <DataTemplate DataType="{x:Type multistageimpl:MultiStageJobViewModel_v0_1}"> + <multistageviews:MultiStageView/> + </DataTemplate> + + <DataTemplate DataType="{x:Type multistageimpl:MultistageAirdragViewModel}"> + <multistageviews:MultistageAirDragView/> + </DataTemplate> + +</ResourceDictionary> \ No newline at end of file diff --git a/VECTO3GUI2020/Resources/folderpicker.ico b/VECTO3GUI2020/Resources/folderpicker.ico new file mode 100644 index 0000000000000000000000000000000000000000..3a76a8fef817549631e18bce0cae2f36f45fe764 Binary files /dev/null and b/VECTO3GUI2020/Resources/folderpicker.ico differ diff --git a/VECTO3GUI2020/Test.xaml b/VECTO3GUI2020/Test.xaml new file mode 100644 index 0000000000000000000000000000000000000000..9eeaeb40e20548db7319e1ec1ed23420ba7ac135 --- /dev/null +++ b/VECTO3GUI2020/Test.xaml @@ -0,0 +1,37 @@ +<Window x:Class="VECTO3GUI2020.Views.Test" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:local="clr-namespace:VECTO3GUI2020.Views" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + Title="Test" Height="450" Width="800"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="1*"/> + <RowDefinition Height="1*"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="1*"/> + <ColumnDefinition Width="1*"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + + + <custom:LabledTextBox + Grid.Row="0" Grid.Column="0" + Label="{Binding TestProperty}" + Text="{Binding TestProperty}" + Height="20" + /> + <custom:LabledTextBoxUnit Grid.Row="0" Grid.Column="1" Height="20" /> + + <custom:LabledTextBoxAutomatic Grid.Row="2" Content="{Binding TestProperty}"></custom:LabledTextBoxAutomatic> + + <DataGrid Grid.ColumnSpan="3" Grid.Row="1"> + + </DataGrid> + </Grid> +</Window> diff --git a/VECTO3GUI2020/Test.xaml.cs b/VECTO3GUI2020/Test.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..325d6af67fc508a0ceb415e5d4c8a509f8fe6028 --- /dev/null +++ b/VECTO3GUI2020/Test.xaml.cs @@ -0,0 +1,26 @@ +using System.Windows; + +namespace VECTO3GUI2020.Views +{ + /// <summary> + /// Interaktionslogik für Test.xaml + /// </summary> + public partial class Test : Window + { + public string TestProperty { get; set; } = "hi"; + + + private enum TestEnum + { + Hallo = 0, Welt, ich, bin, eine, Aufzählung + } + + + + public Test() + { + InitializeComponent(); + this.DataContext = this; + } + } +} diff --git a/VECTO3GUI2020/Util/AllowedEntry.cs b/VECTO3GUI2020/Util/AllowedEntry.cs new file mode 100644 index 0000000000000000000000000000000000000000..4d1c7270a2afa6f818e5d6035daf2e22b9a56297 --- /dev/null +++ b/VECTO3GUI2020/Util/AllowedEntry.cs @@ -0,0 +1,20 @@ +namespace VECTO3GUI2020.Util +{ + + public class AllowedEntry + { + public static AllowedEntry<T> Create<T>(T label, string description) + { + return new AllowedEntry<T> + { + Value = label, + Label = description + }; + } + } + public class AllowedEntry<T> + { + public string Label { get; set; } + public T Value { get; set; } + } +} diff --git a/VECTO3GUI2020/Util/Component.cs b/VECTO3GUI2020/Util/Component.cs new file mode 100644 index 0000000000000000000000000000000000000000..4799bc6244ebe9632df783194f3aa52052d0efed --- /dev/null +++ b/VECTO3GUI2020/Util/Component.cs @@ -0,0 +1,61 @@ +using TUGraz.VectoCommon.Resources; + +namespace VECTO3GUI2020.Util +{ + public enum Component + { + Vehicle = 1, + PrimaryBusVehicle, + Engine, + Gearbox, + TorqueConverter, + Retarder, + Angledrive, + Axlegear, + PTO, + Airdrag, + Axles, + Auxiliaries, + BusAuxiliaries, + 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 XMLNames.Component_Vehicle; + case Component.Engine: + return XMLNames.Component_Engine; + case Component.Gearbox: + return XMLNames.Component_Gearbox; + case Component.TorqueConverter: + return XMLNames.Component_TorqueConverter; + case Component.Retarder: + return XMLNames.Component_Retarder; + case Component.Angledrive: + return XMLNames.Component_Angledrive; + case Component.Axlegear: + return XMLNames.Component_Axlegear; + case Component.PTO: + return XMLNames.Vehicle_PTO; + case Component.Airdrag: + return XMLNames.Component_AirDrag; + case Component.Axles: + return XMLNames.AxleWheels_Axles_Axle; + case Component.Auxiliaries: + case Component.BusAuxiliaries: + return XMLNames.Component_Auxiliaries; + case Component.Cycle: + return nameof(Component.Cycle); + } + + return string.Empty; + } + } +} diff --git a/VECTO3GUI2020/Util/InheritingConstructorParameterInstanceProvider.cs b/VECTO3GUI2020/Util/InheritingConstructorParameterInstanceProvider.cs new file mode 100644 index 0000000000000000000000000000000000000000..9f1312c28050beee9f946e86af4aa1b7d6fb6ace --- /dev/null +++ b/VECTO3GUI2020/Util/InheritingConstructorParameterInstanceProvider.cs @@ -0,0 +1,30 @@ +using Ninject.Extensions.Factory; +using Ninject.Extensions.Factory.Factory; +using Ninject.Parameters; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Navigation; + +namespace VECTO3GUI2020.Util +{ + public class InheritingConstructorParameterInstanceProvider : StandardInstanceProvider + { + public override object GetInstance(IInstanceResolver instanceResolver, MethodInfo methodInfo, object[] arguments) + { + return base.GetInstance(instanceResolver, methodInfo, arguments.Skip(1).ToArray(); + } + + protected override IConstructorArgument[] GetConstructorArguments(MethodInfo methodInfo, object[] arguments) + { + //https://stackoverflow.com/questions/32138857/inherit-constructorparameter-from-a-factory + return methodInfo.GetParameters() + .Select((parameter, index) => + new ConstructorArgument( + parameter.Name, arguments[index], true)).Cast<IConstructorArgument>().ToArray(); + } + } +} diff --git a/VECTO3GUI2020/Util/RelayCommand.cs b/VECTO3GUI2020/Util/RelayCommand.cs new file mode 100644 index 0000000000000000000000000000000000000000..702384d99666b8eafa41b9d97b4d63584f147224 --- /dev/null +++ b/VECTO3GUI2020/Util/RelayCommand.cs @@ -0,0 +1,84 @@ +using System; +using System.Windows.Input; + +namespace VECTO3GUI2020.Util +{ + public class RelayCommand<T> : ICommand + { + + private readonly Action<T> _execute; + private readonly Predicate<T> _canExecute; + + + public event EventHandler CanExecuteChanged { + add + { + CommandManager.RequerySuggested += value; + } + remove + { + CommandManager.RequerySuggested -= value; + } + } + + public RelayCommand(Action<T> execute, Predicate<T> canExecute = null) + { + _execute = execute?? throw new ArgumentNullException(nameof(execute)); + _canExecute = canExecute; + } + + public bool CanExecute(object parameter) + { + return _canExecute != null ?_canExecute((T)parameter) : true; + } + + public void Execute(object parameter) + { + _execute((T)parameter); + } + } + + + + + + public class RelayCommand : ICommand + { + + + private readonly Action _execute; + private readonly Func<bool> _canExecute; + + public RelayCommand(Action execute, Func<bool> canExecute = null) + { + _execute = execute ?? throw new ArgumentNullException(nameof(execute)); + _canExecute = canExecute; + + + } + + public event EventHandler CanExecuteChanged + { + add + { + CommandManager.RequerySuggested += value; + } + + remove + { + CommandManager.RequerySuggested -= value; + } + } + + public bool CanExecute(object parameter) + { + return _canExecute != null ? _canExecute() : true ; + } + + public void Execute(object parameter) + { + _execute(); + } + + } +} diff --git a/VECTO3GUI2020/Util/SIUtils.cs b/VECTO3GUI2020/Util/SIUtils.cs new file mode 100644 index 0000000000000000000000000000000000000000..e1ab5528c59c79949e174e840099cc4e506a807e --- /dev/null +++ b/VECTO3GUI2020/Util/SIUtils.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Reflection; +using TUGraz.VectoCommon.Utils; + + +//Copied from VECTO3GUI franzjosefkober +namespace VECTO3GUI2020.Util +{ + public static class SIUtils + { + static readonly Dictionary<Type, Func<double, object>> Constructors = new Dictionary<Type, Func<double, object>>(); + + public static SI CreateSIValue(Type targetType, double value) + { + if (!typeof(SI).IsAssignableFrom(targetType)) { + return null; + } + + if (!Constructors.ContainsKey(targetType)) { + const BindingFlags bindingFlags = BindingFlags.NonPublic | BindingFlags.Instance; + var constructorInfo = targetType.GetConstructor(bindingFlags, null, new[] { typeof(double) }, null); + var param = Expression.Parameter(typeof(double)); + var expr = Expression.Lambda<Func<double, object>>(Expression.New(constructorInfo, param), param); + var constr = expr.Compile(); + Constructors[targetType] = constr; + } + + return (SI)Constructors[targetType](value); + } + } +} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAirDragWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAirDragWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..0156742325a64d3f6103dfb2fd4703ca71be7756 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAirDragWriter.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCore.InputData.FileIO.XML.Engineering.Interfaces; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter +{ + public abstract class XMLAirDragWriter : IXMLComponentWriter + { + protected IAirdragDeclarationInputData _inputData; + protected XNamespace _defaultNamespace; + protected XElement _xElement; + protected string _uri = "ToDO-Add-id"; + + public XMLAirDragWriter(IAirdragDeclarationInputData inputData) + { + _inputData = inputData; + } + + public XElement GetElement() + { + if (_xElement == null) { + + Initialize(); + CreateDataElements(); + _xElement.Add(this.CreateSignatureElement(_defaultNamespace, _uri, _inputData.DigestValue)); + } + + return _xElement; + } + protected abstract void Initialize(); + protected abstract void CreateDataElements(); + + + } + + public class XMLAirDragWriter_v2_0 : XMLAirDragWriter + { + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(AirDragViewModel_v2_0).ToString() + }; + public XMLAirDragWriter_v2_0(IAirdragDeclarationInputData inputData) : base(inputData) { } + protected override void CreateDataElements() + { + var dataElement = new XElement(_defaultNamespace + XMLNames.ComponentDataWrapper); + _xElement.Add(dataElement); + + dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri), new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.AirDrag_Data_Type_Attr)); + + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Date, _inputData.Date)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_AppVersion, _inputData.AppVersion)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.AirDrag_CdxA_0, _inputData.AirDragArea.ToXMLFormat(2))); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.AirDrag_TransferredCDxA, _inputData.AirDragArea.ToXMLFormat(2))); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.AirDrag_DeclaredCdxA, _inputData.AirDragArea.ToXMLFormat(2))); + + } + + protected override void Initialize() + { + _defaultNamespace = XMLNamespaces.V20; + _xElement = new XElement(_defaultNamespace + XMLNames.Component_AirDrag); + } + } +} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAuxiliariesWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAuxiliariesWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..aadcf95e8de288c0e7d0fa61dbb3fe40cba2cc71 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAuxiliariesWriter.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter +{ + public abstract class XMLAuxiliariesWriter : IXMLComponentWriter + { + protected XNamespace _defaultNamespace; + protected XElement _xElement; + protected IAuxiliariesDeclarationInputData _inputData; + + public XMLAuxiliariesWriter(IAuxiliariesDeclarationInputData inputData) + { + _inputData = inputData; + } + + public XElement GetElement() + { + if (_xElement == null) { + Initialize(); + CreateElements(); + } + + return _xElement; + } + public abstract void Initialize(); + + public abstract void CreateElements(); + } + + public class XMLAuxiliariesWriter_v2_0 : XMLAuxiliariesWriter + { + + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(AuxiliariesViewModel_v2_0).ToString() + }; + + public XMLAuxiliariesWriter_v2_0(IAuxiliariesDeclarationInputData inputData) : base(inputData) { } + + public override void CreateElements() + { + var dataElement = new XElement(_defaultNamespace + XMLNames.ComponentDataWrapper); + _xElement.Add(dataElement); + + dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Auxiliaries_Type_Attr_DataDeclarationType)); + + foreach (var auxiliary in _inputData.Auxiliaries) { + var auxElement = new XElement(_defaultNamespace + auxiliary.Type.ToString()); + auxElement.Add(new XElement(_defaultNamespace + XMLNames.Auxiliaries_Auxiliary_Technology, + auxiliary.Technology[0])); + dataElement.Add(auxElement); + } + } + + public override void Initialize() + { + _defaultNamespace = XMLNamespaces.V20; + _xElement = new XElement(_defaultNamespace + XMLNames.Component_Auxiliaries); + } + } +} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleGearWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleGearWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..d687eb07adb2732548f1aa3ebf22b92144a04d35 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleGearWriter.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter +{ + public abstract class XMLAxleGearWriter : IXMLComponentWriter + { + protected XElement _xElement; + protected IAxleGearInputData _inputData; + protected XNamespace _defaultNamespace; + protected string _uri = "ToDO-ADD_URI"; + + public XMLAxleGearWriter(IAxleGearInputData inputData) + { + _inputData = inputData; + + + } + + public abstract void Initialize(); + public abstract void CreateDataElements(); + + public XElement GetElement() + { + if (_xElement == null) { + Initialize(); + CreateDataElements(); + _xElement.Add(this.CreateSignatureElement(_defaultNamespace, _uri, _inputData.DigestValue)); + } + return _xElement; + } + } + + public class XMLAxleGearWriter_v2_0 : XMLAxleGearWriter + { + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(AxleGearViewModel_v2_0).ToString() + }; + + + public XMLAxleGearWriter_v2_0(IAxleGearInputData inputData) : base(inputData) + { + + } + + + public override void Initialize() + { + _defaultNamespace = XML.XMLNamespaces.V20; + _xElement = new XElement(_defaultNamespace + XMLNames.Component_Axlegear); + } + + public override void CreateDataElements() + { + var dataElement = new XElement(_defaultNamespace + XMLNames.ComponentDataWrapper); + _xElement.Add(dataElement); + + dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri)); + dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.AxleGear_Type_Attr)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Date, _inputData.Date)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_AppVersion, _inputData.AppVersion)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Axlegear_LineType, _inputData.LineType.ToXMLFormat())); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.AngleDrive_Ratio, _inputData.Ratio.ToXMLFormat(3))); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_CertificationMethod, _inputData.CertificationMethod.ToXMLFormat())); + + var torqueLossMap = new XElement(_defaultNamespace + XMLNames.Axlegear_TorqueLossMap); + dataElement.Add(torqueLossMap); + foreach (DataRow row in _inputData.LossMap.Rows) { + var entry = new XElement(_defaultNamespace + XMLNames.Axlegear_TorqueLossMap_Entry); + entry.Add(new XAttribute(XMLNames.TransmissionLossmap_InputSpeed_Attr, row[0].ToString())); + entry.Add(new XAttribute(XMLNames.TransmissionLossmap_InputTorque_Attr, row[1].ToString())); + entry.Add(new XAttribute(XMLNames.TransmissionLossmap_TorqueLoss_Attr, row[2].ToString())); + torqueLossMap.Add(entry); + } + } + } +} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleWheelWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleWheelWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..f52ba462826299b408bb0f7ef5b2fc9e6ea5e585 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleWheelWriter.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter +{ + public abstract class XMLAxleWheelWriter : IXMLComponentWriter + { + protected IXMLWriterFactory _writerFactory; + protected IAxleDeclarationInputData _inputData; + + protected XNamespace _defaultNamespace; + + protected XElement _xElement; + public XMLAxleWheelWriter(IAxleDeclarationInputData inputData, IXMLWriterFactory writerFactory) + { + _inputData = inputData; + _writerFactory = writerFactory; + } + + public XElement GetElement() + { + if (_xElement == null) { + Initialize(); + CreateElement(); + } + + return _xElement; + } + + protected abstract void CreateElement(); + protected abstract void Initialize(); + } + + + public class XMLAxleWheelWriter_v2_0 : XMLAxleWheelWriter + { + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(AxleViewModel_v2_0).ToString() + }; + public XMLAxleWheelWriter_v2_0(IAxleDeclarationInputData inputData, IXMLWriterFactory writerFactory) : base(inputData, writerFactory) { } + + protected override void CreateElement() + { + _xElement.Add(new XAttribute(XMLNames.AxleWheels_Axles_Axle_AxleNumber_Attr, 0));//_inputData.AxleNumber)); + _xElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Axle_Type_Attr_AxleDataDeclarationType)); + _xElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_AxleType, _inputData.AxleType)); + _xElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_TwinTyres, _inputData.TwinTyres)); + _xElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_Steered, false)); //_inputData.Steered)); + + _xElement.Add(_writerFactory.CreateComponentWriter(_inputData.Tyre).GetElement()); + } + + protected override void Initialize() + { + + _defaultNamespace = XML.XMLNamespaces.V20; + _xElement = new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle); + } + } +} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleWheelsWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleWheelsWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..9692c640c49e5768fbef6a98b2272a12016c933a --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLAxleWheelsWriter.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter +{ + public abstract class XMLAxleWheelsWriter : IXMLComponentWriter + { + protected XElement _xElement; + protected XNamespace _defaultNameSpace; + protected IAxlesDeclarationInputData _inputData; + protected IXMLWriterFactory _writerFactory; + + protected XMLAxleWheelsWriter(IAxlesDeclarationInputData inputData, IXMLWriterFactory writerFactory) + { + _inputData = inputData; + _writerFactory = writerFactory; + } + + public XElement GetElement() + { + if (_xElement == null) { + Initialize(); + CreateDataElements(); + } + + return _xElement; + } + + public abstract void CreateDataElements(); + public abstract void Initialize(); + } + + + public class XMLAxleWheelsWriter_v2_0 : XMLAxleWheelsWriter + { + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(AxleWheelsViewModel_v2_0).ToString() + }; + public override void CreateDataElements() + { + _xElement.Add(new XElement(_defaultNameSpace + XMLNames.ComponentDataWrapper)); + var dataElement = _xElement.LastNode as XElement; + + dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.AxleWheels_Type_Attr_AxleWheelsDeclarationType)); + + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.AxleWheels_Axles)); + var axles = dataElement.LastNode as XElement; + foreach (var axle in _inputData.AxlesDeclaration) { + axles.Add(_writerFactory.CreateComponentWriter(axle).GetElement()); + } + } + + public override void Initialize() + { + _defaultNameSpace = XML.XMLNamespaces.V20; + _xElement = new XElement(_defaultNameSpace + XMLNames.Component_AxleWheels); + } + + public XMLAxleWheelsWriter_v2_0(IAxlesDeclarationInputData inputData, IXMLWriterFactory writerFactory) : base(inputData, writerFactory) { } + } +} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLComponentsWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLComponentsWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..db6943a1f19d80c5993e1b9ad340085ac11eef99 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLComponentsWriter.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using TUGraz.IVT.VectoXML.Writer; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; +using EnvironmentVariableTarget = System.EnvironmentVariableTarget; + +namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter +{ + public abstract class XMLComponentsWriter : IXMLComponentsWriter + { + protected IXMLWriterFactory _xMLWriterFactory; + + protected XElement _xElement; + + protected static string _name = "Components"; + protected static readonly string _declarationDefinition = "urn:tugraz:ivt:VectoAPI:DeclarationDefinitions"; + protected static readonly XNamespace _xsi = XNamespace.Get("http://www.w3.org/2001/XMLSchema-instance"); + protected static readonly XNamespace _v10 = _declarationDefinition + ":v1.0"; + protected static readonly XNamespace _v20 = _declarationDefinition + ":v2.0"; + protected XNamespace _defaultNamespace; + protected IVehicleComponentsDeclaration _inputData; + + + public XMLComponentsWriter(IVehicleComponentsDeclaration inputData, IXMLWriterFactory xMLWriterFactory) + { + _inputData = inputData; + _xMLWriterFactory = xMLWriterFactory; + Initialize(); + CreateComponents(); + } + + + protected abstract void CreateComponents(); + public abstract XElement GetComponents(); + public abstract void Initialize(); + + + } + + public class XMLComponentsWriter_v1_0 : XMLComponentsWriter + { + + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(ComponentsViewModel_v1_0).ToString() + }; + public XMLComponentsWriter_v1_0(IVehicleComponentsDeclaration inputData, IXMLWriterFactory xMLWriterFactory) : + base(inputData, xMLWriterFactory) + { + + } + + protected override void CreateComponents() + { + throw new NotImplementedException(); + } + + public override XElement GetComponents() + { + throw new NotImplementedException(); + } + + public override void Initialize() + { + _defaultNamespace = _v10; + } + } + + + public class XMLComponentsWriter_v2_0 : XMLComponentsWriter_v1_0 + { + public new static readonly string[] SUPPORTED_VERSIONS = { + typeof(ComponentsViewModel_v2_0).ToString() + }; + + public XMLComponentsWriter_v2_0(IVehicleComponentsDeclaration inputData, IXMLWriterFactory xMLWriterFactory) : + base(inputData, xMLWriterFactory) + { + + } + + + protected override void CreateComponents() + { + Debug.Assert(_inputData is IComponentsViewModel); + IXMLComponentWriter writer; + if (_inputData.EngineInputData != null) { + writer = _xMLWriterFactory.CreateComponentWriter(_inputData.EngineInputData); + _xElement.Add(writer.GetElement()); + } + + if (_inputData.GearboxInputData != null) { + writer = _xMLWriterFactory.CreateComponentWriter(_inputData.GearboxInputData); + _xElement.Add(writer.GetElement()); + } + + if (_inputData.RetarderInputData != null) { + writer = _xMLWriterFactory.CreateComponentWriter(_inputData.RetarderInputData); + _xElement.Add(writer.GetElement()); + } + + if (_inputData.AxleGearInputData != null) { + writer = _xMLWriterFactory.CreateComponentWriter(_inputData.AxleGearInputData); + _xElement.Add(writer.GetElement()); + } + + if (_inputData.AxleWheels != null) { + writer = _xMLWriterFactory.CreateComponentWriter(_inputData.AxleWheels); + _xElement.Add(writer.GetElement()); + } + + if (_inputData.AuxiliaryInputData != null) { + writer = _xMLWriterFactory.CreateComponentWriter(_inputData.AuxiliaryInputData); + _xElement.Add(writer.GetElement()); + } + + if (_inputData.AirdragInputData != null) { + writer = _xMLWriterFactory.CreateComponentWriter(_inputData.AirdragInputData); + _xElement.Add(writer.GetElement()); + } + } + + public override XElement GetComponents() + { + return _xElement; + } + + public override void Initialize() + { + _defaultNamespace = XMLNamespaces.V20; + _xElement = new XElement(_defaultNamespace + XMLNames.Vehicle_Components); + _xElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, XMLNames.Components_type_attr)); + } + } +} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLEngineWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLEngineWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..e4a5e37542bc1d543feda92d6e24ebf6e8939969 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLEngineWriter.cs @@ -0,0 +1,160 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Diagnostics; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter +{ + public abstract class XMLEngineWriter : IXMLComponentWriter + { + protected XElement _xElement; + protected XNamespace _defaultNameSpace; + protected readonly IEngineDeclarationInputData _inputData; + protected string id = "toDo-Add-Identifier"; + + public XMLEngineWriter(IEngineDeclarationInputData inputData) + { + _inputData = inputData; + } + + public virtual XElement GetElement() + { + if (_xElement == null) { + Initialize(); + CreateDataElements(); + _xElement.Add(this.CreateSignatureElement(_defaultNameSpace, id, _inputData.DigestValue)); + } + + return _xElement; + } + + protected abstract void Initialize(); + protected abstract void CreateDataElements(); + + + } + + public class XMLEngineWriter_v1_0 : XMLEngineWriter + { + + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(EngineViewModel_v1_0).ToString() + }; + + + public override XElement GetElement() + { + throw new NotImplementedException(); + } + + protected override void Initialize() + { + throw new NotImplementedException(); + } + + protected override void CreateDataElements() + { + throw new NotImplementedException(); + } + + public XMLEngineWriter_v1_0(IEngineDeclarationInputData inputData) : base(inputData) { } + } + + public class XMLEngineWriter_v2_0 : XMLEngineWriter + { + private static XNamespace _v20 = XML.XMLNamespaces.V20; + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(EngineViewModel_v2_0).ToString(), + }; + + protected override void Initialize() + { + _defaultNameSpace = _v20; + _xElement = new XElement(_defaultNameSpace + XMLNames.Component_Engine); + } + + protected override void CreateDataElements() + { + var _dataXElement = new XElement(_defaultNameSpace + XMLNames.ComponentDataWrapper); + _xElement.Add(_dataXElement); + _dataXElement.Add(new XAttribute(XMLNames.Component_ID_Attr, id)); + _dataXElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Engine_Type_Attr)); + + Debug.Assert(_xElement != null); + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Model, _inputData.Model)); + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_CertificationNumber, + _inputData.CertificationNumber)); + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Date, _inputData.Date)); + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_AppVersion, _inputData.AppVersion)); + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_Displacement, _inputData.Displacement.ConvertToCubicCentiMeter().ToXMLFormat(0))); + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_IdlingSpeed, "100")); + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_RatedSpeed, _inputData.RatedSpeedDeclared.AsRPM.ToXMLFormat(0))); + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_RatedPower, _inputData.RatedPowerDeclared.ToXMLFormat(0))); + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_MaxTorque, _inputData.MaxTorqueDeclared.ToXMLFormat(0))); + + Debug.Assert(_inputData.EngineModes.Count == 1, "Only 1 Engine Mode supported in XMLEngineWriter_v2_0"); + var mode = _inputData.EngineModes[0]; + + Debug.Assert(mode.Fuels.Count == 1, "Only one fuel supported in XMLEngineWriter_v2_0"); + var fuel = mode.Fuels[0]; + + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_WHTCUrban, fuel.WHTCUrban.ToXMLFormat(4))); + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_WHTCRural, fuel.WHTCRural.ToXMLFormat(4))); + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_WHTCMotorway, fuel.WHTCMotorway.ToXMLFormat(4))); + + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_ColdHotBalancingFactor, fuel.ColdHotBalancingFactor.ToXMLFormat(4))); + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_CorrectionFactor_RegPer, fuel.CorrectionFactorRegPer.ToXMLFormat(4))); + + + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_CorrecionFactor_NCV, "1.0000")); + + _dataXElement.Add(new XElement(_defaultNameSpace + XMLNames.Engine_FuelType, fuel.FuelType.ToXMLFormat())); + + var fuelConsumptionMapElement = new XElement(_defaultNameSpace + XMLNames.Engine_FuelConsumptionMap); + var tableData = fuel.FuelConsumptionMap; + + foreach (DataRow fuelEntry in tableData.Rows) { + var entry = new XElement(_defaultNameSpace + XMLNames.Engine_FuelConsumptionMap_Entry); + entry.Add(new XAttribute(XMLNames.Engine_FuelConsumptionMap_EngineSpeed_Attr, fuelEntry.ItemArray[0])); + entry.Add(new XAttribute(XMLNames.Engine_FuelConsumptionMap_Torque_Attr, fuelEntry.ItemArray[1])); + entry.Add(new XAttribute(XMLNames.Engine_FuelConsumptionMap_FuelConsumption_Attr, fuelEntry.ItemArray[2])); + fuelConsumptionMapElement.Add(entry); + } + _dataXElement.Add(fuelConsumptionMapElement); + + var fullLoadAndDragCurveElement = new XElement(_defaultNameSpace + XMLNames.Engine_FullLoadAndDragCurve); + tableData = mode.FullLoadCurve; + foreach (DataRow loadAndDragEntry in tableData.Rows) { + var entry = new XElement(_defaultNameSpace + XMLNames.Engine_FullLoadCurve_Entry); + entry.Add(new XAttribute(XMLNames.Engine_EngineFullLoadCurve_EngineSpeed_Attr, loadAndDragEntry.ItemArray[0])); + entry.Add(new XAttribute(XMLNames.Engine_FullLoadCurve_MaxTorque_Attr, loadAndDragEntry.ItemArray[1])); + entry.Add(new XAttribute(XMLNames.Engine_FullLoadCurve_DragTorque_Attr, loadAndDragEntry.ItemArray[2])); + fullLoadAndDragCurveElement.Add(entry); + } + _dataXElement.Add(fullLoadAndDragCurveElement); + } + + + + public XMLEngineWriter_v2_0(IEngineDeclarationInputData inputData) : base(inputData) + { + + } + } +} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLGearboxWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLGearboxWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..4fed42688b1d8666740e171164e99f0e9d930e58 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLGearboxWriter.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter +{ + public abstract class XMLGearboxWriter : IXMLComponentWriter + { + protected IGearboxDeclarationInputData _inputData; + protected XElement _xElement; + protected XNamespace _defaultNameSpace; + protected string _uri = "toDo-Adduri"; + + public XMLGearboxWriter(IGearboxDeclarationInputData inputData) + { + + _inputData = inputData; + } + + public virtual XElement GetElement() + { + if (_xElement == null) { + Initialize(); + CreateDataElements(); + _xElement.Add(this.CreateSignatureElement(_defaultNameSpace, _uri, _inputData.DigestValue)); + } + return _xElement; + } + + protected abstract void Initialize(); + protected abstract void CreateDataElements(); + } + public class XMLGearboxWriter_v2_0 : XMLGearboxWriter + { + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(GearboxViewModel_v2_0).ToString() + }; + + public XMLGearboxWriter_v2_0(IGearboxDeclarationInputData inputData) : base(inputData) + { + } + + protected override void Initialize() + { + _defaultNameSpace = XML.XMLNamespaces.V20; + _xElement = new XElement(_defaultNameSpace + XMLNames.Component_Gearbox); + } + + protected override void CreateDataElements() + { + var dataElement = new XElement(_defaultNameSpace + XMLNames.ComponentDataWrapper); + _xElement.Add(dataElement); + dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri)); + dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Gearbox_attr_GearboxDataDeclarationType)); + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Model, _inputData.Model)); + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Date, _inputData.Date)); + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_AppVersion, _inputData.AppVersion)); + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_TransmissionType, _inputData.Type.ToXMLFormat())); + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Gearbox_CertificationMethod, _inputData.CertificationMethod.ToXMLFormat())); + + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gears)); + var gearsElement = dataElement.LastNode as XElement; + gearsElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, XMLNames.Gearbox_Gears_Attr_GearsDeclarationType)); + foreach (var gear in _inputData.Gears) { + gearsElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gears_Gear)); + var gearElement = gearsElement.LastNode as XElement; + //var gearElement = new XElement(_defaultNameSpace + XMLNames.Gearbox_Gears_Gear); + //gearsElement.Add(gearElement); + gearElement.Add(new XAttribute(XMLNames.Gearbox_Gear_GearNumber_Attr, gear.Gear)); + gearElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gear_Ratio, gear.Ratio.ToXMLFormat(3))); + + if (gear.MaxTorque != null) { + gearElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gears_MaxTorque, gear.MaxTorque)); + } + + if (gear.MaxInputSpeed != null) { + gearElement.Add(new XElement(_defaultNameSpace + XMLNames.Gearbox_Gear_MaxSpeed, gear.MaxInputSpeed)); + } + + var torqueLossMapElement = new XElement(_defaultNameSpace + XMLNames.Gearbox_Gear_TorqueLossMap); + gearElement.Add(torqueLossMapElement); + foreach (DataRow torquelossEntry in gear.LossMap.Rows) { + var entry = new XElement(_defaultNameSpace + XMLNames.Gearbox_Gear_TorqueLossMap_Entry); + torqueLossMapElement.Add(entry); + entry.Add(new XAttribute(XMLNames.TransmissionLossmap_InputSpeed_Attr, torquelossEntry[0].ToString())); + entry.Add(new XAttribute(XMLNames.TransmissionLossmap_InputTorque_Attr, torquelossEntry[1].ToString())); + entry.Add(new XAttribute(XMLNames.TransmissionLossmap_TorqueLoss_Attr, torquelossEntry[2].ToString())); + + } + } + Debug.WriteLine(_xElement.ToString()); + } + + + } +} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLPTOWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLPTOWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..e6794a06e0ff0fee1ae506af44980f96bcb6186b --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLPTOWriter.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter +{ + public abstract class XMLPTOWriter : IXMLComponentWriter + { + protected XElement _xElement; + protected XNamespace _defaultNamespace; + private IPTOTransmissionInputData _inputData; + + public XMLPTOWriter(IPTOTransmissionInputData inputData) + { + _inputData = inputData; + Initialize(); + CreateElements(); + } + + + + public XElement GetElement() + { + return _xElement; + } + + protected abstract void Initialize(); + protected abstract void CreateElements(); + } + + public class XMLPTOWriter_v1_0 : XMLPTOWriter + { + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(PTOViewModel_V1_0).ToString() + }; + + public XMLPTOWriter_v1_0(IPTOTransmissionInputData inputData) : base(inputData) { } + + protected override void Initialize() + { + + throw new NotImplementedException(); + } + + protected override void CreateElements() + { + throw new NotImplementedException(); + } + } + + + + + public class XMLPTOWriter_v2_0 : XMLPTOWriter_v1_0 + { + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(PTOViewModel_V2_0).ToString() + }; + + public XMLPTOWriter_v2_0(IPTOTransmissionInputData inputData) : base(inputData) { } + + protected override void Initialize() + { + _defaultNamespace = XMLNamespaces.V20; + _xElement = new XElement(_defaultNamespace + XMLNames.Vehicle_PTO); + _xElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, XMLNames.Component_Type_Attr_PTO)); + } + + protected override void CreateElements() + { + _xElement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_PTO_ShaftsGearWheels, "none")); + _xElement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_PTO_OtherElements, "none")); + } + } + + +} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLRetarderWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLRetarderWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..f75d43a420b938fe62e3b6c374b85842c7b4999c --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLRetarderWriter.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Resources; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter +{ + public abstract class XMLRetarderWriter : IXMLComponentWriter + { + protected XElement _xElement; + protected IRetarderInputData _inputData; + protected XNamespace _defaultNameSpace; + protected string _uri = "toTo-Add-URI"; + + public XMLRetarderWriter(IRetarderInputData inputData) + { + _inputData = inputData; + } + + protected abstract void Initialize(); + protected abstract void CreateDataElements(); + + public XElement GetElement() + { + if (_xElement == null) { + Initialize(); + CreateDataElements(); + _xElement.Add(this.CreateSignatureElement(_defaultNameSpace, _uri, _inputData.DigestValue)); + } + return _xElement; + } + } + + public class XMLRetarderWriter_v1_0 : XMLRetarderWriter + { + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(RetarderViewModel_v1_0).ToString() + }; + + protected override void Initialize() + { + _defaultNameSpace = XML.XMLNamespaces.V10; + _xElement = new XElement(_defaultNameSpace + XMLNames.Component_Retarder); + } + + protected override void CreateDataElements() + { + var dataElement = new XElement(_defaultNameSpace + XMLNames.ComponentDataWrapper); + _xElement.Add(dataElement); + + dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri)); + dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, XMLNames.Retarder_Attr_DataDeclarationType)); + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Model, _inputData.Model)); + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_Date, _inputData.Date)); + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_AppVersion, _inputData.AppVersion)); + dataElement.Add(new XElement(_defaultNameSpace + XMLNames.Component_CertificationMethod, _inputData.CertificationMethod.ToXMLFormat())); + + var lossMapElement = new XElement(_defaultNameSpace + XMLNames.Retarder_RetarderLossMap); + dataElement.Add(lossMapElement); + + foreach (DataRow lossMapRow in _inputData.LossMap.Rows) + { + var entryElement = new XElement(_defaultNameSpace + XMLNames.Retarder_RetarderLossMap_Entry); + entryElement.Add(new XAttribute(XMLNames.Retarder_RetarderLossmap_RetarderSpeed_Attr, lossMapRow[0].ToString())); + entryElement.Add(new XAttribute(XMLNames.Retarder_RetarderLossmap_TorqueLoss_Attr, lossMapRow[1].ToString())); + lossMapElement.Add(entryElement); + } + } + + public XMLRetarderWriter_v1_0(IRetarderInputData inputData) : base(inputData) { } + } + + + + public class XMLRetarderWriter_v2_0 : XMLRetarderWriter_v1_0 + { + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(RetarderViewModel_v2_0).ToString() + }; + + + public XMLRetarderWriter_v2_0(IRetarderInputData inputData) : base(inputData) + { + + } + + + + protected override void Initialize() + { + _defaultNameSpace = XML.XMLNamespaces.V20; + _xElement = new XElement(_defaultNameSpace + XMLNames.Component_Retarder); + } + } +} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLTyreWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLTyreWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..7e10b6ed70f53fca7a91ffceefed4773135c57ff --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLTyreWriter.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.Util.XML.Implementation.ComponentWriter +{ + public abstract class XMLTyreWriter : IXMLComponentWriter + { + protected ITyreDeclarationInputData _inputData; + + protected XNamespace _defaultNamespace; + protected XElement _xElement; + protected string _uri = "ToDo-Add-Id"; + + public XMLTyreWriter(ITyreDeclarationInputData inputData) + { + _inputData = inputData; + } + + public XElement GetElement() + { + if (_xElement == null) { + Initialize(); + CreateDataElements(); + _xElement.Add(this.CreateSignatureElement(_defaultNamespace, _uri, _inputData.DigestValue)); + } + + return _xElement; + } + protected abstract void Initialize(); + protected abstract void CreateDataElements(); + + + + + + } + + public class XMLTyreWriter_v2_0 : XMLTyreWriter + { + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(TyreViewModel_v2_0).ToString() + }; + + public XMLTyreWriter_v2_0(ITyreDeclarationInputData inputData) : base(inputData) { } + protected override void CreateDataElements() + { + var dataElement = new XElement(_defaultNamespace + XMLNames.ComponentDataWrapper); + _xElement.Add(dataElement); + + dataElement.Add(new XAttribute(XMLNames.Component_ID_Attr, _uri)); + dataElement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Component_Type_Attr, XMLNames.Tyre_Type_Attr_TyreDataDeclarationType)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_CertificationNumber, _inputData.CertificationNumber)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_Date, _inputData.Date)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.Component_AppVersion, _inputData.AppVersion)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_Dimension, _inputData.Dimension)); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_RRCDeclared, _inputData.RollResistanceCoefficient.ToXMLFormat(4))); + dataElement.Add(new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_FzISO, _inputData.TyreTestLoad.ToXMLFormat(0))); + } + + protected override void Initialize() + { + _defaultNamespace = XML.XMLNamespaces.V20; + _xElement = new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_Tyre); + } + + } + + public class XMLTyreWriter_v2_3 : XMLTyreWriter_v2_0 + { + public new static readonly string[] SUPPORTED_VERSIONS = { + typeof(TyreViewModel_v2_3).ToString() + }; + public XMLTyreWriter_v2_3(ITyreDeclarationInputData inputData) : base(inputData) { } + + protected override void CreateDataElements() + { + base.CreateDataElements(); + + } + + protected override void Initialize() + { + _defaultNamespace = XML.XMLNamespaces.V23; + _xElement = new XElement(_defaultNamespace + XMLNames.AxleWheels_Axles_Axle_Tyre); + } + } + +} diff --git a/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLVehicleWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLVehicleWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..8090a5e16cf82193f3d65b965e29958c1954cb75 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Implementation/ComponentWriter/XMLVehicleWriter.cs @@ -0,0 +1,187 @@ +using System; +using System.Diagnostics; +using System.Xml.Linq; +using TUGraz.IVT.VectoXML.Writer; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; + +namespace VECTO3GUI2020.Util.XML.Implementation +{ + public abstract class XMLVehicleWriter : IXMLVehicleWriter + { + + + + #region XML + protected XElement _Xelement; + + protected XNamespace _defaultNamespace; + #endregion + + //Template Methods + protected abstract void Initialize(); + protected abstract void CreateElements(); + + protected readonly IVehicleDeclarationInputData _inputData; + protected IXMLWriterFactory _xmlWriterFactory; + + public XMLVehicleWriter(IVehicleDeclarationInputData inputData, IXMLWriterFactory xmlWriterFactory) + { + Debug.Assert(inputData != null); + this._inputData = inputData; + _xmlWriterFactory = xmlWriterFactory; + } + + + + public XElement GetElement() + { + if (_Xelement == null) { + Initialize(); + + CreateElements(); + } + return _Xelement; + } + } + public class XMLVehicleWriter_v1_0 : XMLVehicleWriter + { + public static readonly string[] SUPPORTEDVERSIONS = { + typeof(XMLDeclarationVehicleDataProviderV10).ToString(), + typeof(VehicleViewModel_v1_0).ToString() + }; + + public XMLVehicleWriter_v1_0(IVehicleDeclarationInputData inputData, IXMLWriterFactory xmlWriterFactory) : base(inputData, xmlWriterFactory) + { + + } + + protected override void CreateElements() + { + throw new NotImplementedException(); + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer), + new XElement(_defaultNamespace + XMLNames.Component_ManufacturerAddress, + _inputData.ManufacturerAddress), + new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model), + new XElement(_defaultNamespace + XMLNames.Vehicle_VIN, _inputData.VIN), + new XElement(_defaultNamespace + XMLNames.Component_Date, _inputData.Date), + new XElement(_defaultNamespace + XMLNames.Vehicle_LegislativeClass, _inputData.LegislativeClass), + new XElement(_defaultNamespace + XMLNames.Vehicle_AxleConfiguration, + AxleConfigurationHelper.ToXMLFormat(_inputData.AxleConfiguration)), + new XElement(_defaultNamespace + XMLNames.Vehicle_CurbMassChassis, + _inputData.CurbMassChassis.ToXMLFormat()), + new XElement(_defaultNamespace + XMLNames.Vehicle_GrossVehicleMass, + _inputData.GrossVehicleMassRating.ToXMLFormat()), + new XElement(_defaultNamespace + XMLNames.Vehicle_IdlingSpeed, + _inputData.EngineIdleSpeed.ToXMLFormat())); + + //new XElement(_defaultNamespace + XMLNames.Vehicle_RetarderType, _inputData.RetarderType.ToXMLFormat()), + + //_inputData.RetarderRatio == null ? null : new XElement(_defaultNamespace + XMLNames.Vehicle_RetarderRatio, _inputData.RetarderRatio), + + //new XElement(_defaultNamespace + XMLNames.Vehicle_AngledriveType, _inputData.AngledriveType.ToXMLFormat()), + + + //https://stackoverflow.com/questions/24743916/how-to-convert-xmlnode-into-xelement + //Remove this when PTOType is handled correct. + //XElement.Load(_inputData.PTONode.CreateNavigator().ReadSubtree()), + + //new XElement(_defaultNamespace + XMLNames.Vehicle_Components, + // new XAttribute(_xsi + "type", ComponentsXSD)) + + + //); + + + } + + protected override void Initialize() + { + throw new NotImplementedException(); + } + } + + + public class XMLVehicleWriter_v2_0 : XMLVehicleWriter_v1_0 + { + public new static readonly string[] SUPPORTEDVERSIONS = { + typeof(XMLDeclarationVehicleDataProviderV10).ToString(), + typeof(VehicleViewModel_v2_0).ToString() + }; + + public XMLVehicleWriter_v2_0(IVehicleDeclarationInputData inputData, IXMLWriterFactory xmlWriterFactory) : base(inputData, xmlWriterFactory) + { + + + } + + protected override void CreateElements() + { + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Component_Manufacturer, _inputData.Manufacturer)); + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Component_ManufacturerAddress, + _inputData.ManufacturerAddress)); + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Component_Model, _inputData.Model)); + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_VIN, _inputData.VIN)); + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Component_Date, _inputData.Date)); + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_LegislativeClass, + _inputData.LegislativeClass)); + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_VehicleCategory, _inputData.VehicleCategory)); + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_AxleConfiguration, + _inputData.AxleConfiguration.ToXMLFormat())); + + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_CurbMassChassis, _inputData.CurbMassChassis.ToXMLFormat(0))); + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_GrossVehicleMass, + _inputData.GrossVehicleMassRating.ToXMLFormat(0))); + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_IdlingSpeed, + _inputData.EngineIdleSpeed.AsRPM.ToXMLFormat(0))); + + //TODO: Remove when IVehicleDeclarationInputData is updated + if (_inputData is IVehicleViewModel viewModelInputData) { + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_RetarderType, + viewModelInputData.RetarderType.ToXMLFormat())); + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_RetarderRatio, viewModelInputData.RetarderRatio.ToXMLFormat(3))); + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_AngledriveType, + viewModelInputData.AngledriveType.ToXMLFormat())); + _Xelement.Add(_xmlWriterFactory.CreateComponentWriter(viewModelInputData.PTOTransmissionInputData) + .GetElement()); + } else { + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_RetarderType, + RetarderType.None.ToXMLFormat())); + //_Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_RetarderRatio, "1.000")); + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_AngledriveType, + AngledriveType.None.ToXMLFormat())); + _Xelement.Add(new XElement(_defaultNamespace + XMLNames.Vehicle_PTO, + new XElement(_defaultNamespace + XMLNames.Vehicle_PTO_ShaftsGearWheels, "none"), + new XElement(_defaultNamespace + XMLNames.Vehicle_PTO_OtherElements, "none"))); + } + + + + _Xelement.Add(_xmlWriterFactory.CreateComponentsWriter(_inputData.Components).GetComponents()); + } + + protected override void Initialize() + { + _defaultNamespace = XMLNamespaces.V20; + _Xelement = new XElement(_defaultNamespace + XMLNames.Component_Vehicle); + _Xelement.Add(new XAttribute(XMLNames.Component_ID_Attr, _inputData.Identifier)); + _Xelement.Add(new XAttribute(XMLNamespaces.Xsi + XMLNames.Attr_Type, XMLNames.VehicleAttr_VehicleDeclarationType)); + } + } + + public class XMLVehicleWriter_v2_1 { } + + public class XMLVehicleWriter_v2_7 { } + + public class XMLVehicleWriter_PrimaryBus_v2_6 {} + + public class XMLVehicleWriter_ExcemptedVehicle_v2_2 { } + +} diff --git a/VECTO3GUI2020/Util/XML/Implementation/DocumentWriter/XMLDeclarationJobWriter.cs b/VECTO3GUI2020/Util/XML/Implementation/DocumentWriter/XMLDeclarationJobWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..d89fa6b4cb93877e6eb31b0340db0e7316730f2c --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Implementation/DocumentWriter/XMLDeclarationJobWriter.cs @@ -0,0 +1,99 @@ +using System; +using System.Diagnostics; +using System.Xml; +using System.Xml.Linq; +using Castle.Components.DictionaryAdapter.Xml; +using TUGraz.IVT.VectoXML.Writer; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Resources; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit; + +namespace VECTO3GUI2020.Util.XML.Implementation.DocumentWriter +{ + public abstract class XMLDeclarationJobWriter : IXMLDeclarationJobWriter + { + + protected XDocument _xDocument; + protected string _schemaVersion; + private IXMLWriterFactory _xmlWriterFactory; + + protected string LocalSchemaLocation = @"V:\VectoCore\VectoCore\Resources\XSD\"; + + //Must be overwritten by subclasses; + protected abstract void Initialize(); + + + + public XMLDeclarationJobWriter(IDeclarationJobInputData inputData, IXMLWriterFactory xmlWriterFactory) + { + _xmlWriterFactory = xmlWriterFactory; + Initialize(); + + (_xDocument.FirstNode as XElement)?.Add(_xmlWriterFactory.CreateVehicleWriter(inputData.Vehicle).GetElement()); + var rootElement = _xDocument.FirstNode as XElement; + + } + + + + + + public XDocument GetDocument() + { + return _xDocument; + } + } + + + public class XMLDeclarationJobWriter_v1_0 : XMLDeclarationJobWriter + { + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(XMLDeclarationJobInputDataProviderV10).ToString() + }; + public XMLDeclarationJobWriter_v1_0(IDeclarationJobInputData inputData, IXMLWriterFactory xmlWriterFactory) : base(inputData, xmlWriterFactory) + { + + } + protected override void Initialize() + { + throw new NotImplementedException(); + } + + + } + + public class XMLDeclarationJobWriter_v2_0 : XMLDeclarationJobWriter + { + + public static readonly string[] SUPPORTED_VERSIONS = { + typeof(DeclarationJobEditViewModel_v2_0).ToString(), + typeof(XMLDeclarationJobInputDataProviderV20).ToString() + }; + + public XMLDeclarationJobWriter_v2_0(IDeclarationJobInputData inputData, IXMLWriterFactory xmlWriterFactory) : base(inputData, xmlWriterFactory) + { + + } + + protected override void Initialize() + { + _schemaVersion = "2.0"; + _xDocument = new XDocument(); + + var xElement = new XElement(XMLNamespaces.Tns_v20 + XMLNames.VectoInputDeclaration); + _xDocument.Add(xElement); + + xElement.Add(new XAttribute("schemaVersion", _schemaVersion)); + xElement.Add(new XAttribute("xmlns", XMLNamespaces.DeclarationDefinition + ":v" + _schemaVersion)); + xElement.Add(new XAttribute(XNamespace.Xmlns + "xsi", XMLNamespaces.Xsi.NamespaceName)); + xElement.Add(new XAttribute(XNamespace.Xmlns + "tns", XMLNamespaces.Tns_v20)); + xElement.Add(new XAttribute(XMLNamespaces.Xsi + "schemaLocation", + $"{XMLNamespaces.DeclarationRootNamespace} {LocalSchemaLocation}VectoDeclarationJob.xsd")); + + Debug.WriteLine(_xDocument.ToString()); + } + } + +} diff --git a/VECTO3GUI2020/Util/XML/Interfaces/IXMLComponentWriter.cs b/VECTO3GUI2020/Util/XML/Interfaces/IXMLComponentWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..ac5bf9d65c69cbaa91fd525c159c953264fbfc2b --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Interfaces/IXMLComponentWriter.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace VECTO3GUI2020.Util.XML.Interfaces +{ + public interface IXMLComponentWriter + { + XElement GetElement(); + } +} diff --git a/VECTO3GUI2020/Util/XML/Interfaces/IXMLComponentsWriter.cs b/VECTO3GUI2020/Util/XML/Interfaces/IXMLComponentsWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..5ac14496747748a0b6138f2d71985a60969ca752 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Interfaces/IXMLComponentsWriter.cs @@ -0,0 +1,9 @@ +using System.Xml.Linq; + +namespace VECTO3GUI2020.Util.XML.Interfaces +{ + public interface IXMLComponentsWriter + { + XElement GetComponents(); + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/Util/XML/Interfaces/IXMLDeclarationJobWriter.cs b/VECTO3GUI2020/Util/XML/Interfaces/IXMLDeclarationJobWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..b9854e0d632f9153a06c453001a5550d1655ab0f --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Interfaces/IXMLDeclarationJobWriter.cs @@ -0,0 +1,9 @@ +using System.Xml.Linq; + +namespace VECTO3GUI2020.Util.XML.Interfaces +{ + public interface IXMLDeclarationJobWriter + { + XDocument GetDocument(); + } +} diff --git a/VECTO3GUI2020/Util/XML/Interfaces/IXMLVehicleWriter.cs b/VECTO3GUI2020/Util/XML/Interfaces/IXMLVehicleWriter.cs new file mode 100644 index 0000000000000000000000000000000000000000..6af7fe70e31c41004a7aaf81af669baabdbd809f --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Interfaces/IXMLVehicleWriter.cs @@ -0,0 +1,9 @@ +using System.Xml.Linq; + +namespace VECTO3GUI2020.Util.XML.Interfaces +{ + public interface IXMLVehicleWriter + { + XElement GetElement(); + } +} diff --git a/VECTO3GUI2020/Util/XML/Interfaces/IXMLWriterFactory.cs b/VECTO3GUI2020/Util/XML/Interfaces/IXMLWriterFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..aca85fc6179225530ab42bf6a87313c5ad54013c --- /dev/null +++ b/VECTO3GUI2020/Util/XML/Interfaces/IXMLWriterFactory.cs @@ -0,0 +1,21 @@ +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using TUGraz.VectoCore.OutputData.XML.Engineering.Interfaces; +using TUGraz.VectoCore.OutputData.XML.Engineering.Writer; + +namespace VECTO3GUI2020.Util.XML.Interfaces +{ + public interface IXMLWriterFactory + { + IXMLDeclarationJobWriter CreateJobWriter(IDeclarationJobInputData inputData); + IXMLVehicleWriter CreateVehicleWriter(IVehicleDeclarationInputData inputData); + IXMLComponentWriter CreateComponentWriter(IComponentInputData inputData); + IXMLComponentWriter CreateComponentWriter(IAuxiliariesDeclarationInputData inputData); + IXMLComponentWriter CreateComponentWriter(IAxlesDeclarationInputData inputData); + IXMLComponentWriter CreateComponentWriter(IAxleDeclarationInputData inputData); + IXMLComponentWriter CreateComponentWriter(IAirdragDeclarationInputData inputData); + + IXMLComponentWriter CreateComponentWriter(IPTOTransmissionInputData inputData); + IXMLComponentsWriter CreateComponentsWriter(IVehicleComponentsDeclaration inputData); + } +} diff --git a/VECTO3GUI2020/Util/XML/XMLNamespaces.cs b/VECTO3GUI2020/Util/XML/XMLNamespaces.cs new file mode 100644 index 0000000000000000000000000000000000000000..f2852d486bea1bbc2e2444933b36afcc02cc1313 --- /dev/null +++ b/VECTO3GUI2020/Util/XML/XMLNamespaces.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace VECTO3GUI2020.Util.XML +{ + public static class XMLNamespaces + { + public static readonly string DeclarationDefinition = "urn:tugraz:ivt:VectoAPI:DeclarationDefinitions"; + public static readonly string SchemaVersion = "2.0"; + public static XNamespace Xsi = XNamespace.Get("http://www.w3.org/2001/XMLSchema-instance"); + public static XNamespace Tns = "urn:tugraz:ivt:VectoAPI:DeclarationInput"; + public static XNamespace Tns_v20 = Tns.NamespaceName + ":v2.0"; + public static XNamespace V26 = DeclarationDefinition + ":DEV:v2.6"; + public static XNamespace V21 = DeclarationDefinition + ":v2.1"; + public static XNamespace V23 = DeclarationDefinition + ":v2.3"; + public static XNamespace V20 = DeclarationDefinition + ":v2.0"; + public static XNamespace V10 = DeclarationDefinition + ":v1.0"; + public static XNamespace Di = "http://www.w3.org/2000/09/xmldsig#"; + + + public static string DeclarationRootNamespace = "urn:tugraz:ivt:VectoAPI:DeclarationJob"; + + + } +} diff --git a/VECTO3GUI2020/VECTO3GUI2020.csproj b/VECTO3GUI2020/VECTO3GUI2020.csproj new file mode 100644 index 0000000000000000000000000000000000000000..b61f39615c91dc7a2ff28878d30f3ac768bc1705 --- /dev/null +++ b/VECTO3GUI2020/VECTO3GUI2020.csproj @@ -0,0 +1,652 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{7E9172D4-07E3-4077-814E-7117AB2B3E22}</ProjectGuid> + <OutputType>WinExe</OutputType> + <RootNamespace>VECTO3GUI2020</RootNamespace> + <AssemblyName>VECTO3GUI2020</AssemblyName> + <TargetFrameworkVersion>v4.8</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <WarningLevel>4</WarningLevel> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <Deterministic>true</Deterministic> + <PublishUrl>publish\</PublishUrl> + <Install>true</Install> + <InstallFrom>Disk</InstallFrom> + <UpdateEnabled>false</UpdateEnabled> + <UpdateMode>Foreground</UpdateMode> + <UpdateInterval>7</UpdateInterval> + <UpdateIntervalUnits>Days</UpdateIntervalUnits> + <UpdatePeriodically>false</UpdatePeriodically> + <UpdateRequired>false</UpdateRequired> + <MapFileExtensions>true</MapFileExtensions> + <ApplicationRevision>0</ApplicationRevision> + <ApplicationVersion>1.0.0.%2a</ApplicationVersion> + <IsWebBootstrapper>false</IsWebBootstrapper> + <UseApplicationTrust>false</UseApplicationTrust> + <BootstrapperEnabled>true</BootstrapperEnabled> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup> + <ApplicationIcon>Resources\Icon2.ico</ApplicationIcon> + </PropertyGroup> + <ItemGroup> + <Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> + <HintPath>..\packages\Castle.Core.4.4.1\lib\net45\Castle.Core.dll</HintPath> + </Reference> + <Reference Include="InteractiveDataDisplay.WPF, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\InteractiveDataDisplay.WPF.1.0.0\lib\net452\InteractiveDataDisplay.WPF.dll</HintPath> + </Reference> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="Microsoft.Maps.MapControl.WPF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\packages\Microsoft.Maps.MapControl.WPF.1.0.0.3\lib\net40-Client\Microsoft.Maps.MapControl.WPF.dll</HintPath> + </Reference> + <Reference Include="Microsoft.VisualStudio.DebuggerVisualizers, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> + <Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\WindowsAPICodePack-Core.1.1.2\lib\Microsoft.WindowsAPICodePack.dll</HintPath> + </Reference> + <Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\WindowsAPICodePack-Shell.1.1.1\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath> + </Reference> + <Reference Include="Ninject, Version=3.3.4.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL"> + <HintPath>..\packages\Ninject.3.3.4\lib\net45\Ninject.dll</HintPath> + </Reference> + <Reference Include="Ninject.Extensions.ChildKernel, Version=3.3.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL"> + <HintPath>..\packages\Ninject.Extensions.ChildKernel.3.3.0\lib\net45\Ninject.Extensions.ChildKernel.dll</HintPath> + </Reference> + <Reference Include="Ninject.Extensions.Factory, Version=3.3.3.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL"> + <HintPath>..\packages\Ninject.Extensions.Factory.3.3.3\lib\net45\Ninject.Extensions.Factory.dll</HintPath> + </Reference> + <Reference Include="PresentationFramework.Aero2" /> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Reactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Reactive.5.0.0\lib\net472\System.Reactive.dll</HintPath> + </Reference> + <Reference Include="System.Reactive.Core, Version=3.0.6000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Reactive.Core.5.0.0\lib\net472\System.Reactive.Core.dll</HintPath> + </Reference> + <Reference Include="System.Reactive.Linq, Version=3.0.6000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Reactive.Linq.5.0.0\lib\net472\System.Reactive.Linq.dll</HintPath> + </Reference> + <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath> + </Reference> + <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath> + </Reference> + <Reference Include="System.Windows" /> + <Reference Include="System.Windows.Controls.DataVisualization.Toolkit, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\packages\System.Windows.Controls.DataVisualization.Toolkit.4.0.0.0\lib\net40-Client\System.Windows.Controls.DataVisualization.Toolkit.dll</HintPath> + </Reference> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="System.Xaml"> + <RequiredTargetFramework>4.0</RequiredTargetFramework> + </Reference> + <Reference Include="WindowsBase" /> + <Reference Include="PresentationCore" /> + <Reference Include="PresentationFramework" /> + </ItemGroup> + <ItemGroup> + <ApplicationDefinition Include="App.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </ApplicationDefinition> + <Compile Include="Helper\Converter\AlwaysVisibleConverter.cs" /> + <Compile Include="Helper\Converter\BoolToVisibilityConverter.cs" /> + <Compile Include="Helper\Converter\InvertBoolConverter.cs" /> + <Compile Include="Helper\Converter\JobTypeStringConverter.cs" /> + <Compile Include="Helper\Converter\LabledTextBoxLabelConverter.cs" /> + <Compile Include="Helper\Converter\NullToVisibilityConverter.cs" /> + <Compile Include="Helper\Converter\LabledTextBoxConverter.cs" /> + <Compile Include="Helper\Converter\SIToUnitString.cs" /> + <Compile Include="Helper\Converter\SIValueToStringConverter.cs" /> + <Compile Include="Helper\Converter\VehicleCategoryToStringConverter.cs" /> + <Compile Include="Helper\Extension.cs" /> + <Compile Include="Helper\IWindowHelper.cs" /> + <Compile Include="Helper\DialogHelper.cs" /> + <Compile Include="Helper\WindowHelper.cs" /> + <Compile Include="Helper\XMLExtension.cs" /> + <Compile Include="Ninject\FactoryModule.cs" /> + <Compile Include="Ninject\MultistageModule.cs" /> + <Compile Include="Util\XML\Implementation\ComponentWriter\XMLPTOWriter.cs" /> + <Compile Include="ViewModel\Implementation\Document\DeclarationJobViewModel.cs" /> + <Compile Include="ViewModel\Implementation\Document\DeclarationTrailerJobDocumentViewModel.cs" /> + <Compile Include="Model\Interfaces\IAuxiliaryModelFactory.cs" /> + <Compile Include="ViewModel\Interfaces\Document\IDocumentViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\Document\IDocumentViewModelFactory.cs" /> + <Compile Include="ViewModel\Interfaces\Document\IJobViewModel.cs" /> + <Compile Include="Model\Interfaces\ISettingsModel.cs" /> + <Compile Include="Model\Implementation\SettingsModel.cs" /> + <Compile Include="Ninject\DocumentModule.cs" /> + <Compile Include="Ninject\JobEditModule.cs" /> + <Compile Include="Ninject\Vehicle\ComponentModule.cs" /> + <Compile Include="Ninject\XMLWriterFactoryModule.cs" /> + <Compile Include="Properties\Application.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + <DependentUpon>Application.settings</DependentUpon> + </Compile> + <Compile Include="Properties\Strings.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Strings.resx</DependentUpon> + </Compile> + <Compile Include="Properties\Settings.cs" /> + <Compile Include="Util\AllowedEntry.cs" /> + <Compile Include="Util\RelayCommand.cs" /> + <Compile Include="Util\SIUtils.cs" /> + <Compile Include="Ninject\Util\UseFirstArgumentAsNameInstanceProvider.cs" /> + <Compile Include="Ninject\Util\UseFirstArgumentTypeAsNameInstanceProvider.cs" /> + <Compile Include="Util\XML\Implementation\ComponentWriter\XMLAirDragWriter.cs" /> + <Compile Include="Util\XML\Implementation\ComponentWriter\XMLAuxiliariesWriter.cs" /> + <Compile Include="Util\XML\Implementation\ComponentWriter\XMLAxleGearWriter.cs" /> + <Compile Include="Util\XML\Implementation\ComponentWriter\XMLAxleWheelsWriter.cs" /> + <Compile Include="Util\XML\Implementation\ComponentWriter\XMLAxleWheelWriter.cs" /> + <Compile Include="Util\XML\Implementation\ComponentWriter\XMLEngineWriter.cs" /> + <Compile Include="Util\XML\Implementation\ComponentWriter\XMLComponentsWriter.cs" /> + <Compile Include="Util\XML\Implementation\ComponentWriter\XMLGearboxWriter.cs" /> + <Compile Include="Util\XML\Implementation\ComponentWriter\XMLRetarderWriter.cs" /> + <Compile Include="Util\XML\Implementation\ComponentWriter\XMLTyreWriter.cs" /> + <Compile Include="Util\XML\Implementation\ComponentWriter\XMLVehicleWriter.cs" /> + <Compile Include="Util\XML\Implementation\DocumentWriter\XMLDeclarationJobWriter.cs" /> + <Compile Include="Util\XML\Interfaces\IXMLComponentsWriter.cs" /> + <Compile Include="Util\XML\Interfaces\IXMLDeclarationJobWriter.cs" /> + <Compile Include="Util\XML\Interfaces\IXMLComponentWriter.cs" /> + <Compile Include="Util\XML\Interfaces\IXMLVehicleWriter.cs" /> + <Compile Include="Util\XML\Interfaces\IXMLWriterFactory.cs" /> + <Compile Include="Util\XML\XMLNamespaces.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\EngineFuelViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\EngineModeViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\TorqueConverterViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IEngineFuelViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IEngineModeViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\Common\IViewModelBase.cs" /> + <Compile Include="ViewModel\Implementation\Common\ViewModelBase.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\DeclarationJobEditViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\ComponentsViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Trailer\ITrailerViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\ADASViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\AirDragViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\AngleDriveViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\AuxiliariesViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\AuxiliaryViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\AxleGearViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\AxleViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\AxleWheelsViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\CommonComponentViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\EngineViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\GearboxViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\GearViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\PTOViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\RetarderViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\Components\TyreViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobEdit\Vehicle\VehicleViewModel.cs" /> + <Compile Include="ViewModel\Implementation\JobListViewModel.cs" /> + <Compile Include="ViewModel\Implementation\MainWindowViewModel.cs" /> + <Compile Include="ViewModel\Implementation\MessageViewModel.cs" /> + <Compile Include="ViewModel\Implementation\SettingsViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\IEditViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IAdasViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IAirDragViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IAuxiliariesViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IAuxiliaryViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IAxleGearViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IAxleViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IAxleWheelsViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\ICommonComponentViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IComponentsViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IComponentViewModelFactory.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\IJobEditViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\ISettingsViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\IJobListViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\IMainViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\IMainWindowViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\IMessageViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\IJobEditViewModelFactory.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IComponentViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IEngineViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IGearBoxViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IGearViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IAngleDriveViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IRetarderViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\IPTOViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\ITorqueConverterViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\Components\ITyreViewModel.cs" /> + <Compile Include="ViewModel\Interfaces\JobEdit\Vehicle\IVehicleViewModel.cs" /> + <Compile Include="ViewModel\MultiStage\Implementation\DeclarationInterimStageBusVehicleViewModel_v2_8.cs" /> + <Compile Include="ViewModel\MultiStage\Implementation\ManufacturingStageViewModel_v0_1.cs" /> + <Compile Include="ViewModel\MultiStage\Implementation\MultistageAirdragViewModel.cs" /> + <Compile Include="ViewModel\MultiStage\Implementation\NewMultiStageJobViewModel.cs" /> + <Compile Include="ViewModel\MultiStage\Implementation\MultistageJobViewModel_v0_1.cs" /> + <Compile Include="ViewModel\MultiStage\Interfaces\IMultistageAirdragViewModel.cs" /> + <Compile Include="ViewModel\MultiStage\Interfaces\IMultiStageViewModelFactory.cs" /> + <Compile Include="Views\CustomControls\ComboParameter.xaml.cs"> + <DependentUpon>ComboParameter.xaml</DependentUpon> + </Compile> + <Compile Include="Views\CustomControls\CustomControlExtensionMethods.cs" /> + <Compile Include="Views\CustomControls\DateTimePicker.xaml.cs"> + <DependentUpon>DateTimePicker.xaml</DependentUpon> + </Compile> + <Compile Include="Views\CustomControls\LabledCheckBoxAutomatic.xaml.cs"> + <DependentUpon>LabledCheckBoxAutomatic.xaml</DependentUpon> + </Compile> + <Compile Include="Views\CustomControls\LabledTextBox.xaml.cs"> + <DependentUpon>LabledTextBox.xaml</DependentUpon> + </Compile> + <Compile Include="Views\CustomControls\LabledTextBoxAutomatic.xaml.cs"> + <DependentUpon>LabledTextBoxAutomatic.xaml</DependentUpon> + </Compile> + <Compile Include="Views\CustomControls\LabledTextBoxUnit.xaml.cs"> + <DependentUpon>LabledTextBoxUnit.xaml</DependentUpon> + </Compile> + <Compile Include="Views\CustomControls\ScatterPlot.xaml.cs"> + <DependentUpon>ScatterPlot.xaml</DependentUpon> + </Compile> + <Compile Include="Views\CustomControls\Viewer.xaml.cs"> + <DependentUpon>Viewer.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\DeclarationJobEditView.xaml.cs"> + <DependentUpon>DeclarationJobEditView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\ADASView_v2_3.xaml.cs"> + <DependentUpon>ADASView_v2_3.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\AirDragView_v2_0.xaml.cs"> + <DependentUpon>AirDragView_v2_0.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\AngleDriveView_v2_0.xaml.cs"> + <DependentUpon>AngleDriveView_v2_0.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\AuxiliariesView_v2_0.xaml.cs"> + <DependentUpon>AuxiliariesView_v2_0.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\AuxiliaryView_v2_0.xaml.cs"> + <DependentUpon>AuxiliaryView_v2_0.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\AxleGearView_v2_0.xaml.cs"> + <DependentUpon>AxleGearView_v2_0.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\AxleView_v2_0.xaml.cs"> + <DependentUpon>AxleView_v2_0.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\AxleWheelsView_v2_0.xaml.cs"> + <DependentUpon>AxleWheelsView_v2_0.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\CommonComponentView.xaml.cs"> + <DependentUpon>CommonComponentView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\EngineFuelView.xaml.cs"> + <DependentUpon>EngineFuelView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\EngineModeViewSingleFuel.xaml.cs"> + <DependentUpon>EngineModeViewSingleFuel.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\EngineView_v2_0.xaml.cs"> + <DependentUpon>EngineView_v2_0.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\GearboxView_v2_0.xaml.cs"> + <DependentUpon>GearboxView_v2_0.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\GearView_v2_0.xaml.cs"> + <DependentUpon>GearView_v2_0.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\PTOView_v2_0.xaml.cs"> + <DependentUpon>PTOView_v2_0.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\RetarderView_v2_0.xaml.cs"> + <DependentUpon>RetarderView_v2_0.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\TyreView_v2_3.xaml.cs"> + <DependentUpon>TyreView_v2_3.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\Components\TyreView_v2_0.xaml.cs"> + <DependentUpon>TyreView_v2_0.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobEditViews\Vehicle\VehicleView_v2_0.xaml.cs"> + <DependentUpon>VehicleView_v2_0.xaml</DependentUpon> + </Compile> + <Compile Include="Views\JobListView.xaml.cs"> + <DependentUpon>JobListView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\MessageView.xaml.cs"> + <DependentUpon>MessageView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\Multistage\CustomControls\FilePicker.xaml.cs"> + <DependentUpon>FilePicker.xaml</DependentUpon> + </Compile> + <Compile Include="Views\Multistage\CustomControls\MultiStageParameter.xaml.cs"> + <DependentUpon>MultiStageParameter.xaml</DependentUpon> + </Compile> + <Compile Include="Views\Multistage\MultistageAirDragView.xaml.cs"> + <DependentUpon>MultistageAirDragView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\Multistage\MultiStageView.xaml.cs"> + <DependentUpon>MultiStageView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\Multistage\NewMultistageFileView.xaml.cs"> + <DependentUpon>NewMultistageFileView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\Multistage\ManufacturingStageView.xaml.cs"> + <DependentUpon>ManufacturingStageView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\Multistage\VehicleView_v2_8.xaml.cs"> + <DependentUpon>VehicleView_v2_8.xaml</DependentUpon> + </Compile> + <Compile Include="Views\SettingsView.xaml.cs"> + <DependentUpon>SettingsView.xaml</DependentUpon> + </Compile> + <Compile Include="Test.xaml.cs"> + <DependentUpon>Test.xaml</DependentUpon> + </Compile> + <Compile Include="Views\XMLViewer.xaml.cs"> + <DependentUpon>XMLViewer.xaml</DependentUpon> + </Compile> + <Page Include="ButtonStyles.xaml"> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="ButtonTemplates.xaml"> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="DataGridStyles.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Resources\Colors.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="MainWindow.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Compile Include="App.xaml.cs"> + <DependentUpon>App.xaml</DependentUpon> + <SubType>Code</SubType> + </Compile> + <Compile Include="MainWindow.xaml.cs"> + <DependentUpon>MainWindow.xaml</DependentUpon> + <SubType>Code</SubType> + </Compile> + <Page Include="Resources\Converter.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Resources\GlobalStyles.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Resources\ViewModelBindings.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\CustomControls\ComboParameter.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\CustomControls\DateTimePicker.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\CustomControls\LabledCheckBoxAutomatic.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\CustomControls\LabledTextBox.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\CustomControls\LabledTextBoxAutomatic.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\CustomControls\LabledTextBoxUnit.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\CustomControls\ScatterPlot.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\CustomControls\Viewer.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\DeclarationJobEditView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\ADASView_v2_3.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\AirDragView_v2_0.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\AngleDriveView_v2_0.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\AuxiliariesView_v2_0.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\AuxiliaryView_v2_0.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\AxleGearView_v2_0.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\AxleView_v2_0.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\AxleWheelsView_v2_0.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\CommonComponentView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\EngineFuelView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\EngineModeViewSingleFuel.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\EngineView_v2_0.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\GearboxView_v2_0.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\GearView_v2_0.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\PTOView_v2_0.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\RetarderView_v2_0.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\TyreView_v2_3.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\JobEditViews\Vehicle\Components\TyreView_v2_0.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobEditViews\Vehicle\VehicleView_v2_0.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobListView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\MessageView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\Multistage\CustomControls\FilePicker.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\Multistage\CustomControls\MultiStageParameter.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\Multistage\MultistageAirDragView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\Multistage\MultiStageView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\Multistage\NewMultistageFileView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\Multistage\ManufacturingStageView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\Multistage\VehicleView_v2_8.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\SettingsView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Test.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\XMLViewer.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="Properties\Settings.Designer.cs"> + <AutoGen>True</AutoGen> + <DependentUpon>Settings.settings</DependentUpon> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + </Compile> + <EmbeddedResource Include="Properties\Strings.resx"> + <Generator>PublicResXFileCodeGenerator</Generator> + <LastGenOutput>Strings.Designer.cs</LastGenOutput> + </EmbeddedResource> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + <AdditionalFiles Include="..\DependencyValidation1\DependencyValidation1.layerdiagram"> + <Link>DependencyValidation1.layerdiagram</Link> + <Visible>False</Visible> + </AdditionalFiles> + <None Include="Documentation\InputData.cd" /> + <None Include="Properties\Application.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <LastGenOutput>Application.Designer.cs</LastGenOutput> + </None> + <None Include="packages.config" /> + <None Include="Properties\Settings.settings"> + <Generator>PublicSettingsSingleFileGenerator</Generator> + <LastGenOutput>Settings.Designer.cs</LastGenOutput> + </None> + <None Include="ViewModel\ClassDiagram1.cd" /> + <None Include="ViewModel\Implementation\JobEdit\ClassDiagram1.cd" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <ItemGroup> + <BootstrapperPackage Include=".NETFramework,Version=v4.8"> + <Visible>False</Visible> + <ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName> + <Install>true</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.5 SP1</ProductName> + <Install>false</Install> + </BootstrapperPackage> + </ItemGroup> + <ItemGroup> + <Resource Include="Resources\Icon2.ico" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\VectoCommon\VectoCommon\VectoCommon.csproj"> + <Project>{79a066ad-69a9-4223-90f6-6ed5d2d084f4}</Project> + <Name>VectoCommon</Name> + </ProjectReference> + <ProjectReference Include="..\VectoCommon\VectoHashing\VectoHashing.csproj"> + <Project>{B673E12F-D323-4C4C-8805-9915B2C72D3D}</Project> + <Name>VectoHashing</Name> + </ProjectReference> + <ProjectReference Include="..\VectoCore\VectoCore\VectoCore.csproj"> + <Project>{cd36938a-add9-4c65-96da-b397cdeea90a}</Project> + <Name>VectoCore</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Resource Include="Resources\folderpicker.ico" /> + </ItemGroup> + <ItemGroup> + <Folder Include="Model\Multistage\" /> + </ItemGroup> + <!-- ItemGroup> + <Analyzer Include="..\packages\Microsoft.DependencyValidation.Analyzers.0.11.0\analyzers\dotnet\cs\Microsoft.DependencyValidation.Analyzers.resources.dll" /> + </-ItemGroup --> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project> \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/ClassDiagram1.cd b/VECTO3GUI2020/ViewModel/ClassDiagram1.cd new file mode 100644 index 0000000000000000000000000000000000000000..6266df25c87b5da5fcd7daf2d767bc18ebc225fe --- /dev/null +++ b/VECTO3GUI2020/ViewModel/ClassDiagram1.cd @@ -0,0 +1,566 @@ +<?xml version="1.0" encoding="utf-8"?> +<ClassDiagram MajorVersion="1" MinorVersion="1"> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.Common.ViewModelBase" Collapsed="true"> + <Position X="33.75" Y="0.5" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAEAAIAAAAAAAgAEAAAAAAAAAAAAAAAA=</HashCode> + <FileName>ViewModel\Implementation\Common\ViewModelBase.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.Document.DeclarationJobViewModel" Collapsed="true"> + <Position X="66.75" Y="0.5" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAABAABBAAAIAAABAAAAgAAAAAAAAAAAAAAAAAAAgA=</HashCode> + <FileName>ViewModel\Implementation\Document\DeclarationJobViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.Document.DeclarationTrailerJobDocumentViewModel" Collapsed="true"> + <Position X="68.5" Y="0.5" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAJAABBAAAAAAABAAAAgAAAAAAAAAAAAAAAAAAAgA=</HashCode> + <FileName>ViewModel\Implementation\Document\DeclarationTrailerJobDocumentViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.DeclarationJobViewModel" Collapsed="true"> + <Position X="26" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAMAAkAAAAIAABUwAAgAAAQAAAACAAAAAAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\DeclarationJobViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.DeclarationJobViewModel_v1_0" Collapsed="true"> + <Position X="26" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\DeclarationJobViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.DeclarationJobViewModel_v2_0" Collapsed="true"> + <Position X="26" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\DeclarationJobViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Trailer.DeclarationTrailerJobEditViewModel" Collapsed="true"> + <Position X="44" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAEAAAAAAAAUAAAAAAAAAAAAAAAAAAAA=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Trailer\DeclarationTrailerJobEditViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Trailer.DeclarationTrailerJobEditViewModel_v2_7" Collapsed="true"> + <Position X="44" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Trailer\DeclarationTrailerJobEditViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Trailer.TrailerViewModel" Collapsed="true"> + <Position X="0.5" Y="0.5" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAEAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Trailer\TrailerViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Trailer.TrailerViewModel_v2_7" Collapsed="true"> + <Position X="0.5" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Trailer\TrailerViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.ADASViewModel" Collapsed="true"> + <Position X="5.75" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAEAIAIFAAAQAAAAAAjCAQAAAAAAAAAAAACAAAAAAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\ADASViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.ADASViewModel_v1_0" Collapsed="true"> + <Position X="5.75" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAAAAAAAAAAAAAgCAAAAAAAAAAAAAACAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\ADASViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.ADASViewModel_v2_1" Collapsed="true"> + <Position X="5.75" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\ADASViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.ADASViewModel_v2_3" Collapsed="true"> + <Position X="5.75" Y="6.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\ADASViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AirDragViewModel" Collapsed="true"> + <Position X="41.75" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAgAIYAAEgABEkAABkAEAQUAAAAiAAABAAiAREAAEAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AirDragViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AirDragViewModel_v1_0" Collapsed="true"> + <Position X="41.75" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AirDragViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AirDragViewModel_v2_0" Collapsed="true"> + <Position X="41.75" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AirDragViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AngleDriveViewModel" Collapsed="true"> + <Position X="57.5" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAgABYAAGgABEkQABkAEAAUAAAAiACCBAQiARFAAEAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AngleDriveViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AngleDriveViewModel_v1_0" Collapsed="true"> + <Position X="57.5" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAACAAAAAAAAAAAAAAAAAAgACAAAQAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AngleDriveViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AngleDriveViewModel_v2_0" Collapsed="true"> + <Position X="57.5" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AngleDriveViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AuxiliariesViewModel" Collapsed="true"> + <Position X="19.25" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAACIAAAEAAhUAAAAAAABAQEAAAAAAAAAAAAAEAAIAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AuxiliariesViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AuxiliariesViewModel_v1_0" Collapsed="true"> + <Position X="19.25" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AuxiliariesViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AuxiliariesViewModel_v2_0" Collapsed="true"> + <Position X="19.25" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AuxiliariesViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AuxiliariesViewModel_v2_3" Collapsed="true"> + <Position X="19.25" Y="6.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AuxiliariesViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AuxiliaryViewModel" Collapsed="true"> + <Position X="46.25" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>ABAAIAAAEAAAAAwAACAAAAQICAAAgAAAAQAAEAAAAAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AuxiliaryViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AuxiliaryViewModel_v1_0" Collapsed="true"> + <Position X="46.25" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AuxiliaryViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AuxiliaryViewModel_v2_0" Collapsed="true"> + <Position X="46.25" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AuxiliaryViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AuxiliaryViewModel_v2_3" Collapsed="true"> + <Position X="46.25" Y="6.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AuxiliaryViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AxleGearViewModel" Collapsed="true"> + <Position X="8" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAgIJYAAGgABEkAABkAEAAUAAAIiACCBAAiARFAAEAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AxleGearViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AxleGearViewModel_v1_0" Collapsed="true"> + <Position X="8" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AxleGearViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AxleGearViewModel_v2_0" Collapsed="true"> + <Position X="8" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAgIAIAACgAAAAAAAAAAAAAAAAAgACABAAiAAEAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AxleGearViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AxleViewModel" Collapsed="true"> + <Position X="32.75" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>ICAAAAAAEAAAAggEAEQAAAQAAAQAAAAAGAAIAACAAAY=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AxleViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AxleViewModel_v1_0" Collapsed="true"> + <Position X="32.75" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AxleViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AxleViewModel_v2_0" Collapsed="true"> + <Position X="32.75" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AxleViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AxleViewModel_v2_7" Collapsed="true"> + <Position X="32.75" Y="6.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AxleViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AxleWheelsViewModel" Collapsed="true"> + <Position X="60.75" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAQAIAAAFAAAEAAABAABAAQAAAAAAAAAACAAAAAAAAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AxleWheelsViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AxleWheelsViewModel_v1_0" Collapsed="true"> + <Position X="59.75" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AxleWheelsViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.AxleWheelsViewModel_v2_0" Collapsed="true"> + <Position X="62" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\AxleWheelsViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.CommonComponentViewModel" Collapsed="true"> + <Position X="21.5" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAgAAQAAAgABAgAABkAEAAAAAAACAAABAAiAREAAEAA=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\CommonComponentViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.ComponentsViewModel" Collapsed="true"> + <Position X="28.25" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAgAEAAAABAMKBQCIAAAABhABAAAACAABAIyQKBIAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\ComponentsViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.ComponentsViewModel_v1_0" Collapsed="true"> + <Position X="28.25" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAEAAAAAAECBACAAAAABBAAAAAACAAAAAgACAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\ComponentsViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.ComponentsViewModel_v2_0" Collapsed="true"> + <Position X="28.25" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\ComponentsViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.EngineFuelViewModel" Collapsed="true"> + <Position X="48.5" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAABAAAAAAAAAAAAAIAAAYAAAAAAAABAEAAAAQAAAAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\EngineFuelViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.SingleFuelEngineFuelViewModel" Collapsed="true"> + <Position X="48.5" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>EAABAAIAAIAAAAAAAIAAAYCAAAAQAABEEACAAQAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\EngineFuelViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.EngineModeViewModel" Collapsed="true"> + <Position X="64.25" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AABAAAAAASAAAAAAAAAAQAAAAAAAAAAAAAAAggAAAAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\EngineModeViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.EngineModeViewModelSingleFuel" Collapsed="true"> + <Position X="64.25" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AABAAAAAAQAAAAAAAAAARgAEAEAAAAAAAAAAggAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\EngineModeViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.EngineViewModel" Collapsed="true"> + <Position X="10.25" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>BAgAIZBQEgABEkAAB0AkAIUAABACBAADAAiAREAAEAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\EngineViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.EngineViewModel_v1_0" Collapsed="true"> + <Position X="10.25" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\EngineViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.EngineViewModel_v2_0" Collapsed="true"> + <Position X="10.25" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>BAgAAIBgAAAAAAAAAwAAAIAAAAABBAABAAiAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\EngineViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.GearboxViewModel" Collapsed="true"> + <Position X="36" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAgAIYAAEgABEkQABkAEAEUIABACAQQBAQiARECBEAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\GearboxViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.GearboxViewModel_v1_0" Collapsed="true"> + <Position X="35" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\GearboxViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.GearboxViewModel_v2_0" Collapsed="true"> + <Position X="37.25" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAgAAIAAAgAAAAAAAAAAAEAAAAACAQABAQiAAACAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\GearboxViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.GearViewModel" Collapsed="true"> + <Position X="53" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AEAALoAAGMAAggAQgEQQBAwoAA4hACCkCABAABAAIQI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\GearViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.GearViewModel_v1_0" Collapsed="true"> + <Position X="53" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\GearViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.GearViewModel_v2_0" Collapsed="true"> + <Position X="53" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAACAAAAAAAgAAAAAgAAAAgACAEAAAAAAAAAQg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\GearViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.PTOViewModel" Collapsed="true"> + <Position X="12.5" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAIoAAEAAAEEAAAAAAAAQAgAAAAQAAgAAAACAAAAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\PTOViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.PTOViewModel_V1_0" Collapsed="true"> + <Position X="12.5" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAACAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\PTOViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.PTOViewModel_V2_0" Collapsed="true"> + <Position X="12.5" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\PTOViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.RetarderViewModel" Collapsed="true"> + <Position X="39.5" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAgAJYAAGgABAkQABkAEAAUAAAQCACABAQiARFAAEAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\RetarderViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.RetarderViewModel_v1_0" Collapsed="true"> + <Position X="39.5" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAACAAAAAAAAAAAAAAAAAAAACAAAQAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\RetarderViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.RetarderViewModel_v2_0" Collapsed="true"> + <Position X="39.5" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\RetarderViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.TorqueConverterViewModel" Collapsed="true"> + <Position X="55.25" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAgAAACAEkAAFgAAAEAAAAUAAAAAAAABAAiAAEAAEAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\TorqueConverterViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.TorqueConverterViewModel_v1_0" Collapsed="true"> + <Position X="55.25" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\TorqueConverterViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.TorqueConverterViewModel_v2_0" Collapsed="true"> + <Position X="55.25" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\TorqueConverterViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.TyreViewModel" Collapsed="true"> + <Position X="14.75" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAkBAYAAEiADAkAABkIMAAUAAAACSAABAgiAREAAEAI=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\TyreViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.TyreViewModel_v1_0" Collapsed="true"> + <Position X="14.75" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAAAAAAAAAAAAIAAAAAAAAAQAAAAAAAAAAAAAo=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\TyreViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.TyreViewModel_v2_0" Collapsed="true"> + <Position X="14.75" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\TyreViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.TyreViewModel_v2_2" Collapsed="true"> + <Position X="14.75" Y="6.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\TyreViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components.TyreViewModel_v2_3" Collapsed="true"> + <Position X="14.75" Y="7.5" Width="1.5" /> + <TypeIdentifier> + <HashCode>AQAAAIAAAAACAAAAAAAAAAAAAAAAAAAAAAACAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\Components\TyreViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.VehicleViewModel" Collapsed="true"> + <Position X="50.75" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>EIqCLYIMVmCRMoIODuMVgEfEEBCCAIIBB3iAVcMIPzo=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\VehicleViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.VehicleViewModel_v1_0" Collapsed="true"> + <Position X="50.75" Y="3.25" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\VehicleViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.VehicleViewModel_v2_0" Collapsed="true"> + <Position X="50.75" Y="4.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>BIoAAAAEAgAgAMAAACAAIAIACAAAAIAFAAgARMEAAhg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\VehicleViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobListViewModel" Collapsed="true"> + <Position X="3.5" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AQAIAFAARACQAAAAhGAQGAADIBAgECAAEJCIAIAgADI=</HashCode> + <FileName>ViewModel\Implementation\JobListViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.MainWindowViewModel" Collapsed="true"> + <Position X="17" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAIAAIQAAAAAAAAwAAAAAAAACABAACAAAAAAAAACA=</HashCode> + <FileName>ViewModel\Implementation\MainWindowViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.MessageViewModel" Collapsed="true"> + <Position X="23.75" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> + <FileName>ViewModel\Implementation\MessageViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.SettingsViewModel" Collapsed="true"> + <Position X="30.5" Y="1.75" Width="1.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAABAgAAAIAAAAAAAAAAAAAAAAEAAAAQ=</HashCode> + <FileName>ViewModel\Implementation\SettingsViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Font Name="Segoe UI" Size="9" /> +</ClassDiagram> \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/Implementation/Common/ViewModelBase.cs b/VECTO3GUI2020/ViewModel/Implementation/Common/ViewModelBase.cs new file mode 100644 index 0000000000000000000000000000000000000000..01f9fe42dfb40a7e39585c03adcb1fb6ae62a936 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/Common/ViewModelBase.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using System.ComponentModel; +using System.Runtime.CompilerServices; +using VECTO3GUI2020.ViewModel.Interfaces.Common; + +namespace VECTO3GUI2020.ViewModel.Implementation.Common +{ + /// <summary> + /// Base Implementation of INotifyPropertyChanged + /// https://docs.microsoft.com/en-us/dotnet/framework/wpf/data/how-to-implement-property-change-notification + /// </summary> + /// + public class ViewModelBase : INotifyPropertyChanged, IViewModelBase + { + public event PropertyChangedEventHandler PropertyChanged; + /// <summary> + /// Needs to be called when a Property is changed + /// </summary> + /// + /// <param name="name">Is automatically set to CallerMemberName</param> + protected void OnPropertyChanged([CallerMemberName] string name = "") + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } + + + //borrowed from Franz Josef Kober + protected virtual bool SetProperty<T>(ref T field, T value, [CallerMemberName] string propertyName = null) + { + bool propertyChanged = false; + + if (!EqualityComparer<T>.Default.Equals(field, value)) + { + field = value; + OnPropertyChanged(propertyName); + propertyChanged = true; + } + return propertyChanged; + } + + public virtual string Title { get; set; } = "No Title Set"; + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/Document/DeclarationJobViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/Document/DeclarationJobViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..4f890e5988ea09aabca2bb5fc7d366ba82c7db69 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/Document/DeclarationJobViewModel.cs @@ -0,0 +1,51 @@ +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.Document; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit; + +namespace VECTO3GUI2020.ViewModel.Implementation.Document +{ + public class DeclarationJobViewModel : ViewModelBase, IJobViewModel + { + #region Implementation of IDocumentViewModel + public string DocumentName { get; } + + public XmlDocumentType DocumentType { get; } + + public DataSource DataSource => _jobEditViewModel.DataSource; + + + private IJobEditViewModel _jobEditViewModel; + public IJobEditViewModel JobEditViewModel { get => _jobEditViewModel; } + public IEditViewModel EditViewModel + { + get => _jobEditViewModel as IEditViewModel; + } + + #endregion + #region Members + + public IXMLInputDataReader _xMLInputDataReader; + #endregion + + + public DeclarationJobViewModel(XmlDocumentType xmlDocumentType, string sourcefile, IXMLInputDataReader xMLInputDataReader, + IJobEditViewModelFactory jobEditViewModelFactory) + { + + _xMLInputDataReader = xMLInputDataReader; + DocumentType = xmlDocumentType; + + + var xmlInputDataProvider = _xMLInputDataReader.Create(sourcefile); + _jobEditViewModel = jobEditViewModelFactory.CreateJobEditViewModel(xmlInputDataProvider); + + _xMLInputDataReader.Create(sourcefile); + DocumentName = _jobEditViewModel.Name; + } + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/Document/DeclarationTrailerJobDocumentViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/Document/DeclarationTrailerJobDocumentViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..2b6d2a9a89159f0e7858af118ebed7d02c76b23b --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/Document/DeclarationTrailerJobDocumentViewModel.cs @@ -0,0 +1,44 @@ +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.ViewModel.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.Document; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit; + +namespace VECTO3GUI2020.ViewModel.Implementation.Document +{ + public class DeclarationTrailerJobDocumentViewModel : IJobViewModel + { + private string _name = ""; + public string DocumentName { get => _name; } + + public XmlDocumentType DocumentType { get; } + + public DataSource DataSource => throw new System.NotImplementedException(); + + public string SourceFile { get; } + + public IJobEditViewModel EditViewModel { get => _jobEditViewModel; } + + IEditViewModel IDocumentViewModel.EditViewModel => throw new System.NotImplementedException(); + + private IXMLInputDataReader _xMLInputDataReader; + + private IJobEditViewModel _jobEditViewModel; + + + public DeclarationTrailerJobDocumentViewModel(XmlDocumentType xmlDocumentType, string sourcefile, IXMLInputDataReader xMLInputDataReader, + IJobEditViewModelFactory jobEditViewModelFactory) + { + + DocumentType = xmlDocumentType; + _xMLInputDataReader = xMLInputDataReader; + + SourceFile = sourcefile; + + + var xml_input_data_provider = _xMLInputDataReader.Create(sourcefile); + _jobEditViewModel = jobEditViewModelFactory.CreateJobEditViewModel(xml_input_data_provider); + } + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/ClassDiagram1.cd b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/ClassDiagram1.cd new file mode 100644 index 0000000000000000000000000000000000000000..8b25970a7d90c54eb200dac872cb4bf7a83c2ba3 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/ClassDiagram1.cd @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<ClassDiagram MajorVersion="1" MinorVersion="1"> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.VehicleViewModel"> + <Position X="2" Y="1.5" Width="2.5" /> + <TypeIdentifier> + <HashCode>QAKIJABEEkggAkAAACAAAAUAAAAQAIIAAAAAAIAIAwA=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\VehicleViewModel.cs</FileName> + </TypeIdentifier> + <Lollipop Position="0.2" /> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.VehicleViewModel_v1_0" Collapsed="true"> + <Position X="5.5" Y="5.25" Width="2.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\VehicleViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Class Name="VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.VehicleViewModel_v2_0" Collapsed="true"> + <Position X="5.5" Y="6.25" Width="2.5" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode> + <FileName>ViewModel\Implementation\JobEdit\Vehicle\VehicleViewModel.cs</FileName> + </TypeIdentifier> + </Class> + <Interface Name="VECTO3GUI2020.ViewModel.Interfaces.JobEdit.IVehicleViewModel"> + <Position X="4.75" Y="1.5" Width="2.75" /> + <TypeIdentifier> + <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAA=</HashCode> + <FileName>ViewModel\Interfaces\JobEdit\Vehicle\IVehicleViewModel.cs</FileName> + </TypeIdentifier> + </Interface> + <Font Name="Segoe UI" Size="9" /> +</ClassDiagram> \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/DeclarationJobEditViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/DeclarationJobEditViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..c71ea3f14bb2a4bd5418357de2a9c9187636ca1e --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/DeclarationJobEditViewModel.cs @@ -0,0 +1,207 @@ +using Ninject; +using System; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Windows; +using System.Windows.Forms.VisualStyles; +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.VectoCore.InputData.FileIO.XML.Declaration; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Properties; +using VECTO3GUI2020.Util; +using VECTO3GUI2020.Util.XML.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit +{ + + /// <summary> + /// ViewModel for Declaration Jobs. + /// </summary> + public abstract class DeclarationJobEditViewModel : ViewModelBase, IJobEditViewModel, IDeclarationJobInputData + { + public string Name => _jobInputData.JobName; + public override string Title => Name; + + private IComponentViewModel _currentDetailView; + public IComponentViewModel CurrentDetailView + { + get + { + return _currentDetailView; + } + set + { + _currentDetailView = value; + OnPropertyChanged(); + } + } + + protected IDeclarationJobInputData _jobInputData; + protected IDeclarationInputDataProvider _inputData; + private IXMLWriterFactory _xmlWriterFactory; + + protected IComponentViewModelFactory _componentViewModelFactory; + + + public ObservableCollection<IComponentViewModel> ComponentViewModels { get; protected set; } = new ObservableCollection<IComponentViewModel>(); + + protected IVehicleViewModel _vehicleViewModel; + public IVehicleViewModel VehicleViewModel + { + get => _vehicleViewModel; + set => SetProperty(ref _vehicleViewModel, value); + } + + public DeclarationJobEditViewModel(IDeclarationInputDataProvider inputData, + IComponentViewModelFactory componentViewModelFactory, + IXMLWriterFactory xmlWriterFactory, + IDialogHelper dialogHelper) + { + _xmlWriterFactory = xmlWriterFactory; + _componentViewModelFactory = componentViewModelFactory; + _dialogHelper = dialogHelper; + + _jobInputData = inputData.JobInputData; + _inputData = inputData; + + DataSource = inputData.DataSource; + + + VehicleViewModel = _componentViewModelFactory.CreateVehicleViewModel(_jobInputData.Vehicle); + CurrentDetailView = VehicleViewModel; + + ComponentViewModels.Add(VehicleViewModel); + AddVehicleComponentsToCollection(); + } + + protected void AddVehicleComponentsToCollection() + { + + foreach(var component in VehicleViewModel.ComponentViewModels) + { + ComponentViewModels.Add(component); + } + } + + + #region Commands + + private ICommand _saveCommand; + private ICommand _saveAsCommand; + private DataSource _dataSource; + private IDialogHelper _dialogHelper; + + + private void UpdateDataSource(string filename) + { + DataSource.SourceFile = filename; + OnPropertyChanged(nameof(DataSource.SourceFile)); + } + + public ICommand SaveCommand => + _saveCommand ?? new RelayCommand( + SaveExecute, () => true); + + public ICommand SaveAsCommand => _saveAsCommand ?? new RelayCommand( + SaveAsExecute, () => true); + + private void SaveAsExecute() + { + var filename = _dialogHelper.SaveToXMLDialog(DataSource.SourcePath); + Save(filename); + UpdateDataSource(filename); + } + + + private void SaveExecute() + { + var filename = _dataSource.SourceFile; + var dialogResult = _dialogHelper.ShowMessageBox(Strings.SaveExecute_Do_you_want_to_overwrite + filename + "?", "Save", + MessageBoxButton.YesNo, MessageBoxImage.Question); + + if (dialogResult == MessageBoxResult.No) { + return; + } + + Save(filename); + } + + + private void Save(string filename) + { + if (filename == null) { + return; + } + var document = _xmlWriterFactory.CreateJobWriter(this).GetDocument(); + + document.Save(filename, SaveOptions.OmitDuplicateNamespaces); + } + + #endregion + + public DataSource DataSource + { + get => _dataSource; + set => SetProperty(ref _dataSource, value); + } + + public bool SavedInDeclarationMode => _jobInputData.SavedInDeclarationMode; + + public IVehicleDeclarationInputData Vehicle => _vehicleViewModel; + + public string JobName => Name; + + public string ShiftStrategy => throw new NotImplementedException(); + } + + public class DeclarationJobEditViewModel_v1_0 : DeclarationJobEditViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationInputDataProviderV10).FullName; + + public DeclarationJobEditViewModel_v1_0 + (IDeclarationInputDataProvider inputData, + IComponentViewModelFactory componentViewModelFactory, + IXMLWriterFactory xmlWriterFactory, + IDialogHelper dialogHelper): + base(inputData, + componentViewModelFactory, + xmlWriterFactory, + dialogHelper) + { + //ComponentViewModels.Add(VehicleViewModel.PTOViewModel); + } + } + + public class DeclarationJobEditViewModel_v2_0 : DeclarationJobEditViewModel_v1_0 + { + public new static readonly string VERSION = typeof(XMLDeclarationInputDataProviderV20).FullName; + + public DeclarationJobEditViewModel_v2_0( + IDeclarationInputDataProvider inputData, + IComponentViewModelFactory componentViewModelFactory, + IXMLWriterFactory xmlWriterFactory, + IDialogHelper dialogHelper) : + base(inputData, + componentViewModelFactory, + xmlWriterFactory, + dialogHelper) + { + //ComponentViewModels.Add(VehicleViewModel.PTOViewModel); + } + } + +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/ADASViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/ADASViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..81189514d53d77429ba1b261b1b9120cb21da799 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/ADASViewModel.cs @@ -0,0 +1,127 @@ +using System; +using System.Xml; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class ADASViewModel : ViewModelBase, IComponentViewModel, IAdasViewModel + { + public string Name => "ADAS"; + + public bool IsPresent { get; set; } = false; + + protected IAdvancedDriverAssistantSystemDeclarationInputData _inputData; + + + public ADASViewModel(IAdvancedDriverAssistantSystemDeclarationInputData inputData) + { + _inputData = inputData; + IsPresent = true; + + + if (!IsPresent) + { + return; + } + SetProperties(); + } + + public abstract void SetProperties(); + + #region implementation of IAdvancedDriverAssistantSystemDeclarationInputData + protected bool _engineStopStart; + protected EcoRollType _ecoRoll; + protected PredictiveCruiseControlType _predictiveCruiseControl; + protected bool? _atEcoRollReleaseLockupClutch; + protected XmlNode _xmlSource; + public virtual bool EngineStopStart {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual EcoRollType EcoRoll {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual PredictiveCruiseControlType PredictiveCruiseControl {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual bool? ATEcoRollReleaseLockupClutch {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual XmlNode XMLSource {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + #endregion + } + + + public class ADASViewModel_v1_0 : ADASViewModel + { + + public static readonly string VERSION = typeof(XMLDeclarationADASDataProviderV10).FullName; + + public ADASViewModel_v1_0(IAdvancedDriverAssistantSystemDeclarationInputData inputData) : base(inputData) + { + + } + + public override void SetProperties() + { + _engineStopStart = _inputData.EngineStopStart; + _ecoRoll = _inputData.EcoRoll; + _predictiveCruiseControl = _inputData.PredictiveCruiseControl; + } + +#region implementation Overrides of Properties + public override bool EngineStopStart + { + get => _engineStopStart; + set => SetProperty(ref _engineStopStart, value); + } + public override EcoRollType EcoRoll + { + get => _ecoRoll; + set => SetProperty(ref _ecoRoll, value); + } + public override PredictiveCruiseControlType PredictiveCruiseControl + { + get => _predictiveCruiseControl; + set => SetProperty(ref _predictiveCruiseControl, value); + } +#endregion + } + + + public class ADASViewModel_v2_1 : ADASViewModel_v1_0 + { + public static new readonly string VERSION = typeof(XMLDeclarationADASDataProviderV21).FullName; + public ADASViewModel_v2_1(IAdvancedDriverAssistantSystemDeclarationInputData inputData) : base(inputData) + { + + } + + public override void SetProperties() + { + base.SetProperties(); + } + } + + + public class ADASViewModel_v2_3 : ADASViewModel_v2_1 + { + public static new readonly string VERSION = typeof(XMLDeclarationADASDataProviderV23).ToString(); + + + public override void SetProperties() + { + base.SetProperties(); + _atEcoRollReleaseLockupClutch = _inputData.ATEcoRollReleaseLockupClutch ?? false; + } + + public override bool? ATEcoRollReleaseLockupClutch { get => _atEcoRollReleaseLockupClutch; set => + SetProperty(ref _atEcoRollReleaseLockupClutch, value); } + + + + public ADASViewModel_v2_3(IAdvancedDriverAssistantSystemDeclarationInputData inputData) : base(inputData) + { + + } + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AirDragViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AirDragViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..7be3d7fc23cb761ff1e4d61933da7cec3e9132f7 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AirDragViewModel.cs @@ -0,0 +1,143 @@ +using System; +using System.Diagnostics; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class AirDragViewModel : ViewModelBase, IComponentViewModel, IAirDragViewModel + { + private static readonly string _name = "AirDrag"; + + protected IAirdragDeclarationInputData _inputData; + + private ICommonComponentViewModel _commonComponentViewModel; + public ICommonComponentViewModel CommonComponentViewModel + { + get => _commonComponentViewModel; + set => SetProperty(ref _commonComponentViewModel, value); + } + + + + + + + + + public AirDragViewModel(IXMLAirdragDeclarationInputData inputData, IComponentViewModelFactory vmFactory) + { + _inputData = inputData as IAirdragDeclarationInputData; + Debug.Assert(_inputData != null); + _isPresent = (_inputData?.DataSource?.SourceFile != null); + + _commonComponentViewModel = vmFactory.CreateCommonComponentViewModel(_inputData); + SetProperties(); + } + + public abstract void SetProperties(); + + public string Name { get { return _name; } } + private bool _isPresent; + public bool IsPresent { get { return _isPresent; } } + + #region Implementation of IAirDragDeclarationInputData + + protected SquareMeter _airDragArea; + public DataSource DataSource + { + get => _commonComponentViewModel.DataSource; + set => _commonComponentViewModel.DataSource = value; + } + + public string Manufacturer + { + get => _commonComponentViewModel.Manufacturer; + set => _commonComponentViewModel.Manufacturer = value; + } + + public string Model + { + get => _commonComponentViewModel.Model; + set => _commonComponentViewModel.Model = value; + } + + public DateTime Date + { + get => _commonComponentViewModel.Date; + set => _commonComponentViewModel.Date = value; + } + + public string CertificationNumber + { + get => _commonComponentViewModel.CertificationNumber; + set => _commonComponentViewModel.CertificationNumber = value; + } + + public CertificationMethod CertificationMethod + { + get => _commonComponentViewModel.CertificationMethod; + set => _commonComponentViewModel.CertificationMethod = value; + } + + public bool SavedInDeclarationMode + { + get => _commonComponentViewModel.SavedInDeclarationMode; + set => _commonComponentViewModel.SavedInDeclarationMode = value; + } + + public DigestData DigestValue + { + get => _commonComponentViewModel.DigestValue; + set => _commonComponentViewModel.DigestValue = value; + } + + public string AppVersion => _commonComponentViewModel.AppVersion; + + + public virtual SquareMeter AirDragArea {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + #endregion + } + + + public class AirDragViewModel_v1_0 : AirDragViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationAirdragDataProviderV10).FullName; + public AirDragViewModel_v1_0(IXMLAirdragDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + + } + + public override void SetProperties() + { + throw new NotImplementedException(); + } + } + + public class AirDragViewModel_v2_0 : AirDragViewModel_v1_0 + { + public static new readonly string VERSION = typeof(XMLDeclarationAirdragDataProviderV20).FullName; + + public AirDragViewModel_v2_0(IXMLAirdragDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + + } + + public override void SetProperties() + { + _airDragArea = _inputData.AirDragArea; + } + + public override SquareMeter AirDragArea + { + get => _airDragArea; + set => SetProperty(ref _airDragArea, value); + } + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AngleDriveViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AngleDriveViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..2f49378afa0ef1dc77f51a820d71c255fe3b8f52 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AngleDriveViewModel.cs @@ -0,0 +1,171 @@ +using System; +using System.Diagnostics; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCore.InputData.FileIO.XML; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class AngleDriveViewModel : ViewModelBase, IComponentViewModel, IAngleDriveViewModel + { + protected IXMLAngledriveInputData _inputData; + + private ICommonComponentViewModel _commonComponentViewModel; + + public ICommonComponentViewModel CommonComponentViewModel + { + get => _commonComponentViewModel; + set => SetProperty(ref _commonComponentViewModel, value); + } + + public string Name => "Angle Drive"; + + private bool _isPresent; + public bool IsPresent { get => _isPresent; set => SetProperty(ref _isPresent, value); } + + public abstract void SetProperties(); + + public AngleDriveViewModel(IXMLAngledriveInputData inputData, IComponentViewModelFactory viewModelFactory) + { + _inputData = inputData; + if(((inputData as IXMLResource)?.DataSource.SourceFile == null) || (_inputData.Type == AngledriveType.None)) { + IsPresent = false; + } + + _commonComponentViewModel = viewModelFactory.CreateCommonComponentViewModel(inputData); + } + + #region implementation of IAngleDriveInputData + + protected AngledriveType _type; + protected double _ratio; + protected TableData _lossMap; + protected double _efficiency; + public DataSource DataSource + { + get => _commonComponentViewModel.DataSource; + set => _commonComponentViewModel.DataSource = value; + } + + public string Manufacturer + { + get => _commonComponentViewModel.Manufacturer; + set => _commonComponentViewModel.Manufacturer = value; + } + + public string Model + { + get => _commonComponentViewModel.Model; + set => _commonComponentViewModel.Model = value; + } + + public DateTime Date + { + get => _commonComponentViewModel.Date; + set => _commonComponentViewModel.Date = value; + } + + public string CertificationNumber + { + get => _commonComponentViewModel.CertificationNumber; + set => _commonComponentViewModel.CertificationNumber = value; + } + + public CertificationMethod CertificationMethod + { + get => _commonComponentViewModel.CertificationMethod; + set => _commonComponentViewModel.CertificationMethod = value; + } + + public bool SavedInDeclarationMode + { + get => _commonComponentViewModel.SavedInDeclarationMode; + set => _commonComponentViewModel.SavedInDeclarationMode = value; + } + + public DigestData DigestValue + { + get => _commonComponentViewModel.DigestValue; + set => _commonComponentViewModel.DigestValue = value; + } + + public string AppVersion => _commonComponentViewModel.AppVersion; + + public virtual AngledriveType Type + { + get => _type; + set{ + Debug.WriteLine(value.ToString()); + SetProperty(ref _type, value); + IsPresent = value != AngledriveType.None; + } + } + + public virtual double Ratio {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual TableData LossMap {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual double Efficiency {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + #endregion + } + + + public class AngleDriveViewModel_v1_0 : AngleDriveViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationAngledriveDataProviderV10).FullName; + + public AngleDriveViewModel_v1_0(IXMLAngledriveInputData inputData, IComponentViewModelFactory viewModelFactory) : base(inputData, viewModelFactory) + { + } + + public override void SetProperties() + { + _type = _inputData.Type; + _ratio = _inputData.Ratio; + _lossMap = _inputData.LossMap; + _efficiency = _inputData.Efficiency; + } + + public override double Ratio + { + get => _ratio; + set => SetProperty(ref _ratio, value); + } + + public override TableData LossMap + { + get => _lossMap; + set => SetProperty(ref _lossMap , value); + } + + public override double Efficiency + { + get => _efficiency; + set => SetProperty(ref _efficiency, value); + } + } + + public class AngleDriveViewModel_v2_0 : AngleDriveViewModel_v1_0 + { + public static new readonly string VERSION = typeof(XMLDeclarationAngledriveDataProviderV20).FullName; + + public AngleDriveViewModel_v2_0(IXMLAngledriveInputData inputData, IComponentViewModelFactory viewModelFactory) : base(inputData, viewModelFactory) + { + } + + public override void SetProperties() + { + base.SetProperties(); + } + } + + + + +} + diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AuxiliariesViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AuxiliariesViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..1d503d78964c94d0a946a0de8c89a60572ee5682 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AuxiliariesViewModel.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class AuxiliariesViewModel : ViewModelBase, IComponentViewModel, IAuxiliariesViewModel + { + private static readonly string _name = "Auxiliaries"; + public string Name { get { return _name; } } + + protected IXMLAuxiliariesDeclarationInputData _inputData; + + protected IComponentViewModelFactory _componentViewModelFactory; + private bool _isPresent = true; + private ObservableCollection<IAuxiliaryViewModel> _auxiliaryViewModels = new ObservableCollection<IAuxiliaryViewModel>(); + + + public bool IsPresent { get { return _isPresent; } } + + public ObservableCollection<IAuxiliaryViewModel> AuxiliaryViewModels { + get => _auxiliaryViewModels; + set => SetProperty(ref _auxiliaryViewModels, value); } + + public abstract void CreateAuxiliaries(); + + protected AuxiliariesViewModel(IXMLAuxiliariesDeclarationInputData inputData, IComponentViewModelFactory componentViewModelFactory) + { + _inputData = inputData; + _componentViewModelFactory = componentViewModelFactory; + + Debug.Assert(_inputData != null); + CreateAuxiliaries(); + + + } + + private bool _savedInDeclarationMode; + private IList<IAuxiliaryDeclarationInputData> _auxiliaries; + public virtual bool SavedInDeclarationMode => throw new NotImplementedException(); + + public virtual IList<IAuxiliaryDeclarationInputData> Auxiliaries => _auxiliaryViewModels.Cast<IAuxiliaryDeclarationInputData>().ToList(); + } + + public class AuxiliariesViewModel_v1_0 : AuxiliariesViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationAuxiliariesDataProviderV10).FullName; + + public AuxiliariesViewModel_v1_0(IXMLAuxiliariesDeclarationInputData inputData, IComponentViewModelFactory componentViewModelFactory) : base(inputData, componentViewModelFactory) + { + } + + public override void CreateAuxiliaries() + { + foreach (var auxiliary in _inputData.Auxiliaries) + { + Debug.Assert(auxiliary.Technology.Count == 1); + var componentViewModel = _componentViewModelFactory.CreateComponentViewModel(auxiliary as IXMLAuxiliaryDeclarationInputData); + AuxiliaryViewModels.Add(componentViewModel as IAuxiliaryViewModel); + } + } + } + + public class AuxiliariesViewModel_v2_0 : AuxiliariesViewModel_v1_0 + { + public static new readonly string VERSION = typeof(XMLDeclarationAuxiliariesDataProviderV20).FullName; + + public AuxiliariesViewModel_v2_0(IXMLAuxiliariesDeclarationInputData inputData, IComponentViewModelFactory componentViewModelFactory) : base(inputData, componentViewModelFactory) + { + } + + public override void CreateAuxiliaries() + { + base.CreateAuxiliaries(); + } + } + + public class AuxiliariesViewModel_v2_3 : AuxiliariesViewModel_v2_0 + { + public static new readonly string VERSION = typeof(XMLDeclarationAuxiliariesDataProviderV23).ToString(); + + public AuxiliariesViewModel_v2_3(IXMLAuxiliariesDeclarationInputData inputData, IComponentViewModelFactory componentViewModelFactory) : base(inputData, componentViewModelFactory) + { + } + + public override void CreateAuxiliaries() + { + base.CreateAuxiliaries(); + } + } + + + + +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AuxiliaryViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AuxiliaryViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..9c853ee032451d8780fb58be0a659afd7ab72a02 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AuxiliaryViewModel.cs @@ -0,0 +1,104 @@ +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using TUGraz.VectoCore.Models.Declaration; +using VECTO3GUI2020.Model.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class AuxiliaryViewModel : ViewModelBase, IComponentViewModel, IAuxiliaryViewModel + { + + protected string _name; + private string _technologyName; + private IList<string> _technologyList; + + public string Name + { + get => _name; + set => SetProperty(ref _name, value); + } + + public string TechnologyName + { + get => _technologyName; + set + { + _technology[0] = value; + SetProperty(ref _technologyName, value); + } + } + + public IList<string> TechnologyList + { + get => _technologyList; + } + + + + public bool IsPresent => true; + + protected IDeclarationAuxiliaryTable _auxiliaryTable; + protected IXMLAuxiliaryDeclarationInputData _inputData; + + + public AuxiliaryViewModel(IXMLAuxiliaryDeclarationInputData inputData, + IAuxiliaryModelFactory auxiliaryModelFactory) + { + _inputData = inputData; + _type = _inputData.Type; + _name = AuxiliaryTypeHelper.ToString(_type); + _technology = _inputData.Technology; + _technologyName = _inputData.Technology[0]; + Debug.Assert(_inputData.Technology.Count == 1); + + _auxiliaryTable = auxiliaryModelFactory.CreateAuxiliaryModel(_type); + _technologyList = _auxiliaryTable.GetTechnologies().ToList(); + } + + #region Implementation of IAuxiliaryDeclarationType + protected AuxiliaryType _type; + protected IList<string> _technology; + + public AuxiliaryType Type + { + get => _type; + } + + public IList<string> Technology {get => _technology; } + #endregion + } + + public class AuxiliaryViewModel_v1_0 : AuxiliaryViewModel + { + + public static readonly string VERSION = typeof(XMLAuxiliaryDeclarationDataProviderV10).FullName; + public AuxiliaryViewModel_v1_0(IXMLAuxiliaryDeclarationInputData inputData, IAuxiliaryModelFactory auxiliaryModelFactory) : base(inputData, auxiliaryModelFactory) + { + } + } + + public class AuxiliaryViewModel_v2_0 : AuxiliaryViewModel_v1_0 + { + public static new readonly string VERSION = typeof(XMLAuxiliaryDeclarationDataProviderV20).FullName; + public AuxiliaryViewModel_v2_0(IXMLAuxiliaryDeclarationInputData inputData, IAuxiliaryModelFactory auxiliaryModelFactory) : base(inputData, auxiliaryModelFactory) + { + } + } + + public class AuxiliaryViewModel_v2_3 : AuxiliaryViewModel_v2_0 + { + public static new readonly string VERSION = typeof(XMLAuxiliaryDeclarationDataProviderV23).FullName; + public AuxiliaryViewModel_v2_3(IXMLAuxiliaryDeclarationInputData inputData, IAuxiliaryModelFactory auxiliaryModelFactory) : base(inputData, auxiliaryModelFactory) + { + + } + } + + +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AxleGearViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AxleGearViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..d20748d4577c01de90e414cd87cefac0d0dc1e39 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AxleGearViewModel.cs @@ -0,0 +1,186 @@ +using System; +using System.Data; +using System.Diagnostics; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class AxleGearViewModel : ViewModelBase, IComponentViewModel, IAxleGearViewModel + { + private readonly static string _name = "Axle Gear"; + public string Name { get { return _name; } } + + private bool _isPresent = true; + public bool IsPresent { get { return _isPresent; } } + + protected IAxleGearInputData _inputData; + protected ICommonComponentViewModel _commonComponentViewModel; + + + public ICommonComponentViewModel CommonComponentViewModel { + get => _commonComponentViewModel; + set => SetProperty(ref _commonComponentViewModel, value); } + + protected abstract void SetProperties(); + + public AxleGearViewModel(IXMLAxleGearInputData inputData, IComponentViewModelFactory vmFactory) + { + _inputData = inputData as IAxleGearInputData; + Debug.Assert(_inputData != null); + _isPresent = (_inputData?.DataSource != null); + + CommonComponentViewModel = vmFactory.CreateCommonComponentViewModel(_inputData); + + SetProperties(); + } + + #region implementation of IAxleGearInputData + protected double _ratio; + protected TableData _lossMap; + protected double _efficiency; + protected AxleLineType _lineType; + public DataSource DataSource + { + get => _commonComponentViewModel.DataSource; + set => _commonComponentViewModel.DataSource = value; + } + + public string Manufacturer + { + get => _commonComponentViewModel.Manufacturer; + set => _commonComponentViewModel.Manufacturer = value; + } + + public string Model + { + get => _commonComponentViewModel.Model; + set => _commonComponentViewModel.Model = value; + } + + public DateTime Date + { + get => _commonComponentViewModel.Date; + set => _commonComponentViewModel.Date = value; + } + + public string CertificationNumber + { + get => _commonComponentViewModel.CertificationNumber; + set => _commonComponentViewModel.CertificationNumber = value; + } + + public CertificationMethod CertificationMethod + { + get => _commonComponentViewModel.CertificationMethod; + set => _commonComponentViewModel.CertificationMethod = value; + } + + public bool SavedInDeclarationMode + { + get => _commonComponentViewModel.SavedInDeclarationMode; + set => _commonComponentViewModel.SavedInDeclarationMode = value; + } + + public DigestData DigestValue + { + get => _commonComponentViewModel.DigestValue; + set => _commonComponentViewModel.DigestValue = value; + } + + public string AppVersion => _commonComponentViewModel.AppVersion; + + public virtual double Ratio {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual TableData LossMap {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual double Efficiency {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual AxleLineType LineType {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + #endregion + } + + + + public class AxleGearViewModel_v1_0 : AxleGearViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationAxlegearDataProviderV10).FullName; + public AxleGearViewModel_v1_0(IXMLAxleGearInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + } + + + protected override void SetProperties() + { + throw new NotImplementedException(); + } + } + + public class AxleGearViewModel_v2_0 : AxleGearViewModel_v1_0 + { + public static new readonly string VERSION = typeof(XMLDeclarationAxlegearDataProviderV20).FullName; + + + + public override double Ratio + { + get => _ratio; + set => SetProperty(ref _ratio, value); + } + + public override TableData LossMap + { + get => _lossMap; + set => SetProperty(ref _lossMap, value); + } + + public DataTable LossMapDT + { + get => (DataTable)_lossMap; + } + + public override AxleLineType LineType + { + get => _lineType; + set => SetProperty(ref _lineType, value); + } + + public override double Efficiency + { + get => _efficiency; + set => SetProperty(ref _efficiency, value); + } + + public AxleGearViewModel_v2_0(IXMLAxleGearInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + + } + + protected override void SetProperties() + { + _ratio = _inputData.Ratio; + _lineType = _inputData.LineType; + _lossMap = _inputData.LossMap; + + _lossMap.TableName = "Loss Map"; + // not supported in Declaration mode_efficiency = _inputData.Efficiency; + } + + #region override Properties + + + + + + + + #endregion + + } +} + diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AxleViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AxleViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..5d56b5bbcabb8b2947d32ae1a72dbea4963d84cf --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AxleViewModel.cs @@ -0,0 +1,90 @@ +using System.Diagnostics; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class AxleViewModel : ViewModelBase, IComponentViewModel, IAxleViewModel + { + public string Name => "Axle Wheels"; + + public abstract string Version { get; } + + public bool IsPresent => true; + + protected IXMLAxleDeclarationInputData _inputData; + + private bool _twinTyres; + + public bool TwinTyres { get => _twinTyres; set => SetProperty(ref _twinTyres, value); } + + + + private AxleType _axleType; + public AxleType AxleType { get => _axleType; set => SetProperty(ref _axleType, value); } + + private int _axleNumber; + public int AxleNumber { get => _axleNumber; + set => SetProperty(ref _axleNumber, value); + } + public DataSource DataSource => _dataSource; + + private ITyreViewModel _tyreViewModel; + public ITyreViewModel TyreViewModel { + get => _tyreViewModel; + set => SetProperty(ref _tyreViewModel, value); + } + ITyreDeclarationInputData IAxleDeclarationInputData.Tyre => _tyreViewModel; + + private bool _steered; + private DataSource _dataSource; + public bool Steered { get => _steered; set => SetProperty(ref _steered, value); } + + + + public AxleViewModel(IXMLAxleDeclarationInputData inputData, IComponentViewModelFactory vmFactory) + { + _inputData = inputData; + Debug.Assert(_inputData != null); + + _axleType = _inputData.AxleType; + _twinTyres = _inputData.TwinTyres; + _axleNumber = 0; //_inputData.AxleNumber; + _steered = false; //_inputData.Steered; + _tyreViewModel = (ITyreViewModel)vmFactory.CreateComponentViewModel(_inputData.Tyre); + } + + public override string ToString() + { + return _inputData.AxleType.ToString(); + } + } + + + public class AxleViewModel_v1_0 : AxleViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationAxleDataProviderV10).FullName; + + + public AxleViewModel_v1_0(IXMLAxleDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + + + } + + public override string Version => VERSION; + } + + public class AxleViewModel_v2_0 : AxleViewModel_v1_0 + { + public static new readonly string VERSION = typeof(XMLDeclarationAxleDataProviderV20).FullName; + public AxleViewModel_v2_0(IXMLAxleDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + + } + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AxleWheelsViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AxleWheelsViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..97c194b88d1633123a82426ceb6421550b3cb29c --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/AxleWheelsViewModel.cs @@ -0,0 +1,76 @@ +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; +using System.Xml; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class AxleWheelsViewModel : ViewModelBase, IComponentViewModel, IAxleWheelsViewModel + { + private static readonly string _name = "Axle Wheels"; + public string Name { get { return _name; } } + private bool _isPresent = true; + public bool IsPresent { get { return _isPresent; } } + + protected IXMLAxlesDeclarationInputData _inputData; + + + + public ObservableCollection<IComponentViewModel> AxleViewModels { get; set; } = new ObservableCollection<IComponentViewModel>(); + private IList<IAxleDeclarationInputData> _axlesInputData; + private XmlNode _xmlSource; + + public AxleWheelsViewModel(IXMLAxlesDeclarationInputData inputData, IComponentViewModelFactory vmFactory) + { + _inputData = inputData as IXMLAxlesDeclarationInputData; + Debug.Assert(_inputData != null); + _isPresent = (_inputData?.DataSource?.SourceFile != null); + + _axlesInputData = _inputData.AxlesDeclaration as IList<IAxleDeclarationInputData>; + Debug.Assert(_axlesInputData != null); + + + + + for (int i = 0; i < _axlesInputData.Count(); i++) + { + AxleViewModels.Add(vmFactory.CreateComponentViewModel(_axlesInputData[i])); + } + } + + + public IList<IAxleDeclarationInputData> AxlesDeclaration => + AxleViewModels.Cast<IAxleDeclarationInputData>().ToList(); + + public XmlNode XMLSource => _xmlSource; + } + + public class AxleWheelsViewModel_v1_0 : AxleWheelsViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationAxlesDataProviderV10).FullName; + + + + public AxleWheelsViewModel_v1_0(IXMLAxlesDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + + + } + } + + public class AxleWheelsViewModel_v2_0 : AxleWheelsViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationAxlesDataProviderV20).FullName; + + public AxleWheelsViewModel_v2_0(IXMLAxlesDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + + } + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/CommonComponentViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/CommonComponentViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..8227d65355c8aa60291b62a0537cea2b88f4c2ca --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/CommonComponentViewModel.cs @@ -0,0 +1,88 @@ +using Ninject; +using System; +using System.Diagnostics; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public class CommonComponentViewModel : ViewModelBase, ICommonComponentViewModel + { + private string _manufacturer = "No Manufacturer found"; + private string _model = "No Model found"; + private DateTime _date = new DateTime(1985, 10, 26, 01, 21, 00); + private DataSource _dataSource; + private bool _savedInDeclarationMode; + private string _appVersion; + private CertificationMethod _certificationMethod; + private string _certificationNumber; + private DigestData _digestValue; + + #region Implementation of IComponentInputData + + + public string Manufacturer { get => _manufacturer; set => SetProperty(ref _manufacturer, value); } + public string Model { get => _model; set => SetProperty(ref _model, value); } + public DateTime Date { get => _date; set => SetProperty(ref _date, value); } + + public DataSource DataSource + { + get { return _dataSource; } + set { SetProperty(ref _dataSource, value); } + } + + public bool SavedInDeclarationMode + { + get => _savedInDeclarationMode; + set => SetProperty(ref _savedInDeclarationMode, value); + } + + public string AppVersion + { + get => _appVersion; + set => SetProperty(ref _appVersion, value); + } + + public CertificationMethod CertificationMethod + { + get => _certificationMethod; + set => SetProperty(ref _certificationMethod, value); + } + + public string CertificationNumber + { + get => _certificationNumber; + set => SetProperty(ref _certificationNumber, value); + } + + public DigestData DigestValue + { + get => _digestValue; + set => SetProperty(ref _digestValue, value); + } + + #endregion + + [Inject] + public CommonComponentViewModel(IComponentInputData inputData) { + Debug.Assert(inputData != null); + try { + _manufacturer = inputData.Manufacturer; + _model = inputData.Model; + _date = inputData.Date; + _dataSource = inputData.DataSource; + _savedInDeclarationMode = inputData.SavedInDeclarationMode; + _appVersion = inputData.AppVersion; + _certificationMethod = inputData.CertificationMethod; + _certificationNumber = inputData.CertificationNumber; + _digestValue = inputData.DigestValue; + + } catch (Exception e){ + //TODO ignoring for now + } + } + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/ComponentsViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/ComponentsViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..3fd5661df9df2f919ad69f821b36dacca1df5d2c --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/ComponentsViewModel.cs @@ -0,0 +1,252 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class ComponentsViewModel : ViewModelBase, IComponentsViewModel + { + public ObservableCollection<IComponentViewModel> _components = new ObservableCollection<IComponentViewModel>(); + + protected IComponentViewModelFactory _componentViewModelFactory; + protected IVehicleComponentsDeclaration _inputData; + + public ObservableCollection<IComponentViewModel> Components + { + get { return _components; } + set { SetProperty(ref _components, value); } + } + + public IRetarderViewModel RetarderViewModel + { + get => _retarderViewModel; + } + + public IEngineViewModel EngineViewModel + { + get => _engineViewModel; + } + + public IAngleDriveViewModel AngleDriveViewModel + { + get => _angledriveViewModel; + } + + public IAirDragViewModel AirDragViewModel + { + get => _airdragViewModel; + } + + public IPTOViewModel PTOViewModel + { + get => _ptoViewModel; + } + + protected abstract void CreateComponents(); + + public ComponentsViewModel(IXMLVehicleComponentsDeclaration inputData, IComponentViewModelFactory vmFactory) + { + _componentViewModelFactory = vmFactory; + _inputData = inputData; + CreateComponents(); + } + + + protected IAngleDriveViewModel _angledriveViewModel; + protected IRetarderViewModel _retarderViewModel; + protected IAirDragViewModel _airdragViewModel; + protected IPTOViewModel _ptoViewModel; + protected IEngineViewModel _engineViewModel; + + #region Implementation of IVehicleComponentsdeclaration + + protected IGearboxDeclarationInputData _gearboxInputData; + protected ITorqueConverterDeclarationInputData _torqueConverterInputData; + protected IAxleGearInputData _axleGearInputData; + protected IEngineDeclarationInputData _engineInputData; + protected IAuxiliariesDeclarationInputData _auxiliaryInputData; + protected IAxlesDeclarationInputData _axleWheels; + protected IBusAuxiliariesDeclarationData _busAuxiliaries; + + + + public virtual IAirdragDeclarationInputData AirdragInputData + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual IGearboxDeclarationInputData GearboxInputData + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual ITorqueConverterDeclarationInputData TorqueConverterInputData + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + + } + + public virtual IAxleGearInputData AxleGearInputData + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual IAngledriveInputData AngledriveInputData + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual IEngineDeclarationInputData EngineInputData + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual IAuxiliariesDeclarationInputData AuxiliaryInputData + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual IRetarderInputData RetarderInputData + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual IPTOTransmissionInputData PTOTransmissionInputData + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual IAxlesDeclarationInputData AxleWheels + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual IBusAuxiliariesDeclarationData BusAuxiliaries + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public IElectricStorageDeclarationInputData ElectricStorage => throw new NotImplementedException(); + + public IElectricMachinesDeclarationInputData ElectricMachines => throw new NotImplementedException(); + + #endregion + + } + public class ComponentsViewModel_v1_0 : ComponentsViewModel + { + + public static new readonly string VERSION = typeof(XMLDeclarationComponentsDataProviderV10).FullName; + + public ComponentsViewModel_v1_0(IXMLVehicleComponentsDeclaration inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + + } + + + protected override void CreateComponents() + { + throw new NotImplementedException(); + } + } + + + public class ComponentsViewModel_v2_0 : ComponentsViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationComponentsDataProviderV20).FullName; + private IAxleGearViewModel _axlegearViewModel; + private IGearBoxViewModel _gearBoxViewModel; + private IAxleWheelsViewModel _axleWheelsViewModel; + private IAuxiliariesViewModel _auxiliaryViewModel; + + public ComponentsViewModel_v2_0(IXMLVehicleComponentsDeclaration inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + _inputData = inputData; + } + + + protected override void CreateComponents() + { + _engineViewModel = _componentViewModelFactory.CreateComponentViewModel(_inputData.EngineInputData) as IEngineViewModel; + Components.Add(_engineViewModel); + + _axlegearViewModel = _componentViewModelFactory.CreateComponentViewModel(_inputData.AxleGearInputData) as IAxleGearViewModel; + Components.Add(_axlegearViewModel); + + _gearBoxViewModel = _componentViewModelFactory.CreateComponentViewModel(_inputData.GearboxInputData) as IGearBoxViewModel; + Components.Add(_gearBoxViewModel); + + _angledriveViewModel = _componentViewModelFactory.CreateComponentViewModel(_inputData.AngledriveInputData) as IAngleDriveViewModel; + Components.Add(_angledriveViewModel); + + _retarderViewModel = _componentViewModelFactory.CreateComponentViewModel(_inputData.RetarderInputData) as IRetarderViewModel; + Components.Add(_retarderViewModel); + + _axleWheelsViewModel = _componentViewModelFactory.CreateComponentViewModel(_inputData.AxleWheels) as IAxleWheelsViewModel; + Components.Add(_axleWheelsViewModel); + + _auxiliaryViewModel= _componentViewModelFactory.CreateComponentViewModel(_inputData.AuxiliaryInputData) as IAuxiliariesViewModel; + Components.Add(_auxiliaryViewModel); + + _airdragViewModel = _componentViewModelFactory.CreateComponentViewModel(_inputData.AirdragInputData) as IAirDragViewModel; + Components.Add(_airdragViewModel); + + + _ptoViewModel = + _componentViewModelFactory.CreateComponentViewModel(_inputData.PTOTransmissionInputData) as + IPTOViewModel; + Components.Add(_ptoViewModel); + + + } + + #region Overrides + + public override IAirdragDeclarationInputData AirdragInputData => _airdragViewModel.IsPresent ? _airdragViewModel as IAirdragDeclarationInputData : null; + + public override IGearboxDeclarationInputData GearboxInputData => _gearBoxViewModel.IsPresent + ? _gearBoxViewModel as IGearboxDeclarationInputData + : null; + public override IAxleGearInputData AxleGearInputData => _axlegearViewModel.IsPresent ? _axlegearViewModel as IAxleGearInputData : null; + public override IAngledriveInputData AngledriveInputData => _angledriveViewModel.IsPresent ? _angledriveViewModel as IAngledriveInputData : null; + public override IEngineDeclarationInputData EngineInputData => _engineViewModel.IsPresent ? _engineViewModel as IEngineDeclarationInputData : null; + public override IAuxiliariesDeclarationInputData AuxiliaryInputData => _auxiliaryViewModel.IsPresent ? _auxiliaryViewModel as IAuxiliariesDeclarationInputData : null; + public override IRetarderInputData RetarderInputData => _retarderViewModel.IsPresent ? _retarderViewModel as IRetarderInputData : null; + public override IAxlesDeclarationInputData AxleWheels => _axleWheelsViewModel.IsPresent ? _axleWheelsViewModel as IAxlesDeclarationInputData : null; + /* + public override IPTOTransmissionInputData PTOTransmissionInputData => + _ptoViewModel.IsPresent ? _ptoViewModel as IPTOTransmissionInputData : null; + + public override ITorqueConverterDeclarationInputData TorqueConverterInputData + { + get => _torqueConverterInputData; + set => SetProperty(ref _torqueConverterInputData, value); + } + */ + + #endregion + } + + + + + + +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/EngineFuelViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/EngineFuelViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..b3fc17f7ab8ff907d2566020dcf66d44ad7fddeb --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/EngineFuelViewModel.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public class EngineFuelViewModel : ViewModelBase, IEngineFuelViewModel + { + protected IEngineFuelDeclarationInputData _inputData; + + public EngineFuelViewModel(IEngineFuelDeclarationInputData inputData) + { + _inputData = inputData; + _fuelType = inputData.FuelType; + _whtcMotorway = inputData.WHTCMotorway; + _whtcUrban = inputData.WHTCUrban; + _whtcRural = inputData.WHTCRural; + _coldHotBalancingFactor = inputData.ColdHotBalancingFactor; + _correctionFactorRegPer = inputData.CorrectionFactorRegPer; + _fuelConsumptionMap = inputData.FuelConsumptionMap; + _fuelConsumptionMap.TableName = "Fuel Consumption Map"; + } + #region implementation of IEngineFuelDeclarationInputData + + private FuelType _fuelType; + private double _whtcMotorway; + private double _whtcRural; + private double _whtcUrban; + private double _coldHotBalancingFactor; + private double _correctionFactorRegPer; + private TableData _fuelConsumptionMap; + + + public FuelType FuelType + { + get => _fuelType; + set => _fuelType = value; + } + + public double WHTCMotorway + { + get => _whtcMotorway; + set => _whtcMotorway = value; + } + + public double WHTCRural + { + get => _whtcRural; + set => _whtcRural = value; + } + + public double WHTCUrban + { + get => _whtcUrban; + set => _whtcUrban = value; + } + + public double ColdHotBalancingFactor + { + get => _coldHotBalancingFactor; + set => _coldHotBalancingFactor = value; + } + + public double CorrectionFactorRegPer + { + get => _correctionFactorRegPer; + set => _correctionFactorRegPer = value; + } + + public TableData FuelConsumptionMap + { + get => _fuelConsumptionMap; + set => _fuelConsumptionMap = value; + } + } + #endregion +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/EngineModeViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/EngineModeViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..8b62a8b3fe8f24997b4b3a00f1a5628867c46a7f --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/EngineModeViewModel.cs @@ -0,0 +1,131 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Data; +using System.Dynamic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.Models.SimulationComponent.Data; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class EngineModeViewModel : ViewModelBase, IEngineModeViewModel + { + protected IEngineModeDeclarationInputData _inputData; + protected IComponentViewModelFactory _componentVmFactory; + + public EngineModeViewModel(IEngineModeDeclarationInputData inputData, IComponentViewModelFactory componentVmFactory) + { + _inputData = inputData; + _componentVmFactory = componentVmFactory; + } + + #region implementation of IEngineModeDeclaration + public virtual PerSecond IdleSpeed + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public virtual TableData FullLoadCurve + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public virtual IList<IEngineFuelDeclarationInputData> Fuels + { + get { throw new NotImplementedException(); } + } + + public virtual IWHRData WasteHeatRecoveryDataElectrical + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public virtual IWHRData WasteHeatRecoveryDataMechanical + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + #endregion + } + + + public class EngineModeViewModelSingleFuel : EngineModeViewModel + { + public static readonly string VERSION = + typeof(XMLDeclarationEngineDataProviderV10.XMLSingleFuelEngineMode).FullName; + + private PerSecond _idleSpeed; + private TableData _fullLoadCurve; + private IWHRData _wasteHeatRecoveryDataElectrical; + private IWHRData _wasteHeatRecoveryDataMechanical; + private ObservableCollection<IEngineFuelViewModel> _fuelViewModels; + + public EngineModeViewModelSingleFuel(IEngineModeDeclarationInputData inputData, IComponentViewModelFactory componentVmFactory) : base(inputData, + componentVmFactory) + { + + _fuelViewModels = new ObservableCollection<IEngineFuelViewModel>(); + _idleSpeed = inputData.IdleSpeed; + _fullLoadCurve = inputData.FullLoadCurve; + _wasteHeatRecoveryDataElectrical = inputData.WasteHeatRecoveryDataElectrical; + _wasteHeatRecoveryDataMechanical = inputData.WasteHeatRecoveryDataMechanical; + + _fullLoadCurve.TableName = "Full Load Curve"; + + + foreach (var fuel in inputData.Fuels) { + FuelViewModels.Add(_componentVmFactory.CreateEngineFuelViewModel(fuel)); + } + } + + public ObservableCollection<IEngineFuelViewModel> FuelViewModels { get => _fuelViewModels; set => SetProperty(ref _fuelViewModels, value); } + + public IEngineFuelViewModel FuelViewModel + { + get => FuelViewModels[0]; + } + public override PerSecond IdleSpeed + { + get => _idleSpeed; + set => SetProperty(ref _idleSpeed, value); + } + + public override TableData FullLoadCurve + { + get => _fullLoadCurve; + set => SetProperty(ref _fullLoadCurve, value); + } + + public DataTable FullLoadDT + { + get => (DataTable)_fullLoadCurve; + //get => _fullLoadCurve.AsDataView().ToTable(); + } + + public override IList<IEngineFuelDeclarationInputData> Fuels => + FuelViewModels.Cast<IEngineFuelDeclarationInputData>().ToList(); + + public override IWHRData WasteHeatRecoveryDataElectrical + { + get { return _wasteHeatRecoveryDataElectrical;} + set => SetProperty(ref _wasteHeatRecoveryDataElectrical, value); + } + + public override IWHRData WasteHeatRecoveryDataMechanical + { + get => _wasteHeatRecoveryDataMechanical; + set => SetProperty(ref _wasteHeatRecoveryDataMechanical, value); + } + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/EngineViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/EngineViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..de57bd636889d5c9b40d94fba8c048caf9799ede --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/EngineViewModel.cs @@ -0,0 +1,269 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using TUGraz.VectoCore.Models.Declaration; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class EngineViewModel : ViewModelBase, IComponentViewModel, IEngineViewModel + { + + + protected readonly IEngineDeclarationInputData _inputData; + + + private ICommonComponentViewModel _commonComponentViewModel; + public ICommonComponentViewModel CommonComponentViewModel { + get => _commonComponentViewModel; + set => SetProperty(ref _commonComponentViewModel, value); } + private static readonly string _name = "Engine"; + public string Name { get { return _name; } } + private bool _isPresent; + public bool IsPresent { get { return _isPresent; } } + + + protected abstract void SetProperties(); + + + + + + public EngineViewModel(IXMLEngineDeclarationInputData inputData, + IComponentViewModelFactory componentFactory) + { + + _inputData = inputData as IXMLEngineDeclarationInputData; + Debug.Assert(_inputData != null); + _isPresent = (_inputData != null); + _componentFactory = componentFactory; + Debug.Assert(_inputData != null); + + + SetProperties(); + } + + #region Implementation of IEngineDeclarationInputData + protected CubicMeter _displacement; + protected Watt _ratedPowerDeclared; + protected PerSecond _ratedSpeedDeclared; + protected NewtonMeter _maxTorqueDeclared; + //protected IList<IEngineModeDeclarationInputData> _engineModes; + protected WHRType _whrType; + protected IComponentViewModelFactory _componentFactory; + protected PerSecond _idlingSpeed; + + + public virtual DataSource DataSource + { + get => _commonComponentViewModel.DataSource; + set => _commonComponentViewModel.DataSource = value; + } + + public string Manufacturer + { + get => _commonComponentViewModel.Manufacturer; + set => _commonComponentViewModel.Manufacturer = value; + } + + public string Model + { + get => _commonComponentViewModel.Model; + set => _commonComponentViewModel.Model = value; + } + + public DateTime Date + { + get => _commonComponentViewModel.Date; + set => _commonComponentViewModel.Date = value; + } + + public string CertificationNumber + { + get => _commonComponentViewModel.CertificationNumber; + set => _commonComponentViewModel.CertificationNumber = value; + } + + public CertificationMethod CertificationMethod + { + get => _commonComponentViewModel.CertificationMethod; + set => _commonComponentViewModel.CertificationMethod = value; + } + + public bool SavedInDeclarationMode + { + get => _commonComponentViewModel.SavedInDeclarationMode; + set => _commonComponentViewModel.SavedInDeclarationMode = value; + } + + public DigestData DigestValue + { + get => _commonComponentViewModel.DigestValue; + set => _commonComponentViewModel.DigestValue = value; + } + + public string AppVersion => _commonComponentViewModel.AppVersion; + + public virtual CubicMeter Displacement + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual Watt RatedPowerDeclared + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual PerSecond RatedSpeedDeclared + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual NewtonMeter MaxTorqueDeclared + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual IList<IEngineModeDeclarationInputData> EngineModes + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual WHRType WHRType + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + + public virtual PerSecond IdlingSpeed + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + #endregion + } + + + public class EngineViewModel_v1_0 : EngineViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationEngineDataProviderV10).FullName; + public EngineViewModel_v1_0(IXMLEngineDeclarationInputData inputData, + IComponentViewModelFactory componentFactory) : base(inputData, componentFactory) + { + + } + + protected override void SetProperties() + { + throw new NotImplementedException(); + } + } + + public class EngineViewModel_v2_0 : EngineViewModel_v1_0 + { + public new static readonly string VERSION = typeof(XMLDeclarationEngineDataProviderV20).FullName; + + + + #region overrides of used Properties + public override CubicMeter Displacement + { + get => _displacement; + set => SetProperty(ref _displacement, value); + } + + public override Watt RatedPowerDeclared + { + get => _ratedPowerDeclared; + set => SetProperty(ref _ratedPowerDeclared, value); + } + + public override PerSecond RatedSpeedDeclared + { + get => _ratedSpeedDeclared; + set => SetProperty(ref _ratedSpeedDeclared, value); + } + + public override NewtonMeter MaxTorqueDeclared + { + get => _maxTorqueDeclared; + set => SetProperty(ref _maxTorqueDeclared, value); + } + + private ObservableCollection<IEngineModeViewModel> _engineModeViewModels = new ObservableCollection<IEngineModeViewModel>(); + public ObservableCollection<IEngineModeViewModel> EngineModeViewModels + { + get => _engineModeViewModels; + set => SetProperty(ref _engineModeViewModels, value); + } + + + public override IList<IEngineModeDeclarationInputData> EngineModes + { + get => _engineModeViewModels.Cast<IEngineModeDeclarationInputData>().ToList(); + set => throw new NotImplementedException(); + } + + + public override WHRType WHRType + { + get => _whrType; + set => SetProperty(ref _whrType, value); + } + + public override PerSecond IdlingSpeed + { + get + { + return EngineModeViewModels[0].IdleSpeed; + } + set + { + EngineModeViewModels[0].IdleSpeed = value; + } + } + + #endregion + + + public EngineViewModel_v2_0(IXMLEngineDeclarationInputData inputData, + IComponentViewModelFactory componentFactory) : + base(inputData, componentFactory) + { + } + + + protected override void SetProperties() + { + CommonComponentViewModel = _componentFactory.CreateCommonComponentViewModel(_inputData); + + _displacement = _inputData.Displacement; + _ratedSpeedDeclared = _inputData.RatedSpeedDeclared; + _ratedPowerDeclared = _inputData.RatedPowerDeclared; + _maxTorqueDeclared = _inputData.MaxTorqueDeclared; + _whrType = _inputData.WHRType; + + + foreach (var engineMode in _inputData.EngineModes) { + EngineModeViewModels.Add(_componentFactory.CreateEngineModeViewModel(engineMode)); + } + + + } + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/GearViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/GearViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..d72c74db4e91d4bf4c551c80d143cfc3dc3894e3 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/GearViewModel.cs @@ -0,0 +1,207 @@ +using System; +using System.Data; +using System.Diagnostics; +using System.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class GearViewModel : ViewModelBase, IComponentViewModel, IGearViewModel + { + IComponentViewModelFactory _vmFactory; + protected IXMLGearData _inputData; + + + + public abstract void SetProperties(); + + public double MaxTorqueLossCalculated => GetMaxTorqueLossFromTable(); + public double MinTorqueLossCalculated => GetMinTorqueLossFromTable(); + + + public double MaxInputSpeedCalculated => GetMaxInputSpeedFromTable(); + public double MinInputSpeedCalculated => GetMinInputSpeedFromTable(); + + public double MaxInputTorqueCalculated => GetMaxInputSpeedFromTable(); + + public double MinInputTorqueCalculated => GetMinInputTorqueFromTable(); + + + public DataView LossMapDataView => _lossMap.DefaultView; + + public GearViewModel(IXMLGearData inputData) + { + _inputData = inputData as IXMLGearData; + Debug.Assert(_inputData != null); + + + SetProperties(); + CalculateEfficiency(); + } + + + + private void CalculateEfficiency() + { + DataColumn efficiencyColumn = new DataColumn("Efficiency", typeof(double)); + LossMap.Columns.Add(efficiencyColumn); + foreach (DataRow row in _lossMap.Rows) + { + row[efficiencyColumn.ColumnName] = Math.Round((row.Field<string>("Torque Loss").ToDouble() + row.Field<string>("Input Torque").ToDouble()) / row.Field<string>("Input Torque").ToDouble(),2); + } + } + + + private double GetMinTorqueLossFromTable() + { + return _lossMap.Columns["Torque Loss"].Values<String>().ToDouble().Min(); + } + private double GetMaxTorqueLossFromTable() + { + return _lossMap.Columns["Torque Loss"].Values<String>().ToDouble().Max(); ; + } + private double GetMinInputSpeedFromTable() + { + return _lossMap.Columns["Input Speed"].Values<String>().ToDouble().Min(); + } + private double GetMaxInputSpeedFromTable() + { + return _lossMap.Columns["Input Speed"].Values<String>().ToDouble().Max(); + } + private double GetMaxInputTorqueFromTable() + { + return _lossMap.Columns["Torque Input"].Values<String>().ToDouble().Max(); + } + private double GetMinInputTorqueFromTable() + { + return _lossMap.Columns["Torque Input"].Values<String>().ToDouble().Min(); + + } + + protected string _name = "gear"; + public string Name => _name; + + public bool IsPresent => true; + + + #region Implementation of ITransmissionInputData + protected int _gear; + protected double _ratio; + protected TableData _lossMap; + protected double _efficiency; + protected NewtonMeter _maxTorqueInput; + protected PerSecond _maxInputSpeed; + protected TableData _shiftPolygon; + protected DataSource _dataSource; + + public virtual int Gear {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual double Ratio {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual TableData LossMap {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual double Efficiency {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual NewtonMeter MaxTorque {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual PerSecond MaxInputSpeed {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual TableData ShiftPolygon {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual DataSource DataSource {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + #endregion + } + + + + public class GearViewModel_v1_0 : GearViewModel + { + + public static readonly string VERSION = typeof(XMLGearDataV10).FullName; + public GearViewModel_v1_0(IXMLGearData inputData) : base(inputData) + { + + } + + public override void SetProperties() + { + throw new NotImplementedException(); + } + } + + public class GearViewModel_v2_0 : GearViewModel_v1_0 + { + public static readonly string VERSION = typeof(XMLGearDataV20).FullName; + + + public GearViewModel_v2_0(IXMLGearData inputData) : base(inputData) + { + + } + + public override void SetProperties() + { + _name += " " + _gear; + _gear = _inputData.Gear; + _ratio = _inputData.Ratio; + _lossMap = _inputData.LossMap; + _lossMap.TableName = "Loss Map"; + _efficiency = _inputData.Efficiency; + _maxTorqueInput = _inputData.MaxTorque; + _maxInputSpeed = _inputData.MaxInputSpeed; + _shiftPolygon = _inputData.ShiftPolygon; + } + + #region Override Properties + public override int Gear + { + get => _gear; + set => SetProperty(ref _gear, value); + } + + public override double Ratio + { + get => _ratio; + set => SetProperty(ref _ratio, value); + } + + public override TableData LossMap + { + get => _lossMap; + set => SetProperty(ref _lossMap, value); + } + + public override double Efficiency + { + get => _efficiency; + set => SetProperty(ref _efficiency, value); + } + + public override NewtonMeter MaxTorque + { + get => _maxTorqueInput; + set => SetProperty(ref _maxTorqueInput, value); + } + + public override PerSecond MaxInputSpeed + { + get => _maxInputSpeed; + set => SetProperty(ref _maxInputSpeed, value); + } + + public override TableData ShiftPolygon + { + get => _shiftPolygon; + set => SetProperty(ref _shiftPolygon, value); + } + + #endregion + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/GearboxViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/GearboxViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..4f4c491faa5b0fb3b0672919387deab5bf95ff3a --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/GearboxViewModel.cs @@ -0,0 +1,173 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Diagnostics; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using System.Collections.ObjectModel; +using TUGraz.VectoCommon.Models; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + + + public abstract class GearboxViewModel : ViewModelBase, IComponentViewModel, IGearBoxViewModel + { + private static readonly string _name = "Gearbox"; + public string Name { get { return _name; } } + + protected IXMLGearboxDeclarationInputData _inputData; + + + + private bool _isPresent = true; + public bool IsPresent { get { return _isPresent; } } + + protected ObservableCollection<IGearViewModel> _gearViewModels = new ObservableCollection<IGearViewModel>(); + + public ObservableCollection<IGearViewModel> GearViewModels + { + get { return _gearViewModels; } + set { SetProperty(ref _gearViewModels, value); } + } + + protected ICommonComponentViewModel _commonComponentViewModel; + + + public ICommonComponentViewModel CommonComponentViewModel + { + get => _commonComponentViewModel; + set => SetProperty(ref _commonComponentViewModel, value); + + } + + public GearboxViewModel(IXMLGearboxDeclarationInputData inputData, IComponentViewModelFactory componentViewModelFactory) + { + _inputData = inputData as IXMLGearboxDeclarationInputData; + Debug.Assert(_inputData != null); + if (!(_isPresent = ((IComponentInputData)_inputData).DataSource != null)) + { + return; + } + + _commonComponentViewModel = componentViewModelFactory.CreateCommonComponentViewModel(_inputData); + + + SetProperties(); + foreach (var gear in _inputData.Gears) + { + _gearViewModels.Add((IGearViewModel)componentViewModelFactory.CreateComponentViewModel(gear)); + } + } + + public abstract void SetProperties(); + + #region Implementation of IGearBoxDeclarationInputData + protected GearboxType _type; + protected IList<ITransmissionInputData> _gears; + protected bool _differentialIncluded; + protected double _axlegearRatio; + public DataSource DataSource + { + get => _commonComponentViewModel.DataSource; + set => _commonComponentViewModel.DataSource = value; + } + + public string Manufacturer + { + get => _commonComponentViewModel.Manufacturer; + set => _commonComponentViewModel.Manufacturer = value; + } + + public string Model + { + get => _commonComponentViewModel.Model; + set => _commonComponentViewModel.Model = value; + } + + public DateTime Date + { + get => _commonComponentViewModel.Date; + set => _commonComponentViewModel.Date = value; + } + + public string CertificationNumber + { + get => _commonComponentViewModel.CertificationNumber; + set => _commonComponentViewModel.CertificationNumber = value; + } + + public CertificationMethod CertificationMethod + { + get => _commonComponentViewModel.CertificationMethod; + set => _commonComponentViewModel.CertificationMethod = value; + } + + public bool SavedInDeclarationMode + { + get => _commonComponentViewModel.SavedInDeclarationMode; + set => _commonComponentViewModel.SavedInDeclarationMode = value; + } + + public DigestData DigestValue + { + get => _commonComponentViewModel.DigestValue; + set => _commonComponentViewModel.DigestValue = value; + } + + public string AppVersion => _commonComponentViewModel.AppVersion; + + public virtual GearboxType Type {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public virtual IList<ITransmissionInputData> Gears {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public virtual bool DifferentialIncluded {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public virtual double AxlegearRatio {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + #endregion + } + + public class GearboxViewModel_v1_0 : GearboxViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationGearboxDataProviderV10).FullName; + + public GearboxViewModel_v1_0(IXMLGearboxDeclarationInputData inputData, IComponentViewModelFactory componentViewModelFactory) : base(inputData, componentViewModelFactory) + { + + + } + + public override void SetProperties() + { + throw new NotImplementedException(); + } + } + + public class GearboxViewModel_v2_0 : GearboxViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationGearboxDataProviderV20).FullName; + + public GearboxViewModel_v2_0(IXMLGearboxDeclarationInputData inputData, IComponentViewModelFactory componentViewModelFactory) : base(inputData, componentViewModelFactory) + { + + } + + public override void SetProperties() + { + _type = _inputData.Type; + //_axlegearRatio = _inputData.AxlegearRatio; + //_differentialIncluded = _inputData.DifferentialIncluded; + } + public override GearboxType Type + { + get => _type; + set => SetProperty(ref _type, value); + } + + public override IList<ITransmissionInputData> Gears + { + get => _gearViewModels.Cast<ITransmissionInputData>().ToList(); + } + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/PTOViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/PTOViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..7b9aa64f47ae49af4c84a9c132412d4172059069 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/PTOViewModel.cs @@ -0,0 +1,116 @@ +using System; +using System.Data; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using TUGraz.VectoCore.Models.Declaration; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class PTOViewModel : ViewModelBase, IComponentViewModel, IPTOViewModel + { + + + protected IPTOTransmissionInputData _inputData; + + protected PTOTransmission ptoTransmission = new PTOTransmission(); + + private bool _isPresent = true; + public bool IsPresent { get => _isPresent; set => SetProperty(ref _isPresent, value); } + + private static readonly string _name = "PTO"; + public string Name { get { return _name; } } + + protected abstract void SetProperties(); + protected PTOViewModel(IXMLPTOTransmissionInputData inputData) + { + _inputData = inputData; + _ptoTransmissionType= _inputData.PTOTransmissionType; + if(_ptoTransmissionType == "None") + { + _isPresent = false; + return; + } + + ptoTransmission.GetTechnologies(); + + SetProperties(); + } + + + + + #region implementation of IPTOTransmissionInputData + + protected string _ptoTransmissionType; + protected TableData _ptoLossMap; + protected TableData _ptoCycle; + public virtual string PTOTransmissionType {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual TableData PTOLossMap {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public virtual TableData PTOCycle {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual DataView PTOLossMapDataView + { + get => PTOLossMap?.DefaultView; + } + + public virtual DataView PTOCycleDataView + { + get => PTOCycle?.DefaultView; + } + +#endregion + } + + public class PTOViewModel_V1_0 : PTOViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationPTODataProviderV10).FullName; + + public PTOViewModel_V1_0(IXMLPTOTransmissionInputData inputData) : base(inputData) + { + + } + + protected override void SetProperties() + { + _ptoTransmissionType = _inputData.PTOTransmissionType; + _ptoCycle = _inputData.PTOCycle; + _ptoLossMap = _inputData.PTOLossMap; + } + + public override string PTOTransmissionType + { + get => _ptoTransmissionType; + set => SetProperty(ref _ptoTransmissionType, value); + } + + public override TableData PTOLossMap + { + get => _ptoLossMap; + set => SetProperty(ref _ptoLossMap, value); + } + + public override TableData PTOCycle + { + get => _ptoCycle; + set => SetProperty(ref _ptoCycle, value); + } + } + + public class PTOViewModel_V2_0 : PTOViewModel_V1_0 + { + public static new readonly string VERSION = typeof(XMLDeclarationPTODataProviderV20).FullName; + public PTOViewModel_V2_0(IXMLPTOTransmissionInputData inputData) : base(inputData) + { + + } + + protected override void SetProperties() + { + base.SetProperties(); + } + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/RetarderViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/RetarderViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..140b7fde659943f02af1c7820da91a1e8d434366 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/RetarderViewModel.cs @@ -0,0 +1,179 @@ +using System; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class RetarderViewModel : ViewModelBase, IComponentViewModel, IRetarderViewModel + { + private static readonly string _name = "Retarder"; + public string Name { get { return _name; } } + + protected IRetarderInputData _inputData; + + + private ICommonComponentViewModel _commonComponentViewModel; + + + public ICommonComponentViewModel CommonComponentViewModel { get + => _commonComponentViewModel; + set { SetProperty(ref _commonComponentViewModel, value); } + } + + private bool _isPresent = false; + public bool IsPresent { get => _isPresent; set => SetProperty(ref _isPresent, value); } + + public DataView LossMapDataView => _lossMap?.DefaultView; + + + public abstract void SetProperties(); + + + + public RetarderViewModel(IXMLRetarderInputData inputData, IComponentViewModelFactory vmFactory) + { + _inputData = inputData as IXMLRetarderInputData; + Debug.Assert(_inputData != null); + IsPresent = _inputData?.DataSource.SourceFile != null; + + + + CommonComponentViewModel = vmFactory.CreateCommonComponentViewModel(inputData); + + + + SetProperties(); + } + + protected RetarderType _type; + protected double _ratio; + protected TableData _lossMap; + + public DataSource DataSource + { + get => _commonComponentViewModel.DataSource; + set => _commonComponentViewModel.DataSource = value; + } + + + public string Manufacturer + { + get => _commonComponentViewModel.Manufacturer; + set => _commonComponentViewModel.Manufacturer = value; + } + + public string Model + { + get => _commonComponentViewModel.Model; + set => _commonComponentViewModel.Model = value; + } + + public DateTime Date + { + get => _commonComponentViewModel.Date; + set => _commonComponentViewModel.Date = value; + } + + public string CertificationNumber + { + get => _commonComponentViewModel.CertificationNumber; + set => _commonComponentViewModel.CertificationNumber = value; + } + + public CertificationMethod CertificationMethod + { + get => _commonComponentViewModel.CertificationMethod; + set => _commonComponentViewModel.CertificationMethod = value; + } + + public bool SavedInDeclarationMode + { + get => _commonComponentViewModel.SavedInDeclarationMode; + set => _commonComponentViewModel.SavedInDeclarationMode = value; + } + + public DigestData DigestValue + { + get => _commonComponentViewModel.DigestValue; + set => _commonComponentViewModel.DigestValue = value; + } + + public string AppVersion => _commonComponentViewModel.AppVersion; + + public virtual RetarderType Type {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public virtual double Ratio {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public virtual TableData LossMap {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual DataTable LossMapDataTable + { + get => (DataTable)LossMap; + } + } + + public class RetarderViewModel_v1_0 : RetarderViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationRetarderDataProviderV10).FullName; + + public RetarderViewModel_v1_0(IXMLRetarderInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + + + } + + public override void SetProperties() + { + if (!IsPresent) { + + _ratio = 0; + } else { + _lossMap = _inputData.LossMap; + _ratio = _inputData.Ratio; + } + _type = _inputData.Type; + } + + public override RetarderType Type + { + get => _type; + set + { + IsPresent = (value != RetarderType.None); + SetProperty(ref _type, value); + } + } + + public override double Ratio + { + get => _ratio; + set => SetProperty(ref _ratio, value); + } + + public override TableData LossMap + { + get => _lossMap; + set => SetProperty(ref _lossMap, value); + } + } + + public class RetarderViewModel_v2_0 : RetarderViewModel_v1_0 + { + public static new readonly string VERSION = typeof(XMLDeclarationRetarderDataProviderV20).FullName; + + public RetarderViewModel_v2_0(IXMLRetarderInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + + } + + public override void SetProperties() + { + base.SetProperties(); + } + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/TorqueConverterViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/TorqueConverterViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..4e4225dfd46cb205a5faf2600ae61bf17d27c076 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/TorqueConverterViewModel.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class TorqueConverterViewModel : ViewModelBase, ITorqueConverterViewModel, IComponentViewModel + { + private IComponentViewModelFactory _vmFactory; + private ITorqueConverterDeclarationInputData _inputData; + private ICommonComponentViewModel _commonComponentViewModel; + private TableData _tcData; + private bool _isPresent; + + + public TorqueConverterViewModel(ITorqueConverterDeclarationInputData inputData, IComponentViewModelFactory vmFactory) + { + _commonComponentViewModel = + vmFactory.CreateCommonComponentViewModel(inputData); + _inputData = inputData; + _vmFactory = vmFactory; + } + + #region Implementation of ITorqueConverterDeclarationInputData + public DataSource DataSource + { + get => _commonComponentViewModel.DataSource; + set => _commonComponentViewModel.DataSource = value; + } + + + public string Manufacturer + { + get => _commonComponentViewModel.Manufacturer; + set => _commonComponentViewModel.Manufacturer = value; + } + + public string Model + { + get => _commonComponentViewModel.Model; + set => _commonComponentViewModel.Model = value; + } + + public DateTime Date + { + get => _commonComponentViewModel.Date; + set => _commonComponentViewModel.Date = value; + } + + public string CertificationNumber + { + get => _commonComponentViewModel.CertificationNumber; + set => _commonComponentViewModel.CertificationNumber = value; + } + + public CertificationMethod CertificationMethod + { + get => _commonComponentViewModel.CertificationMethod; + set => _commonComponentViewModel.CertificationMethod = value; + } + + public bool SavedInDeclarationMode + { + get => _commonComponentViewModel.SavedInDeclarationMode; + set => _commonComponentViewModel.SavedInDeclarationMode = value; + } + + public DigestData DigestValue + { + get => _commonComponentViewModel.DigestValue; + set => _commonComponentViewModel.DigestValue = value; + } + + public string AppVersion => _commonComponentViewModel.AppVersion; + + public virtual TableData TCData + { + get => _tcData; + set => SetProperty(ref _tcData, value); + } + + #endregion + + public string Name => "Torque Converter"; + + public bool IsPresent{ + get => _isPresent; + set => SetProperty(ref _isPresent, value); + } + } + + public class TorqueConverterViewModel_v1_0 : TorqueConverterViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationTorqueConverterDataProviderV10).FullName; + public TorqueConverterViewModel_v1_0(ITorqueConverterDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) { } + } + + public class TorqueConverterViewModel_v2_0 : TorqueConverterViewModel_v1_0 + { + public static readonly new string VERSION = typeof(XMLDeclarationTorqueConverterDataProviderV20).FullName; + + public TorqueConverterViewModel_v2_0(ITorqueConverterDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) { } + } + + +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/TyreViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/TyreViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..ef8cd499672b844e595781ad7ffca0fe8114d386 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/Components/TyreViewModel.cs @@ -0,0 +1,218 @@ +using System; +using System.Collections.ObjectModel; +using System.Diagnostics; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using TUGraz.VectoCore.Models.Declaration; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components +{ + public abstract class TyreViewModel : ViewModelBase, IComponentViewModel, ITyreViewModel + { + + public string Name => "Tyre View Model"; + + public bool IsPresent => true; + + + protected IXMLTyreDeclarationInputData _inputData; + + private ICommonComponentViewModel _commonComponentViewModel; + + + public ICommonComponentViewModel CommonComponentViewModel { + get => _commonComponentViewModel; + set => SetProperty(ref _commonComponentViewModel, value); + } + + private static Wheels _wheels = new Wheels(); + + public static ObservableCollection<string> AllowedDimensions { get; } = new ObservableCollection<string>(new Wheels().GetWheelsDimensions()); + + public abstract void SetProperties(); + + public TyreViewModel(IXMLTyreDeclarationInputData inputData, IComponentViewModelFactory vmFactory) + { + _inputData = inputData as IXMLTyreDeclarationInputData; + Debug.Assert(_inputData != null); + + CommonComponentViewModel = vmFactory.CreateCommonComponentViewModel(_inputData); + + + SetProperties(); + } + + + protected string _dimension; + protected double _rollResistanceCoefficient; + protected Newton _tyreTestLoad; + protected string _fuelEfficiencyClass; + + public DataSource DataSource + { + get => _commonComponentViewModel.DataSource; + set => _commonComponentViewModel.DataSource = value; + } + + + public string Manufacturer + { + get => _commonComponentViewModel.Manufacturer; + set => _commonComponentViewModel.Manufacturer = value; + } + + public string Model + { + get => _commonComponentViewModel.Model; + set => _commonComponentViewModel.Model = value; + } + + public DateTime Date + { + get => _commonComponentViewModel.Date; + set => _commonComponentViewModel.Date = value; + } + + public string CertificationNumber + { + get => _commonComponentViewModel.CertificationNumber; + set => _commonComponentViewModel.CertificationNumber = value; + } + + public CertificationMethod CertificationMethod + { + get => _commonComponentViewModel.CertificationMethod; + set => _commonComponentViewModel.CertificationMethod = value; + } + + public bool SavedInDeclarationMode + { + get => _commonComponentViewModel.SavedInDeclarationMode; + set => _commonComponentViewModel.SavedInDeclarationMode = value; + } + + public DigestData DigestValue + { + get => _commonComponentViewModel.DigestValue; + set => _commonComponentViewModel.DigestValue = value; + } + + public string AppVersion => _commonComponentViewModel.AppVersion; + + public virtual string Dimension {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual double RollResistanceCoefficient {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual Newton TyreTestLoad {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + public virtual string FuelEfficiencyClass {get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + + + } + + + public class TyreViewModel_v1_0 : TyreViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationTyreDataProviderV10).FullName; + + + public TyreViewModel_v1_0(IXMLTyreDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + + + } + + public override void SetProperties() + { + _dimension = _inputData.Dimension; + _rollResistanceCoefficient = _inputData.RollResistanceCoefficient; + _tyreTestLoad = _inputData.TyreTestLoad; + } + + public override string Dimension + { + get => _dimension; + set => SetProperty(ref _dimension, value); + } + + public override double RollResistanceCoefficient + { + get => _rollResistanceCoefficient; + set => SetProperty(ref _rollResistanceCoefficient, value); + } + + public override Newton TyreTestLoad + { + get => _tyreTestLoad; + set => SetProperty(ref _tyreTestLoad, value); + } + + } + + + public class TyreViewModel_v2_0 : TyreViewModel_v1_0 + { + public static new readonly string VERSION = typeof(XMLDeclarationTyreDataProviderV20).FullName; + public TyreViewModel_v2_0(IXMLTyreDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + + } + + public override void SetProperties() + { + base.SetProperties(); + } + } + + public class TyreViewModel_v2_2 : TyreViewModel_v2_0 + { + public static new readonly string VERSION = typeof(XMLDeclarationTyreDataProviderV22).ToString(); + public TyreViewModel_v2_2(IXMLTyreDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + + } + + public override void SetProperties() + { + base.SetProperties(); + } + } + + public class TyreViewModel_v2_3 : TyreViewModel_v2_2 + { + public static new readonly string VERSION = typeof(XMLDeclarationTyreDataProviderV23).ToString(); + + + private string _tyreClass; + public string TyreClass + { + get { return _tyreClass; } + set { SetProperty(ref _tyreClass, value); } + } + + + public override string FuelEfficiencyClass + { + get { return _fuelEfficiencyClass; } + set { SetProperty(ref _fuelEfficiencyClass, value); } + } + + + + public TyreViewModel_v2_3(IXMLTyreDeclarationInputData inputData, IComponentViewModelFactory vmFactory) : base(inputData, vmFactory) + { + } + + public override void SetProperties() + { + base.SetProperties(); + _tyreClass = "TODO: TyreClass"; + _fuelEfficiencyClass = _inputData.FuelEfficiencyClass; + } + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/VehicleViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/VehicleViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..2a3c6c6d995823bbd3986dead333fa01a33feba3 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobEdit/Vehicle/VehicleViewModel.cs @@ -0,0 +1,559 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Xml; +using TUGraz.VectoCommon.BusAuxiliaries; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using TUGraz.VectoCore.Models.Declaration; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle +{ + /// <summary> + /// Abstract base class for Vehicle View Models. Implements Common Methods and the IVehicleViewModel Interface. + /// All Properties of IVehicleDeclarationInputData throw an NotImplementedException and should be implemented in the derived classes. + /// + /// </summary> + public abstract class VehicleViewModel : ViewModelBase, IVehicleViewModel + { + private static readonly string _name = "Vehicle"; + protected IXMLDeclarationVehicleData _vehicleInputData; + public string Name => _name; + protected bool _isPresent; + public bool IsPresent => _isPresent; + + + + protected readonly IComponentViewModelFactory _componentViewModelFactory; + + protected ICommonComponentViewModel _commonComponentViewModel; + + //These ViewModels are displayed in the JobEditViewModel + + public ObservableCollection<IComponentViewModel> ComponentViewModels { get; set; } = new ObservableCollection<IComponentViewModel>(); + + + /// <summary> + /// Gets the Data from the InputDataProvider and sets the properties of the viewModel. Should be overridden in the dervived Classes. + /// </summary> + protected virtual void CreateVehicleProperties() { throw new NotImplementedException(); } + + public IXMLDeclarationVehicleData InputData => _vehicleInputData; + + public virtual IPTOViewModel PTOViewModel + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + + + + public VehicleViewModel( + IXMLDeclarationVehicleData vehicleDeclarationInputData, + IComponentViewModelFactory componentViewModelFactory) + { + _vehicleInputData = vehicleDeclarationInputData; + _componentViewModelFactory = componentViewModelFactory; + _isPresent = true; + + + _commonComponentViewModel = _componentViewModelFactory.CreateCommonComponentViewModel(_vehicleInputData); + + CreateVehicleProperties(); + } + + public ICommonComponentViewModel CommonComponentViewModel + { + get => _commonComponentViewModel; + set => SetProperty(ref _commonComponentViewModel, value); + } + + + #region Implementation of IVehicleViewModel, IVehicleDeclarationInputData + protected string _identifier; + protected string _vin; + protected LegislativeClass _legislativeClass; + protected VehicleCategory _vehicleCategory; + protected AxleConfiguration _axleConfiguration; + protected Kilogram _curbMassChassis; + protected Kilogram _grossVehicleMassRating; + protected string _manufacturerAddress; + protected IComponentsViewModel _components; + + + public string Manufacturer + { + get => _commonComponentViewModel.Manufacturer; + set => _commonComponentViewModel.Manufacturer = value; + } + + public string Model + { + get => _commonComponentViewModel.Model; + set => _commonComponentViewModel.Model = value; + } + + public DateTime Date + { + get => _commonComponentViewModel.Date; + set => _commonComponentViewModel.Date = value; + } + + public string CertificationNumber + { + get => _commonComponentViewModel.CertificationNumber; + set => _commonComponentViewModel.CertificationNumber = value; + } + + public CertificationMethod CertificationMethod + { + get => _commonComponentViewModel.CertificationMethod; + set => _commonComponentViewModel.CertificationMethod = value; + } + + public bool SavedInDeclarationMode + { + get => _commonComponentViewModel.SavedInDeclarationMode; + set => _commonComponentViewModel.SavedInDeclarationMode = value; + } + + public DigestData DigestValue + { + get => _commonComponentViewModel.DigestValue; + set => _commonComponentViewModel.DigestValue = value; + } + + public DataSource DataSource + { + get => _commonComponentViewModel.DataSource; + set => _commonComponentViewModel.DataSource = value; + } + + public string AppVersion => _commonComponentViewModel.AppVersion; + + + public virtual IPTOTransmissionInputData PTOTransmissionInputData => throw new NotImplementedException(); + + public virtual RetarderType RetarderType + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual double RetarderRatio + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual AngledriveType AngledriveType + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual string Identifier + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual bool ExemptedVehicle + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual string VIN + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + LegislativeClass? IVehicleDeclarationInputData.LegislativeClass { get; } + + public virtual LegislativeClass LegislativeClass + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual VehicleCategory VehicleCategory + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual AxleConfiguration AxleConfiguration + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual Kilogram CurbMassChassis + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual Kilogram GrossVehicleMassRating + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual IList<ITorqueLimitInputData> TorqueLimits + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + public virtual string ManufacturerAddress + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + public virtual PerSecond EngineIdleSpeed + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + public virtual bool VocationalVehicle + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual bool SleeperCab + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public bool? AirdragModifiedMultistage => throw new NotImplementedException(); + + public virtual TankSystem? TankSystem + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual IAdvancedDriverAssistantSystemDeclarationInputData ADAS + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual bool ZeroEmissionVehicle + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + public virtual bool HybridElectricHDV + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + public virtual bool DualFuelVehicle + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual Watt MaxNetPower1 + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual Watt MaxNetPower2 + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + RegistrationClass? IVehicleDeclarationInputData.RegisteredClass { get; } + int? IVehicleDeclarationInputData.NumberOfPassengersUpperDeck { get; } + int? IVehicleDeclarationInputData.NumberOfPassengersLowerDeck { get; } + + public virtual RegistrationClass RegisteredClass + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + public virtual int NumberOfPassengersUpperDeck + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + public virtual int NumberOfPassengersLowerDeck + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual CubicMeter CargoVolume + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + VehicleCode? IVehicleDeclarationInputData.VehicleCode { get; } + bool? IVehicleDeclarationInputData.LowEntry { get; } + + public virtual VehicleCode VehicleCode + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + public virtual bool LowEntry + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + public virtual bool Articulated + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + public virtual Meter Height + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + public virtual Meter Length + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + public virtual Meter Width + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + public virtual Meter EntranceHeight + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + ConsumerTechnology? IVehicleDeclarationInputData.DoorDriveTechnology { get; } + + public VehicleDeclarationType VehicleDeclarationType => throw new NotImplementedException(); + + public virtual ConsumerTechnology DoorDriveTechnology + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + public virtual IVehicleComponentsDeclaration Components + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public virtual XmlNode XMLSource + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + #endregion + } + + public class VehicleViewModel_v1_0 : VehicleViewModel + { + public static readonly string VERSION = typeof(XMLDeclarationVehicleDataProviderV10).FullName; + + + + + + + + public VehicleViewModel_v1_0( + IXMLDeclarationVehicleData inputData, + IComponentViewModelFactory componentViewModelFactory): + base( + inputData, + componentViewModelFactory) + { + + + } + + protected override void CreateVehicleProperties() + { + throw new NotImplementedException(); + } + + } + /// <summary> + /// Class that Represents the ViewModel for the VehicleDeclarationType v2.0 + /// </summary> + public class VehicleViewModel_v2_0 : VehicleViewModel_v1_0 + { + public new static readonly string VERSION = typeof(XMLDeclarationVehicleDataProviderV20).FullName; + private IAdasViewModel _aDASViewModel; + private PerSecond _engineIdleSpeed; + + + #region Implementation of present Properties + + /* + public override IList<ITorqueLimitInputData> TorqueLimits + { + get => _torqueLimits; + set => SetProperty(ref _torqueLimits, value); + } + + public IAdasViewModel ADASViewModel + { + get => _aDASViewModel; + set => SetProperty(ref _aDASViewModel, value); + } + */ + + + public override string ManufacturerAddress + { + get => _manufacturerAddress; + set => SetProperty(ref _manufacturerAddress, value); + } + + + public override VehicleCategory VehicleCategory + { + get => _vehicleCategory; + set => SetProperty(ref _vehicleCategory, value); + } + + public override AxleConfiguration AxleConfiguration + { + get => _axleConfiguration; + set => SetProperty(ref _axleConfiguration, value); + } + + public override Kilogram CurbMassChassis + { + get => _curbMassChassis; + set => SetProperty(ref _curbMassChassis, value); + } + + + public override Kilogram GrossVehicleMassRating + { + get => _grossVehicleMassRating; + set => SetProperty(ref _grossVehicleMassRating, value); + } + + + public override PerSecond EngineIdleSpeed + { + get => _engineIdleSpeed; + set => SetProperty(ref _engineIdleSpeed, value); + } + + + public override AngledriveType AngledriveType + { + get => _components.AngleDriveViewModel.Type; + set => _components.AngleDriveViewModel.Type = value; + } + + public override RetarderType RetarderType + { + get => _components.RetarderViewModel.Type; + set => _components.RetarderViewModel.Type = value; + } + + public override double RetarderRatio + { + get => _components.RetarderViewModel.Ratio; + set => _components.RetarderViewModel.Ratio = value; + } + /* + public override IPTOViewModel PTOViewModel => _components.PTOViewModel; + + public override IPTOTransmissionInputData PTOTransmissionInputData => + (IPTOTransmissionInputData)PTOViewModel; + */ + public override string VIN + { + get => _vin; + set => SetProperty(ref _vin, value); + } + + public override LegislativeClass LegislativeClass + { + get => _legislativeClass; + set => SetProperty(ref _legislativeClass, value); + } + + + + public override IVehicleComponentsDeclaration Components + { + get => _components; + set => throw new NotImplementedException(); + } + + + + public override string Identifier { get => _identifier; + set => SetProperty(ref _identifier, value); } + + #endregion + + + public VehicleViewModel_v2_0( + IXMLDeclarationVehicleData inputData, + IComponentViewModelFactory componentViewModelFactory) : + base(inputData, + componentViewModelFactory) + { + + } + + protected override void CreateVehicleProperties() + { + Debug.Assert(_vehicleInputData.LegislativeClass.HasValue); + + _manufacturerAddress = _vehicleInputData.ManufacturerAddress; + _vin = _vehicleInputData.VIN; + _legislativeClass = (LegislativeClass) _vehicleInputData.LegislativeClass; + _vehicleCategory = _vehicleInputData.VehicleCategory; + _axleConfiguration = _vehicleInputData.AxleConfiguration; + _curbMassChassis = _vehicleInputData.CurbMassChassis; + _grossVehicleMassRating = _vehicleInputData.GrossVehicleMassRating; + _identifier = _vehicleInputData.Identifier; + + + //_aDASViewModel = (IComponentViewModel)_componentViewModelFactory.CreateAdasViewModel(_vehicleInputData.ADAS as IAdvancedDriverAssistantSystemDeclarationInputData) as IAdasViewModel; + + //TorqueLimits = _vehicleInputData.TorqueLimits; + + _components = _componentViewModelFactory.CreateComponentsViewModel( + _vehicleInputData.Components as IXMLVehicleComponentsDeclaration); + + //Add the viewmodel of every component to the ComponentViewModels collection + foreach (var component in ((IComponentsViewModel)_components).Components) { + ComponentViewModels.Add(component); + } + + EngineIdleSpeed = _vehicleInputData.EngineIdleSpeed; + RetarderType = _vehicleInputData.RetarderType; + RetarderRatio = _vehicleInputData.RetarderRatio; + AngledriveType = _vehicleInputData.AngledriveType; + + } + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..c957de3f19c6615fdea7feea11a70f92ce67fb24 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs @@ -0,0 +1,315 @@ +using Microsoft.Win32; +using Ninject; +using System; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Diagnostics; +using System.Windows.Input; +using TUGraz.VectoCore.InputData.FileIO.XML; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Model.Interfaces; +using VECTO3GUI2020.Properties; +using VECTO3GUI2020.Util; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.Document; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; +using VECTO3GUI2020.Views; +using IDocumentViewModel = VECTO3GUI2020.ViewModel.Interfaces.Document.IDocumentViewModel; + +namespace VECTO3GUI2020.ViewModel.Implementation +{ + public class JobListViewModel : ViewModelBase, IJobListViewModel + { + #region Members and Properties + private readonly Settings _settings = Settings.Default; + + + private ICommand _addJobCommand; + private ICommand _editJobCommand; + private ICommand _removeJobCommand; + private ICommand _moveJobUpCommand; + private ICommand _moveJobDownCommand; + private ICommand _viewXMLCommand; + + private bool _isLoading = false; + public bool IsLoading + { + get => _isLoading; + set => SetProperty(ref _isLoading, value); + } + + private BackgroundWorker fileReadingBackgroundWorker; + + private ObservableCollection<IDocumentViewModel> _jobs = new ObservableCollection<IDocumentViewModel>(); + public ObservableCollection<IDocumentViewModel> Jobs{ get => _jobs; set => SetProperty(ref _jobs, value);} + + private IDialogHelper _dialogHelper; + private IWindowHelper _windowHelper; + private IDocumentViewModelFactory _documentViewModelFactory; + private ICommand _newMultiStageFileCommand; + private IMultiStageViewModelFactory _multiStageViewModelFactory; + + #endregion + + + public JobListViewModel() + { + InitFileBackGroundWorker(); + } + + + public JobListViewModel(IDocumentViewModelFactory documentViewModelFactory, + IDialogHelper dialogHelper, + IWindowHelper windowHelper, + IMultiStageViewModelFactory multiStageViewModelFactory) : this() + { + _documentViewModelFactory = documentViewModelFactory; + _dialogHelper = dialogHelper; + _windowHelper = windowHelper; + _multiStageViewModelFactory = multiStageViewModelFactory; + } + + + + private void InitFileBackGroundWorker() + { + fileReadingBackgroundWorker = new BackgroundWorker + { + WorkerReportsProgress = false + }; + fileReadingBackgroundWorker.DoWork += fileworker_DoWork; + fileReadingBackgroundWorker.ProgressChanged += fileworker_ProgressChanged; + fileReadingBackgroundWorker.RunWorkerCompleted += fileworker_RunWorkerCompleted; + } + + + + + + #region Commands + + public ICommand NewManufacturingStageFile + { + get + { + return _newMultiStageFileCommand ?? new RelayCommand(NewManufacturingStageFileExecute, () => { return true; }); + } + } + + private void NewManufacturingStageFileExecute() + { + _windowHelper.ShowWindow(_multiStageViewModelFactory.CreateNewMultiStageJobViewModel()); + } + + + public ICommand AddJob + { + get + { + return _addJobCommand ?? new RelayCommand(AddJobExecute, () => { return true; }); + } + private set + { + _addJobCommand = value; + OnPropertyChanged(); + } + } + + + private void AddJobExecute() + { + IsLoading = true; + string path = _settings.DefaultFilePath; + var filename = _dialogHelper.OpenXMLFileDialog(path); + + if (filename != null) + { + fileReadingBackgroundWorker.RunWorkerAsync(filename); + } + else + { + IsLoading = false; + } + } + + + public ICommand EditJob + { + get + { + return _editJobCommand ?? new RelayCommand<IJobViewModel>(EditJobExecute, + (IJobViewModel jobentry) => + { + return (jobentry != null); + }); + } + set + { + _editJobCommand = value; + OnPropertyChanged(); + } + } + + private void EditJobExecute(IDocumentViewModel selectedJob) + { + if (selectedJob == null) { + return; + } + _windowHelper.ShowWindow(selectedJob.EditViewModel); + } + + public ICommand ViewXMLFile + { + get + { + return _viewXMLCommand ?? new RelayCommand<IJobViewModel>(ViewXMLFileExecute, + (IJobViewModel jobentry) => + { + return (jobentry != null); + }); + } + set + { + _viewXMLCommand = value; + OnPropertyChanged(); + } + } + + private void ViewXMLFileExecute(IJobViewModel selectedJob) + { + if (selectedJob == null) return; + + //TODO implement using WindowHelper. + Debug.WriteLine("open XML File Viewer"); + //_kernel.Get<XMLViewer>().Show(); + + + } + + + public ICommand RemoveJob + { + get + { + return _removeJobCommand ?? new RelayCommand<IDocumentViewModel>(RemoveJobExecute, (IDocumentViewModel jobentry) => + { + return (jobentry != null); + }); + } + set + { + _removeJobCommand = value; + OnPropertyChanged(); + } + } + + private void RemoveJobExecute(IDocumentViewModel selectedDocument) + { + if (selectedDocument == null) return; + + + Jobs.Remove(selectedDocument); + OnPropertyChanged(); + } + + public ICommand moveJobUp + { + get + { + return _moveJobUpCommand ?? new RelayCommand<IDocumentViewModel>(MoveJobUpExecute, (IDocumentViewModel jobentry) => + { + return (jobentry != null && Jobs.Count > 1 && Jobs.IndexOf(jobentry) != 0); + }); + } + set + { + _moveJobUpCommand = value; + OnPropertyChanged(); + } + + } + + private void MoveJobUpExecute(IDocumentViewModel selectedJob) + { + if (selectedJob == null) return; + var index = Jobs.IndexOf(selectedJob); + if (index > 0) + Jobs.Move(index, index - 1); + + } + + public ICommand moveJobDown + { + get + { + return _moveJobDownCommand ?? new RelayCommand<IDocumentViewModel>(MoveJobDownExecute, (IDocumentViewModel jobentry) => + { + return (jobentry != null && Jobs.Count > 1 && Jobs.IndexOf(jobentry) != Jobs.Count - 1); + }); + } + set + { + _moveJobDownCommand = value; + OnPropertyChanged(); + } + + } + + private void MoveJobDownExecute(IDocumentViewModel selectedJob) + { + Debug.WriteLine("move down command"); + + if (selectedJob == null) return; + var index = Jobs.IndexOf(selectedJob); + if (index != Jobs.Count - 1) + Jobs.Move(index, index + 1); + + } + + #endregion Commands + + #region BackgroundworkerXMLreading + + void fileworker_DoWork(object sender, DoWorkEventArgs e) + { + string filename = e.Argument as string; + Debug.Assert(filename != null); + + //TODO: update usage of GetDocumentType; + // //Loading the file + //try { + // var xElement = new System.Xml.XmlDocument(); + // xElement.Load(filename); + // var documentType = XMLHelper.GetDocumentType(xElement.); + // if (documentType == null) { + // Debug.WriteLine("Unknown Document Type"); + // e.Cancel = true; + // return; + // } + + // var result = _documentViewModelFactory.CreateDocumentViewModel((XmlDocumentType)documentType, filename); + // e.Result = result; + //} catch (Exception) { + // e.Cancel = true; + // throw; + //} + } + + void fileworker_ProgressChanged(object sender, ProgressChangedEventArgs e) + { + + } + + void fileworker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) + { + Debug.Assert(e.Result is IDocumentViewModel); + Jobs.Add(e.Result as IDocumentViewModel); + IsLoading = false; + } + + #endregion + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..2da740c78e3c7d774b85b513df3fde4c538937a2 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/MainWindowViewModel.cs @@ -0,0 +1,101 @@ +using System; +using VECTO3GUI2020.ViewModel.Interfaces; +using Ninject; +using System.Diagnostics; +using System.Windows.Input; +using Castle.DynamicProxy.Generators.Emitters.SimpleAST; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.Util; +using VECTO3GUI2020.Views; + +namespace VECTO3GUI2020.ViewModel.Implementation +{ + public class MainWindowViewModel : ViewModelBase, IMainWindowViewModel + { + #region Member + private IJobListViewModel _jobListVm; + private IMainViewModel _bottomView; + #endregion + + #region Commands + private ICommand _openSettings; + private IWindowHelper _windowHelper; + private ISettingsViewModel _settingsViewModel; + + + #endregion + + + public MainWindowViewModel(IWindowHelper windowHelper, ISettingsViewModel settingsViewModel, IJobListViewModel jobListViewModel) + { + _windowHelper = windowHelper; + _settingsViewModel = settingsViewModel; + _jobListVm = jobListViewModel; + } + + public IMainViewModel CurrentViewModelTop + { + get { return _jobListVm; + + } + set { throw new NotImplementedException(); } + } + + public IMainViewModel CurrentViewModelBottom + { + get { return _bottomView; } + set { _bottomView = value; } + } + + + #region CommandImplementations + #region CommandOpenSettings + public ICommand OpenSettings + { + get{ + return _openSettings ?? (ICommand)new RelayCommand(OpenSettingsExecute); + } + private set + { + + } + } + + private void OpenSettingsExecute() + { + _windowHelper.ShowWindow(_settingsViewModel); + } + + + #region newMultiStage + + public ICommand NewInterimFile => _jobListVm.NewManufacturingStageFile; + + + + + + #endregion + + #endregion + + + + + + + + + + + + + + + + + #endregion + + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/MessageViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/MessageViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..ec24b7a861f5774dd1af325344e6f938c20dba83 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/MessageViewModel.cs @@ -0,0 +1,9 @@ +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces; + +namespace VECTO3GUI2020.ViewModel.Implementation +{ + public class MessageViewModel : ViewModelBase, IMessageViewModel + { + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/SettingsViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/SettingsViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..7e8ab4110f9dec686f51c379eb12af086a1df8c0 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/SettingsViewModel.cs @@ -0,0 +1,74 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Windows.Forms; +using System.Windows.Input; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Properties; +using VECTO3GUI2020.Util; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces; + +namespace VECTO3GUI2020.ViewModel.Implementation +{ + public class SettingsViewModel : ViewModelBase, ISettingsViewModel + { + private Settings _settings; + + private ICommand _changePath; + + + private IDialogHelper _dialogHelper; + + + private String _defaultFilePath; + public String DefaultFilePath + { + get => _defaultFilePath; + set + { + _settings.DefaultFilePath = value; + _settings.Save(); + SetProperty(ref _defaultFilePath, value, "DefaultFilePath"); + } + } + public SettingsViewModel(IDialogHelper dialogHelper) + { + base.Title = "Settings"; + _settings = Settings.Default; + _defaultFilePath = _settings.DefaultFilePath; + _dialogHelper = dialogHelper; + } + + + public ICommand ChangeFilePath + { + get + { + return _changePath ?? new RelayCommand(()=> + { + + + //C:\Users\Harry\source\repos\vecto-gui\VectoCore\VectoCoreTest\TestData\XML\XMLReaderDeclaration + + + var new_path = _dialogHelper.OpenFolderDialog(DefaultFilePath); + + if (new_path != null) + { + DefaultFilePath = new_path; + } + + + }, () => { return true; }); + } + private set + { + _changePath = value; + OnPropertyChanged(); + } + } + + + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/Common/IViewModelBase.cs b/VECTO3GUI2020/ViewModel/Interfaces/Common/IViewModelBase.cs new file mode 100644 index 0000000000000000000000000000000000000000..dff379d33bc1c544aa8b9360da5d2108869a4eb7 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/Common/IViewModelBase.cs @@ -0,0 +1,7 @@ +namespace VECTO3GUI2020.ViewModel.Interfaces.Common +{ + public interface IViewModelBase + { + string Title { get; set; } + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/Interfaces/Document/IDocumentViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/Document/IDocumentViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..274af232039353d30a366b7ee93f15e1d6511996 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/Document/IDocumentViewModel.cs @@ -0,0 +1,15 @@ +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit; + +namespace VECTO3GUI2020.ViewModel.Interfaces.Document +{ + public interface IDocumentViewModel + { + string DocumentName { get; } + XmlDocumentType DocumentType { get; } + DataSource DataSource { get; } + + IEditViewModel EditViewModel { get; } + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/Document/IDocumentViewModelFactory.cs b/VECTO3GUI2020/ViewModel/Interfaces/Document/IDocumentViewModelFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..d9b0d9fff1c98f26dac9f6bf9430e8efb7eab7d9 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/Document/IDocumentViewModelFactory.cs @@ -0,0 +1,27 @@ +using TUGraz.VectoCore.Utils; + +namespace VECTO3GUI2020.ViewModel.Interfaces.Document +{ + public interface IDocumentViewModelFactory + { + /* + public enum XmlDocumentType + { + DeclarationJobData = 1 << 1, + PrimaryVehicleBusOutputData = 1 << 2, + DeclarationComponentData = 1 << 3, + EngineeringJobData = 1 << 4, + EngineeringComponentData = 1 << 5, + ManufacturerReport = 1 << 6, + CustomerReport = 1 << 7, + MonitoringReport = 1 << 8, + VTPReport = 1 << 9, + DeclarationTrailerJobData = 1 << 10, + } + + */ + IDocumentViewModel CreateDocumentViewModel(XmlDocumentType xmlDocumentType, string sourcefile); + + + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/Document/IJobViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/Document/IJobViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..01498019d662fc153fa86ac536bec48f53f152c5 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/Document/IJobViewModel.cs @@ -0,0 +1,7 @@ +namespace VECTO3GUI2020.ViewModel.Interfaces.Document +{ + public interface IJobViewModel : IDocumentViewModel + { + + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/IEditViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/IEditViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..6241441a1734cb45692aa1a2143e5a35a871bdd6 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/IEditViewModel.cs @@ -0,0 +1,7 @@ +namespace VECTO3GUI2020.ViewModel.Interfaces +{ + public interface IEditViewModel + { + string Name { get; } + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/IJobListViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/IJobListViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..03e44d2df9553fa167311b8c6c9554a74b32a778 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/IJobListViewModel.cs @@ -0,0 +1,15 @@ +using System.Collections.ObjectModel; +using System.Windows.Input; +using VECTO3GUI2020.Model.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.Document; + +namespace VECTO3GUI2020.ViewModel.Interfaces +{ + public interface IJobListViewModel : IMainViewModel + { + ICommand AddJob { get; } + ICommand EditJob { get; } + ObservableCollection<IDocumentViewModel> Jobs { get; } + ICommand NewManufacturingStageFile { get; } + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/IMainViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/IMainViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..8f5cca1603353bd0881bbcd42216f7b42fc24d10 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/IMainViewModel.cs @@ -0,0 +1,6 @@ +namespace VECTO3GUI2020.ViewModel.Interfaces +{ + public interface IMainViewModel + { + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/IMainWindowViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/IMainWindowViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..688159a82fbef1ba6c38118537057a0f637aaa85 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/IMainWindowViewModel.cs @@ -0,0 +1,14 @@ +using System.Windows.Input; + +namespace VECTO3GUI2020.ViewModel.Interfaces +{ + public interface IMainWindowViewModel + { + IMainViewModel CurrentViewModelTop { get; set; } + IMainViewModel CurrentViewModelBottom { get; set; } + + #region Commands + ICommand OpenSettings { get;} + #endregion + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/IMessageViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/IMessageViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..619378623e45ed7588e34bdce79de5d0813a77ac --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/IMessageViewModel.cs @@ -0,0 +1,6 @@ +namespace VECTO3GUI2020.ViewModel.Interfaces +{ + public interface IMessageViewModel : IMainViewModel + { + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/ISettingsViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/ISettingsViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..889bdc9b65870abd36d314e3f62200bc9b8801bd --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/ISettingsViewModel.cs @@ -0,0 +1,9 @@ +namespace VECTO3GUI2020.ViewModel.Interfaces +{ + public interface ISettingsViewModel + { + + + + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/IJobEditViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/IJobEditViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..b1d938ccc2879c262faa276d0c259ef88ee3b282 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/IJobEditViewModel.cs @@ -0,0 +1,12 @@ +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit +{ + public interface IJobEditViewModel : IEditViewModel, IInputDataProvider + { + + + + + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/IJobEditViewModelFactory.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/IJobEditViewModelFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..8a476f679cc0f2e286cb88ed6e82be37824ba42a --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/IJobEditViewModelFactory.cs @@ -0,0 +1,17 @@ +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit +{ + public interface IJobEditViewModelFactory + { + + + /// <summary> + /// Creates a JobEditViewModel dependent on the type of the inputdataprovider + /// </summary> + /// <param name="inputData"></param> + /// <returns></returns> + IJobEditViewModel CreateJobEditViewModel(IInputDataProvider inputData); + + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Trailer/ITrailerViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Trailer/ITrailerViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..608f8ab4fd0e7a7320f587192d50e512dc7ffbd4 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Trailer/ITrailerViewModel.cs @@ -0,0 +1,7 @@ +namespace VECTO3GUI2020.ViewModel.Implementation.JobEdit.Trailer +{ + public interface ITrailerViewModel + { + + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAdasViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAdasViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..49ce672c24bd6104ba323b3f970b26ef0e1331bd --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAdasViewModel.cs @@ -0,0 +1,8 @@ +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IAdasViewModel : IAdvancedDriverAssistantSystemDeclarationInputData, IComponentViewModel + { + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAirDragViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAirDragViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..866e9164f3d8b1c42d062ff3b109bfa460076c34 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAirDragViewModel.cs @@ -0,0 +1,8 @@ +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IAirDragViewModel : IAirdragDeclarationInputData, IComponentViewModel + { + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAngleDriveViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAngleDriveViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..30fb28aa0f975ad3db9ff9b7a0ac9bcc2ecb1aac --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAngleDriveViewModel.cs @@ -0,0 +1,10 @@ +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IAngleDriveViewModel : IAngledriveInputData, IComponentViewModel + { + new AngledriveType Type { get; set; } + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAuxiliariesViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAuxiliariesViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..b9999add880d7eb369ca9f9ef5649da30c4c7bb0 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAuxiliariesViewModel.cs @@ -0,0 +1,8 @@ +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IAuxiliariesViewModel : IAuxiliariesDeclarationInputData, IComponentViewModel + { + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAuxiliaryViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAuxiliaryViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..1710ed1706be9fb9f3d822a37ab9ba65778099d7 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAuxiliaryViewModel.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IAuxiliaryViewModel : IAuxiliaryDeclarationInputData + { + string Name { get; set; } + + string TechnologyName { get; set; } + + IList<string> TechnologyList { get; } + AuxiliaryType Type { get; } + } +} + diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAxleGearViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAxleGearViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..2d7a80b828b659f49c70b517704a7321cb5deaba --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAxleGearViewModel.cs @@ -0,0 +1,10 @@ +using System.ComponentModel; +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IAxleGearViewModel : IAxleGearInputData, IComponentViewModel + { + + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAxleViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAxleViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..ae24ba75c428e48de1a44d94c8fccca9c06ba8c6 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAxleViewModel.cs @@ -0,0 +1,8 @@ +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IAxleViewModel : IAxleDeclarationInputData + { + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAxleWheelsViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAxleWheelsViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..41893ae801708eed803d9f173b3e203bced40ac0 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IAxleWheelsViewModel.cs @@ -0,0 +1,8 @@ +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + interface IAxleWheelsViewModel : IAxlesDeclarationInputData, IComponentViewModel + { + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/ICommonComponentViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/ICommonComponentViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..574bf03a86420d4448dd37c2552750af142be617 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/ICommonComponentViewModel.cs @@ -0,0 +1,25 @@ +using System; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface ICommonComponentViewModel : IComponentInputData + { + new string Manufacturer { get; set; } + new string Model { get; set; } + + new DateTime Date { get; set; } + + new string CertificationNumber { get; set; } + new CertificationMethod CertificationMethod { get; set; } + new bool SavedInDeclarationMode { get; set; } + + new DigestData DigestValue { get; set; } + + new DataSource DataSource { get; set; } + + new string AppVersion { get; } + } + +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IComponentViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IComponentViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..86749ddacc34e848d22c3bf2235d421f6957c95c --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IComponentViewModel.cs @@ -0,0 +1,12 @@ +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IComponentViewModel + { + string Name { get; } + + bool IsPresent { get; } + + + + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IComponentViewModelFactory.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IComponentViewModelFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..a7c964dd5f27c4084768bba78732185c07be0cbb --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IComponentViewModelFactory.cs @@ -0,0 +1,21 @@ +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IComponentViewModelFactory + { + /// <summary> + /// Creates a ViewModel for a component. + /// </summary> + /// <param name="inputData">The Type of the input Data is used to resolve a Named Binding and is also passed to the constructor</param> + /// <returns></returns> + IComponentViewModel CreateComponentViewModel(object inputData); + IVehicleViewModel CreateVehicleViewModel(IVehicleDeclarationInputData inputData); + IAdasViewModel CreateAdasViewModel(IAdvancedDriverAssistantSystemDeclarationInputData inputData); + IEngineModeViewModel CreateEngineModeViewModel(IEngineModeDeclarationInputData inputData); + IEngineFuelViewModel CreateEngineFuelViewModel(IEngineFuelDeclarationInputData inputData); + IComponentsViewModel CreateComponentsViewModel(IXMLVehicleComponentsDeclaration inputData); + ICommonComponentViewModel CreateCommonComponentViewModel(IComponentInputData inputData); + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IComponentsViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IComponentsViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..ce8273ec0d04b9c93f0afcda3eb475c60b9db4df --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IComponentsViewModel.cs @@ -0,0 +1,19 @@ +using System.Collections.ObjectModel; +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IComponentsViewModel : IVehicleComponentsDeclaration + { + ObservableCollection<IComponentViewModel> Components { get; set; } + + IRetarderViewModel RetarderViewModel { get; } + IEngineViewModel EngineViewModel { get; } + + IPTOViewModel PTOViewModel { get; } + + IAirDragViewModel AirDragViewModel { get; } + + IAngleDriveViewModel AngleDriveViewModel { get; } + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IEngineFuelViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IEngineFuelViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..44cf39d91ab8758e75e940eada714634c2b78cc3 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IEngineFuelViewModel.cs @@ -0,0 +1,9 @@ +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IEngineFuelViewModel : IEngineFuelDeclarationInputData + { + + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IEngineModeViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IEngineModeViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..79bdeadbd97f7ac0a8ddf4258e0aebcc5915e866 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IEngineModeViewModel.cs @@ -0,0 +1,10 @@ +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Utils; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IEngineModeViewModel : IEngineModeDeclarationInputData + { + new PerSecond IdleSpeed { get; set; } + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IEngineViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IEngineViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..9a862254d9b60334d2bb37d37b7cbeba2c6f894f --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IEngineViewModel.cs @@ -0,0 +1,10 @@ +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Utils; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IEngineViewModel : IEngineDeclarationInputData, IComponentViewModel + { + PerSecond IdlingSpeed { get; set; } + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IGearBoxViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IGearBoxViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..e6970631e5afbca19aa474069a1af69015d1adb2 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IGearBoxViewModel.cs @@ -0,0 +1,8 @@ +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IGearBoxViewModel : IGearboxDeclarationInputData, IComponentViewModel + { + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IGearViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IGearViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..05158bac51cf7dc154c639b6500c64f06f0115cd --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IGearViewModel.cs @@ -0,0 +1,8 @@ +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IGearViewModel : ITransmissionInputData + { + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IPTOViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IPTOViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..60defaf679a3236aead6cab358ff02571ab2df2e --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IPTOViewModel.cs @@ -0,0 +1,8 @@ +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IPTOViewModel : IPTOTransmissionInputData, IComponentViewModel + { + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IRetarderViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IRetarderViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..0a42cc49261381927fa65d96777a7e0026d08cb6 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/IRetarderViewModel.cs @@ -0,0 +1,13 @@ +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface IRetarderViewModel : IRetarderInputData, IComponentViewModel + { + new RetarderType Type { get; set; } + + new double Ratio { get; set; } + + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/ITorqueConverterViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/ITorqueConverterViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..c232eca9fd9a8249459a434c6caa62bbc1668a2e --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/ITorqueConverterViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface ITorqueConverterViewModel : ITorqueConverterDeclarationInputData + { + + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/ITyreViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/ITyreViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..b74b05f33f6120b8249bc6551bce4f4015087796 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/Components/ITyreViewModel.cs @@ -0,0 +1,8 @@ +using TUGraz.VectoCommon.InputData; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components +{ + public interface ITyreViewModel : ITyreDeclarationInputData + { + } +} diff --git a/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/IVehicleViewModel.cs b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/IVehicleViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..3eda515a55158ba019041928f43fa574901514ce --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Interfaces/JobEdit/Vehicle/IVehicleViewModel.cs @@ -0,0 +1,24 @@ +using System.Collections.ObjectModel; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle +{ + public interface IVehicleViewModel : IComponentViewModel, IVehicleDeclarationInputData + { + IPTOViewModel PTOViewModel { get; } + + + //TODO: Move to IVehicleDeclarationInputData + RetarderType RetarderType { get; } + double RetarderRatio { get; } + + AngledriveType AngledriveType { get; } + + IPTOTransmissionInputData PTOTransmissionInputData { get; } + + ObservableCollection<IComponentViewModel> ComponentViewModels { get; set; } + } +} diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/DeclarationInterimStageBusVehicleViewModel_v2_8.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/DeclarationInterimStageBusVehicleViewModel_v2_8.cs new file mode 100644 index 0000000000000000000000000000000000000000..e3ec4d2e7218f09be3a6fafec6563840c9f937b7 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/DeclarationInterimStageBusVehicleViewModel_v2_8.cs @@ -0,0 +1,356 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Configuration; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml; +using TUGraz.VectoCommon.BusAuxiliaries; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Models; +using TUGraz.VectoCommon.Utils; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using VECTO3GUI2020.Properties; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation +{ + class DeclarationInterimStageBusVehicleViewModel_v2_8 : ViewModelBase, IVehicleViewModel + { + public static readonly string INPUTPROVIDERTYPE = typeof(XMLDeclarationInterimStageBusDataProviderV28).ToString(); + + public string Name + { + get { return "Vehicle"; } + } + + public bool IsPresent + { + get { return true; } + } + + public DataSource DataSource + { + get { throw new NotImplementedException(); } + } + + public bool SavedInDeclarationMode + { + get { throw new NotImplementedException(); } + } + + + private string _manufacturer; + private string _model; + private string _vin; + private string _manufacturerAddress; + + public string Manufacturer + { + get { return _manufacturer; } + set { SetProperty(ref _manufacturer, value); } + } + + public string Model + { + get { return _model; } + set { SetProperty(ref _model, value); } + } + + public string VIN + { + get { return _vin; } + set { SetProperty(ref _vin, value); } + } + + public string ManufacturerAddress + { + get { return String.IsNullOrEmpty(_manufacturerAddress) ? null : _manufacturerAddress; } + set { SetProperty(ref _manufacturerAddress, value); } + } + + private bool _measurementsGroupEditingEnabled = false; + public bool MeasurementsGroupEditingEnabled + { + get { return _measurementsGroupEditingEnabled; } + set { SetProperty(ref _measurementsGroupEditingEnabled, value); } + } + + private Meter _height; + public Meter Height + { + get { return _height; } + set { SetProperty(ref _height, value); } + } + + private Meter _length; + public Meter Length + { + get { return _length; } + set { SetProperty(ref _length, value); } + } + + private Meter _width; + public Meter Width + { + get { return _width; } + set { SetProperty(ref _width, value); } + } + + private Kilogram _curbMassChassis; + + public Kilogram CurbMassChassis + { + get { return _curbMassChassis; } + set { SetProperty(ref _curbMassChassis, value); } + } + + private bool __numberOfPassengersEditingEnabled = false; + private int? _numberOfPassengersUpperDeck; + private int? _numberOfPassengersLowerDeck; + public bool NumberOfPassengersEditingEnabled + { + get { return __numberOfPassengersEditingEnabled; } + set { SetProperty(ref __numberOfPassengersEditingEnabled, value); } + } + + + public int? NumberOfPassengersUpperDeck + { + get { return _numberOfPassengersUpperDeck; } + set { SetProperty(ref _numberOfPassengersUpperDeck, value); } + } + + public int? NumberOfPassengersLowerDeck + { + get { return _numberOfPassengersLowerDeck; } + set { SetProperty(ref _numberOfPassengersLowerDeck, value); } + } + + private TankSystem? _tankSystem; + public TankSystem? TankSystem + { + get { return _tankSystem; } + set { SetProperty(ref _tankSystem, value); } + } + + + private IList<IComponentViewModel> _componentViewModels; + private IVehicleDeclarationInputData _inputData; + + + + + public ObservableCollection<IComponentViewModel> ComponentViewModels + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + + public DeclarationInterimStageBusVehicleViewModel_v2_8() + { + + } + + + + + #region implementation of IVehicleDeclarationInputData; + public DateTime Date + { + get { throw new NotImplementedException(); } + } + + public string AppVersion + { + get { throw new NotImplementedException(); } + } + + public CertificationMethod CertificationMethod + { + get { throw new NotImplementedException(); } + } + + public string CertificationNumber + { + get { throw new NotImplementedException(); } + } + + public DigestData DigestValue + { + get { throw new NotImplementedException(); } + } + + public string Identifier + { + get { throw new NotImplementedException(); } + } + + public bool ExemptedVehicle + { + get { throw new NotImplementedException(); } + } + + + public LegislativeClass? LegislativeClass + { + get { throw new NotImplementedException(); } + } + + public VehicleCategory VehicleCategory + { + get { throw new NotImplementedException(); } + } + + public AxleConfiguration AxleConfiguration + { + get { throw new NotImplementedException(); } + } + + + public Kilogram GrossVehicleMassRating + { + get { throw new NotImplementedException(); } + } + + public IList<ITorqueLimitInputData> TorqueLimits + { + get { throw new NotImplementedException(); } + } + + + public PerSecond EngineIdleSpeed + { + get { throw new NotImplementedException(); } + } + + public bool VocationalVehicle + { + get { throw new NotImplementedException(); } + } + + public bool SleeperCab + { + get { throw new NotImplementedException(); } + } + + public bool? AirdragModifiedMultistage + { + get { throw new NotImplementedException(); } + } + + + + public IAdvancedDriverAssistantSystemDeclarationInputData ADAS + { + get { throw new NotImplementedException(); } + } + + public bool ZeroEmissionVehicle + { + get { throw new NotImplementedException(); } + } + + public bool HybridElectricHDV + { + get { throw new NotImplementedException(); } + } + + public bool DualFuelVehicle + { + get { throw new NotImplementedException(); } + } + + public Watt MaxNetPower1 + { + get { throw new NotImplementedException(); } + } + + public Watt MaxNetPower2 + { + get { throw new NotImplementedException(); } + } + + public RegistrationClass? RegisteredClass + { + get { throw new NotImplementedException(); } + } + + + public CubicMeter CargoVolume + { + get { throw new NotImplementedException(); } + } + + public VehicleCode? VehicleCode + { + get { throw new NotImplementedException(); } + } + + public bool? LowEntry + { + get { throw new NotImplementedException(); } + } + + public bool Articulated + { + get { throw new NotImplementedException(); } + } + + public Meter EntranceHeight + { + get { throw new NotImplementedException(); } + } + + public ConsumerTechnology? DoorDriveTechnology + { + get { throw new NotImplementedException(); } + } + + public VehicleDeclarationType VehicleDeclarationType + { + get { throw new NotImplementedException(); } + } + + public IVehicleComponentsDeclaration Components + { + get { throw new NotImplementedException(); } + } + + public XmlNode XMLSource + { + get { throw new NotImplementedException(); } + } + + public IPTOViewModel PTOViewModel + { + get { throw new NotImplementedException(); } + } + + public RetarderType RetarderType + { + get { throw new NotImplementedException(); } + } + + public double RetarderRatio + { + get { throw new NotImplementedException(); } + } + + public AngledriveType AngledriveType + { + get { throw new NotImplementedException(); } + } + + public IPTOTransmissionInputData PTOTransmissionInputData + { + get { throw new NotImplementedException(); } + } + + #endregion; + } +} diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/ManufacturingStageViewModel_v0_1.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/ManufacturingStageViewModel_v0_1.cs new file mode 100644 index 0000000000000000000000000000000000000000..66a21813f67fb61d3a915840a412ac0daacfb5a7 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/ManufacturingStageViewModel_v0_1.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Net.Mime; +using System.Security.RightsManagement; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Input; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.Models.GenericModelData; +using VECTO3GUI2020.Util; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.Interfaces.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; + +namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation +{ + public class ManufacturingStageViewModel_v0_1 : ViewModelBase, IManufacturingStageViewModel + { + public static readonly string INPUTPROVIDERTYPE = typeof(XMLDeclarationMultistageTypeInputDataV01).ToString(); + public static readonly string QualifiedXSD = XMLDeclarationMultistageTypeInputDataV01.QUALIFIED_XSD_TYPE; + private Dictionary<string, IViewModelBase> Components = new Dictionary<string, IViewModelBase>(StringComparer.CurrentCultureIgnoreCase); + + public DigestData HashPreviousStage => throw new NotImplementedException(); + + public int StageCount => throw new NotImplementedException(); + + public IVehicleDeclarationInputData Vehicle => _vehicleViewModel; + + public IViewModelBase CurrentView + { + get => _currentview; + set => SetProperty(ref _currentview, value); + } + + private IApplicationInformation _applicationInformation; + private IVehicleViewModel _vehicleViewModel; + private IMultiStageViewModelFactory _viewModelFactory; + private IViewModelBase _currentview; + + public IVehicleViewModel VehicleViewModel + { + get => _vehicleViewModel; + set => SetProperty(ref _vehicleViewModel, value); + } + + public IApplicationInformation ApplicationInformation + { + get => _applicationInformation; + + } + + public DigestData Signature => throw new NotImplementedException(); + + + public ManufacturingStageViewModel_v0_1(IManufacturingStageInputData prevStageInputData, IMultiStageViewModelFactory viewModelFactory) + { + _viewModelFactory = viewModelFactory; + + VehicleViewModel = + _viewModelFactory.CreateInterimStageVehicleViewModel(prevStageInputData.Vehicle.GetType().ToString()); + + + CurrentView = VehicleViewModel as IViewModelBase; + + + + Components.Add(VehicleViewModel.Name, VehicleViewModel as IViewModelBase); + + var airDragEditViewModel = viewModelFactory.createMultistageAirdragViewModel(); + Components.Add("Airdrag", airDragEditViewModel as IViewModelBase); + } + + + private ICommand _switchComponentViewCommand; + public ICommand SwitchComponentViewCommand + { + get { + return _switchComponentViewCommand ?? new RelayCommand<string>(SwitchViewExecute, (string s) => true); + + } + } + + private void SwitchViewExecute(string viewToShow) + { + IViewModelBase newView; + var success= Components.TryGetValue(viewToShow, out newView); + if (success) { + CurrentView = newView; + } + } + } + + public interface IManufacturingStageViewModel : IManufacturingStageInputData { } +} diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAirdragViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAirdragViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..34e78a737068f954bf85d8ef7974b432b52eaee9 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageAirdragViewModel.cs @@ -0,0 +1,76 @@ +using System; +using System.Windows; +using System.Windows.Input; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Properties; +using VECTO3GUI2020.Util; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Implementation.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; + +namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation +{ + public class MultistageAirdragViewModel : ViewModelBase, IMultistageAirdragViewModel + { + private IDialogHelper _dialogHelper; + private IXMLInputDataReader _inputDataReader; + private IComponentViewModelFactory _componentViewModelFactory; + private IAirDragViewModel _airdragViewModel; + private bool _airdragModified; + + + public IAirDragViewModel AirDragViewModel + { + get => _airdragViewModel; + set => SetProperty(ref _airdragViewModel, value); + } + + public bool AirdragModified + { + get => _airdragModified; + set => SetProperty(ref _airdragModified, value); + } + + + #region Commands + + private ICommand _loadAirdragFileCommand; + + public ICommand LoadAirdragFileCommand + { + get => _loadAirdragFileCommand ?? new RelayCommand(LoadAirdragFileCommandExecute, () => true); + } + + public void LoadAirdragFileCommandExecute() + { + var fileName = _dialogHelper.OpenXMLFileDialog(Settings.Default.DefaultFilePath); + + try { + IAirdragDeclarationInputData airdragInputData = _inputDataReader.Create(fileName) as IAirdragDeclarationInputData; + AirDragViewModel = (AirDragViewModel)_componentViewModelFactory.CreateComponentViewModel(airdragInputData); + AirdragModified = true; + + + } + catch (Exception e) { + _dialogHelper.ShowMessageBox(e.Message, "Invalid File", MessageBoxButton.OK, + MessageBoxImage.Error); + } + } + + #endregion + + + + + public MultistageAirdragViewModel(IDialogHelper dialogHelper, IXMLInputDataReader inputDataReader, IComponentViewModelFactory componentViewModelFactory) + { + _dialogHelper = dialogHelper; + _inputDataReader = inputDataReader; + _componentViewModelFactory = componentViewModelFactory; + } + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs new file mode 100644 index 0000000000000000000000000000000000000000..abc2dfc76a938a9e2c1a9be5db0d2bef7a3f21d1 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultistageJobViewModel_v0_1.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.Common; +using VECTO3GUI2020.ViewModel.Interfaces.Document; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; + +namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation +{ + public class MultiStageJobViewModel_v0_1 : ViewModelBase, IMultiStageJobViewModel + { + #region QualifiedXSD + + public static readonly string QUALIFIED_XSD_TYPE = XMLDeclarationInputDataProviderMultistageV01.QUALIFIED_XSD_TYPE; + + public static readonly string INPUTPROVIDERTYPE = + typeof(XMLDeclarationInputDataProviderMultistageV01).ToString(); + + private IDeclarationMultistageJobInputData _jobInputData; + #endregion + + private IManufacturingStageViewModel _manufacturingStageViewModel; + public IManufacturingStageViewModel ManufacturingStageViewModel + { + get => _manufacturingStageViewModel; + set => SetProperty(ref _manufacturingStageViewModel, value); + } + + private IMultiStageViewModelFactory _vmFactory; + + + public MultiStageJobViewModel_v0_1(IMultistageBusInputDataProvider inputData, IMultiStageViewModelFactory vmFactory) + { + _jobInputData = inputData.JobInputData; + _vmFactory = vmFactory; + + + + var prevStageInputData = _jobInputData.ManufacturingStages.Last(); + + _manufacturingStageViewModel = + vmFactory.CreateManufacturingStageViewModel(prevStageInputData.GetType().ToString(), + prevStageInputData); + + _jobInputData.ManufacturingStages.Add(_manufacturingStageViewModel as IManufacturingStageInputData); + + } + + + + public IPrimaryVehicleInformationInputDataProvider PrimaryVehicle => throw new NotImplementedException(); + + public IList<IManufacturingStageInputData> ManufacturingStages => throw new NotImplementedException(); + } + + public interface IMultiStageJobViewModel : IDeclarationMultistageJobInputData + { + IManufacturingStageViewModel ManufacturingStageViewModel { get; } + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/NewMultiStageJobViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/NewMultiStageJobViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..860a7c77dcc61d23cdb406b4546dcd3215845ba6 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/NewMultiStageJobViewModel.cs @@ -0,0 +1,90 @@ +using System; +using System.CodeDom; +using System.Diagnostics; +using System.Linq; +using System.Linq.Expressions; +using System.Windows; +using System.Windows.Input; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration; +using TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Reader; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.Properties; +using VECTO3GUI2020.Util; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.MultiStage.Interfaces; + +namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation +{ + public class NewMultiStageJobViewModel : ViewModelBase + { + private readonly Settings _settings = Settings.Default; + private ICommand _addVifCommand; + private string _vifPath; + private IDialogHelper _dialogHelper; + private IXMLInputDataReader _inputDataReader; + private IMultiStageViewModelFactory _vmFactory; + private IMultiStageJobViewModel _multistageJobViewModel; + public string VifPath { get => _vifPath; set => SetProperty(ref _vifPath, value); } + + + public IMultiStageJobViewModel MultiStageJobViewModel + { + get { return _multistageJobViewModel; } + set { SetProperty(ref _multistageJobViewModel, value); } + } + + + + public NewMultiStageJobViewModel(IDialogHelper dialogHelper, + IXMLInputDataReader inputDataReader, + IMultiStageViewModelFactory vmFactory) + { + _inputDataReader = inputDataReader; + _dialogHelper = dialogHelper; + _vmFactory = vmFactory; + Title = "New Multistage file"; + VifPath = "Select VIF File"; + } + + + + #region AddVifCommand + + public ICommand AddVifFile + { + get => _addVifCommand ?? new RelayCommand(AddVifFileExecute, () => true); + } + + private void AddVifFileExecute() + { + + var fileName = _dialogHelper.OpenXMLFileDialog(_settings.DefaultFilePath); + IMultistageBusInputDataProvider inputDataProvider = null; + try { + inputDataProvider = _inputDataReader.Create(fileName) as IMultistageBusInputDataProvider; + } + catch(Exception e) { + _dialogHelper.ShowMessageBox(e.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); + } + + if (inputDataProvider == null) { + + _dialogHelper.ShowMessageBox("invalid input file", "Error", MessageBoxButton.OK, MessageBoxImage.Error); + return; + } + + MultiStageJobViewModel = + _vmFactory.CreateMultiStageJobViewModel(inputDataProvider.GetType().ToString(), inputDataProvider); + VifPath = fileName; + } + + + + #endregion + + } +} diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultiStageViewModelFactory.cs b/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultiStageViewModelFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..c791d0f952024f910528318a4327d8484d06a47a --- /dev/null +++ b/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultiStageViewModelFactory.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.ViewModel.Interfaces.Common; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle; +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; +using VECTO3GUI2020.ViewModel.MultiStage.Implementation; + +namespace VECTO3GUI2020.ViewModel.MultiStage.Interfaces +{ + public interface IMultiStageViewModelFactory + { + IViewModelBase CreateNewMultiStageJobViewModel(); + + IMultiStageJobViewModel CreateMultiStageJobViewModel(string inputProviderType, IMultistageBusInputDataProvider inputData); + + IVehicleViewModel CreateInterimStageVehicleViewModel(string inputProviderType); + + IManufacturingStageViewModel CreateManufacturingStageViewModel(string inputProviderType, IManufacturingStageInputData prevStageInputData); + + IMultistageAirdragViewModel createMultistageAirdragViewModel(); + } +} diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultistageAirdragViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultistageAirdragViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..e4bd94ca779906599e45c1f79fc921fbdaa6ba31 --- /dev/null +++ b/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IMultistageAirdragViewModel.cs @@ -0,0 +1,9 @@ +using VECTO3GUI2020.ViewModel.Interfaces.JobEdit.Vehicle.Components; + +namespace VECTO3GUI2020.ViewModel.MultiStage.Interfaces +{ + public interface IMultistageAirdragViewModel + { + + } +} \ No newline at end of file diff --git a/VECTO3GUI2020/Views/CustomControls/ComboParameter.xaml b/VECTO3GUI2020/Views/CustomControls/ComboParameter.xaml new file mode 100644 index 0000000000000000000000000000000000000000..06f76a1a5c826f4149240a2198c4dbe13efbe8b6 --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/ComboParameter.xaml @@ -0,0 +1,32 @@ +<UserControl x:Class="VECTO3GUI2020.Views.CustomControls.ComboParameter" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + d:DesignHeight="30" d:DesignWidth="200" + Name="comboparameter"> + <Grid HorizontalAlignment="Stretch"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + <Label Grid.Column="0" + Content="{Binding Label, ElementName=comboparameter}" + Margin="2" + Padding="2"/> + <ComboBox Grid.Column="1" + Margin="2" + SelectedValue="{Binding Content, Mode=TwoWay, ElementName=comboparameter}" + ItemsSource="{Binding ListItems, ElementName=comboparameter}" + IsEditable="False" + IsReadOnly="True" + /> + + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/CustomControls/ComboParameter.xaml.cs b/VECTO3GUI2020/Views/CustomControls/ComboParameter.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..7abdeb6559212013378d1c0223583fd1373a551d --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/ComboParameter.xaml.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Resources; +using System.Windows; +using System.Windows.Controls; +using VECTO3GUI2020.Properties; + +namespace VECTO3GUI2020.Views.CustomControls +{ + public partial class ComboParameter : UserControl + { + ResourceManager _resourceManager; + public string Label + { + get { return (string)GetValue(LabelProperty); } + set { SetValue(LabelProperty, value); } + } + + // Using a DependencyProperty as the backing store for Label. This enables animation, styling, binding, etc... + public static readonly DependencyProperty LabelProperty = + DependencyProperty.Register("Label", typeof(string), typeof(ComboParameter), new PropertyMetadata("")); + + + + public List<object> ListItems + { + get { return (List<object>)GetValue(ListItemsProperty); } + set { SetValue(ListItemsProperty, value); } + } + + // Using a DependencyProperty as the backing store for ListItems. This enables animation, styling, binding, etc... + public static readonly DependencyProperty ListItemsProperty = + DependencyProperty.Register("ListItems", typeof(List<object>), typeof(ComboParameter), + new FrameworkPropertyMetadata(AvailableItemsChanged) { BindsTwoWayByDefault = true }); + + public static void AvailableItemsChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) + { + var newVal = e.NewValue; + //Console.WriteLine("Items Changed..."); + } + + + + public object SelectedItem + { + get { return (object)GetValue(SelectedItemProperty); } + set { SetValue(SelectedItemProperty, value); } + } + + // Using a DependencyProperty as the backing store for SelectedItem. This enables animation, styling, binding, etc... + public static readonly DependencyProperty SelectedItemProperty = + DependencyProperty.Register("SelectedItem", typeof(object), typeof(ComboParameter), new FrameworkPropertyMetadata(AvailableItemsChanged) { BindsTwoWayByDefault = true }); + + + + public new object Content + { + get { return (object)GetValue(ContentProperty); } + set + { + SetCurrentValue(ContentProperty, value); + } + } + + public static new readonly DependencyProperty ContentProperty = + DependencyProperty.Register("Content", + typeof(object), + typeof(ComboParameter), + new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(ContentChanged))); + + + private static void ContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ComboParameter comboParameter = (ComboParameter)d; + comboParameter.UpdateLabel(e); + comboParameter.UpdateComboBox(e); + + + } + + private void UpdateLabel(DependencyPropertyChangedEventArgs e) + { + + if ((e.NewValue == e.OldValue)) + { + return; //Check if this can happen + } + Content = e.NewValue; + + var Binding = this.GetBindingExpression(ContentProperty); + var PropertyName = Binding?.ResolvedSourcePropertyName; + if (PropertyName == null || Binding == null) + { + //Debug.WriteLine("Binding or Property name == null"); + return; + } + //Debug.WriteLine("PropertyName: " + PropertyName); + + Label = _resourceManager?.GetString(PropertyName) ?? PropertyName; + + } + + private void UpdateComboBox(DependencyPropertyChangedEventArgs e) + { + + if ((e.NewValue == e.OldValue)) + { + return; //Check if this can happen + } + + var Binding = this.GetBindingExpression(ContentProperty); + var PropertyName = Binding?.ResolvedSourcePropertyName; + if (PropertyName == null || Binding == null) + { + //Debug.WriteLine("Binding or Property name == null"); + return; + } + + var data = Binding.ResolvedSource.GetType().GetProperty(PropertyName).GetValue(Binding.DataItem); + //Console.WriteLine("Selected Item:" + data); + + + var items = Enum.GetValues(data.GetType()).Cast<object>().ToList<object>(); + ListItems = items; + SelectedItem = data; + + } + + + public ComboParameter() + { + InitializeComponent(); + _resourceManager = Strings.ResourceManager; + + } + + } +} diff --git a/VECTO3GUI2020/Views/CustomControls/CustomControlExtensionMethods.cs b/VECTO3GUI2020/Views/CustomControls/CustomControlExtensionMethods.cs new file mode 100644 index 0000000000000000000000000000000000000000..79cb6a1d4efc7ab3a9309ddbcd65fdebc18545db --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/CustomControlExtensionMethods.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Resources; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.CustomControls +{ + public static class CustomControlExtensionMethods + { + /// <summary> + /// Looks up the Label by the name the Property that is used for the binding + /// </summary> + /// <param name="dependencyProperty"></param> + /// <param name="resourceManager"></param> + /// <returns></returns> + public static string GetLabelByPropertyName(this UserControl userControl, DependencyProperty dependencyProperty, ResourceManager resourceManager) + { + var name = "unresolved"; + var Binding = userControl.GetBindingExpression(dependencyProperty); + var PropertyName = Binding?.ResolvedSourcePropertyName; + + if (PropertyName == null || Binding == null) + { + return name; + } + + + var extendedPropertyName = Binding?.ResolvedSource.GetType().Name + "_" + PropertyName; + name = resourceManager?.GetString(extendedPropertyName) ?? resourceManager?.GetString(PropertyName) ?? (PropertyName + "_"); //_Postfix to label Property Names that are not in strings.resx + + return name; + } + + public static Type GetPropertyType(this UserControl userControl, DependencyProperty dependencyProperty) + { + var Binding = userControl.GetBindingExpression(dependencyProperty); + var PropertyName = Binding?.ResolvedSourcePropertyName; + + if (PropertyName == null || Binding == null) { + return typeof(object); + } + var PropertyType = Binding?.ResolvedSource.GetType().GetProperty(PropertyName).PropertyType; + return PropertyType; + } + } +} diff --git a/VECTO3GUI2020/Views/CustomControls/DateTimePicker.xaml b/VECTO3GUI2020/Views/CustomControls/DateTimePicker.xaml new file mode 100644 index 0000000000000000000000000000000000000000..25dd36e6b6fb0b363a5d6ddfa25519c7c8f9a1ac --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/DateTimePicker.xaml @@ -0,0 +1,33 @@ +<UserControl x:Class="VECTO3GUI2020.Views.CustomControls.DateTimePicker" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + d:DesignHeight="30" d:DesignWidth="200" + Name="customDateTimePicker" + > + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + <TextBlock Grid.Column="0" + Margin="2 2 2 2" + Padding="2 2 2 2" + Text="{Binding Label, ElementName=customDateTimePicker}" + Visibility="Visible"/> + <DatePicker Grid.Column="1" Background="White" + Margin="2 2 2 2" + Padding="2 2 2 2" + SelectedDate="{Binding Date, + ElementName=customDateTimePicker, + Mode=TwoWay}" + Visibility="Visible" + BorderThickness="1" + BorderBrush="DarkGray"/> + </Grid> + +</UserControl> diff --git a/VECTO3GUI2020/Views/CustomControls/DateTimePicker.xaml.cs b/VECTO3GUI2020/Views/CustomControls/DateTimePicker.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..2b6b389778fd8c571554daa15e2c26df8d0d6548 --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/DateTimePicker.xaml.cs @@ -0,0 +1,75 @@ +using System; +using System.Resources; +using System.Windows; +using System.Windows.Controls; +using VECTO3GUI2020.Properties; + +namespace VECTO3GUI2020.Views.CustomControls +{ + /// <summary> + /// Interaction logic for DateTimePicker.xaml + /// </summary> + public partial class DateTimePicker : UserControl + { + + + ResourceManager _resourceManager; + + + public string Label + { + get { return (string)GetValue(LabelProperty); } + set { SetValue(LabelProperty, value); } + } + + // Using a DependencyProperty as the backing store for Label. This enables animation, styling, binding, etc... + public static readonly DependencyProperty LabelProperty = + DependencyProperty.Register("Label", typeof(string), typeof(DateTimePicker), new PropertyMetadata("")); + + + + + public DateTime Date + { + get { return (DateTime)GetValue(DateProperty); } + set { SetCurrentValue(DateProperty, value); } + } + + // Using a DependencyProperty as the backing store for Date. This enables animation, styling, binding, etc... + public static readonly DependencyProperty DateProperty = + DependencyProperty.Register("Date", typeof(DateTime), typeof(DateTimePicker), new PropertyMetadata(DateTime.Now, new PropertyChangedCallback(ContentChanged))); + + + public DateTimePicker() + { + InitializeComponent(); + _resourceManager = Strings.ResourceManager; + } + + private static void ContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if ((e.NewValue == e.OldValue)) + { + return; + } + DateTimePicker dateTimePicker = (DateTimePicker)d; + dateTimePicker.UpdateLabel(e); + } + + + private void UpdateLabel(DependencyPropertyChangedEventArgs e) + { + + var Binding = this.GetBindingExpression(DateProperty); + var PropertyName = Binding?.ResolvedSourcePropertyName; + if (PropertyName == null || Binding == null) + { + //Debug.WriteLine("Binding or Property name == null"); + return; + } + //Debug.WriteLine("PropertyName: " + PropertyName); + + Label = _resourceManager?.GetString(PropertyName) ?? PropertyName; + } + } +} diff --git a/VECTO3GUI2020/Views/CustomControls/LabledCheckBoxAutomatic.xaml b/VECTO3GUI2020/Views/CustomControls/LabledCheckBoxAutomatic.xaml new file mode 100644 index 0000000000000000000000000000000000000000..40c0ee2183f3c0cc0adebcda7cc802358acf6334 --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/LabledCheckBoxAutomatic.xaml @@ -0,0 +1,26 @@ +<UserControl x:Class="VECTO3GUI2020.Views.CustomControls.LabledCheckBoxAutomatic" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.CustomControls" + Name="labledcheckboxautomatic" + mc:Ignorable="d" d:DesignWidth="748.458" Height="30"> + <Grid HorizontalAlignment="Stretch"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + <Label Grid.Column="0" + Padding="2 2 2 2" + Margin="2 2 2 2" + Content="{Binding Label, ElementName=labledcheckboxautomatic}" /> + + <CheckBox Grid.Column="1" + Padding="2 2 2 2" + Margin="2 2 2 2" + IsChecked="{Binding Content, ElementName=labledcheckboxautomatic}" /> + + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/CustomControls/LabledCheckBoxAutomatic.xaml.cs b/VECTO3GUI2020/Views/CustomControls/LabledCheckBoxAutomatic.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..66274b7dd6ef5d4cf16aa490a3985e8b177b3cd5 --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/LabledCheckBoxAutomatic.xaml.cs @@ -0,0 +1,76 @@ +using System.Diagnostics; +using System.Resources; +using System.Windows; +using System.Windows.Controls; +using VECTO3GUI2020.Properties; + + +namespace VECTO3GUI2020.Views.CustomControls +{ + /// <summary> + /// Interaction logic for LabledCheckBoxAutomatic.xaml + /// </summary> + public partial class LabledCheckBoxAutomatic : UserControl + { + + + private readonly ResourceManager _resourceManager; + + public string Label + { + get { return (string)GetValue(LabelProperty); } + set { SetValue(LabelProperty, value); } + } + + // Using a DependencyProperty as the backing store for Label. This enables animation, styling, binding, etc... + public static readonly DependencyProperty LabelProperty = + DependencyProperty.Register("Label", + typeof(string), + typeof(LabledCheckBoxAutomatic), + new PropertyMetadata("")); + + public new object Content + { + get { return (object)GetValue(ContentProperty); } + set + { + SetCurrentValue(ContentProperty, value); + } + } + + // Using a DependencyProperty as the backing store for MyObject. This enables animation, styling, binding, etc... + public static new readonly DependencyProperty ContentProperty = + DependencyProperty.Register("Content", + typeof(object), + typeof(LabledCheckBoxAutomatic), + new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(ContentChanged))); + + + private static void ContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + + LabledCheckBoxAutomatic labledCheckBox = (LabledCheckBoxAutomatic)d; + labledCheckBox.UpdateContent(e); + } + + private void UpdateContent(DependencyPropertyChangedEventArgs e) + { + var Binding = this.GetBindingExpression(ContentProperty); + var PropertyName = Binding?.ResolvedSourcePropertyName; + if (PropertyName == null || Binding == null) + { + return; + } + + var ExtendedPropertyName = Binding?.ResolvedSource.GetType().Name + "_" + PropertyName; + Label = _resourceManager?.GetString(ExtendedPropertyName) ?? _resourceManager?.GetString(PropertyName) ?? (PropertyName + "_"); //_Postfix to label Property Names that are not in strings.resx + + } + + public LabledCheckBoxAutomatic() + { + InitializeComponent(); + _resourceManager = Strings.ResourceManager; + } + } +} diff --git a/VECTO3GUI2020/Views/CustomControls/LabledTextBox.xaml b/VECTO3GUI2020/Views/CustomControls/LabledTextBox.xaml new file mode 100644 index 0000000000000000000000000000000000000000..1bad4a8bc96f0dead14de7ef669bd754cd2e39fd --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/LabledTextBox.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="VECTO3GUI2020.Views.CustomControls.LabledTextBox" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + Name="labledtextbox" + d:DesignHeight="30" d:DesignWidth="200"> + <Grid> + <!-- https://www.youtube.com/watch?v=h7ZrdGiOm3E Toskers Corner --> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="1*"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + <Label Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="0" + Content="{Binding Label, ElementName=labledtextbox}" /> + <TextBox Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" + Text="{Binding Text, ElementName=labledtextbox}" /> + </Grid> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/CustomControls/LabledTextBox.xaml.cs b/VECTO3GUI2020/Views/CustomControls/LabledTextBox.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..8b2abb3d833cf1faf770e63aa72d207b190fe6ae --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/LabledTextBox.xaml.cs @@ -0,0 +1,42 @@ +using System.Windows; +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.CustomControls +{ + /// <summary> + /// Interaktionslogik für LabledTextBox.xaml + /// </summary> + public partial class LabledTextBox : UserControl + { + + public string Label + { + get { return (string)GetValue(LabelProperty); } + set { SetValue(LabelProperty, value); } + } + + // Using a DependencyProperty as the backing store for Label. This enables animation, styling, binding, etc... + public static readonly DependencyProperty LabelProperty = + DependencyProperty.Register("Label", typeof(string), typeof(LabledTextBox), new PropertyMetadata("Label")); + + + + public string Text + { + get { return (string)GetValue(TextProperty); } + set { SetValue(TextProperty, value); } + } + + // Using a DependencyProperty as the backing store for Text. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TextProperty = + DependencyProperty.Register("Text", typeof(string), typeof(LabledTextBox), new PropertyMetadata("Text")); + + + + + public LabledTextBox() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/CustomControls/LabledTextBoxAutomatic.xaml b/VECTO3GUI2020/Views/CustomControls/LabledTextBoxAutomatic.xaml new file mode 100644 index 0000000000000000000000000000000000000000..0235378b67a9962962d021926c87cd98a48effe5 --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/LabledTextBoxAutomatic.xaml @@ -0,0 +1,40 @@ +<UserControl x:Class="VECTO3GUI2020.Views.CustomControls.LabledTextBoxAutomatic" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + d:DesignHeight="30" d:DesignWidth="200" Height="30" + Name="labledtextboxautomatic" + HorizontalAlignment="Stretch"> + <Grid HorizontalAlignment="Stretch"> + <!-- https://www.youtube.com/watch?v=h7ZrdGiOm3E Toskers Corner --> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + <Label Grid.Column="0" + Padding="2 2 2 2" + Margin="2 2 2 2" + Content="{Binding Label, ElementName=labledtextboxautomatic, + Converter={StaticResource LabledTextBoxLabelConverter} }" /> + + <TextBox Grid.Column="1" + Padding="2 2 2 2" + Margin="2 2 2 2" + Text="{Binding Content, ElementName=labledtextboxautomatic, + Converter={StaticResource LabledTextBoxConverter} }" /> + <!-- UpdateSourceTrigger=PropertyChanged, --> + + <Label Grid.Column="2" x:Name="AutoUnitLabel" + Content="{Binding Content, ElementName=labledtextboxautomatic, + Converter={StaticResource SIToUnitStringConverter}, ConverterParameter=int }"> + </Label> + <Label Grid.Column="2" x:Name ="UserUnitLabel" + Content="{Binding UserUnit, ElementName=labledtextboxautomatic}" Visibility="Hidden"> + </Label> + + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/CustomControls/LabledTextBoxAutomatic.xaml.cs b/VECTO3GUI2020/Views/CustomControls/LabledTextBoxAutomatic.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..68b75d7835221f32aed5f74f7e7ac4a712d84618 --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/LabledTextBoxAutomatic.xaml.cs @@ -0,0 +1,142 @@ +using System.Resources; +using System.Windows; +using System.Windows.Controls; +using VECTO3GUI2020.Properties; + +namespace VECTO3GUI2020.Views.CustomControls +{ + /// <summary> + /// Interaction logic for LabledTextBoxAutomatic.xaml + /// </summary> + public partial class LabledTextBoxAutomatic : UserControl + { + + private readonly ResourceManager _resourceManager; + public string Label + { + get { return (string)GetValue(LabelProperty); } + set { SetValue(LabelProperty, value); } + } + + // Using a DependencyProperty as the backing store for Label. This enables animation, styling, binding, etc... + public static readonly DependencyProperty LabelProperty = + DependencyProperty.Register("Label", + typeof(string), + typeof(LabledTextBoxAutomatic), + new PropertyMetadata("")); + + + public string Text + { + get { return (string)GetValue(TextProperty); } + set { SetValue(TextProperty, value); } + } + + // Using a DependencyProperty as the backing store for Text. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TextProperty = + DependencyProperty.Register("Text", + typeof(string), + typeof(LabledTextBoxAutomatic), + new FrameworkPropertyMetadata() { BindsTwoWayByDefault = true }); + + public string UnitText + { + get { return (string)GetValue(UnitTextProperty); } + set { SetValue(UnitTextProperty, value); } + } + + + + // Using a DependencyProperty as the backing store for UnitText. This enables animation, styling, binding, etc... + public static readonly DependencyProperty UnitTextProperty = + DependencyProperty.Register("UnitText", + typeof(string), + typeof(LabledTextBoxAutomatic), + new PropertyMetadata("")); + + public string UserUnit + { + get { return (string)GetValue(UserUnitProperty); } + set { SetValue(UserUnitProperty, value); } + } + + // Using a DependencyProperty as the backing store for Label. This enables animation, styling, binding, etc... + public static readonly DependencyProperty UserUnitProperty = + DependencyProperty.Register("UserUnit", + typeof(string), + typeof(LabledTextBoxAutomatic), + new PropertyMetadata("")); + + + public new object Content + { + get { return (object)GetValue(ContentProperty); } + set + { + SetCurrentValue(ContentProperty, value); + } + } + + // Using a DependencyProperty as the backing store for MyObject. This enables animation, styling, binding, etc... + public static new readonly DependencyProperty ContentProperty = + DependencyProperty.Register("Content", + typeof(object), + typeof(LabledTextBoxAutomatic), + new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(ContentChanged))); + + public LabledTextBoxAutomatic() + { + InitializeComponent(); + + _resourceManager = Strings.ResourceManager; + } + + private static void ContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + + LabledTextBoxAutomatic labledTextBox = (LabledTextBoxAutomatic)d; + labledTextBox.UpdateContent(e); + } + + private void UpdateContent(DependencyPropertyChangedEventArgs e) + { + var Binding = this.GetBindingExpression(ContentProperty); + var PropertyName = Binding?.ResolvedSourcePropertyName; + if(PropertyName == null || Binding == null) + { + return; + } + + var ExtendedPropertyName = Binding?.ResolvedSource.GetType().Name + "_" + PropertyName; + + Label = _resourceManager?.GetString(ExtendedPropertyName) ??_resourceManager?.GetString(PropertyName) ?? (PropertyName + "_"); //_Postfix to label Property Names that are not in strings.resx + + var data = Binding.ResolvedSource.GetType().GetProperty(PropertyName).GetValue(Binding.DataItem); + if (data == null) return; + + if (UserUnit != "") + { + //UserUnit Visibility + this.AutoUnitLabel.Visibility = Visibility.Hidden; + this.UserUnitLabel.Visibility = Visibility.Visible; + } + + /* + if (data is SI SIUnit) + { + UnitText = SIUnit.UnitString; + Text = SIUnit.ToGUIFormat(); + } + else if (data is string || data is double){ + Text = Content?.ToString(); + }else + { + Debug.Assert(false, "Unsopported Property Type" + data.GetType().ToString()); + } + */ + + } + + + } +} diff --git a/VECTO3GUI2020/Views/CustomControls/LabledTextBoxUnit.xaml b/VECTO3GUI2020/Views/CustomControls/LabledTextBoxUnit.xaml new file mode 100644 index 0000000000000000000000000000000000000000..6c820b82661e20497984de560edaa971ef10db78 --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/LabledTextBoxUnit.xaml @@ -0,0 +1,24 @@ +<UserControl x:Class="VECTO3GUI2020.Views.CustomControls.LabledTextBoxUnit" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + Name="labledtextboxunit" + d:DesignHeight="30" d:DesignWidth="200"> + <!-- https://www.youtube.com/watch?v=h7ZrdGiOm3E Toskers Corner --> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="1*" /> + </Grid.ColumnDefinitions> + <Label Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="0" + Content="{Binding Label, ElementName=labledtextboxunit}" /> + <TextBox Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" + Text="{Binding Text, ElementName=labledtextboxunit}" /> + <Label Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="0" + Content="{Binding SIUnit, ElementName=labledtextboxunit}"/> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/CustomControls/LabledTextBoxUnit.xaml.cs b/VECTO3GUI2020/Views/CustomControls/LabledTextBoxUnit.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..5f096a159a75af2b3c746311861587690c83e682 --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/LabledTextBoxUnit.xaml.cs @@ -0,0 +1,53 @@ +using System.Windows; +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.CustomControls +{ + /// <summary> + /// Interaktionslogik für LabledTextBoxUnit.xaml + /// </summary> + public partial class LabledTextBoxUnit : UserControl + { + public string Label + { + get { return (string)GetValue(LabelProperty); } + set { SetValue(LabelProperty, value); } + } + + // Using a DependencyProperty as the backing store for Label. This enables animation, styling, binding, etc... + public static readonly DependencyProperty LabelProperty = + DependencyProperty.Register("Label", typeof(string), typeof(LabledTextBoxUnit), new PropertyMetadata("Label")); + + + + public string Text + { + get { return (string)GetValue(TextProperty); } + set { SetValue(TextProperty, value); } + } + + // Using a DependencyProperty as the backing store for Text. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TextProperty = + DependencyProperty.Register("Text", typeof(string), typeof(LabledTextBoxUnit), new PropertyMetadata("Text")); + + public string SIUnit + { + get { return (string)GetValue(SIUnitProperty); } + set { SetValue(SIUnitProperty, value); } + } + + // Using a DependencyProperty as the backing store for SIUnit. This enables animation, styling, binding, etc... + public static readonly DependencyProperty SIUnitProperty = + DependencyProperty.Register("SIUnit", typeof(string), typeof(LabledTextBoxUnit), new PropertyMetadata("SI")); + + + + + + + public LabledTextBoxUnit() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/CustomControls/ScatterPlot.xaml b/VECTO3GUI2020/Views/CustomControls/ScatterPlot.xaml new file mode 100644 index 0000000000000000000000000000000000000000..56839097559460975426d2750bcd82a251fa9a73 --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/ScatterPlot.xaml @@ -0,0 +1,36 @@ +<UserControl + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.CustomControls" + xmlns:wpf="clr-namespace:InteractiveDataDisplay.WPF;assembly=InteractiveDataDisplay.WPF" + xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="VECTO3GUI2020.Views.CustomControls.ScatterPlot" + mc:Ignorable="d" + x:Name="scatter" + d:DesignHeight="450" d:DesignWidth="800" Height="300" Width="auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" + Background="White"> + + + <Grid > + <DockPanel> + <wpf:Chart IsVerticalNavigationEnabled="False" + IsAutoFitEnabled="True" + IsHorizontalNavigationEnabled="False" + x:Name="chart" + LegendVisibility="Collapsed" + Title="{Binding Title, ElementName=scatter}" + BottomTitle="{Binding BottomTitle, ElementName=scatter}" + LeftTitle="{Binding LeftTitle, ElementName=scatter}" + RightTitle=" " + + Margin="20" Padding="20" Foreground="Black" Background="White" + DockPanel.Dock="Top" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" ClipToBounds="False"> + <wpf:Plot x:Name="plot" IsAutoFitEnabled="True" > + <wpf:CircleMarkerGraph IsAutoFitEnabled="True" x:Name="circles" Stroke="Black" StrokeThickness="0.3" + ColorDescription="{Binding ColorDescription, ElementName=scatter}"/> + </wpf:Plot> + </wpf:Chart> + </DockPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/CustomControls/ScatterPlot.xaml.cs b/VECTO3GUI2020/Views/CustomControls/ScatterPlot.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..73e56c8499ce2d3a55dbf67fe251d76aceb9c75a --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/ScatterPlot.xaml.cs @@ -0,0 +1,259 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Diagnostics; +using System.Linq; +using System.Resources; +using System.Security.RightsManagement; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using InteractiveDataDisplay.WPF; +using TUGraz.VectoCommon.Utils; +using VECTO3GUI2020.Properties; +using Color = System.Drawing.Color; + +namespace VECTO3GUI2020.Views.CustomControls +{ + /// <summary> + /// Interaction logic for ScatterPlot.xaml + /// </summary> + public partial class ScatterPlot : UserControl + { + + + public bool SwitchAxis + { + get { return (bool)GetValue(SwitchAxisProperty); } + set { SetValue(SwitchAxisProperty, value); } + } + + // Using a DependencyProperty as the backing store for SwitchAxis. This enables animation, styling, binding, etc... + public static readonly DependencyProperty SwitchAxisProperty = + DependencyProperty.Register("SwitchAxis", typeof(bool), typeof(ScatterPlot), new PropertyMetadata(false)); + + + + public DataTable MyDataTable + { + get { return (DataTable)GetValue(MyDataTableProperty); } + set { SetValue(MyDataTableProperty, value); } + } + + // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc... + public static readonly DependencyProperty MyDataTableProperty = + DependencyProperty.Register("MyDataTable", + typeof(DataTable), + typeof(ScatterPlot), new FrameworkPropertyMetadata( + new DataTable("DefaultDataTable"), + FrameworkPropertyMetadataOptions.None, + ContentChanged)); + + private ResourceManager _resourceManager; + + private string _yLabel; + private string _xLabel; + + private DataColumn _xColumn; + private DataColumn _yColumn; + private DataColumn _cColumn; + private DataColumn _sColumn; + + private bool _hasThirdCol = false; + + + + + public string Title + { + get { return (string)GetValue(TitleProperty); } + set { SetValue(TitleProperty, value); } + } + + // Using a DependencyProperty as the backing store for Title. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TitleProperty = + DependencyProperty.Register("Title", typeof(string), typeof(ScatterPlot), new PropertyMetadata("Title")); + + + + + public string LeftTitle + { + get { return (string)GetValue(LeftTitleProperty); } + set { SetValue(LeftTitleProperty, value); } + } + + // Using a DependencyProperty as the backing store for LeftTitle. This enables animation, styling, binding, etc... + public static readonly DependencyProperty LeftTitleProperty = + DependencyProperty.Register("LeftTitle", typeof(string), typeof(ScatterPlot), new PropertyMetadata("y_axis_label")); + + + + + + public string BottomTitle + { + get { return (string)GetValue(BottomTitleProperty); } + set { SetValue(BottomTitleProperty, value); } + } + + // Using a DependencyProperty as the backing store for BottomTitle. This enables animation, styling, binding, etc... + public static readonly DependencyProperty BottomTitleProperty = + DependencyProperty.Register("BottomTitle", typeof(string), typeof(ScatterPlot), new PropertyMetadata("x_axis_label")); + + + + + public string Description + { + get { return (string)GetValue(DescriptionProperty); } + set { SetValue(DescriptionProperty, value); } + } + + // Using a DependencyProperty as the backing store for Description. This enables animation, styling, binding, etc... + public static readonly DependencyProperty DescriptionProperty = + DependencyProperty.Register("Description", typeof(string), typeof(ScatterPlot), new PropertyMetadata(null)); + + + + + public string ColorDescription + { + get { return (string)GetValue(ColorDescriptionProperty); } + set { SetValue(ColorDescriptionProperty, value); } + } + + // Using a DependencyProperty as the backing store for ColorDescription. This enables animation, styling, binding, etc... + public static readonly DependencyProperty ColorDescriptionProperty = + DependencyProperty.Register("ColorDescription", typeof(string), typeof(ScatterPlot), new PropertyMetadata("")); + + + + public ScatterPlot() + { + InitializeComponent(); + _resourceManager = Strings.ResourceManager; + } + + + + + private static void ContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ScatterPlot plot = (ScatterPlot)d; + if (plot.MyDataTable == null || plot.MyDataTable.TableName == "DefaultDataTable") + { + return; + } + + plot.SetColumns(); + plot.SetLabels(); + } + + private void SetColumns() + { + + Debug.Assert(MyDataTable.Columns.Count > 2); + if (SwitchAxis) { + _xColumn = MyDataTable.Columns[1]; + _yColumn = MyDataTable.Columns[0]; + } else { + _xColumn = MyDataTable.Columns[0]; + _yColumn = MyDataTable.Columns[1]; + } + + _hasThirdCol = MyDataTable.Columns.Count >= 3; + + + uint N = (uint)MyDataTable.Rows.Count; + object[] xData = new object[N]; + object[] yData = new object[N]; + + if (_hasThirdCol) { + uint i = 0; + object[] cData = new object[N]; + _cColumn = MyDataTable.Columns[2]; + foreach (DataRow row in MyDataTable.Rows) + { + xData[i] = row[_xColumn].ToString().ToDouble(); + yData[i] = row[_yColumn].ToString().ToDouble(); + cData[i] = row[_cColumn].ToString().ToDouble(); + i++; + } + circles.PlotColor(xData, yData, cData); + } else { + uint i = 0; + foreach (DataRow row in MyDataTable.Rows) + { + xData[i] = row[_xColumn].ToString().ToDouble(); + yData[i] = row[_yColumn].ToString().ToDouble(); + i++; + } + circles.PlotXY(xData, yData); + } + } + + private void SetLabels() + { + Title = MyDataTable.TableName; + LeftTitle = _yColumn.ColumnName; + BottomTitle = _xColumn.ColumnName; + Description = _yColumn.ColumnName; + if (_hasThirdCol) { + ColorDescription = _cColumn.ColumnName; + } + + + + } + + + + /* + * double[] x = new double[N]; + double[] y = new double[N]; + double[] c = new double[N]; + double[] d = new double[N]; + + Random rand = new Random(); + //circles + for (int i = 0; i < N; i++) + { + x[i] = rand.Next(M); + y[i] = rand.Next(M); + c[i] = rand.NextDouble(); + d[i] = 20 * rand.NextDouble(); + } + + circles.PlotColorSize(x, y, c, d); + //diamonds + x = new double[N]; + y = new double[N]; + c = new double[N]; + d = new double[N]; + + for (int i = 0; i < N; i++) + { + x[i] = rand.Next(M); + y[i] = rand.Next(M); + c[i] = rand.NextDouble(); + d[i] = 20 * rand.NextDouble(); + } + diamonds.PlotColorSize(x, y, c, d); + * + * + * + * + * + */ + + } +} diff --git a/VECTO3GUI2020/Views/CustomControls/Viewer.xaml b/VECTO3GUI2020/Views/CustomControls/Viewer.xaml new file mode 100644 index 0000000000000000000000000000000000000000..91de05bebcc58f79d0d6340268758ec1ec212bb0 --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/Viewer.xaml @@ -0,0 +1,110 @@ +<!-- Template: https://www.codeproject.com/Articles/71069/A-Simple-WPF-XML-Document-Viewer-Control --> + <UserControl x:Class="VECTO3GUI2020.Views.CustomControls.Viewer" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:xmlstack="clr-namespace:System.Xml;assembly=System.Xml" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + + <UserControl.Resources> + <SolidColorBrush Color="Blue" x:Key="xmlValueBrush"/> + <SolidColorBrush Color="Red" x:Key="xmAttributeBrush"/> + <SolidColorBrush Color="DarkMagenta" x:Key="xmlTagBrush"/> + <SolidColorBrush Color="Blue" x:Key="xmlMarkBrush"/> + + <DataTemplate x:Key="attributeTemplate"> + <StackPanel Orientation="Horizontal" + + Margin="3,0,0,0" HorizontalAlignment="Center"> + <TextBlock Text="{Binding Path=Name}" + + Foreground="{StaticResource xmAttributeBrush}"/> + <TextBlock Text="="" + + Foreground="{StaticResource xmlMarkBrush}"/> + <TextBlock Text="{Binding Path=Value}" + + Foreground="{StaticResource xmlValueBrush}"/> + <TextBlock Text=""" + + Foreground="{StaticResource xmlMarkBrush}"/> + </StackPanel> + </DataTemplate> + + <Style TargetType="{x:Type TreeViewItem}"> + <Setter Property="IsExpanded" Value="True"/> + </Style> + + <HierarchicalDataTemplate x:Key="treeViewTemplate" + + ItemsSource="{Binding XPath=child::node()}"> + <StackPanel Orientation="Horizontal" Margin="3,0,0,0" + + HorizontalAlignment="Center"> + <TextBlock Text="<" HorizontalAlignment="Center" + + Foreground="{StaticResource xmlMarkBrush}" + + x:Name="startTag"/> + + <TextBlock Text="{Binding Path=Name}" + + Margin="0" + + HorizontalAlignment="Center" + + x:Name="xmlTag" + + Foreground="{StaticResource xmlTagBrush}"/> + + <ItemsControl + + ItemTemplate="{StaticResource attributeTemplate}" + + ItemsSource="{Binding Path=Attributes}" + + HorizontalAlignment="Center"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Horizontal"/> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + </ItemsControl> + + <TextBlock Text=">" HorizontalAlignment="Center" + + Foreground="{StaticResource xmlMarkBrush}" + + x:Name="endTag"/> + </StackPanel> + + <HierarchicalDataTemplate.Triggers> + <DataTrigger Binding="{Binding NodeType}"> + <DataTrigger.Value> + <xmlstack:XmlNodeType>Text</xmlstack:XmlNodeType> + </DataTrigger.Value> + <Setter Property="Text" Value="{Binding InnerText}" + + TargetName="xmlTag"/> + <Setter Property="Foreground" Value="Blue" + + TargetName="xmlTag"/> + <Setter Property="Visibility" Value="Collapsed" + + TargetName="startTag"/> + <Setter Property="Visibility" Value="Collapsed" + + TargetName="endTag"/> + </DataTrigger> + + <DataTrigger Binding="{Binding HasChildNodes}" Value="False"> + <Setter Property="Text" Value="/>" TargetName="endTag"/> + </DataTrigger> + </HierarchicalDataTemplate.Triggers> + </HierarchicalDataTemplate> + </UserControl.Resources> + + <Grid> + <TreeView Grid.Row="2" Grid.ColumnSpan="2" Name="xmlTree" + + ItemTemplate="{StaticResource treeViewTemplate}"/> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/CustomControls/Viewer.xaml.cs b/VECTO3GUI2020/Views/CustomControls/Viewer.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..05920e5973b2fa60d36dd7da2c80c636055e30f1 --- /dev/null +++ b/VECTO3GUI2020/Views/CustomControls/Viewer.xaml.cs @@ -0,0 +1,47 @@ +using System.Windows.Controls; +using System.Windows.Data; +using System.Xml; + +namespace VECTO3GUI2020.Views.CustomControls +{ + /// <summary> + /// Interaktionslogik für Viewer.xaml + /// </summary> + public partial class Viewer : UserControl + { + + private XmlDocument _xmldocument; + public Viewer() + { + InitializeComponent(); + } + + + public XmlDocument xmlDocument + { + get { return _xmldocument; } + set + { + _xmldocument = value; + BindXMLDocument(); + } + } + + private void BindXMLDocument() + { + if (_xmldocument == null) + { + xmlTree.ItemsSource = null; + return; + } + + XmlDataProvider provider = new XmlDataProvider(); + provider.Document = _xmldocument; + Binding binding = new Binding(); + binding.Source = provider; + binding.XPath = "child::node()"; + xmlTree.SetBinding(TreeView.ItemsSourceProperty, binding); + } + + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/DeclarationJobEditView.xaml b/VECTO3GUI2020/Views/JobEditViews/DeclarationJobEditView.xaml new file mode 100644 index 0000000000000000000000000000000000000000..00111fd1d0fbdcb2333e0f5d9370d8d0c704acc8 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/DeclarationJobEditView.xaml @@ -0,0 +1,61 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.DeclarationJobEditView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views" + xmlns:i="http://schemas.microsoft.com/xaml/behaviors" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + + + <Grid Background="#e6f7ff"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="1*"/> + <ColumnDefinition Width="4*"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition></RowDefinition> + <RowDefinition Height="Auto"></RowDefinition> + </Grid.RowDefinitions> + <ListView + Grid.Column="0" Grid.RowSpan="2" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + Name="ComponentList" + ItemsSource="{Binding ComponentViewModels}" + SelectedItem ="{Binding CurrentDetailView, Mode=TwoWay}" SelectedIndex="1" + > + <ListView.Resources> + <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" /> + <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" /> + <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" /> + + </ListView.Resources> + + <ListView.ItemTemplate> + <DataTemplate> + <Label Content="{Binding Name}"/> + </DataTemplate> + </ListView.ItemTemplate> + <ListView.ItemContainerStyle> + <Style TargetType="{x:Type ListViewItem}"> + <Setter Property="Visibility" + Value="{Binding IsPresent, + Converter={StaticResource BooleanToVisibilityConverter}}"/> + <Setter Property="Focusable" Value="{Binding IsPresent}"/> + </Style> + </ListView.ItemContainerStyle> + </ListView> + <ContentControl Grid.Column="1" Grid.Row="0" Margin="10 10 10 10" Content="{Binding CurrentDetailView}"/> + <DockPanel Grid.Column="1" Grid.Row="1" LastChildFill="False" Background="White"> + <Button DockPanel.Dock="Right" Content="Save" Margin="2 2 2 2" Padding="5 0" + Command="{Binding SaveCommand}" Style="{StaticResource MainViewButton}"/> + <Button DockPanel.Dock="Right" Content="Save as ..." Margin="2 2 2 2" Padding="5 0" + Command="{Binding SaveAsCommand}" Style="{StaticResource MainViewButton}"/> + <Button DockPanel.Dock="Right" Content="Save Component to File" Margin="2 2 2 2 " Padding="5 0" IsEnabled="False" Style="{StaticResource MainViewButton}"></Button> + <Button DockPanel.Dock="Right" Content="Load XML File" Margin="2 2 2 2" Padding="5 0" IsEnabled="False" Style="{StaticResource MainViewButton}"></Button> + <Button DockPanel.Dock="Right" Content="Validate" Margin="2 2 2 2" Padding="5 0" IsEnabled="False" Style="{StaticResource MainViewButton}"></Button> + </DockPanel> + </Grid> +</UserControl> \ No newline at end of file diff --git a/VECTO3GUI2020/Views/JobEditViews/DeclarationJobEditView.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/DeclarationJobEditView.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..29452909d04aa44699e797c2f04c5285aa280b09 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/DeclarationJobEditView.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews +{ + /// <summary> + /// Interaction logic for JobEditView.xaml + /// </summary> + public partial class DeclarationJobEditView : UserControl + { + public DeclarationJobEditView() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/ADASView_v2_3.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/ADASView_v2_3.xaml new file mode 100644 index 0000000000000000000000000000000000000000..e533a6e0cf88cc5ba0622bb7c4d4fe14605ec772 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/ADASView_v2_3.xaml @@ -0,0 +1,34 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.ADASView_v2_3" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + + + <Grid> + <StackPanel> + <Label Content="Advanced Driving Assistant Systems" Style="{StaticResource LabelStyleSubView}"></Label> + <custom:ComboParameter Content="{Binding EcoRoll}"></custom:ComboParameter> + <custom:ComboParameter Content="{Binding PredictiveCruiseControl}"></custom:ComboParameter> + <custom:LabledCheckBoxAutomatic Content="{Binding EngineStopStart}"/> + + + <!-- https://stackoverflow.com/questions/9893825/mvvm-hiding-a-control-when-bound-property-is-not-present --> + + <custom:LabledCheckBoxAutomatic Content="{Binding ATEcoRollReleaseLockupClutch}" + Visibility="{Binding ATEcoRollReleaseLockupClutch, + Converter={StaticResource AlwaysVisibleConverter}, + FallbackValue=Collapsed}"/> + + <!-- + <CheckBox Content="Eco Roll Release Lockup Clutch" + IsChecked="{Binding ATEcoRollReleaseLockupClutch, FallbackValue=true}" + Visibility="{Binding ATEcoRollReleaseLockupClutch, Converter={StaticResource AlwaysVisibleConverter}, + FallbackValue=Collapsed}"/> --> + </StackPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/ADASView_v2_3.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/ADASView_v2_3.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..9c61bea4e37e7a97abf233e46043610005148b54 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/ADASView_v2_3.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for ADASView_v2_3.xaml + /// </summary> + public partial class ADASView_v2_3 : UserControl + { + public ADASView_v2_3() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AirDragView_v2_0.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AirDragView_v2_0.xaml new file mode 100644 index 0000000000000000000000000000000000000000..9d16bc0317faba0f5800d3bc097b7b1fd4e49041 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AirDragView_v2_0.xaml @@ -0,0 +1,19 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.AirDragView_v2_0" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" + > + <Grid> + <StackPanel Orientation="Vertical"> + <Label HorizontalAlignment="Stretch" Content="{Binding Name}" Background="Aquamarine" FontSize="20" Height="40" FontWeight="DemiBold" Padding="10 5 5 5"></Label> + <ContentControl Content="{Binding CommonComponentViewModel}"/> + <Separator/> + <custom:LabledTextBoxAutomatic Content="{Binding AirDragArea}"/> + </StackPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AirDragView_v2_0.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AirDragView_v2_0.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..1f93054e155ffb282871de8715296723408c4ce4 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AirDragView_v2_0.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaktionslogik für AirDragView_v2_0.xaml + /// </summary> + public partial class AirDragView_v2_0 : UserControl + { + public AirDragView_v2_0() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AngleDriveView_v2_0.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AngleDriveView_v2_0.xaml new file mode 100644 index 0000000000000000000000000000000000000000..af6514836e3a7cf3df1830c3f3cc30eba5ab3804 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AngleDriveView_v2_0.xaml @@ -0,0 +1,16 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.AngleDriveView_v2_0" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + xmlns:customControls="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + <Grid> + <DockPanel> + <ContentControl Content="{Binding CommonComponentViewModel}" DockPanel.Dock="Top"/> + <customControls:ScatterPlot MyDataTable="{Binding LossMap}"></customControls:ScatterPlot> + </DockPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AngleDriveView_v2_0.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AngleDriveView_v2_0.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..9f079ca06e9865791c4ca5f1f44cdbc4674b1209 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AngleDriveView_v2_0.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for AngleDriveView.xaml + /// </summary> + public partial class AngleDriveView_v2_0 : UserControl + { + public AngleDriveView_v2_0() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AuxiliariesView_v2_0.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AuxiliariesView_v2_0.xaml new file mode 100644 index 0000000000000000000000000000000000000000..63b4740ca395657e0e1d065db1b7d3ea318f3e94 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AuxiliariesView_v2_0.xaml @@ -0,0 +1,42 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.AuxiliariesView_v2_0" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + <Grid> + <DockPanel> + <Label HorizontalAlignment="Stretch" Content="{Binding Name}" Background="Aquamarine" FontSize="20" Height="40" FontWeight="DemiBold" Padding="10 5 5 5" DockPanel.Dock="Top"></Label> + <ScrollViewer DockPanel.Dock="Top" VerticalScrollBarVisibility="Auto"> + <ItemsControl ItemsSource="{Binding AuxiliaryViewModels}" Name="AxleList" AlternationCount="2"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Vertical" x:Name="StackPanel"> + <ContentControl Margin="5 5 5 5" Content="{Binding .}"/> + <Rectangle HorizontalAlignment="Stretch" Height="10" x:Name="Separator"/> + </StackPanel> + <DataTemplate.Triggers> + <Trigger Property="ItemsControl.AlternationIndex" Value="0"> + <Setter TargetName="StackPanel" Property="Background"> + <Setter.Value> + <SolidColorBrush Color="White" Opacity="0.9"/> + </Setter.Value> + </Setter> + </Trigger> + <Trigger Property="ItemsControl.AlternationIndex" Value="1"> + <Setter TargetName="StackPanel" Property="Background"> + <Setter.Value> + <SolidColorBrush Color="White" Opacity="0.3"/> + </Setter.Value> + </Setter> + </Trigger> + </DataTemplate.Triggers> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </ScrollViewer> + </DockPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AuxiliariesView_v2_0.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AuxiliariesView_v2_0.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..896afcd981a92dc70aaad1620fe7af854d6bcd48 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AuxiliariesView_v2_0.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaktionslogik für AuxiliariesView_v2_0.xaml + /// </summary> + public partial class AuxiliariesView_v2_0 : UserControl + { + public AuxiliariesView_v2_0() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AuxiliaryView_v2_0.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AuxiliaryView_v2_0.xaml new file mode 100644 index 0000000000000000000000000000000000000000..4fc975869a8e07e177ca983012d5c358a9785f5f --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AuxiliaryView_v2_0.xaml @@ -0,0 +1,16 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.AuxiliaryView_v2_0" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls"> + <Grid> + <StackPanel> + <Label Content="{Binding Name, FallbackValue='Auxiliary'}" Style="{DynamicResource LabelStyleSubView}" /> + <ComboBox ItemsSource="{Binding TechnologyList}" SelectedItem="{Binding TechnologyName, Mode=TwoWay}"></ComboBox> + </StackPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AuxiliaryView_v2_0.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AuxiliaryView_v2_0.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..222b0896ebdeb8c496d0d0bae97fc787f33377c3 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AuxiliaryView_v2_0.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for AuxiliaryView.xaml + /// </summary> + public partial class AuxiliaryView_v2_0 : UserControl + { + public AuxiliaryView_v2_0() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleGearView_v2_0.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleGearView_v2_0.xaml new file mode 100644 index 0000000000000000000000000000000000000000..4e56af8bde299d8efe6314453dc3bffe870a974b --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleGearView_v2_0.xaml @@ -0,0 +1,26 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.AxleGearView_v2_0" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + + <Grid> + <DockPanel> + <Label DockPanel.Dock="Top" HorizontalAlignment="Stretch" Content="{Binding Name}" Background="Aquamarine" FontSize="20" Height="40" FontWeight="DemiBold" Padding="10 5 5 5"/> + <ScrollViewer DockPanel.Dock="Top" HorizontalContentAlignment="Stretch" Padding="0 10 30 10"> + <DockPanel> + <ContentControl Content="{Binding CommonComponentViewModel}" DockPanel.Dock="Top"/> + <Separator DockPanel.Dock="Top"/> + <!--custom:LabledTextBoxAutomatic Content="{Binding Efficiency}" DockPanel.Dock="Top"/--> + <custom:LabledTextBoxAutomatic Content="{Binding Ratio}" DockPanel.Dock="Top"/> + <custom:ComboParameter Content="{Binding LineType}" DockPanel.Dock="Top"/> + <custom:ScatterPlot Height="300" MyDataTable="{Binding LossMapDT}" DockPanel.Dock="Top"></custom:ScatterPlot> + </DockPanel> + </ScrollViewer> + </DockPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleGearView_v2_0.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleGearView_v2_0.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..36296f61bbdee217ab93c168915669d33460eefc --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleGearView_v2_0.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for AxleGearView_v2_0.xaml + /// </summary> + public partial class AxleGearView_v2_0 : UserControl + { + public AxleGearView_v2_0() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleView_v2_0.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleView_v2_0.xaml new file mode 100644 index 0000000000000000000000000000000000000000..df60ce660dc8158a8be4a02e151b84954f18a16e --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleView_v2_0.xaml @@ -0,0 +1,32 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.AxleView_v2_0" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + d:DesignHeight="150" d:DesignWidth="150" > + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="1*"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition></RowDefinition> + <RowDefinition></RowDefinition> + </Grid.RowDefinitions> + + <StackPanel> + <Label Style="{StaticResource LabelStyleSubView}">Axle</Label> + <custom:ComboParameter Grid.Column="0" Grid.Row="1" Content="{Binding AxleType}"/> + </StackPanel> + + + <StackPanel Grid.Column="1"> + <custom:LabledCheckBoxAutomatic Content="{Binding TwinTyres}"></custom:LabledCheckBoxAutomatic> + <custom:LabledCheckBoxAutomatic Content="{Binding Steered}"></custom:LabledCheckBoxAutomatic> + </StackPanel> + <ContentControl Grid.Row="1" Grid.ColumnSpan="2" Margin="10" Content="{Binding TyreViewModel}"></ContentControl> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleView_v2_0.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleView_v2_0.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..0aa1db44430ffcdd0e942afc7c708c5d0d4a087c --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleView_v2_0.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for AxleView.xaml + /// </summary> + public partial class AxleView_v2_0 : UserControl + { + public AxleView_v2_0() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleWheelsView_v2_0.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleWheelsView_v2_0.xaml new file mode 100644 index 0000000000000000000000000000000000000000..32c48e3af7df86cdc5ef19b7de535597de879f8f --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleWheelsView_v2_0.xaml @@ -0,0 +1,45 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.AxleWheelsView_v2_0" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" + > + <Grid> + <DockPanel> + <Label HorizontalAlignment="Stretch" DockPanel.Dock="Top" Content="{Binding Name}" Background="Aquamarine" FontSize="20" Height="40" FontWeight="DemiBold" Padding="10 5 5 5"></Label> + <ScrollViewer DockPanel.Dock="Top" VerticalScrollBarVisibility="Auto" Padding="0 10 30 10"> + <ItemsControl ItemsSource="{Binding AxleViewModels}" Name="AxleList" AlternationCount="2"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Vertical" x:Name="AxleStackPanel"> + <ContentControl Margin="5 5 5 5" Content="{Binding .}"/> + <Rectangle HorizontalAlignment="Stretch" Height="10" x:Name="Separator"/> + </StackPanel> + <DataTemplate.Triggers> + <Trigger Property="ItemsControl.AlternationIndex" Value="0"> + <Setter TargetName="AxleStackPanel" Property="Background"> + <Setter.Value> + <SolidColorBrush Color="White" Opacity="0.9"/> + </Setter.Value> + </Setter> + </Trigger> + <Trigger Property="ItemsControl.AlternationIndex" Value="1"> + <Setter TargetName="AxleStackPanel" Property="Background"> + <Setter.Value> + <SolidColorBrush Color="White" Opacity="0.0"/> + </Setter.Value> + </Setter> + </Trigger> + </DataTemplate.Triggers> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </ScrollViewer> + </DockPanel> + + + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleWheelsView_v2_0.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleWheelsView_v2_0.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..787484d5d8872edfff8a46d148f309fe39487a26 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/AxleWheelsView_v2_0.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for AxleWheelsView_v2_0.xaml + /// </summary> + public partial class AxleWheelsView_v2_0 : UserControl + { + public AxleWheelsView_v2_0() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/CommonComponentView.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/CommonComponentView.xaml new file mode 100644 index 0000000000000000000000000000000000000000..8e4af5cbfca8d135d3001a7a943c3a0a9a1d374d --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/CommonComponentView.xaml @@ -0,0 +1,19 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.CommonComponentView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + <Grid> + <StackPanel Orientation="Vertical"> + <custom:LabledTextBoxAutomatic Content="{Binding Manufacturer}"/> + <custom:LabledTextBoxAutomatic Content="{Binding Model}"/> + <custom:DateTimePicker Date="{Binding Date}"/> + <custom:ComboParameter Content="{Binding CertificationMethod}"></custom:ComboParameter> + <custom:LabledTextBoxAutomatic Content="{Binding CertificationNumber}"></custom:LabledTextBoxAutomatic> + </StackPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/CommonComponentView.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/CommonComponentView.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..db4b49c30c1f40518e2617a2cbcf4b88c80b791a --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/CommonComponentView.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for CommonComponentViewModel.xaml + /// </summary> + public partial class CommonComponentView : UserControl + { + public CommonComponentView() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineFuelView.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineFuelView.xaml new file mode 100644 index 0000000000000000000000000000000000000000..06901d40435428a9ddcbf90629ec444e2c7ba5a4 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineFuelView.xaml @@ -0,0 +1,27 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.EngineFuelView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + xmlns:customControls="clr-namespace:VECTO3GUI2020.Views.CustomControls" + xmlns:helper="clr-namespace:VECTO3GUI2020.Helper" + xmlns:d3="clr-namespace:InteractiveDataDisplay.WPF;assembly=InteractiveDataDisplay.WPF" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" Background="Transparent"> + <Grid> + <DockPanel> + <customControls:ComboParameter Content="{Binding FuelType}" DockPanel.Dock="Top"/> + <customControls:LabledTextBoxAutomatic Content="{Binding WHTCMotorway}" DockPanel.Dock="Top"/> + <customControls:LabledTextBoxAutomatic Content="{Binding WHTCRural}" DockPanel.Dock="Top"/> + <customControls:LabledTextBoxAutomatic Content="{Binding WHTCUrban}" DockPanel.Dock="Top"/> + <customControls:LabledTextBoxAutomatic Content="{Binding ColdHotBalancingFactor}" DockPanel.Dock="Top"/> + + + <customControls:ScatterPlot HorizontalAlignment="Stretch" DockPanel.Dock="Top" Height="300" MyDataTable="{Binding FuelConsumptionMap}" SwitchAxis="False"/> + + <DataGrid ItemsSource="{Binding FuelConsumptionMap}" + Width="Auto" Margin="0" DockPanel.Dock="Top" IsReadOnly="True" Height="300" ColumnWidth="*" /> + </DockPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineFuelView.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineFuelView.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..6e77bd53108bd670433c6dd3114c03f08a258bec --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineFuelView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for EngineFuelView.xaml + /// </summary> + public partial class EngineFuelView : UserControl + { + public EngineFuelView() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineModeViewSingleFuel.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineModeViewSingleFuel.xaml new file mode 100644 index 0000000000000000000000000000000000000000..ad2ed1197126666cd1c18b75f979475b4ea5de46 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineModeViewSingleFuel.xaml @@ -0,0 +1,52 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.EngineModeViewSingleFuel" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + <Grid> + <StackPanel> + <!--custom:LabledTextBoxAutomatic Content="{Binding IdleSpeed}"/--> + <StackPanel Visibility="{Binding WasteHeatRecoveryDataMechanical, Converter={StaticResource NullToVisibilityConverter}}" IsEnabled="False"> + <Separator></Separator> + <Label Content="Wast Heat Recovery Mechanical"/> + <custom:LabledTextBoxAutomatic Content="{Binding WasteHeatRecoveryDataElectrical.UrbanCorrectionFactor}"/> + <custom:LabledTextBoxAutomatic Content="{Binding WasteHeatRecoveryDataElectrical.RuralCorrectionFactor}"/> + </StackPanel> + <!-- Visibility="{Binding WasteHeatRecoveryDataElectrical, Converter={StaticResource NullToVisibilityConverter}}" --> + <StackPanel Visibility="{Binding WasteHeatRecoveryDataElectrical, Converter={StaticResource NullToVisibilityConverter}}" > + <Separator></Separator> + <Label Content="Wast Heat Recovery Electrical"/> + <custom:LabledTextBoxAutomatic Content="{Binding WasteHeatRecoveryDataElectrical.UrbanCorrectionFactor}"/> + <custom:LabledTextBoxAutomatic Content="{Binding WasteHeatRecoveryDataElectrical.RuralCorrectionFactor}"/> + </StackPanel> + <!--Width="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type Grid}}, Mode=OneWay}"--> + + <custom:ScatterPlot Height="300" MyDataTable="{Binding FullLoadDT}"></custom:ScatterPlot> + <StackPanel> + <Separator/> + <ItemsControl ItemsSource="{Binding FuelViewModels}" Name="Fuels" AlternationCount="2"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Vertical" x:Name="FuelStackpanel"> + <ContentControl Margin="5 5 5 5" Content="{Binding .}"/> + <Rectangle HorizontalAlignment="Stretch" Height="10" x:Name="Separator"/> + </StackPanel> + <DataTemplate.Triggers> + <Trigger Property="ItemsControl.AlternationIndex" Value="0"> + <Setter Property="Background" TargetName="FuelStackpanel" Value="Transparent"/> + </Trigger> + <Trigger Property="ItemsControl.AlternationIndex" Value="1"> + <Setter Property="Background" TargetName="FuelStackpanel" Value="Transparent"/> + </Trigger> + </DataTemplate.Triggers> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + </StackPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineModeViewSingleFuel.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineModeViewSingleFuel.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..42e160cb18d19e0eb56a6baa34ff81dd9bb03dc3 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineModeViewSingleFuel.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for EngineModeViewSingleFuel.xaml + /// </summary> + public partial class EngineModeViewSingleFuel : UserControl + { + public EngineModeViewSingleFuel() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineView_v2_0.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineView_v2_0.xaml new file mode 100644 index 0000000000000000000000000000000000000000..33bb367970f6b28db0ce7cc392da81abf4075603 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineView_v2_0.xaml @@ -0,0 +1,54 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.EngineView_v2_0" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" + HorizontalAlignment="Stretch"> + <Grid> + <DockPanel> + <Label HorizontalAlignment="Stretch" DockPanel.Dock="Top" + Content="{Binding Name}" + Background="Aquamarine" + FontSize="20" Height="40" FontWeight="DemiBold" Padding="10 5 5 5"></Label> + <ScrollViewer DockPanel.Dock="Top" VerticalScrollBarVisibility="Auto" Padding="0 10 30 10"> + <StackPanel> + <StackPanel HorizontalAlignment="Stretch" DockPanel.Dock="Top"> + + <ContentControl Content="{Binding CommonComponentViewModel}"/> + <Separator/> + <custom:LabledTextBoxAutomatic Content="{Binding RatedPowerDeclared}"/> + <custom:LabledTextBoxAutomatic Content="{Binding Displacement}"/> + <custom:LabledTextBoxAutomatic Content="{Binding IdlingSpeed}"/> + <custom:LabledTextBoxAutomatic Content="{Binding RatedSpeedDeclared}"/> + <custom:LabledTextBoxAutomatic Content="{Binding MaxTorqueDeclared}"/> + <custom:ComboParameter Content="{Binding WHRType}"/> + <Separator/> + </StackPanel> + + <ItemsControl ItemsSource="{Binding EngineModeViewModels}" Name="EngineMode" AlternationCount="2"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Vertical" x:Name="EngineModeStackpanel"> + <ContentControl Margin="5 5 5 5" Content="{Binding .}"/> + <Rectangle HorizontalAlignment="Stretch" Height="10" x:Name="Separator"/> + </StackPanel> + <DataTemplate.Triggers> + <Trigger Property="ItemsControl.AlternationIndex" Value="0"> + <Setter Property="Background" TargetName="EngineModeStackpanel" Value="Transparent"/> + </Trigger> + <Trigger Property="ItemsControl.AlternationIndex" Value="1"> + <Setter Property="Background" TargetName="EngineModeStackpanel" Value="Transparent"/> + </Trigger> + </DataTemplate.Triggers> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + </ScrollViewer> + </DockPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineView_v2_0.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineView_v2_0.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..f474564cc915f1c4498d8ff7e4ed70657f256340 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/EngineView_v2_0.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for EngineView_v2_0.xaml + /// </summary> + public partial class EngineView_v2_0 : UserControl + { + public EngineView_v2_0() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/GearView_v2_0.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/GearView_v2_0.xaml new file mode 100644 index 0000000000000000000000000000000000000000..a07412f3bd56620d5f99ee263500242338f7e769 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/GearView_v2_0.xaml @@ -0,0 +1,74 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.GearView_v2_0" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" xmlns:DVC="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit" + mc:Ignorable="d" + d:DesignHeight="1600" d:DesignWidth="800"> + + <Grid> + <StackPanel> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="100"/> + <ColumnDefinition/> + <ColumnDefinition/> + </Grid.ColumnDefinitions> + + <Grid.RowDefinitions> + <RowDefinition/> + <RowDefinition/> + <RowDefinition/> + </Grid.RowDefinitions> + + <StackPanel Orientation="Horizontal" Grid.RowSpan="3" VerticalAlignment="Center"> + <Label Grid.RowSpan="3" Content="Gear:" DockPanel.Dock="Left" Style="{StaticResource LabelStyleSubView}"/> + <Label Content="{Binding Gear}" DockPanel.Dock="Left" Style="{StaticResource LabelStyleSubView}"/> + </StackPanel> + <StackPanel Orientation="Horizontal" Grid.Column="1"> + <Label Content="Torque Loss: " DockPanel.Dock="Left" Padding="0 0 0 0" /> + <Label Content="{Binding MinTorqueLossCalculated}" Padding="0 0 0 0"/> + <Label Content=" - " Padding="0 0 0 0" /> + <Label Content="{Binding MaxTorqueLossCalculated}" Padding="0 0 0 0"/> + </StackPanel> + <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1"> + <Label Content="Input Speed: " Padding="0 0 0 0"/> + <Label Content="{Binding MinInputSpeedCalculated}" Padding="0 0 0 0"/> + <Label Content=" - " Padding="0 0 0 0"/> + <Label Content="{Binding MaxInputSpeedCalculated}" Padding="0 0 0 0"/> + </StackPanel> + <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="2"> + <Label Content="Input Speed: " Padding="0 0 0 0"/> + <Label Content="{Binding MinInputSpeedCalculated}" Padding="0 0 0 0"/> + <Label Content=" - " Padding="0 0 0 0"/> + <Label Content="{Binding MaxInputSpeedCalculated}" Padding="0 0 0 0"/> + </StackPanel> + + <CheckBox Grid.Column="3" Grid.RowSpan="3" VerticalAlignment="Center" + Name="btn_toggletableview" + Content="Show Details" + IsChecked="False" HorizontalAlignment="Right" Width="87.898"/> + </Grid> + + + <DockPanel Visibility="{Binding IsChecked, + ElementName=btn_toggletableview, + Converter={StaticResource BooleanToVisibilityConverter}}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="20"> + + <custom:ScatterPlot DockPanel.Dock="Top" MyDataTable="{Binding LossMap}" Height="300"></custom:ScatterPlot> + <DataGrid ItemsSource="{Binding LossMapDataView}" + DockPanel.Dock="Top" + Width="Auto" + VerticalScrollBarVisibility="Visible" + IsReadOnly="True" + Height="200" + HorizontalContentAlignment="Stretch" ColumnWidth="*"> + </DataGrid> + </DockPanel> + + </StackPanel> + + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/GearView_v2_0.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/GearView_v2_0.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..89109a2b053470f355fc520f7d47f5ce4e939d2d --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/GearView_v2_0.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for GearView_v2_0.xaml + /// </summary> + public partial class GearView_v2_0 : UserControl + { + public GearView_v2_0() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/GearboxView_v2_0.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/GearboxView_v2_0.xaml new file mode 100644 index 0000000000000000000000000000000000000000..3bf8d49b23e34de15683bd9cfb0f8e1c030d54d8 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/GearboxView_v2_0.xaml @@ -0,0 +1,59 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.GearboxView_v2_0" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls"> + + <Grid> + <DockPanel> + <Label HorizontalAlignment="Stretch" + Content="{Binding Name}" + Background="Aquamarine" + FontSize="20" + Height="40" + FontWeight="DemiBold" + Padding="10 5 5 5" + DockPanel.Dock="Top"/> + <ScrollViewer DockPanel.Dock="Top" VerticalScrollBarVisibility="Visible" Padding="0 10 30 10"> + <StackPanel DockPanel.Dock="Top"> + <ContentControl Content="{Binding CommonComponentViewModel}"/> + <Separator/> + <!--custom:LabledTextBoxAutomatic Content="{Binding AxlegearRatio}"/--> + <!--custom:LabledCheckBoxAutomatic Content="{Binding DifferentialIncluded}"/--> + <custom:ComboParameter Content="{Binding Type}"/> + <Separator/> + <ItemsControl ItemsSource="{Binding GearViewModels}" Name="GearsList" AlternationCount="2"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Vertical" x:Name="GearStackPanel"> + <ContentControl Margin="5 5 5 5" Content="{Binding .}"/> + <Rectangle HorizontalAlignment="Stretch" Height="10" x:Name="Separator"/> + </StackPanel> + <DataTemplate.Triggers> + <Trigger Property="ItemsControl.AlternationIndex" Value="0"> + <Setter TargetName="GearStackPanel" Property="Background"> + <Setter.Value> + <SolidColorBrush Color="White" Opacity="0.7"/> + </Setter.Value> + </Setter> + </Trigger> + <Trigger Property="ItemsControl.AlternationIndex" Value="1"> + <Setter TargetName="GearStackPanel" Property="Background"> + <Setter.Value> + <SolidColorBrush Color="White" Opacity="0.1"/> + </Setter.Value> + </Setter> + </Trigger> + </DataTemplate.Triggers> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + </ScrollViewer> + </DockPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/GearboxView_v2_0.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/GearboxView_v2_0.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..b1513406cc7c7bb91bf9888957119820d76ff912 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/GearboxView_v2_0.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaktionslogik für GearboxView_v2_0.xaml + /// </summary> + public partial class GearboxView_v2_0 : UserControl + { + public GearboxView_v2_0() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/PTOView_v2_0.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/PTOView_v2_0.xaml new file mode 100644 index 0000000000000000000000000000000000000000..51c6a0ff3f9197fe1215101e2c392ff6c0e3812f --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/PTOView_v2_0.xaml @@ -0,0 +1,22 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.PTOView_v2_0" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + <Grid> + <StackPanel> + <Label Content="Power-take-off" Style="{StaticResource LabelStyleSubView}"></Label> + <custom:LabledTextBoxAutomatic Content="{Binding PTOTransmissionType}"/> + <DataGrid ItemsSource="{Binding PTOCycleDataView}" + Visibility="{Binding PTOCycleDataView, + Converter={StaticResource NullToVisibilityConverter}}" + IsReadOnly="True" /> + <DataGrid ItemsSource="{Binding PTOLossMapDataView}" + Visibility="{Binding PTOLossMapDataView, + Converter={StaticResource NullToVisibilityConverter}}" IsReadOnly="True"/> + </StackPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/PTOView_v2_0.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/PTOView_v2_0.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..6977b9b98228c17873bcf8d4012c0bef656b325a --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/PTOView_v2_0.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for PTOView_v2_0.xaml + /// </summary> + public partial class PTOView_v2_0 : UserControl + { + public PTOView_v2_0() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/RetarderView_v2_0.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/RetarderView_v2_0.xaml new file mode 100644 index 0000000000000000000000000000000000000000..28d8a183dc79982a8608b085473ed0e82ed5fbad --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/RetarderView_v2_0.xaml @@ -0,0 +1,33 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.RetarderView_v2_0" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:dvc="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + mc:Ignorable="d" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" + d:DesignHeight="450" d:DesignWidth="800" + > + <Grid> + <StackPanel> + <Label DockPanel.Dock="Top" HorizontalAlignment="Stretch" Content="{Binding Name}" Background="Aquamarine" FontSize="20" Height="40" FontWeight="DemiBold" Padding="10 5 5 5"></Label> + <ScrollViewer DockPanel.Dock="Top" VerticalScrollBarVisibility="Visible" CanContentScroll="True" Padding="0 10 30 10"> + <DockPanel> + <ContentControl DockPanel.Dock="Top" Content="{Binding CommonComponentViewModel}"/> + <custom:LabledTextBoxAutomatic DockPanel.Dock="Top" Content="{Binding Ratio}"></custom:LabledTextBoxAutomatic> + <custom:ComboParameter IsEnabled="False" DockPanel.Dock="Top" Content="{Binding Type }"></custom:ComboParameter> + <custom:ScatterPlot Content="{Binding LossMap}"></custom:ScatterPlot> + <DataGrid ItemsSource="{Binding LossMapDataView}" + IsReadOnly="True" /> + </DockPanel> + </ScrollViewer> + + + + <!-- https://docs.microsoft.com/en-us/answers/questions/10086/draw-chart-with-systemwindowscontrolsdatavisualiza.html --> + + + </StackPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/RetarderView_v2_0.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/RetarderView_v2_0.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..2640b2a2c53b9bdd7b4d2b4588ada11f77d177cb --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/RetarderView_v2_0.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for RetarderView_v2_0.xaml + /// </summary> + public partial class RetarderView_v2_0 : UserControl + { + public RetarderView_v2_0() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/TyreView_v2_0.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/TyreView_v2_0.xaml new file mode 100644 index 0000000000000000000000000000000000000000..fa9ea307013fc0945a2a386f471d3a9b3ba21114 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/TyreView_v2_0.xaml @@ -0,0 +1,43 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.TyreView_v2_0" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + <Grid> + + <Grid.ColumnDefinitions> + <ColumnDefinition Width="1*"></ColumnDefinition> + <ColumnDefinition Width="1*"></ColumnDefinition> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition></RowDefinition> + <RowDefinition></RowDefinition> + </Grid.RowDefinitions> + <StackPanel Grid.ColumnSpan="2"> + <Separator></Separator> + <Label Style="{StaticResource LabelStyleSubView}">Tyre</Label> + </StackPanel> + + + <StackPanel Grid.Row="1"> + <ContentControl Content="{Binding CommonComponentViewModel}"/> + + </StackPanel> + <StackPanel Grid.Row="1" Grid.Column="1"> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + <Label Content="Dimension "></Label> + <ComboBox Grid.Column="1" Margin="2 2 2 2" ItemsSource="{Binding AllowedDimensions}" SelectedItem="{Binding Dimension, Mode=TwoWay}"></ComboBox> + </Grid> + <custom:LabledTextBoxAutomatic Content="{Binding RollResistanceCoefficient}" UserUnit="N/N"/> + </StackPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/TyreView_v2_0.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/TyreView_v2_0.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..8b3206bea5338835d0c30b8aac072e7676f7303d --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/TyreView_v2_0.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for TyreView_v2_0.xaml + /// </summary> + public partial class TyreView_v2_0 : UserControl + { + public TyreView_v2_0() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/TyreView_v2_3.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/TyreView_v2_3.xaml new file mode 100644 index 0000000000000000000000000000000000000000..6327bc6f7e017f118828fdeebd0111059baadfaf --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/TyreView_v2_3.xaml @@ -0,0 +1,38 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.Components.TyreView_v2_3" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle.Components" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="1*"></ColumnDefinition> + <ColumnDefinition Width="1*"></ColumnDefinition> + </Grid.ColumnDefinitions> + <StackPanel> + <ContentControl Content="{Binding Path=base}"/> + <custom:LabledTextBoxAutomatic Content="{Binding TyreClass}"/> + <custom:LabledTextBoxAutomatic Content="{Binding FuelEfficiencyClass}"/> + + + <!--custom:LabledTextBoxAutomatic Content="{Binding Dimension}"/--> + + + </StackPanel> + <StackPanel Grid.Column="1"> + <Grid Grid.Column="1"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + <Label Content="Dimension "></Label> + <ComboBox Grid.Column="1" Margin="2 2 2 2" ItemsSource="{Binding AllowedDimensions}" SelectedItem="{Binding Dimension, Mode=TwoWay}"></ComboBox> + </Grid> + <custom:LabledTextBoxAutomatic Content="{Binding RRC}" UserUnit="N/N" /> + </StackPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/TyreView_v2_3.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/TyreView_v2_3.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..eafe2a25be8728b00e80d075ee6c6994fe884644 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/Components/TyreView_v2_3.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle.Components +{ + /// <summary> + /// Interaction logic for TyreView_v2_0.xaml + /// </summary> + public partial class TyreView_v2_3 : UserControl + { + public TyreView_v2_3() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/VehicleView_v2_0.xaml b/VECTO3GUI2020/Views/JobEditViews/Vehicle/VehicleView_v2_0.xaml new file mode 100644 index 0000000000000000000000000000000000000000..50f29987e2ea53401d0b0707854567a41bcf2cc1 --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/VehicleView_v2_0.xaml @@ -0,0 +1,46 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobEditViews.Vehicle.VehicleView_v2_0" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.JobEditViews.Vehicle" + xmlns:System="clr-namespace:System;assembly=mscorlib" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + + <Grid> + <DockPanel> + <Label DockPanel.Dock="Top" HorizontalAlignment="Stretch" Content="{Binding Name}" Background="Aquamarine" FontSize="20" Height="40" FontWeight="DemiBold" Padding="10 5 5 5"/> + <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" DockPanel.Dock="Top" Padding="0 10 30 10"> + <DockPanel> + + + <ContentControl Content="{Binding CommonComponentViewModel}" DockPanel.Dock="Top"/> + <Separator DockPanel.Dock="Top"></Separator> + <StackPanel DockPanel.Dock="Top"> + <custom:LabledTextBoxAutomatic Content="{Binding ManufacturerAddress}"/> + <custom:LabledTextBoxAutomatic Content="{Binding VIN}" /> + <custom:ComboParameter Content="{Binding LegislativeClass}" /> + <custom:ComboParameter Content="{Binding VehicleCategory}" /> + <custom:ComboParameter Content="{Binding AxleConfiguration}" /> + <custom:LabledTextBoxAutomatic Content="{Binding CurbMassChassis}"/> + <custom:LabledTextBoxAutomatic Content="{Binding GrossVehicleMassRating}"/> + <custom:LabledTextBoxAutomatic Content="{Binding EngineIdleSpeed}" /> + <custom:ComboParameter Content="{Binding AngledriveType}"></custom:ComboParameter> + <custom:ComboParameter Content="{Binding RetarderType}"></custom:ComboParameter> + <custom:LabledTextBoxAutomatic Content="{Binding RetarderRatio}"></custom:LabledTextBoxAutomatic> + <Separator/> + </StackPanel> + + <!--ContentControl Content="{Binding ADASViewModel}" DockPanel.Dock="Top"/> + <Separator DockPanel.Dock="Top"/> + <ContentControl Content="{Binding PTOViewModel}" DockPanel.Dock="Top"/> + <Separator DockPanel.Dock="Top"/--> + <!--Label Content="Torque Limits" DockPanel.Dock="Top" Style="{StaticResource LabelStyleSubView}"/> + <DataGrid ItemsSource="{Binding TorqueLimits}" DockPanel.Dock="Top" IsReadOnly="True" CanUserAddRows="False" CanUserResizeColumns="False" Margin="10 10 20 10" ColumnWidth="*" HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch"/ --> + </DockPanel> + </ScrollViewer> + </DockPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JobEditViews/Vehicle/VehicleView_v2_0.xaml.cs b/VECTO3GUI2020/Views/JobEditViews/Vehicle/VehicleView_v2_0.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..3cbcfeb256931476b6a9ab01731ecd763396a8fa --- /dev/null +++ b/VECTO3GUI2020/Views/JobEditViews/Vehicle/VehicleView_v2_0.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.JobEditViews.Vehicle +{ + /// <summary> + /// Interaction logic for VehicleBaseView_v2_0.xaml + /// </summary> + public partial class VehicleView_v2_0 : UserControl + { + public VehicleView_v2_0() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/JoblistView.xaml b/VECTO3GUI2020/Views/JoblistView.xaml new file mode 100644 index 0000000000000000000000000000000000000000..eb9658e8d7527529e0a4bec394444a9a0b72e551 --- /dev/null +++ b/VECTO3GUI2020/Views/JoblistView.xaml @@ -0,0 +1,76 @@ +<UserControl x:Class="VECTO3GUI2020.Views.JobListView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views" + xmlns:converter="clr-namespace:VECTO3GUI2020.Helper.Converter" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + + <Grid Background="Azure"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="1*"/> + <ColumnDefinition Name="MiddleColumn" Width="6*"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + + + <Grid Grid.Column="0"> + <StackPanel> + <Button Template="{DynamicResource MainViewButtonStyle}">Simulieren</Button> + <Button Command="{Binding moveJobUp}" Template="{DynamicResource MainViewButtonStyle}" + CommandParameter="{Binding ElementName=JobDataGrid, Path=SelectedItem}">Up</Button> + <Button Command="{Binding moveJobDown}" Template="{DynamicResource MainViewButtonStyle}" + CommandParameter="{Binding ElementName=JobDataGrid, Path=SelectedItem}">Down</Button> + </StackPanel> + </Grid> + <Grid Grid.Column="1"> + <StackPanel Margin="2 0 2 0"> + <DataGrid ItemsSource="{Binding Jobs}" + Name="JobDataGrid" + HorizontalAlignment="Stretch" + IsReadOnly="True" + CanUserReorderColumns="False" + AutoGenerateColumns="False" + SelectionMode="Single" + BorderThickness="0" + GridLinesVisibility="Horizontal" + HorizontalScrollBarVisibility="Disabled" RowHeaderWidth="0" + > + <DataGrid.Columns> + <DataGridTextColumn Header="Name" Binding="{Binding DocumentName}" Width="1*"/> + <DataGridTextColumn Header="Type" Binding="{Binding DocumentType}" Width="1*"/> + </DataGrid.Columns> + + <DataGrid.RowDetailsTemplate> + <DataTemplate> + <StackPanel Orientation="Vertical"> + <Label Content="Filename"/> + <TextBlock Text="{Binding DataSource.SourceFile}" TextWrapping="Wrap" Margin="10" /> + </StackPanel> + + </DataTemplate> + </DataGrid.RowDetailsTemplate> + <DataGrid.InputBindings> + <MouseBinding + MouseAction="LeftDoubleClick" + Command="{Binding EditJob}" + CommandParameter="{Binding ElementName=JobDataGrid, Path=SelectedItem}"></MouseBinding> + </DataGrid.InputBindings> + </DataGrid> + <Label Content="Loading . . ." Visibility="{Binding IsLoading, Converter={StaticResource BooleanToVisibilityConverter}}"/> + </StackPanel> + </Grid> + <Grid Grid.Column="2"> + <StackPanel> + <Button Command="{Binding AddJob}" Template="{DynamicResource MainViewButtonStyle}">OpenFile</Button> + <Button Command="{Binding EditJob}" Template="{DynamicResource MainViewButtonStyle}" + CommandParameter="{Binding ElementName=JobDataGrid, Path=SelectedItem}" Style="{DynamicResource MainViewButton}">EditFile</Button> + <Button Command="{Binding NewManufacturingStageFile}" Template="{DynamicResource MainViewButtonStyle}">New Multistage File</Button> + <Button Command="{Binding RemoveJob}" Template="{DynamicResource MainViewButtonStyle}" + CommandParameter="{Binding ElementName=JobDataGrid, Path=SelectedItem}">DeleteFile</Button> + </StackPanel> + </Grid> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/JoblistView.xaml.cs b/VECTO3GUI2020/Views/JoblistView.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..0016ff85ba47f5089869cdf6ce8f3e868e028a38 --- /dev/null +++ b/VECTO3GUI2020/Views/JoblistView.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views +{ + /// <summary> + /// Interaction logic for JobListView.xaml + /// </summary> + public partial class JobListView : UserControl + { + public JobListView() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/MessageView.xaml b/VECTO3GUI2020/Views/MessageView.xaml new file mode 100644 index 0000000000000000000000000000000000000000..5544353b64c5ba12ab0cb58266bc42bf3bc07126 --- /dev/null +++ b/VECTO3GUI2020/Views/MessageView.xaml @@ -0,0 +1,12 @@ +<UserControl x:Class="VECTO3GUI2020.Views.MessageView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + <Grid Background="Aqua"> + + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/MessageView.xaml.cs b/VECTO3GUI2020/Views/MessageView.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..af1134c7da717fce2fa98387dda965cd945512fb --- /dev/null +++ b/VECTO3GUI2020/Views/MessageView.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views +{ + /// <summary> + /// Interaction logic for MessageView.xaml + /// </summary> + public partial class MessageView : UserControl + { + public MessageView() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/Multistage/CustomControls/FilePicker.xaml b/VECTO3GUI2020/Views/Multistage/CustomControls/FilePicker.xaml new file mode 100644 index 0000000000000000000000000000000000000000..3678da4594f7616e639489fef7dc336aceccb3f6 --- /dev/null +++ b/VECTO3GUI2020/Views/Multistage/CustomControls/FilePicker.xaml @@ -0,0 +1,23 @@ +<UserControl x:Class="VECTO3GUI2020.Views.Multistage.CustomControls.FilePicker" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.Multistage.CustomControls" + mc:Ignorable="d" + d:DesignHeight="30" d:DesignWidth="800" Name="filepickercustomcontrol"> + <Grid> + <Grid Margin="4" DockPanel.Dock="Top"> + <Grid.ColumnDefinitions> + <ColumnDefinition></ColumnDefinition> + <ColumnDefinition Width="30px"></ColumnDefinition> + </Grid.ColumnDefinitions> + <TextBox VerticalContentAlignment="Center" Height="Auto" Padding="4" Margin = "0 0 0 0" IsReadOnly="True" + Text="{Binding Text, ElementName=filepickercustomcontrol}" HorizontalAlignment="Stretch"/> + <Button Padding="4" Margin="4 0 0 0" Grid.Column="1" Command="{Binding Command, ElementName=filepickercustomcontrol}"> + <Image Source="../../../Resources/folderpicker.ico"> + </Image> + </Button> + </Grid> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/Multistage/CustomControls/FilePicker.xaml.cs b/VECTO3GUI2020/Views/Multistage/CustomControls/FilePicker.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..8fe20e035718c3aed625d9204a7007086d28dae3 --- /dev/null +++ b/VECTO3GUI2020/Views/Multistage/CustomControls/FilePicker.xaml.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace VECTO3GUI2020.Views.Multistage.CustomControls +{ + /// <summary> + /// Interaction logic for FilePicker.xaml + /// </summary> + public partial class FilePicker : UserControl + { + + public static readonly DependencyProperty CommandProperty = DependencyProperty.Register( + "Command", typeof(ICommand), typeof(FilePicker), new PropertyMetadata(default(ICommand))); + + public ICommand Command + { + get { return (ICommand)GetValue(CommandProperty); } + set { SetValue(CommandProperty, value); } + } + + public static readonly DependencyProperty TextProperty = DependencyProperty.Register( + "Text", typeof(string), typeof(FilePicker), new PropertyMetadata(default(string))); + + public string Text + { + get { return (string)GetValue(TextProperty); } + set { SetValue(TextProperty, value); } + } + + public FilePicker() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml b/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml new file mode 100644 index 0000000000000000000000000000000000000000..c8cde83e5ef41f5112ed452cd94be5bdc27b6195 --- /dev/null +++ b/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml @@ -0,0 +1,86 @@ +<UserControl x:Class="VECTO3GUI2020.Views.Multistage.CustomControls.MultiStageParameter" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.Multistage.CustomControls" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" Name="MultistageParameterControl"> + <Grid> + + <!-- _____________________________________________ Text mode ___________________________________________________________________--> + <Grid Visibility="{Binding ElementName=MultistageParameterControl, + Path=ComboBoxMode, + Converter={StaticResource InvertedBoolToVisibilityConverter}}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="4*" SharedSizeGroup="W"/> + <ColumnDefinition Width="1*" SharedSizeGroup="N"/> + <ColumnDefinition Width="4*" SharedSizeGroup="W"/> + <ColumnDefinition Width="4*" SharedSizeGroup="W"/> + <ColumnDefinition Width="1*" SharedSizeGroup="N"/> + </Grid.ColumnDefinitions> + + <Label Content="{Binding LabelText, ElementName=MultistageParameterControl}"></Label> + <CheckBox Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Name="CheckBox" + Visibility="{Binding Optional, + ElementName=MultistageParameterControl, + Converter={StaticResource BooleanToVisibilityConverter}}" + IsChecked="{Binding EditingEnabled, + ElementName=MultistageParameterControl, + Mode=TwoWay}"/> + + <TextBox Grid.Column="2" VerticalAlignment="Center" Margin="2 0 2 0" IsReadOnly="True" + Visibility="{Binding Optional, + ElementName=MultistageParameterControl, Converter={StaticResource BooleanToVisibilityConverter}, UpdateSourceTrigger=PropertyChanged}"/> + + <TextBox Grid.Column="3" Name ="TextBoxContent" VerticalAlignment="Center" Margin="2 0 2 0" + Text="{Binding Content, + ElementName=MultistageParameterControl }" + IsReadOnly="{Binding ElementName=MultistageParameterControl, + Path=EditingEnabled, Converter={StaticResource InvertBoolConverter}}"/> + + <Label Grid.Column="4" x:Name="AutoUnitLabel" + Content="{Binding DummyContent, ElementName=MultistageParameterControl, Converter={StaticResource SIToUnitStringConverter}}"> + </Label> + </Grid> + <!-- ______________________________________________ Comboboxmode ___________________________________________________--> + <Grid Visibility="{Binding ElementName=MultistageParameterControl, + Path=ComboBoxMode, + Converter={StaticResource BooleanToVisibilityConverter}}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="4*" SharedSizeGroup="W"/> + <ColumnDefinition Width="1*" SharedSizeGroup="N"/> + <ColumnDefinition Width="4*" SharedSizeGroup="W"/> + <ColumnDefinition Width="4*" SharedSizeGroup="W"/> + <ColumnDefinition Width="1*" SharedSizeGroup="N"/> + </Grid.ColumnDefinitions> + + <Label Content="{Binding LabelText, ElementName=MultistageParameterControl}"></Label> + <CheckBox Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Name="CheckBoxCombo" + Visibility="{Binding Optional, + ElementName=MultistageParameterControl, + Converter={StaticResource BooleanToVisibilityConverter}}" + IsChecked="{Binding EditingEnabled, + ElementName=MultistageParameterControl, + Mode=TwoWay}"/> + + <ComboBox Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="2 0 2 0" Visibility="{Binding Optional, + ElementName=MultistageParameterControl, + Converter={StaticResource BooleanToVisibilityConverter}}" IsHitTestVisible="False" Focusable="False" IsEditable="False"/> + + <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"/> + + + + <Label Grid.Column="4" + Content="{Binding DummyContent, ElementName=MultistageParameterControl, Converter={StaticResource SIToUnitStringConverter}}"> + </Label> + </Grid> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml.cs b/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..9a07e812c116087fbb500f1bfa6b0acfeb32f9cc --- /dev/null +++ b/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml.cs @@ -0,0 +1,234 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Castle.Components.DictionaryAdapter.Xml; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCommon.Utils; +using VECTO3GUI2020.Properties; +using VECTO3GUI2020.Views.CustomControls; + +namespace VECTO3GUI2020.Views.Multistage.CustomControls +{ + /// <summary> + /// Interaction logic for MultiStageParameter.xaml + /// </summary> + public partial class MultiStageParameter : UserControl + { + #region Dependency Properties + + + public static readonly DependencyProperty PreviousContentProperty = DependencyProperty.Register( + "PreviousContent", typeof(object), typeof(MultiStageParameter), new PropertyMetadata(default(object))); + + public object PreviousContent + { + get { return (object)GetValue(PreviousContentProperty); } + set { SetValue(PreviousContentProperty, value); } + } + + + public static readonly DependencyProperty OptionalProperty = DependencyProperty.Register( + "Optional", typeof(bool), typeof(MultiStageParameter), new PropertyMetadata(true, new PropertyChangedCallback(OptionalChanged))); + + private static void OptionalChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + MultiStageParameter multiStageParameter = (MultiStageParameter)d; + if ((bool)e.NewValue == false) { + multiStageParameter.EditingEnabled = true; + } + } + + public bool Optional + { + get { return (bool)GetValue(OptionalProperty); } + set { SetValue(OptionalProperty, value); } + } + + public static readonly DependencyProperty ComboBoxModeProperty = DependencyProperty.Register( + "ComboBoxMode", typeof(bool), typeof(MultiStageParameter), new PropertyMetadata(false)); + + public bool ComboBoxMode + { + get { return (bool)GetValue(ComboBoxModeProperty); } + set { SetValue(ComboBoxModeProperty, value); } + } + + + + + public static readonly DependencyProperty LabelTextProperty = DependencyProperty.Register( + "LabelText", typeof(string), typeof(MultiStageParameter), new PropertyMetadata(null)); + + public string LabelText + { + get { return (string)GetValue(LabelTextProperty); } + set { SetValue(LabelTextProperty, value); } + } + + public static readonly DependencyProperty EditingEnabledProperty = DependencyProperty.Register( + "EditingEnabled", typeof(bool), typeof(MultiStageParameter), new FrameworkPropertyMetadata( + false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(EditingEnabledChanged))); + + + + public bool EditingEnabled + { + get { return (bool)GetValue(EditingEnabledProperty);} + set + { + SetValue(EditingEnabledProperty, value); + } + } + + public static readonly DependencyProperty DummyContentProperty = DependencyProperty.Register( + "DummyContent", typeof(object), typeof(MultiStageParameter), new PropertyMetadata(default(object))); + + public object DummyContent + { + get { return (object)GetValue(DummyContentProperty); } + set { SetValue(DummyContentProperty, value); } + } + + + public static readonly DependencyProperty HideCheckBoxProperty = DependencyProperty.Register( + "HideCheckBox", typeof(bool), typeof(MultiStageParameter), new PropertyMetadata(default(bool))); + + public bool HideCheckBox + { + get { return (bool)GetValue(HideCheckBoxProperty); } + set { SetValue(HideCheckBoxProperty, value); } + } + + + // Using a DependencyProperty as the backing store for MyObject. This enables animation, styling, binding, etc... + public new static readonly DependencyProperty ContentProperty = + DependencyProperty.Register("Content", + typeof(object), + typeof(MultiStageParameter), + new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(ContentChanged))); //TODO Default value null breaks it for SIs default value "" for strings + + public new object Content + { + get { return (object)GetValue(ContentProperty); } + set + { + SetCurrentValue(ContentProperty, value); + } + } + + public static readonly DependencyProperty ListItemsProperty = DependencyProperty.Register( + "ListItems", typeof(List<object>), typeof(MultiStageParameter), new PropertyMetadata(default(List<object>))); + + public List<object> ListItems + { + get { return (List<object>)GetValue(ListItemsProperty); } + set { SetValue(ListItemsProperty, value); } + } + +#endregion + + private static void ContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var multiStageParameter = (CustomControls.MultiStageParameter) d; + + + multiStageParameter.DummyContent = multiStageParameter.CreateDummyContent(e, multiStageParameter); + + + multiStageParameter.SetListItems(); + + + if (multiStageParameter.LabelText != null) { + return; + } + multiStageParameter.LabelText = multiStageParameter.GetLabelByPropertyName( + MultiStageParameter.ContentProperty, + Strings.ResourceManager); + } + + private void SetListItems() + { + if (!ComboBoxMode) + return; + + if(DummyContent is Enum en) { + var enType = en.GetType(); + + ListItems = Enum.GetValues(enType).Cast<object>().ToList(); + } + } + + private object CreateDummyContent(DependencyPropertyChangedEventArgs e, UserControl userControl) + { + dynamic type = userControl.GetPropertyType(e.Property); + + var baseType = type.BaseType; + try { + //Create SI Dummy + + if (baseType.BaseType == typeof(SI)) { + var createMethod = baseType.GetMethod("Create"); + var dummyContent = createMethod?.Invoke(null, new object[] { (new double()) }); + return dummyContent; + } else{ + + var bindingProperty = userControl.GetBindingExpression(e.Property); + var dataItemType = bindingProperty?.DataItem.GetType(); + var sourcePropertyType = + dataItemType?.GetProperty(bindingProperty?.ResolvedSourcePropertyName)?.PropertyType; + + var underlyingType = Nullable.GetUnderlyingType(type); + + var dummyEnum = Enum.Parse(underlyingType, underlyingType.GetEnumNames()[0]); + + return dummyEnum; + } + + } catch (Exception ex) { + Debug.WriteLine(ex.Message); + return null; + } + + return null; + } + + private static void EditingEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + MultiStageParameter multiStageParameter = (MultiStageParameter)d; + if ((bool)e.NewValue == false) + { + multiStageParameter.Content = null; + } else { + + } + } + + + + + + + + public MultiStageParameter() + { + InitializeComponent(); + + //LabelText = this.GetLabelByPropertyName(ContentProperty, Strings.ResourceManager); + } + } +} diff --git a/VECTO3GUI2020/Views/Multistage/ManufacturingStageView.xaml b/VECTO3GUI2020/Views/Multistage/ManufacturingStageView.xaml new file mode 100644 index 0000000000000000000000000000000000000000..0dacf726638c9c5972a07768e45869e9e31d2c95 --- /dev/null +++ b/VECTO3GUI2020/Views/Multistage/ManufacturingStageView.xaml @@ -0,0 +1,29 @@ +<UserControl x:Class="VECTO3GUI2020.Views.Multistage.ManufacturingStageView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.Multistage" + xmlns:implementation="clr-namespace:VECTO3GUI2020.ViewModel.MultiStage.Implementation" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800"> + <Grid MaxWidth="900"> + <DockPanel> + <Grid Margin="4" DockPanel.Dock="Top"> + <Grid.ColumnDefinitions> + <ColumnDefinition></ColumnDefinition> + <ColumnDefinition Width="30px"></ColumnDefinition> + </Grid.ColumnDefinitions> + </Grid> + <DockPanel Grid.Row="1" LastChildFill="False" DockPanel.Dock="Top" > + <Button DockPanel.Dock="Left" Style="{DynamicResource MultiStageButtonStyle1}" + Margin="4" Command="{Binding SwitchComponentViewCommand}" CommandParameter="Vehicle">Vehicle</Button> + <Button DockPanel.Dock="Left" Style="{DynamicResource MultiStageButtonStyle1}" + Margin="4" Command="{Binding SwitchComponentViewCommand}" CommandParameter="Airdrag">Airdrag</Button> + <Button DockPanel.Dock="Left" Style="{DynamicResource MultiStageButtonStyle1}" + Margin="4" Command="{Binding SwitchComponentViewCommand}" CommandParameter="Auxiliaries">Auxiliaries</Button> + </DockPanel> + <ContentControl Content="{Binding CurrentView}"></ContentControl> + </DockPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/Multistage/ManufacturingStageView.xaml.cs b/VECTO3GUI2020/Views/Multistage/ManufacturingStageView.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..5a5bb7da44d3652c16cbe90d0a0339cd6a5d50a1 --- /dev/null +++ b/VECTO3GUI2020/Views/Multistage/ManufacturingStageView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace VECTO3GUI2020.Views.Multistage +{ + /// <summary> + /// Interaction logic for InterimStageView.xaml + /// </summary> + public partial class ManufacturingStageView : UserControl + { + public ManufacturingStageView() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/Multistage/MultiStageView.xaml b/VECTO3GUI2020/Views/Multistage/MultiStageView.xaml new file mode 100644 index 0000000000000000000000000000000000000000..08e47f34a063126c23b5e6eaf30f17132c5cdd50 --- /dev/null +++ b/VECTO3GUI2020/Views/Multistage/MultiStageView.xaml @@ -0,0 +1,13 @@ +<UserControl x:Class="VECTO3GUI2020.Views.Multistage.MultiStageView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.Multistage" + xmlns:implementation="clr-namespace:VECTO3GUI2020.ViewModel.MultiStage.Implementation" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance implementation:MultiStageJobViewModel_v0_1}"> + <Grid> + <ContentControl Content="{Binding ManufacturingStageViewModel}"/> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/Multistage/MultiStageView.xaml.cs b/VECTO3GUI2020/Views/Multistage/MultiStageView.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..a41d99d5898e04a3128159a2f9285e517e753587 --- /dev/null +++ b/VECTO3GUI2020/Views/Multistage/MultiStageView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace VECTO3GUI2020.Views.Multistage +{ + /// <summary> + /// Interaction logic for MultiStageView.xaml + /// </summary> + public partial class MultiStageView : UserControl + { + public MultiStageView() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/Multistage/MultistageAirDragView.xaml b/VECTO3GUI2020/Views/Multistage/MultistageAirDragView.xaml new file mode 100644 index 0000000000000000000000000000000000000000..61ba5e753f8159e6f3c0cdea009de6d4e6c65ace --- /dev/null +++ b/VECTO3GUI2020/Views/Multistage/MultistageAirDragView.xaml @@ -0,0 +1,21 @@ +<UserControl x:Class="VECTO3GUI2020.Views.Multistage.MultistageAirDragView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.Multistage" + xmlns:customControls="clr-namespace:VECTO3GUI2020.Views.Multistage.CustomControls" + xmlns:customControls1="clr-namespace:VECTO3GUI2020.Views.CustomControls" + xmlns:impl="clr-namespace:VECTO3GUI2020.ViewModel.MultiStage.Implementation" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" BorderBrush="Aquamarine" BorderThickness="2" Margin="4" + d:DataContext="{d:DesignInstance impl:MultistageAirdragViewModel}"> + <Grid> + <StackPanel> + <Label Content="AIRDRAG" HorizontalAlignment="Stretch" Background="Aquamarine"/> + <customControls1:LabledCheckBoxAutomatic Content="{Binding AirdragModified}"></customControls1:LabledCheckBoxAutomatic> + <customControls:FilePicker Height="30px" VerticalAlignment="Top" Text="Test" Command="{Binding LoadAirdragFileCommand}"></customControls:FilePicker> + </StackPanel> + + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/Multistage/MultistageAirDragView.xaml.cs b/VECTO3GUI2020/Views/Multistage/MultistageAirDragView.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..ed0d09985fd82b73f7c8b6ce4048321064ff1f10 --- /dev/null +++ b/VECTO3GUI2020/Views/Multistage/MultistageAirDragView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace VECTO3GUI2020.Views.Multistage +{ + /// <summary> + /// Interaction logic for MultistageAirDragView.xaml + /// </summary> + public partial class MultistageAirDragView : UserControl + { + public MultistageAirDragView() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/Multistage/NewMultistageFileView.xaml b/VECTO3GUI2020/Views/Multistage/NewMultistageFileView.xaml new file mode 100644 index 0000000000000000000000000000000000000000..ac0ac999b7bc8da565663053300b00d0d649d96d --- /dev/null +++ b/VECTO3GUI2020/Views/Multistage/NewMultistageFileView.xaml @@ -0,0 +1,29 @@ +<UserControl x:Class="VECTO3GUI2020.Views.Multistage.NewMultistageFileView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.Multistage" + xmlns:implementation="clr-namespace:VECTO3GUI2020.ViewModel.MultiStage.Implementation" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance implementation:NewMultiStageJobViewModel }"> + <Grid> + <Grid MaxWidth="900"> + <DockPanel> + <Grid Margin="4" DockPanel.Dock="Top"> + <Grid.ColumnDefinitions> + <ColumnDefinition></ColumnDefinition> + <ColumnDefinition Width="30px"></ColumnDefinition> + </Grid.ColumnDefinitions> + <TextBox VerticalContentAlignment="Center" Height="Auto" Padding="4" Margin = "0 0 0 0" IsReadOnly="True" + Text="{Binding VifPath}" HorizontalAlignment="Stretch"/> + <Button Padding="4" Margin="4 0 0 0" Grid.Column="1" Command="{Binding AddVifFile}"> + <Image Source="../../Resources/folderpicker.ico"> + </Image> + </Button> + </Grid> + <ContentControl Grid.Row="2" Content="{Binding MultiStageJobViewModel}"/> + </DockPanel> + </Grid> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/Multistage/NewMultistageFileView.xaml.cs b/VECTO3GUI2020/Views/Multistage/NewMultistageFileView.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..2f1b271281312e5cd208da0bfdd26784a991444c --- /dev/null +++ b/VECTO3GUI2020/Views/Multistage/NewMultistageFileView.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace VECTO3GUI2020.Views.Multistage +{ + /// <summary> + /// Interaction logic for NewMultistageFileView.xaml + /// </summary> + public partial class NewMultistageFileView : UserControl + { + public NewMultistageFileView() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/Multistage/VehicleView_v2_8.xaml b/VECTO3GUI2020/Views/Multistage/VehicleView_v2_8.xaml new file mode 100644 index 0000000000000000000000000000000000000000..1860d7feffa1fd0d550a29418813d9ac30c94e41 --- /dev/null +++ b/VECTO3GUI2020/Views/Multistage/VehicleView_v2_8.xaml @@ -0,0 +1,41 @@ +<UserControl x:Class="VECTO3GUI2020.Views.Multistage.VehicleView_v2_8" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:VECTO3GUI2020.Views.Multistage" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.Multistage.CustomControls" xmlns:implementation="clr-namespace:VECTO3GUI2020.ViewModel.MultiStage.Implementation" d:DataContext="{d:DesignInstance Type=implementation:DeclarationInterimStageBusVehicleViewModel_v2_8}" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" BorderBrush="Aquamarine" BorderThickness="2px" Margin="4px"> + <Grid> + <StackPanel> + <Label Content="VEHICLE DATA" HorizontalAlignment="Stretch" Background="Aquamarine"/> + <custom:MultiStageParameter Optional="False" Content="{Binding Manufacturer}"/> + <custom:MultiStageParameter Optional="False" Content="{Binding ManufacturerAddress}"/> + <custom:MultiStageParameter Optional="False" Content="{Binding VIN}"/> + + <custom:MultiStageParameter EditingEnabled="{Binding + MeasurementsGroupEditingEnabled}" + Content="{Binding Height}"/> + <custom:MultiStageParameter EditingEnabled="{Binding + MeasurementsGroupEditingEnabled}" + Content="{Binding Width}" + HideCheckBox="True"/> + <custom:MultiStageParameter EditingEnabled="{Binding + MeasurementsGroupEditingEnabled}" + Content="{Binding Length}" + HideCheckBox="True"/> + + <custom:MultiStageParameter EditingEnabled="{Binding + NumberOfPassengersEditingEnabled}" + Content="{Binding NumberOfPassengersUpperDeck}"/> + <custom:MultiStageParameter EditingEnabled="{Binding + NumberOfPassengersEditingEnabled}" + Content="{Binding NumberOfPassengersLowerDeck}" + HideCheckBox="True"/> + + <custom:MultiStageParameter Content="{Binding TankSystem}" ComboBoxMode="True"/> + + </StackPanel> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/Multistage/VehicleView_v2_8.xaml.cs b/VECTO3GUI2020/Views/Multistage/VehicleView_v2_8.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..d6fd6cd162dee012ad85dab6f613054d986438db --- /dev/null +++ b/VECTO3GUI2020/Views/Multistage/VehicleView_v2_8.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace VECTO3GUI2020.Views.Multistage +{ + /// <summary> + /// Interaction logic for VehicleView_v2_8.xaml + /// </summary> + public partial class VehicleView_v2_8 : UserControl + { + public VehicleView_v2_8() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/SettingsView.xaml b/VECTO3GUI2020/Views/SettingsView.xaml new file mode 100644 index 0000000000000000000000000000000000000000..c96f1beb1430f5e72df72de1636b0149f5736b81 --- /dev/null +++ b/VECTO3GUI2020/Views/SettingsView.xaml @@ -0,0 +1,28 @@ +<UserControl x:Class="VECTO3GUI2020.Views.SettingsView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:local="clr-namespace:VECTO3GUI2020.Views" + mc:Ignorable="d" Height="450" Width="800"> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="4*"/> + <ColumnDefinition Width="4*"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="40"></RowDefinition> + <RowDefinition/> + <RowDefinition/> + </Grid.RowDefinitions> + + <Label VerticalAlignment="Center" Grid.Column="0" Grid.Row="0" Content="File Path: "></Label> + <TextBox Grid.Column="1" Grid.Row="0" Text="{Binding DefaultFilePath, Mode=OneWay}" IsReadOnly="True" TextWrapping="Wrap"/> + <Button Grid.Column="2" Grid.Row="0" Style="{DynamicResource MainViewButton}" Content="Change Path" Command="{Binding ChangeFilePath}"> + <Button.Background> + <ImageBrush/> + </Button.Background> + </Button> + </Grid> +</UserControl> diff --git a/VECTO3GUI2020/Views/SettingsView.xaml.cs b/VECTO3GUI2020/Views/SettingsView.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..92484cfb87fbcce333ddbb4db53dc92588ffff01 --- /dev/null +++ b/VECTO3GUI2020/Views/SettingsView.xaml.cs @@ -0,0 +1,19 @@ +using System.Windows; +using System.Windows.Controls; +using VECTO3GUI2020.Helper; +using VECTO3GUI2020.ViewModel.Implementation; +using VECTO3GUI2020.ViewModel.Interfaces; + +namespace VECTO3GUI2020.Views +{ + /// <summary> + /// Interaction logic for Settings.xaml + /// </summary> + public partial class SettingsView : UserControl + { + public SettingsView() + { + InitializeComponent(); + } + } +} diff --git a/VECTO3GUI2020/Views/XMLViewer.xaml b/VECTO3GUI2020/Views/XMLViewer.xaml new file mode 100644 index 0000000000000000000000000000000000000000..6e8fa920b6af45f13957fa6d74b954b88df1a1a0 --- /dev/null +++ b/VECTO3GUI2020/Views/XMLViewer.xaml @@ -0,0 +1,31 @@ +<Window x:Class="VECTO3GUI2020.Views.XMLViewer" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:local="clr-namespace:VECTO3GUI2020.Views" + xmlns:custom="clr-namespace:VECTO3GUI2020.Views.CustomControls" + mc:Ignorable="d" + Title="XML Viewer" Height="750" Width="800" WindowStartupLocation="CenterScreen"> + <Grid> + <Grid Margin="10, 10, 10, 10"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="5"/> + <RowDefinition Height="*"/> + </Grid.RowDefinitions> + + <Grid Grid.Row="0"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + + <TextBox Name="txtFilePath" IsReadOnly="True" + Grid.Column="0" HorizontalAlignment="Stretch" /> + </Grid> + + <custom:Viewer x:Name="vXMLViwer" Grid.Row="2" /> + </Grid> + + </Grid> +</Window> diff --git a/VECTO3GUI2020/Views/XMLViewer.xaml.cs b/VECTO3GUI2020/Views/XMLViewer.xaml.cs new file mode 100644 index 0000000000000000000000000000000000000000..73fa8387fdf115af3836e6a38aeb1d316b4ce835 --- /dev/null +++ b/VECTO3GUI2020/Views/XMLViewer.xaml.cs @@ -0,0 +1,16 @@ +using System.Windows; + +namespace VECTO3GUI2020.Views +{ + /// <summary> + /// Interaction logic for XMLViewer.xaml + /// </summary> + public partial class XMLViewer : Window + { + public XMLViewer() + { + InitializeComponent(); + } + + } +} diff --git a/VECTO3GUI2020/packages.config b/VECTO3GUI2020/packages.config new file mode 100644 index 0000000000000000000000000000000000000000..0276e5449b4acc356224fcf078f00f9c1f866c08 --- /dev/null +++ b/VECTO3GUI2020/packages.config @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="Castle.Core" version="4.4.1" targetFramework="net48" /> + <package id="InteractiveDataDisplay.WPF" version="1.0.0" targetFramework="net48" /> + <package id="Microsoft.Maps.MapControl.WPF" version="1.0.0.3" targetFramework="net48" /> + <package id="Ninject" version="3.3.4" targetFramework="net48" /> + <package id="Ninject.Extensions.ChildKernel" version="3.3.0" targetFramework="net48" /> + <package id="Ninject.Extensions.Factory" version="3.3.3" targetFramework="net48" /> + <package id="System.Reactive" version="5.0.0" targetFramework="net48" /> + <package id="System.Reactive.Core" version="5.0.0" targetFramework="net48" /> + <package id="System.Reactive.Linq" version="5.0.0" targetFramework="net48" /> + <package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net48" /> + <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" /> + <package id="System.Windows.Controls.DataVisualization.Toolkit" version="4.0.0.0" targetFramework="net48" /> + <package id="WindowsAPICodePack-Core" version="1.1.2" targetFramework="net48" /> + <package id="WindowsAPICodePack-Shell" version="1.1.1" targetFramework="net48" /> +</packages> \ No newline at end of file diff --git a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs index 0321bf56f5ed1332cc35e6720af88a5dd88cfbcc..67d8be336a5159e3b05cbdda963d9b2422f93a09 100644 --- a/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs +++ b/VectoCommon/VectoCommon/InputData/DeclarationInputData.cs @@ -586,7 +586,7 @@ namespace TUGraz.VectoCommon.InputData /// </summary> TableData FullLoadCurve { get; } - IList<IEngineFuelDelcarationInputData> Fuels { get; } + IList<IEngineFuelDeclarationInputData> Fuels { get; } IWHRData WasteHeatRecoveryDataElectrical { get; } @@ -610,7 +610,7 @@ namespace TUGraz.VectoCommon.InputData TableData GeneratedPower { get; } } - public interface IEngineFuelDelcarationInputData + public interface IEngineFuelDeclarationInputData { FuelType FuelType { get; } diff --git a/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs b/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs index ddac7f345a0af256a4e44ec7534632eede683618..a7242516fc2503f4d8df01996a00b32401de3119 100644 --- a/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs +++ b/VectoCommon/VectoCommon/InputData/EngineeringInputData.cs @@ -382,7 +382,7 @@ namespace TUGraz.VectoCommon.InputData new IList<IEngineFuelEngineeringInputData> Fuels { get; } } - public interface IEngineFuelEngineeringInputData : IEngineFuelDelcarationInputData + public interface IEngineFuelEngineeringInputData : IEngineFuelDeclarationInputData { /// <summary> /// P170 diff --git a/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs b/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs index a1c7ab7cb9dd8279485d0628c688d8cb9eeea887..2ef3211ecda3af1e2337284bba1bdf4161857849 100644 --- a/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs +++ b/VectoCommon/VectoCommon/Resources/XMLNames.Designer.cs @@ -60,6 +60,24 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to CdxA_0. + /// </summary> + public static string AirDrag_CdxA_0 { + get { + return ResourceManager.GetString("AirDrag_CdxA_0", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to AirDragDataDeclarationType. + /// </summary> + public static string AirDrag_Data_Type_Attr { + get { + return ResourceManager.GetString("AirDrag_Data_Type_Attr", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to DeclaredCdxA. /// </summary> @@ -69,6 +87,24 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to DeclaredCdxA. + /// </summary> + public static string AirDrag_DeclaredCdxA1 { + get { + return ResourceManager.GetString("AirDrag_DeclaredCdxA1", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to TransferredCdxA. + /// </summary> + public static string AirDrag_TransferredCDxA { + get { + return ResourceManager.GetString("AirDrag_TransferredCDxA", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to Efficiency. /// </summary> @@ -105,6 +141,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to type. + /// </summary> + public static string Attr_Type { + get { + return ResourceManager.GetString("Attr_Type", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to auxiliarySpeed. /// </summary> @@ -204,6 +249,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to AuxiliariesDataDeclarationType. + /// </summary> + public static string Auxiliaries_Type_Attr_DataDeclarationType { + get { + return ResourceManager.GetString("Auxiliaries_Type_Attr_DataDeclarationType", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to supplyPower. /// </summary> @@ -213,6 +267,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to AxleDataDeclarationType. + /// </summary> + public static string Axle_Type_Attr_AxleDataDeclarationType { + get { + return ResourceManager.GetString("Axle_Type_Attr_AxleDataDeclarationType", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to Efficiency. /// </summary> @@ -258,6 +321,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to AxlegearDataDeclarationType. + /// </summary> + public static string AxleGear_Type_Attr { + get { + return ResourceManager.GetString("AxleGear_Type_Attr", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to Axles. /// </summary> @@ -402,6 +474,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to AxleWheelsDataDeclarationType. + /// </summary> + public static string AxleWheels_Type_Attr_AxleWheelsDeclarationType { + get { + return ResourceManager.GetString("AxleWheels_Type_Attr_AxleWheelsDeclarationType", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to APTEcoRollReleaseLockupClutch. /// </summary> @@ -1194,6 +1275,24 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to type. + /// </summary> + public static string Component_Type_Attr { + get { + return ResourceManager.GetString("Component_Type_Attr", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to PTOType. + /// </summary> + public static string Component_Type_Attr_PTO { + get { + return ResourceManager.GetString("Component_Type_Attr_PTO", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to Vehicle. /// </summary> @@ -1212,6 +1311,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to VehicleComponentsType. + /// </summary> + public static string Components_type_attr { + get { + return ResourceManager.GetString("Components_type_attr", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to Signature. /// </summary> @@ -1806,6 +1914,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to EngineDataDeclarationType. + /// </summary> + public static string Engine_Type_Attr { + get { + return ResourceManager.GetString("Engine_Type_Attr", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to ElectricalOutput. /// </summary> @@ -2058,6 +2175,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to GearboxDataDeclarationType. + /// </summary> + public static string Gearbox_attr_GearboxDataDeclarationType { + get { + return ResourceManager.GetString("Gearbox_attr_GearboxDataDeclarationType", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to AxlegearRatio. /// </summary> @@ -2139,6 +2265,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to GearsDeclarationType. + /// </summary> + public static string Gearbox_Gears_Attr_GearsDeclarationType { + get { + return ResourceManager.GetString("Gearbox_Gears_Attr_GearsDeclarationType", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to Gear. /// </summary> @@ -2949,6 +3084,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to RetarderDataDeclarationType. + /// </summary> + public static string Retarder_Attr_DataDeclarationType { + get { + return ResourceManager.GetString("Retarder_Attr_DataDeclarationType", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to RetarderLossMap. /// </summary> @@ -2985,6 +3129,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to Component_Type_Attr. + /// </summary> + public static string String { + get { + return ResourceManager.GetString("String", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to ApplicationInformation. /// </summary> @@ -3156,6 +3309,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to TyreDataDeclarationType. + /// </summary> + public static string Tyre_Type_Attr_TyreDataDeclarationType { + get { + return ResourceManager.GetString("Tyre_Type_Attr_TyreDataDeclarationType", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to gCO2/tkm. /// </summary> @@ -3984,6 +4146,15 @@ namespace TUGraz.VectoCommon.Resources { } } + /// <summary> + /// Looks up a localized string similar to VehicleDeclarationType. + /// </summary> + public static string VehicleAttr_VehicleDeclarationType { + get { + return ResourceManager.GetString("VehicleAttr_VehicleDeclarationType", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to torqueLimit. /// </summary> diff --git a/VectoCommon/VectoCommon/Resources/XMLNames.resx b/VectoCommon/VectoCommon/Resources/XMLNames.resx index a967d2e63732ab835d3a73281f5faeaeb8885482..34634b35d3bda09decdf5068322e8f17451dc7c7 100644 --- a/VectoCommon/VectoCommon/Resources/XMLNames.resx +++ b/VectoCommon/VectoCommon/Resources/XMLNames.resx @@ -1431,4 +1431,61 @@ <data name="Bus_DeclarationType" xml:space="preserve"> <value>DeclarationType</value> </data> + <data name="AirDrag_CdxA_0" xml:space="preserve"> + <value>CdxA_0</value> + </data> + <data name="AirDrag_Data_Type_Attr" xml:space="preserve"> + <value>AirDragDataDeclarationType</value> + </data> + <data name="AirDrag_DeclaredCdxA1" xml:space="preserve"> + <value>DeclaredCdxA</value> + </data> + <data name="AirDrag_TransferredCDxA" xml:space="preserve"> + <value>TransferredCdxA</value> + </data> + <data name="Attr_Type" xml:space="preserve"> + <value>type</value> + </data> + <data name="Auxiliaries_Type_Attr_DataDeclarationType" xml:space="preserve"> + <value>AuxiliariesDataDeclarationType</value> + </data> + <data name="AxleGear_Type_Attr" xml:space="preserve"> + <value>AxlegearDataDeclarationType</value> + </data> + <data name="AxleWheels_Type_Attr_AxleWheelsDeclarationType" xml:space="preserve"> + <value>AxleWheelsDataDeclarationType</value> + </data> + <data name="Axle_Type_Attr_AxleDataDeclarationType" xml:space="preserve"> + <value>AxleDataDeclarationType</value> + </data> + <data name="Components_type_attr" xml:space="preserve"> + <value>VehicleComponentsType</value> + </data> + <data name="Component_Type_Attr" xml:space="preserve"> + <value>type</value> + </data> + <data name="Component_Type_Attr_PTO" xml:space="preserve"> + <value>PTOType</value> + </data> + <data name="Engine_Type_Attr" xml:space="preserve"> + <value>EngineDataDeclarationType</value> + </data> + <data name="Gearbox_attr_GearboxDataDeclarationType" xml:space="preserve"> + <value>GearboxDataDeclarationType</value> + </data> + <data name="Gearbox_Gears_Attr_GearsDeclarationType" xml:space="preserve"> + <value>GearsDeclarationType</value> + </data> + <data name="Retarder_Attr_DataDeclarationType" xml:space="preserve"> + <value>RetarderDataDeclarationType</value> + </data> + <data name="String" xml:space="preserve"> + <value>Component_Type_Attr</value> + </data> + <data name="Tyre_Type_Attr_TyreDataDeclarationType" xml:space="preserve"> + <value>TyreDataDeclarationType</value> + </data> + <data name="VehicleAttr_VehicleDeclarationType" xml:space="preserve"> + <value>VehicleDeclarationType</value> + </data> </root> \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONEngineData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONEngineData.cs index 8c04adeb30fe8a730a7986c0234eac71eaccad25..277c6edb47bf522870fde73cd6a263affd18bdb6 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONEngineData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONEngineData.cs @@ -339,9 +339,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON get { return _fuels ?? (_fuels = ReadFuels()); } } - public virtual IList<IEngineFuelDelcarationInputData> Fuels + public virtual IList<IEngineFuelDeclarationInputData> Fuels { - get { return (_fuels ?? (_fuels = ReadFuels())).Cast<IEngineFuelDelcarationInputData>().ToList(); } + get { return (_fuels ?? (_fuels = ReadFuels())).Cast<IEngineFuelDeclarationInputData>().ToList(); } } protected virtual IList<IEngineFuelEngineeringInputData> ReadFuels() diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationEngineDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationEngineDataProvider.cs index 42102242be2db70a5fd956ea7921d1536cc6789e..6ff025e4c9efc090ffc868ec555507a844c460cd 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationEngineDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/DataProvider/XMLDeclarationEngineDataProvider.cs @@ -71,7 +71,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider public class XMLSingleFuelEngineMode : AbstractXMLType, IEngineModeDeclarationInputData { - protected IList<IEngineFuelDelcarationInputData> FuelsList; + protected IList<IEngineFuelDeclarationInputData> FuelsList; public XMLSingleFuelEngineMode(XmlNode baseNode) : base(baseNode) { } @@ -89,11 +89,11 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider } } - public virtual IList<IEngineFuelDelcarationInputData> Fuels + public virtual IList<IEngineFuelDeclarationInputData> Fuels { get { return FuelsList ?? - (FuelsList = new List<IEngineFuelDelcarationInputData>() { new XMLSingleFuelEngineFuel(BaseNode) }); + (FuelsList = new List<IEngineFuelDeclarationInputData>() { new XMLSingleFuelEngineFuel(BaseNode) }); } } @@ -108,7 +108,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider } } - public class XMLSingleFuelEngineFuel : AbstractXMLType, IEngineFuelDelcarationInputData + public class XMLSingleFuelEngineFuel : AbstractXMLType, IEngineFuelDeclarationInputData { public XMLSingleFuelEngineFuel(XmlNode baseNode) : base(baseNode) { } @@ -285,12 +285,12 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.DataProvider #region Overrides of XMLSingleFuelEngineMode - public override IList<IEngineFuelDelcarationInputData> Fuels + public override IList<IEngineFuelDeclarationInputData> Fuels { get { return FuelsList ?? (FuelsList = GetNodes(XMLNames.Engine_FuelModes_Fuel) .Cast<XmlNode>().Select(x => new XMLDualFuelEngineFuel(x)) - .Cast<IEngineFuelDelcarationInputData>().ToList()); + .Cast<IEngineFuelDeclarationInputData>().ToList()); } } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringEngineDataProvider.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringEngineDataProvider.cs index b92c0ad5f50f792ab0e63da669073c76cb733db5..218d9eaaf34abde3b511ea20a595d8f3075d9f83 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringEngineDataProvider.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Engineering/DataProvider/XMLEngineeringEngineDataProvider.cs @@ -160,9 +160,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.DataProvider get { return new[] { this }.Cast<IEngineFuelEngineeringInputData>().ToList(); } } - public virtual IList<IEngineFuelDelcarationInputData> Fuels + public virtual IList<IEngineFuelDeclarationInputData> Fuels { - get { return new[] { this }.Cast<IEngineFuelDelcarationInputData>().ToList(); } + get { return new[] { this }.Cast<IEngineFuelDeclarationInputData>().ToList(); } } public virtual IWHRData WasteHeatRecoveryDataElectrical @@ -367,9 +367,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Engineering.DataProvider - IList<IEngineFuelDelcarationInputData> IEngineModeDeclarationInputData.Fuels + IList<IEngineFuelDeclarationInputData> IEngineModeDeclarationInputData.Fuels { - get { return (_fuels ?? (_fuels = ReadFuels())).Cast<IEngineFuelDelcarationInputData>().ToList(); } + get { return (_fuels ?? (_fuels = ReadFuels())).Cast<IEngineFuelDeclarationInputData>().ToList(); } } public virtual IWHRData WasteHeatRecoveryDataElectrical diff --git a/VectoCore/VectoCore/Models/GenericModelData/GenericBusEngineData.cs b/VectoCore/VectoCore/Models/GenericModelData/GenericBusEngineData.cs index f6cd1f33babf28036912c7a52e383fbe08670ee7..dd376e59ebb0bb46dd356783c42b0d79e5063b81 100644 --- a/VectoCore/VectoCore/Models/GenericModelData/GenericBusEngineData.cs +++ b/VectoCore/VectoCore/Models/GenericModelData/GenericBusEngineData.cs @@ -93,7 +93,7 @@ namespace TUGraz.VectoCore.Models.Declaration } - private bool UseDieselFuel(IList<IEngineFuelDelcarationInputData> fuels) + private bool UseDieselFuel(IList<IEngineFuelDeclarationInputData> fuels) { var fuelType = fuels.First().FuelType; var isDualFuel = fuels.Count > 1; @@ -111,24 +111,24 @@ namespace TUGraz.VectoCore.Models.Declaration } } - private string GetEngineRessourceId(IList<IEngineFuelDelcarationInputData> fuels) + private string GetEngineRessourceId(IList<IEngineFuelDeclarationInputData> fuels) { return UseDieselFuel(fuels) ? GenericEngineCM_Normed_CI : GenericEngineCM_Normed_PI; } - private IFuelProperties GetFuelData(IList<IEngineFuelDelcarationInputData> fuels) + private IFuelProperties GetFuelData(IList<IEngineFuelDeclarationInputData> fuels) { return UseDieselFuel(fuels) ? FuelData.Diesel : FuelData.Instance().Lookup(FuelType.NGPI, TankSystem.Compressed); } - private double[] GetEngineCorrectionFactors(IList<IEngineFuelDelcarationInputData> fuels) + private double[] GetEngineCorrectionFactors(IList<IEngineFuelDeclarationInputData> fuels) { return UseDieselFuel(fuels) ? DieselCIFactors : PIFactors; } - private CombustionEngineFuelData GetCombustionEngineFuelData(IList<IEngineFuelDelcarationInputData> fuels, PerSecond idleSpeed, EngineFullLoadCurve fullLoadCurve, Mission mission) + private CombustionEngineFuelData GetCombustionEngineFuelData(IList<IEngineFuelDeclarationInputData> fuels, PerSecond idleSpeed, EngineFullLoadCurve fullLoadCurve, Mission mission) { var ressourceId = GetEngineRessourceId(fuels); diff --git a/VectoCore/VectoCoreTest/Utils/MockEngineDataProvider.cs b/VectoCore/VectoCoreTest/Utils/MockEngineDataProvider.cs index fb3f5a8dba2f1401a7d1201cfa880600e0e649f2..a336da2924c0acc0c3c4d7fecef544d8362436f2 100644 --- a/VectoCore/VectoCoreTest/Utils/MockEngineDataProvider.cs +++ b/VectoCore/VectoCoreTest/Utils/MockEngineDataProvider.cs @@ -71,9 +71,9 @@ namespace TUGraz.VectoCore.Tests.Utils get { return new[] { this }.Cast<IEngineFuelEngineeringInputData>().ToList(); } } - public IList<IEngineFuelDelcarationInputData> Fuels + public IList<IEngineFuelDeclarationInputData> Fuels { - get { return new[] { this }.Cast<IEngineFuelDelcarationInputData>().ToList(); } + get { return new[] { this }.Cast<IEngineFuelDeclarationInputData>().ToList(); } } public IWHRData WasteHeatRecoveryDataElectrical { get; }