00001 #include <QVBoxLayout> 00002 #include <ros/package.h> 00003 #include "rqt_mrta/define_architecture_widget.h" 00004 #include "rqt_mrta/define_architecture_wizard_page.h" 00005 #include "rqt_mrta/ui_define_architecture_widget.h" 00006 00007 namespace rqt_mrta 00008 { 00009 DefineArchitectureWizardPage::DefineArchitectureWizardPage( 00010 NewApplicationWizard* parent) 00011 : NewApplicationWizardPage(parent, "Define the Architecture") 00012 { 00013 DefineArchitectureWidget* widget = new DefineArchitectureWidget( 00014 this, application_config_, architecture_config_); 00015 registerField("architecture*", widget->ui_->architectures_combo_box); 00016 connect(widget, SIGNAL(changed()), this, SIGNAL(completeChanged())); 00017 setWidget(widget); 00018 } 00019 00020 DefineArchitectureWizardPage::~DefineArchitectureWizardPage() {} 00021 00022 bool DefineArchitectureWizardPage::validatePage() 00023 { 00024 if (!application_config_ || !architecture_config_) 00025 { 00026 return false; 00027 } 00028 QString package(application_config_->getApplication()->getArchitecturePackage()); 00029 QString url(QString::fromStdString(ros::package::getPath(package.toStdString()))); 00030 architecture_config_->load(url + "/rqt_mrta.xml"); 00031 return true; 00032 } 00033 00034 bool DefineArchitectureWizardPage::isComplete() const 00035 { 00036 return !application_config_->getApplication() 00037 ->getArchitecturePackage() 00038 .isEmpty(); 00039 } 00040 }