}
//=========================================================================
-
+//EED01
void wxGUIEditorGraphicBBS::OnAddComplexBoxInput(wxCommandEvent& event)
{
wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,
wxT("Name of input port"));
- if (nameDialog->ShowModal() == wxID_OK) {
+ if (nameDialog->ShowModal() == wxID_OK)
+ {
wxString fileName = nameDialog->GetValue();
- if (!fileName.IsEmpty()) {
+ if (!fileName.IsEmpty())
+ {
std::string portName = (const char*) (fileName.mb_str());
- _tabsMgr->addActualDiagramComplexInputPort(portName);
- }
- }
+ if ( !boxNameExists(portName) )
+ {
+ _tabsMgr->addActualDiagramComplexInputPort(portName);
+ } else {
+ wxMessageDialog *dial = new wxMessageDialog(NULL,
+ wxT("Impossible to create Box. The name already exists. Please provide another name"),
+ wxT("Change name: name already exists"), wxOK | wxICON_EXCLAMATION | wxSTAY_ON_TOP);
+ dial->ShowModal();
+ }
+ } // if !fileName
+ } // if namaDialog
}
//=========================================================================
{
wxTextEntryDialog *nameDialog = new wxTextEntryDialog(this,
wxT("Name of output port"));
- if (nameDialog->ShowModal() == wxID_OK) {
+ if (nameDialog->ShowModal() == wxID_OK)
+ {
wxString fileName = nameDialog->GetValue();
- if (!fileName.IsEmpty()) {
+ if (!fileName.IsEmpty())
+ {
std::string portName = (const char*) (fileName.mb_str());
+ if ( !boxNameExists(portName) )
+ {
_tabsMgr->addActualDiagramComplexOutputPort(portName);
- }
- }
+ } else {
+ wxMessageDialog *dial = new wxMessageDialog(NULL,
+ wxT("Impossible to create Box. The name already exists. Please provide another name"),
+ wxT("Change name: name already exists"), wxOK | wxICON_EXCLAMATION | wxSTAY_ON_TOP);
+ dial->ShowModal();
+ }
+
+ } // if !filename
+ } // namaDialog
}
//=========================================================================
//=========================================================================
void wxVtkSceneManager::loadDiagram(stringstream &inputStream)
{
+
int size;
std::string version = "<void>";
std::string line = "";
}
+
//-----------------------
//- COMPLEX OUTPUT PORTS
//-----------------------
result = strtok(NULL, delims);//name
std::string name(result);
+
getCleanLine(inputStream, line);//ISEXEC:TRUE|FALSE
char exec[15];
strcpy(exec, line.c_str());
result = strtok(NULL, delims);
std::string nameEndPort(result);
+
int idCon = configGConnetion(nameStartBox, nameStartPort,nameEndBox, nameEndPort);
if (version != "1.0") {
for (j = 0; j < (int) lstB.size(); j++) {
idB = lstB[j];
bMod = (GBoxModel*) _controllers[idB]->getModel();
- if (_controllers[idB]->getModel()->getBBTKName() == boxname) {
+ if (_controllers[idB]->getModel()->getBBTKName() == boxname)
+ {
boxModel = bMod;
}
} // for
for (j = 0; j < (int) lstInputs.size(); j++) {
idB = lstInputs[j];
bMod = (GBoxModel*) _controllers[idB]->getModel();
- if (_controllers[idB]->getModel()->getBBTKName() == boxname) {
+ if (_controllers[idB]->getModel()->getBBTKName() == boxname)
+ {
boxModel = bMod;
}
} // for
for (j = 0; j < (int) lstOutputs.size(); j++) {
int idB = lstOutputs[j];
bMod = (GBoxModel*) _controllers[idB]->getModel();
- if (_controllers[idB]->getModel()->getBBTKName() == boxname) {
+ if (_controllers[idB]->getModel()->getBBTKName() == boxname)
+ {
boxModel = bMod;
}
} // for
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());
+ printf("SCP: ERROR in wxVtkSceneManager::configGConnetion start port is null. Port name is probably wrong. Start>%s::%s End>%s::%s\n", nameStartBox.c_str(), nameStartPort.c_str(), nameEndBox.c_str(), nameEndPort.c_str() );
}
}
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());
+ printf("SCP: ERROR in wxVtkSceneManager::configGConnetion end port is null. Port name is probably wrong. Start>%s::%s End>%s::%s \n", nameStartBox.c_str(), nameStartPort.c_str(), nameEndBox.c_str(), nameEndPort.c_str());
}
}