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/mGui/mGuiJob/iWxBase.h

99 lines
3.1 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 "iDlgBase.h"
#include "mGuiJob_global.h"
#include "iResultInfo.h"
class iParaItemCtrl;
class ZxDataWell;
//class iResultInfo;
class M_GUI_JOB_EXPORT iWxBase : public iDlgBase
{
Q_OBJECT
public:
explicit iWxBase(QWidget *parent = 0);
~iWxBase();
public:
// 初始化
virtual void initUI();
virtual void setDataWell(ZxDataWell* p);
virtual QVector<iParaItemCtrl*>* getVecParaCtrls();
// 组织结果数据,注vec不进行clear由调用方自行clear
virtual bool organizeResults(QVector<iResultInfo>& vec, QString sType);
virtual bool organizeResultsEx(QStringList& listTags,
QStringList& listValues,
QString sType,
bool bClear = false);
// 与序列化关联
virtual bool saveAsByteArr(QByteArray& v);
virtual bool loadFromByteArr(QByteArray& v);
public:
// 建立某参数的Layout考虑单位控件
virtual iParaItemCtrl* createParaCtrl(QString sPara,
bool bUnitEditable = true,
bool bShowScale = false,
bool bStrench = true,
VecInt* pVecStrenchRatios = NULL,
int nSpacing = 4,
int nMarginL = 20,
int nMarginR = 20);
// 在pCtrl InitUI之前允许部分调整如参数跟着模型走的调整
//virtual void adjustParaInfos(iParameter* pParameter);
// 从各个Wxm_vecWxDatas中遍历查找
virtual bool setParaValue(QString sPara, double d);
virtual bool getParaValue(QString sPara, double& d);
// 返回所有参数Key为英文ID
virtual bool getAllParaValues(QMap<QString, double>& map,
bool bOnlyFitted = false,
bool bClearMap = true);
virtual bool getAllParaValuesUnit(QMap<QString, QString>& map,
bool bOnlyFitted = false,
bool bClearMap = true);
signals:
// 当参数改变时触发,通知后续窗体
void sigParasChanged(QMap<QString, QVariant>& map);
// 返回Jog标识
void sigGetJogTag(QString& s);
public slots:
virtual void slotGetJobTag(QString& s) { Q_UNUSED(s); }
// 当前面窗体参数改变时,本窗体响应
virtual void slotParasObtained(QMap<QString, QVariant>& map);
// 响应ParaCtrl数据的改变
virtual void slotParaCtrlValueChanged(QString sPara, QVariant o);
protected:
virtual void paintEvent(QPaintEvent *);
// 绘制Log
virtual void drawLogInfo(QPainter* painter);
// 从当前井获取该参数的数值
bool getValueFromCurWell(QString sPara, QVariant& o);
protected:
// 对于单位类的控件进行管理
QVector<iParaItemCtrl*> m_vecParaCtrls;
// 当前井
ZxDataWell* m_pDataWell;
// 默认的存储路径,外部传递过来
//QString m_sJobTag;
};