Skip to content

Commit

Permalink
Minor UI fix
Browse files Browse the repository at this point in the history
  • Loading branch information
waynegm committed Apr 18, 2022
1 parent 8e676d2 commit 8150382
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
5 changes: 5 additions & 0 deletions CHANGES.MD
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
### Mistie Analysis
- fix crash when estimating misties for depth surveys

### wmodpy - OpendTect Python Bindings
A decision was made to discontinue development of these within WMPlugins in favour of moving the code
into the dGB managed OpendTect open source code repository system on Github. The new repository will be
called "odpybind".

## Release 6.6.9
### AVOPolarAttrib
- Fix attribute calculation on time slices and horizons
Expand Down
1 change: 0 additions & 1 deletion plugins/EFDAttrib/efdmodesattrib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ void EFDModesAttrib::initClass()
mAttrStartInitClassWithDescAndDefaultsUpdate

IntParam* nrmodes = new IntParam( nrmodesStr() );
nrmodes->setLimits( 1, 20 );
nrmodes->setDefaultValue( 5 );
desc->addParam( nrmodes );

Expand Down
2 changes: 0 additions & 2 deletions plugins/EFDAttrib/efdspectrumattrib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ void EFDSpectrumAttrib::initClass()
mAttrStartInitClassWithDescAndDefaultsUpdate

IntParam* nrmodes = new IntParam( nrmodesStr() );
nrmodes->setLimits( 1, 20 );
nrmodes->setDefaultValue( 5 );
desc->addParam( nrmodes );

FloatParam* step = new FloatParam( stepStr() );
Expand Down
19 changes: 9 additions & 10 deletions plugins/uiEFDAttrib/uiefdmodesattrib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "survinfo.h"
#include "uiattribfactory.h"
#include "uiattrsel.h"
#include "uigeninput.h"
#include "uibutton.h"
#include "uispinbox.h"
#include "trckeyzsampling.h"
Expand All @@ -43,14 +42,15 @@ uiEFDModesAttrib::uiEFDModesAttrib( uiParent* p, bool is2d )
{
inpfld_ = createInpFld( is2d );

IntInpSpec inspec( 5, 1, 20 );
nrmodesfld_ = new uiGenInput( this, tr("Number of Modes"), inspec );
nrmodesfld_ = new uiLabeledSpinBox( this, tr("Number of Modes") );
nrmodesfld_->box()->setInterval(1, 100);
nrmodesfld_->box()->setValue(5);
nrmodesfld_->attach( alignedBelow, inpfld_ );
mAttachCB(nrmodesfld_->valuechanged,uiEFDModesAttrib::nrmodesChgCB);
mAttachCB(nrmodesfld_->box()->valueChanged,uiEFDModesAttrib::nrmodesChgCB);

outmodefld_ = new uiLabeledSpinBox(this, tr("Output Mode"));
outmodefld_->attach( alignedBelow, nrmodesfld_ );
outmodefld_->box()->setInterval(0, inspec.value()-1);
outmodefld_->box()->setInterval(0, nrmodesfld_->box()->getIntValue()-1);
outmodefld_->box()->setValue(0);

uiString butstr = tr("Display EFD Modes panel");
Expand All @@ -68,19 +68,18 @@ uiEFDModesAttrib::~uiEFDModesAttrib()

void uiEFDModesAttrib::nrmodesChgCB( CallBacker* )
{
const int mxmodes = nrmodesfld_->getIntValue();
const int mxmodes = nrmodesfld_->box()->getIntValue();
const int selmode = mMIN(mxmodes-1, outmodefld_->box()->getIntValue());
outmodefld_->box()->setInterval( 0, mxmodes-1);
outmodefld_->box()->setValue( selmode);
}


bool uiEFDModesAttrib::setParameters( const Attrib::Desc& desc )
{
if ( desc.attribName() != EFDModesAttrib::attribName() )
return false;

mIfGetInt(EFDModesAttrib::nrmodesStr(), nrmodes, nrmodesfld_->setValue(nrmodes));
mIfGetInt(EFDModesAttrib::nrmodesStr(), nrmodes, nrmodesfld_->box()->setValue(nrmodes));
nrmodesChgCB(nullptr);
return true;
}
Expand All @@ -103,7 +102,7 @@ bool uiEFDModesAttrib::getParameters( Attrib::Desc& desc )
if ( desc.attribName() != EFDModesAttrib::attribName() )
return false;

mSetInt( EFDModesAttrib::nrmodesStr(), nrmodesfld_->getIntValue() );
mSetInt( EFDModesAttrib::nrmodesStr(), nrmodesfld_->box()->getIntValue() );
return true;
}

Expand Down Expand Up @@ -152,5 +151,5 @@ void uiEFDModesAttrib::showPosDlgCB( CallBacker* )

void uiEFDModesAttrib::fillTestParams( Attrib::Desc* desc ) const
{
mSetParam(Int,nrmodes, EFDModesAttrib::nrmodesStr(), nrmodesfld_->getIntValue())
mSetParam(Int,nrmodes, EFDModesAttrib::nrmodesStr(), nrmodesfld_->box()->getIntValue())
}
4 changes: 1 addition & 3 deletions plugins/uiEFDAttrib/uiefdmodesattrib.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

namespace Attrib { class Desc; }
class uiAttrSel;
class uiGenInput;
class uiLabeledSpinBox;
class uiPushButton;

