Skip to content

Commit

Permalink
- reorganize Trinitas machine setups
Browse files Browse the repository at this point in the history
- update libs
- reduce macOS build size
  • Loading branch information
MAKOMO committed Sep 14, 2024
1 parent 74d7b91 commit dbbf7d8
Show file tree
Hide file tree
Showing 17 changed files with 715 additions and 140 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ for:

environment:
ARTISAN_OS: macos
MACOSX_DEPLOYMENT_TARGET: 11.0
MACOSX_DEPLOYMENT_TARGET: 12.0
PYTHONSITEPKGS: /Users/appveyor/venv${PYTHON_V}/lib/python${PYTHON_V}/site-packages
QT_PATH: ${PYTHONSITEPKGS}/PyQt6/Qt6
QT_SRC_PATH: /Users/appveyor/Qt/6.6/macos
Expand Down
3 changes: 1 addition & 2 deletions src/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,11 @@
<key>LSArchitecturePriority</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>LSHasLocalizedDisplayName</key>
<false/>
<key>LSMinimumSystemVersion</key>
<string>11.0</string>
<string>14.0</string>
<key>LSMultipleInstancesProhibited</key>
<string>false</string>
<key>NSBluetoothAlwaysUsageDescription</key>
Expand Down
11 changes: 6 additions & 5 deletions src/artisanlib/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,21 @@ def _process(self, x:float) -> float:
yraw = ys + yerr

# define the filters
import scipy.signal # type: ignore
from scipy.signal import iirfilter, lfilter, sosfilt # type:ignore[import-untyped]
#
# define lowpass filter with 2.5 Hz cutoff frequency of order 4
b, a = scipy.signal.iirfilter(4, Wn=2.5, fs=fs, btype='low', ftype='butter')
y_scipy_lfilter = scipy.signal.lfilter(b, a, yraw)
b, a = iirfilter(4, Wn=2.5, fs=fs, btype='low', ftype='butter')
y_scipy_lfilter = lfilter(b, a, yraw)

live_lfilter = LiveLFilter(b, a)
# simulate live filter - passing values one by one
y_live_lfilter = [live_lfilter(y) for y in yraw]


# define lowpass filter with 2.5 Hz cutoff frequency of order 2
sos = scipy.signal.iirfilter(2, Wn=2.5, fs=fs, btype='low',
sos = iirfilter(2, Wn=2.5, fs=fs, btype='low',
ftype='butter', output='sos')
y_scipy_sosfilt = scipy.signal.sosfilt(sos, yraw)
y_scipy_sosfilt = sosfilt(sos, yraw)

live_sosfilter = LiveSosFilter(sos)
# simulate live filter - passing values one by one
Expand Down
2 changes: 1 addition & 1 deletion src/artisanlib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25853,7 +25853,7 @@ def initialize_locale(my_app:Artisan) -> str:
qt_translation_modules:List[str] = [
'qtbase',
'qtconnectivity',
'qtwebengine'
# 'qtwebengine'
]

# NOTE: on updates, need to update util.py:locale2full_local() as well
Expand Down
4 changes: 2 additions & 2 deletions src/artisanlib/pid.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import time
import numpy
import scipy.signal # type:ignore[import-untyped]
from scipy.signal import iirfilter # type:ignore[import-untyped]
import logging
from typing import Final, List, Optional, Callable

Expand Down Expand Up @@ -334,7 +334,7 @@ def getDuty(self) -> Optional[float]:
@staticmethod
def derivativeFilter() -> LiveSosFilter:
return LiveSosFilter(
scipy.signal.iirfilter(1, # order
iirfilter(1, # order
Wn=0.2, # 0 < Wn < fs/2 (fs=1 -> fs/2=0.5)
fs=1, # sampling rate, Hz
btype='low',
Expand Down
3 changes: 3 additions & 0 deletions src/build-macos3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ echo "************* build derived files **************"
if [ $? -ne 0 ]; then echo "Failed in build-derived.sh"; exit $?; else (echo "** Finished build-derived.sh"); fi


# remove useless .c file from Python site-packages from local build setups
rm -f ${PYTHONPATH}/site-packages/fontTools/misc/bezierTools.c # 1.9MB

# distribution
rm -rf build dist
sleep .3 # sometimes it takes a little for dist to get really empty
Expand Down
6 changes: 3 additions & 3 deletions src/includes/Machines/TRINITAS/T2.aset
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ extrastopbits=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\x2\0\0\0\x1)
extratimeout=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\x6?\xf0\0\0\0\0\0\0)

[ExtraDev]
extraCurveVisibility1=true, true, true, true, true, true, true, true, true, true
extraCurveVisibility1=false, true, true, true, true, true, true, true, true, true
extraCurveVisibility2=false, true, true, true, true, true, true, true, true, true
extraDelta1=false, false, false, false, false, false, false, false, false, false
extraDelta2=false, false, false, false, false, false, false, false, false, false
extraFill1=0, 0, 0, 0, 0, 0, 0, 0, 0, 0
extraFill2=0, 0, 0, 0, 0, 0, 0, 0, 0, 0
extraLCDvisibility1=true, false, false, false, false, false, false, false, false, false
extraLCDvisibility1=false, false, false, false, false, false, false, false, false, false
extraLCDvisibility2=false, false, false, false, false, false, false, false, false, false
extradevicecolor1=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\xe\0#\0\x32\0\x30\0\x38\0\x36\0\x62\0\x62)
extradevicecolor2=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\n\0\x62\0l\0\x61\0\x63\0k)
Expand Down Expand Up @@ -69,7 +69,7 @@ input3div=1
input3float=false
input3mode=
input3register=106
input3slave=3
input3slave=0
input4FloatsAsInt=false
input4bcd=false
input4code=3
Expand Down
124 changes: 124 additions & 0 deletions src/includes/Machines/TRINITAS/T2_air.aset
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
[General]
Delay=2000
roastertype_setup=TRINITAS T2 air
dropDuplicates=true
dropDuplicatesLimit=0.1

[Device]
id=29

[ExtraComm]
extrabaudrate=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\x2\0\0\x96\0)
extrabytesize=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\x2\0\0\0\b)
extracomport=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\b\0\x43\0O\0M\0\x31)
extraparity=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\x2\0\x45)
extrastopbits=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\x2\0\0\0\x1)
extratimeout=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\x6?\xf0\0\0\0\0\0\0)

