|
@@ -58,6 +58,8 @@ 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);
|
|
|
|
|
@@ -80,8 +82,6 @@ void MainAndSecondaryCamerasWnd::initFrom()
|
|
|
int groupId = settings.value("GroupId", 0).toInt();
|
|
|
int index = settings.value("Index", 0).toInt();
|
|
|
|
|
|
-
|
|
|
-
|
|
|
if (m_allGroup.size() == 1) {
|
|
|
if (lastGroupId == lastLastGroupId) {
|
|
|
GetCurrentSelectSlots(lastLastGroupId, lastLastIndex);
|
|
@@ -92,6 +92,7 @@ void MainAndSecondaryCamerasWnd::initFrom()
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
+ lastLastGroupId = lastLastIndex = 1; //TODO: 需要修改
|
|
|
GetCurrentSelectSlots(lastLastGroupId, lastLastIndex);
|
|
|
GetCurrentSelectSlots(lastGroupId, lastIndex);
|
|
|
}
|
|
@@ -201,6 +202,7 @@ 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);
|
|
|
}
|
|
@@ -416,8 +418,6 @@ 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,49 +432,27 @@ 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)
|
|
|
- {
|
|
|
+ {
|
|
|
+ disconnect(ui->viewwidgetgroup_L, &ControlOperationPage::SendModuleTypeSignals,
|
|
|
+ ui->control_L, &LightJoystickSwitchPage::GetModuleTypeSlots);
|
|
|
+ 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)
|
|
|
{
|
|
|
+ disconnect(ui->viewwidgetgroup_R, &ControlOperationPage::SendModuleTypeSignals,
|
|
|
+ ui->control_r, &LightJoystickSwitchPage::GetModuleTypeSlots);
|
|
|
+ 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++)
|
|
|
- {
|
|
|
- if (i == 0)
|
|
|
- {
|
|
|
- bool bShow = false;
|
|
|
-
|
|
|
- if (m_veCurrentSelectGroup[0].nSelectLeft1 == 1)
|
|
|
- {
|
|
|
- bShow = true;
|
|
|
- }
|
|
|
- Fun(m_veCurrentSelectGroup[0].pSelectGroup,ui->control_L,ui->viewwidgetgroup_L, bShow);
|
|
|
-
|
|
|
- }
|
|
|
- else if (i == 1)
|
|
|
- {
|
|
|
- bool bShow = false;
|
|
|
- if (m_veCurrentSelectGroup[1].nSelectLeft1 == 1)
|
|
|
- {
|
|
|
- bShow = true;
|
|
|
- }
|
|
|
- Fun(m_veCurrentSelectGroup[1].pSelectGroup,ui->control_r, ui->viewwidgetgroup_R, bShow);
|
|
|
-
|
|
|
- }
|
|
|
- }*/
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
void MainAndSecondaryCamerasWnd::timerEvent(QTimerEvent* event)
|
|
@@ -482,7 +460,7 @@ 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)
|
|
@@ -490,7 +468,7 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (nIndex == 2)
|
|
|
+ if (nIndex == 2)
|
|
|
{
|
|
|
if (m_veCurrentSelectGroup_R.isBond == true)
|
|
|
{
|
|
@@ -501,13 +479,13 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
|
|
|
//解绑
|
|
|
disconnect(m_veCurrentSelectGroup_R.pSelectGroup, &Group::SetUpDataImageShowSig,
|
|
|
this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_R);
|
|
|
-
|
|
|
+
|
|
|
//换绑
|
|
|
connect(m_veCurrentSelectGroup_L.pSelectGroup, &Group::SetUpDataImageShowSig,
|
|
|
this, &MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L);
|
|
|
UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_L.pSelectGroup->m_nGroupId, 1, true);
|
|
|
}
|
|
|
- else
|
|
|
+ else
|
|
|
{
|
|
|
if (m_veCurrentSelectGroup_R.isInitialed == true)
|
|
|
{
|
|
@@ -521,7 +499,7 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
|
|
|
UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, false);
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
+ else
|
|
|
{
|
|
|
if (m_veCurrentSelectGroup_R.isBond == true)
|
|
|
{
|
|
@@ -542,9 +520,9 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
|
|
|
UpdataLightJoystickSwitchPage(m_veCurrentSelectGroup_R.pSelectGroup->m_nGroupId, 2, true);
|
|
|
|
|
|
}
|
|
|
- else
|
|
|
+ else
|
|
|
{
|
|
|
- if (m_veCurrentSelectGroup_R.isInitialed == true)
|
|
|
+ if (m_veCurrentSelectGroup_R.isInitialed == true)
|
|
|
{
|
|
|
if (m_veCurrentSelectGroup_L.isBond == true) {
|
|
|
disconnect(m_veCurrentSelectGroup_L.pSelectGroup, &Group::SetUpDataImageShowSig,
|
|
@@ -564,6 +542,29 @@ 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 = m_lastRightPixmap.scaled(size_left, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
|
|
+ //ui->viewwidgetgroup_L->getOperatewidget()->setPixmap(scaledPixmap_left);
|
|
|
+ ui->viewwidgetgroup_L->setScaleFactorSize(scaledPixmap_left);
|
|
|
+
|
|
|
+
|
|
|
+ m_lastRightPixmap = imageData;
|
|
|
+ //UpdataGroupSettings(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);
|
|
|
+ //ui->viewwidgetgroup_R->getOperatewidget()->setPixmap(scaledPixmap_left);
|
|
|
+ ui->viewwidgetgroup_R->setScaleFactorSize(scaledPixmap_right);
|
|
|
+ m_lastRightPixmap = imageData;
|
|
|
+}
|
|
|
+
|
|
|
#if 0
|
|
|
void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
|
|
|
{
|
|
@@ -690,29 +691,6 @@ void MainAndSecondaryCamerasWnd::GetCurrentSelectSlots(int groupId, int nIndex)
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
|
-void MainAndSecondaryCamerasWnd::GetGroupImageShowSignalsTo_L(const QPixmap& imageData)
|
|
|
-{
|
|
|
- //lastIndex = 1;
|
|
|
- QSize size_left = ui->viewwidgetgroup_L->getOperatewidget()->size();
|
|
|
- QPixmap scaledPixmap_left = m_lastRightPixmap.scaled(size_left, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
|
|
- //ui->viewwidgetgroup_L->getOperatewidget()->setPixmap(scaledPixmap_left);
|
|
|
- ui->viewwidgetgroup_L->setScaleFactorSize(scaledPixmap_left);
|
|
|
-
|
|
|
-
|
|
|
- m_lastRightPixmap = imageData;
|
|
|
- //UpdataGroupSettings(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);
|
|
|
- //ui->viewwidgetgroup_R->getOperatewidget()->setPixmap(scaledPixmap_left);
|
|
|
- ui->viewwidgetgroup_R->setScaleFactorSize(scaledPixmap_right);
|
|
|
- m_lastRightPixmap = imageData;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
|
|
|
void MainAndSecondaryCamerasWnd::wheelEvent(QWheelEvent *event)
|
|
|
{
|