// Module : SUPERV
using namespace std;
+#include "SUPERVGUI.h"
#include "SUPERVGUI_CanvasArray.h"
#include "SUPERVGUI_Main.h"
#include "SUPERVGUI_BrowseNodeDlg.h"
#include <qtooltip.h>
#define TEXT_MARGIN 5
+#include <iostream.h> //for debug only
+
#define ADDNODES(NodesName,LevelHasDiffNT) \
ncols = nodes->NodesName.length(); \
for (int co=0; co<ncols; co++) { \
else x += (CELL_WIDTH + CELL_SPACE); \
cell = getCellNode(aCNode); \
if (cell == NULL) { \
- SUPERVGUI_CanvasCellNode* aNode = new SUPERVGUI_CanvasCellNode(this, myMain, aCNode); \
+ SUPERVGUI_CanvasCellNode* aNode = new SUPERVGUI_CanvasCellNode(myMgr, this, myMain, aCNode); \
aNode->move(x, y); \
aNode->show(); \
aNode->sync(); \
SUPERV_CNode aCNodeEnd = SUPERV::CNode::_narrow(nodes->NodesName[co]->Coupled()); \
cell = getCellNode(aCNode); \
if (cell == NULL) { \
- SUPERVGUI_CanvasCellNode* aNode = new SUPERVGUI_CanvasCellNode(this, myMain, aCNode); \
+ SUPERVGUI_CanvasCellNode* aNode = new SUPERVGUI_CanvasCellNode( myMgr, this, myMain, aCNode); \
aNode->move(x, y); \
aNode->show(); \
aNode->sync(); \
y += (CELL_HEIGHT + CELL_SPACE); \
- SUPERVGUI_CanvasCellNode* aNodeEnd = new SUPERVGUI_CanvasCellEndNode(this, myMain, aCNodeEnd, aNode); \
+ SUPERVGUI_CanvasCellNode* aNodeEnd = new SUPERVGUI_CanvasCellEndNode( myMgr, this, myMain, aCNodeEnd, aNode); \
aNodeEnd->move(x, y); \
aNodeEnd->show(); \
aNodeEnd->sync(); \
// SUPERVGUI_Array on QCanvas
// ----------------------------------------------------------
-SUPERVGUI_CanvasArray::SUPERVGUI_CanvasArray(SUPERVGUI_Main* m):
+SUPERVGUI_CanvasArray::SUPERVGUI_CanvasArray(SUPERVGUI_Main* m, SUIT_ResourceMgr* mgr ):
QCanvas(),
- myMain(m)
+ myMain(m),
+ myMgr( mgr )
{
Trace("SUPERVGUI_CanvasArray::SUPERVGUI_CanvasArray");
//resize(GRAPH_WIDTH, GRAPH_HEIGHT);
- resize(800, 600);
+ resize(1000, 725);
setDoubleBuffering(true);
- QColor aColor(MAIN_COLOR);
+ // mkr : IPAL10825 -->
+ SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+ if ( !aSupMod ) {
+ MESSAGE("NULL Supervision module!");
+ return;
+ }
+ QColor aColor = aSupMod->getIVFBackgroundColor();
+ if ( !aColor.isValid() )
+ aColor = mgr->colorValue( "SUPERVGraph", "Background", DEF_MAIN_COLOR );
+ // <--
+
//aColor = QColor(SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorRed" ),
// SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorGreen" ),
// SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorBlue" ) );
SUPERVGUI_CanvasCellNode* cell;
QString aLabel;
int x, y;
+
int nligs = myMain->getDataflow()->LevelMax();
+ cout<<"-> myMain->getDataflow()->LevelMax() = "<<myMain->getDataflow()->LevelMax()<<endl;
int ncols = myMain->getDataflow()->ThreadsMax();
+ cout<<"-> myMain->getDataflow()->ThreadsMax() = "<<myMain->getDataflow()->ThreadsMax()<<endl;
// there is no any calculations
if (ncols == 0) return false;
QPen pen(Qt::SolidLine);
pen.setWidth(1);
- QBrush br(MAIN_TITLE);
+
+ QBrush br( myMgr->colorValue( "SUPERVGraph", "Title", DEF_MAIN_TITLE ) );
+
+ // variables to resize canvas in table view
+ int aMaxWidth = 0;
+ int aMaxHeight = 0;
for (int co = 0; co < ncols; co++) {
aLabel = QString("Thread %1").arg(co);
aText->setY(aRect.y() + aRect.height()/2 - aBRect.height()/2);
aText->setZ(1);
aText->show();
+
+ aMaxWidth = aRect.x() + aRect.width() + 50;
}
y = 60;
nodeX = 50;
nodeY = y + CELL_HEIGHT*2;
+ aMaxHeight = nodeY;
+
+ // if aMaxWidth and aMaxHeight is greater than the current size
+ // of the canvas, we resize canvas to these new width and height
+ if ( aMaxWidth > this->width() || aMaxHeight > this->height() )
+ this->resize( aMaxWidth > this->width() ? aMaxWidth : this->width(),
+ aMaxHeight > this->height() ? aMaxHeight : this->height() );
return true;
}
SUPERVGUI_CanvasCellNode* SUPERVGUI_CanvasArray::addNode(SUPERV_CNode node) {
Trace("SUPERVGUI_CanvasArray::addNode");
- SUPERVGUI_CanvasCellNode* n = new SUPERVGUI_CanvasCellNode(this, myMain, node);
+ SUPERVGUI_CanvasCellNode* n = new SUPERVGUI_CanvasCellNode( myMgr, this, myMain, node);
n->move(nodeX, nodeY);
n->show();
update();