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/iWxResult.h

145 lines
4.0 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 "iWxBase.h"
#include "iResultInfo.h"
#include "ZxTextEdit.h"
#include "mGuiJob_global.h"
class iParameter;
class iGridResultUtils;
namespace Ui {
class iWxResult;
}
class M_GUI_JOB_EXPORT iWxResult : public iWxBase
{
Q_OBJECT
public:
explicit iWxResult(QWidget *parent = 0, \
int nVisibleTabItem = -1);
~iWxResult();
virtual void initSheets(); //Sheet
virtual void initUI();
// 序列化
virtual void onSerialize(ZxSerializer* ser);
virtual void onDeserialize(ZxSerializer* ser);
// 这是显示的数据详细Tab页中的标题
// 而不是iWxResult本身的标题
void setTitle(QString s);
public:
// 返回TextEdit指针
QTextEdit* getTbxSimle();
QTextEdit* getTbxAll();
QTextEdit* getTbxTemp();
// 传入数据
void freshResults(QVector<iResultInfo>& vecResults);
//ZXF20240625 模型参数更新
void freshParams(QVector<iResultInfo>& vecResults);
// 追加式传入数据放在Temp的Tab页
void freshResult_t(QStringList listInfo, bool bWarning = false);
void clearResult_t();
// _o oneTab版
void freshResults_o(QVector<iResultInfo>& vecResults);
void clearResult_o();
// 结果对比调用,非常复杂
void freshResults_ResCp(QStringList& listTags,
QVector <QVector<iResultInfo> >& vvecInfosM,
QVector <QVector<iResultInfo> >& vvecInfosP,
QVector <QVector<iResultInfo> >& vvecInfosC);
// 填表
void _fillTableWith(QTextTable *pTableWx, \
QVector <QVector<iResultInfo> >* pVVec, \
bool bChart);
QString _getRandomType(QVector <QVector<iResultInfo> >* pVVec);
// 显示隐藏Tab
void setTabItemVisible(int n, bool bVisible);
private slots:
void slotCustomMenu(QMenu* pMenu);
private:
// 传入数据,刷新
// _g grid版新版
// _s 简易版
// _c详细版
void freshResults_g(QVector<iResultInfo>& vecResults);
void freshResults_s(QVector<iResultInfo>& vecResults);
void freshResults_c(QVector<iResultInfo>& vecResults);
// 解析得到类别
QStringList parseTypes(QVector<iResultInfo> & vec, bool bSimpleMode = false);
// 新的方式(只针对GridResult模式
void initSubUI_g();
void resetRstObjs_g();
void resetRstInfos_g();
void cacheRstInfos_g(QVector<iResultInfo>& vecResults);
void adjustRstInfos_g(QStringList listTypes);
QStringList parseTypes_g();
void fresh2RstUtils_g();
// 显示相关
void displayText(QTextCursor& cursor,
QString s,
Qt::AlignmentFlag oAln = Qt::AlignHCenter,
bool bBold = false,
bool bReturn = true,
bool bWarning = false);
QTextTable* createTableWithHeaders(QTextCursor& cursor, \
QStringList listTitles, \
bool bSimpleMode = false);
void displayTableHeaders(QTextTable* &pTableWx, \
QStringList listTitles);
// n = 0: s 1:c 2:o
void displayOneRow(QTextTable* &pTableWx, \
iResultInfo o, \
int n = 0);
protected:
virtual void paintEvent(QPaintEvent *);
private slots:
// 打印
void slotPrintResult_s();
void slotPrintResult_c();
void slotPrintResult_t();
void _printResultsOf(QTextEdit* p);
private:
Ui::iWxResult *ui;
// 这是显示的数据详细Tab页中的标题
// 而不是iWxResult本身的标题
QString m_sResTitle;
// 这是对Tab显示与隐藏的控制
// >0时仅仅显示特定的Tab页
// <0时所有
// 默认-1所有
int m_nVisibleTabItem;
// 这是新的方式TODO需要增加序列化处理
QVector<iParameter*> m_vecAllObjs;//需要析构
QVector<iResultInfo*> m_vecGridRstInfos;
iGridResultUtils* m_pGridRstUtils;
QVBoxLayout* m_pGridRstLayout;
};