[ExtraDev]
extraCurveVisibility1=true, true, true, true, true, true, true, true, true, true
extraCurveVisibility2=false, true, true, true, true, true, true, true, true, true
extraDelta1=false, false, false, false, false, false, false, false, false, false
extraDelta2=false, false, false, false, false, false, false, false, false, false
extraFill1=0, 0, 0, 0, 0, 0, 0, 0, 0, 0
extraFill2=0, 0, 0, 0, 0, 0, 0, 0, 0, 0
extraLCDvisibility1=true, false, false, false, false, false, false, false, false, false
extraLCDvisibility2=false, false, false, false, false, false, false, false, false, false
extradevicecolor1=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\xe\0#\0\x32\0\x30\0\x38\0\x36\0\x62\0\x62)
extradevicecolor2=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\n\0\x62\0l\0\x61\0\x63\0k)
extradevices=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\x2\0\0\0!)
extramathexpression1=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\0)
extramathexpression2=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\0)
extraname1=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\xe\0\x41\0i\0r\0\x66\0l\0o\0w)
extraname2=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\xe\0\x45\0x\0t\0r\0\x61\0 \0\x32)

[Modbus]
PID_OFF_action=
PID_ON_action=
PID_SV_register=0
PID_d_register=0
PID_i_register=0
PID_p_register=0
PID_slave_ID=0
PIDmultiplier=0
SVmultiplier=0
baudrate=9600
bytesize=8
comport=COM4
host=127.0.0.1
input1FloatsAsInt=false
input1bcd=false
input1code=4
input1div=0
input1float=false
input1mode=C
input1register=1000
input1slave=2
input2FloatsAsInt=false
input2bcd=false
input2code=4
input2div=0
input2float=false
input2mode=C
input2register=1000
input2slave=1
input3FloatsAsInt=false
input3bcd=false
input3code=3
input3div=1
input3float=false
input3mode=
input3register=106
input3slave=3
input4FloatsAsInt=false
input4bcd=false
input4code=3
input4div=0
input4float=false
input4mode=C
input4register=0
input4slave=0
input5FloatsAsInt=false
input5bcd=false
input5code=3
input5div=0
input5float=false
input5mode=C
input5register=0
input5slave=0
input6FloatsAsInt=false
input6bcd=false
input6code=3
input6div=0
input6float=false
input6mode=C
input6register=0
input6slave=0
input7FloatsAsInt=false
input7bcd=false
input7code=3
input7div=0
input7float=false
input7mode=C
input7register=0
input7slave=0
input8FloatsAsInt=false
input8bcd=false
input8code=3
input8div=0
input8float=false
input8mode=C
input8register=0
input8slave=0
littleEndianFloats=false
parity=N
port=502
stopbits=2
timeout=0.4
type=0
wordorderLittle=true
optimizer=true
fetch_max_blocks=false

