Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 3ecf1711 authored by Harald Martini's avatar Harald Martini
Browse files

Added ViewModels (ManufacturingStageEditViewmodel,...

Added ViewModels (ManufacturingStageEditViewmodel, DeclarationInterimStageBusVehicleViewodel) and Views.

Added MultistageParameter Custom control
parent 907a945d
No related branches found
No related tags found
No related merge requests found
Showing
with 697 additions and 28 deletions
......@@ -32,7 +32,8 @@ namespace VECTO3GUI2020
new JobEditModule(),
new ComponentModule(),
new DocumentModule(),
new XMLWriterFactoryModule()
new XMLWriterFactoryModule(),
new MultistageModule()
) ;
......
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Interface Name="TUGraz.VectoCommon.InputData.IMultistageBusInputDataProvider">
<Position X="1.75" Y="1.5" Width="1.5" />
<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
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
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;
}
}
}
......@@ -8,8 +8,8 @@ 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")
......@@ -17,8 +17,23 @@ namespace VECTO3GUI2020.Helper.Converter
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)
......
......@@ -20,7 +20,6 @@ namespace VECTO3GUI2020.Helper
#region File and Folder Dialogs
private string _xmlFilter = "XML Files (*.xml)|*.xml";
public string FileName { get; set; }
private string[] OpenFilesDialog(string filter, string initialDirectory, bool multiselect)
{
......@@ -55,7 +54,7 @@ namespace VECTO3GUI2020.Helper
return OpenFilesDialog(_xmlFilter, initialDirectory);
}
public string OpenXMLFileDialog(string initialDirectory)
public string OpenXMLFileDialog(string initialDirectory = null)
{
return OpenFilesDialog(_xmlFilter, initialDirectory, false)?[0];
}
......
......@@ -26,6 +26,7 @@
<Menu IsMainMenu="True">
<MenuItem Header="File" VerticalAlignment="Center">
<MenuItem Header="Settings" Command="{Binding OpenSettings}"/>
<MenuItem Header="New File" Command="{Binding NewInterimFile}"/>
</MenuItem>
</Menu>
</StackPanel>
......
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.ViewModel.MultiStage.Implementation;
using VECTO3GUI2020.ViewModel.MultiStage.Interfaces;
namespace VECTO3GUI2020.Ninject
{
public class MultistageModule : NinjectModule
{
public override void Load()
{
Bind<IViewModelFactory>().ToFactory();
Bind<IManufacturingStageEditViewModel>().To<ManufacturingStageEditViewModel>();
}
}
}
......@@ -10,6 +10,7 @@ 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
{
......@@ -26,6 +27,9 @@ namespace VECTO3GUI2020.Ninject.Vehicle
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.VERSION);
Bind<IComponentViewModel>().To<EngineViewModel_v1_0>().Named(EngineViewModel_v1_0.VERSION);
Bind<IComponentViewModel>().To<EngineViewModel_v2_0>().Named(EngineViewModel_v2_0.VERSION);
......
......@@ -9,5 +9,7 @@
<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>
......@@ -8,8 +8,10 @@
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: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>
......@@ -192,6 +194,13 @@
</DataTemplate>
<DataTemplate DataType="{x:Type multistageimpl:ManufacturingStageEditViewModel}">
<multistageviews:ManufacturingStageView/>
</DataTemplate>
<DataTemplate DataType="{x:Type multistageimpl:DeclarationInterimStageBusVehicleViewModel_v2_8}">
<multistageviews:VehicleView_v2_8/>
</DataTemplate>
</ResourceDictionary>
\ No newline at end of file
VECTO3GUI2020/Resources/folderpicker.ico

250 KiB

