#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& map); static double getCompSubDefault(QString sTag, int whichOne = 0); // 文件标识 virtual QString getFilePvtTag(); public: // 从各个Wx(m_vecWxDatas)中遍历查找 virtual bool setParaValue(QString sPara, double d); virtual bool getParaValue(QString sPara, double& f); // 返回所有参数,Key为英文ID virtual bool getAllParaValues(QMap& 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(double error = 0); // 最后对结果的验证,并弹出对话框 // bool runFinalCheckWithTips(); void slotApply(); void slotClose(); signals: void sigTcPcChanged(QMap& ); 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(double &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; double m_fSum; QPushButton* m_pBtnDown; QPushButton* m_pBtnUp; QMap 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; double m_fFraction; //0-1之间 double m_fPc; double m_fTc; };