|
@@ -10,7 +10,7 @@
|
|
|
#include "Src/common/JMessageTip.h"
|
|
|
|
|
|
|
|
|
-MainAndSecondaryCamerasWnd::MainAndSecondaryCamerasWnd(QWidget *parent)
|
|
|
+MainAndSecondaryCamerasWnd::MainAndSecondaryCamerasWnd(QWidget* parent)
|
|
|
: JOriginalMainWnd(parent)
|
|
|
, ui(new Ui::MainAndSecondaryCamerasWnd)
|
|
|
{
|
|
@@ -18,19 +18,13 @@ MainAndSecondaryCamerasWnd::MainAndSecondaryCamerasWnd(QWidget *parent)
|
|
|
|
|
|
|
|
|
|
|
|
- QString buildDirPath = QCoreApplication::applicationDirPath();
|
|
|
- QDir buildDirectory(buildDirPath);
|
|
|
- QStringList files = getImageslist(buildDirectory.filePath("photos"));
|
|
|
- for (const QString& file : files) {
|
|
|
- qDebug() << file;
|
|
|
- }
|
|
|
+
|
|
|
ui->control_r->HideOrShowPage(false);
|
|
|
ui->control_L->HideOrShowPage(false);
|
|
|
ui->viewwidgetgroup_L->setBlueBord();
|
|
|
+ connect(ui->viewwidgetgroup_L, &ControlOperationPage::send_ComboBox_singal, this, &MainAndSecondaryCamerasWnd::HandleComboxchange_L);
|
|
|
+ connect(ui->viewwidgetgroup_R, &ControlOperationPage::send_ComboBox_singal, this, &MainAndSecondaryCamerasWnd::HandleComboxchange_R);
|
|
|
qApp->installEventFilter(this);
|
|
|
-
|
|
|
- m_veCurrentSelectGroup_R = {};
|
|
|
- m_veCurrentSelectGroup_L = {};
|
|
|
m_veCurrentSelectGroup_R.isInitialed = false;
|
|
|
m_veCurrentSelectGroup_L.isInitialed = false;
|
|
|
m_veCurrentSelectGroup_R.isBond = false;
|
|
@@ -45,7 +39,7 @@ MainAndSecondaryCamerasWnd::~MainAndSecondaryCamerasWnd()
|
|
|
|
|
|
void MainAndSecondaryCamerasWnd::initFrom()
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
{
|
|
|
// 界面刷新
|
|
|
InitPage();
|
|
@@ -63,7 +57,7 @@ void MainAndSecondaryCamerasWnd::initFrom()
|
|
|
//SwitchToConfigAAAAA<MainAndSecondaryCamerasWnd, STR_TEMPLATE>();
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//ui->LeftOperatewidget->setMouseTracking(true);
|
|
|
//ui->RightOperatewidget->setMouseTracking(true);
|
|
|
|
|
@@ -90,7 +84,7 @@ void MainAndSecondaryCamerasWnd::InitPage()
|
|
|
//JMessageTip::Message_warning("a");
|
|
|
}
|
|
|
QList<int> numbers;
|
|
|
-
|
|
|
+
|
|
|
for (int i = 1; i <= nSize; i++)
|
|
|
{
|
|
|
numbers.push_back(i);
|
|
@@ -99,12 +93,18 @@ void MainAndSecondaryCamerasWnd::InitPage()
|
|
|
for (int i = 0; i < numbers.size(); ++i)
|
|
|
{
|
|
|
int num = numbers[i];
|
|
|
- CameraImageHandler* manager = new CameraImageHandler(num);
|
|
|
+ CameraInfo test;
|
|
|
+ test.iCameraId = i;
|
|
|
+ test.name = ("camera" + QString::number(i)).toStdString();
|
|
|
+ test.eType = MATERIAL_WAFER;
|
|
|
+ CameraImageHandler* manager = new CameraImageHandler(num,test);
|
|
|
Group* widget = manager->getGroup();
|
|
|
CameraConnectUpdateImageFun(i, widget);
|
|
|
|
|
|
connect(widget, &Group::sendUpdateGroupState,
|
|
|
this, &MainAndSecondaryCamerasWnd::checkSettings);
|
|
|
+ connect(widget, &Group::send_ComboBox_singal,
|
|
|
+ this, &MainAndSecondaryCamerasWnd::GetGroupComboxChanged);
|
|
|
if (widget != nullptr)
|
|
|
{
|
|
|
mainLayout->addWidget(widget);
|
|
@@ -123,6 +123,9 @@ void MainAndSecondaryCamerasWnd::InitPage()
|
|
|
if (manager->getBond()) {
|
|
|
m_mapBondMap.insert(num, manager->getBond());
|
|
|
}
|
|
|
+ if(!manager->getFileList().isEmpty()){
|
|
|
+ m_mapFileListMap.insert(num, manager->getFileList());
|
|
|
+ }
|
|
|
delete manager;
|
|
|
}
|
|
|
|
|
@@ -130,11 +133,11 @@ void MainAndSecondaryCamerasWnd::InitPage()
|
|
|
int minHeight = 162;
|
|
|
int maxWidth = 244;
|
|
|
int num = -28;
|
|
|
- for(Group* w : m_allGroup)
|
|
|
+ for (Group* w : m_allGroup)
|
|
|
{
|
|
|
- w->setMinimumHeight(minHeight);
|
|
|
- w->setMaximumWidth(maxWidth);
|
|
|
- num = num + 272;
|
|
|
+ w->setMinimumHeight(minHeight);
|
|
|
+ w->setMaximumWidth(maxWidth);
|
|
|
+ num = num + 272;
|
|
|
}
|
|
|
|
|
|
container->setMinimumSize(num, 162);
|
|
@@ -171,12 +174,13 @@ void MainAndSecondaryCamerasWnd::CameraConnectUpdateImageFun(int nIndex, Group*
|
|
|
{
|
|
|
if (isUnCameraBind)
|
|
|
{
|
|
|
- //disconnect(widget, &Group::SetCurrentSelectSig, this, &MainAndSecondaryCamerasWnd::GetCurrentSelectSlots);
|
|
|
+ disconnect(widget, &Group::SetCurrentSelectSig, this, &MainAndSecondaryCamerasWnd::GetCurrentSelectSlots);
|
|
|
disconnect(this, pCamerasImage, widget, &Group::UpDataImageShowSlots);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//共用函数
|
|
|
+ //connect(widget, &Group::send_button_Signal, this, &MainAndSecondaryCamerasWnd::CheckIs);
|
|
|
// connect(widget, &Group::SetCurrentSelectSig, this, &MainAndSecondaryCamerasWnd::GetCurrentSelectSlots);
|
|
|
connect(this, pCamerasImage, widget, &Group::UpDataImageShowSlots);
|
|
|
}
|
|
@@ -231,63 +235,77 @@ void MainAndSecondaryCamerasWnd::initLeftAndRightWidget() {
|
|
|
lastGroupId = 1;
|
|
|
lastIndex = 1;
|
|
|
lastLastGroupId = 1;
|
|
|
- lastLastGroupId = 2;
|
|
|
+ lastLastIndex = 2;
|
|
|
|
|
|
}
|
|
|
m_veCurrentSelectGroup_R.isInitialed = true;
|
|
|
m_veCurrentSelectGroup_L.isInitialed = true;
|
|
|
|
|
|
if (m_allGroup.size() == 1) {
|
|
|
-
|
|
|
m_veCurrentSelectGroup_L.pSelectGroup = m_allGroup.at(lastGroupId - 1);
|
|
|
m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(lastGroupId - 1);
|
|
|
+ m_veCurrentSelectGroup_L.pSelectGroup->initBorderStyle(lastLastIndex,0);
|
|
|
+ m_veCurrentSelectGroup_R.pSelectGroup->initBorderStyle(lastIndex, 1);
|
|
|
+ int currentLeftComboBoxIndex = m_veCurrentSelectGroup_L.pSelectGroup->getCurrentComboBoxIndex();
|
|
|
+ ui->viewwidgetgroup_L->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId],currentLeftComboBoxIndex);
|
|
|
+ int currentRightComboBoxIndex = m_veCurrentSelectGroup_R.pSelectGroup->getCurrentComboBoxIndex();
|
|
|
+ ui->viewwidgetgroup_R->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId],currentRightComboBoxIndex);
|
|
|
if (lastIndex != lastLastIndex) {
|
|
|
|
|
|
if (lastIndex == 1) {
|
|
|
BindImageOrMaterial(m_nCurrentRight, m_nImageIndex);
|
|
|
+ ui->viewwidgetgroup_R->setEnableControls(true);
|
|
|
BindImageOrMaterial(m_nLastLeft, m_nMaterialIndex);
|
|
|
+ ui->viewwidgetgroup_L->setEnableControls(false);
|
|
|
}
|
|
|
else {
|
|
|
BindImageOrMaterial(m_nCurrentRight, m_nMaterialIndex);
|
|
|
+ ui->viewwidgetgroup_R->setEnableControls(false);
|
|
|
BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
|
|
|
-
|
|
|
+ ui->viewwidgetgroup_L->setEnableControls(true);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
|
else {
|
|
|
BindImageOrMaterial(m_nCurrentRight, m_nMaterialIndex);
|
|
|
+ ui->viewwidgetgroup_R->setEnableControls(true);
|
|
|
BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
|
|
|
+ ui->viewwidgetgroup_L->setEnableControls(false);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- if (lastLastGroupId > m_allGroup.size() || lastGroupId > m_allGroup.size()) {
|
|
|
- //重置记录
|
|
|
- lastGroupId = 1;
|
|
|
- lastIndex = 1;
|
|
|
- lastLastGroupId = 1;
|
|
|
- lastLastGroupId = 2;
|
|
|
- }
|
|
|
|
|
|
m_veCurrentSelectGroup_L.pSelectGroup = m_allGroup.at(lastLastGroupId - 1);
|
|
|
m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(lastGroupId - 1);
|
|
|
+ m_veCurrentSelectGroup_L.pSelectGroup->initBorderStyle(lastLastIndex, 0);
|
|
|
+ m_veCurrentSelectGroup_R.pSelectGroup->initBorderStyle(lastIndex, 1);
|
|
|
+ int currentLeftComboBoxIndex = m_veCurrentSelectGroup_L.pSelectGroup->getCurrentComboBoxIndex();
|
|
|
+ ui->viewwidgetgroup_L->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId],currentLeftComboBoxIndex);
|
|
|
+ int currentRightComboBoxIndex = m_veCurrentSelectGroup_R.pSelectGroup->getCurrentComboBoxIndex();
|
|
|
+ ui->viewwidgetgroup_R->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId],currentRightComboBoxIndex);
|
|
|
if (lastLastIndex == 1) {
|
|
|
|
|
|
BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
|
|
|
+ ui->viewwidgetgroup_L->setEnableControls(true);
|
|
|
|
|
|
}
|
|
|
else {
|
|
|
|
|
|
BindImageOrMaterial(m_nLastLeft, m_nMaterialIndex);
|
|
|
+ ui->viewwidgetgroup_L->setEnableControls(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (lastIndex == 1) {
|
|
|
BindImageOrMaterial(m_nCurrentRight, m_nImageIndex);
|
|
|
+ ui->viewwidgetgroup_R->setEnableControls(true);
|
|
|
|
|
|
}
|
|
|
else {
|
|
|
BindImageOrMaterial(m_nCurrentRight, m_nMaterialIndex);
|
|
|
+ ui->viewwidgetgroup_R->setEnableControls(false);
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -302,10 +320,10 @@ void MainAndSecondaryCamerasWnd::BindImageOrMaterial(int location, int index) {
|
|
|
m_veCurrentSelectGroup_L.isBond = true;
|
|
|
connect(m_veCurrentSelectGroup_L.pSelectGroup, &Group::SetUpDataImageShowSig,
|
|
|
this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L);
|
|
|
- ui->viewwidgetgroup_L->initImage();
|
|
|
UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId, 1, true);
|
|
|
|
|
|
- }else {
|
|
|
+ }
|
|
|
+ else {
|
|
|
//左边更新物料窗口
|
|
|
QSettings settings("YourOrganization", "YourApplication");
|
|
|
settings.beginGroup(QString::number(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId));
|
|
@@ -316,13 +334,13 @@ void MainAndSecondaryCamerasWnd::BindImageOrMaterial(int location, int index) {
|
|
|
updateMaterialWidget(m_nLastLeft, lastMaterialWndType, m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId);
|
|
|
|
|
|
}
|
|
|
- }else {
|
|
|
+ }
|
|
|
+ else {
|
|
|
if (index == m_nImageIndex) {
|
|
|
|
|
|
m_veCurrentSelectGroup_R.isBond = true;
|
|
|
connect(m_veCurrentSelectGroup_R.pSelectGroup, &Group::SetUpDataImageShowSig,
|
|
|
this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R);
|
|
|
- ui->viewwidgetgroup_R->initImage();
|
|
|
UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, true);
|
|
|
|
|
|
}
|
|
@@ -341,7 +359,7 @@ void MainAndSecondaryCamerasWnd::BindImageOrMaterial(int location, int index) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void MainAndSecondaryCamerasWnd::checkSettings(int groupId,int index) {
|
|
|
+void MainAndSecondaryCamerasWnd::checkSettings(int groupId, int index) {
|
|
|
|
|
|
|
|
|
if (groupId != lastGroupId || index != lastIndex) {
|
|
@@ -360,20 +378,18 @@ void MainAndSecondaryCamerasWnd::saveInfoOfLast() {
|
|
|
QSettings settings("YourOrganization", "YourApplication");
|
|
|
settings.setValue("DoubleLastIndex", lastIndex);
|
|
|
settings.setValue("DoubleLastGroupId", lastGroupId);
|
|
|
-
|
|
|
settings.setValue("DoubleLastLastIndex", lastLastIndex);
|
|
|
settings.setValue("DoubleLastLastGroupId", lastLastGroupId);
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-void MainAndSecondaryCamerasWnd::updateMaterialWidget(int side,int materialWndType, int groupId) {
|
|
|
+void MainAndSecondaryCamerasWnd::updateMaterialWidget(int side, int materialWndType, int groupId) {
|
|
|
if (side == m_nLastLeft) {
|
|
|
switch (materialWndType) {
|
|
|
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;
|
|
|
- case 4: ui->viewwidgetgroup_L->setBond(m_mapBondMap.value(groupId)); break;
|
|
|
+ case 4: ui->viewwidgetgroup_L->setBond(m_mapBondMap.value(groupId)); break;
|
|
|
}
|
|
|
}
|
|
|
else if (side == m_nCurrentRight) {
|
|
@@ -381,7 +397,7 @@ void MainAndSecondaryCamerasWnd::updateMaterialWidget(int side,int materialWndT
|
|
|
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;
|
|
|
- case 4: ui->viewwidgetgroup_R->setBond(m_mapBondMap.value(groupId)); break;
|
|
|
+ case 4: ui->viewwidgetgroup_R->setBond(m_mapBondMap.value(groupId)); break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -398,18 +414,6 @@ void MainAndSecondaryCamerasWnd::UnCameraBind()
|
|
|
{
|
|
|
CameraConnectUpdateImageFun(i, m_allGroup[i], true);
|
|
|
}
|
|
|
- //判断更新前的左窗口是否是绑定相机
|
|
|
- if (m_veCurrentSelectGroup_L.isBond == true) {
|
|
|
- disconnect(m_veCurrentSelectGroup_L.pSelectGroup, &Group::SetUpDataImageShowSig,
|
|
|
- this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L);
|
|
|
- }
|
|
|
-
|
|
|
- //判断更新前的右窗口是否是绑定相机
|
|
|
- if (m_veCurrentSelectGroup_R.isBond == true) {
|
|
|
- //解绑
|
|
|
- disconnect(m_veCurrentSelectGroup_R.pSelectGroup, &Group::SetUpDataImageShowSig,
|
|
|
- this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
void MainAndSecondaryCamerasWnd::UpdateCameraDisplay0(int iCameraId, JVision::ImageInfo imageData)
|
|
@@ -483,7 +487,7 @@ void MainAndSecondaryCamerasWnd::HideLayout(QHBoxLayout* layout, bool isHide)
|
|
|
|
|
|
void MainAndSecondaryCamerasWnd::UpdataLightJoystickSwitchPage(int groupId, int index, bool isShow)
|
|
|
{
|
|
|
- auto Fun = [&](Group* pGroup,LightJoystickSwitchPage* p, ControlOperationPage* pContPage, bool bShow)
|
|
|
+ auto Fun = [&](Group* pGroup, LightJoystickSwitchPage* p, ControlOperationPage* pContPage, bool bShow)
|
|
|
{
|
|
|
p->UpdatemPageGroup(pGroup);
|
|
|
p->InitMainCameraBind(m_pMainCameraBind, bShow);
|
|
@@ -498,21 +502,21 @@ void MainAndSecondaryCamerasWnd::UpdataLightJoystickSwitchPage(int groupId, int
|
|
|
}
|
|
|
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
if (index == 1)
|
|
|
{
|
|
|
disconnect(ui->viewwidgetgroup_L, &ControlOperationPage::SendModuleTypeSignals,
|
|
|
ui->control_L, &LightJoystickSwitchPage::GetModuleTypeSlots);
|
|
|
- Group* currGroup = m_allGroup.at(groupId-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);
|
|
|
+ connect(ui->viewwidgetgroup_L, &ControlOperationPage::SendModuleTypeSignals,
|
|
|
+ ui->control_L, &LightJoystickSwitchPage::GetModuleTypeSlots);
|
|
|
}
|
|
|
- else if(index == 2)
|
|
|
+ else if (index == 2)
|
|
|
{
|
|
|
disconnect(ui->viewwidgetgroup_R, &ControlOperationPage::SendModuleTypeSignals,
|
|
|
ui->control_r, &LightJoystickSwitchPage::GetModuleTypeSlots);
|
|
|
- Group* currGroup = m_allGroup.at(groupId-1);
|
|
|
+ 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);
|
|
@@ -546,16 +550,27 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
|
|
|
this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
m_veCurrentSelectGroup_L = m_veCurrentSelectGroup_R;
|
|
|
+
|
|
|
//判断更新前的右窗口的index是相机还是物料
|
|
|
if (lastIndex == 1) {
|
|
|
//左窗口绑定
|
|
|
-
|
|
|
+ //更新左边的下拉框内容同步小窗口索引
|
|
|
+ int currentLeftComboBoxIndex = m_veCurrentSelectGroup_L.pSelectGroup->getCurrentComboBoxIndex();
|
|
|
+ ui->viewwidgetgroup_L->setEnableControls(true);
|
|
|
+ ui->viewwidgetgroup_L->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId],currentLeftComboBoxIndex);
|
|
|
+
|
|
|
BindImageOrMaterial(m_nLastLeft, m_nImageIndex);
|
|
|
+ QPixmap pixmap = ui->viewwidgetgroup_L->getCurrentComboBoxPixmap(currentLeftComboBoxIndex);
|
|
|
+ GetGroupImageShowSignalsTo_L(pixmap);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
else {
|
|
|
-
|
|
|
+ ui->viewwidgetgroup_L->setEnableControls(false);
|
|
|
BindImageOrMaterial(m_nLastLeft, m_nMaterialIndex);
|
|
|
|
|
|
}
|
|
@@ -563,13 +578,18 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
|
|
|
m_veCurrentSelectGroup_R.pSelectGroup = m_allGroup.at(nOnClickGroupId);
|
|
|
//判断当前index是相机还是物料
|
|
|
if (nIndex == 2) {
|
|
|
-
|
|
|
+ ui->viewwidgetgroup_R->setEnableControls(false);
|
|
|
BindImageOrMaterial(m_nCurrentRight, m_nMaterialIndex);
|
|
|
|
|
|
}
|
|
|
else if (nIndex == 1) {//当前切换时相机序号
|
|
|
+ int currentRightComboBoxIndex = m_veCurrentSelectGroup_R.pSelectGroup->getCurrentComboBoxIndex();
|
|
|
+ ui->viewwidgetgroup_R->setEnableControls(true);
|
|
|
+ ui->viewwidgetgroup_R->setComboBox(m_mapFileListMap[m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId],currentRightComboBoxIndex);
|
|
|
|
|
|
BindImageOrMaterial(m_nCurrentRight, m_nImageIndex);
|
|
|
+ QPixmap pixmap = ui->viewwidgetgroup_R->getCurrentComboBoxPixmap(currentRightComboBoxIndex);
|
|
|
+ GetGroupImageShowSignalsTo_R(pixmap);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -577,29 +597,25 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
|
|
|
|
|
|
void MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L(const QPixmap& imageData)
|
|
|
{
|
|
|
- //lastIndex = 1;
|
|
|
+
|
|
|
QSize size_left = ui->viewwidgetgroup_L->getOperatewidget()->size();
|
|
|
- QPixmap scaledPixmap_left = imageData.scaled(size_left, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
|
|
- //ui->viewwidgetgroup_L->getOperatewidget()->setPixmap(scaledPixmap_left);
|
|
|
+ QPixmap scaledPixmap_left = m_lastRightPixmap.scaled(size_left, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
|
|
ui->viewwidgetgroup_L->setScaleFactorSize(scaledPixmap_left);
|
|
|
+ m_lastRightPixmap = imageData;
|
|
|
|
|
|
-
|
|
|
- // m_lastRightPixmap = imageData;
|
|
|
- //UpdataGroupSettings(imageData);
|
|
|
}
|
|
|
|
|
|
void MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R(const QPixmap& imageData)
|
|
|
{
|
|
|
- QSize size_right = ui->viewwidgetgroup_R->getOperatewidget()->size();
|
|
|
- QPixmap scaledPixmap_right = imageData.scaled(size_right, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
|
|
- //ui->viewwidgetgroup_R->getOperatewidget()->setPixmap(scaledPixmap_left);
|
|
|
+ QSize size_left = ui->viewwidgetgroup_R->getOperatewidget()->size();
|
|
|
+ QPixmap scaledPixmap_right = imageData.scaled(size_left, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
|
|
ui->viewwidgetgroup_R->setScaleFactorSize(scaledPixmap_right);
|
|
|
- // m_lastRightPixmap = imageData;
|
|
|
+ m_lastRightPixmap = imageData;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-void MainAndSecondaryCamerasWnd::wheelEvent(QWheelEvent *event)
|
|
|
+void MainAndSecondaryCamerasWnd::wheelEvent(QWheelEvent* event)
|
|
|
{
|
|
|
//if (ui->viewwidgetgroup_L->getOperatewidget()->rect().contains(ui->viewwidgetgroup_L->getOperatewidget()->mapFromGlobal(event->globalPos()))) {
|
|
|
// mousePos = ui->viewwidgetgroup_L->getOperatewidget()->mapFromGlobal(event->globalPos());
|
|
@@ -628,35 +644,71 @@ void MainAndSecondaryCamerasWnd::wheelEvent(QWheelEvent *event)
|
|
|
// scrollBar->setValue(scrollBar->value() + 50);
|
|
|
// }
|
|
|
//}
|
|
|
-
|
|
|
- QMainWindow::wheelEvent(event);
|
|
|
+
|
|
|
+ QMainWindow::wheelEvent(event);
|
|
|
}
|
|
|
|
|
|
-void MainAndSecondaryCamerasWnd::showEvent(QShowEvent *event) {
|
|
|
+void MainAndSecondaryCamerasWnd::showEvent(QShowEvent* event) {
|
|
|
isUpdatingSettings = false;
|
|
|
QMainWindow::showEvent(event);
|
|
|
|
|
|
+
|
|
|
isUpdatingSettings = false;
|
|
|
}
|
|
|
|
|
|
-void MainAndSecondaryCamerasWnd::hideEvent(QHideEvent *event) {
|
|
|
+void MainAndSecondaryCamerasWnd::hideEvent(QHideEvent* event) {
|
|
|
isUpdatingSettings = false;
|
|
|
QMainWindow::hideEvent(event);
|
|
|
}
|
|
|
|
|
|
-QStringList MainAndSecondaryCamerasWnd::getImageslist(const QString& path) {
|
|
|
|
|
|
- // 创建 QDir 对象
|
|
|
- QDir dir(path);
|
|
|
|
|
|
- // 检查文件夹是否存在
|
|
|
- if (!dir.exists()) {
|
|
|
- qWarning() << "Folder does not exist:" ;
|
|
|
+void MainAndSecondaryCamerasWnd::GetGroupComboxChanged(int groupId,int comboxIndex){
|
|
|
+
|
|
|
+ m_allGroup.at(groupId - 1);
|
|
|
+ if(comboxIndex == 0){
|
|
|
+ CameraConnectUpdateImageFun(groupId - 1,m_allGroup.at(groupId - 1),false);
|
|
|
+
|
|
|
+ }else{
|
|
|
+ CameraConnectUpdateImageFun(groupId - 1,m_allGroup.at(groupId - 1),true);
|
|
|
+
|
|
|
}
|
|
|
+ m_allGroup.at(groupId - 1)->setCurrentCombox(comboxIndex);
|
|
|
+ if(groupId == m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId && lastLastIndex == 1){
|
|
|
|
|
|
- // 获取文件夹中的所有图片文件
|
|
|
- QStringList filters;
|
|
|
- filters << "*.png" << "*.jpg" << "*.jpeg" << "*.bmp" << "*.gif"; // 添加你需要的图片格式
|
|
|
- QStringList fileList = dir.entryList(filters, QDir::Files);
|
|
|
- return fileList;
|
|
|
+ if(comboxIndex != 0){//图片
|
|
|
+ QPixmap updatePixmap = ui->viewwidgetgroup_L->getCurrentComboBoxPixmap(comboxIndex);
|
|
|
+ m_veCurrentSelectGroup_L.pSelectGroup->UpDataImageShowSlots(updatePixmap);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if(groupId == m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId && lastIndex == 1){
|
|
|
+
|
|
|
+ if(comboxIndex != 0){//图片
|
|
|
+ QPixmap updatePixmap = ui->viewwidgetgroup_R->getCurrentComboBoxPixmap(comboxIndex);
|
|
|
+ m_veCurrentSelectGroup_R.pSelectGroup->UpDataImageShowSlots(updatePixmap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+void MainAndSecondaryCamerasWnd::HandleComboxchange_L(int index) {
|
|
|
+ if (index == 0) {
|
|
|
+ CameraConnectUpdateImageFun(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId-1, m_allGroup.at(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId - 1), false);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ CameraConnectUpdateImageFun(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId - 1, m_allGroup.at(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId - 1), true);
|
|
|
+ QPixmap updatePixmap = ui->viewwidgetgroup_L->getCurrentComboBoxPixmap(index);
|
|
|
+ m_veCurrentSelectGroup_L.pSelectGroup->UpDataImageShowSlots(updatePixmap);
|
|
|
+ }
|
|
|
+}
|
|
|
+void MainAndSecondaryCamerasWnd::HandleComboxchange_R(int index) {
|
|
|
+ if (index == 0) {
|
|
|
+ CameraConnectUpdateImageFun(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId - 1, m_allGroup.at(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId - 1), false);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ CameraConnectUpdateImageFun(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId - 1, m_allGroup.at(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId - 1), true);
|
|
|
+ QPixmap updatePixmap = ui->viewwidgetgroup_R->getCurrentComboBoxPixmap(index);
|
|
|
+ m_veCurrentSelectGroup_R.pSelectGroup->UpDataImageShowSlots(updatePixmap);
|
|
|
+ }
|
|
|
}
|