From faf5d068f2d06822c411a99042a49c3244503528 Mon Sep 17 00:00:00 2001 From: "harald.martini@student.tugraz.at" <harald.martini@student.tugraz.at> Date: Tue, 3 Aug 2021 16:34:24 +0200 Subject: [PATCH] Changed paths in Primary & Interim to relative paths --- .../MultiStage/Implementation/CreateVifViewModel.cs | 4 ++-- Vecto3GUI2020Test/TestData/newVifCompletedDiesel.json | 6 +++--- Vecto3GUI2020Test/TestData/newVifCompletedStage.json | 6 +++--- Vecto3GUI2020Test/TestData/newVifExempted.json | 6 +++--- Vecto3GUI2020Test/TestData/newVifInterimStage.json | 6 +++--- VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs | 2 ++ 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs index dd06e836f9..f0a24bc9d1 100644 --- a/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs +++ b/VECTO3GUI2020/ViewModel/MultiStage/Implementation/CreateVifViewModel.cs @@ -293,8 +293,8 @@ namespace VECTO3GUI2020.ViewModel.MultiStage.Implementation FileVersion = JSONJobHeader.PrimaryAndInterimVersion }, Body = new JSONJobBody() { - PrimaryVehicle = PrimaryInputPath, - InterimStage = StageInputPath + PrimaryVehicle = PathHelper.GetRelativePath(path, PrimaryInputPath), + InterimStage = PathHelper.GetRelativePath(path, StageInputPath) } }; diff --git a/Vecto3GUI2020Test/TestData/newVifCompletedDiesel.json b/Vecto3GUI2020Test/TestData/newVifCompletedDiesel.json index 704b90bd69..7ff2aec686 100644 --- a/Vecto3GUI2020Test/TestData/newVifCompletedDiesel.json +++ b/Vecto3GUI2020Test/TestData/newVifCompletedDiesel.json @@ -1,13 +1,13 @@ { "Header": { "CreatedBy": "Harry", - "Date": "2021-08-02T00:00:00+02:00", + "Date": "2021-08-03T00:00:00+02:00", "AppVersion": "Vecto3GUI2020", "FileVersion": 10 }, "Body": { - "PrimaryVehicle": "C:\\Users\\Harry\\source\\repos\\vecto-dev\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.6_Buses\\vecto_vehicle-primary_heavyBus-sample_Diesel.xml", - "InterimStage": "C:\\Users\\Harry\\source\\repos\\vecto-dev\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.8\\vecto_vehicle-stage_input_full-sample_final_noNG.xml", + "PrimaryVehicle": "..\\..\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.6_Buses\\vecto_vehicle-primary_heavyBus-sample_Diesel.xml", + "InterimStage": "..\\..\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.8\\vecto_vehicle-stage_input_full-sample_final_noNG.xml", "Completed": false } } \ No newline at end of file diff --git a/Vecto3GUI2020Test/TestData/newVifCompletedStage.json b/Vecto3GUI2020Test/TestData/newVifCompletedStage.json index 8d6c8877cc..7e0e1d061a 100644 --- a/Vecto3GUI2020Test/TestData/newVifCompletedStage.json +++ b/Vecto3GUI2020Test/TestData/newVifCompletedStage.json @@ -1,13 +1,13 @@ { "Header": { "CreatedBy": "Harry", - "Date": "2021-08-02T00:00:00+02:00", + "Date": "2021-08-03T00:00:00+02:00", "AppVersion": "Vecto3GUI2020", "FileVersion": 10 }, "Body": { - "PrimaryVehicle": "C:\\Users\\Harry\\source\\repos\\vecto-dev\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.6_Buses\\vecto_vehicle-primary_heavyBus-sample.xml", - "InterimStage": "C:\\Users\\Harry\\source\\repos\\vecto-dev\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.8\\vecto_vehicle-stage_input_full-sample_final.xml", + "PrimaryVehicle": "..\\..\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.6_Buses\\vecto_vehicle-primary_heavyBus-sample.xml", + "InterimStage": "..\\..\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.8\\vecto_vehicle-stage_input_full-sample_final.xml", "Completed": false } } \ No newline at end of file diff --git a/Vecto3GUI2020Test/TestData/newVifExempted.json b/Vecto3GUI2020Test/TestData/newVifExempted.json index b97de228e0..4eb332ae98 100644 --- a/Vecto3GUI2020Test/TestData/newVifExempted.json +++ b/Vecto3GUI2020Test/TestData/newVifExempted.json @@ -1,13 +1,13 @@ { "Header": { "CreatedBy": "Harry", - "Date": "2021-07-28T00:00:00+02:00", + "Date": "2021-08-03T00:00:00+02:00", "AppVersion": "Vecto3GUI2020", "FileVersion": 10 }, "Body": { - "PrimaryVehicle": "C:\\Users\\Harry\\source\\repos\\vecto-dev\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.6_Buses\\exempted_primary_heavyBus.xml", - "InterimStage": "C:\\Users\\Harry\\source\\repos\\vecto-dev\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.8\\vecto_vehicle-exempted_input_full-sample.xml", + "PrimaryVehicle": "..\\..\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.6_Buses\\exempted_primary_heavyBus.xml", + "InterimStage": "..\\..\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.8\\vecto_vehicle-exempted_input_full-sample.xml", "Completed": false } } \ No newline at end of file diff --git a/Vecto3GUI2020Test/TestData/newVifInterimStage.json b/Vecto3GUI2020Test/TestData/newVifInterimStage.json index 7f64bef871..d31e100708 100644 --- a/Vecto3GUI2020Test/TestData/newVifInterimStage.json +++ b/Vecto3GUI2020Test/TestData/newVifInterimStage.json @@ -1,13 +1,13 @@ { "Header": { "CreatedBy": "Harry", - "Date": "2021-07-15T00:00:00+02:00", + "Date": "2021-08-03T00:00:00+02:00", "AppVersion": "Vecto3GUI2020", "FileVersion": 10 }, "Body": { - "PrimaryVehicle": "C:\\Users\\Harry\\source\\repos\\vecto-dev\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.6_Buses\\vecto_vehicle-primary_heavyBus-sample.xml", - "InterimStage": "C:\\Users\\Harry\\source\\repos\\vecto-dev\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.8\\vecto_vehicle-stage_input_full-sample.xml", + "PrimaryVehicle": "..\\..\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.6_Buses\\vecto_vehicle-primary_heavyBus-sample_Diesel.xml", + "InterimStage": "..\\..\\VectoCore\\VectoCoreTest\\TestData\\XML\\XMLReaderDeclaration\\SchemaVersion2.8\\vecto_vehicle-stage_input_full-sample.xml", "Completed": false } } \ No newline at end of file diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs index 6e60303119..2c4b040ad5 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs @@ -1164,7 +1164,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON _primaryVehicleInputDataPath = Body.GetEx<string>(JsonKeys.PrimaryVehicle); + _primaryVehicleInputDataPath = PathHelper.GetAbsolutePath(filename, _primaryVehicleInputDataPath); _stageInputDataPath = Body.GetEx<string>(JsonKeys.InterimStage); + _stageInputDataPath = PathHelper.GetAbsolutePath(filename, _stageInputDataPath); _completed = Body.GetValueOrDefault<bool>(JsonKeys.Completed); } -- GitLab