g0b1vetx-board/Application/simuflow.c
2023-11-30 08:10:01 +08:00

56 lines
885 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "data.h"
#include "math.h"
#include "easyflash.h"
#include "stdlib.h"
// 两点法计算kb
//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);
}