|
@@ -7,6 +7,7 @@
|
|
|
#include <QScrollBar>
|
|
|
#include <QDoubleValidator>
|
|
|
#include "CameraDistribute.h"
|
|
|
+#include "Src/common/JMessageTip.h"
|
|
|
|
|
|
|
|
|
MainAndSecondaryCamerasWnd::MainAndSecondaryCamerasWnd(QWidget *parent)
|
|
@@ -25,6 +26,9 @@ MainAndSecondaryCamerasWnd::MainAndSecondaryCamerasWnd(QWidget *parent)
|
|
|
lastLastGroupId = settings.value("LastLastGroupId", 0).toInt();
|
|
|
settings.endGroup();
|
|
|
|
|
|
+
|
|
|
+ ui->control_r->HideOrShowPage(false);
|
|
|
+ ui->control_L->HideOrShowPage(false);
|
|
|
//initFrom();
|
|
|
qApp->installEventFilter(this);
|
|
|
}
|
|
@@ -88,64 +92,82 @@ void MainAndSecondaryCamerasWnd::InitPage()
|
|
|
mainLayout->setSpacing(28);
|
|
|
mainLayout->setMargin(0);
|
|
|
|
|
|
- int nSize = 5;
|
|
|
+ int nSize = 0;
|
|
|
if (m_pMainCameraBind != nullptr)
|
|
|
{
|
|
|
nSize = m_pMainCameraBind->m_vecCamera.size();
|
|
|
-
|
|
|
if (nSize == 0) // 针对获取不到的情况
|
|
|
{
|
|
|
- nSize = 5;
|
|
|
+ //nSize = 5;
|
|
|
+ JMessageTip::Message_warning("a");
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- QList<int> numbers;
|
|
|
- for (int i = 1; i <= nSize; i++)
|
|
|
- {
|
|
|
- numbers.push_back(i);
|
|
|
- }
|
|
|
-
|
|
|
- for (int i = 0; i < numbers.size(); ++i)
|
|
|
- {
|
|
|
- int num = numbers[i];
|
|
|
- CameraImageHandler* manager = new CameraImageHandler(num);
|
|
|
- Group* widget = manager->getGroup();
|
|
|
- CameraConnectUpdateImageFun(i, widget);
|
|
|
-
|
|
|
- if (widget != nullptr)
|
|
|
+ QList<int> numbers;
|
|
|
+ for (int i = 1; i <= nSize; i++)
|
|
|
{
|
|
|
- mainLayout->addWidget(widget);
|
|
|
- m_currentSelectGroup.liGroup.append(widget);
|
|
|
+ numbers.push_back(i);
|
|
|
}
|
|
|
- if (manager->getWafer())
|
|
|
+
|
|
|
+ for (int i = 0; i < numbers.size(); ++i)
|
|
|
{
|
|
|
- waferMap.insert(num, manager->getWafer());
|
|
|
- }
|
|
|
- if (manager->getWafer()) {
|
|
|
- waffleMap.insert(num, manager->getWaffle());
|
|
|
+ int num = numbers[i];
|
|
|
+ CameraImageHandler* manager = new CameraImageHandler(num);
|
|
|
+ Group* widget = manager->getGroup();
|
|
|
+ CameraConnectUpdateImageFun(i, widget);
|
|
|
+
|
|
|
+ if (widget != nullptr)
|
|
|
+ {
|
|
|
+ mainLayout->addWidget(widget);
|
|
|
+ m_currentSelectGroup.liGroup.append(widget);
|
|
|
+ }
|
|
|
+ if (manager->getWafer())
|
|
|
+ {
|
|
|
+ waferMap.insert(num, manager->getWafer());
|
|
|
+ }
|
|
|
+ if (manager->getWafer()) {
|
|
|
+ waffleMap.insert(num, manager->getWaffle());
|
|
|
+ }
|
|
|
+ if (manager->getMaterialBox()) {
|
|
|
+ materialBoxMap.insert(num, manager->getMaterialBox());
|
|
|
+ }
|
|
|
+
|
|
|
+ delete manager;
|
|
|
}
|
|
|
- if (manager->getMaterialBox()) {
|
|
|
- materialBoxMap.insert(num, manager->getMaterialBox());
|
|
|
+
|
|
|
+ // 设置控件的最小高度和最大宽度
|
|
|
+ int minHeight = 162;
|
|
|
+ int maxWidth = 244;
|
|
|
+ int num = -28;
|
|
|
+ for (Group* w : m_currentSelectGroup.liGroup)
|
|
|
+ {
|
|
|
+ w->setMinimumHeight(minHeight);
|
|
|
+ w->setMaximumWidth(maxWidth);
|
|
|
+ num = num + 272;
|
|
|
}
|
|
|
|
|
|
- delete manager;
|
|
|
- }
|
|
|
+ container->setMinimumSize(num, 162);
|
|
|
+ container->setLayout(mainLayout);
|
|
|
+ ui->scrollArea->setWidget(container);
|
|
|
+ ui->scrollArea->resize(1062, 177);
|
|
|
|
|
|
- // 设置控件的最小高度和最大宽度
|
|
|
- int minHeight = 162;
|
|
|
- int maxWidth = 244;
|
|
|
- int num = -28;
|
|
|
- for (Group* w : m_currentSelectGroup.liGroup)
|
|
|
- {
|
|
|
- w->setMinimumHeight(minHeight);
|
|
|
- w->setMaximumWidth(maxWidth);
|
|
|
- num = num + 272;
|
|
|
- }
|
|
|
|
|
|
- container->setMinimumSize(num, 162);
|
|
|
- container->setLayout(mainLayout);
|
|
|
- ui->scrollArea->setWidget(container);
|
|
|
- ui->scrollArea->resize(1062, 177);
|
|
|
+ // 只有一个相机的情况,直接绑定
|
|
|
+ if (numbers.size() == 1)
|
|
|
+ {
|
|
|
+ Group* pGroup = m_currentSelectGroup.liGroup[0];
|
|
|
+ connect(pGroup, &Group::SetUpDataImageShowSig,
|
|
|
+ this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0);
|
|
|
+
|
|
|
+ ST_CURRENT_SELECT_GROUP _curr;
|
|
|
+ _curr.isBond = true;
|
|
|
+ _curr.pSelectGroup = pGroup;
|
|
|
+ _curr.nCurrentCameraId = pGroup->m_nGroupId;
|
|
|
+ _curr.nSelectLeft1 = 1;
|
|
|
+
|
|
|
+ m_veCurrentSelectGroup.push_back(_curr);
|
|
|
+
|
|
|
+ UpdataLightJoystickSwitchPage(pGroup);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void MainAndSecondaryCamerasWnd::CameraConnectUpdateImageFun(int nIndex, Group* widget)
|
|
@@ -1072,6 +1094,43 @@ void MainAndSecondaryCamerasWnd::HideLayout(QHBoxLayout* layout, bool isHide)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void MainAndSecondaryCamerasWnd::UpdataLightJoystickSwitchPage(Group* pGroup)
|
|
|
+{
|
|
|
+ auto Fun = [&](LightJoystickSwitchPage* p, bool bShow)
|
|
|
+ {
|
|
|
+ p->UpdatemPageGroup(pGroup);
|
|
|
+ p->InitMainCameraBind(m_pMainCameraBind);
|
|
|
+ p->HideOrShowPage(bShow);
|
|
|
+ };
|
|
|
+
|
|
|
+ for (int i = 0; i < m_veCurrentSelectGroup.size(); i++)
|
|
|
+ {
|
|
|
+ if (i == 0)
|
|
|
+ {
|
|
|
+ bool bShow = false;
|
|
|
+
|
|
|
+ if (m_veCurrentSelectGroup[0].nSelectLeft1 == 1)
|
|
|
+ {
|
|
|
+ bShow = true;
|
|
|
+ }
|
|
|
+ Fun(ui->control_L, bShow);
|
|
|
+
|
|
|
+ }
|
|
|
+ else if (i == 1)
|
|
|
+ {
|
|
|
+ bool bShow = false;
|
|
|
+ if (m_veCurrentSelectGroup[1].nSelectLeft1 == 1)
|
|
|
+ {
|
|
|
+ bShow = true;
|
|
|
+ }
|
|
|
+ Fun(ui->control_L, bShow);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
void MainAndSecondaryCamerasWnd::timerEvent(QTimerEvent* event)
|
|
|
{
|
|
|
int nID = event->timerId();
|
|
@@ -1195,52 +1254,28 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- m_veCurrentSelectGroup.push_back(_curr);
|
|
|
-
|
|
|
- //yang:
|
|
|
- // 传递当前group
|
|
|
- auto Fun = [&](LightJoystickSwitchPage* p, bool bShow)
|
|
|
- {
|
|
|
- p->InitMainCameraBind(m_pMainCameraBind);
|
|
|
- p->HideOrShowPage(bShow);
|
|
|
- };
|
|
|
-
|
|
|
- int nIndex = 0;
|
|
|
- for (auto& a: m_veCurrentSelectGroup)
|
|
|
+ m_veCurrentSelectGroup.push_back(_curr);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (m_veCurrentSelectGroup[0].pSelectGroup != _curr.pSelectGroup)
|
|
|
{
|
|
|
- bool bShow = false;
|
|
|
- if (a.nSelectLeft1 == 1)
|
|
|
- {
|
|
|
- bShow = true;
|
|
|
- }
|
|
|
-
|
|
|
- if (nIndex == 0)
|
|
|
+ if (m_veCurrentSelectGroup.size() == 1)
|
|
|
{
|
|
|
- Fun(ui->control_L, bShow);
|
|
|
- ui->control_L->UpdatemPageGroup(pGroup);
|
|
|
+ connect(pGroup, &Group::SetUpDataImageShowSig,
|
|
|
+ this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals4);
|
|
|
}
|
|
|
- else if (nIndex == 1)
|
|
|
+ else
|
|
|
{
|
|
|
- Fun(ui->control_r, bShow);
|
|
|
- ui->control_r->UpdatemPageGroup(pGroup);
|
|
|
+ connect(pGroup, &Group::SetUpDataImageShowSig,
|
|
|
+ this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0);
|
|
|
}
|
|
|
- nIndex += 1;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (m_veCurrentSelectGroup.size() == 1)
|
|
|
- {
|
|
|
- connect(pGroup, &Group::SetUpDataImageShowSig,
|
|
|
- this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals4);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- connect(pGroup, &Group::SetUpDataImageShowSig,
|
|
|
- this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0);
|
|
|
+ m_veCurrentSelectGroup.push_back(_curr);
|
|
|
}
|
|
|
- m_veCurrentSelectGroup.push_back(_curr);
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+ UpdataLightJoystickSwitchPage(pGroup);
|
|
|
}
|
|
|
|
|
|
void MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0(const QPixmap& imageData)
|