\param aContainer Container containing the component.
*/
boolean SetContainer(in string aContainer ) ;
+/*! Method to define if %FNode gets from a component, which is implemented in C++ or Python.
+ Returns True if it's a C++ component node
+*/
+ boolean IsCimpl() ;
+
} ;
/*! \brief %INode class
*/
SUPERV::FNode FNode( in string aComponentName ,
in string anInterfaceName ,
- in SALOME_ModuleCatalog::Service aService ) ;
+ in SALOME_ModuleCatalog::Service aService ,
+ in boolean isCimpl ) ;
/*! Creates an InLine Node in a Graph.
*/
}
}
-bool GraphBase::ComputingNode::IsLinked(const char * ToServiceParameterName ) {
+bool GraphBase::ComputingNode::IsLinked(const char * ToServiceParameterName, bool isInput ) {
bool RetVal = false ;
- const GraphBase::InPort * thePort = GetInPort( ToServiceParameterName ) ;
- if ( thePort ) {
- RetVal = thePort->IsPortConnected() ;
+ if ( isInput ) { // mkr : PAL8060
+ // we have to know the type of the port, because of input and output ports
+ // belong to one node may have the same names
+ const GraphBase::InPort * thePort = GetInPort( ToServiceParameterName ) ;
+ if ( thePort ) {
+ RetVal = thePort->IsPortConnected() ;
+ }
}
else {
const GraphBase::OutPort * thePort = GetOutPort( ToServiceParameterName ) ;
cdebug << "UpdateMacroPorts DelInPort In" << i << " " << GetNodeInPort( i )->PortName() << " "
<< GetNodeInPort( i )->PortType() << " " << GetNodeInPort( i )->Kind() << endl ;
DelInPort( GetNodeInPort( i )->PortName() ) ;
+ i--; // mkr : fix for bug PAL8004
}
}
int index ;
const char * ServiceParameterName ,
char ** aNode , char ** aPort ) ;
- bool IsLinked(const char * ToServiceParameterName ) ;
+ bool IsLinked(const char * ToServiceParameterName, bool isInput ) ; // mkr : PAL8060
bool HasInput(const char * ToServiceParameterName ) ;
GraphBase::SNode * GetInfo() ;
inline long GraphEditor::DataFlow::LevelMax() {
// if ( !IsValid( false ) ) {
- if ( !IsExecutable() ) {
+// if ( !IsExecutable() ) {
+ // mkr : IPAL9974 -->
+ int SubStreamGraphsNumber = 0 ;
+ if ( !IsValid() || !Graph()->Sort( SubStreamGraphsNumber ) ) {
+ // mkr : IPAL9974 <--
return 0 ;
}
return Graph()->LevelMax() ;
inline SUPERV::ListOfStrings * GraphEditor::DataFlow::LevelNodes(long aLevel ) {
// if ( !IsValid( false ) ) {
- if ( !IsExecutable() ) {
+// if ( !IsExecutable() ) {
+ if ( !IsValid() ) { // mkr : IPAL9974
return ((SUPERV::ListOfStrings * ) NULL ) ;
}
return Graph()->LevelNodes( aLevel ) ;
inline long GraphEditor::DataFlow::ThreadsMax() {
// if ( !IsValid() ) {
- if ( !IsExecutable() ) {
+// if ( !IsExecutable() ) {
+ // mkr : IPAL9974 -->
+ int SubStreamGraphsNumber = 0 ;
+ if ( !IsValid() || !Graph()->Sort( SubStreamGraphsNumber ) ) {
+ // mkr : IPAL9974 <--
return 0 ;
}
return Graph()->ThreadsMax() ;
void DelOutPort( const char * OutputParameterName ) {
_ComputingNode->DelOutPort( OutputParameterName ) ; } ;
- bool IsLinked(const char * ToServiceParameterName ) {
- return _ComputingNode->IsLinked( ToServiceParameterName ) ; } ;
+ bool IsLinked(const char * ToServiceParameterName, bool isInput ) {
+ return _ComputingNode->IsLinked( ToServiceParameterName, isInput ) ; } ; // mkr : PAL8060
bool HasInput(const char * ToServiceParameterName ) {
return _ComputingNode->HasInput( ToServiceParameterName ) ; } ;
map< string , int > _MapOfGraphNames;
string GraphInstanceName( const char * aGraphName ) {
+ // mkr : PAL8004 -->
+ // For Macro nodes : names of subgraphs must be unique and differ from the main dataflow
+ // name (i.e. the dataflow with MacroLevel = 0).
+ // It is neccessary for reqursive call of LoadDataFlows(...) method for MacroNodes execution.
int GraphInstanceNumber = _MapOfGraphNames[ aGraphName ] ;
- if ( GraphInstanceNumber ) {
- _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ;
- }
- else {
- GraphInstanceNumber = 0 ;
- _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ;
- }
string theGraphInstanceName = string( aGraphName ) ;
if ( GraphInstanceNumber ) {
theGraphInstanceName += "_" ;
astr << GraphInstanceNumber ;
theGraphInstanceName += astr.str() ;
}
+ if ( theGraphInstanceName != string( aGraphName ) )
+ _MapOfGraphNames[ theGraphInstanceName ] = GraphInstanceNumber ;
+ _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ;
+ // mkr : PAL8004 <--
return theGraphInstanceName ;
}
SUPERVGUI_Notification.cxx \
SUPERVGUI_ManagePortsDlg.cxx \
SUPERVGUI_Library.cxx \
- SUPERVGUI_Clipboard.cxx
+ SUPERVGUI_Clipboard.cxx
LIB_MOC = SUPERVGUI.h \
SUPERVGUI_ArrayView.h \
SUPERVGUI_Notification.h \
SUPERVGUI_ManagePortsDlg.h \
SUPERVGUI_Library.h \
- SUPERVGUI_Clipboard.h
+ SUPERVGUI_Clipboard.h
LIB_CLIENT_IDL = SALOMEDS.idl \
SALOMEDS_Attributes.idl \
// Author : Francis KLOSS
// Module : SUPERV
-using namespace std;
#include "SUPERVGUI.h"
#include "SUPERVGUI_DataModel.h"
#include "SUPERVGUI_Selection.h"
-
-#include "SALOMEDSClient.hxx"
-#include <boost/shared_ptr.hpp>
-using namespace boost;
-
#include "CAM_Application.h"
#include "OB_Browser.h"
#include "OB_ListItem.h"
#include <qinputdialog.h>
#include <qmenubar.h>
+#include "SALOMEDSClient.hxx"
+#include <boost/shared_ptr.hpp>
+using namespace boost;
+
int SUPERVGUI::factory = 0;
extern "C" {
else {
// second case : get empty initial view frame as new ViewFrame object
aViewFrame = myInitialViewFrame;
+ // mkr : PAL8237 : remove first "gag" Main from children
+ aViewFrame->removeChild( aViewFrame->queryList("SUPERVGUI_Main")->first() );
}
if( aViewFrame ) {
else {
// 2. get empty initial view frame as new ViewFrame object
aViewFrame = myInitialViewFrame;
+ // mkr : PAL8237 : remove first "gag" Main from children
+ aViewFrame->removeChild( aViewFrame->queryList("SUPERVGUI_Main")->first() );
}
if ( aViewFrame ) {
// Author :
// Module : SUPERV
-
-using namespace std;
#include "SUPERVGUI.h"
#include "SUPERVGUI_ArrayView.h"
#include "SUPERVGUI_Main.h"
#include "SUPERVGUI_CanvasCellNodePrs.h"
+#include "SUPERVGUI_CanvasLink.h"
+#include "SUPERVGUI_CanvasPort.h"
#include <qcolordialog.h>
// compute collision rectangle
QRect aSel(theP.x()-MARGIN, theP.y()-MARGIN, 1+2*MARGIN, 1+2*MARGIN);
- QCanvasItemList l = ((SUPERVGUI_ArrayView*)parentWidget())->canvas()->collisions(aSel);
+ QCanvasItemList l = ((QCanvasView*)parentWidget())->canvas()->collisions(aSel);
for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
+ // tooltip for node
if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_Node) {
- SUPERVGUI_CanvasCellNodePrs* aNodePrs = (SUPERVGUI_CanvasCellNodePrs*) (*it);
+ SUPERVGUI_CanvasNodePrs* aNodePrs = (SUPERVGUI_CanvasNodePrs*) (*it);
QObject* anObj = aNodePrs->getObject(theP);
- if (anObj->inherits("SUPERVGUI_CanvasCellNode")) {
+ if (anObj->inherits("SUPERVGUI_CanvasNode")) {
QRect aTitleRect = aNodePrs->getTitleRect();
+ QRect aLabelRect = aNodePrs->getLabelRect();
+ QRect aStatusRect = aNodePrs->getStatusRect();
+
+ if (aTitleRect.bottom()+1 == aLabelRect.top() &&
+ aLabelRect.bottom()+1 == aStatusRect.top()) {
+ QRect aTipRect(aTitleRect.left(), aTitleRect.top(), aTitleRect.width(),
+ aTitleRect.height() + aLabelRect.height() + aStatusRect.height());
+ tip(aTipRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
+ return;
+ }
+
if (aTitleRect.contains(theP, true)) {
- tip(aTitleRect, ((SUPERVGUI_CanvasCellNode*)anObj)->getEngine()->Name());
+ tip(aTitleRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
return;
}
- QRect aLabelRect = aNodePrs->getLabelRect();
if (aLabelRect.contains(theP, true)) {
- tip(aLabelRect, ((SUPERVGUI_CanvasCellNode*)anObj)->getLabelText());
+ tip(aLabelRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
return;
}
+
+ if (aStatusRect.contains(theP, true)) {
+ tip(aStatusRect, ((SUPERVGUI_CanvasNode*)anObj)->getToolTipText());
+ return;
+ }
+
}
+ // tooltip for nodes' port
+ if (anObj->inherits("SUPERVGUI_CanvasPort")) {
+ SUPERVGUI_CanvasPort* aPort = (SUPERVGUI_CanvasPort*)anObj;
+ tip(aPort->getPrs()->getPortRect(),
+ aPort->getEngine()->Type() + QString(" ") + aPort->getPrs()->getText());
+ return;
+ }
+ }
+ // tootip for links' point
+ if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_LinkPoint) {
+ SUPERVGUI_CanvasPointPrs* aPrs = (SUPERVGUI_CanvasPointPrs*) (*it);
+ if (aPrs->getLink()->getMain()->getViewType() == CANVAS)
+ tip(aSel, aPrs->getLink()->getToolTipText());
+ return;
+ }
+ // tooltip for links' edge
+ if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_LinkEdge) {
+ SUPERVGUI_CanvasEdgePrs* aPrs = (SUPERVGUI_CanvasEdgePrs*) (*it);
+ if (aPrs->getLink()->getMain()->getViewType() == CANVAS)
+ tip(aSel, aPrs->getLink()->getToolTipText());
+ return;
}
}
}
// Author : Vitaly SMETANNIKOV
// Module : SUPERV
-using namespace std;
-
#include "SALOMEDSClient.hxx"
#include "SALOMEDS_SObject.hxx"
#include "SALOMEDS_Study.hxx"
-#include <boost/shared_ptr.hpp>
-using namespace boost;
#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include <qgroupbox.h>
#include <qvalidator.h>
+#include <boost/shared_ptr.hpp>
+using namespace boost;
+
/**
* Constructor
*/
void SUPERVGUI_BrowseNodeDlg::setValues() {
SUPERVGUI_PortField* aField;
for ( aField = myPortsList.first(); aField; aField = myPortsList.next() ) {
- aField->updateGUI();
+ if ( aField->getData().isEmpty() || aField->getData().isNull() ) // mkr : PAL11406
+ aField->updateGUI();
}
}
bool isEditable () { return myIsEditable; }
- void setData( const QString& data ) { myValue->setText( data ); myValue->home( false ); }
- void updateGUI() { myValue->setText( myPort->ToString() ); }
+ QString getData() const { return myValue->text(); } // mkr : PAL11406
+ void setData( const QString& data ) { myValue->setText( data ); myValue->home( false ); }
+ void updateGUI() { myValue->setText( myPort->ToString() ); }
bool setNewValue();
// Author : Natalia KOPNOVA
// Module : SUPERV
-using namespace std;
#include "SUPERVGUI.h"
#include "SUPERVGUI_Def.h"
#include "SUPERVGUI_Main.h"
#ifndef SUPERVGUI_Canvas_H
#define SUPERVGUI_Canvas_H
-using namespace std;
#include "SUPERVGUI_Def.h"
#include <qcanvas.h>
// Author :
// Module : SUPERV
-using namespace std;
#include "SUPERVGUI.h"
#include "SUPERVGUI_CanvasArray.h"
#include "SUPERVGUI_Main.h"
int x, y;
int nligs = myMain->getDataflow()->LevelMax();
- cout<<"-> myMain->getDataflow()->LevelMax() = "<<myMain->getDataflow()->LevelMax()<<endl;
int ncols = myMain->getDataflow()->ThreadsMax();
- cout<<"-> myMain->getDataflow()->ThreadsMax() = "<<myMain->getDataflow()->ThreadsMax()<<endl;
// there is no any calculations
if (ncols == 0) return false;
#ifndef SUPERVGUI_CanvasArray_H
#define SUPERVGUI_CanvasArray_H
-using namespace std;
#include "SUPERVGUI_Def.h"
#include "SUPERVGUI_CanvasControlNode.h"
#ifndef SUPERVGUI_CanvasCellNodePrs_H
#define SUPERVGUI_CanvasCellNodePrs_H
-using namespace std;
#include "SUPERVGUI_Def.h"
#include "SUPERVGUI_CanvasNodePrs.h"
#include "SUPERVGUI_CanvasControlNode.h"
// Author : Natalia KOPNOVA
// Module : SUPERV
-using namespace std;
#include "SUPERVGUI_CanvasControlNode.h"
#include "SUPERVGUI_CanvasControlNodePrs.h"
#include "SUPERVGUI_CanvasCellNodePrs.h"
#ifndef SUPERVGUI_CanvasControlNode_H
#define SUPERVGUI_CanvasControlNode_H
-using namespace std;
#include "SUPERVGUI_Def.h"
#include "SUPERVGUI_CanvasNode.h"
#include <qdialog.h>
// Author : Natalia KOPNOVA
// Module : SUPERV
-
-using namespace std;
#include "SUPERVGUI_CanvasControlNodePrs.h"
#include "SUPERVGUI_CanvasControlNode.h"
#include "SUPERVGUI_Canvas.h"
#ifndef SUPERVGUI_CanvasControlNodePrs_H
#define SUPERVGUI_CanvasControlNodePrs_H
-using namespace std;
#include "SUPERVGUI_Def.h"
#include "SUPERVGUI_CanvasNodePrs.h"
// Author : Natalia KOPNOVA
// Module : SUPERV
-using namespace std;
#include "SUPERVGUI_CanvasLink.h"
#include "SUPERVGUI_Canvas.h"
#include "SUPERVGUI_CanvasPort.h"
else
myColor = DRAW_COLOR;
}
+
+ // mkr : PAL8237
+ connect(this, SIGNAL(objectCreatedDeleted()), myMain, SLOT(onObjectCreatedDeleted()));
}
SUPERVGUI_CanvasLink::~SUPERVGUI_CanvasLink()
}
}
myLink->destroy();
+
+ emit objectCreatedDeleted(); // mkr : PAL8237
}
+
delete this;
if (aPort && !aValue.isEmpty() && myMain->getDataflow()->GraphLevel() == 0) {
aPort->setValue(aValue);
anIndex = aPoint->getIndex()+1;
if (anIndex < 1) anIndex = 1;
}
- if (myLink && !SUPERV_isNull(myLink))
+ if (myLink && !SUPERV_isNull(myLink)) {
myLink->AddCoord(anIndex, mySelectedPoint.x(), mySelectedPoint.y());
+ emit objectCreatedDeleted(); // mkr : PAL8237
+ }
merge();
myMain->getCanvas()->update();
}
void SUPERVGUI_CanvasLink::removePoint() {
if (mySelectedItem && mySelectedItem->rtti() == SUPERVGUI_Canvas::Rtti_LinkPoint) {
SUPERVGUI_CanvasPointPrs* aPoint = (SUPERVGUI_CanvasPointPrs*) mySelectedItem;
- if (myLink && !SUPERV_isNull(myLink))
+ if (myLink && !SUPERV_isNull(myLink)) {
myLink->RemoveCoord(aPoint->getIndex());
+ emit objectCreatedDeleted(); // mkr : PAL8237
+ }
merge();
myMain->getCanvas()->update();
}
}
+QString SUPERVGUI_CanvasLink::getToolTipText() const {
+ QString aTTT;
+ if (myInputPort && myOutputPort)
+ aTTT = myOutputPort->getEngine()->Node()->Name() + QString(" : ") +
+ myOutputPort->getEngine()->Name() + QString(" => ") +
+ myInputPort->getEngine()->Node()->Name() + QString(" : ") +
+ myInputPort->getEngine()->Name();
+ return aTTT;
+}
+
/*
//===============================================================================
// SUPERVGUI_CanvasStreamLink: new link to be created
#ifndef SUPERVGUI_CanvasLink_H
#define SUPERVGUI_CanvasLink_H
-using namespace std;
#include "SUPERVGUI_Def.h"
#include <qcanvas.h>
#include <qvaluevector.h>
void setSelectedObject(QCanvasItem* theItem, const QPoint& thePoint);
virtual QPopupMenu* getPopupMenu(QWidget* theParent);
+ QString getToolTipText() const;
+
+ signals:
+ void objectCreatedDeleted(); // mkr : PAL8237
+
public slots:
virtual void remove();
void addPoint();
// Author : Natalia KOPNOVA
// Module : SUPERV
-using namespace std;
#include "SUPERVGUI_CanvasNode.h"
#include "SUPERVGUI_CanvasNodePrs.h"
#include "SUPERVGUI_CanvasPort.h"
}
isIgnore = false;
+
+ // mkr : PAL8237
+ connect(this, SIGNAL(objectCreatedDeleted()), myMain, SLOT(onObjectCreatedDeleted()));
+ emit objectCreatedDeleted();
}
SUPERVGUI_CanvasNode::~SUPERVGUI_CanvasNode()
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasNode::createPrs() const
{
+ //
+ //SUPERVGUI_PrsNode* glNode = new SUPERVGUI_PrsNode( (SUPERVGUI_CanvasNode*)this );
+ //glNode->setFirstPoint( new GLViewer_Pnt( 10, 10 ) );
+ //glNode->compute();
+ //glNode->update();
+ //getGLContext()->insertObject( glNode, true /*false*/ );
+ //
+
return new SUPERVGUI_CanvasNodePrs( myMgr, myMain->getCanvas(), (SUPERVGUI_CanvasNode*)this);
}
if (aPort) {
connect(aPort, SIGNAL(destroyed(QObject*)), this, SLOT(onDestroyed(QObject*)));
if (!isIgnore) getPrs()->updatePorts();
+
+ emit objectCreatedDeleted(); // mkr : PAL8237
}
}
SUPERVGUI_Canvas* aCanvas = myMain->getCanvas();
setDestroyed();
myNode->destroy();
+
+ emit objectCreatedDeleted(); // mkr : PAL8237
+
delete this;
aCanvas->update();
}
else
SUIT_MessageBox::error1( SUIT_Session::session()->activeApplication()->desktop(), tr( "ERROR" ), tr( "MSG_BAD_INODE" ), tr( "OK" ) );
}
+
+QString SUPERVGUI_CanvasNode::getToolTipText() const {
+ if ( myNode->IsFactory() )
+ return QString("Name : ") + SUPERV::FNode::_narrow(myNode)->Name() +
+ QString("\nContainer : ") + SUPERV::FNode::_narrow(myNode)->GetContainer() +
+ QString("\nComponentName : ") + SUPERV::FNode::_narrow(myNode)->GetComponentName() +
+ QString("\nInterfaceName : ") + SUPERV::FNode::_narrow(myNode)->GetInterfaceName();
+ return QString("Name : ") + myNode->Name() + '\n' + getLabelText();
+}
#ifndef SUPERVGUI_CanvasNode_H
#define SUPERVGUI_CanvasNode_H
-using namespace std;
#include "SUPERVGUI_Def.h"
#include "SUPERVGUI_BrowseNodeDlg.h"
#include <qstringlist.h>
QString getLabelText() const { return myLabelText; }
+ virtual QString getToolTipText() const;
+
+ signals:
+ void objectCreatedDeleted(); // mkr : PAL8237
+
public slots:
void suspendResume();
void kill();
virtual void pastePort();
void managePorts();
void exportToLib();
-
+
protected:
// redefined by most of CanvasNode successors
virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
// Author : Natalia KOPNOVA
// Module : SUPERV
-using namespace std;
#include "SUPERVGUI_CanvasNodePrs.h"
#include "SUPERVGUI_CanvasNode.h"
#include "SUPERVGUI_CanvasPort.h"
#include "SUPERVGUI_Canvas.h"
#include "SUPERVGUI_CanvasCellNodePrs.h"
+#include "SUPERVGUI_Main.h"
#include "SUIT_ResourceMgr.h"
#include <sys/timeb.h>
#endif
-#define PORT_MARGIN 2
+//#define PORT_MARGIN 2
#undef PORT_HEIGHT // to avoid warning message
#define PORT_HEIGHT LABEL_HEIGHT
#define TEXT_MARGIN 5
{
thePainter.setPen(pen());
thePainter.setBrush(nodeColor());
- drawShape(thePainter);
+ if ( !CORBA::is_nil( myNode->getMain()->getDataflow()->Node( myNode->name() ) ) ) // mkr : IPAL11360
+ drawShape(thePainter);
}
void SUPERVGUI_CanvasNodePrs::drawShape(QPainter& thePainter)
++it;
if (obj->inherits("SUPERVGUI_CanvasPort")) {
aPort = (SUPERVGUI_CanvasPort*) obj;
- if (!aPort->getEngine()->IsGate()) {
+
+ SUPERV_Port aPortEng = aPort->getEngine();
+ // if ( CORBA::is_nil( aPortEng ) )
+ // printf ( "---\n port engine IS NIL ---\n\n" );
+
+ if ( !CORBA::is_nil( aPortEng ) && !aPortEng->IsGate() ) {
aPort->getPrs()->draw(thePainter);
}
}
QString SUPERVGUI_CanvasPortPrs::getText() const
{
SUPERV_Port aPort = myPort->getEngine();
- QString aText = aPort->Name();
- if (aPort->IsParam() || aPort->IsInLine() || myPort->isStream())
- aText = aText + "=" + aPort->ToString();
+ QString aText;
+ if ( !CORBA::is_nil( aPort ) ) {
+ aText = aPort->Name();
+ if (aPort->IsParam() || aPort->IsInLine() || myPort->isStream())
+ aText = aText + "=" + aPort->ToString();
+ }
+ // printf( "--- return text of port : %s ---\n", aText.latin1() );
return aText;
}
#ifndef SUPERVGUI_CanvasNodePrs_H
#define SUPERVGUI_CanvasNodePrs_H
-using namespace std;
#include "SUPERVGUI_Def.h"
#include <qcanvas.h>
// Author : Natalia KOPNOVA
// Module : SUPERV
-using namespace std;
#include "SUPERVGUI_CanvasPort.h"
#include "SUPERVGUI_CanvasNode.h"
#include "SUPERVGUI_CanvasLink.h"
// setName(myPort->Name());
setName(myMain->getCanvas()->getPortName(thePort));
+
+ // mkr : PAL8237
+ connect(this, SIGNAL(objectDeleted()), myMain, SLOT(onObjectCreatedDeleted()));
}
SUPERVGUI_CanvasPort::~SUPERVGUI_CanvasPort()
Trace("SUPERVGUI_CanvasPort::remove");
myPort->destroy();
+
+ emit objectDeleted(); // mkr : PAL8237
+
delete this;
}
#ifndef SUPERVGUI_CanvasPort_H
#define SUPERVGUI_CanvasPort_H
-using namespace std;
#include "SUPERVGUI_Def.h"
void removeLink(SUPERVGUI_CanvasLink* theLink);
void updateLinks();
+ signals:
+ void objectDeleted(); // mkr : PAL8237
+
public slots:
void sketchLink();
virtual void remove();
// Author : Natalia KOPNOVA
// Module : SUPERV
-using namespace std;
-
#include "SUPERVGUI.h"
#include "SUPERVGUI_CanvasView.h"
#include "SUPERVGUI_Main.h"
#include "SUPERVGUI_CanvasNodePrs.h"
#include "SUPERVGUI_Clipboard.h"
+#include "SUPERVGUI_ArrayView.h" //for tooltip testing
+
#include "SUIT_MessageBox.h"
#include <qpixmap.h>
myPopup->insertSeparator();
myShowToolBarItem = myPopup->insertItem( tr( "MEN_SHOW_TOOLBAR" ), myMain, SLOT( onShowToolbar() ) );
}
+
+ // mkr : PAL8237
+ connect(this, SIGNAL(objectCreated()), myMain, SLOT(onObjectCreatedDeleted()));
}
setHilighted(0);
}
+ // QToolTip for title and label for SUPERVGUI_CanvasNode
+ SUPERVGUI_ToolTip* aTT = new SUPERVGUI_ToolTip(this);
+ aTT->maybeTip(p);
+
busy = false;
}
SUPERVGUI_CanvasLink* aLink = new SUPERVGUI_CanvasLink(canvas(), myMain, aLinkEngine);
aLink->show();
+ emit objectCreated(); // mkr : PAL8237
+
canvas()->update();
myIsLinkCreating = false;
bool isAnyLinkCreating() const { return myIsLinkCreating; }
void startSketch(SUPERVGUI_CanvasPort* thePort);
+ signals:
+ void objectCreated(); // mkr : PAL8237
+
public slots:
void addToStudy();
void onTimeout();
case SUPERV::FactoryNode :
{
SUPERV::FNode_var aFNode = dataflow->FNode( SUPERV::FNode::_narrow(aNode)->GetComponentName(),
- SUPERV::FNode::_narrow(aNode)->GetInterfaceName(),
- *SUPERV::FNode::_narrow(aNode)->Service() );
+ SUPERV::FNode::_narrow(aNode)->GetInterfaceName(),
+ *SUPERV::FNode::_narrow(aNode)->Service(),
+ SUPERV::FNode::_narrow(aNode)->IsCimpl()); // mkr : PAL11273
if (CORBA::is_nil(aFNode)) {
QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
return;
// -----
#define PORT_WIDTH 75
-#define PORT_HEIGHT 28
+#define PORT_HEIGHT 20
+#define PORT_MARGIN 2
// Taille des points carres constituant les lignes entre les noeuds
// ----------------------------------------------------------------
// Author : Francis KLOSS
// Module : SUPERV
-using namespace std;
#include "SUPERVGUI_Information.h"
#include "CAM_Application.h"
// Author : Francis KLOSS
// Module : SUPERV
-using namespace std;
#ifndef SUPERVGUI_Information_H
#define SUPERVGUI_Information_H
return true;
}
else {
- SUIT_MessageBox::error1( (QWidget*)(SUIT_Session::session()->activeApplication()->desktop()), tr( "ERROR" ), tr( "MSG_ERROR_LIB1" ), tr( "OK" ) );
- return false; // error opening library file for writing
+ // mkr : PAL8557
+ QString aFullPath = GetLibraryFileName();
+ QString aDir = aFullPath.left( aFullPath.findRev('/')+1 );
+ const int toCreateDir = SUIT_MessageBox::warn2( (QWidget*)(SUIT_Session::session()->activeApplication()->desktop()), tr( "ERROR" ),
+ tr( "MSG_ERROR_LIB_DIR_NOT_EXIST_RECREATE" ).arg(aDir), tr( "BUT_YES" ), tr( "BUT_NO" ), 1, 0, 0 );
+ if ( toCreateDir ) { // user selected to create a new ./salome subdirectory in HOME directory
+
+ // create directory
+ QString aCommand = QString("mkdir ") + aDir;
+ int status = system( aCommand.latin1() );
+
+ if ( status == -1 || status == 217 ) {
+ SUIT_MessageBox::error1( (QWidget*)(SUIT_Session::session()->activeApplication()->desktop()), tr( "ERROR" ), tr( "MSG_ERROR_LIB_RECREATE_DIR" ).arg(aDir), tr( "OK" ) );
+ return false;
+ }
+
+ // create XML file
+ libFile.open( IO_WriteOnly | IO_Truncate );
+ QDomDocument doc( DOCTYPE ); // create a simple XML stub
+ doc.appendChild( doc.createElement( ROOT_ELEMENT ) ); // IMPORTANT: do not delete this root element
+ QTextStream stream( &libFile );
+ doc.save( stream, 0 );
+ libFile.close();
+ return true;
+ }
+ else // user chose not to create a new ./salome subdirectory in HOME directory
+ return false;
}
}
catch ( ... ) {
tr( "MSG_ERROR_LIB_IS_RECREATE" ), tr( "BUT_YES" ), tr( "BUT_NO" ), 1, 0, 0 );
if ( toRecreate ) { // user selected to recreate a bad XML file
libFile.close(); // in case it was opened by doc.setContent()
+
+ // remove old bad file
+ QString aCommand = QString("rm -f ") + libFile.name();
+ system( aCommand.latin1() );
+
if ( !createLibFile() )
return false; // error opening library file for writing. MB was already displayed
// Author : Francis KLOSS
// Module : SUPERV
-using namespace std;
-
#include "SALOMEDSClient.hxx"
#include "SALOMEDS_Study.hxx"
#include "SALOMEDS_SObject.hxx"
-#include <boost/shared_ptr.hpp>
-using namespace boost;
#include "NOTIFICATION.hxx"
#include "SALOME_Event.hxx"
#include "SUPERVGraph_ViewFrame.h"
+#include "SUPERVGraph_ViewModel.h"
#include "LogWindow.h"
#include "OB_Browser.h"
#include <qlineedit.h>
#include <qcombobox.h>
-SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, SUIT_Desktop* theDesktop, SUPERV_Graph theDataFlow )
+#include <boost/shared_ptr.hpp>
+using namespace boost;
+
+SUPERVGUI_Main::SUPERVGUI_Main( SUPERVGraph_ViewFrame* theParent,
+ SUIT_Desktop* theDesktop, SUPERV_Graph theDataFlow )
: SUPERVGraph_View(theParent),
myLogged( false ),
myFiltered( false ),
myStep( false ),
myTrace( false ),
myVerbose( false )
- //myExecuted( false )
+ //myExecuted( false )
{
Trace("SUPERVGUI_Main::SUPERVGUI_Main (copy)");
- theParent->setViewWidget(this);
+ setFocusPolicy( StrongFocus ); // mkr : IPAL11388
+ theParent->setViewWidget(this);
dataflow = theDataFlow;
if (SUPERV_isNull(dataflow)) {
QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_COPY"));
} else {
init(theDesktop);
}
+ // mkr : IPAL11362
+ connect(this, SIGNAL(EventToSync()), this, SLOT(onObjectCreatedDeleted()));
}
void SUPERVGUI_Main::init(SUIT_Desktop* theDesktop) {
void SUPERVGUI_Main::execute( char * theNodeName, SUPERV::GraphState theNodeState ) {
if (myCurrentView == CANVAS || myCurrentView == CONTROLFLOW) {
SUPERVGUI_CanvasNode* aNode = (SUPERVGUI_CanvasNode*) myCanvas->child(theNodeName, "SUPERVGUI_CanvasNode");
- if ( aNode )
+ if ( aNode ) {
aNode->sync();
+ emit EventToSync(); // mkr : IPAL11362
+ }
}
else if (myCurrentView == CANVASTABLE) {
SUPERVGUI_CanvasCellNode* aNode = (SUPERVGUI_CanvasCellNode*) myArray->child(theNodeName, "SUPERVGUI_CanvasCellNode");
- if (aNode)
+ if (aNode) {
aNode->sync();
+ emit EventToSync(); // mkr : IPAL11362
+ }
}
// asv : 26.01.05 : Bug PAL7164 : puting out-value to study if the "put_to_Study" flag is set on a
aVF->getToolBar()->show();
}
+// mkr : PAL8237 : synchronize many views of the same dataflow (objects creation/deletion)
+void SUPERVGUI_Main::onObjectCreatedDeleted()
+{
+ if ( study ) {
+ if ( STD_Application* app = dynamic_cast<STD_Application*>( study->application() ) ) {
+ ViewManagerList aVMList;
+ app->viewManagers( SUPERVGraph_Viewer::Type(), aVMList );
+ SUIT_ViewManager* aVM;
+ for ( aVM = aVMList.first(); aVM; aVM = aVMList.next() ) {
+ QPtrVector<SUIT_ViewWindow> aVWList = aVM->getViews();
+ for ( int i = 0; i < aVWList.count(); i++ ) {
+ SUPERVGraph_ViewFrame* aVW = dynamic_cast<SUPERVGraph_ViewFrame*>( aVWList[i] );
+ QObjectList* aMainList = aVW->queryList("SUPERVGUI_Main");
+ if ( aMainList->count() == 1 ) {
+ SUPERVGUI_Main* aMain = dynamic_cast<SUPERVGUI_Main*>( aMainList->first() );
+ if ( aMain )
+ if ( !QString(aMain->getDataflow()->getIOR()).compare(getDataflow()->getIOR()) // equal dataflows
+ &&
+ aMain != this ) // not equal mains
+ aMain->getCanvas()->merge();
+ }
+ }
+ }
+ }
+ }
+}
+
void SUPERVGUI_Main::run( const bool andSuspend ) {
Trace("SUPERVGUI_Main::run");
if ( SUPERV_isNull(dataflow) )
QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_DF_NOTVALID") + QString(" : ") + QString(dataflow->Messages()));
}
else if (!dataflow->IsExecutable()) {
- QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_DF_NOTEXECUTABLE") + QString(" : ") + QString(dataflow->Messages()));
+ QString aMessage = QString(dataflow->Messages());
+ if ( aMessage.isEmpty() ) // mkr : IPAL11471
+ QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_DF_NOTEXECUTABLE"));
+ else
+ QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_DF_NOTEXECUTABLE") + QString(" : ") + aMessage);
}
else if (myCanvasView->isAnyLinkCreating()) {
QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("ERROR"), tr("MSG_CRL_NOTCOMPLETE"));
//if (dataflow->IsExecuting()) return;
CAM_Application* anApp = ( CAM_Application* )(SUIT_Session::session()->activeApplication());
+ if ( !anApp->activeModule() ) return;
if ( anApp->activeModule()->moduleName().compare( anApp->moduleTitle( "SUPERV" ) ) !=0 ) return;
if (e->button() == RightButton) {
SALOMEDS::SObject_var aTmpSO;// = aSO;
SALOMEDS_Study* aSStudy = dynamic_cast<SALOMEDS_Study*>( aStudy.get() );
if ( !aSStudy ) return false;
- aTmpSO = aDriver->PublishInStudy( aSStudy->GetStudy(), aTmpSO, anObject, "" );
- aBuilder->Addreference(aSO, _PTR(SObject)(new SALOMEDS_SObject( aTmpSO )) );
- PublishOtherComponent = true;
+ try {
+ aTmpSO = aDriver->PublishInStudy( aSStudy->GetStudy(), aTmpSO, anObject, "" );
+ aBuilder->Addreference(aSO, _PTR(SObject)(new SALOMEDS_SObject( aTmpSO )) );
+ PublishOtherComponent = true;
+ }
+ catch ( ... ) { // mkr : PAL8150
+ }
}
else { // can't publish object: abort transaction
MESSAGE( "CanPublishInStudy() returned FALSE. ok, AbortCommand.." );
signals:
void KillMyThread(bool theValue);
+ void EventToSync(); // mkr : IPAL11362
public slots:
void execute(char * theNodeNode, SUPERV::GraphState theNodeState);
void onSubGraphActivated( SUIT_ViewWindow* );
void onShowToolbar();
+
+ void onObjectCreatedDeleted(); // mkr : PAL8237
private slots:
void chooseData(QListViewItem* item);
SUPERV_Graph dataflow;
QMap<QString, SUIT_ViewWindow*> mySubGraphs;
- QMap<QString, QString> mySubGraphMap;
- SUIT_ViewWindow* myLastGraph;
+ QMap<QString, QString> mySubGraphMap;
+ SUIT_ViewWindow* myLastGraph;
- SUIT_Study* study;
- OB_Browser* objectBrowser;
- LogWindow* message;
+ SUIT_Study* study;
+ OB_Browser* objectBrowser;
+ LogWindow* message;
GraphViewType myCurrentView;
SUPERVGUI_CanvasArray* myArray;
SUPERVGUI_Thread* myThread;
- QPtrList< char * > myEventNodes ;
- QPtrList< SUPERV::GraphState > myStates ;
+ QPtrList<char*> myEventNodes ;
+ QPtrList<SUPERV::GraphState> myStates ;
QTimer* myTimer;
};
// Author : Alexander SLADKOV
// Module : SUPERV
-using namespace std;
-
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
#include "SUPERVGUI_CanvasNode.h"
#include "SUPERVGUI_CanvasPort.h"
#include "SUPERVGUI_CanvasControlNode.h"
-#include "SUPERVGUI.h"
+#include "SUPERVGUI_CanvasLink.h"
#include <qlayout.h>
#include <qlabel.h>
SUPERVGUI_ManagePortsDlg::~SUPERVGUI_ManagePortsDlg() {
}
+// mkr : PAL8060
+void SUPERVGUI_ManagePortsDlg::createLinkEngine( SUPERV::Port_ptr thePort,
+ QValueList< QPair< QString,QString > >& theOwnList,
+ QValueList< QPair< QString,QString > >& theCorrespList ) {
+ // pair <NodeName, PortName> for the given port
+ QPair<QString, QString> anOwnPair(QString(thePort->Node()->Name()), QString(thePort->Name()));
+ int aNum = theOwnList.contains(anOwnPair);
+ while ( aNum > 0 ) {
+ int anId = theOwnList.findIndex(anOwnPair); // get index in theOwnList
+ QPair<QString, QString> aCorrespPair = theCorrespList[anId]; // corresponding pair in theCorrespList
+
+ theOwnList.remove(theOwnList.at(anId));
+ theCorrespList.remove(theCorrespList.at(anId));
+
+ SUPERV_Port aCorrespPort = myNode->getMain()->getDataflow()->Node(aCorrespPair.first)->Port(aCorrespPair.second);
+ SUPERV_Link aLinkEngine;
+ if ( thePort->IsInput() )
+ aLinkEngine = myNode->getMain()->getDataflow()->Link(aCorrespPort, thePort);
+ else
+ aLinkEngine = myNode->getMain()->getDataflow()->Link(thePort, aCorrespPort);
+ SUPERVGUI_CanvasLink* aLink = new SUPERVGUI_CanvasLink(myNode->getMain()->getCanvas(), myNode->getMain(), aLinkEngine);
+ aLink->show();
+
+ aNum--;
+ }
+}
+
/**
* Set the ports as entered by user (order, name/type, etc.) and close the dialog
*/
// automatically removes the corresponding Output Port. So for Loops the
// oldPorts list should be filtered to include only Input Ports.
// But I'll filter Gate-s as well..
+ bool isAnyLinked = false; // check if any port from old ports is linked
+ // map PortName <-> (PortType, PortInputValue) for non linked input ports, which have input
+ QMap< QString, QPair< QString,QString > > InNameInput;
QObjectList portsToRemove;
while ( (obj = it.current()) != 0 ) {
++it;
SUPERV::Port_var aPort = ((SUPERVGUI_CanvasPort*)obj)->getEngine();
- if ( !aPort->IsGate() && ( !isLoop || aPort->IsInput() ) )
+ if ( !aPort->IsGate() && ( !isLoop || aPort->IsInput() ) ) {
portsToRemove.append( obj );
+ }
+ // check if port has a link (output porst of Loop node are also checked)
+ if ( !aPort->IsGate() && aPort->IsLinked() && !isAnyLinked)
+ isAnyLinked = true;
+ // check if input port has an input value
+ if ( !aPort->IsGate() && aPort->IsInput() && aPort->HasInput() )
+ InNameInput.insert( QString(aPort->Name()),
+ QPair<QString, QString>(QString(aPort->Type()),QString(aPort->ToString())) );
}
delete oldPorts; // delete the list, not the objects
+
+ // mkr : PAL8060 -->
+ QString aNodeName = myNode->getEngine()->Name();
+ QValueList< QPair< QString,QString > > InPortsL, OutPortsL;
+ if ( isAnyLinked ) {
+ // if myNode has linked port(s), create two lists of In/Out ports (InPortsL, OutPortsL) to identify all links for myNode
+ QObjectList* list = myNode->getMain()->getCanvas()->queryList("SUPERVGUI_CanvasLink");
+ QObjectListIt listit( *list );
+ QObject *listobj;
+ while ( (listobj = listit.current()) != 0 ) {
+ ++listit;
+ SUPERV::Link_var aLink = ((SUPERVGUI_CanvasLink*)listobj)->getEngine();
+ if ( aNodeName.compare(aLink->InPort()->Node()->Name()) == 0
+ ||
+ aNodeName.compare(aLink->OutPort()->Node()->Name()) == 0 ) {
+ QPair<QString, QString> InPair(QString(aLink->InPort()->Node()->Name()), QString(aLink->InPort()->Name()));
+ QPair<QString, QString> OutPair(QString(aLink->OutPort()->Node()->Name()), QString(aLink->OutPort()->Name()));
+ InPortsL.append(InPair);
+ OutPortsL.append(OutPair);
+ }
+
+ if ( isLoop ) {
+ // put into In/Out lists all links for corresponding EndLoop node
+ QString aCoupledNodeName = ((SUPERVGUI_CanvasStartNode*)myNode)->getCoupled()->getEngine()->Name();
+ if ( aCoupledNodeName.compare(aLink->InPort()->Node()->Name()) == 0
+ ||
+ aCoupledNodeName.compare(aLink->OutPort()->Node()->Name()) == 0 ) {
+ QPair<QString, QString> InPair(QString(aLink->InPort()->Node()->Name()), QString(aLink->InPort()->Name()));
+ QPair<QString, QString> OutPair(QString(aLink->OutPort()->Node()->Name()), QString(aLink->OutPort()->Name()));
+ InPortsL.append(InPair);
+ OutPortsL.append(OutPair);
+ }
+ }
+ }
+ }
+ // mkr : PAL8060 <--
// portsToRemove list contains:
// for Loop node: all INPUT ports except Gates
for ( i = 0; i < myInList->count(); i++ ) {
item = (PortListItem*)myInList->item( i );
aPort = aINode->InPort( item->PortName.latin1(), item->PortType.latin1() );
- myNode->createPort( aPort.in() );
+ if ( InNameInput.contains( item->PortName )
+ &&
+ item->PortType.compare(InNameInput[item->PortName].first) == 0 ) {
+ // i.e. aPort is input and had a value (not linked!)
+ // if ports' name and type didn't change and ports had an input value => set this value again
+ SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+ if ( aSupMod )
+ aPort->Input( aSupMod->getEngine()->StringValue( InNameInput[item->PortName].second ) );
+ myNode->createPort( aPort.in() );
+ }
+ else {
+ myNode->createPort( aPort.in() );
+ // mkr : PAL8060
+ if ( !InPortsL.isEmpty() && !OutPortsL.isEmpty() )
+ // create links for those input ports, which had links earlier
+ createLinkEngine( aPort, InPortsL, OutPortsL );
+ }
+ }
+
+ if ( isLoop ) {
// asv : 11.01.05 : for Loop nodes do the same as in SUPERVGUI_CanvasStartNode::addInputPort()
- if ( isLoop ) {
- SUPERVGUI_CanvasStartNode* aStartLoopNode = (SUPERVGUI_CanvasStartNode*)myNode;
- aStartLoopNode->merge();
- aStartLoopNode->getCoupled()->merge();
+ SUPERVGUI_CanvasStartNode* aStartLoopNode = (SUPERVGUI_CanvasStartNode*)myNode;
+ aStartLoopNode->merge();
+ aStartLoopNode->getCoupled()->merge();
+
+ // mkr : PAL8060 -->
+ if ( !InPortsL.isEmpty() && !OutPortsL.isEmpty() ) {
+
+ // 1) create old links for output ports of Loop node
+ QObjectList* aPortsOut = aStartLoopNode->queryList("SUPERVGUI_CanvasPortOut");
+ QObjectListIt aPorstOutit( *aPortsOut );
+ QObject *listobj;
+ while ( (listobj = aPorstOutit.current()) != 0 ) {
+ ++aPorstOutit;
+
+ SUPERV::Port_var aPortOut = ((SUPERVGUI_CanvasPort*)listobj)->getEngine();
+ createLinkEngine( aPortOut, OutPortsL, InPortsL );
+ }
+
+ // 2) create old links for input ports of EndLoop node
+ QObjectList* aPortsIn = aStartLoopNode->getCoupled()->queryList("SUPERVGUI_CanvasPortIn");
+ QObjectListIt aPorstInit( *aPortsIn );
+ while ( (listobj = aPorstInit.current()) != 0 ) {
+ ++aPorstInit;
+
+ SUPERV::Port_var aPortIn = ((SUPERVGUI_CanvasPort*)listobj)->getEngine();
+ createLinkEngine( aPortIn, InPortsL, OutPortsL );
+ }
+
+ // 3) create old links for output ports of EndLoop node
+ aPortsOut = aStartLoopNode->getCoupled()->queryList("SUPERVGUI_CanvasPortOut");
+ aPorstOutit = QObjectListIt( *aPortsOut );
+ while ( (listobj = aPorstOutit.current()) != 0 ) {
+ ++aPorstOutit;
+
+ SUPERV::Port_var aPortOut = ((SUPERVGUI_CanvasPort*)listobj)->getEngine();
+ createLinkEngine( aPortOut, OutPortsL, InPortsL );
+ }
}
+ // mkr : PAL8060 <--
}
+
// creating Out-ports, except LoopNode-s
for ( i = 0; i < myOutList->count() && !isLoop; i++ ) {
item = (PortListItem*)myOutList->item( i );
aPort = aINode->OutPort( item->PortName.latin1(), item->PortType.latin1() );
myNode->createPort( aPort.in() );
+
+ // mkr : PAL8060
+ if ( !InPortsL.isEmpty() && !OutPortsL.isEmpty() )
+ // create links for those output ports, which had links earlier
+ createLinkEngine( aPort, OutPortsL, InPortsL );
}
// 2. update the node's presentation
// 1. fill myTypeCombo with all available types
myTypeCombo->insertStrList( gTypes );
-
+
// 2. fill Input and Output listboxes with Ports' names/types
QStringList aTypes;
SUPERV_Ports aPorts = aINode->Ports();
for ( int i=0; i < aPorts->length(); i++ ) {
if ( aPorts[i]->IsGate() )
continue;
- if ( aPorts[i]->IsInput() )
+ if ( aPorts[i]->IsInput()
+ &&
+ !myInList->findItem( QString( "%1 (%2)" ).arg( aPorts[i]->Name() ).arg( aPorts[i]->Type() ) ) ) // mkr : PAL11332
new PortListItem( myInList, aPorts[i]->Name(), aPorts[i]->Type() );
- else
+ if ( !aPorts[i]->IsInput()
+ &&
+ !myOutList->findItem( QString( "%1 (%2)" ).arg( aPorts[i]->Name() ).arg( aPorts[i]->Type() ) ) ) // mkr : PAL11332
new PortListItem( myOutList, aPorts[i]->Name(), aPorts[i]->Type() );
}
}
#ifndef SUPERVGUI_ManagePortsDlg_H
#define SUPERVGUI_ManagePortsDlg_H
+#include "SUPERVGUI.h"
+
#include <qdialog.h>
#include <qlistbox.h>
#include <qstringlist.h>
#include <qlineedit.h>
#include <qcombobox.h>
+#include <qpair.h>
class SUPERVGUI_CanvasNode;
void moveUp( QListBox* );
void moveDown( QListBox* );
void moveItem( QListBox* theLB, const int from, const int to );
+ // mkr : PAL8060
+ void createLinkEngine( SUPERV::Port_ptr thePort,
+ QValueList< QPair< QString,QString > >& theOwnList,
+ QValueList< QPair< QString,QString > >& theCorrespList );
private:
void init();
// Author : Francis KLOSS
// Module : SUPERV
-using namespace std;
-
#include "SUPERVGUI_Notification.h"
#include "SUPERVGUI_Main.h"
#include "SUPERVGUI_CanvasNode.h"
#ifndef SUPERVGUI_Notification_H
#define SUPERVGUI_Notification_H
-using namespace std;
#include "SUPERVGUI_Def.h"
#include <qdialog.h>
#include <qlist.h>
#include "SALOMEDSClient.hxx"
#include <boost/shared_ptr.hpp>
-using namespace boost;
class SALOME_InteractiveObject;
// Author : Francis KLOSS
// Module : SUPERV
-using namespace std;
#include "SUPERVGUI_Service.h"
#include "SUPERVGUI_Main.h"
#include "SUPERVGUI_Library.h"
}
}
else { // Factory Node
- aNode = aMain->getDataflow()->FNode(component, interface, *myService);
+ aNode = aMain->getDataflow()->FNode(component, interface, *myService, myComponent->implementation_type()); // mkr : PAL11273
if ( CORBA::is_nil( aNode ) ) {
QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
return;
return;
}
SUPERV::INode_var aDummyEndNode;
+ // here we have to
+ // 1) parse nodes' python function to find ports names
+ // 2) create ports for engine node with found names and "undefined" types
+ // ( aNode->InPort(name,type), aNode->OutPort(name,type) )
+ // P.S. CanvasNode->createPort(...) for create presentation of port
+ // will be called from addNode(...) (inside CanvasNode constructor)
addNode( aNode, aDummyEndNode, myX, myY );
}
break;
#ifndef SUPERVGUI_Service_H
#define SUPERVGUI_Service_H
-using namespace std;
#include "SUPERVGUI_Def.h"
#include <qtabwidget.h>
#include <qhgroupbox.h>
msgid "ICO_SUSPEND/RESUME"
msgstr "suspend-resume.gif"
+
+msgid "ICO_NODE_INLINE"
+msgstr "node_inline.png"
msgstr "Error creating a library file and opening for writing."
msgid "MSG_ERROR_LIB_IS_RECREATE"
-msgstr "Library file is corrupt (bad XML structure). Remove it and create a new one?"
+msgstr "Library file is corrupt (bad XML structure) or read-protected. Remove it and create a new one?"
+
+msgid "MSG_ERROR_LIB_DIR_NOT_EXIST_RECREATE"
+msgstr "%1 directory doesn't exist. Create it?"
+
+msgid "MSG_ERROR_LIB_RECREATE_DIR"
+msgstr "Can not create %1 directory."
msgid "MSG_ERROR_LIB_IO"
msgstr "Unknown I/O error occured creating new library file."
msgid "MSG_ERROR_LIB_WRITE"
-msgstr "Error writing library file!"
+msgstr "Error writing library file: file is write-protected!"
msgid "MSG_ERROR_LIB_NIL_NODE"
msgstr "Error: the node to be exported is NULL"
#include "StreamPort_Impl.hxx"
+char *FACTORYSERVERPY = "localhost/FactoryServerPy" ;
+
CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb ,
PortableServer::POA_ptr poa ,
PortableServer::ObjectId * contId ,
const char * NodeName ,
const SUPERV::KindOfNode NodeKindOfNode ,
const char * FuncName ,
- const SUPERV::ListOfStrings & PythonFunction ) :
+ const SUPERV::ListOfStrings & PythonFunction ,
+ bool isCimpl ) :
Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
// beginService( "CNode_Impl::CNode_Impl" );
// cout << "CNode_Impl::CNode_Impl -->" << endl ;
aPythonFunction.resize(1) ;
aPythonFunction[0] = &PythonFunction ;
}
- _DataFlowNode = DataFlowEditor()->AddNode( NodeService , "" , "" , NodeName ,
- NodeKindOfNode ,
- aFuncName ,
- aPythonFunction ) ;
+
+ // mkr : PAL11273 -->
+ if ( isCimpl ) // C++ implementation
+ _DataFlowNode = DataFlowEditor()->AddNode( NodeService , "" , "" , NodeName ,
+ NodeKindOfNode ,
+ aFuncName ,
+ aPythonFunction ) ;
+ else // Python implementation
+ _DataFlowNode = DataFlowEditor()->AddNode( NodeService , "" , "" , NodeName ,
+ NodeKindOfNode ,
+ aFuncName ,
+ aPythonFunction ,
+ SUPERV::SDate() ,
+ SUPERV::SDate() ,
+ NULLSTRING ,
+ NULLSTRING ,
+ FACTORYSERVERPY ) ;
+ // mkr : PAL11273 <--
+
_IsNode = true ;
// endService( "CNode_Impl::CNode_Impl" );
// cout << "<-- CNode_Impl::CNode_Impl" << endl ;
begin = false ;
}
if ( anInPort->IsLoop() || ( anInPort->IsGate() && anInPort->IsNotConnected() &&
- ( IsExecuting() || DataFlowEditor()->IsReadOnly() ) ) ) {
+ ( /*IsExecuting() || */DataFlowEditor()->IsReadOnly() ) ) ) { // mkr : IPAL11362
// MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ;
}
else if ( CORBA::is_nil( anInPort->ObjRef() ) ) {
begin = false ;
}
if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && anOutPort->IsNotConnected() &&
- ( IsExecuting() || DataFlowEditor()->IsReadOnly() ) ) ) {
+ ( /*IsExecuting() || */DataFlowEditor()->IsReadOnly() ) ) ) { // mkr : IPAL11362
// MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ;
}
else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) {
return RetVal ;
}
-bool CNode_Impl::IsLinked(const char * ServiceParameterName ) {
+// mkr : PAL8060 : this method is not used
+/*bool CNode_Impl::IsLinked(const char * ServiceParameterName ) {
beginService( "CNode_Impl::IsLinked" );
bool RetVal = DataFlowNode()->IsLinked( ServiceParameterName ) ;
MESSAGE( Name() << "->IsLinked( '" << ServiceParameterName << "' )" ) ;
endService( "CNode_Impl::IsLinked" );
return RetVal ;
-}
+ }*/
bool CNode_Impl::HasInput(const char * ServiceParameterName ) {
// beginService( "CNode_Impl::HasInput" );
const char * NodeName = NULLSTRING ,
const SUPERV::KindOfNode NodeKindOfNode = SUPERV::ComputingNode ,
const char * aFuncName = NULLSTRING ,
- const SUPERV::ListOfStrings & aPythonFunction = SUPERV::ListOfStrings() ) ;
+ const SUPERV::ListOfStrings & aPythonFunction = SUPERV::ListOfStrings() ,
+ bool isCimpl = true ) ; // mkr : PAL11273 : C++ implementation by default
CNode_Impl( CORBA::ORB_ptr orb ,
PortableServer::POA_ptr poa ,
PortableServer::ObjectId * contId ,
virtual long SubGraph() ;
virtual long SubStreamGraph() ;
- virtual bool IsLinked(const char * ToServiceParameterName ) ;
+ // mkr : PAL8060 : this method is not used
+ //virtual bool IsLinked(const char * ToServiceParameterName ) ;
virtual bool HasInput(const char * ToServiceParameterName ) ;
// virtual SUPERV::Link_ptr GetLink(const char * ToServiceParameterName ) ;
const char * NodeComponentName ,
const char * NodeInterfaceName ,
const char * NodeName ,
- const SUPERV::KindOfNode NodeKindOfNode ) :
+ const SUPERV::KindOfNode NodeKindOfNode ,
+ bool isCimpl ) :
// Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
- CNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , NodeService , NodeName , NodeKindOfNode , NULLSTRING ) {
+ CNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , NodeService , NodeName , NodeKindOfNode , NULLSTRING , SUPERV::ListOfStrings() , isCimpl ) {
// MESSAGE( NodeName << " " );
beginService( "FNode_Impl::FNode_Impl" );
// cout << "FNode_Impl::FNode_Impl -->" << endl ;
_Orb = CORBA::ORB::_duplicate(orb);
_Poa = poa ;
_ContId = contId ;
+ _isCimpl = isCimpl ;
// DataFlowNode( DataFlowEditor()->AddNode( NodeService , NodeComponentName ,
// NodeInterfaceName , NodeName ,
// NodeKindOfNode ) ) ;
_Orb = CORBA::ORB::_duplicate(orb);
_Poa = poa ;
_ContId = contId ;
+ _isCimpl = true ;
endService( "FNode_Impl::FNode_Impl" );
}
CORBA::ORB_ptr _Orb ;
PortableServer::POA_ptr _Poa ;
PortableServer::ObjectId * _ContId ;
+ bool _isCimpl;
public:
FNode_Impl();
const char * NodeComponentName ,
const char * NodeInterfaceName ,
const char * NodeName = NULLSTRING ,
- const SUPERV::KindOfNode NodeKindOfNode = SUPERV::FactoryNode ) ;
+ const SUPERV::KindOfNode NodeKindOfNode = SUPERV::FactoryNode ,
+ bool isCimpl = true ) ; // mkr : PAL11273 : C++ implementation by default
FNode_Impl( CORBA::ORB_ptr orb ,
PortableServer::POA_ptr poa ,
PortableServer::ObjectId * contId ,
virtual GraphBase::FactoryNode * BaseNode() {
return DataFlowNode()->FactoryNode() ; } ;
+ virtual bool IsCimpl() { return _isCimpl; } ; // mkr : PAL11273
+
} ;
#endif
SUPERV::FNode_ptr Graph_Impl::FNode( const char * NodeComponentName ,
const char * NodeInterfaceName ,
- const SALOME_ModuleCatalog::Service &NodeService ) {
+ const SALOME_ModuleCatalog::Service &NodeService ,
+ bool isCimpl ) {
beginService( "Graph_Impl::FNode" );
SUPERV::FNode_var iobject = SUPERV::FNode::_nil() ;
if ( DataFlowEditor()->IsEditing() && !DataFlowEditor()->IsReadOnly() && !IsMacro() ) {
DataFlowEditor() ,
NodeService ,
NodeComponentName ,
- NodeInterfaceName ) ;
+ NodeInterfaceName ,
+ NULLSTRING ,
+ SUPERV::FactoryNode ,
+ isCimpl ) ;
if ( myNode->DataFlowNode() ) {
PortableServer::ObjectId * id = myNode->getId() ;
CORBA::Object_var obj = _poa->id_to_reference(*id);
bool Graph_Impl::Begin() {
bool RetVal = false ;
+ // mkr : IPAL11408 : "Run()" method returns "0" after trying to start graph execution.
+ // If we call Run() method from Python script two times for one graph, we have to be sure,
+ // that first execution of this graph ended (i.e. GraphEditor::DataFlow::Editing() method was called).
+ // Otherwise, the second call of Run() method will return 0. Therefore, we have to waiting for
+ // the first execution finish.
+ // NB! From GUI we cann't run dataflow if its previous execution not finished.
+ while ( !DataFlowEditor()->IsEditing() ) {} // waiting for the previous execution of this graph ended
if ( DataFlowEditor()->IsEditing() ) {
if ( pthread_mutex_lock( &_MutexExecutorWait ) ) {
perror("pthread_mutex_lock _MutexExecutorWait") ;
SUPERV::FNode_var aNode = (aGraphNodes->FNodes)[ i ] ;
SUPERV::FNode_ptr myNode = FNode( aNode->GetComponentName() ,
aNode->GetInterfaceName() ,
- *(aNode->Service()) ) ;
+ *(aNode->Service()) ,
+ aNode->IsCimpl() ) ; // mkr : PAL11273
if ( !CORBA::is_nil( myNode ) ) {
myNode->SetName( aNode->Name() ) ;
myNode->SetAuthor( aNode->Author() ) ;
myPorts = *(myEndOfSwitch->Ports()) ;
for ( j = 0 ; j < (int ) myPorts.length() ; j++ ) {
if ( myPorts[ j ]->IsInput() ) {
- aPort = myNode->InPort( myPorts[ j ]->Name() , myPorts[ j ]->Type() ) ;
+ aPort = anEndOfSwitch->InPort( myPorts[ j ]->Name() , myPorts[ j ]->Type() ) ; // mkr : IPAL11394 (add port to !EndSwitch! node)
}
else {
- aPort = myNode->OutPort( myPorts[ j ]->Name() , myPorts[ j ]->Type() ) ;
+ aPort = anEndOfSwitch->OutPort( myPorts[ j ]->Name() , myPorts[ j ]->Type() ) ; // mkr : IPAL11394 (add port to !EndSwitch! node)
}
}
if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) {
SUPERV::ListOfStreamPorts myStreamSwitchPorts = *(myEndOfSwitch->StreamPorts()) ;
for ( j = 0 ; j < (int ) myStreamSwitchPorts.length() ; j++ ) {
if ( myStreamSwitchPorts[ j ]->IsInput() ) {
- aPort = myNode->InStreamPort( myStreamSwitchPorts[ j ]->Name() , StringToDataStreamType( myStreamSwitchPorts[ j ]->Type() ) , myStreamSwitchPorts[ j ]->Dependency() ) ;
+ aPort = anEndOfSwitch->InStreamPort( myStreamSwitchPorts[ j ]->Name() , StringToDataStreamType( myStreamSwitchPorts[ j ]->Type() ) , myStreamSwitchPorts[ j ]->Dependency() ) ; // mkr : IPAL11394 (add port to !EndSwitch! node)
}
else {
- aPort = myNode->OutStreamPort( myStreamSwitchPorts[ j ]->Name() , StringToDataStreamType( myStreamSwitchPorts[ j ]->Type() ) , myStreamSwitchPorts[ j ]->Dependency() ) ;
+ aPort = anEndOfSwitch->OutStreamPort( myStreamSwitchPorts[ j ]->Name() , StringToDataStreamType( myStreamSwitchPorts[ j ]->Type() ) , myStreamSwitchPorts[ j ]->Dependency() ) ; // mkr : IPAL11394 (add port to !EndSwitch! node)
}
}
}
virtual SUPERV::FNode_ptr FNode(
const char * NodeComponentName ,
const char * InterfaceName ,
- const SALOME_ModuleCatalog::Service &NodeService ) ;
+ const SALOME_ModuleCatalog::Service &NodeService ,
+ bool isCimpl ) ; // mkr : PAL11273 : C++ implementation by default
virtual SUPERV::INode_ptr INode(
const char * FuncName ,
const SUPERV::ListOfStrings & PythonFunction ) ;
// << anInPort->PortName() << ")" << " ignored" ) ;
}
else {
- RetVal = _DataFlowNode->IsLinked( _DataFlowPort->PortName() ) ;
+ RetVal = _DataFlowNode->IsLinked( _DataFlowPort->PortName(), IsInput() ) ; // mkr : PAL8060
}
}
// endService( "Port_Impl::IsLinked" ) ;
import os
import re
from types import *
-import readline
#try :
# SuperVision = SuperV_Swig( len(sys.argv) , sys.argv )
return self.N.SetInterfaceName( anInterfaceName )
def SetContainer( self , aComputer ):
return self.N.SetContainer( aComputer )
+ def IsCimpl( self ):
+ return self.N.isCimpl
##########################################################
class INode(CNode):
#if SuperVision.Swig :
#aService = Service_Swig( aService )
return self.FNode( aComponent , anInterface , aService )
+ def FNodeImpl( self , aComponent , anInterface , aService, isCimpl ):
+ NodeComponent = modulecatalog.GetComponent( aComponent )
+ aService = NodeComponent.GetService( anInterface , aService )
+ aNode = self.G.FNode( aComponent , anInterface , aService, isCimpl )
+ if aNode != None :
+ aNode.isCimpl = isCimpl
+ myNode = FNode( aNode , self.G.Verbose )
+ return myNode
+ ErrMsg = "Failed to create a Node with Service " + aService.ServiceName
+ if self.G.Verbose :
+ print ErrMsg
+ return aNode
def FNode( self , aComponent , anInterface , aService ):
+ # create node with C++ implementation type by default
NodeComponent = modulecatalog.GetComponent( aComponent )
aService = NodeComponent.GetService( anInterface , aService )
#if SuperVision.Swig :
#aService = Service_Swig( aService )
- aNode = self.G.FNode( aComponent , anInterface , aService )
+ aNode = self.G.FNode( aComponent , anInterface , aService, 1 )
if aNode != None :
+ aNode.isCimpl = 1
myNode = FNode( aNode , self.G.Verbose )
return myNode
ErrMsg = "Failed to create a Node with Service " + aService.ServiceName
import os
import re
from types import *
-import readline
import SALOMEDS
import SALOMEDS_Attributes_idl
#try :
return self.N.SetInterfaceName( anInterfaceName )
def SetContainer( self , aComputer ):
return self.N.SetContainer( aComputer )
+ def IsCimpl( self ):
+ return self.N.isCimpl
##########################################################
class INode(CNode):
#if SuperVision.Swig :
#aService = Service_Swig( aService )
return self.FNode( aComponent , anInterface , aService )
+ def FNodeImpl( self , aComponent , anInterface , aService, isCimpl ):
+ NodeComponent = modulecatalog.GetComponent( aComponent )
+ aService = NodeComponent.GetService( anInterface , aService )
+ aNode = self.G.FNode( aComponent , anInterface , aService, isCimpl )
+ if aNode != None :
+ aNode.isCimpl = isCimpl
+ myNode = FNode( aNode , self.G.Verbose )
+ return myNode
+ ErrMsg = "Failed to create a Node with Service " + aService.ServiceName
+ if self.G.Verbose :
+ print ErrMsg
+ return aNode
def FNode( self , aComponent , anInterface , aService ):
+ # create node with C++ implementation type by default
NodeComponent = modulecatalog.GetComponent( aComponent )
aService = NodeComponent.GetService( anInterface , aService )
#if SuperVision.Swig :
#aService = Service_Swig( aService )
- aNode = self.G.FNode( aComponent , anInterface , aService )
+ aNode = self.G.FNode( aComponent , anInterface , aService, 1 )
if aNode != None :
+ aNode.isCimpl = 1
myNode = FNode( aNode , self.G.Verbose )
return myNode
ErrMsg = "Failed to create a Node with Service " + aService.ServiceName