|
@@ -58,8 +58,6 @@ void MainAndSecondaryCamerasWnd::initFrom()
|
|
|
//strFun.pView = ui->scrollArea;
|
|
|
//strFun.veSignalFun.emplace_back(std::bind(&MainAndSecondaryCamerasWnd::UpdateCameraDisplay0, this, std::placeholders::_1, std::placeholders::_2));
|
|
|
//strFun.veSignalFun.emplace_back(std::bind(&MainAndSecondaryCamerasWnd::UpdateCameraDisplay1, this, std::placeholders::_1, std::placeholders::_2));
|
|
|
- ////strFun.veSlotFun.emplace_back([this]() { CheckIs(); });
|
|
|
- //strFun.veSlotFun.emplace_back(std::bind(&MainAndSecondaryCamerasWnd::CheckIs, this));
|
|
|
|
|
|
//InitAllCamerPage(strFun, this);
|
|
|
|
|
@@ -142,13 +140,13 @@ void MainAndSecondaryCamerasWnd::InitPage()
|
|
|
}
|
|
|
if (manager->getWafer())
|
|
|
{
|
|
|
- waferMap.insert(num, manager->getWafer());
|
|
|
+ m_mapWaferMap.insert(num, manager->getWafer());
|
|
|
}
|
|
|
if (manager->getWafer()) {
|
|
|
- waffleMap.insert(num, manager->getWaffle());
|
|
|
+ m_mapWaffleMap.insert(num, manager->getWaffle());
|
|
|
}
|
|
|
if (manager->getMaterialBox()) {
|
|
|
- materialBoxMap.insert(num, manager->getMaterialBox());
|
|
|
+ m_mapMaterialBoxMap.insert(num, manager->getMaterialBox());
|
|
|
}
|
|
|
|
|
|
delete manager;
|
|
@@ -203,7 +201,6 @@ void MainAndSecondaryCamerasWnd::CameraConnectUpdateImageFun(int nIndex, Group*
|
|
|
else
|
|
|
{
|
|
|
//共用函数
|
|
|
- //connect(widget, &Group::send_button_Signal, this, &MainAndSecondaryCamerasWnd::CheckIs);
|
|
|
connect(widget, &Group::SetCurrentSelectSig, this, &MainAndSecondaryCamerasWnd::GetCurrentSelectSlots);
|
|
|
connect(this, pCamerasImage, widget, &Group::UpDataImageShowSlots);
|
|
|
}
|
|
@@ -291,13 +288,13 @@ void MainAndSecondaryCamerasWnd::loadGroupSettings(int Id, int Index)
|
|
|
}
|
|
|
else if (lastIndex == 2)
|
|
|
{
|
|
|
- updateMaterialWidget(last_left,Last_materialWndType, lastGroupId);
|
|
|
+ updateMaterialWidget(m_nLastLeft,Last_materialWndType, lastGroupId);
|
|
|
ui->viewwidgetgroup_L->setEnableControls(false);
|
|
|
}
|
|
|
|
|
|
if (Index == 2)
|
|
|
{
|
|
|
- updateMaterialWidget(current_right,materialWndType, Id);
|
|
|
+ updateMaterialWidget(m_nCurrentRight,materialWndType, Id);
|
|
|
ui->viewwidgetgroup_R->setEnableControls(false);
|
|
|
}
|
|
|
|
|
@@ -318,18 +315,18 @@ void MainAndSecondaryCamerasWnd::loadGroupSettings(int Id, int Index)
|
|
|
}
|
|
|
}
|
|
|
void MainAndSecondaryCamerasWnd::updateMaterialWidget(int side,int materialWndType, int groupId) {
|
|
|
- if (side == last_left) {
|
|
|
+ if (side == m_nLastLeft) {
|
|
|
switch (materialWndType) {
|
|
|
- case 1: ui->viewwidgetgroup_L->setWafer(waferMap.value(groupId)); break;
|
|
|
- case 2: ui->viewwidgetgroup_L->setWaffle(waffleMap.value(groupId)); break;
|
|
|
- case 3: ui->viewwidgetgroup_L->setMaterialBox(materialBoxMap.value(groupId)); break;
|
|
|
+ case 1: ui->viewwidgetgroup_L->setWafer(m_mapWaferMap.value(groupId)); break;
|
|
|
+ case 2: ui->viewwidgetgroup_L->setWaffle(m_mapWaffleMap.value(groupId)); break;
|
|
|
+ case 3: ui->viewwidgetgroup_L->setMaterialBox(m_mapMaterialBoxMap.value(groupId)); break;
|
|
|
}
|
|
|
}
|
|
|
- else if (side == current_right) {
|
|
|
+ else if (side == m_nCurrentRight) {
|
|
|
switch (materialWndType) {
|
|
|
- case 1: ui->viewwidgetgroup_R->setWafer(waferMap.value(groupId)); break;
|
|
|
- case 2: ui->viewwidgetgroup_R->setWaffle(waffleMap.value(groupId)); break;
|
|
|
- case 3: ui->viewwidgetgroup_R->setMaterialBox(materialBoxMap.value(groupId)); break;
|
|
|
+ case 1: ui->viewwidgetgroup_R->setWafer(m_mapWaferMap.value(groupId)); break;
|
|
|
+ case 2: ui->viewwidgetgroup_R->setWaffle(m_mapWaffleMap.value(groupId)); break;
|
|
|
+ case 3: ui->viewwidgetgroup_R->setMaterialBox(m_mapMaterialBoxMap.value(groupId)); break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -419,6 +416,8 @@ void MainAndSecondaryCamerasWnd::HideLayout(QHBoxLayout* layout, bool isHide)
|
|
|
|
|
|
void MainAndSecondaryCamerasWnd::UpdataLightJoystickSwitchPage(int groupId, int index, bool isShow)
|
|
|
{
|
|
|
+ groupId -= 1; //TODO: 因为这里是0 开始的
|
|
|
+
|
|
|
auto Fun = [&](Group* pGroup,LightJoystickSwitchPage* p, ControlOperationPage* pContPage, bool bShow)
|
|
|
{
|
|
|
p->UpdatemPageGroup(pGroup);
|
|
@@ -432,21 +431,22 @@ void MainAndSecondaryCamerasWnd::UpdataLightJoystickSwitchPage(int groupId, int
|
|
|
{
|
|
|
pContPage->setSwitchJoystickButEnable(bShow);
|
|
|
}
|
|
|
+
|
|
|
+ disconnect(pContPage, &ControlOperationPage::SendModuleTypeSignals,
|
|
|
+ p, &LightJoystickSwitchPage::GetModuleTypeSlots);
|
|
|
+
|
|
|
+ connect(pContPage, &ControlOperationPage::SendModuleTypeSignals,
|
|
|
+ p, &LightJoystickSwitchPage::GetModuleTypeSlots);
|
|
|
};
|
|
|
|
|
|
+ Group* currGroup = m_allGroup.at(groupId);
|
|
|
if (index == 1)
|
|
|
- {
|
|
|
- Group* currGroup = m_allGroup.at(groupId -1);
|
|
|
+ {
|
|
|
Fun(currGroup, ui->control_L, ui->viewwidgetgroup_L, isShow);
|
|
|
- connect(ui->viewwidgetgroup_L, &ControlOperationPage::SendModuleTypeSignals,
|
|
|
- ui->control_L,&LightJoystickSwitchPage::GetModuleTypeSlots);
|
|
|
}
|
|
|
else if(index == 2)
|
|
|
{
|
|
|
- Group* currGroup = m_allGroup.at(groupId -1);
|
|
|
Fun(currGroup, ui->control_r, ui->viewwidgetgroup_R, isShow);
|
|
|
- connect(ui->viewwidgetgroup_R, &ControlOperationPage::SendModuleTypeSignals,
|
|
|
- ui->control_r, &LightJoystickSwitchPage::GetModuleTypeSlots);
|
|
|
}
|
|
|
|
|
|
/* for (int i = 0; i < m_veCurrentSelectGroup.size(); i++)
|
|
@@ -482,29 +482,35 @@ void MainAndSecondaryCamerasWnd::timerEvent(QTimerEvent* event)
|
|
|
int nID = event->timerId();
|
|
|
}
|
|
|
|
|
|
-void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex) {
|
|
|
+void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
|
|
|
+{
|
|
|
int nOnClickGroupId = groupId - 1; // 这里new 有些是0,有些是1 暂时选择
|
|
|
if (m_pMainCameraBind == nullptr || m_allGroup.size() < nOnClickGroupId)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
- if (nIndex == 2) {
|
|
|
- if (m_veCurrentSelectGroup_R.isBond == true) {
|
|
|
+
|
|
|
+ if (nIndex == 2)
|
|
|
+ {
|
|
|
+ if (m_veCurrentSelectGroup_R.isBond == true)
|
|
|
+ {
|
|
|
m_veCurrentSelectGroup_R.isBond = false;
|
|
|
UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, false);
|
|
|
m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
|
|
|
m_veCurrentSelectGroup_L.isBond = true;
|
|
|
//解绑
|
|
|
disconnect(m_veCurrentSelectGroup_R.pSelectGroup, &Group::SetUpDataImageShowSig,
|
|
|
- this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals4);
|
|
|
+ this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R);
|
|
|
|
|
|
//换绑
|
|
|
connect(m_veCurrentSelectGroup_L.pSelectGroup, &Group::SetUpDataImageShowSig,
|
|
|
- this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0);
|
|
|
+ this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L);
|
|
|
UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId, 1, true);
|
|
|
}
|
|
|
- else {
|
|
|
- if (m_veCurrentSelectGroup_R.isInitialed == true) {
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (m_veCurrentSelectGroup_R.isInitialed == true)
|
|
|
+ {
|
|
|
m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
|
|
|
m_veCurrentSelectGroup_L.isBond = false;
|
|
|
UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId, 1, false);
|
|
@@ -513,53 +519,49 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
|
|
|
m_veCurrentSelectGroup_R.isInitialed = true;
|
|
|
m_veCurrentSelectGroup_R.pSelectGroup = pGroup;
|
|
|
UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, false);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
- else {
|
|
|
- if (m_veCurrentSelectGroup_R.isBond == true) {
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (m_veCurrentSelectGroup_R.isBond == true)
|
|
|
+ {
|
|
|
//解绑
|
|
|
disconnect(m_veCurrentSelectGroup_R.pSelectGroup, &Group::SetUpDataImageShowSig,
|
|
|
- this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals4);
|
|
|
+ this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R);
|
|
|
m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
|
|
|
//换绑
|
|
|
connect(m_veCurrentSelectGroup_L.pSelectGroup, &Group::SetUpDataImageShowSig,
|
|
|
- this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0);
|
|
|
+ this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L);
|
|
|
UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId, 1, true);
|
|
|
Group* pGroup = m_allGroup.at(nOnClickGroupId);
|
|
|
m_veCurrentSelectGroup_R.pSelectGroup = pGroup;
|
|
|
m_veCurrentSelectGroup_R.isBond = true;
|
|
|
m_veCurrentSelectGroup_R.isInitialed = true;
|
|
|
connect(m_veCurrentSelectGroup_R.pSelectGroup, &Group::SetUpDataImageShowSig,
|
|
|
- this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals4);
|
|
|
+ this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R);
|
|
|
UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, true);
|
|
|
|
|
|
- }else {
|
|
|
- if (m_veCurrentSelectGroup_R.isInitialed == true) {
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (m_veCurrentSelectGroup_R.isInitialed == true)
|
|
|
+ {
|
|
|
if (m_veCurrentSelectGroup_L.isBond == true) {
|
|
|
disconnect(m_veCurrentSelectGroup_L.pSelectGroup, &Group::SetUpDataImageShowSig,
|
|
|
- this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0);
|
|
|
+ this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L);
|
|
|
}
|
|
|
m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
|
|
|
UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId, 1, false);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
|
|
|
Group* pGroup = m_allGroup.at(nOnClickGroupId);
|
|
|
m_veCurrentSelectGroup_R.pSelectGroup = pGroup;
|
|
|
m_veCurrentSelectGroup_R.isBond = true;
|
|
|
m_veCurrentSelectGroup_R.isInitialed = true;
|
|
|
connect(m_veCurrentSelectGroup_R.pSelectGroup, &Group::SetUpDataImageShowSig,
|
|
|
- this, &MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals4);
|
|
|
+ this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R);
|
|
|
UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, true);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
#if 0
|
|
@@ -688,7 +690,7 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
|
-void MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0(const QPixmap& imageData)
|
|
|
+void MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L(const QPixmap& imageData)
|
|
|
{
|
|
|
//lastIndex = 1;
|
|
|
QSize size_left = ui->viewwidgetgroup_L->getOperatewidget()->size();
|
|
@@ -701,13 +703,7 @@ void MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals0(const QPixmap& image
|
|
|
//UpdataGroupSettings(imageData);
|
|
|
}
|
|
|
|
|
|
-void MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals1(const QPixmap& imageData)
|
|
|
-{
|
|
|
- // lastIndex = 2;
|
|
|
- //UpdataGroupSettings(imageData);
|
|
|
-}
|
|
|
-
|
|
|
-void MainAndSecondaryCamerasWnd::GetUpDataImageShowSignals4(const QPixmap& imageData)
|
|
|
+void MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R(const QPixmap& imageData)
|
|
|
{
|
|
|
QSize size_left = ui->viewwidgetgroup_R->getOperatewidget()->size();
|
|
|
QPixmap scaledPixmap_right = imageData.scaled(size_left, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
|
@@ -764,40 +760,6 @@ void MainAndSecondaryCamerasWnd::hideEvent(QHideEvent *event) {
|
|
|
QMainWindow::hideEvent(event);
|
|
|
}
|
|
|
|
|
|
-void MainAndSecondaryCamerasWnd::CheckIs()
|
|
|
-{
|
|
|
- /*QSettings settings("YourCompany", "YourApplication_Button");
|
|
|
- int groupId = settings.value("GroupId_button", 0).toInt();
|
|
|
-
|
|
|
- if (groupId == lastGroupId) {
|
|
|
- if (lastIndex == 1 ) {
|
|
|
- if(isShow == true){
|
|
|
- isShow = false;
|
|
|
- } else {
|
|
|
- isShow = true;
|
|
|
- }
|
|
|
- }
|
|
|
- if (lastLastIndex == 1 && groupId == lastLastGroupId) {
|
|
|
- if(isShow_L == true){
|
|
|
- isShow_L = false;
|
|
|
- } else {
|
|
|
- isShow_L = true;
|
|
|
- }
|
|
|
- }
|
|
|
- showAndHide();
|
|
|
- showAndHide_L();
|
|
|
-
|
|
|
- } else if (groupId == lastLastGroupId) {
|
|
|
- if (lastLastIndex == 1) {
|
|
|
- if(isShow_L == true){
|
|
|
- isShow_L = false;
|
|
|
- } else {
|
|
|
- isShow_L = true;
|
|
|
- }
|
|
|
- }
|
|
|
- showAndHide_L();
|
|
|
- }*/
|
|
|
-}
|
|
|
QStringList MainAndSecondaryCamerasWnd::getImageslist(const QString& path) {
|
|
|
|
|
|
// 创建 QDir 对象
|