const std::string &boxto,
const std::string &input) // virtual
{
- _sceneManager->configGConnetion(_complexbox, boxfrom,output,boxto,input);
+ _sceneManager->configGConnetion( boxfrom,output,boxto,input);
}
//=========================================================================
/// sets the input of the box with the value
void InterpreterBBS::commandSet(const std::string &box,const std::string &input,const std::string &value) // virtual
{
- GBlackBoxModel *bbMod = _sceneManager->findGBox(box);
+ GBlackBoxModel *bbMod = (GBlackBoxModel *)_sceneManager->findGBox(box);
bbMod->setValueToInput(input,"\""+value+"\"");
}
//=========================================================================
//=========================================================================
void InterpreterBBS::commandExec(const std::string &word) // virtual
{
- GBlackBoxModel *bbMod = _sceneManager->findGBox(word);
+ GBlackBoxModel *bbMod = (GBlackBoxModel *)_sceneManager->findGBox(word);
bbMod->setExecutable(true);
}
//=========================================================================
std::string script = "";
script+="# BBTK GEditor Script\n";
script+="# ----------------------\n";
+ script+="\n";
if(existsExec)
{
script+="include std\n"; // EED
script+=packages[i];
script+="\n";
}
+ script+="\n";
// script+="include std\n"; // JPR
GPortModel* inputPort = inputs[j];
if(inputPort->isValueSet())
{
- script+="set ";
+ script+=" set ";
script+=model->getBBTKName();
script+=".";
script+=inputPort->getBBTKName();
script+="\n";
}
}
+ script+="\n";
}
+ script+="\n";
+
for(i = 0; i<(int)connections.size();i++)
{
script+="connect ";
script+="\n";
}
+ script+="\n";
for(i = 0; i<(int)execBoxes.size();i++)
{
script+="exec ";
} // while
//EED bbmod->notifyObservers(_idManager);
- } // boxes
+ } // for boxes
/// CONNECTIONS
//----------
result = strtok( NULL, delims );
std::string nameEndPort(result);
- configGConnetion(_isComplexBox, nameStartBox, nameStartPort, nameEndBox, nameEndPort);
+ configGConnetion(nameStartBox, nameStartPort, nameEndBox, nameEndPort);
//ups 3 EED Borrame
/*
std::vector<int> lstB = getBlackBoxes();
//=========================================================================
- GBlackBoxModel* wxVtkSceneManager::findGBox(std::string boxname)
+ GBoxModel* wxVtkSceneManager::findGBox(std::string boxname)
{
- GBlackBoxModel *boxModel = NULL;
- GBlackBoxModel *bbMod;
- std::vector<int> lstB = getBlackBoxes();
- int idB;
int j;
+ int idB;
+ GBoxModel *bMod;
+ GBoxModel *boxModel = NULL;
+ std::vector<int> lstB = getBlackBoxes();
for(j = 0;j<(int)lstB.size();j++)
{
- idB = lstB[j];
- bbMod = (GBlackBoxModel*)_controllers[idB]->getModel();
+ idB = lstB[j];
+ bMod = (GBoxModel*)_controllers[idB]->getModel();
if(_controllers[idB]->getModel()->getBBTKName()==boxname)
- {
- boxModel = bbMod;
+ {
+ boxModel = bMod;
}
} // for
+
+ if((_isComplexBox) && (boxModel==NULL))
+ {
+ std::vector<int> lstInputs = getComplexInputPorts();
+ for(j = 0;j<(int)lstInputs.size();j++)
+ {
+ idB = lstInputs[j];
+ bMod = (GBoxModel*)_controllers[idB]->getModel();
+ if(_controllers[idB]->getModel()->getBBTKName()==boxname)
+ {
+ boxModel = bMod;
+ }
+ } // for
+
+ std::vector<int> lstOutputs = getComplexOutputPorts();
+ for(j = 0;j<(int)lstOutputs.size();j++)
+ {
+ int idB = lstOutputs[j];
+ bMod = (GBoxModel*)_controllers[idB]->getModel();
+ if(_controllers[idB]->getModel()->getBBTKName()==boxname)
+ {
+ boxModel = bMod;
+ }
+ } // for
+
+ } // complex box
+
return boxModel;
}
//=========================================================================
- void wxVtkSceneManager::configGConnetion(bool _isComplexBox,
- std::string nameStartBox, std::string nameStartPort, std::string
+ void wxVtkSceneManager::configGConnetion(std::string nameStartBox, std::string nameStartPort, std::string
nameEndBox, std::string nameEndPort)
{
- GPortModel *startP = findGBox(nameStartBox)->getOutputPort(nameStartPort);
- GPortModel *endP = findGBox(nameEndBox)->getInputPort(nameEndPort);
+ printf("EED wxVtkSceneManager::configGConnetion 1 %s %s %s %s\n", nameStartBox.c_str(), nameStartPort.c_str(), nameEndBox.c_str(), nameEndPort.c_str() );
+
+ GBoxModel *boxModel;
+ GPortModel *startP = NULL;
+ GPortModel *endP = NULL;
+
+ boxModel= findGBox(nameStartBox);
+ if (boxModel!=NULL)
+ {
+ startP = boxModel->getOutputPort(nameStartPort);
+ }
+
+ boxModel= findGBox(nameEndBox);
+ if (boxModel!=NULL)
+ {
+ endP = boxModel->getInputPort(nameEndPort);
+ }
+
+
+ printf("EED wxVtkSceneManager::configGConnetion 2 %p %p \n", startP, endP );
/*ups5 EED Borrame
std::vector<int> lstB = getBlackBoxes();
endP = bbMod->getInputPort(nameEndPort);
}
} // for
-*/
- int j;
+
if(_isComplexBox)
{
if(startP==NULL)
std::vector<int> lstInputs = getComplexInputPorts();
for(j = 0;j<(int)lstInputs.size();j++)
{
- int idB = lstInputs[j];
- GBoxModel *cbMod = (GBoxModel*)_controllers[idB]->getModel();
+ int idB = lstInputs[j];
+ GBoxModel *cbMod = (GBoxModel*)_controllers[idB]->getModel();
if(_controllers[idB]->getModel()->getBBTKName()==nameStartBox)
{
startP = cbMod->getOutputPort(nameStartPort);
} // for
} // if endP
} // complex box
+ */
- int idCon = createGConnector(startP);
- _worldState = NOTHING_HAPPENS;
+ int idCon = createGConnector(startP);
+ _worldState = NOTHING_HAPPENS;
GConnectorController *tempp = (GConnectorController*)_controllers[idCon];
- GConnectorModel *conMod = (GConnectorModel*)tempp->getModel();
- vtkGConnectorView *conView = (vtkGConnectorView*)tempp->getView();
+ GConnectorModel *conMod = (GConnectorModel*)tempp->getModel();
+ vtkGConnectorView *conView = (vtkGConnectorView*)tempp->getView();
tempp->endContourCreation();
conMod->setEndPort(endP);
conView->updateStartEndPoints();