Skip to content

Commit 1a960cf

Browse files
committed
- adds support for Pratter coffee roasters
- updates Orbiter support
1 parent 94ac8c6 commit 1a960cf

8 files changed

Lines changed: 357 additions & 8 deletions

File tree

src/artisanlib/canvas.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4615,7 +4615,7 @@ def compute_ror_simple(timex:list[float], temp:list[float], left_index:int) -> f
46154615
return ((temp[-1] - (temp[-left_index - 1] + temp[-left_index] + temp[-left_index + 1])/3.)/timed)*60. #delta BT (degrees/minute)
46164616
return ((temp[-1] - temp[-left_index])/timed)*60. #delta BT (degrees/minute)
46174617

4618-
def compute_ror(self, t_final:float, timex:list[float], temp:list[float], unfiltereddelta:list[float]) -> float:
4618+
def compute_ror(self, t_final:float, timex:list[float], temp:list[float], unfiltereddelta:list[float], deltaTempSamples:int) -> float:
46194619
# compute RoR
46204620
try:
46214621
if t_final == -1 or len(timex)<2: # we repeat the last RoR if underlying temperature dropped
@@ -4624,7 +4624,7 @@ def compute_ror(self, t_final:float, timex:list[float], temp:list[float], unfilt
46244624
return 0.
46254625
# normal data received
46264626
# Delta T = (changeTemp/ChangeTime)*60. = degrees per minute;
4627-
left_index = min(len(timex),len(temp),max(2, self.deltaETsamples + 1))
4627+
left_index = min(len(timex),len(temp),max(2, deltaTempSamples + 1))
46284628
# ****** Instead of basing the estimate on the window extremal points,
46294629
# grab the full set of points and do a formal LS solution to a straight line and use the slope estimate for RoR
46304630
if self.polyfitRoRcalc:
@@ -4972,10 +4972,10 @@ def sample_processing(self, local_flagstart:bool, temp1_readings:list[float], te
49724972
#we need a minimum of two readings to calculate rate of change
49734973
if length_of_qmc_timex > 1:
49744974
# compute T1 RoR
4975-
self.rateofchange1 = self.compute_ror(t1_final, sample_ctimex1, sample_tstemp1, sample_unfiltereddelta1)
4975+
self.rateofchange1 = self.compute_ror(t1_final, sample_ctimex1, sample_tstemp1, sample_unfiltereddelta1, self.deltaETsamples)
49764976

49774977
# compute T2 RoR
4978-
self.rateofchange2 = self.compute_ror(t2_final, sample_ctimex2, sample_tstemp2, sample_unfiltereddelta2)
4978+
self.rateofchange2 = self.compute_ror(t2_final, sample_ctimex2, sample_tstemp2, sample_unfiltereddelta2, self.deltaBTsamples)
49794979

49804980
# self.unfiltereddelta{1,2}_pure contain the RoR values respecting the delta_span, but without any delta smoothing NOR delta mathformulas applied
49814981
self.unfiltereddelta1_pure.append(self.rateofchange1)
@@ -13697,8 +13697,10 @@ def OffMonitor(self, respectAlwaysON:bool = True) -> None:
1369713697

1369813698
try:
1369913699
# trigger event action before disconnecting from devices
13700-
if self.extrabuttonactions[1] != 18: # Artisan Commands are executed after the OFFMonitor action is fully executed as they might trigger another buttons
13700+
if self.extrabuttonactions[1] not in {0, 18}: # Artisan Commands are executed after the OFFMonitor action is fully executed as they might trigger other buttons
13701+
# for all actions (buttonaction!=0) which are not Artisan Command (buttonaction!=18)
1370113702
self.aw.eventactionx(self.extrabuttonactions[1],self.extrabuttonactionstrings[1])
13703+
libtime.sleep(.3) # we wait a moment to increase the change that a potential write command can be succeed before connections are closed
1370213704
except Exception as e: # pylint: disable=broad-except
1370313705
_log.exception(e)
1370413706

src/artisanlib/comm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2225,13 +2225,15 @@ def Orbiter_BTET(self) -> tuple[float,float,float]:
22252225
t1:float = -1
22262226
t2:float = -1
22272227
if self.aw.orbiter is not None:
2228+
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()
22282229
t1 = self.aw.orbiter.getBT(self.aw.qmc.current_time())
22292230
t2 = self.aw.orbiter.getET()
22302231

22312232
# autoCHARGE/autoDROP triggered by machine
22322233
if self.aw.qmc.timeindex[0] == -1 and self.aw.orbiter.isRoaster_Roasting:
22332234
self.aw.qmc.markChargeSignal.emit(True) # CHARGE
2234-
elif self.aw.qmc.timeindex[0] > -1 and self.aw.qmc.timeindex[6] == 0 and self.aw.qmc.autoDropIdx == 0 and not self.aw.orbiter.isRoaster_Roasting:
2235+
elif (self.aw.qmc.timeindex[0] > -1 and self.aw.qmc.timeindex[6] == 0 and self.aw.qmc.autoDropIdx == 0 and
2236+
previous_isRoaster_Roasting and not self.aw.orbiter.isRoaster_Roasting):
22352237
self.aw.qmc.autoDropIdx = len(self.aw.qmc.timex) - 1
22362238
self.aw.qmc.markDropSignal.emit(True) # DROP
22372239

src/artisanlib/orbiter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ def create_msg(self, cmd:bytes, data:bytes, param:bytes, time:int) -> bytes:
256256

257257
# data byte order: LSB last (little-endian); eg. data=b'\x07\x00' equals 7
258258
def send_msg(self, cmd:bytes, data:bytes = b'\x00\x00', param:bytes = b'\x00', time:int = 0) -> None:
259+
# _log.debug("PRINT send_msg(%s,%s,%s,%s)",cmd,data,param,time)
259260
# send via socket
260261
self.send(self.create_msg(cmd, data, param, time))
261262

src/includes/Machines/Orbiter/OB-1.aset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ weight=g
1919
buttonactions=5, 0, 0, 0, 0, 0, 5, 5
2020
buttonactionstrings="orbiter(13,1);orbiter(02)", , , , , , "orbiter(14,1);orbiter(03);orbiter(0F,1)", "orbiter(0F,0);orbiter(01)"
2121
buttonvisibility=true, true, true, true, true, false, true, true
22-
extrabuttonactions=5, 5, 0
22+
extrabuttonactions=5, 0, 0
2323
extrabuttonactionstrings="orbiter(01)", orbiter(06),
2424
xextrabuttonactions=0, 5
2525
xextrabuttonactionstrings=, "orbiter(07,0,1)"
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
[General]
2+
Delay=2000
3+
roastertype_setup=Pratter Autonics
4+
dropDuplicates=true
5+
6+
[Device]
7+
id=29
8+
9+
10+
[Modbus]
11+
IP_retries=1
12+
IP_timeout=0.3
13+
PID_OFF_action=
14+
PID_ON_action=
15+
PID_SV_register=0
16+
PID_d_register=0
17+
PID_device_ID=1
18+
PID_i_register=0
19+
PID_p_register=0
20+
PIDmultiplier=0
21+
SVmultiplier=0
22+
SVwriteFloat=false
23+
SVwriteLong=false
24+
baudrate=9600
25+
bytesize=8
26+
comport=COM4
27+
fetch_max_blocks=false
28+
host=127.0.0.1
29+
input10BCDsAsInt=false
30+
input10FloatsAsInt=false
31+
input10Signed=false
32+
input10bcd=false
33+
input10code=3
34+
input10deviceId=0
35+
input10div=0
36+
input10float=false
37+
input10mode=C
38+
input10register=0
39+
input1BCDsAsInt=false
40+
input1FloatsAsInt=false
41+
input1Signed=false
42+
input1bcd=false
43+
input1code=4
44+
input1deviceId=1
45+
input1div=0
46+
input1float=false
47+
input1mode=C
48+
input1register=1000
49+
input2BCDsAsInt=false
50+
input2FloatsAsInt=false
51+
input2Signed=false
52+
input2bcd=false
53+
input2code=4
54+
input2deviceId=2
55+
input2div=0
56+
input2float=false
57+
input2mode=C
58+
input2register=1000
59+
input3BCDsAsInt=false
60+
input3FloatsAsInt=false
61+
input3Signed=false
62+
input3bcd=false
63+
input3code=3
64+
input3deviceId=0
65+
input3div=0
66+
input3float=false
67+
input3mode=C
68+
input3register=0
69+
input4BCDsAsInt=false
70+
input4FloatsAsInt=false
71+
input4Signed=false
72+
input4bcd=false
73+
input4code=3
74+
input4deviceId=0
75+
input4div=0
76+
input4float=false
77+
input4mode=C
78+
input4register=0
79+
input5BCDsAsInt=false
80+
input5FloatsAsInt=false
81+
input5Signed=false
82+
input5bcd=false
83+
input5code=3
84+
input5deviceId=0
85+
input5div=0
86+
input5float=false
87+
input5mode=C
88+
input5register=0
89+
input6BCDsAsInt=false
90+
input6FloatsAsInt=false
91+
input6Signed=false
92+
input6bcd=false
93+
input6code=3
94+
input6deviceId=0
95+
input6div=0
96+
input6float=false
97+
input6mode=C
98+
input6register=0
99+
input7BCDsAsInt=false
100+
input7FloatsAsInt=false
101+
input7Signed=false
102+
input7bcd=false
103+
input7code=3
104+
input7deviceId=0
105+
input7div=0
106+
input7float=false
107+
input7mode=C
108+
input7register=0
109+
input8BCDsAsInt=false
110+
input8FloatsAsInt=false
111+
input8Signed=false
112+
input8bcd=false
113+
input8code=3
114+
input8deviceId=0
115+
input8div=0
116+
input8float=false
117+
input8mode=C
118+
input8register=0
119+
input9BCDsAsInt=false
120+
input9FloatsAsInt=false
121+
input9Signed=false
122+
input9bcd=false
123+
input9code=3
124+
input9deviceId=0
125+
input9div=0
126+
input9float=false
127+
input9mode=C
128+
input9register=0
129+
modbus_serial_connect_delay=0.5
130+
optimizer=true
131+
parity=N
132+
port=502
133+
serial_readRetries=1
134+
stopbits=2
135+
timeout=0.4
136+
type=0
137+
wordorderLittle=true
138+

src/includes/Machines/Pratter/PLC.aset

Lines changed: 204 additions & 0 deletions
Large diffs are not rendered by default.

src/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ websockets==16.0
4444
PyYAML==6.0.3
4545
psutil==7.2.2
4646
protobuf==7.34.0
47-
numpy==2.4.2
47+
numpy==2.4.3
4848
scipy==1.17.1
4949
wquantiles==0.6
5050
colorspacious==1.1.2

wiki/ReleaseHistory.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ v4.0.4 (Mar XX, 2026)
66
------------------
77

88
* ADDITIONS
9+
- adds support for [Orbiter](https://artisan-scope.org/machines/orbiter/) smart roasters
10+
- adds support for [Pratter](https://artisan-scope.org/machines/pratter/) roasting machines
911
- adds Artisan Command `pidSVbuttons(<bool>)` ([Issue #2121](../../../issues/2121))
1012
* CHANGES
1113
- added a popup explaining the reason the Roast Properties dialog is opened on START if plus is connected and disabled the OK button until beans are specified ([Issue #2133](../../../issues/2133))

0 commit comments

Comments
 (0)