diff --git a/VECTO3GUI2020/App.xaml.cs b/VECTO3GUI2020/App.xaml.cs index 864fb0e62618b9feaeb0ffe96056999b410468b3..a74dff5f5731900c42404cb38ef88b35ffc23b58 100644 --- a/VECTO3GUI2020/App.xaml.cs +++ b/VECTO3GUI2020/App.xaml.cs @@ -1,5 +1,6 @@ using System.Windows; using Ninject; +using Ninject.Extensions.ChildKernel; using VECTO3GUI2020.ViewModel.Interfaces; using VECTO3GUI2020.ViewModel.Implementation; using VECTO3GUI2020.Model.Interfaces; @@ -16,6 +17,7 @@ namespace VECTO3GUI2020 { private IKernel container; + private IKernel multiStageChildContainer; protected override void OnStartup(StartupEventArgs e) { @@ -33,13 +35,13 @@ namespace VECTO3GUI2020 new ComponentModule(), new DocumentModule(), new XMLWriterFactoryModule(), + new FactoryModule(), new MultistageModule() - ) ; + ) ; - - container.Bind<IJobListViewModel>().To<JobListViewModel>(); + container.Bind<IJobListViewModel>().To<JobListViewModel>(); container.Bind<IMainWindowViewModel>().To<MainWindowViewModel>(); container.Bind<IMainViewModel>().To<JobListViewModel>(); container.Bind<ISettingsViewModel>().To<SettingsViewModel>(); diff --git a/VECTO3GUI2020/Documentation/InputData.cd b/VECTO3GUI2020/Documentation/InputData.cd index dcc1e33e879e416d23ec0a579544795f538da2e2..f294b40a8783f1e2291a7830af79733b30c4d11e 100644 --- a/VECTO3GUI2020/Documentation/InputData.cd +++ b/VECTO3GUI2020/Documentation/InputData.cd @@ -1,7 +1,7 @@ <?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" /> + <Position X="0.5" Y="1.5" Width="2.75" /> <TypeIdentifier /> <ShowAsAssociation> <Property Name="JobInputData" /> diff --git a/VECTO3GUI2020/Ninject/DocumentModule.cs b/VECTO3GUI2020/Ninject/DocumentModule.cs index 802b9174a09c7e323f449a6d5e52db81ac3dffca..b989696e777d65d62950502aee7ac1d4c742470f 100644 --- a/VECTO3GUI2020/Ninject/DocumentModule.cs +++ b/VECTO3GUI2020/Ninject/DocumentModule.cs @@ -6,6 +6,7 @@ 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 { @@ -13,10 +14,11 @@ namespace VECTO3GUI2020.Ninject { public override void Load() { - Bind<IDocumentViewModelFactory>().ToFactory(() => new UseFirstArgumentAsNameInstanceProvider(false)); + Bind<IDocumentViewModel>().To<DeclarationJobViewModel>().Named(XmlDocumentType.DeclarationJobData.ToString()); - //Bind<IDocumentViewModel>().To<DeclarationTrailerJobDocumentViewModel>().Named(XmlDocumentType.DeclarationTrailerJobData.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 index 2438f26e228c8b3841a25d2275f20103664ae8c1..817a490777255850e811a0596b05528092aeb000 100644 --- a/VECTO3GUI2020/Ninject/JobEditModule.cs +++ b/VECTO3GUI2020/Ninject/JobEditModule.cs @@ -13,7 +13,7 @@ namespace VECTO3GUI2020.Ninject { public override void Load() { - Bind<IJobEditViewModelFactory>().ToFactory(() => new UseFirstArgumentTypeAsNameInstanceProvider()); + 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 index 9d874c291396d3205afbbcd71a7a88923a03cc01..9a3de4889e5aac7a009fee69d8fd8c3f126fa8ce 100644 --- a/VECTO3GUI2020/Ninject/MultistageModule.cs +++ b/VECTO3GUI2020/Ninject/MultistageModule.cs @@ -5,6 +5,9 @@ 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; @@ -14,8 +17,20 @@ namespace VECTO3GUI2020.Ninject { public override void Load() { - Bind<IViewModelFactory>().ToFactory(); - Bind<IMultiStageEditViewModel>().To<MultiStageEditViewModel>(); + + 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 index 525447f656338f25c0e61cf68da8cfb847d1f248..97c89dbee42dae4e3be87b0c04d4244067f89d9b 100644 --- a/VECTO3GUI2020/Ninject/Util/UseFirstArgumentAsNameInstanceProvider.cs +++ b/VECTO3GUI2020/Ninject/Util/UseFirstArgumentAsNameInstanceProvider.cs @@ -13,26 +13,31 @@ namespace VECTO3GUI2020.Ninject.Util /// </summary> public class UseFirstArgumentAsNameInstanceProvider : StandardInstanceProvider { - private bool _skip_first_argument = true; - public UseFirstArgumentAsNameInstanceProvider(bool skip_first_argument) : base() + private bool _skipFirstArgument = true; + public UseFirstArgumentAsNameInstanceProvider(bool skipFirstArgument=true, bool fallback=false) : base() { - _skip_first_argument = skip_first_argument; - } + _skipFirstArgument = skipFirstArgument; + base.Fallback = fallback; + } public UseFirstArgumentAsNameInstanceProvider() : base() { } - - - protected override IConstructorArgument[] GetConstructorArguments(MethodInfo methodInfo, object[] arguments) + protected override IConstructorArgument[] GetConstructorArguments(MethodInfo methodInfo, object[] arguments) { - return base.GetConstructorArguments(methodInfo, arguments).Skip(_skip_first_argument ? 1 : 0).ToArray(); + 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(); } diff --git a/VECTO3GUI2020/Ninject/Vehicle/ComponentModule.cs b/VECTO3GUI2020/Ninject/Vehicle/ComponentModule.cs index e4280ceb05657a280756b9bc8aba83c513ecb402..f065c4e26e315c38da7b5e11167467b06a238fc4 100644 --- a/VECTO3GUI2020/Ninject/Vehicle/ComponentModule.cs +++ b/VECTO3GUI2020/Ninject/Vehicle/ComponentModule.cs @@ -21,14 +21,13 @@ namespace VECTO3GUI2020.Ninject.Vehicle #region IComponentViewModelFactory - Bind<IComponentViewModelFactory>().ToFactory( - () => new UseFirstArgumentTypeAsNameInstanceProvider(true)); 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<IVehicleViewModel>().To<DeclarationInterimStageBusVehicleViewModel_v2_8>() + // .Named(DeclarationInterimStageBusVehicleViewModel_v2_8.INPUTPROVIDERTYPE).BindingConfiguration.; Bind<IComponentViewModel>().To<EngineViewModel_v1_0>().Named(EngineViewModel_v1_0.VERSION); diff --git a/VECTO3GUI2020/Ninject/XMLWriterFactoryModule.cs b/VECTO3GUI2020/Ninject/XMLWriterFactoryModule.cs index 15a4ec6804d9c8a6bb5b9e42923cefd324ebe4d7..9791fa3362f830d1daddf78578b56ce5e00fa80d 100644 --- a/VECTO3GUI2020/Ninject/XMLWriterFactoryModule.cs +++ b/VECTO3GUI2020/Ninject/XMLWriterFactoryModule.cs @@ -13,7 +13,7 @@ namespace VECTO3GUI2020.Ninject { public override void Load() { - Bind<IXMLWriterFactory>().ToFactory(() => new UseFirstArgumentTypeAsNameInstanceProvider()); + Array.ForEach( XMLDeclarationJobWriter_v1_0.SUPPORTED_VERSIONS, diff --git a/VECTO3GUI2020/Resources/ViewModelBindings.xaml b/VECTO3GUI2020/Resources/ViewModelBindings.xaml index 6627f901b6508787ffa5d53b1439586207ef3894..993c2c434cb59d23be5c9c3ab0b8fd7db5685b8a 100644 --- a/VECTO3GUI2020/Resources/ViewModelBindings.xaml +++ b/VECTO3GUI2020/Resources/ViewModelBindings.xaml @@ -194,13 +194,24 @@ </DataTemplate> - <DataTemplate DataType="{x:Type multistageimpl:MultiStageEditViewModel}"> - <multistageviews:ManufacturingStageView/> + <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/VECTO3GUI2020.csproj b/VECTO3GUI2020/VECTO3GUI2020.csproj index 1913f2146c321777bee2439fca8b581c10c8442b..b61f39615c91dc7a2ff28878d30f3ac768bc1705 100644 --- a/VECTO3GUI2020/VECTO3GUI2020.csproj +++ b/VECTO3GUI2020/VECTO3GUI2020.csproj @@ -73,6 +73,9 @@ <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> @@ -131,6 +134,7 @@ <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" /> @@ -238,8 +242,12 @@ <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\MultiStageEditViewModel.cs" /> - <Compile Include="ViewModel\MultiStage\Interfaces\IViewModelFactory.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> @@ -331,9 +339,21 @@ <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> @@ -507,10 +527,26 @@ <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> @@ -606,7 +642,9 @@ <ItemGroup> <Resource Include="Resources\folderpicker.ico" /> </ItemGroup> - <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 --> diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs index 9b777895c48bfa6383472895baa9cbea6a643b41..c957de3f19c6615fdea7feea11a70f92ce67fb24 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs @@ -50,7 +50,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation private IWindowHelper _windowHelper; private IDocumentViewModelFactory _documentViewModelFactory; private ICommand _newMultiStageFileCommand; - private IViewModelFactory _viewModelFactory; + private IMultiStageViewModelFactory _multiStageViewModelFactory; #endregion @@ -64,12 +64,12 @@ namespace VECTO3GUI2020.ViewModel.Implementation public JobListViewModel(IDocumentViewModelFactory documentViewModelFactory, IDialogHelper dialogHelper, IWindowHelper windowHelper, - IViewModelFactory viewModelFactory) : this() + IMultiStageViewModelFactory multiStageViewModelFactory) : this() { _documentViewModelFactory = documentViewModelFactory; _dialogHelper = dialogHelper; _windowHelper = windowHelper; - _viewModelFactory = viewModelFactory; + _multiStageViewModelFactory = multiStageViewModelFactory; } @@ -101,7 +101,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation private void NewManufacturingStageFileExecute() { - _windowHelper.ShowWindow(_viewModelFactory.createManufacturingStageEditViewModel()); + _windowHelper.ShowWindow(_multiStageViewModelFactory.CreateNewMultiStageJobViewModel()); } diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/DeclarationInterimStageBusVehicleViewModel_v2_8.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/DeclarationInterimStageBusVehicleViewModel_v2_8.cs index 68b6804096f87b9c9bc605856e44ab64d7c75f94..e3ec4d2e7218f09be3a6fafec6563840c9f937b7 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/DeclarationInterimStageBusVehicleViewModel_v2_8.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/DeclarationInterimStageBusVehicleViewModel_v2_8.cs @@ -20,7 +20,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation { class DeclarationInterimStageBusVehicleViewModel_v2_8 : ViewModelBase, IVehicleViewModel { - public static String VERSION = typeof(XMLDeclarationInterimStageBusDataProviderV28).ToString(); + public static readonly string INPUTPROVIDERTYPE = typeof(XMLDeclarationInterimStageBusDataProviderV28).ToString(); public string Name { @@ -151,15 +151,9 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation } - public DeclarationInterimStageBusVehicleViewModel_v2_8(IVehicleDeclarationInputData inputData) + public DeclarationInterimStageBusVehicleViewModel_v2_8() { - _inputData = inputData; - - _manufacturer = inputData.Manufacturer; - _manufacturerAddress = inputData.ManufacturerAddress; - _vin = inputData.VIN; - _width = inputData.Width; } 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/MultiStageEditViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/NewMultiStageJobViewModel.cs similarity index 61% rename from VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultiStageEditViewModel.cs rename to VECTO3GUI2020/ViewModel/MultiStage/Implementation/NewMultiStageJobViewModel.cs index 39cf7ce9bbb88814e578fcc7ea1015604d153aaa..860a7c77dcc61d23cdb406b4546dcd3215845ba6 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/MultiStageEditViewModel.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/NewMultiStageJobViewModel.cs @@ -15,49 +15,38 @@ 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 interface IMultiStageEditViewModel - { - - } - - public class MultiStageEditViewModel : ViewModelBase, IMultiStageEditViewModel + public class NewMultiStageJobViewModel : ViewModelBase { private readonly Settings _settings = Settings.Default; private ICommand _addVifCommand; private string _vifPath; private IDialogHelper _dialogHelper; private IXMLInputDataReader _inputDataReader; - private IVehicleViewModel _vehicleViewModel; - private IComponentViewModelFactory _componentViewModelFactory; - private int _stageCount; + private IMultiStageViewModelFactory _vmFactory; + private IMultiStageJobViewModel _multistageJobViewModel; public string VifPath { get => _vifPath; set => SetProperty(ref _vifPath, value); } - public int StageCount - { - get => _stageCount; - set => SetProperty(ref _stageCount, value); - } - public IVehicleViewModel VehicleViewModel + public IMultiStageJobViewModel MultiStageJobViewModel { - get => _vehicleViewModel; - set => SetProperty(ref _vehicleViewModel, value); + get { return _multistageJobViewModel; } + set { SetProperty(ref _multistageJobViewModel, value); } } - - public MultiStageEditViewModel(IDialogHelper dialogHelper, + public NewMultiStageJobViewModel(IDialogHelper dialogHelper, IXMLInputDataReader inputDataReader, - IComponentViewModelFactory componentViewModelFactory) + IMultiStageViewModelFactory vmFactory) { _inputDataReader = inputDataReader; _dialogHelper = dialogHelper; - _componentViewModelFactory = componentViewModelFactory; - Title = "New interim stage file"; + _vmFactory = vmFactory; + Title = "New Multistage file"; VifPath = "Select VIF File"; } @@ -67,17 +56,17 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation public ICommand AddVifFile { - get => _addVifCommand ?? new RelayCommand(addVifFileExecute, () => true); + get => _addVifCommand ?? new RelayCommand(AddVifFileExecute, () => true); } - private void addVifFileExecute() + 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); } @@ -87,23 +76,14 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation _dialogHelper.ShowMessageBox("invalid input file", "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } - - - var lastManufacturingStageInputData = inputDataProvider.JobInputData.ManufacturingStages.Last(); + MultiStageJobViewModel = + _vmFactory.CreateMultiStageJobViewModel(inputDataProvider.GetType().ToString(), inputDataProvider); VifPath = fileName; - - _stageCount = inputDataProvider.JobInputData.ManufacturingStages.Count + 1; - - - - - - VehicleViewModel = - _componentViewModelFactory.CreateVehicleViewModel(lastManufacturingStageInputData.Vehicle); - } + + #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/ViewModel/MultiStage/Interfaces/IViewModelFactory.cs b/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IViewModelFactory.cs deleted file mode 100644 index a359e35a9e7ca2ae37461a3085f3a5474d54079a..0000000000000000000000000000000000000000 --- a/VECTO3GUI2020/ViewModel/MultiStage/Interfaces/IViewModelFactory.cs +++ /dev/null @@ -1,14 +0,0 @@ -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 - { - IMultiStageEditViewModel createManufacturingStageEditViewModel(); - } -} 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.cs b/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml.cs index a9aa764f65e079ed5d96e1d7dbac5f62df984b38..9a07e812c116087fbb500f1bfa6b0acfeb32f9cc 100644 --- a/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml.cs +++ b/VECTO3GUI2020/Views/Multistage/CustomControls/MultiStageParameter.xaml.cs @@ -181,7 +181,7 @@ namespace VECTO3GUI2020.Views.Multistage.CustomControls try { //Create SI Dummy - if (baseType == typeof(SI)) { + if (baseType.BaseType == typeof(SI)) { var createMethod = baseType.GetMethod("Create"); var dummyContent = createMethod?.Invoke(null, new object[] { (new double()) }); return dummyContent; diff --git a/VECTO3GUI2020/Views/Multistage/ManufacturingStageView.xaml b/VECTO3GUI2020/Views/Multistage/ManufacturingStageView.xaml index 8999b236fde870ee5294a2dbfbca1ce512349afe..0dacf726638c9c5972a07768e45869e9e31d2c95 100644 --- a/VECTO3GUI2020/Views/Multistage/ManufacturingStageView.xaml +++ b/VECTO3GUI2020/Views/Multistage/ManufacturingStageView.xaml @@ -14,19 +14,16 @@ <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> <DockPanel Grid.Row="1" LastChildFill="False" DockPanel.Dock="Top" > - <Button DockPanel.Dock="Left" Style="{DynamicResource MultiStageButtonStyle1}" Margin="4">Vehicle</Button> - <Button DockPanel.Dock="Left" Style="{DynamicResource MultiStageButtonStyle1}" Margin="4">Airdrag</Button> - <Button DockPanel.Dock="Left" Style="{DynamicResource MultiStageButtonStyle1}" Margin="4">Auxiliaries</Button> + <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 Grid.Row="2" Content="{Binding VehicleViewModel}"></ContentControl> + <ContentControl Content="{Binding CurrentView}"></ContentControl> </DockPanel> </Grid> </UserControl> 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/packages.config b/VECTO3GUI2020/packages.config index e586a612cfdabcdcd5fbac02f770e2e15981a042..0276e5449b4acc356224fcf078f00f9c1f866c08 100644 --- a/VECTO3GUI2020/packages.config +++ b/VECTO3GUI2020/packages.config @@ -4,6 +4,7 @@ <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" />