diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e5b80f0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +CMakeLists.txt + + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9acc0fc --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,9 @@ +foreach(incdir ${APP_INCDIRS}) + include_directories(${incdir}) +endforeach() + +aux_source_directory(. DIR_SRCS) +add_library(Stage-Discharge-Relation ${CMAKE_LIB_TYPE} ${DIR_SRCS}) + +#add_subdirectory("test-hdsmf") + diff --git a/cal_gate.c b/cal_gate.c index c67e360..4597247 100644 --- a/cal_gate.c +++ b/cal_gate.c @@ -471,14 +471,14 @@ double Calculation_of_InstantaneousFlow(double openning_height_of_gate, double w //double openning_height_of_gate, double water_depth_front_of_gate,double water_depth_behind_of_gate,double gate_width,int wingwall,int drop_step -double Calculation_of_InstantaneousFlow(struct param_gate *param) +int Calculation_of_InstantaneousFlow(double *value,struct param_gate *param) { patterns_of_water get_pattern; double temp; if(data_validity_check(param)!=0) - return 0; + return -1; get_pattern = discrimination_of_flow_pattern(param->openning_height_of_gate,param->water_depth_front_of_gate,param->water_depth_behind_of_gate,param->drop_step); switch(get_pattern){ @@ -511,7 +511,8 @@ double Calculation_of_InstantaneousFlow(struct param_gate *param) param->openning_height_of_gate,param->gate_width,param->wingwall,param->drop_step); break; } - return temp; + *value = temp; + return 0; } diff --git a/cal_gate.h b/cal_gate.h index 75d310b..1b579c8 100644 --- a/cal_gate.h +++ b/cal_gate.h @@ -12,10 +12,6 @@ struct param_gate{ double gate_width; }; - -//double Calculation_of_InstantaneousFlow(double openning_height_of_gate, double water_depth_front_of_gate,double water_depth_behind_of_gate,double gate_width,int wingwall,int drop_step); -double Calculation_of_InstantaneousFlow(struct param_gate *param); - - +int Calculation_of_InstantaneousFlow(double * value,struct param_gate *param); #endif diff --git a/test b/test deleted file mode 100644 index 60d6a6b..0000000 --- a/test +++ /dev/null diff --git a/test.c b/test-hdsmf/test.c index 6c154d6..6c154d6 100644 --- a/test.c +++ b/test-hdsmf/test.c