X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGraphBase%2FDataFlowBase_XmlHandler.cxx;h=2f22457f7e812892448165d5e962471775f17bd3;hb=8bb6ea38a8357d6ae5c45c4edbed03fd540f7866;hp=4b26c8af5baf1ec72429feab69414f19ffecdf8b;hpb=d2ea75950816c9bb41f70a80a8c4339d3d0ff9a5;p=modules%2Fsuperv.git diff --git a/src/GraphBase/DataFlowBase_XmlHandler.cxx b/src/GraphBase/DataFlowBase_XmlHandler.cxx index 4b26c8a..2f22457 100644 --- a/src/GraphBase/DataFlowBase_XmlHandler.cxx +++ b/src/GraphBase/DataFlowBase_XmlHandler.cxx @@ -1,19 +1,32 @@ -using namespace std; -//============================================================================= -// File : DataFlowBase_XmlHandler.cxx -// Created : Thu Sept 13 14:20:36 2001 -// Author : Arnaud RES -// Project : SALOME -// Copyright : CEA +// SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes. +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : DataFlowBase_XmlHandler.cxx +// Author : Arnaud RES +// Module : SUPERV // $Header$ -//#include "SALOME_NamingService.hxx" - -//#include -//#include CORBA_CLIENT_HEADER(SALOME_SuperVision) - -//#include "DataFlow_debug.hxx" - +using namespace std; #include "DataFlowBase_XmlHandler.hxx" #include @@ -34,22 +47,27 @@ GraphBase::XmlHandler::XmlHandler( CORBA::ORB_ptr Orb , step[i] = 0 ; } VXSize = 0 ; + GraphsNumber = 0 ; } GraphBase::XmlHandler::XmlHandler() {} GraphBase::XmlHandler::~XmlHandler() {} -QString GraphBase::XmlHandler::errorProtocol() -{ - return errorProt; +QString GraphBase::XmlHandler::errorProtocol() { + return errorProt; } -bool GraphBase::XmlHandler::startDocument() -{ - // at the beginning of parsing: do some initialization - errorProt = ""; - return TRUE; +bool GraphBase::XmlHandler::startDocument() { + MESSAGE( "====================startDocument " ) ; +// at the beginning of parsing: do some initialization + errorProt = ""; + return TRUE; +} + +bool GraphBase::XmlHandler::endDocument() { + MESSAGE( "====================endDocument " ) ; + return TRUE; } bool GraphBase::XmlHandler::startElement( const QString&, const QString&, @@ -62,12 +80,26 @@ bool GraphBase::XmlHandler::startElement( const QString&, const QString&, MESSAGE( "====================startElement " << depth << " " << qName) #endif - if ( qName == "dataflow" && depth == 0 ) { + + if ( ( qName == "dataflow" || qName == "supergraph" ) && depth == 0 ) { // Dataflow detected + aListOfDataFlows.resize( GraphsNumber + 1 ) ; + int i ; + for ( i = 0 ; i < maxlevel ; i++ ) { + fieldname[i] = NULLSTRING ; + fieldvalue[i] = NULLSTRING ; + step[i] = 0 ; + } + VXSize = 0 ; dataflowxml = TRUE; } if ( dataflowxml ) { - fieldname[depth++] = qName ; + if ( qName == "supergraph" ) { + fieldname[depth] = qName.latin1() ; + } + else { + fieldname[depth++] = qName.latin1() ; + } } if ( depth == maxlevel+1 ) return false ; @@ -89,25 +121,37 @@ bool GraphBase::XmlHandler::endElement( const QString&, const QString&, const QString& qName) { + if ( qName == "supergraph" ) { +#if TRACE + MESSAGE( " ====================endElement supergraph" ) ; +#endif + return TRUE ; + } + +// ERRORs : +// * On a eu endElement(dataflow) +// * Ou bien on a eu uniquement startElement(dataflow) et qName != fieldname et fieldvalue != NULLSTRING if ( !dataflowxml || ( qName != QString( fieldname[depth].c_str() ) && fieldvalue[depth] != NULLSTRING ) ) { - MESSAGE( "endElement ERROR " << dataflowxml << " qName " << qName - << " fieldname" << fieldname[depth] << " fieldvalue " + MESSAGE( "endElement ERROR dataflowxml " << dataflowxml << " qName " << qName + << " fieldname[" << depth << "] "<< fieldname[depth] << " fieldvalue " << fieldvalue[depth] ) return returnfalse( this , "top" , qName ) ; } - if ( fieldvalue[depth] == NULLSTRING ) + if ( fieldvalue[depth] == NULLSTRING ) { depth -= 1 ; + } #if TRACE - MESSAGE( " ==========endElement step[" << depth << "]=" + MESSAGE( " ====================endElement step[" << depth << "]=" << step[depth] << " qName " << qName << " fieldvalue '" << fieldvalue[depth] << "'") #endif switch ( depth ) { case 0 : { if ( step[depth] == 0 && qName == "dataflow" ) { + GraphsNumber += 1 ; dataflowxml = false ; } else @@ -119,7 +163,7 @@ bool GraphBase::XmlHandler::endElement( const QString&, switch ( step[depth] ) { case 0 : if ( qName == "info-list" ) { -// aDataFlow.Info = aNode ; +// aListOfDataFlows[ GraphsNumber ].Info = aNode ; step[depth]++ ; } else @@ -162,17 +206,18 @@ bool GraphBase::XmlHandler::endElement( const QString&, if ( qName == "node" ) { // Node ok if ( step[1] == 0 ) { - aDataFlow.Info = aNode ; + aListOfDataFlows[ GraphsNumber ].Info = aNode ; } else if ( step[1] == 1 ) { - int sizenode = aDataFlow.Nodes.size() ; - aDataFlow.Nodes.resize( sizenode+1 ) ; - aDataFlow.Nodes[ sizenode ] = aNode ; + int sizenode = aListOfDataFlows[ GraphsNumber ].Nodes.size() ; + aListOfDataFlows[ GraphsNumber ].Nodes.resize( sizenode+1 ) ; + aListOfDataFlows[ GraphsNumber ].Nodes[ sizenode ] = aNode ; } step[3] = 0 ; aNode.theService.ServiceinParameter.length( 0 ) ; aNode.theService.ServiceoutParameter.length( 0 ) ; - aNode.theListOfParameters.resize( 0 ) ; + aNode.theListOfInDataStreams.resize( 0 ) ; + aNode.theListOfOutDataStreams.resize( 0 ) ; aNode.theListOfFuncName.resize( 0 ) ; aNode.theListOfPythonFunctions.resize( 0 ) ; break ; @@ -186,15 +231,15 @@ bool GraphBase::XmlHandler::endElement( const QString&, } case 1 : if ( qName == "link" ) { - int sizelink = aDataFlow.Links.size() ; - aDataFlow.Links.resize( sizelink+1 ) ; - aDataFlow.Links[ sizelink ] = aLink ; + int sizelink = aListOfDataFlows[ GraphsNumber ].Links.size() ; + aListOfDataFlows[ GraphsNumber ].Links.resize( sizelink+1 ) ; + aListOfDataFlows[ GraphsNumber ].Links[ sizelink ] = aLink ; if ( VXSize ) { - aDataFlow.Links[ sizelink ].aListOfCoords.resize( VXSize ) ; + aListOfDataFlows[ GraphsNumber ].Links[ sizelink ].aListOfCoords.resize( VXSize ) ; int ic ; for ( ic = 0 ; ic < VXSize ; ic++ ) { - aDataFlow.Links[ sizelink ].aListOfCoords[ ic ].theX = VX[ic] ; - aDataFlow.Links[ sizelink ].aListOfCoords[ ic ].theY = VY[ic] ; + aListOfDataFlows[ GraphsNumber ].Links[ sizelink ].aListOfCoords[ ic ].theX = VX[ic] ; + aListOfDataFlows[ GraphsNumber ].Links[ sizelink ].aListOfCoords[ ic ].theY = VY[ic] ; } } VXSize = 0 ; @@ -212,15 +257,15 @@ bool GraphBase::XmlHandler::endElement( const QString&, if ( qName == "data" ) { // Data ok if ( constructor ) { - int sizedata = aDataFlow.Datas.size() ; - aDataFlow.Datas.resize( sizedata+1 ) ; - aDataFlow.Datas[ sizedata ] = aLink ; + int sizedata = aListOfDataFlows[ GraphsNumber ].Datas.size() ; + aListOfDataFlows[ GraphsNumber ].Datas.resize( sizedata+1 ) ; + aListOfDataFlows[ GraphsNumber ].Datas[ sizedata ] = aLink ; if ( VXSize ) { - aDataFlow.Datas[ sizedata ].aListOfCoords.resize( VXSize ) ; + aListOfDataFlows[ GraphsNumber ].Datas[ sizedata ].aListOfCoords.resize( VXSize ) ; int ic ; for ( ic = 0 ; ic < VXSize ; ic++ ) { - aDataFlow.Datas[ sizedata ].aListOfCoords[ ic ].theX = VX[ic] ; - aDataFlow.Datas[ sizedata ].aListOfCoords[ ic ].theY = VY[ic] ; + aListOfDataFlows[ GraphsNumber ].Datas[ sizedata ].aListOfCoords[ ic ].theX = VX[ic] ; + aListOfDataFlows[ GraphsNumber ].Datas[ sizedata ].aListOfCoords[ ic ].theY = VY[ic] ; } } } @@ -283,14 +328,47 @@ bool GraphBase::XmlHandler::endElement( const QString&, if ( fieldvalue[depth] == NULLSTRING ) return returnfalse( this , "depth3-3" , qName ) ; // kind ok - sscanf( fieldvalue[depth].c_str() ,"%d" , &aNode.theKind ) ; + sscanf( fieldvalue[depth].c_str() ,"%d" , (int * ) &aNode.theKind ) ; + fieldvalue[depth] = NULLSTRING ; + if ( aNode.theKind != SUPERV::DataStreamGraph ) { + step[depth]++ ; + step[4] = 0 ; + } + break ; + } + else if ( qName == "streamgraph-timeout" ) { + if ( fieldvalue[depth] == NULLSTRING ) + return returnfalse( this , "depth3-3" , qName ) ; + sscanf( fieldvalue[depth].c_str() ,"%d" , (int * ) &aNode.theTimeout ) ; + fieldvalue[depth] = NULLSTRING ; +// step[depth]++ ; +// step[4] = 0 ; + break ; + } + else if ( qName == "streamgraph-datastreamtrace" ) { + if ( fieldvalue[depth] == NULLSTRING ) + return returnfalse( this , "depth3-3" , qName ) ; + sscanf( fieldvalue[depth].c_str() ,"%d" , (int * ) &aNode.theDataStreamTrace ) ; + fieldvalue[depth] = NULLSTRING ; +// step[depth]++ ; +// step[4] = 0 ; + break ; + } + else if ( qName == "streamgraph-deltatime" ) { + if ( fieldvalue[depth] == NULLSTRING ) + return returnfalse( this , "depth3-3" , qName ) ; + sscanf( fieldvalue[depth].c_str() ,"%lf" , (double * ) &aNode.theDeltaTime ) ; fieldvalue[depth] = NULLSTRING ; step[depth]++ ; step[4] = 0 ; + break ; } - else - return returnfalse( this , "depth3-3" , qName ) ; - break ; + else { + step[depth]++ ; + step[4] = 0 ; + } +// return returnfalse( this , "depth3-3" , qName ) ; +// break ; case 4 : if ( qName == "coupled-node" ) { if ( fieldvalue[depth] == NULLSTRING ) @@ -321,7 +399,7 @@ bool GraphBase::XmlHandler::endElement( const QString&, return returnfalse( this , "depth3-5" , qName ) ; break ; case 6 : - if ( qName == "Parameter-list" ) { + if ( qName == "DataStream-list" || qName == "Parameter-list" ) { if ( fieldvalue[depth] != NULLSTRING ) return returnfalse( this , "depth3-6" , qName ) ; fieldvalue[depth] = NULLSTRING ; @@ -362,7 +440,7 @@ bool GraphBase::XmlHandler::endElement( const QString&, char Date[23] ; strcpy( Date , fieldvalue[depth].c_str() ) ; int i ; - for ( i = 0 ; i < strlen(Date) ; i++ ) { + for ( i = 0 ; i < (int ) strlen(Date) ; i++ ) { if ( Date[i] == '/' || Date[i] == '-' || Date[i] == ':' ) Date[i] = ' ' ; } @@ -393,7 +471,7 @@ bool GraphBase::XmlHandler::endElement( const QString&, char Date[23] ; strcpy( Date , fieldvalue[depth].c_str() ) ; int i ; - for ( i = 0 ; i < strlen(Date) ; i++ ) { + for ( i = 0 ; i < (int ) strlen(Date) ; i++ ) { if ( Date[i] == '/' || Date[i] == '-' || Date[i] == ':' ) Date[i] = ' ' ; } @@ -473,7 +551,7 @@ bool GraphBase::XmlHandler::endElement( const QString&, if ( qName == "x-position" ) { if ( fieldvalue[depth] == NULLSTRING ) return returnfalse( this , "depth3-14" , qName ) ; - sscanf( fieldvalue[depth].c_str() , "%d" , &aNode.theCoords.theX ) ; + sscanf( fieldvalue[depth].c_str() , "%ld" , &aNode.theCoords.theX ) ; fieldvalue[depth] = NULLSTRING ; step[depth]++ ; // x-position ok @@ -485,7 +563,7 @@ bool GraphBase::XmlHandler::endElement( const QString&, if ( qName == "y-position" ) { if ( fieldvalue[depth] == NULLSTRING ) return returnfalse( this , "depth3-15" , qName ) ; - sscanf( fieldvalue[depth].c_str() , "%d" , &aNode.theCoords.theY ) ; + sscanf( fieldvalue[depth].c_str() , "%ld" , &aNode.theCoords.theY ) ; fieldvalue[depth] = NULLSTRING ; step[depth]++ ; // y-position ok @@ -631,7 +709,8 @@ bool GraphBase::XmlHandler::endElement( const QString&, aLink.aLinkValue = CORBA::Any() ; switch ( Kind ) { case CORBA::tk_string: { - aLink.aLinkValue <<= (char *) NULL ; +//Mandrake 10.1/Salome 3 aLink.aLinkValue <<= (char *) NULL ; + aLink.aLinkValue <<= (char *) "" ; char * t; aLink.aLinkValue >>= t; #if TRACE @@ -658,7 +737,8 @@ bool GraphBase::XmlHandler::endElement( const QString&, break; } case CORBA::tk_objref: { - aLink.aLinkValue.replace(CORBA::_tc_Object, NULL); +// aLink.aLinkValue.replace(CORBA::_tc_Object, NULL); + aLink.aLinkValue <<= CORBA::Object::_nil() ; #if TRACE MESSAGE( " (object reference)" ); #endif @@ -680,8 +760,7 @@ bool GraphBase::XmlHandler::endElement( const QString&, if ( fieldvalue[depth] == NULLSTRING ) return returnfalse( this , "depth4-4" , qName ) ; if ( !strcmp( fieldvalue[depth].c_str() , "?" ) ) { -// aLink.aLinkValue.Value = fieldvalue[depth].c_str() ; - aLink.aLinkValue = CORBA::Any() ; // ??? + aLink.aLinkValue <<= "" ; } else { switch ( aLink.aLinkValue.type()->kind() ) { @@ -741,7 +820,7 @@ bool GraphBase::XmlHandler::endElement( const QString&, if ( qName == "coord" ) { if ( fieldvalue[depth] != NULLSTRING ) return returnfalse( this , "depth4-5" , qName ) ; - if ( VXSize == VX.size() ) { + if ( VXSize == (int ) VX.size() ) { VX.resize( VX.size() + 10 ) ; VY.resize( VY.size() + 10 ) ; } @@ -757,21 +836,23 @@ bool GraphBase::XmlHandler::endElement( const QString&, if ( qName == "inParameter" ) { if ( fieldvalue[depth] != NULLSTRING ) return returnfalse( this , "depth4-6" , qName ) ; - int size = aNode.theListOfParameters.size() ; - aNode.theListOfParameters.resize( size+1 ) ; - aNode.theListOfParameters[size].theInParameter = aParameter ; - step[depth]++ ; + int size = aNode.theListOfInDataStreams.size() ; + aNode.theListOfInDataStreams.resize( size+1 ) ; + aNode.theListOfInDataStreams[ size ] = anInDataStreamParameter ; + break ; // One more aParameter input } else - return returnfalse( this , "depth4-6" , qName ) ; - break ; + step[depth]++ ; +// return returnfalse( this , "depth4-6" , qName ) ; +// break ; case 7 : if ( qName == "outParameter" ) { if ( fieldvalue[depth] != NULLSTRING ) return returnfalse( this , "depth4-7" , qName ) ; - int size = aNode.theListOfParameters.size() ; - aNode.theListOfParameters[size-1].theOutParameter = aParameter ; + int size = aNode.theListOfOutDataStreams.size() ; + aNode.theListOfOutDataStreams.resize( size+1 ) ; + aNode.theListOfOutDataStreams[ size ] = anOutDataStreamParameter ; // One more aParameter output step[4] = 6 ; step[5] = 4 ; @@ -853,31 +934,103 @@ bool GraphBase::XmlHandler::endElement( const QString&, if ( qName == "inParameter-type" ) { if ( fieldvalue[depth] == NULLSTRING ) return returnfalse( this , "depth5-4" , qName ) ; - aParameter.Parametertype = fieldvalue[depth].c_str() ; + sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theDataStreamParameter.Parametertype ) ; fieldvalue[depth] = NULLSTRING ; step[depth]++ ; +#if TRACE + //cout << "InDataStreamParameter.inParameter-type " << anInDataStreamParameter.theDataStreamParameter.Parametertype << " step[" << depth << "]" << step[depth] << endl ; +#endif + break ; } else - return returnfalse( this , "depth5-4" , qName ) ; - break ; + step[depth] = 6 ; +// return returnfalse( this , "depth5-4" , qName ) ; +// break ; case 5 : if ( qName == "inParameter-name" ) { if ( fieldvalue[depth] == NULLSTRING ) return returnfalse( this , "depth5-5" , qName ) ; - aParameter.Parametername = fieldvalue[depth].c_str() ; + if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) { + anInDataStreamParameter.theDataStreamParameter.Parametername = fieldvalue[depth].c_str() ; + } + else { + anInDataStreamParameter.theDataStreamParameter.Parametername = "" ; + } fieldvalue[depth] = NULLSTRING ; - step[depth]++ ; +#if TRACE + //cout << "InDataStreamParameter.inParameter-name " << anInDataStreamParameter.theDataStreamParameter.Parametername << " step[" << depth << "]" << step[depth] << endl ; +#endif +// step[depth]++ ; +// step[depth] = 4 ; + break ; } - else - return returnfalse( this , "depth5-5" , qName ) ; - break ; + else if ( qName == "inParameter-dependency" ) { + if ( fieldvalue[depth] == NULLSTRING ) + return returnfalse( this , "depth5-5" , qName ) ; + sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theDataStreamParameter.Parameterdependency ) ; + fieldvalue[depth] = NULLSTRING ; +#if TRACE + //cout << "InDataStreamParameter.inParameter-dependency " << anInDataStreamParameter.theDataStreamParameter.Parameterdependency << " step[" << depth << "]" + // << step[depth] << endl ; +#endif +// step[depth]++ ; +// step[depth] = 4 ; + break ; + } + else if ( qName == "inParameter-schema" ) { + if ( fieldvalue[depth] == NULLSTRING ) + return returnfalse( this , "depth5-5" , qName ) ; + sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theKindOfSchema ) ; + fieldvalue[depth] = NULLSTRING ; +#if TRACE + //cout << "InDataStreamParameter.inParameter-schema " << anInDataStreamParameter.theKindOfSchema << " step[" << depth << "]" + // << step[depth] << endl ; +#endif +// step[depth]++ ; +// step[depth] = 4 ; + break ; + } + else if ( qName == "inParameter-interpolation" ) { + if ( fieldvalue[depth] == NULLSTRING ) + return returnfalse( this , "depth5-5" , qName ) ; + sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theKindOfInterpolation ) ; + fieldvalue[depth] = NULLSTRING ; +#if TRACE + //cout << "InDataStreamParameter.inParameter-interpolation " << anInDataStreamParameter.theKindOfInterpolation << " step[" << depth << "]" + // << step[depth] << endl ; +#endif +// step[depth]++ ; +// step[depth] = 4 ; + break ; + } + else if ( qName == "inParameter-extrapolation" ) { + if ( fieldvalue[depth] == NULLSTRING ) + return returnfalse( this , "depth5-5" , qName ) ; + sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anInDataStreamParameter.theKindOfExtrapolation ) ; + fieldvalue[depth] = NULLSTRING ; +// step[depth]++ ; + step[depth] = 4 ; +#if TRACE + //cout << "InDataStreamParameter.inParameter-extrapolation " << anInDataStreamParameter.theKindOfExtrapolation << " step[" << depth << "]" + // << step[depth] << endl ; +#endif + break ; + } +// else +// return returnfalse( this , "depth5-5" , qName ) ; +// break ; case 6 : if ( qName == "outParameter-type" ) { if ( fieldvalue[depth] == NULLSTRING ) return returnfalse( this , "depth5-6" , qName ) ; - aParameter.Parametertype = fieldvalue[depth].c_str() ; + sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anOutDataStreamParameter.theDataStreamParameter.Parametertype ) ; fieldvalue[depth] = NULLSTRING ; - step[depth]++ ; +// step[depth]++ ; + step[depth] = 7 ; +#if TRACE + //cout << "OutDataStreamParameter.outParameter-type " << anOutDataStreamParameter.theDataStreamParameter.Parametertype << " step[" << depth << "]" + // << step[depth] << endl ; +#endif } else return returnfalse( this , "depth5-6" , qName ) ; @@ -886,9 +1039,43 @@ bool GraphBase::XmlHandler::endElement( const QString&, if ( qName == "outParameter-name" ) { if ( fieldvalue[depth] == NULLSTRING ) return returnfalse( this , "depth5-7" , qName ) ; - aParameter.Parametername = fieldvalue[depth].c_str() ; + if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) { + anOutDataStreamParameter.theDataStreamParameter.Parametername = fieldvalue[depth].c_str() ; + } + else { + anOutDataStreamParameter.theDataStreamParameter.Parametername = "" ; + } fieldvalue[depth] = NULLSTRING ; - step[depth]++ ; +#if TRACE + //cout << "OutDataStreamParameter.outParameter-name " << anOutDataStreamParameter.theDataStreamParameter.Parametername << " step[" << depth << "]" + // << step[depth] << endl ; +#endif +// step[depth]++ ; +// step[depth] = 6 ; + } + else if ( qName == "outParameter-dependency" ) { + if ( fieldvalue[depth] == NULLSTRING ) + return returnfalse( this , "depth5-7" , qName ) ; + sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anOutDataStreamParameter.theDataStreamParameter.Parameterdependency ) ; + fieldvalue[depth] = NULLSTRING ; +#if TRACE + //cout << "OutDataStreamParameter.outParameter-dependency " << anOutDataStreamParameter.theDataStreamParameter.Parameterdependency << " step[" << depth << "]" + // << step[depth] << endl ; +#endif +// step[depth]++ ; +// step[depth] = 6 ; + } + else if ( qName == "outParameter-values" ) { + if ( fieldvalue[depth] == NULLSTRING ) + return returnfalse( this , "depth5-7" , qName ) ; + sscanf( fieldvalue[depth].c_str() , "%d" , (int * ) &anOutDataStreamParameter.theNumberOfValues ) ; + fieldvalue[depth] = NULLSTRING ; +// step[depth]++ ; + step[depth] = 6 ; +#if TRACE + //cout << "OutDataStreamParameter.outParameter-values " << anOutDataStreamParameter.theNumberOfValues << " step[" << depth << "]" + // << step[depth] << endl ; +#endif } else return returnfalse( this , "depth5-7" , qName ) ; @@ -899,7 +1086,12 @@ bool GraphBase::XmlHandler::endElement( const QString&, return returnfalse( this , "depth5-8" , qName ) ; int l = aNode.theListOfFuncName.size() ; aNode.theListOfFuncName.resize( l+1 ) ; - aNode.theListOfFuncName[ l ] = fieldvalue[depth].c_str() ; + if ( strcmp( fieldvalue[depth].c_str() , "?" ) ) { + aNode.theListOfFuncName[ l ] = fieldvalue[depth].c_str() ; + } + else { + aNode.theListOfFuncName[ l ] = "" ; + } aNode.theListOfPythonFunctions.resize( l+1 ) ; aNode.theListOfPythonFunctions[ l ] = new SUPERV::ListOfStrings() ; #if TRACE @@ -1002,6 +1194,9 @@ bool GraphBase::XmlHandler::endElement( const QString&, } } +#if TRACE + //cout << "return from endElement " << qName << " step[" << depth << "]" << step[depth] << endl ; +#endif return TRUE; } @@ -1015,18 +1210,19 @@ bool GraphBase::XmlHandler::characters( const QString& ch ) { depth -= 1 ; #if TRACE MESSAGE( "characters step[" << depth << "]=" << step[depth] - << " ch " << ch << " fieldvalue_must_be_NULL " << fieldvalue[depth] ) + << " ch " << ch << " fieldvalue_must_be_NULL : '" << fieldvalue[depth] << "'" ) ; #endif if ( depth < 0 || fieldvalue[depth] != NULLSTRING ) return returnfalse( this , "characters " , ch ) ; - fieldvalue[depth] = ch ; +// fieldvalue[depth] = (const char * ) ch ; + fieldvalue[depth] = ch.latin1() ; return TRUE; } QString GraphBase::XmlHandler::errorString() { - cout << "the document is not in the quote file format" << endl ; + //cout << "the document is not in the quote file format" << endl ; return "the document is not in the quote file format"; } @@ -1036,7 +1232,7 @@ bool GraphBase::XmlHandler::fatalError( const QXmlParseException& exception ) { .arg( exception.message() ) .arg( exception.lineNumber() ) .arg( exception.columnNumber() ); - cout << "GraphBase::XmlHandler::fatalError " << errorProt.latin1() << endl ; + //cout << "GraphBase::XmlHandler::fatalError " << errorProt.latin1() << endl ; return QXmlDefaultHandler::fatalError( exception ); }