//#include "utilities.h"
+#include "SALOME_Container_i.hxx"
+
#include "StreamGraph_Impl.hxx"
#include "DataFlowEditor_DataFlow.hxx"
const SUPERV::KindOfNode aKindOfNode ,
string & dbgfile ,
GraphEditor::DataFlow ** aDataFlowEditor ) {
-// string dbgfile = "/tmp/" ;
bool aXmlFile = false ;
- dbgfile = "/tmp/" ;
- dbgfile += instanceName ;
- dbgfile += "_" ;
int lenname = strlen( aDataFlowName ) ;
char * theDataFlowName = new char [ lenname+1 ] ;
strcpy( theDataFlowName , aDataFlowName ) ;
strcpy( theDataFlowName , &aDataFlowName[ 0 ] ) ;
}
}
+
string theDataFlowInstanceName = theDataFlowName ;
-// if ( !aXmlFile ) {
-// theDataFlowInstanceName = theAutomaton->GraphInstanceName( theDataFlowName ) ;
-// }
+
+ // asv : 16.11.04 : creation of log file in /tmp/logs/$USER dir.
+ // "/tmp/logs/$USER" was created by runSalome.py -> orbmodule.py.
+ dbgfile = "/tmp/logs/" ;
+ dbgfile += getenv( "USER" ) ;
+ dbgfile += "/" ;
+ dbgfile += instanceName ;
+ dbgfile += "_" ;
dbgfile += theDataFlowInstanceName ;
dbgfile = dbgfile + "_" + theAutomaton->DbgFileNumber() + ".log" ;
+ FILE* f = fopen ( dbgfile.c_str(), "a" );
+ if ( f ) { // check if file can be opened for writing
+ fclose( f );
+ }
+ else { // if file can't be opened - use a guaranteed temp file name
+ char* aTempNam = tempnam( NULL, NULL );
+ dbgfile = aTempNam;
+ free ( aTempNam );
+ }
+
SALOME_NamingService * NamingService = new SALOME_NamingService( orb ) ;
*aDataFlowEditor = new GraphEditor::DataFlow( orb , NamingService ,
theDataFlowInstanceName.c_str() , dbgfile.c_str() ,
const SUPERV::KindOfNode aKindOfNode ,
string & dbgfile ,
GraphExecutor::DataFlow ** aDataFlowExecutor ) {
-// string dbgfile = "/tmp/" ;
- dbgfile = "/tmp/" ;
- dbgfile += instanceName ;
- dbgfile += "_" ;
int lenname = strlen( aDataFlowName ) ;
char * theDataFlowName = new char [ lenname+1 ] ;
strcpy( theDataFlowName , aDataFlowName ) ;
if ( aDataFlowName ) {
strcpy( theDataFlowName , &aDataFlowName[ 0 ] ) ;
}
+
string theDataFlowInstanceName = theDataFlowName ;
+
+ // asv : 16.11.04 : creation of log file in /tmp/logs/$USER dir.
+ // "/tmp/logs/$USER" was created by runSalome.py -> orbmodule.py.
+ dbgfile = "/tmp/logs/" ;
+ dbgfile += getenv( "USER" ) ;
+ dbgfile += "/" ;
+ dbgfile += instanceName ;
+ dbgfile += "_" ;
dbgfile += theDataFlowInstanceName ;
dbgfile = dbgfile + "_" + theAutomaton->DbgFileNumber() ;
-
ostringstream astr ;
astr << theAutomaton->ExecNumber() ;
dbgfile += astr.str() ;
dbgfile += string( "_Exec.log" ) ;
+ FILE* f = fopen ( dbgfile.c_str(), "a" );
+ if ( f ) { // check if file can be opened for writing
+ fclose( f );
+ }
+ else { // if file can't be opened - use a guaranteed temp file name
+ char* aTempNam = tempnam( NULL, NULL );
+ dbgfile = aTempNam;
+ free ( aTempNam );
+ }
SALOME_NamingService * NamingService = new SALOME_NamingService( orb ) ;
*aDataFlowExecutor = new GraphExecutor::DataFlow( orb , NamingService ,
theDataFlowInstanceName.c_str() , dbgfile.c_str() ,
aKindOfNode ) ;
+
MESSAGE( "CreateExecutor " << theDataFlowName << " " << theDataFlowInstanceName << " created with "
<< dbgfile.c_str() ) ;
bool Graph_Impl::IsExecutable() {
// beginService( "Graph_Impl::IsExecutable" );
bool RetVal = false ;
- if ( !IsMacro() ) {
+
+ // asv : 15.11.04 : added "&& GraphMacroLevel() == 0" ->
+ // subgraphs are not executable by themselves, RetVal = false..
+ if ( !IsMacro() && DataFlowEditor()->Graph()->GraphMacroLevel() == 0 ) {
RetVal = DataFlowEditor()->IsExecutable() ;
}
// endService( "Graph_Impl::IsExecutable" );