00001 /*!@file Qt/ModelManagerControl.ui.h functions relating to model control 00002 panel */ 00003 00004 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Qt/ModelManagerControl.ui.h $ 00005 // $Id: ModelManagerControl.ui.h 12962 2010-03-06 02:13:53Z irock $ 00006 00007 /**************************************************************************** 00008 ** ui.h extension file, included from the uic-generated form implementation. 00009 ** 00010 ** If you wish to add, delete or rename functions or slots use 00011 ** Qt Designer which will update this file, preserving your code. Create an 00012 ** init() function in place of a constructor, and a destroy() function in 00013 ** place of a destructor. 00014 *****************************************************************************/ 00015 00016 00017 void ModelManagerControl::showConfigDialog( void ) 00018 { 00019 mmd.init( *mgr ); 00020 mmd.show(); 00021 } 00022 00023 00024 void ModelManagerControl::loadConfig( void ) 00025 { 00026 QString fname = QFileDialog::getOpenFileName( mgr->getModelParamString( "LoadConfigFile" ).c_str() ); 00027 if( !fname.isNull() && !fname.isEmpty() ) 00028 mgr->loadConfig( std::string( fname.ascii() ) ); 00029 } 00030 00031 00032 void ModelManagerControl::saveConfig( void ) 00033 { 00034 QString fname = QFileDialog::getSaveFileName( mgr->getModelParamString( "SaveConfigFile" ).c_str() ); 00035 if( !fname.isNull() && !fname.isEmpty() ) 00036 mgr->saveConfig( std::string( fname.ascii() ) ); 00037 } 00038 00039 00040 void ModelManagerControl::start_or_stop( void ) 00041 { 00042 if( mgr->started() ) 00043 { 00044 startstopButton->setText( "Start" ); 00045 configButton->setEnabled( true ); 00046 *dorun = false; 00047 } 00048 else 00049 { 00050 startstopButton->setText( "Stop" ); 00051 configButton->setEnabled( false ); 00052 *dorun = true; 00053 } 00054 } 00055 00056 00057 void ModelManagerControl::init( ModelManager & manager, bool *dorun_ ) 00058 { 00059 mgr = &manager; 00060 dorun = dorun_; 00061 mmd.init( manager ); 00062 } 00063 00064 00065 void ModelManagerControl::exitPressed( void ) 00066 { 00067 if( mgr->started() ) 00068 mgr->stop(); 00069 close(); 00070 }