#include <QListWidget>
#include <QPushButton>
#include <QDoubleSpinBox>
+#include <QTextEdit>
HYDROGUI_StreamDlg::HYDROGUI_StreamDlg( HYDROGUI_Module* theModule, const QString& theTitle )
: HYDROGUI_InputPanel( theModule, theTitle )
myAxes = new QComboBox( aParamGroup );
myAxes->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myDDZ = new QDoubleSpinBox( aParamGroup );
- myDDZ->setRange( 1E-2, 100 );
- myDDZ->setSingleStep( 1E-2 );
+ myDDZ->setRange( 0.01, 100 );
+ myDDZ->setSingleStep( 0.1 );
myDDZ->setValue( 0.1 );
myDDZ->setDecimals( 2 );
mySpatialStep = new QDoubleSpinBox( aParamGroup );
- mySpatialStep->setRange( 1E-2, 100 );
- mySpatialStep->setSingleStep( 1.0 );
+ mySpatialStep->setRange( 0.1, 100 );
+ mySpatialStep->setSingleStep( 0.1 );
mySpatialStep->setValue( 1 );
mySpatialStep->setDecimals( 2 );
aParamLayout->addLayout( aParam1Layout );
aParamLayout->addWidget( myProfiles );
aParamLayout->addLayout( aButtonsLayout );
-
-
-
+
aParamGroup->setLayout( aParamLayout );
+ // Warnings
+ QGroupBox* aWarnGroup = new QGroupBox( tr( "STREAM_WARNINGS" ), mainFrame() );
+ myWarnText = new QTextEdit();
+ myWarnText->setReadOnly(true);
+ QBoxLayout* aWarnLayout = new QVBoxLayout();
+ aWarnLayout->addWidget( myWarnText );
+ aWarnGroup->setLayout( aWarnLayout );
+
// Common
addWidget( myObjectNameGroup );
addWidget( aParamGroup );
+ addWidget( aWarnGroup );
addStretch();
// Create selector
}
// Connect signals and slots
- connect( myAxes, SIGNAL( currentIndexChanged( const QString & ) ),
- this, SIGNAL( AxisChanged( const QString& ) ) );
+ connect( myAxes, SIGNAL( currentIndexChanged( const QString & ) ), this, SIGNAL( AxisChanged( const QString& ) ) );
connect( myAddButton, SIGNAL( clicked() ), this, SIGNAL( AddProfiles() ) );
connect( myRemoveButton, SIGNAL( clicked() ), this, SLOT( onRemoveProfiles() ) );
+ connect( myDDZ, SIGNAL( valueChanged (double) ), this, SLOT (onDDZValueChanged(double)));
+ connect( mySpatialStep, SIGNAL( valueChanged (double) ), this, SLOT (onSSValueChanged(double)));
}
HYDROGUI_StreamDlg::~HYDROGUI_StreamDlg()
myAxes->clear();
myProfiles->setObjects( HYDROGUI_ListModel::Object2VisibleList() );
- myAddButton->setEnabled( false );
- myRemoveButton->setEnabled( false );
+ myAddButton->setEnabled( true );
+ myRemoveButton->setEnabled( true );
blockSignals( isBlocked );
}
if ( aNewId != myAxes->currentIndex() ) {
myAxes->setCurrentIndex( aNewId );
}
- myAddButton->setEnabled( myAxes->currentIndex() > -1 );
+ //myAddButton->setEnabled( myAxes->currentIndex() > -1 );
blockSignals( isBlocked );
}
myProfiles->setObjects( aProfiles );
+
myRemoveButton->setEnabled( myProfiles->getObjects().count() > 0 );
myProfiles->setUpdatesEnabled( true );
emit RemoveProfiles( aSelectedProfiles );
}
+void HYDROGUI_StreamDlg::onDDZValueChanged(double d)
+{
+ emit DDZValueChanged( d );
+}
+
+void HYDROGUI_StreamDlg::onSSValueChanged(double d)
+{
+ emit SSValueChanged( d );
+}
+
+
void HYDROGUI_StreamDlg::setDDZ( const double theDDZ )
{
myDDZ->setValue( theDDZ );
return mySpatialStep->value();
}
+void HYDROGUI_StreamDlg::setBackgroundColorForProfileList (int theInd, QColor theColor)
+{
+ myProfiles->setBackgroundColor(theInd, theColor);
+}
+
+void HYDROGUI_StreamDlg::setBackgroundColorForProfileList (QString name, QColor theColor)
+{
+ myProfiles->setBackgroundColor(name, theColor);
+}
+
+QColor HYDROGUI_StreamDlg::getBackgroundColorForProfileList (int theInd) const
+{
+ return myProfiles->getBackgroundColor(theInd);
+}
+
+void HYDROGUI_StreamDlg::clearAllBackgroundColorsForProfileList ()
+{
+ myProfiles->clearAllBackgroundColors();
+}
+
+void HYDROGUI_StreamDlg::addWarning( const QString& theWarnMess )
+{
+ myWarnText->append( theWarnMess );
+}
+
+void HYDROGUI_StreamDlg::clearWarnings()
+{
+ myWarnText->clear();
+}
+