Skip to content

Commit

Permalink
adds support for RM20 Playone and RM60-240
Browse files Browse the repository at this point in the history
  • Loading branch information
MAKOMO committed Oct 7, 2023
1 parent 236aa9b commit 54b7b4b
Show file tree
Hide file tree
Showing 10 changed files with 213 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ environment:
# Set the Appveyor Python version for windows, macos and linux here. Does not affect windows_legacy.
PYTHON_V: 3.11
# Upgrade to specific version (for platforms supporting upgrade). Upgrade skipped if env var is missing or blank.
PYUPGRADE_V: 3.11.5
# PYUPGRADE_V: 3.11.5 # causes ssl problems failing to connect to plus

matrix:
- job_name: windows_legacy
Expand Down
4 changes: 3 additions & 1 deletion src/artisanlib/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -3304,7 +3304,7 @@ def update_additional_artists(self) -> None:
linestyle = '-', linewidth= 1, alpha = .5,sketch_params=None,path_effects=[])
else:
self.l_timeline.set_xdata(tx)
self.ax.draw_artist(self.l_timeline)
self.ax.draw_artist(self.l_timeline)
if self.projectFlag:
if self.l_BTprojection is not None and self.BTcurve:
self.ax.draw_artist(self.l_BTprojection)
Expand Down Expand Up @@ -6673,6 +6673,8 @@ def reset(self,redraw=True,soundOn=True,sampling=False,keepProperties=False,fire
self.l_event_flags_dict = {} # initiate the event id to temp/time annotation dict for flags
self.l_background_annotations = [] # initiate the background event annotations

self.l_timeline = None # clear timeline Artist to get the linecount correct after changning a machine setup

if not sampling:
self.aw.hideDefaultButtons()
self.aw.updateExtraButtonsVisibility()
Expand Down
12 changes: 6 additions & 6 deletions src/artisanlib/curves.py
Original file line number Diff line number Diff line change
Expand Up @@ -1504,16 +1504,16 @@ def renameBT(self):
self.aw.BTname = str(self.renameBTLine.text()).strip()
if self.aw.BTname == '':
self.aw.BTname = QApplication.translate('Label', 'BT')
self.aw.label3.setText('<big><b>' + self.aw.BTname + '</b></big>')
self.aw.label5.setText(deltaLabelBigPrefix + self.aw.BTname + '</b></big>')
self.aw.label3.setText(f'<big><b>{self.aw.BTname}</b></big>'.format(self.aw.qmc.etypes[0],self.aw.qmc.etypes[1],self.aw.qmc.etypes[2],self.aw.qmc.etypes[3]))
self.aw.label5.setText(f'{deltaLabelBigPrefix}{self.aw.BTname}</b></big>'.format(self.aw.qmc.etypes[0],self.aw.qmc.etypes[1],self.aw.qmc.etypes[2],self.aw.qmc.etypes[3]))

@pyqtSlot()
def renameET(self):
self.aw.ETname = str(self.renameETLine.text()).strip()
if self.aw.ETname == '':
self.aw.ETname = QApplication.translate('Label', 'ET')
self.aw.label2.setText('<big><b>' + self.aw.ETname + '</b></big>')
self.aw.label4.setText(deltaLabelBigPrefix + self.aw.ETname + '</b></big>')
self.aw.label2.setText(f'<big><b>{self.aw.ETname}</b></big>'.format(self.aw.qmc.etypes[0],self.aw.qmc.etypes[1],self.aw.qmc.etypes[2],self.aw.qmc.etypes[3]))
self.aw.label4.setText(f'{deltaLabelBigPrefix}{self.aw.ETname}</b></big>'.format(self.aw.qmc.etypes[0],self.aw.qmc.etypes[1],self.aw.qmc.etypes[2],self.aw.qmc.etypes[3]))

@pyqtSlot(int)
def toggleWebLCDsAlerts(self,_):
Expand All @@ -1526,7 +1526,7 @@ def changeWebLCDsPort(self):
def setWebLCDsURL(self):
url_str = self.getWebLCDsURL()
# set URL label
self.WebLCDsURL.setText('<a href="' + url_str + '">' + url_str + '</a>')
self.WebLCDsURL.setText(f'<a href="{url_str}">{url_str}</a>')
# set QR label
try:
from artisanlib.qrcode import QRlabel
Expand All @@ -1541,7 +1541,7 @@ def getWebLCDsURL(self):
s.connect(('8.8.8.8', 80))
localIP = s.getsockname()[0]
s.close()
return 'http://' + str(localIP) + ':' + str(self.aw.WebLCDsPort) + '/artisan'
return f'http://{str(localIP)}:{str(self.aw.WebLCDsPort)}/artisan'

@pyqtSlot(bool)
def toggleWebLCDs(self,b):
Expand Down
8 changes: 4 additions & 4 deletions src/artisanlib/large_lcds.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def makeLCDs(self):
self.lcd0.display('00:00')
# ET
ETlcd = self.makeLCD('et') # Environmental Temperature ET
ETlabelUpper = self.makeLabel('<b>' + self.aw.ETname + '</b> ')
ETlabelUpper = self.makeLabel(f'<b>{self.aw.ETname.format(self.aw.qmc.etypes[0],self.aw.qmc.etypes[1],self.aw.qmc.etypes[2],self.aw.qmc.etypes[3])}</b> ')
ETlabelLower = self.makeLabel(' ')
#
self.lcds1 = [ETlcd]
Expand All @@ -371,7 +371,7 @@ def makeLCDs(self):
self.lcds1frames = [self.makeLCDframe(ETlabelUpper,ETlcd,ETlabelLower)]
# BT
BTlcd = self.makeLCD('bt') # Bean Temperature BT
BTlabelUpper = self.makeLabel('<b>' + self.aw.BTname + '</b> ')
BTlabelUpper = self.makeLabel(f'<b>{self.aw.BTname.format(self.aw.qmc.etypes[0],self.aw.qmc.etypes[1],self.aw.qmc.etypes[2],self.aw.qmc.etypes[3])}</b> ')
BTlabelLower = self.makeLabel(' ')
#
self.lcds2 = [BTlcd]
Expand Down Expand Up @@ -490,15 +490,15 @@ def __init__(self, parent = None, aw = None) -> None:
def makeLCDs(self):
self.lcds1styles = ['deltaet']
self.lcds1 = [self.makeLCD(self.lcds1styles[0])] # DeltaET
label1Upper = self.makeLabel('<b>&Delta;' + self.aw.ETname + '</b> ')
label1Upper = self.makeLabel(f'<b>&Delta;{self.aw.ETname.format(self.aw.qmc.etypes[0],self.aw.qmc.etypes[1],self.aw.qmc.etypes[2],self.aw.qmc.etypes[3])}</b> ')
label1Lower = self.makeLabel(' ')
self.lcds1labelsUpper = [label1Upper]
self.lcds1labelsLower = [label1Lower]
self.lcds1frames = [self.makeLCDframe(label1Upper,self.lcds1[0],label1Lower)]
#
self.lcds2styles = ['deltabt']
self.lcds2 = [self.makeLCD(self.lcds2styles[0])] # DeltaBT
label2Upper = self.makeLabel('<b>&Delta;' + self.aw.BTname + '</b> ')
label2Upper = self.makeLabel(f'<b>&Delta;{self.aw.BTname.format(self.aw.qmc.etypes[0],self.aw.qmc.etypes[1],self.aw.qmc.etypes[2],self.aw.qmc.etypes[3])}</b> ')
label2Lower = self.makeLabel(' ')
self.lcds2labelsUpper = [label2Upper]
self.lcds2labelsLower = [label2Lower]
Expand Down
44 changes: 27 additions & 17 deletions src/artisanlib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3175,31 +3175,31 @@ def __init__(self, parent:Optional[QWidget] = None, *, locale:str, WebEngineSupp
#MET
self.label2 = QLabel()
self.label2.setAlignment(Qt.AlignmentFlag.AlignBottom | Qt.AlignmentFlag.AlignRight)
self.label2.setText('<big><b>' + QApplication.translate('Label', 'ET') + '</b></big>')
self.label2.setText(f"<big><b>{QApplication.translate('Label', 'ET')}</b></big>")
self.setLabelColor(self.label2,QColor(self.qmc.palette['et']))
#BT
self.label3 = QLabel()
self.label3.setAlignment(Qt.AlignmentFlag.AlignBottom | Qt.AlignmentFlag.AlignRight)
self.label3.setText('<big><b>' + QApplication.translate('Label', 'BT') + '</b></big>')
self.label3.setText(f"<big><b>{QApplication.translate('Label', 'BT')}</b></big>")
self.setLabelColor(self.label3,QColor(self.qmc.palette['bt']))
#DELTA MET
self.label4 = QLabel()
self.label4.setAlignment(Qt.AlignmentFlag.AlignBottom | Qt.AlignmentFlag.AlignRight)
self.label4.setText(deltaLabelBigPrefix + QApplication.translate('Label', 'ET') + '</b></big>')
self.label4.setText(f"{deltaLabelBigPrefix}{QApplication.translate('Label', 'ET')}</b></big>")
self.setLabelColor(self.label4,QColor(self.qmc.palette['deltaet']))
# DELTA BT
self.label5 = QLabel()
self.label5.setAlignment(Qt.AlignmentFlag.AlignBottom | Qt.AlignmentFlag.AlignRight)
self.label5.setText(deltaLabelBigPrefix + QApplication.translate('Label', 'BT') + '</b></big>')
self.label5.setText(f"{deltaLabelBigPrefix}{QApplication.translate('Label', 'BT')}</b></big>")
self.setLabelColor(self.label5,QColor(self.qmc.palette['deltabt']))
# pid sv
self.label6 = QLabel()
self.label6.setAlignment(Qt.AlignmentFlag.AlignBottom | Qt.AlignmentFlag.AlignRight)
self.label6.setText('<big><b>' + QApplication.translate('Label', 'PID SV') + '</b></big>')
self.label6.setText(f"<big><b>{QApplication.translate('Label', 'PID SV')}</b></big>")
# pid power % duty cycle
self.label7 = QLabel()
self.label7.setAlignment(Qt.AlignmentFlag.AlignBottom | Qt.AlignmentFlag.AlignRight)
self.label7.setText('<big><b>' + QApplication.translate('Label', 'PID %') + '</b></big>')
self.label7.setText(f"<big><b>{QApplication.translate('Label', 'PID %')}</b></big>")

#extra LCDs
self.nLCDS: Final[int] = 10 # maximum number of LCDs and extra devices
Expand Down Expand Up @@ -4989,6 +4989,12 @@ def recentRoastsMenuList(self):
return [self.recentRoastLabel(rr) for rr in self.recentRoasts]

def establish_etypes(self):
# update ET/BT LCD label substitutions
self.label2.setText(f'<big><b>{self.ETname}</b></big>'.format(self.qmc.etypes[0],self.qmc.etypes[1],self.qmc.etypes[2],self.qmc.etypes[3]))
self.label3.setText(f'<big><b>{self.BTname}</b></big>'.format(self.qmc.etypes[0],self.qmc.etypes[1],self.qmc.etypes[2],self.qmc.etypes[3]))
# update ET/BT Delta LCD lable substitutions
self.label4.setText(f'{deltaLabelBigPrefix}{self.ETname}</b></big>'.format(self.qmc.etypes[0],self.qmc.etypes[1],self.qmc.etypes[2],self.qmc.etypes[3]))
self.label5.setText(f'{deltaLabelBigPrefix}{self.BTname}</b></big>'.format(self.qmc.etypes[0],self.qmc.etypes[1],self.qmc.etypes[2],self.qmc.etypes[3]))
# update extra LCD label substitutions
for i in range(len(self.qmc.extradevices)):
if i < len(self.qmc.extraname1):
Expand Down Expand Up @@ -16173,17 +16179,16 @@ def settingsLoad(self, filename=None, theme=False, machine=False, redraw=True):
self.qmc.eventsGraphflag = toInt(settings.value('eventsGraphflag',int(self.qmc.eventsGraphflag)))
if settings.contains('etypes'):
self.qmc.etypes = toStringList(settings.value('etypes',self.qmc.etypes))
# etype specified as empty strings are replaced by their defaults to enable translations in partially customized etypes
for i, name in enumerate(self.qmc.etypes):
if name == '':
self.qmc.etypes[i] = self.qmc.etypesdefault[i]
# update minieditor event type ComboBox
self.etypeComboBox.clear()
self.etypeComboBox.addItems(self.qmc.etypes)
else:
# etypes have not been saved in the setting to presever the translations, we have to reset those to their default
self.qmc.etypes = [
QApplication.translate('ComboBox', 'Air'),
QApplication.translate('ComboBox', 'Drum'),
QApplication.translate('ComboBox', 'Damper'),
QApplication.translate('ComboBox', 'Burner')
]
self.qmc.etypes = self.qmc.etypesdefault
self.qmc.eventsshowflag = toInt(settings.value('eventsshowflag',int(self.qmc.eventsshowflag)))
self.qmc.clampEvents = bool(toBool(settings.value('clampEvents',self.qmc.clampEvents)))
self.qmc.renderEventsDescr = bool(toBool(settings.value('renderEventsDescr',self.qmc.renderEventsDescr)))
Expand Down Expand Up @@ -16773,14 +16778,14 @@ def settingsLoad(self, filename=None, theme=False, machine=False, redraw=True):
self.qmc.graphfont = toInt(settings.value('graphfont',self.qmc.graphfont))
if settings.contains('ETname'):
self.ETname = settings.value('ETname')
self.label2.setText('<big><b>' + self.ETname + '</b></big>')
self.label4.setText(deltaLabelBigPrefix + self.ETname + '</b></big>')
self.label2.setText(f'<big><b>{self.ETname}</b></big>'.format(self.qmc.etypes[0],self.qmc.etypes[1],self.qmc.etypes[2],self.qmc.etypes[3]))
self.label4.setText(f'{deltaLabelBigPrefix}{self.ETname}</b></big>'.format(self.qmc.etypes[0],self.qmc.etypes[1],self.qmc.etypes[2],self.qmc.etypes[3]))
else:
self.ETname = QApplication.translate('Label', 'ET')
if settings.contains('BTname'):
self.BTname = settings.value('BTname')
self.label3.setText('<big><b>' + self.BTname + '</b></big>')
self.label5.setText(deltaLabelBigPrefix + self.BTname + '</b></big>')
self.label3.setText(f'<big><b>{self.BTname}</b></big>'.format(self.qmc.etypes[0],self.qmc.etypes[1],self.qmc.etypes[2],self.qmc.etypes[3]))
self.label5.setText(f'{deltaLabelBigPrefix}{self.BTname}</b></big>'.format(self.qmc.etypes[0],self.qmc.etypes[1],self.qmc.etypes[2],self.qmc.etypes[3]))
else:
self.BTname = QApplication.translate('Label', 'BT')
settings.endGroup()
Expand Down Expand Up @@ -18026,7 +18031,12 @@ def saveAllSettings(self, settings:QSettings, default_settings:Optional[Dict[str
(self.qmc.etypes[1] != QApplication.translate('ComboBox', 'Drum')) or
(self.qmc.etypes[2] != QApplication.translate('ComboBox', 'Damper')) or
(self.qmc.etypes[3] != QApplication.translate('ComboBox', 'Burner'))):
self.settingsSetValue(settings, default_settings, 'etypes',self.qmc.etypes, read_defaults)
etypes = self.qmc.etypes
if not read_defaults:
for i, _ in enumerate(self.qmc.etypes):
if self.qmc.etypes[i] == self.qmc.etypesdefault[i]:
etypes[i] = '' # we save empty strings for default event type names to ensure correct translation on re-loading those settings
self.settingsSetValue(settings, default_settings, 'etypes',etypes, read_defaults)
else:
settings.remove('etypes')
self.settingsSetValue(settings, default_settings, 'eventsshowflag',self.qmc.eventsshowflag, read_defaults)
Expand Down
33 changes: 26 additions & 7 deletions src/includes/Machines/Buehler/RM_20_Legacy.aset
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
[General]
Delay=1000
Oversampling=false
roastertype_setup=B\xfchler Roastmaster
roastertype_setup=B\xfchler RM 20 Legacy

[MachineSetup]
capacity=20

[Device]
id=79

[Style]
ETname=IT

[ExtraComm]
extrabaudrate=19200, 19200
extrabytesize=8, 8
Expand All @@ -15,17 +21,17 @@ extrastopbits=1, 1
extratimeout=1, 1

[ExtraDev]
extraCurveVisibility1=true, false, true, true, true, true, true, true, true, true
extraCurveVisibility1=false, false, true, true, true, true, true, true, true, true
extraCurveVisibility2=true, false, true, true, true, true, true, true, true, true
extraLCDvisibility1=true, true, false, false, false, false, false, false, false, false
extraLCDvisibility2=true, true, false, false, false, false, false, false, false, false
extradevicecolor1=black, black
extradevicecolor2=black, black
extradevicecolor1=#d27d1c, #49b260
extradevicecolor2=#333333, #45a6cf
extradevices=80, 81
extramathexpression1=,
extramathexpression2=,
extraname1=AT, Speed
extraname2=Drum, Air
extraname1=AT, {1}
extraname2=Pa, {0}

[S7]
PID_OFF_action=
Expand All @@ -47,6 +53,19 @@ port=102
rack=0
slot=1
start=16, 12, 32, 20, 8, 24, 0, 0, 0, 0
type=1, 1, 1, 1, 1, 1, 0, 0, 0, 0
type=1, 1, 1, 1, 2, 2, 0, 0, 0, 0
optimizer=true
fetch_max_blocks=true

[Sliders]
eventsliderunits=%, %, ,

[Quantifiers]
clusterEventsFlag=false
eventquantifierSV=0, 0, 0, 0
eventquantifieraction=0, 0, 0, 0
quantifieractive=1, 1, 0, 0
quantifiercoarse=0, 0, 0, 0
quantifiermax=100, 100, 100, 100
quantifiermin=0, 0, 0, 0
quantifiersource=5, 4, 0, 0
71 changes: 71 additions & 0 deletions src/includes/Machines/Buehler/RM_20_Playone.aset
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
[General]
Delay=1000
Oversampling=false
roastertype_setup=B\xfchler RM Playone

[MachineSetup]
capacity=20

[Device]
id=79

[Style]
ETname=IT

[ExtraComm]
extrabaudrate=19200, 19200
extrabytesize=8, 8
extracomport=COM1, COM1
extraparity=E, E
extrastopbits=1, 1
extratimeout=1, 1

[ExtraDev]
extraCurveVisibility1=false, false, true, true, true, true, true, true, true, true
extraCurveVisibility2=true, false, true, true, true, true, true, true, true, true
extraLCDvisibility1=true, true, false, false, false, false, false, false, false, false
extraLCDvisibility2=true, true, false, false, false, false, false, false, false, false
extradevicecolor1=#d27d1c, #49b260
extradevicecolor2=#333333, #45a6cf
extradevices=80, 81
extramathexpression1=,
extramathexpression2=,
extraname1=AT, {1}
extraname2=Pa, {0}

[S7]
PID_OFF_action=
PID_ON_action=
PID_SV_register=0
PID_area=0
PID_d_register=0
PID_db_nr=0
PID_i_register=0
PID_p_register=0
PIDmultiplier=0
SVmultiplier=0
area=6, 6, 6, 6, 6, 6, 0, 0, 0, 0
db_nr=1606, 1606, 1606, 1606, 1606, 1606, 1, 1, 1, 1
div=0, 0, 0, 0, 0, 0, 0, 0, 0, 0
host=192.168.1.10
mode=1, 1, 1, 0, 0, 0, 0, 0, 0, 0
port=102
rack=0
slot=1
start=240, 244, 252, 248,228, 232, 0, 0, 0, 0
type=1, 1, 1, 1, 2, 2, 0, 0, 0, 0
optimizer=true
fetch_max_blocks=true

[Sliders]
eventsliderunits=%, %, ,

[Quantifiers]
clusterEventsFlag=false
eventquantifierSV=0, 0, 0, 0
eventquantifieraction=0, 0, 0, 0
quantifieractive=1, 1, 0, 0
quantifiercoarse=0, 0, 0, 0
quantifiermax=100, 100, 100, 100
quantifiermin=0, 0, 0, 0
quantifiersource=5, 4, 0, 0
Loading

0 comments on commit 54b7b4b

Please sign in to comment.