From 5863c3c48d441af152683386bba31b15fa4e5ad9 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 2 Feb 2018 03:40:29 +0000 Subject: [PATCH] Changes in Modules handling and re-enable module while playing --- app/ModulesHandle.cpp | 18 ++++++++---------- app/PlaYUVerApp.cpp | 2 +- app/VideoHandle.cpp | 5 +---- app/VideoHandle.h | 2 +- app/VideoSubWindow.cpp | 2 +- 5 files changed, 12 insertions(+), 17 deletions(-) diff --git a/app/ModulesHandle.cpp b/app/ModulesHandle.cpp index 67d412e..613c500 100644 --- a/app/ModulesHandle.cpp +++ b/app/ModulesHandle.cpp @@ -376,21 +376,18 @@ Void ModulesHandle::activateModule() VideoSubWindow* pcModuleSubWindow = NULL; if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE ) { - if( ( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_NEW_WINDOW ) || - bShowModulesNewWindow ) + if( ( pcCurrAppModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_NEW_WINDOW ) || bShowModulesNewWindow ) { pcModuleSubWindow = new VideoSubWindow( VideoSubWindow::MODULE_SUBWINDOW ); windowName.append( QStringLiteral( "Module " ) ); windowName.append( pcCurrAppModuleIf->m_pcModule->m_pchModuleName ); - - connect( pcModuleSubWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), m_appModuleVideo, - SLOT( updateSelectionArea( QRect ) ) ); - connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo, - SLOT( zoomToFactorAll( double, QPoint ) ) ); - connect( pcModuleSubWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ), m_appModuleVideo, - SLOT( moveAllScrollBars( const QPoint ) ) ); - pcCurrAppModuleIf->m_pcDisplaySubWindow = pcModuleSubWindow; + // connect( pcModuleSubWindow->getViewArea(), SIGNAL( selectionChanged( QRect ) ), m_appModuleVideo, + // SLOT( updateSelectionArea( QRect ) ) ); + // connect( pcModuleSubWindow, SIGNAL( zoomFactorChanged_SWindow( const double, const QPoint ) ), m_appModuleVideo, + // SLOT( zoomToFactorAll( double, QPoint ) ) ); + // connect( pcModuleSubWindow, SIGNAL( scrollBarMoved_SWindow( const QPoint ) ), m_appModuleVideo, + // SLOT( moveAllScrollBars( const QPoint ) ) ); } } else if( pcCurrAppModuleIf->m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE ) @@ -455,6 +452,7 @@ Void ModulesHandle::activateModule() pcModuleSubWindow->setWindowName( windowName ); m_pcMainWindowManager->addSubWindow( pcModuleSubWindow ); pcModuleSubWindow->show(); + m_appModuleVideo->addSubWindow( pcModuleSubWindow ); } else { diff --git a/app/PlaYUVerApp.cpp b/app/PlaYUVerApp.cpp index b2f77ea..2cffd1d 100644 --- a/app/PlaYUVerApp.cpp +++ b/app/PlaYUVerApp.cpp @@ -219,7 +219,7 @@ Void PlaYUVerApp::loadFile( QString fileName, PlaYUVerStreamInfo* pStreamInfo ) m_pcWindowHandle->addSubWindow( videoSubWindow ); videoSubWindow->show(); - m_appModuleVideo->openSubWindow( videoSubWindow ); + m_appModuleVideo->addSubWindow( videoSubWindow ); updateZoomFactorSBox(); diff --git a/app/VideoHandle.cpp b/app/VideoHandle.cpp index 37d4026..0a142e5 100644 --- a/app/VideoHandle.cpp +++ b/app/VideoHandle.cpp @@ -382,7 +382,7 @@ Void VideoHandle::updateSelectionArea( QRect area ) } } -Void VideoHandle::openSubWindow( VideoSubWindow* window ) +Void VideoHandle::addSubWindow( VideoSubWindow* window ) { window->zoomToFit(); window->getViewArea()->setTool( m_uiViewTool ); @@ -397,9 +397,6 @@ Void VideoHandle::openSubWindow( VideoSubWindow* window ) connect( window, &SubWindowAbstract::scrollBarMoved, this, &VideoHandle::moveAllScrollBars ); - //connect( window, SIGNAL( aboutToClose( SubWindowAbstract* ) ), this, SLOT( closeSubWindow( SubWindowAbstract* ) ) ); - //connect( window, SIGNAL( zoomFactorChanged( const double, const QPoint ) ), this, SLOT( zoomToFactorAll( double, QPoint ) ) ); - //connect( window, SIGNAL( scrollBarMoved( const QPoint ) ), this, SLOT( moveAllScrollBars( const QPoint ) ) ); connect( window->getViewArea(), SIGNAL( selectionChanged( QRect ) ), this, SLOT( updateSelectionArea( QRect ) ) ); } diff --git a/app/VideoHandle.h b/app/VideoHandle.h index 3970016..f7b9472 100644 --- a/app/VideoHandle.h +++ b/app/VideoHandle.h @@ -69,7 +69,7 @@ public: Void update( VideoSubWindow* currSubWindow ); - Void openSubWindow( VideoSubWindow* subWindow ); + Void addSubWindow( VideoSubWindow* subWindow ); private: QWidget* m_pcParet; diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 57b0850..e6ce92a 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -660,7 +660,7 @@ Void VideoSubWindow::refreshFrameOperation() { m_cViewArea->setImage( m_pcCurrFrame ); } - for( Int i = 0; i < m_apcCurrentModule.size() && !m_bIsPlaying; i++ ) + for( Int i = 0; i < m_apcCurrentModule.size(); i++ ) { m_apcCurrentModule.at( i )->update(); }