//=========================================================================
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];
}
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;
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
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