forked from M-Labs/thermostat
ctrl_panel: Fix editing fields with unit "°C"
A faulty regular expression within PyQtGraph causes any Parameter with a suffix that doesn't begin with an alphanumeric character (as matched with \w) to act abnormally. For instance, entering "100 °C" into the input boxes gets interpreted as 10 °C. Use a custom regular expression for Parameters with this unit, which simply matches for any character in the suffix group.
This commit is contained in:
parent
9a00c2b8f2
commit
38099d6d7b
@ -89,6 +89,7 @@
|
|||||||
],
|
],
|
||||||
"format": "{value:.4f} {suffix}",
|
"format": "{value:.4f} {suffix}",
|
||||||
"suffix": "°C",
|
"suffix": "°C",
|
||||||
|
"regex": "(?P<number>[+-]?((((\\d+(\\.\\d*)?)|(\\d*\\.\\d+))([eE][+-]?\\d+)?)|((?i:nan)|(inf))))\\s*((?P<siPrefix>[uyzafpnµm kMGTPEZY]?)(?P<suffix>.*))?$",
|
||||||
"noUnitEditing": true,
|
"noUnitEditing": true,
|
||||||
"compactHeight": false,
|
"compactHeight": false,
|
||||||
"param": [
|
"param": [
|
||||||
@ -201,6 +202,7 @@
|
|||||||
],
|
],
|
||||||
"format": "{value:.4f} {suffix}",
|
"format": "{value:.4f} {suffix}",
|
||||||
"suffix": "°C",
|
"suffix": "°C",
|
||||||
|
"regex": "(?P<number>[+-]?((((\\d+(\\.\\d*)?)|(\\d*\\.\\d+))([eE][+-]?\\d+)?)|((?i:nan)|(inf))))\\s*((?P<siPrefix>[uyzafpnµm kMGTPEZY]?)(?P<suffix>.*))?$",
|
||||||
"noUnitEditing": true,
|
"noUnitEditing": true,
|
||||||
"compactHeight": false,
|
"compactHeight": false,
|
||||||
"param": [
|
"param": [
|
||||||
@ -392,6 +394,7 @@
|
|||||||
"step": 0.1,
|
"step": 0.1,
|
||||||
"format": "{value:.4f} {suffix}",
|
"format": "{value:.4f} {suffix}",
|
||||||
"suffix": "°C",
|
"suffix": "°C",
|
||||||
|
"regex": "(?P<number>[+-]?((((\\d+(\\.\\d*)?)|(\\d*\\.\\d+))([eE][+-]?\\d+)?)|((?i:nan)|(inf))))\\s*((?P<siPrefix>[uyzafpnµm kMGTPEZY]?)(?P<suffix>.*))?$",
|
||||||
"noUnitEditing": true,
|
"noUnitEditing": true,
|
||||||
"compactHeight": false,
|
"compactHeight": false,
|
||||||
"pid_autotune": [
|
"pid_autotune": [
|
||||||
@ -430,6 +433,7 @@
|
|||||||
"step": 0.1,
|
"step": 0.1,
|
||||||
"format": "{value:.4f} {suffix}",
|
"format": "{value:.4f} {suffix}",
|
||||||
"suffix": "°C",
|
"suffix": "°C",
|
||||||
|
"regex": "(?P<number>[+-]?((((\\d+(\\.\\d*)?)|(\\d*\\.\\d+))([eE][+-]?\\d+)?)|((?i:nan)|(inf))))\\s*((?P<siPrefix>[uyzafpnµm kMGTPEZY]?)(?P<suffix>.*))?$",
|
||||||
"noUnitEditing": true,
|
"noUnitEditing": true,
|
||||||
"compactHeight": false,
|
"compactHeight": false,
|
||||||
"pid_autotune": [
|
"pid_autotune": [
|
||||||
|
Loading…
Reference in New Issue
Block a user