#include "QAD_Application.h"
#include "QAD_RightFrame.h"
#include "QAD_SpinBoxDbl.h"
+#include "QAD_MessageBox.h"
#include "NOTIFICATION.hxx"
#include "SALOME_Event.hxx"
#include "SUPERVGUI_Notification.h"
#include "SUPERVGUI_Information.h"
#include "SUPERVGUI_CanvasControlNode.h"
+#include "SUPERVGUI_CanvasPort.h"
#include <qvalidator.h>
#include <qlayout.h>
/**
* Called by thread when dataflow is executing
*/
-void SUPERVGUI_Main::execute(char * theNodeName, SUPERV::GraphState theNodeState) {
+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 ) {
SUPERVGUI_CanvasCellNode* aNode = (SUPERVGUI_CanvasCellNode*) myArray->child(theNodeName, "SUPERVGUI_CanvasCellNode");
if (aNode) aNode->sync();
}
+
+ // asv : 26.01.05 : Bug PAL7164 : puting out-value to study if the "put_to_Study" flag is set on a
+ // CanvasPort the functionality was moved from SUPERVGUI_CanvasPortOut::sync() method please, see
+ // comment in that method for details.
+ if ( theNodeState == SUPERV::DoneState ) {
+ SUPERVGUI_CanvasNode* aNode = (SUPERVGUI_CanvasNode*) myCanvas->child(theNodeName, "SUPERVGUI_CanvasNode");
+ if ( aNode ) {
+ //cout << " *** theNode " << theNodeName << " received DONE_STATE *** " << endl;
+ SUPERVGUI_CanvasPortOut* aPortOut;
+ QObjectList* aPortList = aNode->queryList("SUPERVGUI_CanvasPortOut");
+ QObjectListIt aPortIt(*aPortList);
+ while ((aPortOut=(SUPERVGUI_CanvasPortOut*)aPortIt.current()) != 0) {
+ ++aPortIt;
+ if ( aPortOut->isInStudy() && aPortOut->getEngine()->State() == SUPERV::ReadyState ) {
+ //cout << " *** " << theNodeName << "[" << aPortOut->name() << "]--> goes into study *** " << endl;
+ putDataStudy( aPortOut->getEngine(), STUDY_PORT_OUT );
+ }
+ }
+ delete aPortList;
+ }
+ //else //normal case if Node is not found is when node is a graph! it can receive DoneState as well!
+ // MESSAGE( "ERROR in SUPERVGUI_Main::execute() : CanvasNode \"" << theNodeName << "\" NOT FOUND in myCanvas" );
+ }
}
*/
void SUPERVGUI_Main::addNode() {
Trace("SUPERVGUI_Main::addNode");
- if (SUPERV_isNull(dataflow)) return;
+ bool error = SUPERV_isNull( dataflow );
+ if ( error )
+ return;
- if (dataflow->IsExecuting()) {
- if (QMessageBox::warning(QAD_Application::getDesktop(),
- tr("WARNING"), tr("MSG_GRAPH_ISRUN"),
- QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) {
- return;
- } else {
+ if ( dataflow->IsExecuting() ) {
+ error = QAD_MessageBox::warn2( QAD_Application::getDesktop(), // 0=Yes, 1=No
+ tr("WARNING"), tr("MSG_GRAPH_ISRUN"), tr( "BUT_YES" ), tr( "BUT_NO" ), 0, 1, 0 );
+ if ( error ) // user selected NOT to kill dataflow and NOT to add new node
+ return;
+ else // user selected to kill the dataflow and add new node after that
kill();
- }
}
Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
// as argument
if (myArray) {
const QObjectList* aChList = myArray->children();
- QObjectListIt aItChList(*aChList);
- SUPERVGUI_CanvasNode* anObjNode;
- while ((anObjNode = (SUPERVGUI_CanvasNode*)aItChList.current()) != 0) {
- ++aItChList;
- if ((QString(anObjNode->getEngine()->Name())).compare(QString(theNode->Name())) == 0) {
- myArray->removeChild(anObjNode);
- delete anObjNode;
+ if ( aChList ) { // asv 27.01.05 : fix for 7817
+ QObjectListIt aItChList(*aChList);
+ SUPERVGUI_CanvasNode* anObjNode;
+ while ((anObjNode = (SUPERVGUI_CanvasNode*)aItChList.current()) != 0) {
+ ++aItChList;
+ if ((QString(anObjNode->getEngine()->Name())).compare(QString(theNode->Name())) == 0) {
+ myArray->removeChild(anObjNode);
+ delete anObjNode;
+ }
}
- }
+ } // end of if ( ChList )
}
}