修改界面

This commit is contained in:
2024-06-06 16:54:03 +08:00
parent 2381801773
commit 12c4b5562a
14 changed files with 113 additions and 117 deletions
@@ -48,5 +48,12 @@ signals:
void sendPixmapImageWidget(showImgPack*);
void sendInitFinished(int);
void sendInitString(QString);//初始化日志
void addDashBoardData(int index, bool value);//增加一个OK/NG数据到dashboard
void resetDashBoard();//reset dashBoard
void addShowPerformanceWidgetData(int index,int timeCost);
void resetShowPerformanceWidget();
};
#endif
@@ -73,6 +73,7 @@ void triggerManager::reciveCommond()
decodeCameraCMD(readByte);
//workThread->snDatas.checkSnFromWaittingVec(readByte);
}
int ixxx = 0;
void triggerManager::decodeCameraCMD(QByteArray byte)
{
#if debugTesting
@@ -6,20 +6,23 @@
#include <uiModule/uiModule_imageView.h>
#include <uiModule/components/fancyWidget.h>
#include <uiModule/uiModule_summaryDataManager.h>
#include <qlistwidget.h>
class displayWidget :public QWidget
{
public:
QHBoxLayout* Layout;
QGridLayout* Layout;
QLabel* icon, * Title;
QWidget* leftWidget, * rightWidget;
ImageWidgetManager _ImageWidgetManager;
summaryDataManager* _summaryDataManager;
QListWidget* historyImgs = new QListWidget();
//ImageWidget* imgWidget;
displayWidget()
{
this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
this->setMaximumSize(9999, 9999);
Layout = new QHBoxLayout(this);
Layout = new QGridLayout(this);
Layout->setContentsMargins(0, 0, 0, 0);
this->setObjectName("DisplayWidget");
Layout->setAlignment(Qt::AlignLeft);
@@ -27,17 +30,21 @@ public:
leftWidget = new QWidget();
rightWidget = new QWidget();
Layout->addWidget(leftWidget);
Layout->addWidget(rightWidget);
Layout->addWidget(leftWidget, 0, 0);
Layout->addWidget(rightWidget ,0, 1);
Layout->addWidget(historyImgs, 0, 2);
Layout->setColumnStretch(0, 3);
Layout->setColumnStretch(1, 1);
Layout->setColumnStretch(2, 1);
leftItemInit();
rightItemInit();
}
void rightItemInit()
{
summaryDataManager* test = new summaryDataManager();
_summaryDataManager = new summaryDataManager();
QVBoxLayout* hLayout = new QVBoxLayout(rightWidget);
hLayout->addWidget(test->widget);
hLayout->addWidget(_summaryDataManager->widget);
}
void leftItemInit()
{
+1
View File
@@ -20,6 +20,7 @@ void connectSignalAndSlots(MainWindow* front, backEndManager* back)
QObject::connect(back, &backEndManager::sendPixmapImageWidget, front, &MainWindow::recvPixmapImageWidget);
QObject::connect(back, &backEndManager::sendInitString, front, &MainWindow::recvInitString);
QObject::connect(back, &backEndManager::sendInitFinished, front, &MainWindow::recvInitFinished);
QObject::connect(back, &backEndManager::addDashBoardData, front, &MainWindow::addDashBoardData);
QObject::connect(front, &MainWindow::reInitSignal, back, &backEndManager::initialization);
QObject::connect(front->_loadingWidget.retryBtn, &QPushButton::clicked, back, &backEndManager::initialization);
+9
View File
@@ -209,6 +209,15 @@ public slots:
_loadingWidget.initLog->append(strIn);
}
}
void addDashBoardData(int index, bool value)//增加一个OK/NG数据到dashboard
{
//_displayWidget->_summaryDataManager->dashBoardWidgets[index]->setCurrentPercentage(value);
}
//void resetDashBoard();//reset dashBoard
//void addShowPerformanceWidgetData(int index, int timeCost);
//void resetShowPerformanceWidget();
signals:
void reInitSignal();
protected:
@@ -90,7 +90,7 @@ protected:
private:
int currentValue;
double currentValue;
QString Title;
QString showText;
};
@@ -7,18 +7,88 @@
#include <uiModule/components/fancyLogWindow.h>
#include <uiModule/uiModule_switchProduct.h>
#include <FrontendBackendBridge.h>
class dashBoradDataWidget : public QWidget
{
public:
QLabel* OKLabel;
QLabel* NGLabel;
QLabel* totalLabel;
dashBoradDataWidget(QString dataName)
{
QPalette palette;
palette.setColor(QPalette::WindowText, Qt::white);
QFont font("微软雅黑", 14, QFont::Bold);
QHBoxLayout* layout = new QHBoxLayout();
this->setLayout(layout);
QVBoxLayout* vlayout1 = new QVBoxLayout();
QVBoxLayout* vlayout2 = new QVBoxLayout();
layout->addLayout(vlayout1);
layout->addLayout(vlayout2);
DashboardWidget* dashBoard = new DashboardWidget();
vlayout1->addWidget(dashBoard);
vlayout1->setContentsMargins(0, 0, 0, 0);
{
QHBoxLayout* tempLayout = new QHBoxLayout();
QLabel* tempLabel = new QLabel(dataName + u8"OK数量:");
tempLabel->setFont(font);
tempLabel->setPalette(palette);
OKLabel = new QLabel("0");
OKLabel->setFont(font);
OKLabel->setPalette(palette);
tempLayout->addWidget(tempLabel);
tempLayout->addWidget(OKLabel);
vlayout2->addLayout(tempLayout);
}
{
QHBoxLayout* tempLayout = new QHBoxLayout();
QLabel* tempLabel = new QLabel(dataName + u8"NG数量:");
tempLabel->setFont(font);
tempLabel->setPalette(palette);
NGLabel = new QLabel("0");
NGLabel->setFont(font);
NGLabel->setPalette(palette);
tempLayout->addWidget(tempLabel);
tempLayout->addWidget(NGLabel);
vlayout2->addLayout(tempLayout);
}
{
QHBoxLayout* tempLayout = new QHBoxLayout();
QLabel* tempLabel = new QLabel(dataName + u8"总数量:");
tempLabel->setFont(font);
tempLabel->setPalette(palette);
totalLabel = new QLabel("0");
totalLabel->setFont(font);
totalLabel->setPalette(palette);
tempLayout->addWidget(tempLabel);
tempLayout->addWidget(totalLabel);
vlayout2->addLayout(tempLayout);
}
}
void addOk()
{
}
void addNG()
{
}
};
class summaryDataManager
{
public:
fancyWidget* widget;
QLabel* productNameLabel;
QLabel* OKLabel;
QLabel* NGLabel;
QLabel* totalLabel;
QLabel* OKLabel2;
QLabel* NGLabel2;
QLabel* totalLabel2;
std::vector< dashBoradDataWidget*> dashBoardWidgets;
summaryDataManager()
{
QPalette palette;
@@ -33,111 +103,12 @@ public:
QVBoxLayout* layout = new QVBoxLayout();
widget->dataWidget.setLayout(layout);
QHBoxLayout* hLayout1 = new QHBoxLayout();
layout->addLayout(hLayout1);
{
QVBoxLayout* vlayout1 = new QVBoxLayout();
QVBoxLayout* vlayout2 = new QVBoxLayout();
hLayout1->addLayout(vlayout1);
hLayout1->addLayout(vlayout2);
DashboardWidget* dashBoard = new DashboardWidget();
vlayout1->addWidget(dashBoard);
vlayout2->setContentsMargins(0, 0, 0, 0);
{
QHBoxLayout* tempLayout = new QHBoxLayout();
QLabel* tempLabel = new QLabel(u8"测量OK数量:");
tempLabel->setFont(font);
tempLabel->setPalette(palette);
dashBoradDataWidget* _dashBoradDataWidget = new dashBoradDataWidget(u8"测量");
dashBoradDataWidget* _dashBoradDataWidget2 = new dashBoradDataWidget(u8"检测");
layout->addWidget(_dashBoradDataWidget);
layout->addWidget(_dashBoradDataWidget2);
OKLabel = new QLabel("0");
OKLabel->setFont(font);
OKLabel->setPalette(palette);
tempLayout->addWidget(tempLabel);
tempLayout->addWidget(OKLabel);
vlayout2->addLayout(tempLayout);
}
{
QHBoxLayout* tempLayout = new QHBoxLayout();
QLabel* tempLabel = new QLabel(u8"测量NG数量:");
tempLabel->setFont(font);
tempLabel->setPalette(palette);
NGLabel = new QLabel("0");
NGLabel->setFont(font);
NGLabel->setPalette(palette);
tempLayout->addWidget(tempLabel);
tempLayout->addWidget(NGLabel);
vlayout2->addLayout(tempLayout);
}
{
QHBoxLayout* tempLayout = new QHBoxLayout();
QLabel* tempLabel = new QLabel(u8"测量总 数 量:");
tempLabel->setFont(font);
tempLabel->setPalette(palette);
totalLabel = new QLabel("0");
totalLabel->setFont(font);
totalLabel->setPalette(palette);
tempLayout->addWidget(tempLabel);
tempLayout->addWidget(totalLabel);
vlayout2->addLayout(tempLayout);
}
}
QHBoxLayout* hLayout2 = new QHBoxLayout();
layout->addLayout(hLayout2);
{
QVBoxLayout* vlayout1 = new QVBoxLayout();
QVBoxLayout* vlayout2 = new QVBoxLayout();
hLayout2->addLayout(vlayout1);
hLayout2->addLayout(vlayout2);
DashboardWidget* dashBoard = new DashboardWidget();
vlayout1->addWidget(dashBoard);
vlayout2->setContentsMargins(0, 0, 0, 0);
{
QHBoxLayout* tempLayout = new QHBoxLayout();
QLabel* tempLabel = new QLabel(u8"外观OK数量:");
tempLabel->setFont(font);
tempLabel->setPalette(palette);
OKLabel2 = new QLabel("0");
OKLabel2->setFont(font);
OKLabel2->setPalette(palette);
tempLayout->addWidget(tempLabel);
tempLayout->addWidget(OKLabel2);
vlayout2->addLayout(tempLayout);
}
{
QHBoxLayout* tempLayout = new QHBoxLayout();
QLabel* tempLabel = new QLabel(u8"外观NG数量:");
tempLabel->setFont(font);
tempLabel->setPalette(palette);
NGLabel2 = new QLabel("0");
NGLabel2->setFont(font);
NGLabel2->setPalette(palette);
tempLayout->addWidget(tempLabel);
tempLayout->addWidget(NGLabel2);
vlayout2->addLayout(tempLayout);
}
{
QHBoxLayout* tempLayout = new QHBoxLayout();
QLabel* tempLabel = new QLabel(u8"外观总 数 量:");
tempLabel->setFont(font);
tempLabel->setPalette(palette);
totalLabel2 = new QLabel("0");
totalLabel2->setFont(font);
totalLabel2->setPalette(palette);
tempLayout->addWidget(tempLabel);
tempLayout->addWidget(totalLabel2);
vlayout2->addLayout(tempLayout);
}
}
FrequencyBar* progressBar=new FrequencyBar("totalCT");
progressBar->setProgress(0.5);
layout->addWidget(progressBar);
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.