You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
717 B
47 lines
717 B
3 months ago
|
#ifndef _UINT_H_
|
||
|
#define _UINT_H_
|
||
|
|
||
|
|
||
|
#include <stdint.h>
|
||
|
#include<iostream>
|
||
|
using namespace std;
|
||
|
|
||
|
//频率偏移量
|
||
|
#define FRE_BASE 30.0
|
||
|
#define FRE_UNIT 0.0005
|
||
|
|
||
|
//EAU电压单位
|
||
|
#define EAU_VOL_UNIT 0.002
|
||
|
|
||
|
//EAU频率单位
|
||
|
//#define EAU_POW_UNIT 0.02
|
||
|
#define EAU_POW_UNIT 0.05
|
||
|
|
||
|
//FRE_BASE / FRE_UNIT
|
||
|
#define FRE_OFFSET 60000.0
|
||
|
|
||
|
|
||
|
#define C_10KV 10000.0
|
||
|
#define C_KV 1000.0
|
||
|
#define C_KW 1000.0
|
||
|
|
||
|
class Unit {
|
||
|
public:
|
||
|
Unit(int pt, int ct);
|
||
|
~Unit();
|
||
|
|
||
|
float getVoltage(uint16_t v, float cof);
|
||
|
float getFrequency(uint16_t v);
|
||
|
// float getPower(int16_t v, float cof);
|
||
|
float getPower(int16_t v, float cof, bool isPositive);
|
||
|
|
||
|
|
||
|
private:
|
||
|
int mpt;
|
||
|
int mct;
|
||
|
int mptct;
|
||
|
};
|
||
|
|
||
|
|
||
|
|
||
|
#endif
|