Add feature to disable current module
This commit is contained in:
1 parent
87cad865fe
commit
468d525b16
5 files changed
+28
-7
No files matched your search
@@ -62,8 +62,11 @@ void ModulesHandle::selectModule( int index )
|
||||
PlaYUVerModuleIf* ModulesHandle::getSelectedModuleIf()
|
||||
{
|
||||
PlaYUVerModuleIf* currModuleIf = NULL;
|
||||
|
||||
if( m_uiModuleSelected >= 0 )
|
||||
return m_pcPlaYUVerModules.at( m_uiModuleSelected );
|
||||
//if( m_arrayModulesActions.at(m_uiModuleSelected)->isChecked() )
|
||||
currModuleIf = m_pcPlaYUVerModules.at( m_uiModuleSelected );
|
||||
|
||||
m_uiModuleSelected = -1;
|
||||
return currModuleIf;
|
||||
}
|
||||
@@ -92,6 +95,8 @@ QMenu* ModulesHandle::createMenus( QMenuBar *MainAppMenuBar )
|
||||
m_arrayModulesActions.append( currAction );
|
||||
|
||||
m_pcModulesMenu->addAction( currAction );
|
||||
|
||||
currModuleIf->m_pcAction = currAction;
|
||||
}
|
||||
return m_pcModulesMenu;
|
||||
//MainAppMenuBar->
|
||||
|
||||
@@ -115,6 +115,11 @@ bool SubWindowHandle::loadFile( const QString &fileName )
|
||||
*/
|
||||
Void SubWindowHandle::enableModule( PlaYUVerModuleIf* select_module )
|
||||
{
|
||||
if( m_pcCurrentModule == select_module )
|
||||
{
|
||||
disableModule();
|
||||
return;
|
||||
}
|
||||
m_pcCurrentModule = select_module;
|
||||
m_pcCurrentModule->create( m_pCurrStream->getFrame( m_pcCurrentModule->getModImage() ) );
|
||||
refreshFrame();
|
||||
@@ -122,6 +127,8 @@ Void SubWindowHandle::enableModule( PlaYUVerModuleIf* select_module )
|
||||
|
||||
Void SubWindowHandle::disableModule()
|
||||
{
|
||||
if( !m_pcCurrentModule )
|
||||
return;
|
||||
m_pcCurrentModule->destroy();
|
||||
m_pcCurrentModule = NULL;
|
||||
refreshFrame();
|
||||
|
||||
@@ -31,6 +31,8 @@ namespace plaYUVer
|
||||
|
||||
Void FilterFrame::create( PlaYUVerFrame* InputFrame )
|
||||
{
|
||||
if( m_pcFilteredFrame )
|
||||
delete m_pcFilteredFrame;
|
||||
m_pcFilteredFrame = new PlaYUVerFrame( InputFrame->getWidth(), InputFrame->getHeight(), InputFrame->getPelFormat() );
|
||||
}
|
||||
|
||||
@@ -48,13 +50,15 @@ PlaYUVerFrame* FilterFrame::process( PlaYUVerFrame* InputFrame )
|
||||
pppPelYUV[2][y][x] = 128;
|
||||
}
|
||||
}
|
||||
m_pcFilteredFrame->YUV420toRGB();
|
||||
//m_pcFilteredFrame->YUV420toRGB();
|
||||
return m_pcFilteredFrame;
|
||||
}
|
||||
|
||||
Void FilterFrame::destroy()
|
||||
{
|
||||
delete m_pcFilteredFrame;
|
||||
if( m_pcFilteredFrame )
|
||||
delete m_pcFilteredFrame;
|
||||
m_pcFilteredFrame = NULL;
|
||||
}
|
||||
|
||||
} // NAMESPACE
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "PlaYUVerFrame.h"
|
||||
|
||||
class QImage;
|
||||
class QAction;
|
||||
|
||||
namespace plaYUVer
|
||||
{
|
||||
@@ -54,6 +55,8 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
QAction* m_pcAction;
|
||||
|
||||
const Char* m_pchModuleType;
|
||||
const Char* m_pchModuleName;
|
||||
const Char* m_pchModuleTooltip;
|
||||
@@ -65,6 +68,8 @@ public:
|
||||
virtual PlaYUVerFrame* process( PlaYUVerFrame* ) {};
|
||||
virtual PlaYUVerFrame* getModImage() {};
|
||||
|
||||
virtual QImage* process( QImage* ) {};
|
||||
|
||||
virtual Void destroy() {};
|
||||
|
||||
};
|
||||
|
||||
@@ -140,12 +140,12 @@ void plaYUVerApp::save()
|
||||
void plaYUVerApp::selectModule( QAction *curr_action )
|
||||
{
|
||||
//emit curr_action->triggered();
|
||||
|
||||
if( m_pcModulesHandle->getSelectedModuleIf() )
|
||||
if( activeSubWindow() )
|
||||
{
|
||||
if( activeSubWindow() )
|
||||
PlaYUVerModuleIf* pcCurrMod = m_pcModulesHandle->getSelectedModuleIf();
|
||||
if( pcCurrMod )
|
||||
{
|
||||
activeSubWindow()->enableModule( m_pcModulesHandle->getSelectedModuleIf() );
|
||||
activeSubWindow()->enableModule( pcCurrMod );
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user