Skip to content

Commit afdb8f7

Browse files
committed
- updates CN translations
- adds slider(5,<bool>) Artisan Command to toggle visibility of the SV Slider - extended MPL default font mappings for the languages AR, HE, KR, zh_CN, zh_TW on Linux
1 parent c8d1588 commit afdb8f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+27996
-27852
lines changed
92 Bytes
Binary file not shown.
18 Bytes
Binary file not shown.

doc/help_dialogs/Output_html/eventbuttons_help.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@
870870
<tr>
871871
<td>&#160;</td>
872872
<td>slider(n,&lt;bool&gt;)</td>
873-
<td>show/hide slider per event type n from {1,2,3,4}</td>
873+
<td>show/hide slider per event type n from {1,2,3,4}; n=5 toggles the PID SV slider visibility</td>
874874
</tr>
875875
<tr>
876876
<td>&#160;</td>

doc/help_dialogs/Output_html/eventsliders_help.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@
708708
<tr>
709709
<td>&#160;</td>
710710
<td>slider(n,&lt;bool&gt;)</td>
711-
<td>show/hide slider per event type n from {1,2,3,4}</td>
711+
<td>show/hide slider per event type n from {1,2,3,4}; n=5 toggles the PID SV slider visibility</td>
712712
<td>&#160;</td>
713713
</tr>
714714
<tr>

src/artisanlib/comm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6755,7 +6755,7 @@ def YOCTOtemperatures(self, mode:int = 0, productNameFilter:str|None = None) ->
67556755
else:
67566756
self.YOCTOlastvalues[0] = probe1
67576757
if probe1 == -1 and self.YOCTOsensor and self.YOCTOsensor.isOnline():
6758-
probe1 = self.YOCTOsensor.get_currentValue()
6758+
probe1 = cast(float, self.YOCTOsensor.get_currentValue())
67596759
if probe1 != -1:
67606760
# convert temperature scale
67616761
if self.aw.qmc.YOCTOchanUnit == 'C' and self.aw.qmc.mode == 'F':

