1 // SUPERV SUPERVGUI : GUI for Supervisor component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SUPERVGUI_Graph.cxx
25 // Author : Francis KLOSS
29 #include "SUPERVGUI_Def.h"
30 #include "SUPERVGUI_Graph.h"
31 #include "SUPERVGUI_Main.h"
32 #include "SUPERVGUI_ComputeNode.h"
33 #include "SUPERVGUI_ControlNode.h"
34 #include "SUPERVGUI.h"
36 #include <qapplication.h>
38 #include <qgroupbox.h>
40 #include <qvalidator.h>
45 #include <sys/timeb.h>
49 #define UPDATECONTROLNODES(NodesName) \
50 n = nodes->NodesName.length(); \
51 for (int i=0; i<n; i++) { \
52 SUPERV_CNode aCNode = SUPERV::CNode::_narrow(nodes->NodesName[i]); \
53 SUPERV_CNode aCNodeEnd = SUPERV::CNode::_narrow(nodes->NodesName[i]->Coupled()); \
54 ihmNode = (SUPERVGUI_Node *)child(aCNode->Name(), "SUPERVGUI_Node"); \
55 if (ihmNode == NULL) { \
56 main->addControlNode(aCNode, aCNodeEnd, false); \
58 ResizeGraph(ihmNode, aCNode->X(), aCNode->Y()); \
59 moveChild(ihmNode, aCNode->X(), aCNode->Y()); \
60 ihmList->removeRef(ihmNode); \
62 aEndNodePrs = (SUPERVGUI_EndControlNode*)child(aCNodeEnd->Name(), "SUPERVGUI_EndControlNode"); \
63 ResizeGraph(aEndNodePrs, aCNodeEnd->X(), aCNodeEnd->Y()); \
64 moveChild(aEndNodePrs, aCNodeEnd->X(), aCNodeEnd->Y()); \
65 ihmList->removeRef(aEndNodePrs); \
66 aEndNodePrs->sync(); \
71 #define UPDATENODES(NodesName, FuncName) \
72 n = nodes->NodesName.length(); \
73 for (int i=0; i<n; i++) { \
74 SUPERV_CNode aCNode = SUPERV::CNode::_narrow(nodes->NodesName[i]); \
75 ihmNode = (SUPERVGUI_Node *)child(aCNode->Name(), "SUPERVGUI_Node"); \
76 if (ihmNode == NULL) { \
77 main->FuncName(aCNode); \
79 ResizeGraph(ihmNode, aCNode->X(), aCNode->Y()); \
80 moveChild(ihmNode, aCNode->X(), aCNode->Y()); \
81 ihmList->removeRef(ihmNode); \
87 SUPERVGUI_Graph::SUPERVGUI_Graph(SUPERVGUI_Main* m):
91 Trace("SUPERVGUI_Graph::SUPERVGUI_Graph");
92 myIsControlView = false;
93 myLinksList.setAutoDelete(true);
94 viewport()->setMouseTracking(true);
96 resizeContents(GRAPH_WIDTH, GRAPH_HEIGHT);
98 if (SUPERV_isNull(main->getDataflow())) return;
101 //create sketching popup menu
102 mySketchPopup = new QPopupMenu(viewport());
103 if (!mySketchPopup->isCheckable())
104 mySketchPopup->setCheckable(true);
105 myDelPntItem = mySketchPopup->insertItem(tr("MSG_DEL_LAST_PNT"), this, SLOT(delLastPnt()));
106 mySketchPopup->insertItem(tr("MSG_DEL_LINK"), this, SLOT(delCreatingLink()));
107 myOrtoItem = mySketchPopup->insertItem(tr("MSG_ORTHO_LINE"), this, SLOT(setOrtho()));
109 //create link popup menu
110 myLinkPopup = new QPopupMenu(viewport());
111 myDelLinkItem = myLinkPopup->insertItem(tr("MSG_DELLINK"), this, SLOT(deleteLink()));
112 myAddLinkPntItem = myLinkPopup->insertItem(tr("MSG_ADD_POINT"), this, SLOT(addPoint()));
113 myDelLinkPntItem = myLinkPopup->insertItem(tr("MSG_DEL_POINT"), this, SLOT(deletePoint()));
118 SUPERVGUI_Graph::~SUPERVGUI_Graph() {
122 * Synchronizes Graph presentation with internal graph structure
124 void SUPERVGUI_Graph::sync() {
125 if (SUPERV_isNull(main->getDataflow())) return;
129 SUPERVGUI_Node* ihmNode;
130 QObjectList* ihmList = queryList("SUPERVGUI_Node");
131 SUPERV_Nodes nodes = main->getDataflow()->Nodes();
133 MESSAGE("CNodes="<<nodes->CNodes.length());
134 MESSAGE("FNodes="<<nodes->FNodes.length());
135 MESSAGE("INodes="<<nodes->INodes.length());
136 MESSAGE("GNodes="<<nodes->GNodes.length());
137 MESSAGE("LNodes="<<nodes->LNodes.length());
138 MESSAGE("SNodes="<<nodes->SNodes.length());
141 UPDATENODES(CNodes, addComputeNode);
142 UPDATENODES(FNodes, addComputeNode);
143 UPDATENODES(INodes, addComputeNode);
144 UPDATENODES(GNodes, addGOTONode);
146 SUPERVGUI_EndControlNode* aEndNodePrs;
147 UPDATECONTROLNODES(LNodes);
148 UPDATECONTROLNODES(SNodes);
150 QObjectListIt i(*ihmList);
151 while ((ihmNode=(SUPERVGUI_Node*)i.current()) != 0) {
153 ihmNode->close(true);
157 ihmList = queryList("SUPERVGUI_GraphNode");
159 SUPERVGUI_GraphNode* aGraphNode;
160 while ((aGraphNode=(SUPERVGUI_GraphNode*)i.current()) != 0) {
162 aGraphNode->updateLinksPrs();
171 * Reimplemented for repainting links
173 bool SUPERVGUI_Graph::eventFilter(QObject* object, QEvent* event) {
174 if (event->type() == QEvent::Paint) {
178 return QScrollView::eventFilter(object, event);
183 * Clears content of Graph (links)
185 void SUPERVGUI_Graph::clearView() {
186 QPainter aPainter(viewport());
187 aPainter.eraseRect(viewport()->rect());
192 * Draws links using off screen buffer
194 void SUPERVGUI_Graph::draw() {
199 if (myLinksList.count() == 0) {
202 int aWidth = viewport()->width();
203 int aHeight = viewport()->height();
204 QPixmap aPixmap(aWidth, aHeight);
205 aPixmap.setOptimization(QPixmap::BestOptim);
206 aPixmap.fill(viewport()->paletteBackgroundColor());
208 QPainter aPainter(&aPixmap);
209 QPoint aPos = viewportToContents(viewport()->pos());
211 if (myIsControlView) {
212 SUPERVGUI_CtrlLink* aLink;
213 QMap<QString, SUPERVGUI_CtrlLink>::Iterator it;
214 for ( it = myCtrlLinks.begin(); it != myCtrlLinks.end(); ++it ) {
215 it.data().paint(&aPainter, false);
218 SUPERVGUI_Link* aLink;
219 for (aLink = myLinksList.first(); aLink; aLink = myLinksList.next()) {
220 aLink->isInRect(aPos.x(), aPos.y(), aWidth, aHeight);
221 if (aLink->isInRect(aPos.x(), aPos.y(), aWidth, aHeight)) {
222 aLink->paint(&aPainter, false);
226 bitBlt(viewport(), 0, 0,
227 &aPixmap, 0, 0, aWidth, aHeight,
231 myNewLink->repaintSketch();
236 ulong aTm = 1000*(aTm2.time-aTm1.time)+(aTm2.millitm-aTm1.millitm);
237 cout<<"### Time="<<aTm<<endl;
242 void SUPERVGUI_Graph::contentsMousePressEvent(QMouseEvent* e) {
243 Trace("SUPERVGUI_Graph::contentsMousePressEvent");
244 if ( e->button() == Qt::RightButton) {
246 main->showPopup(mySketchPopup, e);
248 SUPERVGUI_Link* aLink = SUPERVGUI_Link::getSelectedLink();
249 if (aLink && main->isEditable()) {
250 myLinkPopup->setItemEnabled(myAddLinkPntItem,
251 !aLink->haveSelectedPoint());
252 myLinkPopup->setItemEnabled(myDelLinkPntItem,
253 aLink->haveSelectedPoint());
256 if (!aLink->isESInputPort()) {
257 SUPERV::KindOfPort aOutType = aLink->getOutputPort()->getPort()->Kind();
258 SUPERV::KindOfPort aInType = aLink->getInputPort()->getPort()->Kind();
259 myLinkPopup->setItemEnabled(myDelLinkItem,
260 ((aOutType != SUPERV::LoopParameter)
262 (aInType != SUPERV::LoopParameter)));
265 myMousePos = e->pos();
266 mySelectedLink = aLink;
267 mySelectedPoint = mySelectedLink->getSelectedPoint();
268 main->showPopup(myLinkPopup, e);
272 main->showPopup(myPopup, e);
276 emit mousePressed(e);
278 SUPERVGUI_View::contentsMousePressEvent(e);
282 void SUPERVGUI_Graph::contentsMouseReleaseEvent(QMouseEvent* e) {
283 Trace("SUPERVGUI_Graph::contentsMouseReleaseEvent");
284 if (myNewLink && (e->button() == Qt::LeftButton)) {
285 myNewLink->addTmpPoint(e->pos());
286 mySketchPopup->setItemEnabled(myDelPntItem, true);
288 emit mouseReleased(e);
289 SUPERVGUI_View::contentsMouseReleaseEvent(e);
293 void SUPERVGUI_Graph::contentsMouseMoveEvent(QMouseEvent* e) {
294 Trace("SUPERVGUI_Graph::contentsMouseMoveEvent");
296 myNewLink->drawTo(e->pos());
299 SUPERVGUI_View::contentsMouseMoveEvent(e);
303 void SUPERVGUI_Graph::addPoint() {
304 mySelectedLink->addPoint(myMousePos.x(), myMousePos.y());
308 void SUPERVGUI_Graph::deletePoint() {
309 mySelectedLink->removePoint(mySelectedPoint);
313 void SUPERVGUI_Graph::deleteLink() {
315 if (mySelectedLink->isESInputPort())
316 aName = mySelectedLink->getInputPortES()->getPort()->Name();
318 aName = mySelectedLink->getInputPort()->getPort()->Name();
320 if (aName != "Default") {
321 deleteLink(mySelectedLink);
328 void SUPERVGUI_Graph::deleteLink(SUPERVGUI_Link* theLink) {
329 //update values of input ports of theLink if theLink is deleted
330 if ( theLink->getInputPort() ) {
332 SUPERVGUI_PortIn* aInPort = theLink->getInputPort();
333 if (aInPort->getPort()->IsParam() || aInPort->getPort()->IsInLine()) {
334 QString aPortValue = QString(aInPort->getPort()->ToString());
335 if (!aPortValue.isNull()) {
336 //gives a value to an input port
337 theLink->destroyEngine();
338 aInPort->getPort()->Input( Supervision.getEngine()->StringValue( aPortValue ) );
344 theLink->destroyEngine();
346 myLinksList.removeRef(theLink);
347 if (myLinksList.count() == 0) clearView();
351 void SUPERVGUI_Graph::setAsFromStudy(bool theToStudy) {
352 SUPERVGUI_View::setAsFromStudy(theToStudy);
353 if (theToStudy) return;
355 SUPERVGUI_PortOut* aPortOut;
356 QObjectList* aPortsList = queryList("SUPERVGUI_PortOut");
357 QObjectListIt aPortIt(*aPortsList);
358 while ((aPortOut=(SUPERVGUI_PortOut*)aPortIt.current()) != 0) {
360 if (aPortOut->isInStudy()) {
361 aPortOut->setStudyState(false);
370 * Begins Link sketching
372 void SUPERVGUI_Graph::sketchBegin(SUPERVGUI_Port* thePort) {
373 if (thePort == 0) return;
375 SUPERV_Port aPort = thePort->getPort();
376 myNewLink = new SUPERVGUI_Link(this);
377 mySketchPopup->setItemEnabled(myDelPntItem, false);
378 mySketchPopup->setItemChecked(myOrtoItem, myNewLink->isOrthoMode());
380 myNewLink->setBeginPort(thePort);
382 if (aPort->IsInput()) {
383 if (aPort->Kind() == SUPERV::EndSwitchParameter
385 aPort->Node()->Kind() == SUPERV::EndSwitchNode) {
386 myNewLink->setInputPortES(dynamic_cast<SUPERVGUI_PortInESNode*>(thePort));
389 myNewLink->setInputPort(dynamic_cast<SUPERVGUI_PortIn*>(thePort));
392 myNewLink->setOutputPort(dynamic_cast<SUPERVGUI_PortOut*>(thePort));
396 void SUPERVGUI_Graph::sketchEnd(SUPERVGUI_Port* thePort) {
397 if (!myNewLink) return;
399 bool aIsInput = myNewLink->getBeginPort()->getPort()->IsInput();
400 if (aIsInput && thePort->getPort()->IsInput()
402 !aIsInput && !thePort->getPort()->IsInput()) {
407 SUPERV_Port aPort = thePort->getPort();
408 if (aPort->IsInput()) {
410 int aKind = myNewLink->getOutputPort()->getPort()->Kind();
412 if ((aPort->Kind() == SUPERV::EndSwitchParameter
414 aPort->Node()->Kind() == SUPERV::EndSwitchNode)
416 (aKind == SUPERV::InLineParameter || aKind == SUPERV::ServiceParameter))
418 QString aName(aPort->Name());
419 if (aName != "Default")
420 myNewLink->setInputPortES(dynamic_cast<SUPERVGUI_PortInESNode*>(thePort));
422 else if (aPort->Kind() == SUPERV::DataStreamParameter){
423 myNewLink->setInputPort(dynamic_cast<SUPERVGUI_StreamPortIn*>(thePort));
425 if (aPort->IsLinked()) return;
427 if (aKind == SUPERV::GateParameter || aPort->Kind() == SUPERV::GateParameter) {
428 if (aKind != aPort->Kind() && aKind != SUPERV::InLineParameter
429 && aPort->Kind() != SUPERV::InLineParameter) {
432 else { //connection like Gate <--> Gate
433 myNewLink->setInputPort(dynamic_cast<SUPERVGUI_PortIn*>(thePort));
436 myNewLink->setInputPort(dynamic_cast<SUPERVGUI_PortIn*>(thePort));
441 if (myNewLink->isESInputPort()) {
442 if(aPort->Kind() == SUPERV::InLineParameter || aPort->Kind() == SUPERV::ServiceParameter)
444 myNewLink->setOutputPort(dynamic_cast<SUPERVGUI_PortOut*>(thePort));
449 int aKind = myNewLink->getInputPort()->getPort()->Kind();
451 if (aKind == SUPERV::GateParameter || aPort->Kind() == SUPERV::GateParameter) {
452 if (aKind != aPort->Kind() &&
453 aKind != SUPERV::InLineParameter &&
454 aPort->Kind() != SUPERV::InLineParameter) {
456 } else //connection like Gate <--> Gate
457 myNewLink->setOutputPort(dynamic_cast<SUPERVGUI_PortOut*>(thePort));
458 } else if (aPort->Kind() == SUPERV::DataStreamParameter){
459 myNewLink->setOutputPort(dynamic_cast<SUPERVGUI_StreamPortOut*>(thePort));
461 myNewLink->setOutputPort(dynamic_cast<SUPERVGUI_PortOut*>(thePort));
465 if (myNewLink->isCreationComplete()) { // if everything is defined
466 if (myNewLink->createEngine()) {
467 myLinksList.append(myNewLink);
470 QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_LINK"));
478 * Returns true if presentation of link exists
480 bool SUPERVGUI_Graph::isLinkPrsExists(SUPERV_Link theLink) {
481 SUPERVGUI_Link* aTmpLink;
482 for (aTmpLink = myLinksList.first(); aTmpLink; aTmpLink = myLinksList.next()) {
483 SUPERVGUI_PortOut* aOutPort = aTmpLink->getOutputPort();
484 if (strcmp(aOutPort->getPort()->Node()->Name(),
485 theLink->OutPort()->Node()->Name()) == 0) {
486 QString aName(theLink->OutPort()->Name());
488 if (aOutPort->name() == aName) {
498 * Creates link presentation from link engine
499 * Returns false if fails
501 bool SUPERVGUI_Graph::createLinkPrs(SUPERV_Link theLink) {
502 SUPERVGUI_Link* aNewLink = new SUPERVGUI_Link(this, theLink);
505 SUPERVGUI_Node* aOutNode = (SUPERVGUI_Node*)
506 child(theLink->OutPort()->Node()->Name(), "SUPERVGUI_Node");
508 QString aName(theLink->OutPort()->Name());
510 SUPERVGUI_PortOut* aOutPort = (SUPERVGUI_PortOut*)
511 aOutNode->child(aName, "SUPERVGUI_PortOut");
513 aNewLink->setOutputPort(aOutPort);
523 SUPERVGUI_Node* aInNode = (SUPERVGUI_Node*)
524 child(theLink->InPort()->Node()->Name(), "SUPERVGUI_Node");
526 QString aName(theLink->InPort()->Name());
528 if (theLink->InPort()->Kind() == SUPERV::EndSwitchParameter) {
529 //If input port is EndSwitchParameter
530 SUPERVGUI_PortInESNode* aInPortES =(SUPERVGUI_PortInESNode*)
531 aInNode->child(aName, "SUPERVGUI_PortInESNode"); //returns null
533 aNewLink->setInputPortES(aInPortES);
539 SUPERVGUI_PortIn* aInPort =(SUPERVGUI_PortIn*)
540 aInNode->child(aName, "SUPERVGUI_PortIn");
542 aNewLink->setInputPort(aInPort);
552 aNewLink->setVisible(!myIsControlView);
553 myLinksList.append(aNewLink);
558 void SUPERVGUI_Graph::delLastPnt() {
560 myNewLink->delLastTmpPoint();
564 void SUPERVGUI_Graph::delCreatingLink() {
565 myNewLink->abortCreation();
571 void SUPERVGUI_Graph::setOrtho() {
573 bool aIsOrtho = !mySketchPopup->isItemChecked(myOrtoItem);
574 myNewLink->setOrthoMode(aIsOrtho);
575 mySketchPopup->setItemChecked(myOrtoItem, aIsOrtho);
581 void SUPERVGUI_Graph::setFullView() {
582 QObjectList* aNodeList = queryList("SUPERVGUI_Node");
583 QObjectListIt aIt(*aNodeList);
584 SUPERVGUI_Node* aNode;
585 while ((aNode=(SUPERVGUI_Node*)aIt.current()) != 0) {
592 SUPERVGUI_Link* aLink;
593 for (aLink = myLinksList.first(); aLink; aLink = myLinksList.next()) {
594 aLink->setVisible(true);
597 myIsControlView = false;
601 void SUPERVGUI_Graph::setControlView() {
602 QObjectList* aNodeList = queryList("SUPERVGUI_Node");
603 QObjectListIt aIt(*aNodeList);
604 SUPERVGUI_Node* aNode;
605 while ((aNode=(SUPERVGUI_Node*)aIt.current()) != 0) {
611 SUPERVGUI_Link* aLink;
612 for (aLink = myLinksList.first(); aLink; aLink = myLinksList.next()) {
613 aLink->setVisible(false);
615 QString aOutName(aLink->getEngineLink()->OutPort()->Node()->Name());
616 QString aInName(aLink->getEngineLink()->InPort()->Node()->Name());
617 QString aKey = aOutName + aInName;
619 if (!myCtrlLinks.contains(aKey)) {
620 SUPERVGUI_GraphNode* aOutNode = (SUPERVGUI_GraphNode*)
621 child(aOutName, "SUPERVGUI_GraphNode");
622 if (!aOutNode) continue;
623 SUPERVGUI_GraphNode* aInNode = (SUPERVGUI_GraphNode*)
624 child(aInName, "SUPERVGUI_GraphNode");
625 if (!aInNode) continue;
627 myCtrlLinks[aKey] = SUPERVGUI_CtrlLink(this, aOutNode, aInNode);
631 myIsControlView = true;
635 void SUPERVGUI_Graph::deleteNode(SUPERVGUI_Node* theNode) {
636 theNode->close(true);
643 SUPERVGUI_DSGraphParameters::SUPERVGUI_DSGraphParameters(SUPERV_Graph theGraph, bool isReadOnly)
644 : QDialog( QAD_Application::getDesktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
646 Trace("SUPERVGUI_DSGraphParameters::SUPERVGUI_DSGraphParameters");
647 setCaption( tr( "TLT_DSGRAPHPARAMS" ) );
648 setSizeGripEnabled( true );
651 QGridLayout* TopLayout = new QGridLayout( this );
652 TopLayout->setSpacing( 6 );
653 TopLayout->setMargin( 11 );
655 QGroupBox* TopGroup = new QGroupBox( this, "TopGroup" );
656 TopGroup->setColumnLayout(0, Qt::Vertical );
657 TopGroup->layout()->setSpacing( 0 );
658 TopGroup->layout()->setMargin( 0 );
659 QGridLayout* TopGroupLayout = new QGridLayout( TopGroup->layout() );
660 TopGroupLayout->setAlignment( Qt::AlignTop );
661 TopGroupLayout->setSpacing( 6 );
662 TopGroupLayout->setMargin( 11 );
665 QLabel* DeltaTimeL = new QLabel( tr( "DELTATIME_LBL" ), TopGroup );
666 TopGroupLayout->addWidget( DeltaTimeL, 0, 0 );
668 myDeltaTime = new QAD_SpinBoxDbl( TopGroup, 0.0, 1.0, 0.1);
669 myDeltaTime->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
670 TopGroupLayout->addWidget( myDeltaTime, 0, 1 );
673 QLabel* TimeOutL = new QLabel( tr( "TIMEOUT_LBL" ), TopGroup);
674 TopGroupLayout->addWidget( TimeOutL, 1, 0 );
676 myTimeOut = new QLineEdit( TopGroup );
677 myTimeOut->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
678 myTimeOut->setValidator( new QIntValidator(this) );
679 myTimeOut->setMinimumSize( 100, 0 );
680 myTimeOut->setReadOnly( isReadOnly );
681 TopGroupLayout->addWidget( myTimeOut, 1, 1 );
684 QLabel* DataStreamTraceL = new QLabel( tr( "DATASTREAMTRACE_LBL" ), TopGroup);
685 TopGroupLayout->addWidget( DataStreamTraceL, 2, 0 );
687 myDataStreamTrace = new QComboBox( TopGroup );
688 myDataStreamTrace->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
689 myDataStreamTrace->insertItem("WithoutTrace");
690 myDataStreamTrace->insertItem("SummaryTrace");
691 myDataStreamTrace->insertItem("DetailedTrace");
692 TopGroupLayout->addWidget( myDataStreamTrace, 2, 1 );
694 QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
695 GroupButtons->setColumnLayout(0, Qt::Vertical );
696 GroupButtons->layout()->setSpacing( 0 );
697 GroupButtons->layout()->setMargin( 0 );
698 QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
699 GroupButtonsLayout->setAlignment( Qt::AlignTop );
700 GroupButtonsLayout->setSpacing( 6 );
701 GroupButtonsLayout->setMargin( 11 );
703 QPushButton* okB = new QPushButton( tr( "BUT_OK" ), GroupButtons );
704 QPushButton* cancelB = new QPushButton( tr( "BUT_CANCEL" ), GroupButtons );
706 GroupButtonsLayout->addWidget( okB, 0, 0 );
707 GroupButtonsLayout->addItem ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
708 GroupButtonsLayout->addWidget( cancelB, 0, 2 );
710 TopLayout->addWidget( TopGroup, 0, 0 );
711 TopLayout->addWidget( GroupButtons, 1, 0 );
713 connect( okB, SIGNAL( clicked() ), this, SLOT( accept() ) );
714 connect( cancelB, SIGNAL( clicked() ), this, SLOT( reject() ) );
722 SUPERVGUI_DSGraphParameters::~SUPERVGUI_DSGraphParameters() {
723 Trace("SUPERVGUI_DSGraphParameters::~SUPERVGUI_DSGraphParameters");
729 void SUPERVGUI_DSGraphParameters::setData() {
732 SUPERV::KindOfDataStreamTrace aDataStreamTrace;
734 myGraph->StreamParams(aTimeOut, aDataStreamTrace, aDeltaTime);
736 myDeltaTime->setValue(aDeltaTime);
737 myTimeOut->setText(QString("%1").arg(aTimeOut));
738 myDataStreamTrace->setCurrentItem((int)aDataStreamTrace);
744 void SUPERVGUI_DSGraphParameters::accept() {
745 myGraph->SetStreamParams( myTimeOut->text().toLong(),
746 (SUPERV::KindOfDataStreamTrace) myDataStreamTrace->currentItem(),
747 myDeltaTime->value());