diff --git a/VECTO3GUI2020/Ninject/DocumentModule.cs b/VECTO3GUI2020/Ninject/DocumentModule.cs index a89e2a912886530bb8fe2cf8967687356c1d3f08..31fd37e9536e38507981f3da9f41c74de455d9bd 100644 --- a/VECTO3GUI2020/Ninject/DocumentModule.cs +++ b/VECTO3GUI2020/Ninject/DocumentModule.cs @@ -19,6 +19,9 @@ namespace VECTO3GUI2020.Ninject Bind<IDocumentViewModel>().To<CreateVifViewModel>() .Named(typeof(JSONInputDataV10_PrimaryAndStageInputBus).ToString()); + Bind<IDocumentViewModel>().To<CompletedBusV7ViewModel>() + .Named(typeof(JSONInputDataCompletedBusFactorMethodV7).ToString()); + //Bind<IDocumentViewModel>().To<MultistageJobViewModel>().Named(XmlDocumentType.MultistageOutputData.ToString()); //Bind<IDocumentViewModel>().To<DeclarationTrailerJobDocumentViewModel>().Named(XmlDocumentType.DeclarationTrailerJobData.ToString()); diff --git a/VECTO3GUI2020/ViewModel/Implementation/Document/CompletedBusV7ViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/Document/CompletedBusV7ViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..7c29ea1658c4b969582fec50e6e25f40c44cc07a --- /dev/null +++ b/VECTO3GUI2020/ViewModel/Implementation/Document/CompletedBusV7ViewModel.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TUGraz.VectoCommon.Exceptions; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.Utils; +using VECTO3GUI2020.ViewModel.Implementation.Common; +using VECTO3GUI2020.ViewModel.Interfaces; +using VECTO3GUI2020.ViewModel.Interfaces.Document; + +namespace VECTO3GUI2020.ViewModel.Implementation.Document +{ + internal class CompletedBusV7ViewModel : ViewModelBase, IJobViewModel + { + private bool _selected; + private DataSource _dataSource; + + private IMultistageVIFInputData _inputData; + private string _documentName; + + #region Implementation of IDocumentViewModel + + public CompletedBusV7ViewModel(IInputDataProvider inputData) + { + _dataSource = inputData.DataSource; + _inputData = inputData as IMultistageVIFInputData; + if (_inputData == null) { + throw new VectoException("Invalid input file"); + } + + _documentName = Path.GetFileNameWithoutExtension(_inputData.DataSource.SourceFile); + } + + public string DocumentName => _documentName; + + public XmlDocumentType? DocumentType => null; + + public string DocumentTypeName => "CompletedBus"; + + public DataSource DataSource => _dataSource; + + public IEditViewModel EditViewModel => null; + + public bool Selected + { + get => _selected; + set => SetProperty(ref _selected, value); + } + + public bool CanBeSimulated + { + get => true; + set => throw new NotImplementedException(); + } + + public IAdditionalJobInfoViewModel AdditionalJobInfoVm + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + #endregion + } +} diff --git a/VECTO3GUI2020/ViewModel/Implementation/Document/SimulationOnlyDeclarationJob.cs b/VECTO3GUI2020/ViewModel/Implementation/Document/SimulationOnlyDeclarationJob.cs index df09dd609691d1079c1f041636d0d5387a3eebc6..77f8343fd9d3bb81be7417cc855eb9f8377f87d6 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/Document/SimulationOnlyDeclarationJob.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/Document/SimulationOnlyDeclarationJob.cs @@ -8,7 +8,7 @@ using VECTO3GUI2020.ViewModel.Interfaces.Document; namespace VECTO3GUI2020.ViewModel.Implementation.Document { - public class SimulationOnlyDeclarationJob : ViewModelBase, IDocumentViewModel, IJobViewModel + public class SimulationOnlyDeclarationJob : ViewModelBase, IJobViewModel { #region Implementation of IDocumentViewModel diff --git a/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs b/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs index 7beef48c8172dfae844d5325334539239722dbeb..93616a77dc4a99eacf53932202b35db1ddf2b460 100644 --- a/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs +++ b/VECTO3GUI2020/ViewModel/Implementation/JobListViewModel.cs @@ -472,6 +472,9 @@ namespace VECTO3GUI2020.ViewModel.Implementation case IMultistagePrimaryAndStageInputDataProvider primaryAndStage: mode = ExecutionMode.Declaration; break; + case IMultistageVIFInputData vifInputData: + mode = ExecutionMode.Declaration; + break; default: input = null;