......@@ -59,6 +59,7 @@
<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>
......@@ -116,6 +117,8 @@
<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" />
......@@ -128,6 +131,7 @@
<Compile Include="Helper\DialogHelper.cs" />
<Compile Include="Helper\WindowHelper.cs" />
<Compile Include="Helper\XMLExtension.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" />
......@@ -233,9 +237,13 @@
<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\ManufacturingStageEditViewModel.cs" />
<Compile Include="ViewModel\MultiStage\Interfaces\IViewModelFactory.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>
......@@ -323,6 +331,15 @@
<Compile Include="Views\MessageView.xaml.cs">
<DependentUpon>MessageView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Multistage\CustomControls\MultiStageParameter.xaml.cs">
<DependentUpon>MultiStageParameter.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>
......@@ -484,6 +501,18 @@
<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\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>
......@@ -523,6 +552,7 @@
<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>
......@@ -567,6 +597,9 @@
<Name>VectoCore</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\folderpicker.ico" />
</ItemGroup>
<ItemGroup />
<!-- ItemGroup>
<Analyzer Include="..\packages\Microsoft.DependencyValidation.Analyzers.0.11.0\analyzers\dotnet\cs\Microsoft.DependencyValidation.Analyzers.resources.dll" />
......
......@@ -14,6 +14,8 @@ 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;
......@@ -47,8 +49,10 @@ namespace VECTO3GUI2020.ViewModel.Implementation
private IDialogHelper _dialogHelper;
private IWindowHelper _windowHelper;
private IDocumentViewModelFactory _documentViewModelFactory;
private ICommand _newMultiStageFileCommand;
private IViewModelFactory _viewModelFactory;
#endregion
#endregion
public JobListViewModel()
......@@ -59,12 +63,14 @@ namespace VECTO3GUI2020.ViewModel.Implementation
public JobListViewModel(IDocumentViewModelFactory documentViewModelFactory,
IDialogHelper dialogHelper,
IWindowHelper windowHelper) : this()
IWindowHelper windowHelper,
IViewModelFactory viewModelFactory) : this()
{
_documentViewModelFactory = documentViewModelFactory;
_dialogHelper = dialogHelper;
_windowHelper = windowHelper;
}
_viewModelFactory = viewModelFactory;
}
......@@ -85,7 +91,21 @@ namespace VECTO3GUI2020.ViewModel.Implementation
#region Commands
public ICommand AddJob
public ICommand NewManufacturingStageFile
{
get
{
return _newMultiStageFileCommand ?? new RelayCommand(NewManufacturingStageFileExecute, () => { return true; });
}
}
private void NewManufacturingStageFileExecute()
{
_windowHelper.ShowWindow(_viewModelFactory.createManufacturingStageEditViewModel());
}
public ICommand AddJob
{
get
{
......
using VECTO3GUI2020.ViewModel.Interfaces;
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;
......@@ -12,33 +14,33 @@ namespace VECTO3GUI2020.ViewModel.Implementation
public class MainWindowViewModel : ViewModelBase, IMainWindowViewModel
{
#region Member
private IMainViewModel _topView;
private IJobListViewModel _jobListVm;
private IMainViewModel _bottomView;
#endregion
#region Commands
private ICommand _openSettings;
private ICommand _editJob;
private IWindowHelper _windowHelper;
private ISettingsViewModel _settingsViewModel;
#endregion
public MainWindowViewModel(IWindowHelper windowHelper, ISettingsViewModel settingsViewModel)
public MainWindowViewModel(IWindowHelper windowHelper, ISettingsViewModel settingsViewModel, IJobListViewModel jobListViewModel)
{
_windowHelper = windowHelper;
_settingsViewModel = settingsViewModel;
_jobListVm = jobListViewModel;
}
[Inject]
public IMainViewModel CurrentViewModelTop
public IMainViewModel CurrentViewModelTop
{
get { return _topView;
get { return _jobListVm;
}
set { _topView = value; }
}
set { throw new NotImplementedException(); }
}
public IMainViewModel CurrentViewModelBottom
{
......@@ -65,13 +67,20 @@ namespace VECTO3GUI2020.ViewModel.Implementation
_windowHelper.ShowWindow(_settingsViewModel);
}
#endregion
#region newMultiStage
public ICommand NewInterimFile => _jobListVm.NewManufacturingStageFile;
#endregion
#endregion
......
......@@ -10,5 +10,6 @@ namespace VECTO3GUI2020.ViewModel.Interfaces
ICommand AddJob { get; }
ICommand EditJob { get; }
ObservableCollection<IDocumentViewModel> Jobs { get; }
}
ICommand NewManufacturingStageFile { get; }
}
}
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 String VERSION = 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(IVehicleDeclarationInputData inputData)
{
_inputData = inputData;
_manufacturer = inputData.Manufacturer;
_manufacturerAddress = inputData.ManufacturerAddress;
_vin = inputData.VIN;
_width = inputData.Width;
}
#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;
}
}
using System;
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;
namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
{
public interface IManufacturingStageEditViewModel
{
}
public class ManufacturingStageEditViewModel : ViewModelBase, IManufacturingStageEditViewModel
{
private readonly Settings _settings = Settings.Default;
private ICommand _addVifCommand;
private string _vifPath;
private IDialogHelper _dialogHelper;
private IXMLInputDataReader _inputDataReader;
private IVehicleViewModel _vehicleViewModel;
private IComponentViewModelFactory _componentViewModelFactory;
public string VifPath { get => _vifPath; set => SetProperty(ref _vifPath, value); }
public IVehicleViewModel VehicleViewModel
{
get => _vehicleViewModel;
set => SetProperty(ref _vehicleViewModel, value);
}
public ManufacturingStageEditViewModel(IDialogHelper dialogHelper,
IXMLInputDataReader inputDataReader,
IComponentViewModelFactory componentViewModelFactory)
{
_inputDataReader = inputDataReader;
_dialogHelper = dialogHelper;
_componentViewModelFactory = componentViewModelFactory;
Title = "New interim stage 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;
}
VifPath = fileName;
var lastManufacturingStageInputData = inputDataProvider.JobInputData.ManufacturingStages.Last();
VehicleViewModel =
_componentViewModelFactory.CreateVehicleViewModel(lastManufacturingStageInputData.Vehicle);
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VECTO3GUI2020.ViewModel.MultiStage.Implementation;
namespace VECTO3GUI2020.ViewModel.MultiStage.Interfaces
{
public interface IViewModelFactory
{
IManufacturingStageEditViewModel createManufacturingStageEditViewModel();
}
}
......@@ -123,12 +123,6 @@ namespace VECTO3GUI2020.Views.CustomControls
var items = Enum.GetValues(data.GetType()).Cast<object>().ToList<object>();
foreach (var item in items)
{
//Console.WriteLine(item.ToString());
}
ListItems = items;
SelectedItem = data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment