Skip to content
Snippets Groups Projects
Commit 8b5f4585 authored by Karsten Rink's avatar Karsten Rink
Browse files

first test example

parent 0e284ee7
No related branches found
No related tags found
No related merge requests found
...@@ -15,4 +15,6 @@ else() ...@@ -15,4 +15,6 @@ else()
add_subdirectory(ModelPreparation/PartitionMesh) add_subdirectory(ModelPreparation/PartitionMesh)
endif() # OGS_BUILD_GUI endif() # OGS_BUILD_GUI
include(Tests.cmake) if(OGS_BUILD_SWMM)
add_subdirectory(SWMMConverter)
endif()
add_executable(SWMMInterface SWMMInterface.cpp)
target_link_libraries(SWMMInterface
MeshLib
swmm5interface
)
ADD_VTK_DEPENDENCY(SWMMInterface)
set_target_properties(SWMMInterface PROPERTIES FOLDER Utilities)
#include <string>
#include <iostream>
#include "ThirdParty/SWMMInterface/swmm5_iface.h"
int main(int argc, char *argv[])
{
// Open outfile as a SWMM output file
std::string outfile = argv[1];
int r = OpenSwmmOutFile(const_cast<char*>(outfile.c_str()));
if (r == 1)
{
printf("\nInvalid results in SWMM output file.\n");
}
else if (r == 2)
{
printf("\nFile is not a SWMM output file.\n");
}
else
{
printf("\nTime Total Total Total");
printf("\nPeriod Rainfall Runoff Outflow");
printf("\n====================================");
for (int i=1; i<=SWMM_Nperiods; i++)
{
float x, y, z;
GetSwmmResult(3, 0, 1, i, &x);
GetSwmmResult(3, 0, 4, i, &y);
GetSwmmResult(3, 0, 11, i, &z);
printf("\n%6d %8.2f %8.2f %8.2f", i, x, y, z);
}
CloseSwmmOutFile();
}
return 0;
}
\ No newline at end of file
...@@ -50,3 +50,8 @@ if(NOT TARGET vtkGUISupportQt AND OGS_BUILD_GUI) ...@@ -50,3 +50,8 @@ if(NOT TARGET vtkGUISupportQt AND OGS_BUILD_GUI)
include_directories(SYSTEM ${VTK_INCLUDE_DIRS}) include_directories(SYSTEM ${VTK_INCLUDE_DIRS})
add_subdirectory(${CMAKE_SOURCE_DIR}/ThirdParty/vtkGUISupportQt) add_subdirectory(${CMAKE_SOURCE_DIR}/ThirdParty/vtkGUISupportQt)
endif() endif()
if(OGS_BUILD_SWMM)
add_subdirectory(${CMAKE_SOURCE_DIR}/ThirdParty/SWMMInterface/swmm5)
add_subdirectory(${CMAKE_SOURCE_DIR}/ThirdParty/SWMMInterface)
endif()
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