X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FwxCDMProjectActionsPanel.cpp;h=5b5cc09279986c0f70abb1e7ea993c82910a77eb;hb=752294dd30e2ee94f38be513d441f4716509ce13;hp=ea9062f8f20d924eccdf7293a9db417cd2258562;hpb=5413640f931dc9bc9b3c24a27f42c3cf40c35072;p=crea.git diff --git a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp index ea9062f..5b5cc09 100755 --- a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp @@ -33,17 +33,19 @@ #include "wxCDMProjectActionsPanel.h" +#include + #include "creaDevManagerIds.h" BEGIN_EVENT_TABLE(wxCDMProjectActionsPanel, wxPanel) EVT_BUTTON(ID_BUTTON_BUILD_PROJECT, wxCDMProjectActionsPanel::OnBtnBuildProject) EVT_BUTTON(ID_BUTTON_CONFIGURE_BUILD, wxCDMProjectActionsPanel::OnBtnConfigureBuild) -EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMProjectActionsPanel::OnBtnEditCMakeLists) EVT_BUTTON(ID_BUTTON_CONNECT_PROJECT, wxCDMProjectActionsPanel::OnBtnConnectProject) END_EVENT_TABLE() wxCDMProjectActionsPanel::wxCDMProjectActionsPanel( wxWindow* parent, + modelCDMProject* project, wxWindowID id, const wxString& caption, const wxPoint& pos, @@ -52,6 +54,7 @@ wxCDMProjectActionsPanel::wxCDMProjectActionsPanel( ) { wxCDMProjectActionsPanel::Create(parent,id,caption,pos,size,style); + this->project = project; } wxCDMProjectActionsPanel::~wxCDMProjectActionsPanel() @@ -78,10 +81,10 @@ bool wxCDMProjectActionsPanel::Create( void wxCDMProjectActionsPanel::CreateControls() { - wxButton* configurebt = new wxButton(this, ID_BUTTON_CONFIGURE_BUILD, _T("1. Configure Project")); - configurebt->SetToolTip(wxT("This is the first step in order to execute the project.")); + wxButton* configurebt = new wxButton(this, ID_BUTTON_CONFIGURE_BUILD, _T("1. Configure Project (CMake)")); + configurebt->SetToolTip(wxT("This is the first step in order to execute the project. Make sure you have selected the desired Build location.")); wxButton* compilebt = new wxButton(this, ID_BUTTON_BUILD_PROJECT, _T("2. Compile Project")); - compilebt->SetToolTip(wxT("This step should be done after configuring the project. This will create the executables")); + compilebt->SetToolTip(wxT("This step should be done after configuring the project. This will create the executables.")); wxButton* plugbt = new wxButton(this, ID_BUTTON_CONNECT_PROJECT, _T("3. Plug Packages (BBTK)")); plugbt->SetToolTip(wxT("This step should be done after compiling the project. This will allow to use the boxes in this project to be available in the bbEditor.")); this->GetSizer()->Add(configurebt, 0, wxALL, 5); @@ -89,30 +92,42 @@ void wxCDMProjectActionsPanel::CreateControls() this->GetSizer()->Add(plugbt, 0, wxALL, 5); } -void wxCDMProjectActionsPanel::OnBtnBuildProject(wxCommandEvent& event) -{ - //TODO: implement method - std::cerr << "Event OnBtnBuildProject not implemented" << std::endl; - event.Skip(); -} - +//configure project void wxCDMProjectActionsPanel::OnBtnConfigureBuild(wxCommandEvent& event) { - //TODO: implement method - std::cerr << "Event OnBtnConfigureBuild not implemented" << std::endl; - event.Skip(); + std::string* result; + if(!this->project->ConfigureBuild(result)) + { + wxMessageBox(crea::std2wx(result->c_str()), wxT("Project Configuration - Error!")); + return; + } + wxMessageBox(crea::std2wx("The configuration was executed successfully."), wxT("Project Configuration")); } -void wxCDMProjectActionsPanel::OnBtnEditCMakeLists(wxCommandEvent& event) +//compile project +void wxCDMProjectActionsPanel::OnBtnBuildProject(wxCommandEvent& event) { - //TODO: implement method - std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl; - event.Skip(); + std::string* result; + //wxProgressDialog* loadBar = new wxProgressDialog(wxT("Compiling"), wxT("Please wait while the compilation is executing..."), 100, this); + //loadBar->Pulse(); + if(!this->project->Build(result)) + { + //loadBar->Destroy(); + wxMessageBox(crea::std2wx(result->c_str()), wxT("Project Compilation - Error!")); + return; + } + //loadBar->Destroy(); + wxMessageBox(crea::std2wx("The compilation was executed successfully. Please check the \"building.log\" file located in the build folder to check the compilation result."), wxT("Project Compilation")); } +//plug packages void wxCDMProjectActionsPanel::OnBtnConnectProject(wxCommandEvent& event) { - //TODO: implement method - std::cerr << "Event OnBtnConnectProject not implemented" << std::endl; - event.Skip(); + std::string* result; + if(!this->project->Connect(result)) + { + wxMessageBox(crea::std2wx(result->c_str()), wxT("Plug Packages - Error!")); + return; + } + wxMessageBox(crea::std2wx("The connection was executed successfully. Please check the \"plugging.log\" file located in the build folder to check the compilation result."), wxT("Plug Package")); }