diff --git a/Framework/DataHandling/src/RotateSampleShape.cpp b/Framework/DataHandling/src/RotateSampleShape.cpp index cc76b73b7194..4d107472cb8b 100644 --- a/Framework/DataHandling/src/RotateSampleShape.cpp +++ b/Framework/DataHandling/src/RotateSampleShape.cpp @@ -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(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(ei->sample().getShapePtr()); diff --git a/docs/source/release/v6.12.0/Framework/Algorithms/Bugfixes/38063.rst b/docs/source/release/v6.12.0/Framework/Algorithms/Bugfixes/38063.rst new file mode 100644 index 000000000000..6fe28f083b44 --- /dev/null +++ b/docs/source/release/v6.12.0/Framework/Algorithms/Bugfixes/38063.rst @@ -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 diff --git a/qt/python/mantidqtinterfaces/mantidqtinterfaces/SampleTransmissionCalculator/stc_view.py b/qt/python/mantidqtinterfaces/mantidqtinterfaces/SampleTransmissionCalculator/stc_view.py index d9ad9f06d136..0faa2cabd240 100644 --- a/qt/python/mantidqtinterfaces/mantidqtinterfaces/SampleTransmissionCalculator/stc_view.py +++ b/qt/python/mantidqtinterfaces/mantidqtinterfaces/SampleTransmissionCalculator/stc_view.py @@ -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(),