Skip to content

Commit 1229c40

Browse files
committed
improves reliability of the recognition of autoDROP as signaled by the Orbiter
1 parent f966c57 commit 1229c40

5 files changed

Lines changed: 17 additions & 11 deletions

File tree

src/artisanlib/comm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,7 +2271,6 @@ def Orbiter_BTET(self) -> tuple[float,float,float]:
22712271
t1:float = -1
22722272
t2:float = -1
22732273
if self.aw.orbiter is not None:
2274-
previous_isRoaster_Roasting:bool = self.aw.orbiter.isRoaster_Roasting # keep previous roasting state to be able to detect a change after getting new data via getBT()
22752274
t1 = self.aw.orbiter.getBT(self.aw.qmc.current_time())
22762275
t2 = self.aw.orbiter.getET()
22772276

@@ -2280,7 +2279,7 @@ def Orbiter_BTET(self) -> tuple[float,float,float]:
22802279
if self.aw.qmc.timeindex[0] == -1 and self.aw.orbiter.isRoaster_Roasting:
22812280
self.aw.qmc.markChargeSignal.emit(True) # CHARGE
22822281
elif (self.aw.qmc.timeindex[0] > -1 and self.aw.qmc.timeindex[6] == 0 and
2283-
previous_isRoaster_Roasting and not self.aw.orbiter.isRoaster_Roasting):
2282+
self.aw.orbiter.isRoaster_Cooling):
22842283
#self.aw.qmc.autoDropIdx = len(self.aw.qmc.timex) - 1
22852284
self.aw.qmc.markDropSignal.emit(True) # DROP
22862285

src/artisanlib/orbiter.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Orbiter(AsyncComm):
7171
__slots__ = [ 'send_timeout', 'connected', 'outer_connected_handler', 'outer_disconnected_handler',
7272
'_BT', '_ET', '_IT', '_DT', '_air', '_drum', '_damper', '_heater', '_sound', '_RoR', '_master_control',
7373
'_SERIAL', '_FW_VERSION', '_PCB_VERSION', '_DASHBOARD_STATUS', '_MODEL', '_MODEL_NUM',
74-
'isRoaster_Roasting' ]
74+
'isRoaster_Roasting', 'isRoaster_Cooling' ]
7575

7676
def __init__(self, serial:'SerialSettings',
7777
connected_handler:Callable[[], None]|None = None,
@@ -112,6 +112,7 @@ def __init__(self, serial:'SerialSettings',
112112
self._MODEL_NUM:int = 0 # 1 byte
113113
# machine status
114114
self.isRoaster_Roasting:bool = False
115+
self.isRoaster_Cooling:bool = False
115116

116117
def connected_handler(self) -> None:
117118
self.connected = True
@@ -206,7 +207,12 @@ async def read_msg(self, stream: asyncio.StreamReader|IteratorReader) -> None:
206207
dashboard_state = data[3:5]
207208
dashboard_state_low = dashboard_state[0]
208209
#
209-
# self.isRoaster_Cooling = self.test_bit(dashboard_state_low, 3)
210+
self.isRoaster_Cooling = self.test_bit(dashboard_state_low, 3)
211+
# if self.isRoaster_Cooling:
212+
# _log.debug("isRoaster_Cooling")
213+
# else:
214+
# _log.debug("NOT isRoaster_Cooling")
215+
#
210216
self.isRoaster_Roasting = self.test_bit(dashboard_state_low, 2)
211217
# if self.isRoaster_Roasting:
212218
# _log.debug("isRoaster_Roasting")

src/artisanlib/util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def appFrozen() -> bool:
8080
_log.exception(e)
8181
return ib
8282

83+
@functools.lru_cache
8384
def signature_message(version:str, revision:str, artisan_os:str) -> bytes:
8485
return bytes(f'{version}{revision}{artisan_os}', encoding='ascii')
8586

src/requirements-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ types-openpyxl>=3.1.5.20260518
44
types-Pillow>=10.2.0.20240822
55
types-protobuf>=7.34.1.20260518
66
types-psutil>=7.2.2.20260518
7-
types-pyserial>=3.5.0.20260518
7+
types-pyserial>=3.5.0.20260519
88
types-python-dateutil>=2.9.0.20260518
99
types-pytz>=2026.2.0.20260518
1010
types-pyyaml>=6.0.12.20260518
@@ -29,7 +29,7 @@ pytest-datadir==1.8.0
2929
#PyVirtualDisplay==3.0
3030
#pytest-bdd==6.1.1
3131
#pytest-benchmark==4.0.0
32-
hypothesis>=6.152.7
32+
hypothesis>=6.152.9
3333
coverage>=7.14.0
3434
coverage-badge==1.1.2
3535
codespell==2.4.2

src/requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ xlrd==2.0.2
4343
websockets==16.0
4444
PyYAML==6.0.3
4545
psutil==7.2.2
46-
protobuf==7.34.0
47-
numpy==2.4.4
46+
protobuf==7.35.0
47+
numpy==2.4.6
4848
scipy==1.17.1
4949
wquantiles==0.6
5050
colorspacious==1.1.2
5151
openpyxl==3.1.5
5252
keyring==25.7.0
5353
prettytable==3.17.0
54-
lxml==6.1.0
54+
lxml==6.1.1
5555
matplotlib==3.10.9
5656
jinja2==3.1.6
5757
aiohttp==3.13.5
@@ -62,8 +62,8 @@ pillow==12.2.0
6262
pydantic==2.13.4
6363
babel==2.18.0
6464
bleak==3.0.2
65-
python-statemachine==3.1.1
66-
yoctopuce==2.1.12672
65+
python-statemachine==3.1.2
66+
yoctopuce==2.1.13347
6767
PyQt6==6.11.0
6868
PyQt6-WebEngine==6.11.0
6969
qt6-tools==6.5.0.1.3

0 commit comments

Comments
 (0)