@@ -871,7 +871,11 @@ def __init__(self, parent:QWidget, dpi:int, locale:str, aw:'ApplicationWindow')
871
871
f'+IKAWA {deltaLabelUTF8}Humidity/{deltaLabelUTF8}Humidity Dir.', #160
872
872
'+Omega HH309 34', #161
873
873
'Digi-Sense 20250-07', #162
874
- 'Extech 42570' #163
874
+ 'Extech 42570', #163
875
+ 'Mugma BT/ET', #164
876
+ '+Mugma Heater/Fan', #165
877
+ '+Mugma Catalyzer', #166
878
+ '+Mugma SV' #167
875
879
]
876
880
877
881
# ADD DEVICE:
@@ -933,7 +937,8 @@ def __init__(self, parent:QWidget, dpi:int, locale:str, aw:'ApplicationWindow')
933
937
133, # Yocto Sensor
934
938
134, # Santoker BT/ET
935
939
138, # Kaleido BT/ET
936
- 142 # IKAWA
940
+ 142, # IKAWA,
941
+ 164 # Mugma BT/ET
937
942
]
938
943
939
944
# ADD DEVICE:
@@ -1002,7 +1007,9 @@ def __init__(self, parent:QWidget, dpi:int, locale:str, aw:'ApplicationWindow')
1002
1007
157, # +Phidget DAQ1301 23
1003
1008
158, # +Phidget DAQ1301 45
1004
1009
159, # +Phidget DAQ1301 67
1005
- 160 # IKAWA \Delta Humidity / \Delat Humidity direction
1010
+ 160, # IKAWA \Delta Humidity / \Delat Humidity direction
1011
+ 165, # +Mugma Heater/Fan
1012
+ 166 # +Mugma Catalyzer
1006
1013
]
1007
1014
1008
1015
# ADD DEVICE:
@@ -1031,6 +1038,8 @@ def __init__(self, parent:QWidget, dpi:int, locale:str, aw:'ApplicationWindow')
1031
1038
#extra devices
1032
1039
self.extradevices:List[int] = [] # list with indexes for extra devices
1033
1040
self.extratimex:List[List[float]] = [] # individual time for each extra device (more accurate). List of lists (2 dimension)
1041
+ #NOTE: extra device colors may contain alpha information thus to turn them into QColors, one needs to truncate the string by [:7] to remove the alpha or
1042
+ # or first convert the color string using util.rgba_colorname2argb_colorname to preserve the alpha information
1034
1043
self.extradevicecolor1:List[str] = [] # extra line 1 color. list with colors.
1035
1044
self.extradevicecolor2:List[str] = [] # extra line 2 color. list with colors.
1036
1045
self.extratemp1:List[List[float]] = [] # extra temp1. List of lists
@@ -3314,6 +3323,9 @@ def updateLargeExtraLCDs(self, extra1:Optional[List[Optional[str]]] = None, extr
3314
3323
except Exception as e: # pylint: disable=broad-except
3315
3324
_log.exception(e)
3316
3325
3326
+
3327
+ # ADD DEVICE:
3328
+
3317
3329
# returns True if the extra device n, channel c, is of type MODBUS or S7, has no factor defined, nor any math formula, and is of type int
3318
3330
# channel c is either 0 or 1
3319
3331
@functools.lru_cache(maxsize=None) # noqa: B019 # pylint: disable=W1518 #for Python >= 3.9 can use @functools.cache; Not relevant here, as qmc is only created once: [B019] Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
@@ -3374,7 +3386,7 @@ def intChannel(self, n:int, c:int) -> bool:
3374
3386
return self.aw.s7.type[6+c] != 1 and self.aw.s7.mode[6+c] == 0 and (self.aw.s7.div[6+c] == 0 or self.aw.s7.type[6+c] == 2) and no_math_formula_defined
3375
3387
if self.extradevices[n] == 110: # S7_910
3376
3388
return self.aw.s7.type[8+c] != 1 and self.aw.s7.mode[8+c] == 0 and (self.aw.s7.div[8+c] == 0 or self.aw.s7.type[8+c] == 2) and no_math_formula_defined
3377
- if self.extradevices[n] in {54, 90, 91, 135, 136, 140, 141}: # Hottop Heater/Fan, Slider 12, Slider 34, Santoker Power / Fan, Kaleido Fan/Drum, Kaleido Heater/AH
3389
+ if self.extradevices[n] in {54, 90, 91, 135, 136, 140, 141, 165 }: # Hottop Heater/Fan, Slider 12, Slider 34, Santoker Power / Fan, Kaleido Fan/Drum, Kaleido Heater/AH, Mugma Heater/Fan
3378
3390
return True
3379
3391
if self.extradevices[n] == 136 and c == 0: # Santoker Drum
3380
3392
return True
@@ -6365,7 +6377,7 @@ def formtime(self, x:float, _pos:Optional[int]) -> str:
6365
6377
if s >= 59:
6366
6378
return f'{m+1:.0f}'
6367
6379
if abs(s - 30) < 1:
6368
- return f'{m:d.5} '
6380
+ return f'{m:d}.5 '
6369
6381
if s > 1:
6370
6382
return f'{m:.0f}:{s:02.0f}'
6371
6383
return f'{m:.0f}'
@@ -6377,7 +6389,7 @@ def formtime(self, x:float, _pos:Optional[int]) -> str:
6377
6389
if s >= 59:
6378
6390
return f'-{m+1:.0f}'
6379
6391
if abs(s-30) < 1:
6380
- return f'-{m:d.5} '
6392
+ return f'-{m:d}.5 '
6381
6393
if s > 1:
6382
6394
return f'-{m:.0f}:{s:02.0f}'
6383
6395
if m == 0:
@@ -11670,6 +11682,15 @@ def OnMonitor(self) -> None:
11670
11682
_log.error(ex)
11671
11683
_, _, exc_tb = sys.exc_info()
11672
11684
self.adderror((QApplication.translate('Error Message', 'Exception:') + ' Bluetooth BLE support not available {0}').format(str(ex)),getattr(exc_tb, 'tb_lineno', '?'))
11685
+ elif self.device == 164:
11686
+ # connect Mugma
11687
+ from artisanlib.mugma import Mugma
11688
+ self.aw.mugma = Mugma(self.aw.mugmaHost, self.aw.mugmaPort,
11689
+ connected_handler=lambda : self.aw.sendmessageSignal.emit(QApplication.translate('Message', '{} connected').format('Mugma'),True,None),
11690
+ disconnected_handler=lambda : self.aw.sendmessageSignal.emit(QApplication.translate('Message', '{} disconnected').format('Mugma'),True,None))
11691
+ self.aw.mugma.setLogging(self.device_logging)
11692
+ self.aw.mugma.start()
11693
+
11673
11694
11674
11695
self.aw.initializedMonitoringExtraDeviceStructures()
11675
11696
@@ -11791,6 +11812,11 @@ def OffMonitorCloseDown(self) -> None:
11791
11812
_log.error(e)
11792
11813
self.aw.ikawa = None
11793
11814
11815
+ # disconnect Mugma
11816
+ if not bool(self.aw.simulator) and self.device == 164 and self.aw.mugma is not None:
11817
+ self.aw.mugma.stop()
11818
+ self.aw.mugma = None
11819
+
11794
11820
# at OFF we stop the follow-background on FujiPIDs and set the SV to 0
11795
11821
if self.device == 0 and self.aw.fujipid.followBackground and self.aw.fujipid.sv and self.aw.fujipid.sv > 0:
11796
11822
try:
@@ -12305,8 +12331,8 @@ def OnRecorder(self) -> None:
12305
12331
self.aw.updateReadingsLCDsVisibility() # update visibility of reading LCDs based on the user preference
12306
12332
if self.phasesLCDflag:
12307
12333
self.aw.phasesLCDs.show()
12308
- self.aw.TP2DRYlabel.setStyleSheet("background-color:'transparent'; color: " + self.palette['messages'] + ';')
12309
- self.aw.DRY2FCslabel.setStyleSheet("background-color:'transparent'; color: " + self.palette['messages'] + ';')
12334
+ self.aw.TP2DRYlabel.setStyleSheet("background-color:'transparent'; color: " + self.palette['messages'][:7] + ';')
12335
+ self.aw.DRY2FCslabel.setStyleSheet("background-color:'transparent'; color: " + self.palette['messages'][:7] + ';')
12310
12336
if self.AUClcdFlag:
12311
12337
self.aw.AUCLCD.show()
12312
12338
@@ -16009,11 +16035,11 @@ def phases_to_messageline(self) -> None:
16009
16035
16010
16036
margin = ' '
16011
16037
text_color_rect1 = '#ffffff' if self.aw.QColorBrightness(QColor(self.palette['rect1'])) < 128 else '#000000'
16012
- string1 = f" <font color = \"{text_color_rect1}\" style=\"BACKGROUND-COLOR: {self.palette['rect1']}\">{margin}{stringfromseconds(dryphasetime)}{margin}{dryphaseP}%{margin}{dryroc}{margin}</font>"
16038
+ string1 = f" <font color = \"{text_color_rect1[:7] }\" style=\"BACKGROUND-COLOR: {self.palette['rect1'][:7 ]}\">{margin}{stringfromseconds(dryphasetime)}{margin}{dryphaseP}%{margin}{dryroc}{margin}</font>"
16013
16039
text_color_rect2 = '#ffffff' if self.aw.QColorBrightness(QColor(self.palette['rect2'])) < 128 else '#000000'
16014
- string2 = f" <font color = \"{text_color_rect2}\" style=\"BACKGROUND-COLOR: {self.palette['rect2']}\">{margin} {stringfromseconds(midphasetime)} {margin} {midphaseP}% {margin} {midroc} {margin}</font>"
16040
+ string2 = f" <font color = \"{text_color_rect2[:7] }\" style=\"BACKGROUND-COLOR: {self.palette['rect2'][:7 ]}\">{margin} {stringfromseconds(midphasetime)} {margin} {midphaseP}% {margin} {midroc} {margin}</font>"
16015
16041
text_color_rect3 = '#ffffff' if self.aw.QColorBrightness(QColor(self.palette['rect3'])) < 128 else '#000000'
16016
- string3 = f" <font color = \"{text_color_rect3}\" style=\"BACKGROUND-COLOR: {self.palette['rect3']}\">{margin} {stringfromseconds(finishphasetime)} {margin} {finishphaseP}% {margin} {finishroc} {margin}</font>"
16042
+ string3 = f" <font color = \"{text_color_rect3[:7] }\" style=\"BACKGROUND-COLOR: {self.palette['rect3'][:7 ]}\">{margin} {stringfromseconds(finishphasetime)} {margin} {finishphaseP}% {margin} {finishroc} {margin}</font>"
16017
16043
self.aw.sendmessage(f'<PRE>{string1}{string2}{string3}</PRE>',append=False)
16018
16044
16019
16045
#handler for moving point
0 commit comments