@COMMENCE@
-SUBDIRS = idl src doc
+SUBDIRS = idl src doc adm_local
RESOURCES_FILES = \
components.png \
--- /dev/null
+# source path
+top_srcdir=@top_srcdir@
+top_builddir=..
+srcdir=@srcdir@
+VPATH=.:$(srcdir)/adm_local
+
+
+all: resources
+
+install:
+ cp -rf @top_srcdir@/adm_local @prefix@
+
+bin:
+
+resources :
+ cp -rf @top_srcdir@/adm_local $(top_builddir)
+
+inc:
+
+lib:
+
+depend:
+
+depend_idl:
+
+install-end:
+
+install-include:
+
+install-bin:
+
+uninstall:
+
+uninstall-idl:
+
+distclean:
+
+clean:
+
+distclean-other:
+
--- /dev/null
+# Check availability of SUPERV module binary distribution
+#
+# Author : Marc Tajchman (CEA, 2002)
+#------------------------------------------------------------
+
+AC_DEFUN([CHECK_SUPERV],[
+
+AC_CHECKING(for Superv)
+
+Superv_ok=no
+
+AC_ARG_WITH(superv,
+ --with-superv=DIR root directory path of SUPERV installation,
+ SUPERV_DIR="$withval",SUPERV_DIR="")
+
+if test "x$SUPERV_DIR" = "x" ; then
+
+# no --with-gui-dir option used
+
+ if test "x$SUPERV_ROOT_DIR" != "x" ; then
+
+ # SUPERV_ROOT_DIR environment variable defined
+ SUPERV_DIR=$SUPERV_ROOT_DIR
+
+ else
+
+ # search SUPERV binaries in PATH variable
+ AC_PATH_PROG(TEMP, libSUPERV.so)
+ if test "x$TEMP" != "x" ; then
+ SUPERV_BIN_DIR=`dirname $TEMP`
+ SUPERV_DIR=`dirname $SUPERV_BIN_DIR`
+ fi
+
+ fi
+#
+fi
+
+if test -f ${SUPERV_DIR}/lib/salome/libSUPERV.so ; then
+ Superv_ok=yes
+ AC_MSG_RESULT(Using SUPERV distribution in ${SUPERV_DIR})
+
+ if test "x$SUPERV_ROOT_DIR" == "x" ; then
+ SUPERV_ROOT_DIR=${SUPERV_DIR}
+ fi
+ AC_SUBST(SUPERV_ROOT_DIR)
+else
+ AC_MSG_WARN("Cannot find compiled SUPERV distribution")
+fi
+
+AC_MSG_RESULT(for SUPERV: $Superv_ok)
+
+])dnl
+
ACLOCAL_SRC = \
-ac_cxx_bool.m4 check_corba.m4 check_vtk.m4 \
+ac_cxx_bool.m4 check_corba.m4 \
ac_cxx_depend_flag.m4 check_hdf5.m4 enable_pthreads.m4 \
ac_cxx_mutable.m4 check_mico.m4 libtool.m4 \
ac_cxx_namespaces.m4 check_omniorb.m4 pyembed.m4 \
-ac_cxx_partial_specialization.m4 check_opengl.m4 python.m4 \
+ac_cxx_partial_specialization.m4 python.m4 \
ac_cxx_typename.m4 check_pthreads.m4 check_cas.m4 \
-ac_cc_warnings.m4 check_qt.m4 check_swig.m4
+ac_cc_warnings.m4 check_swig.m4
-$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%)
- cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files
+ACLOCAL_GUI = \
+check_vtk.m4 check_opengl.m4 check_qt.m4 \
+check_GUI.m4 check_corba_in_GUI.m4
+
+$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \
+ $(ACLOCAL_GUI:%=@GUI_ROOT_DIR@/adm_local/unix/config_files/%)
+ cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \
+ -I @GUI_ROOT_DIR@/adm_local/unix/config_files
# echo "failed : KERNEL_SRC variable is not correct !"
# exit
#fi
+########################################################################
+# Test if the GUI_ROOT_DIR is set correctly
+
+if test ! -d "${GUI_ROOT_DIR}"; then
+ echo "failed : GUI_ROOT_DIR variable is not correct !"
+ exit
+fi
+
########################################################################
# find_in - utility function
#
echo -n "Creating 'configure' script ... "
fi
-aclocal --acdir=adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
+aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files
if autoconf
then
echo "done"
CHECK_HTML_GENERATORS
echo
+echo
+echo ---------------------------------------------
+echo Testing GUI
+echo ---------------------------------------------
+echo
+
+CHECK_SALOME_GUI
+
+echo
+echo ---------------------------------------------
+echo Testing full GUI
+echo ---------------------------------------------
+echo
+
+CHECK_CORBA_IN_GUI
+if test "x${CORBA_IN_GUI}" != "xyes"; then
+ echo "failed : For configure SUPERV module necessary full GUI !"
+ exit
+fi
+
echo ---------------------------------------------
echo Testing Kernel
echo ---------------------------------------------
}
else if ( !strcmp( Type , "float" ) ) {
cdebug << "float" << endl ;
- InitialValue <<= (double ) 0. ;
+ double d = 0.;
+ InitialValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+ //InitialValue <<= (double ) 0. ;
}
else if ( !strcmp( Type , "double" ) ) {
cdebug << "double" << endl ;
- InitialValue <<= (double ) 0. ;
+ double d = 0.;
+ InitialValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+ //InitialValue <<= (double ) 0. ;
}
else { // Default
cdebug << "objref" << endl ;
#endif
}
else if ( !strcmp( Type , "float" ) || !strcmp( Type , "double" ) ) {
- double d ;
- sscanf( t , "%lf" , &d ) ;
- *theValue <<= d ;
- *theValue >>= d;
+ double d ;
+ sscanf( t , "%lf" , &d ) ;
+ theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+ //*theValue <<= d ;
+ *theValue >>= d ;
#if ValueTrace
cdebug << " --> Value( " << d << ") (double) kind " << theValue->type()->kind() ;
#endif
<< theValue->type()->kind() ;
#endif
}
- _theValue = theValue ;
- *_Value = theValue ;
+ //_theValue = theValue ;
+ _theValue = new CORBA::Any( *theValue ) ;
+
+ //*_Value = theValue ;
+ _Value = &_theValue ;
+
//JR 21.02.2005 Debug Memory leak :
delete aDataValue ;
}
}
else if ( !strcmp( Type , "float" ) || !strcmp( Type , "double" ) ) {
double d = l ;
- *theValue <<= d ;
+ theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+ //*theValue <<= d ;
*theValue >>= d ;
+
#if ValueTrace
cdebug << " --> Value( " << d << ") (double) kind " << theValue->type()->kind() ;
#endif
<< theValue->type()->kind() ;
#endif
}
- _theValue = theValue ;
- *_Value = theValue ;
+
+ //_theValue = theValue ;
+ _theValue = new CORBA::Any( *theValue ) ;
+
+ //*_Value = theValue ;
+ _Value = &_theValue ;
+
//JR 21.02.2005 Debug Memory leak :
delete aDataValue ;
}
cdebug << "Value( " << d << ") (double)";
#endif
if ( !strcmp( Type , "float" ) || !strcmp( Type , "double" ) ) { // SuperVision Value
- _theValue = aDataValue ;
- *_Value = aDataValue ;
+ //_theValue = aDataValue ;
+ _theValue = new CORBA::Any( *aDataValue ) ;
+
+ //*_Value = aDataValue ;
+ _Value = &_theValue ;
+
*_theValue >>= d;
#if ValueTrace
cdebug << " == Value( " << d << ") (double)";
<< theValue->type()->kind() ;
#endif
}
- _theValue = theValue ;
- *_Value = theValue ;
+ //_theValue = theValue ;
+ _theValue = new CORBA::Any( *theValue ) ;
+
+ //*_Value = theValue ;
+ _Value = &_theValue ;
+
//JR 21.02.2005 Debug Memory leak :
delete aDataValue ;
}
}
else if ( !strcmp( Type , "float" ) || !strcmp( Type , "double" ) ) {
double d = (double ) 0. ;
- *theValue <<= d ;
+ theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+ //*theValue <<= d ;
*theValue >>= d;
#if ValueTrace
cdebug << " --> Value( " << d << ") (double) kind " << theValue->type()->kind() ;
#endif
}
- _theValue = theValue ;
- *_Value = theValue ;
+ //_theValue = theValue ;
+ _theValue = new CORBA::Any( *theValue ) ;
+
+ //*_Value = theValue ;
+ _Value = &_theValue ;
+
//JR 21.02.2005 Debug Memory leak :
delete aDataValue ;
}
}
VXSize = 0 ;
GraphsNumber = 0 ;
+
+ aLinkValue = CORBA::Any();
}
GraphBase::XmlHandler::XmlHandler() {}
if ( constructor ) {
int sizedata = aListOfDataFlows[ GraphsNumber ].Datas.size() ;
aListOfDataFlows[ GraphsNumber ].Datas.resize( sizedata+1 ) ;
- aListOfDataFlows[ GraphsNumber ].Datas[ sizedata ] = aLink ;
+
+ if ( aLinkValue.type()->kind() == CORBA::tk_double )
+ aLink.aLinkValue = *aLinkDoubleValue ;
+
+ aListOfDataFlows[ GraphsNumber ].Datas[ sizedata ] = aLink ;
+
if ( VXSize ) {
aListOfDataFlows[ GraphsNumber ].Datas[ sizedata ].aListOfCoords.resize( VXSize ) ;
int ic ;
break;
}
case CORBA::tk_double: {
- aLink.aLinkValue <<= (double ) 0. ;
- double d;
+ //aLink.aLinkValue <<= (double ) 0. ;
+ double d = 0.;
+ aLink.aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
aLink.aLinkValue >>= d;
#if TRACE
MESSAGE( d << " (double)" );
case CORBA::tk_double: {
double d;
sscanf( fieldvalue[depth].c_str() , "%lf" , &d ) ;
- aLink.aLinkValue <<= d;
+ //aLink.aLinkValue <<= d;
+ aLink.aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+ aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+ aLinkDoubleValue = new CORBA::Any( aLinkValue );
#if TRACE
- MESSAGE( d << " (double)" );
+ MESSAGE( d << " (double)" );
#endif
break;
}
GraphBase::SLink aLink ;
// SALOME_SuperVisionBase::ServicesParameterValue aLinkValue ;
CORBA::Any aLinkValue ;
+ CORBA::Any const *aLinkDoubleValue ;
int X ;
int Y ;
int VXSize ;
#if SendEventTrace
cdebug << pthread_self() << "/" << ThreadNo() << " SendedEvent Node " << Name()
<< " will exit : a node was aborted ..." << endl ;
- State( _NextState ) ;
#endif
+ State( _NextState ) ;
+ sts = false;
}
else {
sts = executeAction() ;
}
int GraphExecutor::InNode::executeAction() {
+
int oldRewindStack = ( _RewindStack > MAXSTACKTHREADSIZE ) ;
if ( !CreateNewThread() && oldRewindStack ) {
#if ActionsTrace
nOutParams = GetNodeOutPortsSize() ;
OutParametersList = new ServicesAnyData[nOutParams];
InOutParametersSet( nOutParams , OutParametersList ) ;
+
#if 0
if ( !Err && IsComputingNode() ) {
cdebug << ThreadNo() << " DataReady_ExecuteAction " << Name() << " "
InLineNode()->PyFuncName() ,
InParametersList , ServiceInParameter().length() ,
OutParametersList , ServiceOutParameter().length() ) ;
+
if ( !StsPyDynInvoke ) {
string anErrorMessage = string( "Dynamic Python call for node " ) +
string( Name() ) + " function " +
<< InLineNode()->PyFuncName()
<< "' IsGOTONode PyDynInvoke" << endl ;
#endif
+
StsPyDynInvoke = PyDynInvoke( InLineNode()->PyRunMethod() ,
InLineNode()->PyFuncName() ,
InParametersList , ServiceInParameter().length() ,
OutParametersList , ServiceOutParameter().length() ) ;
+
if ( !StsPyDynInvoke ) {
string anErrorMessage = string( "Dynamic Python call for node " ) +
string( Name() ) + " function " +
<< InLineNode()->PyFuncName()
<< "' IsSwitchNode PyDynInvoke" << endl ;
#endif
+
StsPyDynInvoke = PyDynInvoke( InLineNode()->PyRunMethod() ,
InLineNode()->PyFuncName() ,
InParametersList , ServiceInParameter().length() ,
OutParametersList , ServiceOutParameter().length() ) ;
+
if ( !StsPyDynInvoke ) {
string anErrorMessage = string( "Dynamic Python call for node " ) +
string( Name() ) + " function " +
<< InLineNode()->PyFuncName()
<< "' IsSwitchNode PyDynInvoke" << endl ;
#endif
+
StsPyDynInvoke = PyDynInvoke( InLineNode()->PyRunMethod() ,
InLineNode()->PyFuncName() ,
InParametersList , ServiceInParameter().length() + 1 ,
OutParametersList , ServiceOutParameter().length() + 1 ) ;
+
if ( !StsPyDynInvoke ) {
string anErrorMessage = string( "Dynamic Python call for node " ) +
string( Name() ) + " function " +
else {
for ( i = 0 ; i < (int ) ServiceInParameter().length() ; i++ ) {
OutParametersList[argout0 + i].Value = InParametersList[argin0 + i].Value ;
+
#if TraceDataReady_ExecuteAction
cdebug << "ArgOut->In" << InParametersList[argin0 + i].Name.c_str()
<< " " << AnyValue( InParametersList[argin0 + i].Value )
double d ;
sscanf( t , "%lf" , &d ) ;
float f = d ;
- D.Value <<= f ;
+ D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+// D.Value <<= f ;
#if InParametersSetTrace
cdebug << "string '" << t << "' --> " << setw(25) << setprecision(18) << d << " --> float " << " = "
<< setw(25) << setprecision(18) << f ;
else if ( !strcmp( Type , "double" ) ) {
double d ;
sscanf( t , "%lf" , &d ) ;
- D.Value <<= d ;
+ D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+// D.Value <<= d ;
#if InParametersSetTrace
cdebug << "string '" << t << " --> double " << setw(25) << setprecision(18) << d ;
#endif
else if ( !strcmp( Type , "float" ) ) {
float f ;
f = (float ) l ;
- D.Value <<= f ;
+ D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+// D.Value <<= f ;
// theOutPort->Value( D.Value ) ;
}
else if ( !strcmp( Type , "double" ) ) {
double d ;
d = (double ) l ;
- D.Value <<= d ;
+ D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+// D.Value <<= d ;
// theOutPort->Value( D.Value ) ;
}
// else if ( !strcmp( Type , "objref" ) ) {
else if ( !strcmp( Type , "float" ) ) {
float f ;
f = (float ) d ;
- D.Value <<= f ;
+ D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+// D.Value <<= f ;
// theOutPort->Value( D.Value ) ;
}
else if ( !strcmp( Type , "double" ) ) {
}
else if ( !strcmp( Type , "float" ) ) {
float f = 0 ;
- D.Value <<= f ;
+ D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+// D.Value <<= f ;
// theOutPort->Value( D.Value ) ;
}
else if ( !strcmp( Type , "double" ) ) {
double d = 0 ;
- D.Value <<= d ;
+ D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+// D.Value <<= d ;
// theOutPort->Value( D.Value ) ;
}
// else if ( !strcmp( Type , "objref" ) ) {
}
else if ( !strcmp( Type , "float" ) ) {
float f = 0 ;
- D.Value <<= f ;
+ D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+// D.Value <<= f ;
}
else if ( !strcmp( Type , "double" ) ) {
double d = 0 ;
- D.Value <<= d ;
+ D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+// D.Value <<= d ;
}
else {
D.Value <<= CORBA::Object::_nil() ;
float f;
D.Value >>= f;
double d = (double ) f ;
- D.Value <<= d ;
+ D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+// D.Value <<= d ;
#if OutParametersSetTrace
cdebug << ThreadNo() << " " << f << "(float)" << endl ;
#endif
ArgValue = Py_BuildValue( "O" , ResultObj ) ;
PyTuple_SetItem( ArgsList , i , ArgValue ) ;
#if PyDynInvokeTrace
- cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value (objref) ArgsList->ob_refcnt"
- << ArgsList->ob_refcnt << " ArgValue->ob_refcnt" << ArgValue->ob_refcnt << endl ;
+ if ( ArgValue )
+ cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value (objref) ArgsList->ob_refcnt"
+ << ArgsList->ob_refcnt << " ArgValue->ob_refcnt" << ArgValue->ob_refcnt << endl ;
+ else
+ cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value (objref) ArgsList->ob_refcnt"
+ << ArgsList->ob_refcnt << " ArgValue is NULL" << endl ;
cdebug << "MyPyObjRefList->ob_refcnt " << MyPyObjRefList->ob_refcnt-1 << endl ;
#endif
Py_DECREF( MyPyObjRefList ) ;
}
else {
#if PyDynInvokeTrace
- cdebug << "ResultObj->ob_refcnt " << ResultObj->ob_refcnt-1 << endl ;
+ if ( ResultObj )
+ cdebug << "ResultObj->ob_refcnt " << ResultObj->ob_refcnt-1 << endl ;
+ else
+ cdebug << "ResultObj is NULL" << endl ;
#endif
- Py_DECREF( ResultObj ) ;
+ if ( ResultObj )
+ Py_DECREF( ResultObj ) ;
}
break ;
}
else {
f = PyFloat_AsDouble( ArgValue ) ;
}
- data <<= f ;
+ data.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+ //data <<= f ;
#if PyDynInvokeTrace
cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << f << " (float)"
<< " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
else {
d = PyFloat_AsDouble( ArgValue ) ;
}
- data <<= d ;
+ data.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+ //data <<= d ;
#if PyDynInvokeTrace
cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << d << " (double)"
<< " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
LDFLAGS+=$(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) $(OGL_LIBS) \
-lSalomeApp -lsuit -lSalomeNS -lEvent \
-lSalomeLifeCycleCORBA -lSalomeNotification -lSUPERVGraph \
- -L${KERNEL_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome
+ -L${KERNEL_ROOT_DIR}/lib/salome -lSalomeDS -lSalomeDSClient -L${GUI_ROOT_DIR}/lib/salome
#-lqsplitterP
LIBS+=
else
myInitialViewFrame = aViewFrame;
}
- else
- registerGraph( f, main );
+ // mkr : IPAL11550 : register graph not depend on creation mode
+ registerGraph( f, main );
main->resizeView( new QResizeEvent( aViewFrame->size(), aViewFrame->size() ) );
aViewFrame->show();
QFileInfo inf( f );
}
}
+// mkr : IPAL11549 : before remove Macro Node we have to destroy
+// all its opened sub-graphs
+void SUPERVGUI_CanvasMacroNode::remove()
+{
+ SUPERV_Graph aGraph;
+ if (getEngine()->IsMacro()) {
+ SUPERV_Graph aMacro = getMacroNode();
+ if (aMacro->IsStreamMacro())
+ aGraph = aMacro->StreamObjRef();
+ else
+ aGraph = aMacro->FlowObjRef();
+ }
+ if (SUPERV_isNull(aGraph)) {
+ QMessageBox::warning(SUIT_Session::session()->activeApplication()->desktop(), tr("WARNING"), tr("MSG_NOSUBGRAPH_TO_REMOVE"));
+ return;
+ }
+ else {
+ getMain()->destroySubGraph(aGraph->Name());
+ }
+
+ SUPERVGUI_CanvasNode::remove();
+}
+
//=====================================================================
// Cell node: node for table view
//=====================================================================
virtual QPopupMenu* getPopupMenu(QWidget* theParent);
public slots:
+ virtual void remove(); // mkr : IPAL11549
void openSubGraph();
void exportDataflow();
{
Trace("SUPERVGUI_CanvasPortOut::SUPERVGUI_CanvasPortOut");
myInStudy = false;
+
+ // mkr : PAL8150
+ connect(this, SIGNAL(putInStudy( QString* )), getMain(), SLOT(onPutInStudy( QString* )));
}
SUPERVGUI_CanvasPortOut::~SUPERVGUI_CanvasPortOut()
aSupMod->unregisterGraph(getMain());
aSupMod->registerGraph(getMain()->getDataflow()->getIOR(), getMain());
}
+
+ // mkr : PAL8150
+ QString aNodePortName = QString( getEngine()->Node()->Name() ) + QString( "_" ) + QString( getEngine()->Name() );
+ emit putInStudy( &aNodePortName );
+
}
virtual QPopupMenu* getPopupMenu(QWidget* theParent);
+ signals:
+ void putInStudy( QString* ); // mkr : PAL8150
+
public slots:
void toStudy();
#include <boost/shared_ptr.hpp>
using namespace boost;
+// mkr : PAL8150
+#define SYNCPUTINSTUDY(NodesName) \
+ for ( int n = 0; n < nodes->NodesName.length(); n++ ) { \
+ SUPERV_CNode aCNode = SUPERV::CNode::_narrow(nodes->NodesName[n]); \
+ SUPERV_Ports aPortList = aCNode->Ports(); \
+ for (int p = 0; p < aPortList->length(); p++) { \
+ SUPERV::Port_ptr aPort = aPortList[p].in(); \
+ if ( !aPort->IsInput() && !aPort->IsGate() ) { \
+ bool aInStudy = dynamic_cast<SUPERVGUI_CanvasPortOut*>( aMain->getCanvas()->getPort(aPort) )->isInStudy(); \
+ dynamic_cast<SUPERVGUI_CanvasPortOut*>( getCanvas()->getPort( getDataflow()->Node(aCNode->Name())->Port(aPort->Name()) ) )->setStudyState(aInStudy); \
+ } \
+ } \
+ }
+
SUPERVGUI_Main::SUPERVGUI_Main( SUPERVGraph_ViewFrame* theParent,
SUIT_Desktop* theDesktop, SUPERV_Graph theDataFlow )
: SUPERVGraph_View(theParent),
} else {
init(theDesktop);
}
+
+ syncPutInStudy(); // mkr : PAL8150
+
// mkr : IPAL11362
connect(this, SIGNAL(EventToSync()), this, SLOT(onObjectCreatedDeleted()));
}
sync();
show();
- if ( myLogged && !myLogFileName.isEmpty() && QFile::exists( myLogFileName ) ) {
+ if ( myLogged && !myLogFileName.isEmpty() /*&& QFile::exists( myLogFileName )*/ ) { // mkr : PAL7037
myLogFile = fopen( myLogFileName.latin1(), "a" );
if ( myLogFile == NULL )
myLogged = false;
SUIT_ViewManager* aVM = it.data()->getViewManager();
STD_Application* anApp = dynamic_cast<STD_Application*>( SUIT_Session::session()->activeApplication() );
if ( anApp ) anApp->removeViewManager(aVM);
- if ( aVM ) delete aVM;
+ //if ( aVM ) delete aVM; // mkr : IPAL11547
}
mySubGraphs.clear();
fclose( myLogFile );
}
myLogFile = NULL;
- if ( myLogged && !myLogFileName.isEmpty() && QFile::exists( myLogFileName ) ) {
+ if ( myLogged && !myLogFileName.isEmpty() /*&& QFile::exists( myLogFileName )*/ ) { // mkr : PAL7037
myLogFile = fopen( myLogFileName.latin1(), "a" );
if ( myLogFile == NULL ) {
myLogged = false;
if ( aStudyFrame ) {
SUPERVGraph_ViewFrame* aViewFrame = dynamic_cast<SUPERVGraph_ViewFrame*>( aStudyFrame );
if( aViewFrame ) {
- /*SUPERVGUI_Main* m = */new SUPERVGUI_Main(aViewFrame,
- aSupMod->application()->desktop(),//getDesktop(),
- aGraph);
+ new SUPERVGUI_Main(aViewFrame,
+ aSupMod->application()->desktop(),//getDesktop(),
+ aGraph);
// connect(aStudyFrame, SIGNAL(sfStudyFrameClosing(QAD_StudyFrame*)),
// this, SLOT(onSubGraphClosed(QAD_StudyFrame*)));
connect(aSupMod->application()->desktop(), SIGNAL(windowActivated( SUIT_ViewWindow* )),
}
}
+// mkr : IPAL11549
+void SUPERVGUI_Main::destroySubGraph(QString theSubGraphName)
+{
+ if ( mySubGraphs.contains(theSubGraphName) ) {
+ SUIT_ViewWindow* aStudyFrame = mySubGraphs[theSubGraphName];
+ onSubGraphClosed(aStudyFrame);
+ SUIT_ViewManager* aVM = aStudyFrame->getViewManager();
+ STD_Application* anApp = dynamic_cast<STD_Application*>( SUIT_Session::session()->activeApplication() );
+ if ( anApp ) anApp->removeViewManager(aVM);
+ }
+}
+
bool SUPERVGUI_Main::eventFilter( QObject* o, QEvent* e)
{
// workaround to get close event
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
+ if ( !CORBA::is_nil( aMain->getDataflow() )
+ &&
+ !QString(aMain->getDataflow()->getIOR()).compare(getDataflow()->getIOR()) // equal dataflows
&&
aMain != this ) // not equal mains
aMain->getCanvas()->merge();
}
}
+// mkr : PAL8150 : synchronize many views of the same dataflow ("Put In Study"/"Not In Study" operation)
+void SUPERVGUI_Main::onPutInStudy( QString* theNodePortName )
+{
+ 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
+ QString aNodeName = theNodePortName->left( theNodePortName->find('_') );
+ QString aPortName = theNodePortName->right( theNodePortName->length() - theNodePortName->find('_') - 1 );
+ bool anIsInStudy = dynamic_cast<SUPERVGUI_CanvasPortOut*>( getCanvas()->getPort( getDataflow()->Node( aNodeName )->GetOutPort( aPortName ) ) )->isInStudy();
+ dynamic_cast<SUPERVGUI_CanvasPortOut*>( aMain->getCanvas()->getPort( aMain->getDataflow()->Node( aNodeName )->GetOutPort( aPortName ) ) )->setStudyState( anIsInStudy );
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+// mkr : PAL8150 : synchronize many views of the same dataflow ("Display" operation for dataflow)
+void SUPERVGUI_Main::syncPutInStudy()
+{
+ 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 ( !CORBA::is_nil( aMain->getDataflow() )
+ &&
+ !QString(aMain->getDataflow()->getIOR()).compare(getDataflow()->getIOR()) // equal dataflows
+ &&
+ aMain != this ) { // not equal mains
+
+ // check "myInStudy" field of output ports of original main (i.e. this main)
+ // and synchronize this property for nodes' output ports of dublicate main (i.e. of aMain)
+ SUPERV_Nodes nodes = aMain->getDataflow()->Nodes();
+
+ SYNCPUTINSTUDY(CNodes);
+ SYNCPUTINSTUDY(FNodes);
+ SYNCPUTINSTUDY(INodes);
+ SYNCPUTINSTUDY(GNodes);
+ SYNCPUTINSTUDY(LNodes);
+ SYNCPUTINSTUDY(ELNodes);
+ SYNCPUTINSTUDY(SNodes);
+ SYNCPUTINSTUDY(ESNodes);
+ SYNCPUTINSTUDY(Graphs);
+
+ setRunTime( aMain->getRunTime() );
+
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
void SUPERVGUI_Main::run( const bool andSuspend ) {
Trace("SUPERVGUI_Main::run");
if ( SUPERV_isNull(dataflow) )
void SUPERVGUI_Main::suspendResume() {
Trace("SUPERVGUI_Main::suspendResume");
+
if ((SUPERV_isNull(dataflow))) return;
if (dataflow->IsEditing()) {
_PTR(ChildIterator) anIterator ( theStudy->NewChildIterator(theSO) );
for (; anIterator->More(); anIterator->Next()) {
if (anIterator->Value()->FindAttribute(anAttr, "AttributeName")) {
- aName = anAttr;
+ aName = _PTR(AttributeName) ( anAttr );
if (strcmp(aName->Value().c_str(), theName) == 0) {
aResult = anIterator->Value();
break;
// add new SObject
aResult = theBuilder->NewObject( theSO );
anAttr = theBuilder->FindOrCreateAttribute(aResult, "AttributeName");
- aName = anAttr;
+ aName = _PTR(AttributeName) ( anAttr );
aName->SetValue(theName);
return aResult;
}
if ( !aComponent ) { // is supervision component not found, then create it
aComponent = aBuilder->NewComponent(STUDY_SUPERVISION);
anAttr = aBuilder->FindOrCreateAttribute(aComponent, "AttributeName");
- aName = anAttr;
+ aName = _PTR(AttributeName) ( anAttr );
aName->SetValue( (( CAM_Application* )(study->application()))->moduleTitle( "SUPERV" ).latin1() );
anAttr = aBuilder->FindOrCreateAttribute(aComponent, "AttributePixMap");
// create dataflow SObject ("aNewDataflow_1")
aSO = aBuilder->NewObject(aComponent);
anAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeName");
- aName = anAttr;
+ aName = _PTR(AttributeName) ( anAttr );
aName->SetValue(dataflow->Name());
anAttr = aBuilder->FindOrCreateAttribute(aSO, "AttributeIOR");
_PTR(AttributeIOR) anIORAttr ( anAttr );
long counter;
char* date;
long stamp;
-
+
while (notification->Receive(&graph, &node, &type, &message, &sender, &counter, &date, &stamp)) {
-// if (isFiltered(graph, node, type, message, sender, counter, date, stamp)) {
+ if (isFiltered(graph, node, type, message, sender, counter, date, stamp)) { // mkr : PAL7037
QString mess("");
mess += "NOTIF: "; mess += graph;
mess += " / " ; mess += node;
mess += " / " ; mess += type;
mess += " / " ; mess += message;
getMessage()->putMessage(mess.latin1());
-// };
+ };
};
}
bool b = false;
if (strcmp(getDataflow()->Name(), graph) == 0) {
SUPERVGUI_CanvasNode* n;
- QObjectList* nodes = queryList("SUPERVGUI_CanvasNode");
+ QObjectList* nodes;
+ // mkr : PAL7037 -->
+ if (myCurrentView == CANVASTABLE)
+ nodes = myArray->queryList("SUPERVGUI_CanvasNode");
+ else
+ nodes = myCanvas->queryList("SUPERVGUI_CanvasNode");
+ // mkr : PAL7037 <--
QObjectListIt i(*nodes);
while ((n=(SUPERVGUI_CanvasNode*)i.current()) != 0) {
++i;
SUPERV_CNode aNode = NULL;
SUPERV::GraphEvent aEvent = SUPERV::UndefinedEvent ;
SUPERV::GraphState aState = SUPERV::UndefinedState ;
-
+
// blocking function of Engine. Return from there only after anEvent happens on node aNode
myMain->getDataflow()->Event(aNode, aEvent, aState);
-
+
ProcessVoidEvent( new TMainRunEvent( this, &SUPERVGUI_Thread::main_thread_run,aNode, aEvent, aState ) );
} // end of while( myIsActive )
void suspendResume();
//void stopRestart();
void openSubGraph(SUPERV_CNode theNode, bool correct = false);
+ void destroySubGraph(QString theSubGraphName); // mkr : IPAL11549
bool putDataStudy(SUPERV_Port port, const char* inout);
virtual void resizeView( QResizeEvent* theEvent );
+ // mkr : PAL8150
+ void setRunTime( QDateTime theRunTime ) { myRunTime = theRunTime; }
+ QDateTime getRunTime() const { return myRunTime; }
+
signals:
void KillMyThread(bool theValue);
void EventToSync(); // mkr : IPAL11362
void onShowToolbar();
void onObjectCreatedDeleted(); // mkr : PAL8237
+ void onPutInStudy( QString* ); // mkr : PAL8150
private slots:
void chooseData(QListViewItem* item);
void syncNotification();
bool isFiltered(char* graph, char* node, char* type, char* message, char* sender, long counter, char* date, long stamp);
void closeEvent(QCloseEvent*);
-
+ void syncPutInStudy(); // mkr : PAL8150
+
SUPERV_Graph dataflow;
QMap<QString, SUIT_ViewWindow*> mySubGraphs;
msgid "MSG_NOWINDOW_TO_EXPORT"
msgstr "No Supervisor Window Has Been Selected to Export a Dataflow"
+msgid "MSG_NOSUBGRAPH_TO_REMOVE"
+msgstr "There is no sub-graph of this Macro node to remove"
+
msgid "MSG_CANT_LOAD_SUPERV"
msgstr "Cannot Find or Load Supervisor Component"
// return(anAny);
}
}
- catch ( CORBA::BAD_PARAM ) {
+ catch ( ... ) { // mkr : catch any exception to avoid crash after set incorrect
+ // value of 'objref' type for input port
+ //catch ( CORBA::BAD_PARAM ) {
// JR : objref or string only ==> the eventual convertion to long or double is done in
// the SuperVisionEngine with the real type of the argument