src/artisanlib/main.py

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7699,11 +7699,17 @@ def setFonts(self, redraw:bool = True) -> None:
76997699
elif platform.system() == 'Linux':
77007700
mpl.rcParams['font.family'] = ['DejaVu Sans','DejaVu Sans Mono', 'sans-serif'] # default; works for Greek
77017701
if self.locale_str == 'ar':
7702-
mpl.rcParams['font.family'] = ['DejaVu Sans','DejaVu Sans Mono','Times New Roman', 'sans-serif']
7702+
mpl.rcParams['font.family'] = ['Noto Sans Arabic', 'DejaVu Sans','DejaVu Sans Mono','Times New Roman', 'sans-serif']
7703+
elif self.locale_str == 'he':
7704+
mpl.rcParams['font.family'] = ['Noto Sans Hebrew', 'DejaVu Sans', 'sans-serif']
77037705
elif self.locale_str == 'ja':
7704-
mpl.rcParams['font.family'] = ['TakaoPGothic', 'DejaVu Sans', 'sans-serif']
7705-
elif self.locale_str in {'zh_CN', 'zh_TW'}:
7706-
mpl.rcParams['font.family'] = ['NanumGothic', 'DejaVu Sans', 'DejaVu Sans Mono', 'sans-serif']
7706+
mpl.rcParams['font.family'] = ['Noto Sans CJK JP', 'Noto Sans JP', 'TakaoPGothic', 'DejaVu Sans', 'sans-serif']
7707+
elif self.locale_str in {'kr'}:
7708+
mpl.rcParams['font.family'] = ['Noto Sans KR', 'Noto Sans CJK KR', 'Noto Sans CJK JP', 'NanumGothic', 'DejaVu Sans', 'DejaVu Sans Mono', 'sans-serif']
7709+
elif self.locale_str in {'zh_CN'}:
7710+
mpl.rcParams['font.family'] = ['Noto Sans SC', 'Noto Sans CJK SC', 'Noto Sans CJK JP', 'Source Han Sans CN', 'NanumGothic', 'DejaVu Sans', 'DejaVu Sans Mono', 'sans-serif']
7711+
elif self.locale_str in {'zh_TW'}:
7712+
mpl.rcParams['font.family'] = ['Noto Sans TC', 'Noto Sans CJK TC', 'Noto Sans CJK JP', 'Source Han Sans CN', 'NanumGothic', 'DejaVu Sans', 'DejaVu Sans Mono', 'sans-serif']
77077713
self.mpl_fontproperties = FontProperties()
77087714
else: # Windows:
77097715
mpl.rcParams['font.family'] = ['Microsoft Sans Serif', 'DejaVu Sans', 'Arial', 'sans-serif'] # works for Greek and Arabic
@@ -10444,7 +10450,7 @@ def eventaction_internal(self, action:int, cmd:str, eventtype:int|None) -> None:
1044410450
self.eventquantifieractive[event_type - 1] = False
1044510451
except Exception as e: # pylint: disable=broad-except
1044610452
_log.exception(e)
10447-
# slider(<int>, <bool>) with <int> from {1,2,3,4} selecting one of the four event types
10453+
# slider(<int>, <bool>) with <int> from {1,2,3,4,5} selecting one of the four event types or with 5 the PID SV slider
1044810454
elif cs.startswith('slider(') and cs.endswith(')'):
1044910455
try:
1045010456
args = cs[len('slider('):-1].split(',')
@@ -10457,10 +10463,21 @@ def eventaction_internal(self, action:int, cmd:str, eventtype:int|None) -> None:
1045710463
except Exception: # pylint: disable=broad-except
1045810464
value_str = args[1].strip()
1045910465
if value_str.lower() in {'yes', 'true', 't', '1'}:
10460-
self.eventslidervisibilities[event_type - 1] = True
10466+
self.eventslidervisibilities[event_type - 1] = 1
1046110467
else:
10462-
self.eventslidervisibilities[event_type - 1] = False
10468+
self.eventslidervisibilities[event_type - 1] = 0
1046310469
QTimer.singleShot(100, self.updateSlidersProperties) # needs to run in the GUI thread!
10470+
elif event_type == 5:
10471+
try:
10472+
state = toBool(eval(args[1])) # pylint: disable=eval-used
10473+
self.pidcontrol.svSlider = state
10474+
except Exception: # pylint: disable=broad-except
10475+
value_str = args[1].strip()
10476+
if value_str.lower() in {'yes', 'true', 't', '1'}:
10477+
self.pidcontrol.svSlider = True
10478+
else:
10479+
self.pidcontrol.svSlider = False
10480+
QTimer.singleShot(100, self.updateSVsliderVisibility) # needs to run in the GUI thread!
1046410481
except Exception as e: # pylint: disable=broad-except
1046510482
_log.exception(e)
1046610483
# setBatchSize(<float>) : if <float> is negative, the batchsize of the background profile is used if any
@@ -11805,6 +11822,9 @@ def toggleReadings(self,_:bool = False) -> None:
1180511822
else:
1180611823
self.showLCDs()
1180711824

11825+
def updateSVsliderVisibility(self) -> None:
11826+
self.sliderGrpBoxSV.setVisible(self.pidcontrol.svSlider)
11827+
1180811828
def updateSlidersProperties(self) -> None:
1180911829
# update slider properties and event type names
1181011830
if bool(self.eventslidervisibilities[0]):

