calib_piecewise_linear.h 652 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * @brief 线性插值计算电容值对应的油水比例(%)
  3. * @param cap 输入的电容值(单位:pF)
  4. * @return 油水比例百分比(范围:0.0f ~ 100.0f)
  5. */
  6. #ifndef __CALIB_PIECEWISE_LINEAR_H
  7. #define __CALIB_PIECEWISE_LINEAR_H
  8. #include <stdint.h>
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. typedef enum {
  13. OIL_DIESEL, // 柴油
  14. OIL_92, // 92# 汽油
  15. OIL_95, // 95# 汽油
  16. OIL_98 // 98# 汽油
  17. } OilType;
  18. extern OilType g_oil_type;
  19. void Load_Default_CalibPoints(void);
  20. float Estimate_Percentage_piecewise(float cap);
  21. #ifdef __cplusplus
  22. }
  23. #endif
  24. #endif // __CALIB_PIECEWISE_LINEAR_H