diff --git a/lib/PlaYUVerOptions.cpp b/lib/PlaYUVerOptions.cpp index a9d492e..0c09b48 100644 --- a/lib/PlaYUVerOptions.cpp +++ b/lib/PlaYUVerOptions.cpp @@ -40,7 +40,6 @@ #include "config.h" #include "lib/PlaYUVerModuleIf.h" -#include "modules/PlaYUVerModuleFactory.h" #include #include @@ -708,65 +707,5 @@ Bool PlaYUVerOptions::checkListingOpts() } bRet |= true; } - if( hasOpt( "module_list" ) || hasOpt( "module_list_full" ) ) - { - listModules(); - bRet |= true; - } return bRet; } - -Void PlaYUVerOptions::listModules() -{ - Bool bDetailed = false; - - if( hasOpt( "module_list_full" ) ) - bDetailed = true; - - PlaYUVerModuleIf* pcCurrModuleIf; - PlaYUVerModuleFactoryMap& PlaYUVerModuleFactoryMap = PlaYUVerModuleFactory::Get()->getMap(); - PlaYUVerModuleFactoryMap::iterator it = PlaYUVerModuleFactoryMap.begin(); - - printf( "PlaYUVer available modules: \n" ); - printf( " [Internal Name] " ); - if( bDetailed ) - { - printf( " [Full Name] " ); - printf( " [Type] " ); - printf( " [Description]" ); - } - printf( " \n" ); - - Char ModuleNameString[40]; - - for( UInt i = 0; it != PlaYUVerModuleFactoryMap.end(); ++it, i++ ) - { - printf( " " ); - printf( "%-30s", it->first ); - if( bDetailed ) - { - ModuleNameString[0] = '\0'; - pcCurrModuleIf = it->second(); - - if( pcCurrModuleIf->m_pchModuleCategory ) - { - strcat( ModuleNameString, pcCurrModuleIf->m_pchModuleCategory ); - strcat( ModuleNameString, "/" ); - } - strcat( ModuleNameString, pcCurrModuleIf->m_pchModuleName ); - printf( " %-40s", ModuleNameString ); - switch( pcCurrModuleIf->m_iModuleType ) - { - case FRAME_PROCESSING_MODULE: - printf( " Processing " ); - break; - case FRAME_MEASUREMENT_MODULE: - printf( " Measurement " ); - break; - } - printf( " %s", pcCurrModuleIf->m_pchModuleTooltip ); - pcCurrModuleIf->Delete(); - } - printf( "\n" ); - } -} diff --git a/lib/PlaYUVerOptions.h b/lib/PlaYUVerOptions.h index c0064fa..c1fa82d 100644 --- a/lib/PlaYUVerOptions.h +++ b/lib/PlaYUVerOptions.h @@ -131,7 +131,7 @@ public: // desc ); Bool checkListingOpts(); - Void listModules(); + //Void listModules(); private: typedef std::map OptionMap; diff --git a/tools/PlaYUVerToolsCmdParser.cpp b/tools/PlaYUVerToolsCmdParser.cpp index 4d83493..99dfdac 100644 --- a/tools/PlaYUVerToolsCmdParser.cpp +++ b/tools/PlaYUVerToolsCmdParser.cpp @@ -81,6 +81,12 @@ Int PlaYUVerToolsCmdParser::parseToolsArgs( Int argc, Char* argv[] ) m_uiLogLevel = LOG_RESULT; } + if( m_cOptions.hasOpt( "module_list" ) || m_cOptions.hasOpt( "module_list_full" ) ) + { + listModules(); + iRet = 1; + } + if( m_cOptions.hasOpt( "module" ) && m_cOptions.hasOpt( "help" ) ) { listModuleHelp(); @@ -118,3 +124,58 @@ Void PlaYUVerToolsCmdParser::listModuleHelp() pcCurrModuleIf->m_cModuleOptions.doHelp( std::cout ); } } + +Void PlaYUVerToolsCmdParser::listModules() +{ + Bool bDetailed = false; + + if( m_cOptions.hasOpt( "module_list_full" ) ) + bDetailed = true; + + PlaYUVerModuleIf* pcCurrModuleIf; + PlaYUVerModuleFactoryMap& PlaYUVerModuleFactoryMap = PlaYUVerModuleFactory::Get()->getMap(); + PlaYUVerModuleFactoryMap::iterator it = PlaYUVerModuleFactoryMap.begin(); + + printf( "PlaYUVer available modules: \n" ); + printf( " [Internal Name] " ); + if( bDetailed ) + { + printf( " [Full Name] " ); + printf( " [Type] " ); + printf( " [Description]" ); + } + printf( " \n" ); + + Char ModuleNameString[40]; + + for( UInt i = 0; it != PlaYUVerModuleFactoryMap.end(); ++it, i++ ) + { + printf( " " ); + printf( "%-30s", it->first ); + if( bDetailed ) + { + ModuleNameString[0] = '\0'; + pcCurrModuleIf = it->second(); + + if( pcCurrModuleIf->m_pchModuleCategory ) + { + strcat( ModuleNameString, pcCurrModuleIf->m_pchModuleCategory ); + strcat( ModuleNameString, "/" ); + } + strcat( ModuleNameString, pcCurrModuleIf->m_pchModuleName ); + printf( " %-40s", ModuleNameString ); + switch( pcCurrModuleIf->m_iModuleType ) + { + case FRAME_PROCESSING_MODULE: + printf( " Processing " ); + break; + case FRAME_MEASUREMENT_MODULE: + printf( " Measurement " ); + break; + } + printf( " %s", pcCurrModuleIf->m_pchModuleTooltip ); + pcCurrModuleIf->Delete(); + } + printf( "\n" ); + } +}