From f48b4c76f14ffdfd21da6933c3d5ad8a381c397d Mon Sep 17 00:00:00 2001 From: NightIsDark <935528249@qq.ocm> Date: Mon, 30 Nov 2020 10:42:17 +0800 Subject: [PATCH] add ignore --- .gitignore | 3 +++ CMakeLists.txt | 9 +++++++++ cal_gate.c | 7 ++++--- cal_gate.h | 6 +----- test | Bin 17416 -> 0 bytes test-hdsmf/test.c | 32 ++++++++++++++++++++++++++++++++ test.c | 32 -------------------------------- 7 files changed, 49 insertions(+), 40 deletions(-) create mode 100644 .gitignore create mode 100644 CMakeLists.txt delete mode 100644 test create mode 100644 test-hdsmf/test.c delete mode 100644 test.c 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 Binary files a/test and /dev/null differ diff --git a/test-hdsmf/test.c b/test-hdsmf/test.c new file mode 100644 index 0000000..6c154d6 --- /dev/null +++ b/test-hdsmf/test.c @@ -0,0 +1,32 @@ +#include +#include +#include +#include "cal_gate.h" + + + +int main() +{ + void *param; + + param=malloc(40); + + *((int*)param)=1; + *((int*)param+1)=0; + *((double*)param+1)=5.0; + *((double*)param+2)=1.2; + *((double*)param+3)=0.1; + *((double*)param+4)=1.2; + + + + printf("For Test\r\n"); + + + printf("ins:%f\r\n",Calculation_of_InstantaneousFlow(param)); + //printf("ins:%f\r\n",Calculation_of_InstantaneousFlow(5,1.2,0.1,1.2,1,0)); + free(param); + return 0; +} + + diff --git a/test.c b/test.c deleted file mode 100644 index 6c154d6..0000000 --- a/test.c +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include -#include -#include "cal_gate.h" - - - -int main() -{ - void *param; - - param=malloc(40); - - *((int*)param)=1; - *((int*)param+1)=0; - *((double*)param+1)=5.0; - *((double*)param+2)=1.2; - *((double*)param+3)=0.1; - *((double*)param+4)=1.2; - - - - printf("For Test\r\n"); - - - printf("ins:%f\r\n",Calculation_of_InstantaneousFlow(param)); - //printf("ins:%f\r\n",Calculation_of_InstantaneousFlow(5,1.2,0.1,1.2,1,0)); - free(param); - return 0; -} - - -- libgit2 0.21.4