X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSUPERVGUI%2FSUPERVGUI_CanvasNodePrs.cxx;h=c5d107df1af309255346fb8becba5789ed54c315;hb=1f25d68b3c1179622df53d4403b253d3e0fb52da;hp=d82abd2a81bec413dc67b51a4faebf7120ff500c;hpb=3adca07fe666de5d5a9ad6228488f1cbc939d1fb;p=modules%2Fsuperv.git diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasNodePrs.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasNodePrs.cxx index d82abd2..c5d107d 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasNodePrs.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasNodePrs.cxx @@ -1,17 +1,34 @@ // SUPERV SUPERVGUI : GUI for Supervisor component // -// Copyright (C) 2003 OPEN CASCADE +// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : SUPERVGUI_GanvasNodePrs.cxx // 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" @@ -21,7 +38,7 @@ using namespace std; #include #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 @@ -561,7 +578,8 @@ void SUPERVGUI_CanvasNodePrs::draw(QPainter& thePainter) { 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) @@ -671,7 +689,12 @@ void SUPERVGUI_CanvasNodePrs::drawPort(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); } } @@ -754,7 +777,10 @@ void SUPERVGUI_CanvasNodePrs::setState(SUPERV::GraphState theState) break; } - long sec = myNode->getEngine()->CpuUsed(); + long sec = 0; + // IPAL9273, 9369, 9731 + if ( theState != SUPERV_Kill && myNode->getMain()->getDataflow()->State() != SUPERV_Kill ) + sec = myNode->getEngine()->CpuUsed(); char hms[9]; long s = sec/3600; hms[0]=(char)(((s/10)%10)+48); @@ -878,9 +904,23 @@ bool SUPERVGUI_CanvasPortPrs::isAlert() const 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()) { + // mkr : modifications to avoid displaying long IOR's values on nodes' ports, + // display ports type from corresponding XML catalog instead. + QString aPortValue = aPort->ToString(); + QString aPortType = aPort->Type(); + if ( aPortType.compare("string") // not "string" type + && + aPortValue.find("IOR:") >= 0 ) // has IOR:... in value + aText = aText + "=" + aPortType; + else + aText = aText + "=" + aPortValue; + } + } + // printf( "--- return text of port : %s ---\n", aText.latin1() ); return aText; }