From 17ebb6cd85e47f9faa09c5edd6a0a502972d9f60 Mon Sep 17 00:00:00 2001
From: Mohcine Chraibi <m.chraibi@fz-juelich.de>
Date: Tue, 19 Feb 2019 14:47:55 +0100
Subject: [PATCH] fix xml parsing for trajectories

- CHanges in cmakefile, because it does not compile for me otherwise.
---
 CMakeLists.txt      |  4 ++--
 methods/PedData.cpp | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f6ce515..60c392aa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -312,14 +312,14 @@ endif()
 #message (STATUS "PSAPI: ${PSAPI}")
 #endif()
 
-add_library ( geometrycore STATIC ${source_files} )
+add_library ( geometrycore SHARED ${source_files}  ${methods})
 set_property(TARGET geometrycore PROPERTY CXX_STANDARD 17)
 set_property(TARGET geometrycore PROPERTY CXX_STANDARD_REQUIRED ON)
 set(CMAKE_CXX_EXTENSIONS OFF)
 target_link_libraries(geometrycore  stdc++fs)
 
 add_executable(
-        jpsreport main.cpp ${methods}
+        jpsreport main.cpp
 )
 
 set_property(TARGET jpsreport PROPERTY CXX_STANDARD 17)
diff --git a/methods/PedData.cpp b/methods/PedData.cpp
index 08d4d47e..3e2e6544 100644
--- a/methods/PedData.cpp
+++ b/methods/PedData.cpp
@@ -67,8 +67,8 @@ bool PedData::ReadData(const fs::path& projectRootDir, const fs::path&outputLoca
                return false;
           }
           TiXmlElement* xRootNode = docGeo.RootElement();
-          fs::path filename(xRootNode->ValueStr());
-          result=InitializeVariables(filename);	//initialize some global variables
+          result=InitializeVariables(xRootNode);	//initialize some global
+                                                        //variables using xml format
      }
 
      else if(trajformat == FORMAT_PLAIN)
@@ -92,7 +92,7 @@ bool PedData::InitializeVariables(const fs::path& filename)
      fdata.open(filename.string());
      if (fdata.is_open() == false)
      {
-           Log->Write("ERROR: \t could not parse the trajectories file <%s>",filename.string().c_str());
+           Log->Write("ERROR: \t could not open the trajectories file <%s>",filename.string().c_str());
           return false;
      }
      else
@@ -340,15 +340,15 @@ bool PedData::InitializeVariables(const fs::path& filename)
      return true;
 }
 
-// initialize the global variables variables
+// initialize the global variables. xml format
 bool PedData::InitializeVariables(TiXmlElement* xRootNode)
 {
      if( ! xRootNode ) {
-          Log->Write("ERROR:\tRoot element does not exist");
+          Log->Write("ERROR:\tPedData::InitializeVariables: Root element does not exist");
           return false;
      }
      if( xRootNode->ValueStr () != "trajectories" ) {
-          Log->Write("ERROR:\tRoot element value is not 'trajectories'.");
+          Log->Write("ERROR:\tPedData::InitializeVariables. Root element value is not 'trajectories'.");
           return false;
      }
 
-- 
GitLab