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

Skip to content
Snippets Groups Projects
Commit b124110d authored by Harald MARTINI's avatar Harald MARTINI
Browse files

Updated IMulsitagePrimaryAndStageINputDataProvider Interface, and added support in JobListViewModel

parent e95f87d8
No related branches found
No related tags found
No related merge requests found
......@@ -447,10 +447,18 @@ namespace VECTO3GUI2020.ViewModel.Implementation
switch (extension) {
case Constants.FileExtensions.VectoJobFile:
input = JSONInputDataFactory.ReadJsonJob(fullFileName);
var tmp = input as IDeclarationInputDataProvider;
mode = tmp?.JobInputData.SavedInDeclarationMode ?? false
? ExecutionMode.Declaration
: ExecutionMode.Engineering;
if (input is IDeclarationInputDataProvider tmp) {
mode = tmp.JobInputData.SavedInDeclarationMode
? ExecutionMode.Declaration
: ExecutionMode.Engineering;
} else {
mode = ExecutionMode.Engineering;
}
break;
case Constants.FileExtensions.Json:
input = JSONInputDataFactory.ReadJsonJob(fullFileName);
mode = ExecutionMode.Declaration;
break;
case ".xml":
var xdoc = XDocument.Load(fullFileName);
......@@ -640,9 +648,16 @@ namespace VECTO3GUI2020.ViewModel.Implementation
foreach (var jobEntry in jobs)
{
var w = new FileOutputWriter(GetOutputDirectory(jobEntry.DataSource.SourceFile));
foreach (var entry in new Dictionary<string, string>() { { w.XMLFullReportName, "XML ManufacturereReport" }, { w.XMLCustomerReportName, "XML Customer Report" }, { w.XMLVTPReportName, "VTP Report" }, { w.XMLPrimaryVehicleReportName, "Primary Vehicle Information File" } })
foreach (var entry in
new Dictionary<string, string>() {
{ w.XMLFullReportName, "XML ManufacturereReport" },
{ w.XMLCustomerReportName, "XML Customer Report" },
{ w.XMLVTPReportName, "VTP Report" },
{ w.XMLPrimaryVehicleReportName, "Primary Vehicle Information File" }
})
{
if (File.Exists(entry.Key))
if (File.Exists(entry.Key) &&
((DateTime.Now - File.GetLastWriteTime(entry.Key) < start.Elapsed)))
{
outputMessages.Report(
new MessageEntry()
......
......@@ -160,7 +160,7 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation
if (inputDataProvider.StageInputData != null && (inputDataProvider.StageInputData.ExemptedVehicle !=
inputDataProvider.PrimaryVehicle.ExemptedVehicle)) {
inputDataProvider.PrimaryVehicle.JobInputData.Vehicle.ExemptedVehicle)) {
throw new VectoException("Can't combine exempted and non-exempted input data");
}
......
......@@ -84,7 +84,6 @@ namespace TUGraz.VectoCommon.InputData
public interface ISingleBusInputDataProvider : IDeclarationInputDataProvider
{
IVehicleDeclarationInputData PrimaryVehicle { get; }
IVehicleDeclarationInputData CompletedVehicle { get; }
}
......@@ -98,7 +97,7 @@ namespace TUGraz.VectoCommon.InputData
public interface IMultistagePrimaryAndStageInputDataProvider : IInputDataProvider
{
IVehicleDeclarationInputData PrimaryVehicle { get; }
IDeclarationInputDataProvider PrimaryVehicle { get; }
IVehicleDeclarationInputData StageInputData { get; }
}
......
......@@ -146,6 +146,7 @@
<Compile Include="Utils\VectoMath.cs" />
</ItemGroup>
<ItemGroup>
<None Include="InputData\BusInputData.cd" />
<None Include="packages.config" />
<None Include="Properties\Version.tt">
<Generator>TextTemplatingFileGenerator</Generator>
......
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