[MachineSetup]
capacity=2
124 changes: 124 additions & 0 deletions src/includes/Machines/TRINITAS/T2_legacy.aset
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
[General]
Delay=2000
roastertype_setup=TRINITAS T2 legacy
dropDuplicates=true
dropDuplicatesLimit=0.1

[Device]
id=29

[ExtraComm]
extrabaudrate=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\x2\0\0\x96\0)
extrabytesize=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\x2\0\0\0\b)
extracomport=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\b\0\x43\0O\0M\0\x31)
extraparity=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\x2\0\x45)
extrastopbits=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\x2\0\0\0\x1)
extratimeout=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\x6?\xf0\0\0\0\0\0\0)

[ExtraDev]
extraCurveVisibility1=true, true, true, true, true, true, true, true, true, true
extraCurveVisibility2=false, true, true, true, true, true, true, true, true, true
extraDelta1=false, false, false, false, false, false, false, false, false, false
extraDelta2=false, false, false, false, false, false, false, false, false, false
extraFill1=0, 0, 0, 0, 0, 0, 0, 0, 0, 0
extraFill2=0, 0, 0, 0, 0, 0, 0, 0, 0, 0
extraLCDvisibility1=true, false, false, false, false, false, false, false, false, false
extraLCDvisibility2=false, false, false, false, false, false, false, false, false, false
extradevicecolor1=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\xe\0#\0\x32\0\x30\0\x38\0\x36\0\x62\0\x62)
extradevicecolor2=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\n\0\x62\0l\0\x61\0\x63\0k)
extradevices=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\x2\0\0\0!)
extramathexpression1=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\0)
extramathexpression2=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\0)
extraname1=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\xe\0\x41\0i\0r\0\x66\0l\0o\0w)
extraname2=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\xe\0\x45\0x\0t\0r\0\x61\0 \0\x32)

[Modbus]
PID_OFF_action=
PID_ON_action=
PID_SV_register=0
PID_d_register=0
PID_i_register=0
PID_p_register=0
PID_slave_ID=0
PIDmultiplier=0
SVmultiplier=0
baudrate=9600
bytesize=8
comport=COM4
host=127.0.0.1
input1FloatsAsInt=false
input1bcd=false
input1code=4
input1div=0
input1float=false
input1mode=C
input1register=1000
input1slave=2
input2FloatsAsInt=false
input2bcd=false
input2code=4
input2div=0
input2float=false
input2mode=C
input2register=1000
input2slave=1
input3FloatsAsInt=false
input3bcd=false
input3code=3
input3div=1
input3float=false
input3mode=
input3register=106
input3slave=0
input4FloatsAsInt=false
input4bcd=false
input4code=3
input4div=0
input4float=false
input4mode=C
input4register=0
input4slave=0
input5FloatsAsInt=false
input5bcd=false
input5code=3
input5div=0
input5float=false
input5mode=C
input5register=0
input5slave=0
input6FloatsAsInt=false
input6bcd=false
input6code=3
input6div=0
input6float=false
input6mode=C
input6register=0
input6slave=0
input7FloatsAsInt=false
input7bcd=false
input7code=3
input7div=0
input7float=false
input7mode=C
input7register=0
input7slave=0
input8FloatsAsInt=false
input8bcd=false
input8code=3
input8div=0
input8float=false
input8mode=C
input8register=0
input8slave=0
littleEndianFloats=false
parity=N
port=502
stopbits=2
timeout=0.4
type=0
wordorderLittle=true
optimizer=true
fetch_max_blocks=false

[MachineSetup]
capacity=2
4 changes: 2 additions & 2 deletions src/includes/Machines/TRINITAS/T7.aset
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extraDelta2=false, false, false, false, false, false, false, false, false, false
extraFill1=0, 0, 0, 0, 0, 0, 0, 0, 0, 0
extraFill2=0, 0, 0, 0, 0, 0, 0, 0, 0, 0
extraLCDvisibility1=true, false, false, false, false, false, false, false, false, false
extraLCDvisibility2=true, false, false, false, false, false, false, false, false, false
extraLCDvisibility2=false, false, false, false, false, false, false, false, false, false
extradevicecolor1=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\xe\0#\0\x32\0\x30\0\x38\0\x36\0\x62\0\x62)
extradevicecolor2=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\n\0\0\0\xe\0#\0\x61\0\x62\0\x30\0\x34\0\x32\0\x36)
extradevices=@Variant(\0\0\0\t\0\0\0\x1\0\0\0\x2\0\0\0!)
Expand Down Expand Up @@ -77,7 +77,7 @@ input4div=1
input4float=false
input4mode=
input4register=3
input4slave=3
input4slave=0
input5FloatsAsInt=false
input5bcd=false
input5code=3
Expand Down
Loading

0 comments on commit dbbf7d8

Please sign in to comment.