Skip to content
Snippets Groups Projects
Verified Commit 17ebb6cd authored by Mohcine Chraibi's avatar Mohcine Chraibi
Browse files

fix xml parsing for trajectories

- CHanges in cmakefile, because it does not compile for me otherwise.
parent b3fef7b6
No related branches found
No related tags found
2 merge requests!15Resolve "Method D | IndividualFD file use wrong PersID",!14Resolve "Method I | new measurement method"
Pipeline #17183 failed
...@@ -312,14 +312,14 @@ endif() ...@@ -312,14 +312,14 @@ endif()
#message (STATUS "PSAPI: ${PSAPI}") #message (STATUS "PSAPI: ${PSAPI}")
#endif() #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 17)
set_property(TARGET geometrycore PROPERTY CXX_STANDARD_REQUIRED ON) set_property(TARGET geometrycore PROPERTY CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
target_link_libraries(geometrycore stdc++fs) target_link_libraries(geometrycore stdc++fs)
add_executable( add_executable(
jpsreport main.cpp ${methods} jpsreport main.cpp
) )
set_property(TARGET jpsreport PROPERTY CXX_STANDARD 17) set_property(TARGET jpsreport PROPERTY CXX_STANDARD 17)
......
...@@ -67,8 +67,8 @@ bool PedData::ReadData(const fs::path& projectRootDir, const fs::path&outputLoca ...@@ -67,8 +67,8 @@ bool PedData::ReadData(const fs::path& projectRootDir, const fs::path&outputLoca
return false; return false;
} }
TiXmlElement* xRootNode = docGeo.RootElement(); TiXmlElement* xRootNode = docGeo.RootElement();
fs::path filename(xRootNode->ValueStr()); result=InitializeVariables(xRootNode); //initialize some global
result=InitializeVariables(filename); //initialize some global variables //variables using xml format
} }
else if(trajformat == FORMAT_PLAIN) else if(trajformat == FORMAT_PLAIN)
...@@ -92,7 +92,7 @@ bool PedData::InitializeVariables(const fs::path& filename) ...@@ -92,7 +92,7 @@ bool PedData::InitializeVariables(const fs::path& filename)
fdata.open(filename.string()); fdata.open(filename.string());
if (fdata.is_open() == false) 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; return false;
} }
else else
...@@ -340,15 +340,15 @@ bool PedData::InitializeVariables(const fs::path& filename) ...@@ -340,15 +340,15 @@ bool PedData::InitializeVariables(const fs::path& filename)
return true; return true;
} }
// initialize the global variables variables // initialize the global variables. xml format
bool PedData::InitializeVariables(TiXmlElement* xRootNode) bool PedData::InitializeVariables(TiXmlElement* xRootNode)
{ {
if( ! xRootNode ) { if( ! xRootNode ) {
Log->Write("ERROR:\tRoot element does not exist"); Log->Write("ERROR:\tPedData::InitializeVariables: Root element does not exist");
return false; return false;
} }
if( xRootNode->ValueStr () != "trajectories" ) { 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; return false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment