QObject* anObj;
while ( (anObj = aIt.current()) != 0 ) {
++aIt;
+ aNodeList->removeRef(anObj);
delete anObj;
}
// asv : list returned by queryList() must be removed
// there is no any calculations
if (ncols == 0) return false;
- QCanvasItemList anIL1 = this->allItems();
-
QPen pen(Qt::SolidLine);
pen.setWidth(1);
QBrush br(MAIN_TITLE);
myOldThreadNum = ncols;
- QCanvasItemList anIL2 = this->allItems();
-
y = 60;
bool LevelHasDiffNT = false;
for (int li = 0; li <= nligs; li++) {
}
if (nodes->FNodes.length() != 0 ) {
ADDNODES(FNodes,LevelHasDiffNT);
-
- QCanvasItemList anIL3 = this->allItems();
-
if (aSumNum > nodes->FNodes.length())
LevelHasDiffNT = true;
}
nodeX = 50;
nodeY = y + CELL_HEIGHT*2;
- QCanvasItemList anIL4 = this->allItems();
-
return true;
}
void SUPERVGUI_CanvasArray::destroy() {
Trace("SUPERVGUI_Array::destroy");
- QCanvasItemList anIL1 = this->allItems();
- const QObjectList* anCL1 = this->children();
-
QObjectList* aCellList = queryList("SUPERVGUI_CanvasCellNode");
QObjectListIt aIt(*aCellList);
QObject* anObj;
delete aTextList;
- QCanvasItemList anIL2 = this->allItems();
}
SUPERVGUI_CanvasCellNode* SUPERVGUI_CanvasArray::getCellNode(SUPERV::CNode_ptr theNode) const
SUPERVGUI_CanvasNodePrs(theCanvas, theNode, true)
{
myPortVisible = false;
- QCanvasItemList anIL2 = canvas()->allItems();
}
SUPERVGUI_CanvasCellNodePrs::~SUPERVGUI_CanvasCellNodePrs()
}
void SUPERVGUI_CanvasCellNodePrs::drawShape(QPainter& thePainter) {
-//MESSAGE("SUPERVGUI_CanvasCellNodePrs::drawShape begin");
drawTitle(thePainter);
drawLabel(thePainter);
drawStatus(thePainter);
drawFrame(thePainter);
-//MESSAGE("SUPERVGUI_CanvasCellNodePrs::drawShape end");
}
void drawCellText(QPainter& thePainter, const QString& theText,
}
void SUPERVGUI_CanvasCellNodePrs::drawTitle(QPainter& thePainter) {
-//MESSAGE("SUPERVGUI_CanvasCellNodePrs::drawTitle begin");
QBrush saved = thePainter.brush();
if (getNode()->getEngine()->IsLoop() || getNode()->getEngine()->IsEndLoop()
||
thePainter.setBrush(saved);
drawCellText(thePainter, getNode()->getEngine()->Name(), getTitleRect(), Qt::AlignLeft);
-//MESSAGE("SUPERVGUI_CanvasCellNodePrs::drawTitle end");
}
void SUPERVGUI_CanvasCellNodePrs::drawLabel(QPainter& thePainter)
{
-//MESSAGE("SUPERVGUI_CanvasCellNodePrs::drawLabel begin");
QRect r = getLabelRect();
QPen saved = thePainter.pen();
thePainter.setPen(saved);
drawCellText(thePainter, getNode()->getLabelText(), r, Qt::AlignLeft);
-//MESSAGE("SUPERVGUI_CanvasCellNodePrs::drawLabel end");
}
void SUPERVGUI_CanvasCellNodePrs::drawStatus(QPainter& thePainter)
{
-//MESSAGE("SUPERVGUI_CanvasCellNodePrs::drawStatus begin");
QRect r = getStatusRect();
QBrush savedB = thePainter.brush();
thePainter.setBrush(savedB);
drawCellText(thePainter, getStatus(), r, Qt::AlignHCenter);
-//MESSAGE("SUPERVGUI_CanvasCellNodePrs::drawStatus end");
}
QRect SUPERVGUI_CanvasCellNodePrs::getTitleRect() const
{
-//MESSAGE("SUPERVGUI_CanvasCellNodePrs::getTitleRect()!!!");
-// cout<<" xT = "<<(int)x()
-// <<" yT = "<<(int)y()
-// <<" wT = "<<getTitleWidth()
-// <<" hT = "<<getTitleHeight()<<endl;
return QRect((int)x(), (int)y(), getTitleWidth(), getTitleHeight());
}
QRect SUPERVGUI_CanvasCellNodePrs::getLabelRect() const
{
-// MESSAGE("SUPERVGUI_CanvasCellNodePrs::getLabelRect()!!!");
-// cout<<" xL = "<<((int)x())+getTitleWidth()
-// <<" yL = "<<(int)y()
-// <<" wL = "<<getLabelWidth()
-// <<" hL = "<<getLabelHeight()<<endl;
return QRect(((int)x())+getTitleWidth(), (int)y(), getLabelWidth(), getLabelHeight());
}
QRect SUPERVGUI_CanvasCellNodePrs::getStatusRect() const
{
-// MESSAGE("SUPERVGUI_CanvasCellNodePrs::getStatusRect()!!!");
-// cout<<" xS = "<<((int)x())+getTitleWidth()+getLabelWidth()
-// <<" yS = "<<(int)y()
-// <<" wS = "<<getStatusWidth()
-// <<" hS = "<<getStatusHeight()<<endl;
return QRect(((int)x())+getTitleWidth()+getLabelWidth(), (int)y(),
getStatusWidth(), getStatusHeight());
}
int SUPERVGUI_CanvasCellNodePrs::width() const
{
-//MESSAGE("SUPERVGUI_CanvasCellNodePrs::width() begin");
return myTitleWidth + myLabelWidth + myStatusWidth;
}
int SUPERVGUI_CanvasCellNodePrs::height() const
{
-//MESSAGE("SUPERVGUI_CanvasCellNodePrs::height() begin");
return getTitleHeight();
}
if ( QString(getEngine()->Name()) == QString(aCB->getCopyNode()->Name()) )
aCB->setCopyNode( 0 );
+ // mkr: since the deletion of the node allow only in CANVAS view,
+ // it is necessary to remove the CanvasArray's children, which
+ // have the same CNode engine as deleting node
+ getMain()->removeArrayChild(getEngine());
+ getMain()->removeArrayChild(myCoupled->getEngine());
+
getEngine()->destroy();
if (myCoupled)
myLabelText = aNewComment;
- // create node ports
- isIgnore = true;
- SUPERV_Ports aPortList = myNode->Ports();
- for (int i = 0; i < aPortList->length(); i++) {
- createPort(aPortList[i].in());
- }
-
- SUPERV_StreamPorts aStreamPortList = myNode->StreamPorts();
- for (int i = 0; i < aStreamPortList->length(); i++) {
- createStreamPort(aStreamPortList[i].in());
+ // mkr : if the SUPERVGUI_CavasCellNode created (for CANVASTABLE view),
+ // we haven't create its ports
+ if (!theIsCell) {
+ // create node ports
+ isIgnore = true;
+ SUPERV_Ports aPortList = myNode->Ports();
+ for (int i = 0; i < aPortList->length(); i++)
+ createPort(aPortList[i].in());
+
+ SUPERV_StreamPorts aStreamPortList = myNode->StreamPorts();
+ for (int i = 0; i < aStreamPortList->length(); i++) {
+ createStreamPort(aStreamPortList[i].in());
+ }
}
isIgnore = false;
-
- QCanvasItemList anIL2 = ((QCanvas*)parent())->allItems();
}
SUPERVGUI_CanvasNode::~SUPERVGUI_CanvasNode()
{
isIgnore = true;
if ( myPrs ) {
+ myPrs->hide();
delete myPrs;
myPrs = 0;
}
}
void SUPERVGUI_CanvasNode::remove() {
+ Trace("SUPERVGUI_CanvasNode::remove");
myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
//set myCopyPort from Main object to empty if engine of this port is deleted
if ( aCB->isCopyNode() )
if ( QString(myNode->Name()) == QString(aCB->getCopyNode()->Name()) )
aCB->setCopyNode( 0 );
-
- Trace("SUPERVGUI_CanvasNode::remove");
+
+ // mkr: since the deletion of the node allow only in CANVAS view,
+ // it is necessary to remove the CanvasArray's children, which
+ // have the same CNode engine as deleting node
+ myMain->removeArrayChild(myNode);
+
SUPERVGUI_Canvas* aCanvas = myMain->getCanvas();
setDestroyed();
myNode->destroy();
setState(myNode->getEngine()->State());
updatePorts();
}
-
- QCanvasItemList anIL2 = canvas()->allItems();
}
SUPERVGUI_CanvasNodePrs::~SUPERVGUI_CanvasNodePrs()
{
- MESSAGE("SUPERVGUI_CanvasNodePrs::~SUPERVGUI_CanvasNodePrs");
if ( !myCellPrs ) {
if ( myPointIn ) {
delete myPointIn;
myPointOut = 0;
}
}
- hide();
}
int SUPERVGUI_CanvasNodePrs::rtti() const
if (myCurrentView == CANVAS || myCurrentView == CONTROLFLOW) {
myCanvas->merge();
}
+
sync();
show();
if ( myLogged && !myLogFileName.isEmpty() && QFile::exists( myLogFileName ) ) {
sync();
}
+void SUPERVGUI_Main::removeArrayChild(SUPERV::CNode_ptr theNode)
+{
+ // mkr: since the deletion of the node allow only in CANVAS view,
+ // it is necessary to remove the CanvasArray's children, which
+ // have the same CNode engine as deleting node. This CNode is given
+ // 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;
+ }
+ }
+ }
+}
+
/******************************* SUPERVGUI_Thread class ****************************************/
SUPERVGUI_Thread::SUPERVGUI_Thread()
:QThread()
void Editing(); // any Editing operation is to be performed ->
// activate Editors data model in Engine
+ void removeArrayChild(SUPERV::CNode_ptr theNode);
+
signals:
void KillMyThread(bool theValue);