src/help/eventbuttons_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def content() -> str:
218218
tbl_Commands.add_row(['&#160;','playbackdropmode(<int>)',QApplication.translate('HelpDlg','sets playback DROP mode to 0: off, 1: time, 2: BT, 3: ET')])
219219
tbl_Commands.add_row(['&#160;','playback(n,<bool>)',QApplication.translate('HelpDlg','toggles playback per event type n from {1,2,3,4}')])
220220
tbl_Commands.add_row(['&#160;','ramp(n,<bool>)',QApplication.translate('HelpDlg','toggles playback ramping per event type n from {1,2,3,4}')])
221-
tbl_Commands.add_row(['&#160;','slider(n,<bool>)',QApplication.translate('HelpDlg','show/hide slider per event type n from {1,2,3,4}')])
221+
tbl_Commands.add_row(['&#160;','slider(n,<bool>)',QApplication.translate('HelpDlg','show/hide slider per event type n from {1,2,3,4}; n=5 toggles the PID SV slider visibility')])
222222
tbl_Commands.add_row(['&#160;','quantifier(n,<bool>)',QApplication.translate('HelpDlg','activate/deactivate quantification per event type n from {1,2,3,4}')])
223223
tbl_Commands.add_row(['&#160;','setBatchSize(<float>)',QApplication.translate('HelpDlg','set the batch size to the given value. If the value is negative, the batch size is taken from the background profile, if any is loaded')])
224224
tbl_Commands.add_row(['&#160;','openProperties',QApplication.translate('HelpDlg','opens the Roast Properties dialog')])

src/help/eventsliders_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def content() -> str:
142142
tbl_Commands.add_row(['&#160;','playbackdropmode(<int>)',QApplication.translate('HelpDlg','sets playback DROP mode to 0: off, 1: time, 2: BT, 3: ET'),'&#160;'])
143143
tbl_Commands.add_row(['&#160;','playback(n,<bool>)',QApplication.translate('HelpDlg','toggles playback per event type n from {1,2,3,4}'),'&#160;'])
144144
tbl_Commands.add_row(['&#160;','ramp(n,<bool>)',QApplication.translate('HelpDlg','toggles playback ramping per event type n from {1,2,3,4}'),'&#160;'])
145-
tbl_Commands.add_row(['&#160;','slider(n,<bool>)',QApplication.translate('HelpDlg','show/hide slider per event type n from {1,2,3,4}'),'&#160;'])
145+
tbl_Commands.add_row(['&#160;','slider(n,<bool>)',QApplication.translate('HelpDlg','show/hide slider per event type n from {1,2,3,4}; n=5 toggles the PID SV slider visibility'),'&#160;'])
146146
tbl_Commands.add_row(['&#160;','quantifier(n,<bool>)',QApplication.translate('HelpDlg','activate/deactivate quantification per event type n from {1,2,3,4}'),'&#160;'])
147147
tbl_Commands.add_row(['&#160;','setBatchSize(<float>)',QApplication.translate('HelpDlg','set the batch size to the given value. If the value is negative, the batch size is taken from the background profile, if any is loaded'),'&#160;'])
148148
tbl_Commands.add_row(['&#160;','openProperties',QApplication.translate('HelpDlg','opens the Roast Properties dialog'),'&#160;'])

src/requirements-dev.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ types-Pillow>=10.2.0.20240822
33
types-protobuf>=6.32.1.20251210
44
types-psutil>=7.2.1.20260116
55
types-pyserial>=3.5.0.20251001
6-
types-python-dateutil==2.9.0.20251115
6+
types-python-dateutil==2.9.0.20260124
77
types-pytz>=2025.2.0.20251108
88
types-pyyaml>=6.0.12.20250915
99
types-requests>=2.32.4.20260107
10-
types-setuptools>=80.9.0.20251223
10+
types-setuptools>=80.10.0.20260124
1111
types-urllib3>=1.26.25.14
1212
types-docutils>=0.22.3.20251115
1313
types-xlrd>=2.0.0.20251020
@@ -28,7 +28,7 @@ pytest-datadir==1.8.0
2828
#PyVirtualDisplay==3.0
2929
#pytest-bdd==6.1.1
3030
#pytest-benchmark==4.0.0
31-
hypothesis>=6.150.2
31+
hypothesis>=6.150.3
3232
coverage>=7.13.1
3333
coverage-badge==1.1.2
3434
codespell==2.4.1

src/translations/artisan_ar.qm

118 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)