Skip to content

Commit 2c41f33

Browse files
committed
-graph updates immediately when smoothing value changes
-updates test to run on Windows
1 parent 7774999 commit 2c41f33

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/artisanlib/curves.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,13 @@ def __init__(self, parent:QWidget, aw:'ApplicationWindow', activeTab:int = 0) ->
352352
self.DeltaETfilter.setRange(0,40)
353353
self.DeltaETfilter.setAlignment(Qt.AlignmentFlag.AlignRight)
354354
self.DeltaETfilter.setValue(int(round((self.aw.qmc.deltaETfilter - 1)/2)))
355-
self.DeltaETfilter.editingFinished.connect(self.changeDeltaETfilter)
355+
self.DeltaETfilter.valueChanged.connect(self.changeDeltaETfilter)
356356
self.DeltaBTfilter = QSpinBox()
357357
self.DeltaBTfilter.setSingleStep(1)
358358
self.DeltaBTfilter.setRange(0,40)
359359
self.DeltaBTfilter.setAlignment(Qt.AlignmentFlag.AlignRight)
360360
self.DeltaBTfilter.setValue(int(round(self.aw.qmc.deltaBTfilter -1)/2))
361-
self.DeltaBTfilter.editingFinished.connect(self.changeDeltaBTfilter)
361+
self.DeltaBTfilter.valueChanged.connect(self.changeDeltaBTfilter)
362362

363363
self.OptimalSmoothingFlag = QCheckBox(QApplication.translate('CheckBox', 'Optimal Smoothing Post Roast'))
364364
self.OptimalSmoothingFlag.setToolTip(QApplication.translate('Tooltip', 'Use an optimal smoothing algorithm (only applicable offline, after recording)'))
@@ -378,7 +378,7 @@ def __init__(self, parent:QWidget, aw:'ApplicationWindow', activeTab:int = 0) ->
378378
self.Filter.setRange(0,5)
379379
self.Filter.setAlignment(Qt.AlignmentFlag.AlignRight)
380380
self.Filter.setValue(int(round((self.aw.qmc.curvefilter - 1)/2)))
381-
self.Filter.editingFinished.connect(self.changeFilter)
381+
self.Filter.valueChanged.connect(self.changeFilter)
382382
#filterspikes
383383
self.FilterSpikes = QCheckBox(QApplication.translate('CheckBox', 'Smooth Spikes'))
384384
self.FilterSpikes.setChecked(self.aw.qmc.filterDropOuts)

src/test/unitary/plus/test_plus_util.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import datetime
77
import os
88
import sys
9+
from pathlib import Path
910
import tempfile
1011
from typing import Any, Dict, Generator
1112
from unittest.mock import Mock, patch
@@ -951,7 +952,7 @@ def test_set_plus_icon_with_app_style(self) -> None:
951952
mock_app_style = Mock()
952953
mock_app_style.pixelMetric.return_value = 48
953954

954-
with patch('plus.util.getResourcePath', return_value='/path/to/resources'), patch(
955+
with patch('plus.util.getResourcePath', return_value=str(Path('/path/to/resources'))), patch(
955956
'plus.util.QApplication.style', return_value=mock_app_style
956957
), patch('plus.util.QIcon') as mock_qicon, patch('plus.util.QSize') as mock_qsize:
957958

@@ -964,7 +965,7 @@ def test_set_plus_icon_with_app_style(self) -> None:
964965
util.setPlusIcon(mock_mbox)
965966

966967
# Assert
967-
mock_qicon.assert_called_once_with('/path/to/resources/Icons/plus-notification.svg')
968+
mock_qicon.assert_called_once_with(str(Path('/path/to/resources/Icons/plus-notification.svg')))
968969
mock_qsize.assert_called_once_with(48, 48)
969970
mock_mbox.setIconPixmap.assert_called_once_with(mock_pixmap)
970971

@@ -973,7 +974,7 @@ def test_set_plus_icon_without_app_style(self) -> None:
973974
# Arrange
974975
mock_mbox = Mock()
975976

976-
with patch('plus.util.getResourcePath', return_value='/path/to/resources'), patch(
977+
with patch('plus.util.getResourcePath', return_value=str(Path('/path/to/resources'))), patch(
977978
'plus.util.QApplication.style', return_value=None
978979
), patch('plus.util.QIcon') as mock_qicon, patch('plus.util.QSize') as mock_qsize:
979980

@@ -986,6 +987,6 @@ def test_set_plus_icon_without_app_style(self) -> None:
986987
util.setPlusIcon(mock_mbox)
987988

988989
# Assert
989-
mock_qicon.assert_called_once_with('/path/to/resources/Icons/plus-notification.svg')
990+
mock_qicon.assert_called_once_with(str(Path('/path/to/resources/Icons/plus-notification.svg')))
990991
mock_qsize.assert_called_once_with(64, 64) # Default size
991992
mock_mbox.setIconPixmap.assert_called_once_with(mock_pixmap)

wiki/ReleaseHistory.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ v3.2.1
2929
- updates internal PID by adding Advanced Integral Windup Prevention, derivative on measurement calculation (DoM), measurement discontinuity detection, derivative limiting and enhanced setpoint change detection to prevent the derivative kicks and spikes
3030
- updates libs (scipy, bleak, lxml, pillow)
3131
- expands automatic test coverage
32+
- graph updates immediately when smoothing value changes
3233

3334
* FIXES
3435
- fixes regression which broke the designer such that points could not be moved ([Discussion #1905](../../../discussions/1905) and [Issue #1916](../../../issues/1916))

0 commit comments

Comments
 (0)