Expand All @@ -38,14 +37,13 @@ mExpClass(uiEFDAttrib) uiEFDModesAttrib : public uiAttrDescEd, public TestPanelA
protected:

uiAttrSel* inpfld_;
uiGenInput* nrmodesfld_;
uiLabeledSpinBox* nrmodesfld_;
uiLabeledSpinBox* outmodefld_;
uiAttribTestPanel<uiEFDModesAttrib>* testpanel_ = nullptr;
uiPushButton* modepanelbut_;

void nrmodesChgCB(CallBacker*);


bool setParameters(const Attrib::Desc&);
bool setInput(const Attrib::Desc&);
bool setOutput(const Attrib::Desc&);
Expand Down
16 changes: 9 additions & 7 deletions plugins/uiEFDAttrib/uiefdspectrumattrib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "survinfo.h"
#include "uiattribfactory.h"
#include "uiattrsel.h"
#include "uigeninput.h"
#include "uibutton.h"
#include "uispinbox.h"
#include "trckeyzsampling.h"
Expand All @@ -42,9 +41,12 @@ uiEFDSpectrumAttrib::uiEFDSpectrumAttrib( uiParent* p, bool is2d )
, TestPanelAdaptor()
{
inpfld_ = createInpFld( is2d );
mAttachCB(inpfld_->selectionDone, uiEFDSpectrumAttrib::inputSel);

modesfld_ = new uiGenInput( this, tr("Number of Modes"), IntInpSpec(5, 1, 20));
modesfld_->attach( alignedBelow, inpfld_ );
nrmodesfld_ = new uiLabeledSpinBox(this, tr("Number of Modes"));
nrmodesfld_->box()->setInterval(1, 100);
nrmodesfld_->box()->setValue(5);
nrmodesfld_->attach( alignedBelow, inpfld_ );

uiString lbl;
const bool zistime = SI().zDomain().isTime();
Expand All @@ -57,7 +59,7 @@ uiEFDSpectrumAttrib::uiEFDSpectrumAttrib( uiParent* p, bool is2d )
lbl = tr("Output Wavenumber (/kft)");

freqfld_ = new uiLabeledSpinBox( this, lbl, 1 );
freqfld_->attach( alignedBelow, modesfld_ );
freqfld_->attach( alignedBelow, nrmodesfld_ );
freqfld_->box()->doSnap( true );

stepfld_ = new uiLabeledSpinBox( this, uiStrings::sStep(), 1 );
Expand Down Expand Up @@ -121,7 +123,7 @@ bool uiEFDSpectrumAttrib::setParameters( const Attrib::Desc& desc )
if ( desc.attribName() != EFDSpectrumAttrib::attribName() )
return false;

mIfGetInt(EFDSpectrumAttrib::nrmodesStr(), nrmodes, modesfld_->setValue(nrmodes));
mIfGetInt(EFDSpectrumAttrib::nrmodesStr(), nrmodes, nrmodesfld_->box()->setValue(nrmodes));
const float freqscale = zIsTime() ? 1.f : 1000.f;
mIfGetFloat(EFDSpectrumAttrib::stepStr(), step, stepfld_->box()->setValue(step*freqscale) );

Expand Down Expand Up @@ -149,7 +151,7 @@ bool uiEFDSpectrumAttrib::getParameters( Attrib::Desc& desc )
if ( desc.attribName() != EFDSpectrumAttrib::attribName() )
return false;

mSetInt( EFDSpectrumAttrib::nrmodesStr(), modesfld_->getIntValue() );
mSetInt( EFDSpectrumAttrib::nrmodesStr(), nrmodesfld_->box()->getIntValue() );
const float freqscale = zIsTime() ? 1.f : 1000.f;
mSetFloat( EFDSpectrumAttrib::stepStr(), stepfld_->box()->getFValue()/freqscale );
return true;
Expand Down Expand Up @@ -216,7 +218,7 @@ void uiEFDSpectrumAttrib::showPosDlgCB( CallBacker* )

void uiEFDSpectrumAttrib::fillTestParams( Attrib::Desc* desc ) const
{
mSetParam(Int,nmodes, EFDSpectrumAttrib::nrmodesStr(), modesfld_->getIntValue())
mSetParam(Int,nmodes, EFDSpectrumAttrib::nrmodesStr(), nrmodesfld_->box()->getIntValue())

//show Frequencies with a step of 1 in Time and 1e-3 in Depth,
//independently of what the user can have specified previously
Expand Down
3 changes: 1 addition & 2 deletions plugins/uiEFDAttrib/uiefdspectrumattrib.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

namespace Attrib { class Desc; }
class uiAttrSel;
class uiGenInput;
class uiLabeledSpinBox;
class uiPushButton;

Expand All @@ -39,7 +38,7 @@ mExpClass(uiEFDAttrib) uiEFDSpectrumAttrib : public uiAttrDescEd, public TestPan
protected:

uiAttrSel* inpfld_;
uiGenInput* modesfld_;
uiLabeledSpinBox* nrmodesfld_;
uiLabeledSpinBox* freqfld_;
uiLabeledSpinBox* stepfld_;
uiAttribTestPanel<uiEFDSpectrumAttrib>* testpanel_ = nullptr;
Expand Down

0 comments on commit 8150382

Please sign in to comment.