+
+
+// ----------------------------
+// Stream Ports
+// ----------------------------
+
+SUPERVGUI_StreamInDlg::SUPERVGUI_StreamInDlg(SUPERVGUI_CanvasStreamPortIn* thePort)
+ :QDialog( QAD_Application::getDesktop(), "", 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->getStreamEngine()->SetParams((SUPERV::KindOfSchema) mySchemaCombo->currentItem(),
+ (SUPERV::KindOfInterpolation) myInterCombo->currentItem(),
+ (SUPERV::KindOfExtrapolation) myExterCombo->currentItem());
+ QDialog::accept();
+}
+
+
+//-------------------------------------------------------------------------
+SUPERVGUI_StreamOutDlg::SUPERVGUI_StreamOutDlg(SUPERVGUI_CanvasStreamPortOut* thePort)
+ :QDialog( QAD_Application::getDesktop(), "", 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();
+}
+