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

Skip to content
Snippets Groups Projects
Commit 259a189c authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

Merge branch 'feature/VECTO-1410-multistage-tool-buses' of...

Merge branch 'feature/VECTO-1410-multistage-tool-buses' of git+ssh://129.27.107.191:2211/vecto-dev into test
parents b7fba4e3 b14adb06
No related branches found
No related tags found
No related merge requests found
......@@ -188,6 +188,7 @@
<Compile Include="ViewModel\Implementation\Document\DeclarationJobViewModel.cs" />
<Compile Include="ViewModel\Implementation\Document\DeclarationTrailerJobDocumentViewModel.cs" />
<Compile Include="Model\Interfaces\IAuxiliaryModelFactory.cs" />
<Compile Include="ViewModel\Implementation\Document\SimulationOnlyDeclarationJob.cs" />
<Compile Include="ViewModel\Implementation\MessageEntry.cs" />
<Compile Include="ViewModel\Interfaces\Document\IDocumentViewModel.cs" />
<Compile Include="ViewModel\Interfaces\Document\IDocumentViewModelFactory.cs" />
......
......@@ -32,6 +32,12 @@ namespace VECTO3GUI2020.ViewModel.Implementation.Document
set => SetProperty(ref _selected, value);
}
public bool CanBeEdited
{
get => false;
set => throw new System.NotImplementedException();
}
#endregion
#region Members
......
......@@ -26,6 +26,12 @@ namespace VECTO3GUI2020.ViewModel.Implementation.Document
set => throw new System.NotImplementedException();
}
public bool CanBeEdited
{
get => false;
set => throw new System.NotImplementedException();
}
IEditViewModel IDocumentViewModel.EditViewModel => throw new System.NotImplementedException();
private IXMLInputDataReader _xMLInputDataReader;
......
using System.Configuration;
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
{
public class SimulationOnlyDeclarationJob : ViewModelBase, IDocumentViewModel, IJobViewModel
{
#region Implementation of IDocumentViewModel
public string DocumentName
{
get => _documentName;
set => _documentName = value;
}
public XmlDocumentType DocumentType
{
get => _documentType;
set => _documentType = value;
}
public DataSource DataSource
{
get => _dataSource;
set => _dataSource = value;
}
public IEditViewModel EditViewModel { get; set; }
private bool _selected;
private XmlDocumentType _documentType;
private string _documentName;
private DataSource _dataSource;
public bool Selected
{
get => _selected;
set => SetProperty(ref _selected, value);
}
public bool CanBeEdited
{
get => false;
set => throw new System.NotImplementedException();
}
#endregion
public SimulationOnlyDeclarationJob(DataSource dataSource, string name, XmlDocumentType documentType)
{
_documentType = documentType;
_dataSource = dataSource;
_documentName = name;
}
}
}
\ No newline at end of file
......@@ -38,6 +38,7 @@ using VECTO3GUI2020.Helper;
using VECTO3GUI2020.Model.Interfaces;
using VECTO3GUI2020.Properties;
using VECTO3GUI2020.ViewModel.Implementation.Common;
using VECTO3GUI2020.ViewModel.Implementation.Document;
using VECTO3GUI2020.ViewModel.Interfaces;
using VECTO3GUI2020.ViewModel.Interfaces.Document;
using VECTO3GUI2020.ViewModel.MultiStage.Implementation;
......@@ -556,7 +557,15 @@ namespace VECTO3GUI2020.ViewModel.Implementation
if (documentType == XmlDocumentType.MultistageOutputData) {
var inputDataProvider = _inputDataReader.Create(fileName) as IMultistageBusInputDataProvider;
return Task.FromResult(_multiStageViewModelFactory.GetMultiStageJobViewModel(inputDataProvider) as IDocumentViewModel);
} else {
} else if (documentType == XmlDocumentType.DeclarationJobData) {
//Remove
var inputDataProvider = _inputDataReader.CreateDeclaration(fileName);
var result = new SimulationOnlyDeclarationJob(inputDataProvider.DataSource,
inputDataProvider.JobInputData.JobName, XmlDocumentType.DeclarationJobData) as IDocumentViewModel;
return Task.FromResult(result);
}else {
throw new VectoXMLException($"{documentType.ToString()} not supported");
}
......@@ -581,8 +590,7 @@ namespace VECTO3GUI2020.ViewModel.Implementation
private void AddJobExecute()
{
//Another possibility is to use IsAsync true property of Binding.
IsLoading = true;
IsLoading = true;
var filename = _dialogHelper.OpenXMLFileDialog();
if (filename != null)
{
......@@ -605,9 +613,9 @@ namespace VECTO3GUI2020.ViewModel.Implementation
get
{
return _editJobCommand ?? new Util.RelayCommand<IJobViewModel>(EditJobExecute,
(IJobViewModel jobentry) =>
{
return (jobentry != null);
(IJobViewModel jobentry) => {
var canExecute = jobentry != null && jobentry.CanBeEdited;
return canExecute;
});
}
set
......
......@@ -12,5 +12,7 @@ namespace VECTO3GUI2020.ViewModel.Interfaces.Document
IEditViewModel EditViewModel { get; }
bool Selected { get; set; }
bool CanBeEdited { get; set; }
}
}
......@@ -314,6 +314,12 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
set => SetProperty(ref _selected, value);
}
public bool CanBeEdited
{
get => true;
set => throw new NotImplementedException();
}
#endregion
#region Implementation of IMultistageVIFInputData
......
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