Skip to content

Commit

Permalink
refs #6315 fix problems found during migration.
Browse files Browse the repository at this point in the history
1) Fix the problem with warnings being emitted as a result of duplicate calls to connect.
2) Fix problem with ThresholdRange objects, particularly MedianAndBelow.

There is still an outstanding problem with the non-axis aligned binning plugin that I need to fix.
  • Loading branch information
OwenArnold committed Jan 4, 2013
1 parent ce3e4d1 commit 4fc2438
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,33 +100,34 @@ void RebinningCutterObjectPanel::constructThresholdRanges(QGridLayout* gLayout)
{
m_thresholdWidget = new ThresholdRangeWidget(inputMinThreshold, inputMaxThreshold);
gLayout->addWidget(m_thresholdWidget, gLayout->rowCount() + 1, 0, Qt::AlignCenter);
}
else
{
m_thresholdWidget->setMaximum(inputMaxThreshold);
m_thresholdWidget->setMinimum(inputMinThreshold);
}

// Property used as setter
vtkSMProperty * minThreshold = this->proxy()->GetProperty("MinThreshold");
// Property used as setter
vtkSMProperty * minThreshold = this->proxy()->GetProperty("MinThreshold");

// Property used as setter
vtkSMProperty * maxThreshold = this->proxy()->GetProperty("MaxThreshold");

// Property used as setter
vtkSMProperty * maxThreshold = this->proxy()->GetProperty("MaxThreshold");
// Property used as setter
vtkSMProperty * rangeStrategy = this->proxy()->GetProperty("ThresholdRangeStrategyIndex");

// Property used as setter
vtkSMProperty * rangeStrategy = this->proxy()->GetProperty("ThresholdRangeStrategyIndex");
// Hook-up events to PV properties.
this->propertyManager()->registerLink(m_thresholdWidget, "MinSignal",
SIGNAL(minChanged()), this->proxy(), minThreshold);

// Hook-up events to PV properties.
this->propertyManager()->registerLink(m_thresholdWidget, "MinSignal",
SIGNAL(minChanged()), this->proxy(), minThreshold);
// Hook-up events to PV properties.
this->propertyManager()->registerLink(m_thresholdWidget, "MaxSignal",
SIGNAL(maxChanged()), this->proxy(), maxThreshold);

// Hook-up events to PV properties.
this->propertyManager()->registerLink(m_thresholdWidget, "MaxSignal",
SIGNAL(maxChanged()), this->proxy(), maxThreshold);
// Hook-up events to PV properties.
this->propertyManager()->registerLink(m_thresholdWidget, "ChosenStrategy",
SIGNAL(chosenStrategyChanged()), this->proxy(), rangeStrategy);

// Hook-up events to PV properties.
this->propertyManager()->registerLink(m_thresholdWidget, "ChosenStrategy",
SIGNAL(chosenStrategyChanged()), this->proxy(), rangeStrategy);
}
else
{
m_thresholdWidget->setMaximum(inputMaxThreshold);
m_thresholdWidget->setMinimum(inputMinThreshold);
}

m_cachedMaxThreshold = inputMaxThreshold;
m_cachedMinThreshold = inputMinThreshold;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,33 +98,33 @@ void RebinningTransformObjectPanel::constructThresholdRanges(QGridLayout* gLayou
{
m_thresholdWidget = new ThresholdRangeWidget(inputMinThreshold, inputMaxThreshold);
gLayout->addWidget(m_thresholdWidget, gLayout->rowCount() + 1, 0, 1, 2, Qt::AlignCenter);
}
else
{
m_thresholdWidget->setMaximum(inputMaxThreshold);
m_thresholdWidget->setMinimum(inputMinThreshold);
}

// Property used as setter
vtkSMProperty * minThreshold = this->proxy()->GetProperty("MinThreshold");
// Property used as setter
vtkSMProperty * minThreshold = this->proxy()->GetProperty("MinThreshold");

// Property used as setter
vtkSMProperty * maxThreshold = this->proxy()->GetProperty("MaxThreshold");
// Property used as setter
vtkSMProperty * maxThreshold = this->proxy()->GetProperty("MaxThreshold");

// Property used as setter
vtkSMProperty * rangeStrategy = this->proxy()->GetProperty("ThresholdRangeStrategyIndex");
// Property used as setter
vtkSMProperty * rangeStrategy = this->proxy()->GetProperty("ThresholdRangeStrategyIndex");

// Hook-up events to PV properties.
this->propertyManager()->registerLink(m_thresholdWidget, "MinSignal",
SIGNAL(minChanged()), this->proxy(), minThreshold);
// Hook-up events to PV properties.
this->propertyManager()->registerLink(m_thresholdWidget, "MinSignal",
SIGNAL(minChanged()), this->proxy(), minThreshold);

// Hook-up events to PV properties.
this->propertyManager()->registerLink(m_thresholdWidget, "MaxSignal",
SIGNAL(maxChanged()), this->proxy(), maxThreshold);
// Hook-up events to PV properties.
this->propertyManager()->registerLink(m_thresholdWidget, "MaxSignal",
SIGNAL(maxChanged()), this->proxy(), maxThreshold);

// Hook-up events to PV properties.
this->propertyManager()->registerLink(m_thresholdWidget, "ChosenStrategy",
SIGNAL(chosenStrategyChanged()), this->proxy(), rangeStrategy);
// Hook-up events to PV properties.
this->propertyManager()->registerLink(m_thresholdWidget, "ChosenStrategy",
SIGNAL(chosenStrategyChanged()), this->proxy(), rangeStrategy);
}
else
{
m_thresholdWidget->setMaximum(inputMaxThreshold);
m_thresholdWidget->setMinimum(inputMinThreshold);
}

