+// SUPERV SUPERVGUI : GUI for Supervisor component
+//
+// Copyright (C) 2003 CEA/DEN, EDF R&D
+//
+//
+//
+// File : SUPERVGUI_BrowseNodeDlg.cxx
+// Author : Vitaly SMETANNIKOV
+// Module : SUPERV
+
using namespace std;
-// File : SUPERVGUI_BrowseNodeDlg.cxx
-// Created : 10 / 01 / 2003
-// Author : Vitaly SMETANNIKOV
-// Project : SALOME
-// Module : SUPERVGUI
-// Copyright : Open CASCADE
+#include "SALOMEDSClient.hxx"
+#include "SALOMEDS_SObject.hxx"
+#include "SALOMEDS_Study.hxx"
+#include <boost/shared_ptr.hpp>
+using namespace boost;
+
+#include "SalomeApp_Application.h"
+#include "LightApp_SelectionMgr.h"
+#include "SalomeApp_Study.h"
+#include "SUIT_Session.h"
+
+#include "SALOME_ListIO.hxx"
#include "SUPERVGUI_BrowseNodeDlg.h"
-#include "SUPERVGUI_Node.h"
+#include "SUPERVGUI_CanvasNode.h"
+#include "SUPERVGUI_CanvasPort.h"
#include "SUPERVGUI.h"
+
#include <qlayout.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qhbox.h>
#include <qgroupbox.h>
+#include <qvalidator.h>
/**
* Constructor
if ( !myIsEditable ) return false;
QString aTxt = myValue->text();
- if ( aTxt.isNull() || aTxt.isEmpty() ) return false;
+ //mkr : fix for bug IPAL9441
+ //if ( aTxt.isNull() || aTxt.isEmpty() ) return false;
if ( aTxt.find( "Unknown" ) < 0 ) {
- return myPort->Input( ( *Supervision.getEngine() )->StringValue( aTxt ) );
+ SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+ if ( !aSupMod ) {
+ MESSAGE("NULL Supervision module!");
+ return false;
+ }
+ return myPort->Input( aSupMod->getEngine()->StringValue( aTxt ) );
}
return false;
}
/**
- * Constructor
+ * Constructor (SUPERVGUI_CanvasNode)
*/
-SUPERVGUI_BrowseNodeDlg::SUPERVGUI_BrowseNodeDlg( SUPERVGUI_Node* theNode )
- : QDialog( theNode, 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
+SUPERVGUI_BrowseNodeDlg::SUPERVGUI_BrowseNodeDlg( SUPERVGUI_CanvasNode* theNode )
+ : QDialog( SUIT_Session::session()->activeApplication()->desktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
+{
+ myNodeCanvas = theNode;
+
+ init();
+}
+
+void SUPERVGUI_BrowseNodeDlg::init()
{
myActiveField = 0;
setSizeGripEnabled( true );
- myNode = theNode;
myPortsList.setAutoDelete( true );
- SUPERV_CNode aEngine = myNode->getEngine();
- mySelection = SALOME_Selection::Selection( Supervision.getActiveStudy()->getSelection() );
-// mySelection->ClearIObjects();
-
+ SUPERV_CNode aEngine = myNodeCanvas->getEngine();
+
setName( "SUPERVGUI_BrowseNodeDlg" );
setCaption( tr( "TIT_BROWSENODE" ) + aEngine->Name() );
if ( ports[i]->IsInput() ) {
if ( !ports[i]->IsGate() ) { // not a gate
SUPERVGUI_PortField* aField = new SUPERVGUI_PortField( aInBox, ports[i] );
- if ( aField->isEditable() ) myIsEditable = true;
+ if ( aField->isEditable() )
+ myIsEditable = true;
myPortsList.append( aField );
if ( !myActiveField )
myActiveField = aField;
if ( !myIsEditable )
aBtnLayout->addStretch();
- connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
- myNode->getMain()->lockedGraph(true);
+ SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+ if ( aSupMod ) connect( (( SalomeApp_Application* )(aSupMod->getActiveStudy()->application()))->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
+ else MESSAGE("NULL Supervision module!");
+
+ myNodeCanvas->getMain()->lockedGraph(true);
}
/**
* Set inputed values of editable ports and then closes and destroys dialog
*/
void SUPERVGUI_BrowseNodeDlg::accept() {
+ myNodeCanvas->getMain()->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
if ( myIsEditable ) {
SUPERVGUI_PortField* aField;
for ( aField = myPortsList.first(); aField; aField = myPortsList.next() ) {
aField->setNewValue();
}
- myNode->sync();
+ myNodeCanvas->sync();
+ myNodeCanvas->getMain()->getCanvas()->update();
}
- myNode->getMain()->lockedGraph(false);
+ myNodeCanvas->getMain()->lockedGraph(false);
QDialog::accept();
close();
}
* Closes and destroys dialog
*/
void SUPERVGUI_BrowseNodeDlg::reject() {
- myNode->getMain()->lockedGraph(false);
+ myNodeCanvas->getMain()->lockedGraph(false);
QDialog::reject();
close();
}
void SUPERVGUI_BrowseNodeDlg::onSelectionChanged()
{
if ( myActiveField ) {
- if( mySelection->IObjectCount() == 1 ) {
- Handle( SALOME_InteractiveObject ) anIO = mySelection->firstIObject();
+
+ SALOME_ListIO aList;
+ aList.Clear();
+
+ SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+ if ( !aSupMod ) {
+ MESSAGE("NULL Supervision module!");
+ return;
+ }
+
+ (( SalomeApp_Application* )(aSupMod->getActiveStudy()->application()))
+ ->selectionMgr()->selectedObjects( aList );
+
+ if( aList.Extent() == 1 ) {
+ Handle( SALOME_InteractiveObject ) anIO = aList.First();
if ( anIO->hasEntry() ) {
- SALOMEDS::SObject_var aObj = Supervision.getActiveStudy()->
- getStudyDocument()->FindObjectID( anIO->getEntry() );
+ _PTR(SObject) aObj ( dynamic_cast<SalomeApp_Study*>( aSupMod->getActiveStudy() )->
+ studyDS()->FindObjectID( anIO->getEntry() ) );
- SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::AttributeIOR_var anIOR;
- Standard_CString ior = "";
+ _PTR(GenericAttribute) anAttr;
+ QString ior("");
if (aObj->FindAttribute( anAttr, "AttributeIOR" ) ) {
- anIOR = SALOMEDS::AttributeIOR::_narrow( anAttr );
- ior = anIOR->Value();
- myActiveField->setData( ior );
+ _PTR(AttributeIOR) anIOR ( anAttr );
+ ior = anIOR->Value().c_str();
}
+ else {
+ SALOMEDS_Study* aSStudy = dynamic_cast<SALOMEDS_Study*>( aObj->GetStudy().get() );
+ SALOMEDS_SObject* aSSObj = dynamic_cast<SALOMEDS_SObject*>( aObj.get() );
+ if ( aSStudy && aSSObj )
+ ior = aSStudy->ConvertObjectToIOR( aSSObj->GetObject() ).c_str();
+ }
+ myActiveField->setData( ior );
}
}
}
}
+
/**
- * Constructor
+ * Constructor (SUPERVGUI_CanvasPort)
*/
-SUPERVGUI_GetValueDlg::SUPERVGUI_GetValueDlg( SUPERVGUI_PortIn* thePort )
- : QDialog( thePort, 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
+SUPERVGUI_GetValueDlg::SUPERVGUI_GetValueDlg( SUPERVGUI_CanvasPort* thePort )
+ : QDialog( SUIT_Session::session()->activeApplication()->desktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
{
- myOKBtn = 0;
- setSizeGripEnabled( true );
- myPort = thePort;
- myPortESNode = 0;
+ myPortCanvas = thePort;
- mySelection = SALOME_Selection::Selection( Supervision.getActiveStudy()->getSelection() );
-// mySelection->ClearIObjects();
-
- setName( "SUPERVGUI_GetValueDlg" );
- setCaption( tr( "TIT_SETVALUE_PORT" ) );
-
- QGridLayout* aBaseLayout = new QGridLayout( this );
- aBaseLayout->setMargin( 11 ); aBaseLayout->setSpacing( 6 );
-
- QGroupBox* aBox = new QGroupBox( this );
- aBox->setColumnLayout( 0, Qt::Vertical );
- aBox->layout()->setSpacing( 0 ); aBox->layout()->setMargin( 0 );
- QGridLayout* aBoxLayout = new QGridLayout( aBox->layout() );
- aBoxLayout->setAlignment( Qt::AlignTop );
- aBoxLayout->setSpacing( 6 ); aBoxLayout->setMargin( 11 );
- aBaseLayout->addWidget( aBox, 0, 0 );
- aBox->setMinimumWidth( 200 );
-
- QLabel* aInfoLab = new QLabel( tr( "ENTER_OR_SELECT_LBL" ), aBox );
- QFont fnt = aInfoLab->font(); fnt.setBold( true ); aInfoLab->setFont( fnt );
- aBoxLayout->addMultiCellWidget( aInfoLab, 0, 0, 0, 1 );
- myField = new SUPERVGUI_PortField( aBox, myPort->getPort() );
- bool myIsEditable = myField->isEditable();
- aBoxLayout->addWidget( myField->myLabel, 1, 0 );
- aBoxLayout->addWidget( myField->myValue, 1, 1 );
-
- QGroupBox* aBtnBox = new QGroupBox( this );
- aBtnBox->setColumnLayout( 0, Qt::Vertical );
- aBtnBox->layout()->setSpacing( 0 ); aBtnBox->layout()->setMargin( 0 );
- QHBoxLayout* aBtnLayout = new QHBoxLayout( aBtnBox->layout() );
- aBtnLayout->setAlignment( Qt::AlignTop );
- aBtnLayout->setSpacing( 6 ); aBtnLayout->setMargin( 11 );
-
- aBaseLayout->addWidget( aBtnBox, 1, 0 );
-
- if ( myIsEditable ) {
- myOKBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox );
- connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
- aBtnLayout->addWidget( myOKBtn );
- }
-
- aBtnLayout->addStretch();
- myCancelBtn = new QPushButton( myIsEditable ? tr( "BUT_CANCEL" ) : tr( "BUT_CLOSE" ), aBtnBox );
- aBtnLayout->addWidget( myCancelBtn );
- connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
-
- if ( !myIsEditable )
- aBtnLayout->addStretch();
-
- myField->updateGUI();
- connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
- myPort->getMain()->lockedGraph(true);
+ init();
}
-/**
- * Constructor
- */
-SUPERVGUI_GetValueDlg::SUPERVGUI_GetValueDlg( SUPERVGUI_PortInESNode* thePort )
- : QDialog( thePort, 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
+void SUPERVGUI_GetValueDlg::init()
{
myOKBtn = 0;
setSizeGripEnabled( true );
- myPort = 0;
- myPortESNode = thePort;
-
- mySelection = SALOME_Selection::Selection( Supervision.getActiveStudy()->getSelection() );
-// mySelection->ClearIObjects();
setName( "SUPERVGUI_GetValueDlg" );
setCaption( tr( "TIT_SETVALUE_PORT" ) );
QLabel* aInfoLab = new QLabel( tr( "ENTER_OR_SELECT_LBL" ), aBox );
QFont fnt = aInfoLab->font(); fnt.setBold( true ); aInfoLab->setFont( fnt );
aBoxLayout->addMultiCellWidget( aInfoLab, 0, 0, 0, 1 );
- myField = new SUPERVGUI_PortField( aBox, myPortESNode->getPort() );
+ SUPERV_Port aEngine = myPortCanvas->getEngine();
+
+ myField = new SUPERVGUI_PortField( aBox, aEngine );
bool myIsEditable = myField->isEditable();
aBoxLayout->addWidget( myField->myLabel, 1, 0 );
aBoxLayout->addWidget( myField->myValue, 1, 1 );
aBtnLayout->addStretch();
myField->updateGUI();
- connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
- myPortESNode->getMain()->lockedGraph(true);
+
+ SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+ if ( aSupMod ) connect( (( SalomeApp_Application* )(aSupMod->getActiveStudy()->application()))->selectionMgr(),
+ SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
+ else MESSAGE("NULL Supervision module!");
+
+ myPortCanvas->getMain()->lockedGraph(true);
}
/**
* Set entered value into port and then closes and destroys dialog
*/
void SUPERVGUI_GetValueDlg::accept() {
+ myPortCanvas->getMain()->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
if ( myField->setNewValue() ) {
- if (myPort != 0)
- myPort->sync();
- else
- myPortESNode->sync();
+ myPortCanvas->sync();
+
+ // asv : 19.11.04 : fix for 6170, last comment of it about BrowsePort - update node status
+ // asv : 13.12.04 : commented out sync() of Node. See 2.21.
+ //if ( myPortCanvas->parent() && myPortCanvas->parent()->inherits( "SUPERVGUI_CanvasNode" ) ) {
+ // SUPERVGUI_CanvasNode* aNode = (SUPERVGUI_CanvasNode*)myPortCanvas->parent();
+ // aNode->sync();
+ //}
+
+ myPortCanvas->getMain()->getCanvas()->update();
}
else {
- if ( QMessageBox::warning( QAD_Application::getDesktop(),
+ if ( QMessageBox::warning( SUIT_Session::session()->activeApplication()->desktop(),
tr( "ERROR" ), tr( "MSG_CANT_SETVAL" ),
QMessageBox::Retry, QMessageBox::Abort) == QMessageBox::Retry )
return;
}
- if (myPort != 0)
- myPort->getMain()->lockedGraph(false);
- else
- myPortESNode->getMain()->lockedGraph(false);
+ myPortCanvas->getMain()->lockedGraph(false);
+
QDialog::accept();
close();
}
* Closes and destroys dialog
*/
void SUPERVGUI_GetValueDlg::reject() {
- if (myPort != 0)
- myPort->getMain()->lockedGraph(false);
- else
- myPortESNode->getMain()->lockedGraph(false);
+ myPortCanvas->getMain()->lockedGraph(false);
QDialog::reject();
close();
}
*/
void SUPERVGUI_GetValueDlg::onSelectionChanged()
{
- if( mySelection->IObjectCount() == 1 ) {
- Handle( SALOME_InteractiveObject ) anIO = mySelection->firstIObject();
+ SALOME_ListIO aList;
+ aList.Clear();
+
+ SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+ if ( !aSupMod ) {
+ MESSAGE("NULL Supervision module!");
+ return;
+ }
+
+ (( SalomeApp_Application* )(aSupMod->getActiveStudy()->application()))
+ ->selectionMgr()->selectedObjects( aList );
+
+ if( aList.Extent() == 1 ) {
+ Handle( SALOME_InteractiveObject ) anIO = aList.First();
if ( anIO->hasEntry() ) {
- SALOMEDS::SObject_var aObj = Supervision.getActiveStudy()->
- getStudyDocument()->FindObjectID( anIO->getEntry() );
+ _PTR(SObject) aObj ( dynamic_cast<SalomeApp_Study*>( aSupMod->getActiveStudy() )->
+ studyDS()->FindObjectID( anIO->getEntry() ) );
- SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::AttributeIOR_var anIOR;
- Standard_CString ior = "";
+ _PTR(GenericAttribute) anAttr;
+ QString ior("");
if (aObj->FindAttribute( anAttr, "AttributeIOR" ) ) {
- anIOR = SALOMEDS::AttributeIOR::_narrow( anAttr );
- ior = anIOR->Value();
- myField->setData( ior );
+ _PTR(AttributeIOR) anIOR ( anAttr );
+ ior = anIOR->Value().c_str();
+ }
+ else {
+ SALOMEDS_Study* aSStudy = dynamic_cast<SALOMEDS_Study*>( aObj->GetStudy().get() );
+ SALOMEDS_SObject* aSSObj = dynamic_cast<SALOMEDS_SObject*>( aObj.get() );
+ if ( aSStudy && aSSObj )
+ ior = aSStudy->ConvertObjectToIOR( aSSObj->GetObject() ).c_str();
}
+ myField->setData( ior );
}
}
}
+
+
+// ----------------------------
+// Stream Ports
+// ----------------------------
+
+SUPERVGUI_StreamInDlg::SUPERVGUI_StreamInDlg(SUPERVGUI_CanvasStreamPortIn* thePort)
+ :QDialog( SUIT_Session::session()->activeApplication()->desktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+{
+ myPortCanvas = thePort;
+ init();
+}
+
+void SUPERVGUI_StreamInDlg::init()
+{
+ setSizeGripEnabled( true );
+ setCaption( tr( "MSG_STREAM_DLG_TIT" ) );
+
+ QVBoxLayout* TopLayout = new QVBoxLayout( this, 11, 6 );
+
+ QFrame* aCtrlPane = new QFrame(this);
+ QGridLayout* aCtrlLayout = new QGridLayout( aCtrlPane, 4, 10 );
+
+ // Schema
+ QLabel* aSchemaLbl = new QLabel(tr("MSG_STREAM_SCHEMA"),aCtrlPane);
+ aCtrlLayout->addWidget(aSchemaLbl, 0, 0);
+
+ mySchemaCombo = new QComboBox(aCtrlPane, "SchemaBox" );
+ mySchemaCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ mySchemaCombo->insertItem("SCHENULL");
+ mySchemaCombo->insertItem("TI");
+ mySchemaCombo->insertItem("TF");
+ mySchemaCombo->insertItem("DELTA");
+ aCtrlLayout->addWidget(mySchemaCombo, 0, 1);
+
+ // Interpolation
+ QLabel* aInterLbl = new QLabel(tr("MSG_STREAM_INTER"),aCtrlPane);
+ aCtrlLayout->addWidget(aInterLbl, 1, 0);
+
+ myInterCombo = new QComboBox(aCtrlPane, "InterBox" );
+ myInterCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ myInterCombo->insertItem("INTERNULL");
+ myInterCombo->insertItem("L0");
+ myInterCombo->insertItem("L1");
+ aCtrlLayout->addWidget(myInterCombo, 1, 1);
+
+ // Extrapolation
+ QLabel* aExtraLbl = new QLabel(tr("MSG_STREAM_EXTRA"),aCtrlPane);
+ aCtrlLayout->addWidget(aExtraLbl, 2, 0);
+
+ myExterCombo = new QComboBox(aCtrlPane, "ExtraBox" );
+ myExterCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ myExterCombo->insertItem("EXTRANULL");
+ myExterCombo->insertItem("E0");
+ myExterCombo->insertItem("E1");
+ aCtrlLayout->addWidget(myExterCombo, 2, 1);
+
+ TopLayout->addWidget( aCtrlPane );
+
+ // Buttons
+ QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
+ GroupButtons->setColumnLayout(0, Qt::Vertical );
+ GroupButtons->layout()->setSpacing( 0 );
+ GroupButtons->layout()->setMargin( 0 );
+ QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
+ GroupButtonsLayout->setAlignment( Qt::AlignTop );
+ GroupButtonsLayout->setSpacing( 5 );
+ GroupButtonsLayout->setMargin( 8 );
+
+ QPushButton* okB = new QPushButton( tr( "BUT_OK" ), GroupButtons );
+ QPushButton* cancelB = new QPushButton( tr( "BUT_CANCEL" ), GroupButtons );
+
+ GroupButtonsLayout->addWidget( okB, 0, 0 );
+ GroupButtonsLayout->addItem ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
+ GroupButtonsLayout->addWidget( cancelB, 0, 2 );
+
+ TopLayout->addWidget( GroupButtons );
+
+ connect( okB, SIGNAL( clicked() ), this, SLOT( accept() ) );
+ connect( cancelB, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ setData();
+}
+
+void SUPERVGUI_StreamInDlg::setData() {
+ SUPERV::KindOfSchema aSchema;
+ SUPERV::KindOfInterpolation aInterpolat;
+ SUPERV::KindOfExtrapolation aExtrapolat;
+
+ myPortCanvas->getStreamEngine()->Params(aSchema, aInterpolat, aExtrapolat);
+
+ mySchemaCombo->setCurrentItem((int)aSchema);
+ myInterCombo->setCurrentItem((int)aInterpolat);
+ myExterCombo->setCurrentItem((int)aExtrapolat);
+}
+
+void SUPERVGUI_StreamInDlg::accept() {
+ myPortCanvas->getMain()->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
+ myPortCanvas->getStreamEngine()->SetParams((SUPERV::KindOfSchema) mySchemaCombo->currentItem(),
+ (SUPERV::KindOfInterpolation) myInterCombo->currentItem(),
+ (SUPERV::KindOfExtrapolation) myExterCombo->currentItem());
+ QDialog::accept();
+}
+
+
+//-------------------------------------------------------------------------
+SUPERVGUI_StreamOutDlg::SUPERVGUI_StreamOutDlg(SUPERVGUI_CanvasStreamPortOut* thePort)
+ :QDialog( SUIT_Session::session()->activeApplication()->desktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+{
+ myPortCanvas = thePort;
+ init();
+}
+
+void SUPERVGUI_StreamOutDlg::init()
+{
+ setSizeGripEnabled( true );
+ setCaption( tr( "MSG_STREAM_DLG_TIT" ) );
+
+ QVBoxLayout* TopLayout = new QVBoxLayout( this, 11, 6 );
+
+ QFrame* aCtrlPane = new QFrame(this);
+ QGridLayout* aCtrlLayout = new QGridLayout( aCtrlPane, 4, 10 );
+
+ QLabel* aLbl = new QLabel(tr("MSG_STREAM_LEVEL"),aCtrlPane);
+ aCtrlLayout->addWidget(aLbl, 0, 0);
+
+ myValEdit = new QLineEdit( aCtrlPane, "ValEdit" );
+ myValEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ myValEdit->setValidator( new QIntValidator(this) );
+ SUPERV_StreamPort aEngine = myPortCanvas->getStreamEngine();
+ myValEdit->setText(QString("%1").arg(aEngine->NumberOfValues()));
+ aCtrlLayout->addWidget(myValEdit, 0, 1);
+ TopLayout->addWidget( aCtrlPane );
+
+ // Buttons
+ QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
+ GroupButtons->setColumnLayout(0, Qt::Vertical );
+ GroupButtons->layout()->setSpacing( 0 );
+ GroupButtons->layout()->setMargin( 0 );
+ QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
+ GroupButtonsLayout->setAlignment( Qt::AlignTop );
+ GroupButtonsLayout->setSpacing( 5 );
+ GroupButtonsLayout->setMargin( 8 );
+
+ QPushButton* okB = new QPushButton( tr( "BUT_OK" ), GroupButtons );
+ QPushButton* cancelB = new QPushButton( tr( "BUT_CANCEL" ), GroupButtons );
+
+ GroupButtonsLayout->addWidget( okB, 0, 0 );
+ GroupButtonsLayout->addItem ( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
+ GroupButtonsLayout->addWidget( cancelB, 0, 2 );
+
+ TopLayout->addWidget( GroupButtons );
+
+ connect( okB, SIGNAL( clicked() ), this, SLOT( accept() ) );
+ connect( cancelB, SIGNAL( clicked() ), this, SLOT( reject() ) );
+}
+
+void SUPERVGUI_StreamOutDlg::accept() {
+ int aRes = 0;
+ QString aStr = myValEdit->text();
+ if (!aStr.isEmpty())
+ aRes = aStr.toLong();
+ myPortCanvas->getStreamEngine()->SetNumberOfValues(aRes);
+ QDialog::accept();
+}
+