From: camarasu <> Date: Tue, 29 May 2012 09:25:15 +0000 (+0000) Subject: #1372 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=bbtkGEditor.git;a=commitdiff_plain;h=228d83d191151e160937f836bc768365e55e1cf0 #1372 --- diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/GObjectsMVCFactory.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/GObjectsMVCFactory.cxx index 0b299b8..41b3fe0 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/GObjectsMVCFactory.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/GObjectsMVCFactory.cxx @@ -62,10 +62,20 @@ namespace bbtk //========================================================================= BlackBoxDescriptor::Pointer GObjectsMVCFactory::getBlackBoxDescriptor(std::string packageName, std::string boxName) - { - Factory::Pointer factory = _interpreter->GetExecuter()->GetFactory(); - Package::Pointer k = factory->GetPackage(packageName); - std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc = k->GetDescriptorMap(); + { + Factory::Pointer factory; + Package::Pointer k; + std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc; + try{ + factory = _interpreter->GetExecuter()->GetFactory(); + k = factory->GetPackage(packageName); + mapDesc = k->GetDescriptorMap(); + }catch(Exception e){ + printf("SCP: Exception in BlackBoxDescriptor::Pointer GObjectsMVCFactory::getBlackBoxDescriptor for package %s\n", packageName.c_str()); + printf("SCP: ERROR package %s probably does not exist\n", packageName.c_str()); + } + + return mapDesc[boxName]; } diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx index 4fb42db..eeb3afc 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx @@ -825,6 +825,7 @@ void wxGUIEditorGraphicBBS::OnCenterViewActualDiagram(wxCommandEvent& event) { void wxGUIEditorGraphicBBS::OnOpenDiagram(wxCommandEvent& event) { wxFileDialog * openFileDialog = new wxFileDialog(this, wxT("Open diagram"), wxEmptyString, wxT(""), wxT("*.bbg"), wxOPEN | wxFILE_MUST_EXIST); + printf("SCP: wxGUIEditorGraphicBBS::OnOpenDiagram \n"); if (openFileDialog->ShowModal() == wxID_OK) { wxString fileName = openFileDialog->GetPath(); ifstream inputStream; diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index 6de3040..dc5545a 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -252,7 +252,9 @@ int wxVtkSceneManager::createGBlackBox(int x, int y, std::string packageName, BlackBoxDescriptor::Pointer descriptor = GObjectsMVCFactory::getInstance()->getBlackBoxDescriptor( packageName, boxType); - + if (descriptor == NULL){ + printf("SCP: ERROR in wxVtkSceneManager::createGBlackBox, box %s probably does not exist.\n", boxType.c_str()); + } //Prepares the initial model //The coordinates obtained are the following. Top-Left:x=0,y=0 Bottom-Right:x=width,y=height @@ -2171,11 +2173,17 @@ int wxVtkSceneManager::configGConnetion(std::string nameStartBox, boxModel = findGBox(nameStartBox); if (boxModel != NULL) { startP = boxModel->getOutputPort(nameStartPort); + if(startP == NULL){ + printf("SCP: ERROR in wxVtkSceneManager::configGConnetion start port %s is null. Port name is probably wrong.\n", nameStartPort.c_str()); + } } boxModel = findGBox(nameEndBox); if (boxModel != NULL) { endP = boxModel->getInputPort(nameEndPort); + if(endP == NULL){ + printf("SCP: ERROR in wxVtkSceneManager::configGConnetion end port %s is null. Port name is probably wrong\n", nameStartPort.c_str(), nameEndPort.c_str()); + } } //ups2