56 lines
885 B
C
56 lines
885 B
C
#include "data.h"
|
||
#include "math.h"
|
||
#include "easyflash.h"
|
||
#include "stdlib.h"
|
||
|
||
// 两点法计算k,b
|
||
//uint16_t math_k(uint32_t x0,uint32_t y0,uint32_t x1,uint32_t y1)
|
||
//{
|
||
// uint16_t k;
|
||
// k = (y0-x0)/(y1-x1);
|
||
// return k;
|
||
//}
|
||
|
||
//uint16_t math_k(uint32_t x0,uint32_t y0,uint32_t x1,uint32_t y1)
|
||
//{
|
||
// uint16_t k;
|
||
// k = (y0-x0)/(y1-x1);
|
||
// return k;
|
||
//}
|
||
|
||
//WaterLeveInfo_t Info = {
|
||
// .Y[0] = 2,
|
||
//};
|
||
|
||
|
||
// 水位流量关系表
|
||
//uint16_t WaterLeveCalc(int leve,int Open)
|
||
//{
|
||
// for (int i =0;i< 100;i++)
|
||
// {
|
||
// if (LeveInfo.X[i] > Open)
|
||
// {
|
||
// for (int j =0;j < 100;i++)
|
||
// {
|
||
// if (LeveInfo.Key[i].Y[j] >leve)
|
||
// {
|
||
// return LeveInfo.Key[i].Key[j];
|
||
// }
|
||
// }
|
||
// }
|
||
// }
|
||
// return 0;
|
||
//}
|
||
|
||
|
||
|
||
int32_t ParShallCalc(int index,double leve)
|
||
{
|
||
char * p;
|
||
double flow = 0;
|
||
flow = ParShallTale[index].c * pow(leve,ParShallTale[index].m);
|
||
return (int32_t )(flow *100);
|
||
}
|
||
|
||
|