//QHGroupBox* aAddBox = new QHGroupBox(tr("TIT_ADDNODE"), aCorbaPane); //!!
//aAddBox->setInsideSpacing(20); //!!
- QPushButton* aComputeCBtn = new QPushButton(tr("TIT_ADDCNODE"), aCorbaPane); //!!
- connect(aComputeCBtn, SIGNAL(clicked()), this, SLOT(addComputeNode())); //!!
- aComputeCBtn->setDefault(false);
+//NRI QPushButton* aComputeCBtn = new QPushButton(tr("TIT_ADDCNODE"), aCorbaPane); //!!
+//NRI connect(aComputeCBtn, SIGNAL(clicked()), this, SLOT(addComputeNode())); //!!
+//NRI aComputeCBtn->setDefault(false);
QPushButton* aComputeBtn = new QPushButton(tr("TIT_ADDFNODE"), aCorbaPane);
connect(aComputeBtn, SIGNAL(clicked()), this, SLOT(addFactoryNode()));
aComputeBtn->setDefault(true);
aBaseLayout->addWidget(aComputeBtn);
- aBaseLayout->addWidget(aComputeCBtn); //!!
+ //NRI aBaseLayout->addWidget(aComputeCBtn); //!!
aBaseLayoutV->insertLayout(-1, aBaseLayout);
myTabPane->addTab(aCorbaPane, tr("MODULES_PANE"));
}
+char* getDataStreamParameterName(int aType)
+{
+ switch(aType) {
+ case 1:
+ return "integer";
+ case 2:
+ return "float";
+ case 3:
+ return "double";
+ case 4:
+ return "string";
+ case 6:
+ return "boolean";
+ default:
+ return "unknown";
+ }
+}
void SUPERVGUI_Service::initialise() {
CORBA::Object_ptr obj = naming->Resolve("/Kernel/ModulCatalog");
long nbComp = lComponents->length();
for (int i=0; i<nbComp; i++) {
SALOME_ModuleCatalog::Acomponent_ptr C = (*aModuleCatalog)->GetComponent((char *)lComponents[i]);
- QListViewItem* myComponentItem = new QListViewItem(components, (char*)lComponents[i]);
+ QListViewItem* myComponentItem = new QListViewItem(components, (char*)C->componentusername());
myComponentItem->setSelectable(false);
QString aIconName = C->component_icone();
if (!aIconName.isEmpty()) {
long nbPortsOut = Service->ServiceoutParameter.length();
for (int m=0; m<nbPortsOut; m++) {
SALOME_ModuleCatalog::ServicesParameter* PortOut = &(Service->ServiceoutParameter[m]);
- QListViewItem* myPortOutItem = new QListViewItem(myServiceItem, (char*)PortOut->Parametername, (char*)PortOut->Parametertype, "Out");
+ QListViewItem* myPortOutItem =
+ new QListViewItem(myServiceItem, (char*)PortOut->Parametername, (char*)PortOut->Parametertype, "Out");
+ myPortOutItem->setSelectable(false);
+ }
+
+ long nbStreamPortsOut = Service->ServiceoutDataStreamParameter.length();
+ for (int m=0; m<nbStreamPortsOut; m++) {
+ SALOME_ModuleCatalog::ServicesDataStreamParameter* PortOut = &(Service->ServiceoutDataStreamParameter[m]);
+ QListViewItem* myPortOutItem =
+ new QListViewItem(myServiceItem, (char*)PortOut->Parametername,
+ getDataStreamParameterName(PortOut->Parametertype), "DataStream Out");
myPortOutItem->setSelectable(false);
}
long nbPortsIn = Service->ServiceinParameter.length();
for (int l=0; l<nbPortsIn; l++) {
SALOME_ModuleCatalog::ServicesParameter* PortIn = &(Service->ServiceinParameter[l]);
- QListViewItem* myPortInItem = new QListViewItem(myServiceItem, (char*)PortIn->Parametername, (char*)PortIn->Parametertype, "In");
+ QListViewItem* myPortInItem =
+ new QListViewItem(myServiceItem, (char*)PortIn->Parametername, (char*)PortIn->Parametertype, "In");
+ myPortInItem->setSelectable(false);
+ }
+
+ long nbStreamPortsIn = Service->ServiceinDataStreamParameter.length();
+ for (int l=0; l<nbStreamPortsIn; l++) {
+ SALOME_ModuleCatalog::ServicesDataStreamParameter* PortIn = &(Service->ServiceinDataStreamParameter[l]);
+ QListViewItem* myPortInItem =
+ new QListViewItem(myServiceItem, (char*)PortIn->Parametername,
+ getDataStreamParameterName(PortIn->Parametertype), "DataStream In");
myPortInItem->setSelectable(false);
}
}
}
void SUPERVGUI_Service::addComputeNode() {
+ QAD_Desktop* aDesktop = QAD_Application::getDesktop();
SUPERVGUI_Main* aMain = Supervision.getMain();
if (aMain==0) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
+ QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
} else {
CORBA::Object_ptr obj = naming->Resolve("/Kernel/ModulCatalog");
SALOME_ModuleCatalog::ModuleCatalog_var* aModuleCatalog = new SALOME_ModuleCatalog::ModuleCatalog_var;
const char* service = item->text(0).latin1();
const char* interface = item->parent()->text(0).latin1();
const char* component = item->parent()->parent()->text(0).latin1();
- SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component);
+ SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(aDesktop->getComponentName(component));
if (myComponent==NULL) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
+ QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
} else {
const SALOME_ModuleCatalog::Service* myService = myComponent->GetService(interface, service);
b = true;
}
}
if (!b) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NONODE_TOADD"));
+ QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NONODE_TOADD"));
}
}
}
}
void SUPERVGUI_Service::addFactoryNode() {
+ QAD_Desktop* aDesktop = QAD_Application::getDesktop();
SUPERVGUI_Main* aMain = Supervision.getMain();
if (aMain==0) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
+ QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
} else {
CORBA::Object_ptr obj = naming->Resolve("/Kernel/ModulCatalog");
SALOME_ModuleCatalog::ModuleCatalog_var* aModuleCatalog = new SALOME_ModuleCatalog::ModuleCatalog_var;
if (item->isSelected()) {
const char* service = item->text(0).latin1();
const char* interface = item->parent()->text(0).latin1();
- const char* component = item->parent()->parent()->text(0).latin1();
+ const char* component = aDesktop->getComponentName(item->parent()->parent()->text(0).latin1());
SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component);
if (myComponent==NULL) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
+ QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
} else {
const SALOME_ModuleCatalog::Service* myService = myComponent->GetService(interface, service);
b = true;
- SUPERV_FNode node = aMain->getDataflow()->FNode(component, interface, *myService);
- if (CORBA::is_nil(node)) {
- QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
- return;
+ MESSAGE ( " myService->TypeOfNode == " << myService->TypeOfNode )
+
+ if ( myService->TypeOfNode == 0 ) { // ComputeNode
+ SUPERV_CNode node = aMain->getDataflow()->CNode(*myService);
+ if (CORBA::is_nil(node)) {
+ QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+ return;
+ }
+ node->Coords(myX, myY);
+ myX += NODE_DX;
+ myY += NODE_DY;
+ aMain->addComputeNode(SUPERV::CNode::_narrow(node));
+ } else { // Factory Node
+ SUPERV_FNode node = aMain->getDataflow()->FNode(component, interface, *myService);
+ if (CORBA::is_nil(node)) {
+ QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+ return;
+ }
+ node->Coords(myX, myY);
+ myX += NODE_DX;
+ myY += NODE_DY;
+ aMain->addComputeNode(SUPERV::CNode::_narrow(node));
+
}
- node->Coords(myX, myY);
- myX += NODE_DX;
- myY += NODE_DY;
- aMain->addComputeNode(SUPERV::CNode::_narrow(node));
- }
+
+// SUPERV_FNode node = aMain->getDataflow()->FNode(component, interface, *myService);
+// if (CORBA::is_nil(node)) {
+// QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+// return;
+// }
+// node->Coords(myX, myY);
+// myX += NODE_DX;
+// myY += NODE_DY;
+// aMain->addComputeNode(SUPERV::CNode::_narrow(node));
+ }
}
}
if (!b) {