1.重新组织了文件。
2.准备试试把所有元素都读入内存中。 Signed-off-by: facat@lab.com <facat@lab.com>
This commit is contained in:
67
core/transformerparser.h
Normal file
67
core/transformerparser.h
Normal file
@@ -0,0 +1,67 @@
|
||||
#ifndef TRANSFORMERPARSER_H
|
||||
#define TRANSFORMERPARSER_H
|
||||
|
||||
|
||||
/*****************************/
|
||||
/* 这是一个单件(Singlton)类 */
|
||||
/*****************************/
|
||||
#include <QObject>
|
||||
#include <QtCore>
|
||||
#include <QHash>
|
||||
#include <QTextStream>
|
||||
#include <QFile>
|
||||
#include <QStringList>
|
||||
#include <QSharedPointer>
|
||||
class TransformerParser : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
private:
|
||||
//static bool mFileOpened;
|
||||
typedef struct
|
||||
{
|
||||
double A;//有功
|
||||
double B;//有功
|
||||
double C;//有功
|
||||
double RA;//无功
|
||||
double RB;//无功
|
||||
double RC;//无功
|
||||
} ThreePhrasePower;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
double Pk;
|
||||
double Uk;
|
||||
double P0;
|
||||
double I0;
|
||||
} TransRX;
|
||||
static QSharedPointer<QHash<QString,ThreePhrasePower> > msharedPoint;//功率
|
||||
static QSharedPointer<QHash<QString,TransRX> > mTransRXsharedPoint;//阻抗
|
||||
public:
|
||||
static double GetTransformerAPower(const QString &file, const QString &id);
|
||||
static double GetTransformerBPower(const QString &file, const QString &id);
|
||||
static double GetTransformerCPower(const QString &file, const QString &id);
|
||||
static double GetTransformerAReactivePower(const QString &file, const QString &id);
|
||||
static double GetTransformerBReactivePower(const QString &file, const QString &id);
|
||||
static double GetTransformerCReactivePower(const QString &file, const QString &id);
|
||||
static double GetDisTransformerPk(const QString &file, const QString &id);
|
||||
static double GetDisTransformerUk(const QString &file, const QString &id);
|
||||
static double GetDisTransformerP0(const QString &file, const QString &id);
|
||||
static double GetDisTransformerI0(const QString &file, const QString &id);
|
||||
private:
|
||||
explicit TransformerParser(QObject *parent = 0);
|
||||
//static QHash<QString,ThreePhrasePower> *mTransHash;
|
||||
static bool ReadData(const QString &file);
|
||||
static bool ReadRXData(const QString &file);//读阻抗
|
||||
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // TRANSFORMERPARSER_H
|
||||
Reference in New Issue
Block a user