Skip to content

Commit 2e071ee

Browse files
committed
persistent Energy tab reporting mode
1 parent c9e4253 commit 2e071ee

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/artisanlib/canvas.py

+1
Original file line numberDiff line numberDiff line change
@@ -2308,6 +2308,7 @@ def __init__(self, parent:QWidget, dpi:int, locale:str, aw:'ApplicationWindow')
23082308
QApplication.translate('Label','Continuous'),
23092309
QApplication.translate('Label','Roast Event'),
23102310
QApplication.translate('Label','Meter')]
2311+
self.perKgRoastMode:bool = False # if true only the amount during the roast and not the full batch (incl. preheat and BBP) are displayed), toggled by click on the result widget
23112312

23122313
## working variables (stored in .alog profiles):
23132314
# Burners

src/artisanlib/main.py

+2
Original file line numberDiff line numberDiff line change
@@ -18213,6 +18213,7 @@ def settingsLoad(self, filename:Optional[str] = None, theme:bool = False, machin
1821318213
self.qmc.gasMix_setup = toInt(settings.value('gasMix_setup',self.qmc.gasMix_setup))
1821418214
self.qmc.energyresultunit_setup = toInt(settings.value('energyresultunit_setup',self.qmc.energyresultunit_setup))
1821518215
# self.qmc.energytablecolumnwidths = [toInt(x) for x in toList(settings.value("energytablecolumnwidths",self.qmc.energytablecolumnwidths))]
18216+
self.qmc.perKgRoastMode = toBool(settings.value('perKgRoastMode',self.qmc.perKgRoastMode))
1821618217
settings.endGroup()
1821718218
self.qmc.restoreEnergyLoadDefaults()
1821818219
self.qmc.restoreEnergyProtocolDefaults()
@@ -19979,6 +19980,7 @@ def saveAllSettings(self, settings:QSettings, default_settings:Optional[Dict[str
1997919980
self.settingsSetValue(settings, default_settings, 'electricEnergyMix_setup',self.qmc.electricEnergyMix_setup, read_defaults)
1998019981
self.settingsSetValue(settings, default_settings, 'gasMix_setup',self.qmc.gasMix_setup, read_defaults)
1998119982
self.settingsSetValue(settings, default_settings, 'energyresultunit_setup',self.qmc.energyresultunit_setup, read_defaults)
19983+
self.settingsSetValue(settings, default_settings, 'perKgRoastMode',self.qmc.perKgRoastMode, read_defaults)
1998219984
settings.endGroup()
1998319985
#--- END GROUP EnergyUse
1998419986

src/artisanlib/roast_properties.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,8 @@ def __init__(self, parent:QWidget, aw:'ApplicationWindow', activeTab:int = 0) ->
600600

601601
self.batcheditmode = False # a click to the batch label enables the batcheditmode
602602

603-
self.perKgRoastMode = False # if true only the amount during the roast and not the full batch (incl. preheat and BBP) are displayed), toggled by click on the result widget
603+
self.org_perKgRoastMode = self.aw.qmc.perKgRoastMode
604+
self.perKgRoastMode = self.aw.qmc.perKgRoastMode # if true only the amount during the roast and not the full batch (incl. preheat and BBP) are displayed), toggled by click on the result widget
604605

605606
self.acaia:'Optional[Acaia]' = None # the BLE interface # noqa: UP037
606607
self.scale_weight:Optional[float] = None # weight received from a connected scale
@@ -2555,6 +2556,8 @@ def closeEvent(self, _:Optional['QCloseEvent'] = None) -> None:
25552556
self.aw.qmc.weight = self.org_weight
25562557
self.aw.qmc.volume = self.org_volume
25572558

2559+
self.aw.qmc.perKgRoastMode = self.org_perKgRoastMode
2560+
25582561
self.aw.qmc.specialevents = self.org_specialevents
25592562
self.aw.qmc.specialeventstype = self.org_specialeventstype
25602563
self.aw.qmc.specialeventsStrings = self.org_specialeventsStrings
@@ -5266,6 +5269,8 @@ def accept(self) -> None:
52665269
self.aw.qmc.roastbatchnr = self.batchcounterSpinBox.value()
52675270
self.aw.qmc.roastbatchpos = self.batchposSpinBox.value()
52685271

5272+
self.aw.qmc.perKgRoastMode = self.perKgRoastMode
5273+
52695274
# if custom events were changed we clear the event flag position cache
52705275
if self.aw.qmc.specialevents != self.org_specialevents:
52715276
self.aw.qmc.l_event_flags_dict = {}

0 commit comments

Comments
 (0)