m_cachedMaxThreshold = inputMaxThreshold;
m_cachedMinThreshold = inputMinThreshold;
Expand Down
5 changes: 4 additions & 1 deletion Code/Mantid/Vates/VatesAPI/src/MDEWRebinningPresenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ namespace Mantid
using namespace Mantid::Kernel;

V3D b3 = m_b1.cross_prod(m_b2);
binningAlg->setPropertyValue("Origin", VMD(m_origin).toString(",") );
binningAlg->setPropertyValue("Translation", VMD(m_origin).toString(",") );
binningAlg->setProperty("AxisAligned", false);
binningAlg->setProperty("ForceOrthogonal", m_ForceOrthogonal );
std::vector<int> OutputBins;
Expand Down Expand Up @@ -315,6 +315,8 @@ namespace Mantid
{
binningAlg->setPropertyValue("BasisVector3", "");
}
binningAlg->setProperty("OutputExtents", OutputExtents);
binningAlg->setProperty("OutputBins", OutputBins);
}
else
{
Expand Down Expand Up @@ -342,6 +344,7 @@ namespace Mantid
//Add observer.
binningAlg->addObserver(observer);
//Run the rebinning algorithm.
binningAlg->setRethrows(true);
binningAlg->execute();
//Remove observer
binningAlg->removeObserver(observer);
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Vates/VatesAPI/src/vtkMDHexFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ namespace Mantid
m_workspace = imdws;

//Setup range values according to whatever strategy object has been injected.
m_thresholdRange->setWorkspace(m_workspace);
m_thresholdRange->setWorkspace(ws);
m_thresholdRange->calculate();
}

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Vates/VatesAPI/src/vtkMDHistoHex4DFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace VATES
m_timeMapper = TimeMapper::construct(tMin, tMax, nbins);

//Setup range values according to whatever strategy object has been injected.
m_thresholdRange->setWorkspace(m_workspace);
m_thresholdRange->setWorkspace(workspace);
m_thresholdRange->calculate();
}
}
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Vates/VatesAPI/src/vtkMDHistoHexFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace VATES
m_workspace = doInitialize<MDHistoWorkspace, 3>(workspace);

//Setup range values according to whatever strategy object has been injected.
m_thresholdRange->setWorkspace(m_workspace);
m_thresholdRange->setWorkspace(workspace);
m_thresholdRange->calculate();
}

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Vates/VatesAPI/src/vtkMDHistoLineFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ namespace Mantid
m_workspace = this->doInitialize<MDHistoWorkspace, 1>(wspace_sptr);

//Setup range values according to whatever strategy object has been injected.
m_thresholdRange->setWorkspace(m_workspace);
m_thresholdRange->setWorkspace(wspace_sptr);
m_thresholdRange->calculate();
}

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Vates/VatesAPI/src/vtkMDHistoQuadFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ namespace Mantid
m_workspace = doInitialize<MDHistoWorkspace, 2>(wspace_sptr);

//Setup range values according to whatever strategy object has been injected.
m_thresholdRange->setWorkspace(m_workspace);
m_thresholdRange->setWorkspace(wspace_sptr);
m_thresholdRange->calculate();
}

Expand Down

0 comments on commit 4fc2438

Please sign in to comment.