You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWATI/Include/mTool/mToolPvt/iWxPvtComposition.h

121 lines
2.9 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include "iWxPvtBase.h"
//#include "mToolPvt_global.h"
class ZxTableModel;
class iXmlTable;
class iXmlField;
class CompSubItem;
class M_TOOL_PVT_EXPORT iWxPvtComposition : public iWxPvtBase
{
Q_OBJECT
public:
explicit iWxPvtComposition(bool bExt = false, QWidget *parent = 0);
~iWxPvtComposition();
virtual void initUI();
void setMapParas(QMap<QString, float>& map);
static float getCompSubDefault(QString sTag, int whichOne = 0);
// 文件标识
virtual QString getFilePvtTag();
public:
// 从各个Wxm_vecWxDatas中遍历查找
virtual bool setParaValue(QString sPara, double d);
virtual bool getParaValue(QString sPara, float& f);
// 返回所有参数Key为英文ID
virtual bool getAllParaValues(QMap<QString, double>& map,
bool bOnlyFitted = false,
bool bClearMap = true);
virtual void onSerialize(ZxSerializer* ser);
virtual void onDeserialize(ZxSerializer* ser);
public slots:
// 组分范围判断
void slotTextInputValueChanged(const QString &);
// 校验组分是否100
void slotVerifyCompo100();
// 归一C1
void slotVerifyDown();
//同比例缩小
void slotVerifyUp();
// 组分校验颜色
void changeMarkClr(bool bByNormalC1 = false);
// 是否满足组分100
bool isCompo100(float error = 0);
// 最后对结果的验证,并弹出对话框
// bool runFinalCheckWithTips();
void slotApply();
void slotClose();
signals:
void sigTcPcChanged(QMap<QString, float>& );
private:
void initUI_Sub(QGridLayout* pGridLayout, int iLayout, iXmlField *pField, int nCount); //组分
void initOutputUI_Sub(QVBoxLayout*& pMainLayout);//组分界面
void initOutputUI_Btn(QVBoxLayout*& pMainLayout);//组分界面
// 组分内容检测(仅仅是范围)
bool checkTextValueScale(QLineEdit* pSender = NULL);
// 组分综合是否100
bool checkTextCompo100s(float &fSum, QLineEdit* pSender = NULL);
// 综合调用
bool verifyInputOfComp(QLineEdit* pSender = NULL);
protected:
virtual void paintEvent(QPaintEvent *);
private:
iXmlTable* m_pXmlDefine;
// 组分相关
bool m_bMergeMode; //是否合并模式,组分
QCheckBox* m_pCbxAuto;
QCheckBox* m_pCbxLess100;
QLabel* m_pLabelClr;
QLineEdit* m_pSumCompo;
bool m_bNormalingC1;
float m_fSum;
QPushButton* m_pBtnDown;
QPushButton* m_pBtnUp;
QMap<QString, float> m_mapComps;
int m_nDigit;
bool m_bExtMode; //应用于组分三区拟压力的输入比普通的要多4项
};
//组分 fraction 临界压力MPa 临界温度(℃)
class M_TOOL_PVT_EXPORT CompSubItem
{
public:
CompSubItem();
CompSubItem(QString s, double d1, double d2, double d3);
static CompSubItem* getDefaultOf(QString s);
public:
QString m_sTag;
float m_fFraction; //0-1之间
float m_fPc;
float m_fTc;
};