From: isn Date: Mon, 4 Feb 2019 18:29:42 +0000 (+0300) Subject: lot 12 GUI p.1 X-Git-Tag: SH_V2_2_0~99^2~27^2~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d968be5099f438170abd3d0ce1efb450d3c56c04;p=modules%2Fhydro.git lot 12 GUI p.1 --- diff --git a/src/HYDROGUI/HYDROGUI_ChannelDlg.cxx b/src/HYDROGUI/HYDROGUI_ChannelDlg.cxx index d2c66807..c8fa95f3 100644 --- a/src/HYDROGUI/HYDROGUI_ChannelDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ChannelDlg.cxx @@ -27,6 +27,7 @@ #include #include #include +#include HYDROGUI_ChannelDlg::HYDROGUI_ChannelDlg( HYDROGUI_Module* theModule, const QString& theTitle ) : HYDROGUI_InputPanel( theModule, theTitle ) @@ -58,20 +59,58 @@ HYDROGUI_ChannelDlg::HYDROGUI_ChannelDlg( HYDROGUI_Module* theModule, const QStr myEquiDistance->setValue( 1.0 ); myEquiDistance->setSingleStep( 1.0 ); + //for digue + myLCVal = new QtxDoubleSpinBox( aParamGroup ); + myLCVal->setRange( 0.0, 999999 ); + myLCVal->setValue( 50 ); + myLCVal->setSingleStep( 0.1 ); + + myDeltaZVal = new QtxDoubleSpinBox( aParamGroup ); + myDeltaZVal->setRange( 0.0, 999999 ); + myDeltaZVal->setValue( 5.0 ); + myDeltaZVal->setSingleStep( 0.1 ); + + myCoteZVal = new QtxDoubleSpinBox( aParamGroup ); + myCoteZVal->setRange( 0.0, 999999 ); + myCoteZVal->setValue( 1.0 ); + myCoteZVal->setSingleStep( 0.1 ); + //END for digue + myInvertDirection = new QCheckBox(aParamGroup); myInvertDirection->setChecked(false); + myProfileLabel = new QLabel( tr( "CHANNEL_PROFILE" ), aParamGroup); + + myProfileModeButton = new QRadioButton( tr( "VIA_PROFILE" ), myObjectNameGroup ); + QRadioButton* ProfileModeButton2 = new QRadioButton( tr( "PREDEF" ), myObjectNameGroup ); + QGridLayout* aParamsLayout = new QGridLayout( aParamGroup ); aParamsLayout->setMargin( 5 ); aParamsLayout->setSpacing( 5 ); aParamsLayout->addWidget( new QLabel( tr( "CHANNEL_GUIDE_LINE" ), aParamGroup ), 0, 0 ); aParamsLayout->addWidget( myGuideLines, 0, 1 ); - aParamsLayout->addWidget( new QLabel( tr( "CHANNEL_PROFILE" ), aParamGroup ), 1, 0 ); - aParamsLayout->addWidget( myProfiles, 1, 1 ); - aParamsLayout->addWidget( new QLabel( tr( "EQUI_DISTANCE" ), aParamGroup ), 2, 0 ); - aParamsLayout->addWidget( myEquiDistance, 2, 1 ); - aParamsLayout->addWidget( new QLabel( tr( "INVERT_DIRECTION" ), aParamGroup ), 3, 0 ); - aParamsLayout->addWidget( myInvertDirection, 3, 1 ); + + aParamsLayout->addWidget( myProfileModeButton, 1, 0 ); + aParamsLayout->addWidget( ProfileModeButton2, 1, 1 ); + + aParamsLayout->addWidget( myProfileLabel, 2, 0 ); + aParamsLayout->addWidget( myProfiles, 2, 1 ); + + myLCValLabel = new QLabel( tr( "LC_VALUE" ), aParamGroup); + myDeltaZValLabel = new QLabel( tr( "DELTAZ_VALUE" ), aParamGroup); + myCoteZValLabel = new QLabel( tr( "COTEZ_VALUE" ), aParamGroup); + + aParamsLayout->addWidget( myLCValLabel, 3, 0 ); + aParamsLayout->addWidget( myLCVal, 3, 1 ); + aParamsLayout->addWidget( myDeltaZValLabel, 4, 0 ); + aParamsLayout->addWidget( myDeltaZVal, 4, 1 ); + aParamsLayout->addWidget( myCoteZValLabel, 5, 0 ); + aParamsLayout->addWidget( myCoteZVal, 5, 1 ); + + aParamsLayout->addWidget( new QLabel( tr( "EQUI_DISTANCE" ), aParamGroup ), 6, 0 ); + aParamsLayout->addWidget( myEquiDistance, 6, 1 ); + aParamsLayout->addWidget( new QLabel( tr( "INVERT_DIRECTION" ), aParamGroup ), 7, 0 ); + aParamsLayout->addWidget( myInvertDirection, 7, 1 ); // Common addWidget( myObjectNameGroup ); @@ -82,6 +121,9 @@ HYDROGUI_ChannelDlg::HYDROGUI_ChannelDlg( HYDROGUI_Module* theModule, const QStr // Connect signals and slots connect( myGuideLines, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onChannelDefChanged() ) ); connect( myProfiles, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onChannelDefChanged() ) ); + + connect( myProfileModeButton, SIGNAL( toggled( bool ) ), this, SLOT( onProfileModeChanged( bool ) ) ); + myProfileModeButton->setChecked(true); } HYDROGUI_ChannelDlg::~HYDROGUI_ChannelDlg() @@ -176,6 +218,39 @@ void HYDROGUI_ChannelDlg::onChannelDefChanged() emit CreatePreview(); } +void HYDROGUI_ChannelDlg::onProfileModeChanged(bool mode) +{ + if ( signalsBlocked() ) + return; + if (mode) + { + myProfiles->setVisible(true); + myProfileLabel->setVisible(true); + myLCValLabel->setVisible(false); + myLCVal->setVisible(false); + myDeltaZValLabel->setVisible(false); + myDeltaZVal->setVisible(false); + myCoteZValLabel->setVisible(false); + myCoteZVal->setVisible(false); + } + else + { + myProfiles->setVisible(false); + myProfileLabel->setVisible(false); + myLCValLabel->setVisible(true); + myLCVal->setVisible(true); + myDeltaZValLabel->setVisible(true); + myDeltaZVal->setVisible(true); + myCoteZValLabel->setVisible(true); + myCoteZVal->setVisible(true); + } +} + +bool HYDROGUI_ChannelDlg::getProfileMode() +{ + return myProfileModeButton->isChecked(); +} + double HYDROGUI_ChannelDlg::getEquiDistance() const { return myEquiDistance->value(); diff --git a/src/HYDROGUI/HYDROGUI_ChannelDlg.h b/src/HYDROGUI/HYDROGUI_ChannelDlg.h index 1501dc2f..d651c446 100644 --- a/src/HYDROGUI/HYDROGUI_ChannelDlg.h +++ b/src/HYDROGUI/HYDROGUI_ChannelDlg.h @@ -27,6 +27,8 @@ class QGroupBox; class QLineEdit; class QCheckBox; class QtxDoubleSpinBox; +class QLabel; +class QRadioButton; class HYDROGUI_ChannelDlg : public HYDROGUI_InputPanel { @@ -55,12 +57,16 @@ public: bool getInvertDirection() const; void setInvertDirection( bool isChecked ); + bool getProfileMode(); + + signals: void CreatePreview(); private slots: void onChannelDefChanged(); + void onProfileModeChanged(bool); protected: @@ -70,8 +76,19 @@ protected: QComboBox* myGuideLines; QComboBox* myProfiles; + QLabel* myProfileLabel; + QLabel* myLCValLabel; + QLabel* myDeltaZValLabel; + QLabel* myCoteZValLabel; + QtxDoubleSpinBox* myEquiDistance; QCheckBox* myInvertDirection; + + QtxDoubleSpinBox* myLCVal; + QtxDoubleSpinBox* myDeltaZVal; + QtxDoubleSpinBox* myCoteZVal; + + QRadioButton* myProfileModeButton; }; #endif