208 lines
5.9 KiB
C++
208 lines
5.9 KiB
C++
#ifndef RESULTVIEW_H
|
|
#define RESULTVIEW_H
|
|
/*
|
|
日历查询界面
|
|
*/
|
|
#include <QWidget>
|
|
#include <QLabel>
|
|
#include <QLineEdit>
|
|
#include <QTableWidget>
|
|
#include <QToolButton>
|
|
#include <QEvent>
|
|
#include <QMouseEvent>
|
|
#include <QGraphicsSceneMouseEvent>
|
|
#include <QCalendarWidget>
|
|
#include <QFont>
|
|
#include <QColor>
|
|
#include <QMenu>
|
|
#include <QAction>
|
|
#include <qtimer.h>
|
|
#pragma execution_character_set("utf-8")
|
|
|
|
class RightWindow;
|
|
class MyParamSet;
|
|
class SearchLineEdit;
|
|
class ImageResListView;
|
|
class TimeList;
|
|
class WaitProgressWidget;
|
|
|
|
class ResultView : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
QString currPath;
|
|
QFont m_Font;
|
|
SearchLineEdit* m_search = nullptr;
|
|
ImageResListView* m_resultlist = nullptr;
|
|
RightWindow* m_timelist = nullptr;
|
|
WaitProgressWidget* m_waitwidget = nullptr;
|
|
QString forRefreshDatatime;
|
|
int forRefreshTlabel;
|
|
QTimer timer;
|
|
public:
|
|
explicit ResultView(QWidget* parent = nullptr);
|
|
~ResultView();
|
|
|
|
void initwidget();
|
|
void my_SetFont(const QFont& afont) { m_Font = afont; };
|
|
void setPath(QString path) { currPath = path; initwidget(); }
|
|
|
|
|
|
protected:
|
|
|
|
void mouseMoveEvent(QMouseEvent* event)override;
|
|
|
|
void waitstart(int msec = 60000);
|
|
void waitstop();
|
|
|
|
public slots:
|
|
//加载检测配置参数
|
|
void Load_Param_Config(const QString path);
|
|
|
|
//保存检测配置参数
|
|
void Save_Param_Config(const QString path);
|
|
|
|
signals:
|
|
void LoadSavepath(const QString path);//更新检测图片保存路径
|
|
void mouseRecover();
|
|
void getResultRepot();//生成结果报表
|
|
};
|
|
|
|
class SearchLineEdit :public QWidget {
|
|
Q_OBJECT
|
|
private:
|
|
QString currPath;
|
|
QStringList SavePath; // 图片保存路径
|
|
|
|
QFont m_Font;
|
|
QLineEdit* m_Line_SN_TIME_RESULT = nullptr;//检索 产品SN,时间戳,结果信息
|
|
QToolButton* m_SearchButton = nullptr;//搜索按钮
|
|
|
|
QLabel* m_text = nullptr; // 检索提示
|
|
QColor ok_color = QColor(180, 165, 130);
|
|
QColor ng_color = QColor(202, 120, 83);
|
|
QColor er_color = QColor(233,139,42);
|
|
|
|
QTableWidget* m_result_List = nullptr; //检测数据列表
|
|
QStringList str_resultList; //日期列表数据
|
|
QStringList search_resultList; //检索列表数据
|
|
QStringList stationLists;//单个产品结果文件夹
|
|
QMenu* m_pContextMenu = nullptr;//右键菜单
|
|
QAction* m_pActionCopy = nullptr;//右键拷贝原图
|
|
QAction* m_pActionEsc = nullptr;//取消选中
|
|
|
|
QString search_name = "";//检索名
|
|
QString m_datatime;//当前时间
|
|
int search_start = 0;// 正在检索
|
|
int getResult = 0;// 正在汇总
|
|
int isRuning = 0;
|
|
QString seach_init;
|
|
QString seach_start;
|
|
QString seach_end;
|
|
public:
|
|
explicit SearchLineEdit(QWidget* parent = nullptr);
|
|
~SearchLineEdit();
|
|
|
|
void initwidget();
|
|
void my_SetFont(const QFont& afont) { m_Font = afont; };
|
|
void setPath(QString path) { currPath = path; initwidget(); }// 设置运行相对路径
|
|
void Load_Time_resultlist(const QStringList& resultlist);
|
|
void searchProgram(const QString& resultDir, const QString& Datatime, const int& tim_label);
|
|
void refreshProgram(const QString& resultDir, const QString& Datatime, const int& tim_label);
|
|
void GetCodeResuleInfos(const QStringList names);//对产品缺陷数据进行汇总
|
|
|
|
void ReadCSVInfos(const QString top,const QString station , QMap<QString, int>& resultsMap);
|
|
|
|
void setSavePath(const QStringList& path);//设置检测结果存储路径
|
|
int getSearch();// 获取检索状态
|
|
void stopSearch();//设置检索状态
|
|
void clearList();// 清理列表
|
|
|
|
signals:
|
|
void Send_Search_SN_TIME_RESULT(const QString res);//搜索
|
|
|
|
void waitSearch(bool isok = true);//搜索开始/结束
|
|
|
|
void checkResult(const QString path); //点击产品SN
|
|
|
|
|
|
|
|
|
|
protected:
|
|
void upListShow(const QString res);//更新表格
|
|
bool checkSameData(const QString res);
|
|
void Search_Result_List(const QStringList& searchlist);
|
|
|
|
void GetDataTimeCSV(const QStringList Datatime, const QString day);
|
|
|
|
|
|
public slots:
|
|
|
|
void GetResultRepot();//生成结果报表
|
|
void GetDataTimeList2(const QString Datatime, int tim_label = 24);
|
|
void GetDataTimeList(const QString Datatime, int tim_label = 24);
|
|
void RefreshDataTimeList(const QString Datatime, int tim_label = 24);
|
|
protected:
|
|
void keyReleaseEvent(QKeyEvent* e) override;
|
|
void mouseMoveEvent(QMouseEvent* event)override;
|
|
|
|
};
|
|
|
|
|
|
class TimeList :public QWidget {
|
|
Q_OBJECT
|
|
private:
|
|
QString currPath;
|
|
|
|
QFont m_Font;
|
|
QCalendarWidget* m_cal = nullptr; //日历显示
|
|
QTableWidget* m_result_List = nullptr; //检测数据列表
|
|
QString m_datatime; //检索列表数据
|
|
int time_Label = -1;// 选中时间段
|
|
double OK_arg = 80.00;//判断时段内良率
|
|
QColor ok_color = QColor(180, 165, 130);
|
|
QColor ng_color = QColor(202,120,83);
|
|
|
|
public:
|
|
explicit TimeList(QWidget* parent = nullptr);
|
|
~TimeList();
|
|
QString DataSheetpath = "DataSheet";
|
|
void initwidget();
|
|
void my_SetFont(const QFont& afont) { m_Font = afont; };
|
|
void setPath(QString path) { currPath = path; initwidget(); }
|
|
|
|
private:
|
|
void DataChange();//日历日期选择修改
|
|
|
|
bool GupListData(const QString csvpath);//更新日期检测数据
|
|
|
|
|
|
signals:
|
|
void waitSearch(bool isok = true);//搜索开始/结束
|
|
void searchTimeList(const QString Datatime, int time = 24);//检索时段内结果
|
|
void changeData();//时间改变
|
|
|
|
protected:
|
|
|
|
void mouseMoveEvent(QMouseEvent* event)override;
|
|
|
|
};
|
|
|
|
class RightWindow : public QTabWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit RightWindow(QWidget* parent = nullptr);
|
|
~RightWindow();
|
|
void initwidget();
|
|
TimeList* m_statist; // 统计报表
|
|
private:
|
|
MyParamSet* m_param; // 参数设置
|
|
signals:
|
|
void Loadparam(const QString path);
|
|
void Saveparam(const QString path);
|
|
void Loadruninfo(const QString path);
|
|
void Loadstatist(const QString path);
|
|
|
|
};
|
|
#endif // RESULTVIEW_H
|