1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// driver_VenturiSpiroquantH .h

#ifndef _DRIVER_VENTURISPIROQUANTH _h
#define _DRIVER_VENTURISPIROQUANTH _h
typedef enum { VENTURI_CUSTOM, SpiroquantH_R122P04, ALPE_1551} t_VenturiSensorModel;

class VenturiFlowMeter
{
public:
	void Init(t_VenturiSensorModel model);
	float GetFlow(float pressure, float temperature);
	bool setLowpass(float lowpass);
	float GetIntegral();
	void ResetIntegral();
	bool VenturiSetCoefficient(int index, float value);

private:
	float SpiroquantH_R122P04_Convert(float pressure);
	float ALPE_1551_Convert(float pressure);
	float VenturiCustom_Convert(float pressure);
	float VenturiFlux=0;
	float _LowPass;
	float Integral=0;
	float CustomCoefficients[5];
	t_VenturiSensorModel _model;
};


#endif



//                  #     # ### 
//                  ##    #  #  
//                  # #   #  #  
//                  #  #  #  #  
//                  #   # #  #  
//                  #    ##  #  
//                  #     # ### 
//
// Nuclear Instruments 2020 - All rights reserved
// Any commercial use of this code is forbidden
// Contact info@nuclearinstruments.eu