107 lines
2.4 KiB
C++
107 lines
2.4 KiB
C++
#ifndef CHART_H
|
|||
|
|
#define CHART_H
|
||
|
|
|
||
|
|
#include <iostream>
|
||
|
|
#include <istream>
|
||
|
|
#include <fstream>
|
||
|
|
#include <sstream>
|
||
|
|
#include <QString>
|
||
|
|
//#include <qstring.h>
|
||
|
|
#include <QTextCodec>
|
||
|
|
#include <QFile>
|
||
|
|
#include <QDir>
|
||
|
|
#include <QDebug>
|
||
|
|
#include <QVector>
|
||
|
|
#include <QMenu>
|
||
|
|
#include <QDesktopWidget>
|
||
|
|
#include <QFont>
|
||
|
|
#include "iconhelper.h"
|
||
|
|
#include "qcustomplot.h"
|
||
|
|
#include <QDesktopWidget>
|
||
|
|
#include <QWidget>
|
||
|
|
#include <QTimer>
|
||
|
|
#include <QApplication>
|
||
|
|
#include <QGridLayout>
|
||
|
|
#include <QThread>
|
||
|
|
#include <QCalendarWidget>
|
||
|
|
#include <QTableView>
|
||
|
|
#include <QStandardItemModel>
|
||
|
|
#include <QStandardItem>
|
||
|
|
#include <QHeaderView>
|
||
|
|
#include <windows.h>
|
||
|
|
|
||
|
|
struct SN_NG {
|
||
|
|
QMap<QString, QString> SN_NG_Rang;//二维码 缺陷
|
||
|
|
//QMap<QString,QMap<QString,QMap<QString,QMap<QString,>>>>
|
||
|
|
QMap<QString, int> SN_NG_Num;//缺陷 数量
|
||
|
|
};
|
||
|
|
|
||
|
|
struct SN_NG_HOUR {
|
||
|
|
QMap<QString, QVector<QString>> SN_NG_Hour;//时间 缺陷
|
||
|
|
QMap<QString, int> SN_NG_Num;//缺陷 数量
|
||
|
|
QMap<QString, QColor> NG_Color;//缺陷 对应的颜色
|
||
|
|
QMap<QString, bool>NG_Color_Flag;//缺陷 颜色标志位
|
||
|
|
};
|
||
|
|
|
||
|
|
class chart : public QWidget
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
|
||
|
|
public:
|
||
|
|
explicit chart();
|
||
|
|
~chart();
|
||
|
|
|
||
|
|
//void Read_Csv();
|
||
|
|
void clear_all();
|
||
|
|
void cartogram();
|
||
|
|
void Cal_start(int flag, QString Str_Time);
|
||
|
|
bool same_NG(QString& NG);
|
||
|
|
void show_NG_Num(int& all, QString Str_Time);
|
||
|
|
void show_NG_Top_Three(int& all, QString Str_Time);
|
||
|
|
//void show_NG_Top_Ten(int& all);
|
||
|
|
bool copyFile(QString srcPath, QString dstPath, bool coverFileIfExist);
|
||
|
|
void plot(QString Str_Time);
|
||
|
|
void Creat_label();
|
||
|
|
void show_NG_csv();
|
||
|
|
void type_table(QString Str_Time);
|
||
|
|
|
||
|
|
template<class T>
|
||
|
|
void Data_Exchange(T& a, T& b);
|
||
|
|
|
||
|
|
private:
|
||
|
|
QString gb2312ToGB18030(const char* strUtf8);
|
||
|
|
QString gb2312ToUtf8(const QString strUtf8);
|
||
|
|
|
||
|
|
SN_NG Cal_NG_Num;
|
||
|
|
SN_NG_HOUR Cal_NG_Hour;
|
||
|
|
QString file_path;
|
||
|
|
QString file_name;
|
||
|
|
QMap<QString, bool>NG_Same_Flag;
|
||
|
|
QVector<QString> read_All;
|
||
|
|
|
||
|
|
QTableView* maintable;
|
||
|
|
QStandardItemModel* table_model;
|
||
|
|
|
||
|
|
int max_time;
|
||
|
|
int r_flag;
|
||
|
|
int g_flag;
|
||
|
|
int b_flag;
|
||
|
|
|
||
|
|
int All_SN;
|
||
|
|
int OK_SN;
|
||
|
|
int NG_SN;
|
||
|
|
int all;
|
||
|
|
int month_day_NG;
|
||
|
|
int month_night_NG;
|
||
|
|
|
||
|
|
QString name_first_null;
|
||
|
|
QString name_second_null;
|
||
|
|
QString name_third_null;
|
||
|
|
QGridLayout* MainWidgetLayout;
|
||
|
|
QWidget* MainWidget;
|
||
|
|
//QMenu* m_pContextMenu = nullptr;//右键菜单
|
||
|
|
//QAction* m_pActionCopy = nullptr;//右键拷贝原图
|
||
|
|
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif
|