]> Creatis software - bbtkGEditor.git/commitdiff
#1372
authorcamarasu <>
Tue, 29 May 2012 09:25:15 +0000 (09:25 +0000)
committercamarasu <>
Tue, 29 May 2012 09:25:15 +0000 (09:25 +0000)
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/GObjectsMVCFactory.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx

index 0b299b8e9922f2559565e82451d45c7bd841f5f6..41b3fe06aa57e36d987bb3976983363e52234b41 100644 (file)
@@ -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];
        }
 
index 4fb42dbdafb20feab9362ca47ff96ae116f06d49..eeb3afced317a52b9aed8cc4608850f5598873fa 100644 (file)
@@ -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;
index 6de30402b985bce8502bfbb80e2fdc5cb7e3a249..dc5545af9ba4652599f22fd17aa1b2209c125b68 100644 (file)
@@ -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