Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Framework/DataHandling/src/RotateSampleShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ void RotateSampleShape::exec() {
g_log.warning() << "Empty goniometer created; will always return an "
"identity rotation matrix.\n";

const auto sampleShapeRotation = gon.getR();
const auto &sampleShapeRotation = gon.getR();
if (sampleShapeRotation == Kernel::Matrix<double>(3, 3, true)) {
// If the resulting rotationMatrix is Identity, ignore the calculatrion
g_log.warning("Rotation matrix set via RotateSampleShape is an Identity matrix. Ignored rotating sample shape");
return;
}

const auto oldRotation = ei->run().getGoniometer().getR();
const auto &oldRotation = ei->run().getGoniometer().getR();
auto newSampleShapeRot = sampleShapeRotation * oldRotation;
if (isMeshShape) {
auto meshShape = std::dynamic_pointer_cast<MeshObject>(ei->sample().getShapePtr());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed a bug in :ref:`sample_transmission_calculator` (Interfaces > General > Sample Transmission Calculator) interface to restrict entering commas mixed with decimal point in the double spin boxes for Low, Width and High fields
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ def __init__(self, parent=None):
"Or 0,100,10000,200,20000: from 0 rebin in steps of 100 to 10,000 then steps of 200 to 20,000."
)

self.single_high_spin_box.textChanged.connect(self._double_spinbox_textChanged)
self.single_low_spin_box.textChanged.connect(self._double_spinbox_textChanged)
self.single_width_spin_box.textChanged.connect(self._double_spinbox_textChanged)

def _double_spinbox_textChanged(self, text):
if "," in text:
text = text.replace(",", ".")
oldState = self.sender().blockSignals(True)
self.isEditing = True
self.sender().setValue(float(text))
self.sender().lineEdit().setText(f"{self.sender().value():.1f}")
self.sender().blockSignals(oldState)

def get_input_dict(self):
input_dict = {
"binning_type": self.binning_type_combo_box.currentIndex(),
Expand Down
Loading