Skip to content

Commit

Permalink
- right-click EVENT input dialog remembers event type
Browse files Browse the repository at this point in the history
- a picked custom event can be removed using the backspace key
- adds quick keyboard focused event slider input using numeric keys followed by the ENTER/RETURN key. The last digit can be removed by using the backspace key.
- the quick custom event entry using the q, w, e and e key followed by number keys now requires the ENTER/RETURN key to establish the new value.  The last entered digit can be removed by using the backspace key.
- adds keyboard shortcut annotations to View menu entries (buttons, sliders, control, and readings)
  • Loading branch information
MAKOMO committed Feb 16, 2025
1 parent 44023bb commit d1cc6e7
Show file tree
Hide file tree
Showing 68 changed files with 40,885 additions and 40,467 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Version History
| [v3.0.0](https://github.com/artisan-roaster-scope/artisan/releases/tag/v3.0.0) | Aug&nbsp;1,&nbsp;2024 | Adds [roast scheduling](https://doc.artisan.plus/docs/schedule/) support<br><b>Release Sponsor: [artisan.plus](https://artisan.plus/)</b><br/> |
| [v2.10.4](https://github.com/artisan-roaster-scope/artisan/releases/tag/v2.10.4) | Mar&nbsp;21,&nbsp;2024 | Bug fixes |
| [v2.10.2](https://github.com/artisan-roaster-scope/artisan/releases/tag/v2.10.2) | Feb&nbsp;29,&nbsp;2024 | Adds support for machines from [Mill City Roasters](https://millcityroasters.com/), the [IKAWA PRO X](https://www.ikawacoffee.com/), the standard WinUSB driver for the [Aillio R1](https://aillio.com/) on Windows, the [Digi-Sense 20250-07 IR](https://www.coleparmer.com/i/digi-sense-ir-thermometer-thermocouple-probe-input-and-nist-traceable-calibration-30-1/2025007), and the [Extech 42570 IR](https://www.extech-online.com/index.php?main_page=product_info&cPath=78_21_35&products_id=99).<br>|
| [v2.10.0](https://github.com/artisan-roaster-scope/artisan/releases/tag/v2.10.0) | Nov&nbsp;28,&nbsp;2023 | Adds support for [Bühler Roastmaster](https://www.buhlergroup.com/global/de/products/roastmaster_coffeeroaster.html), [Joper](https://joper-roasters.com/), and [Cogen](https://cogen-company.com/) roasting machines, the Phidget [DAQ1000](https://phidgets.com/?prodid=622), [DAQ1200](https://phidgets.com/?prodid=623), [DAQ1300](https://phidgets.com/?prodid=624), [DAQ1301](https://phidgets.com/?prodid=625), AppleSilicon support to macOS build, a Raspbian Bookworm 64bit build, extra devices to [Roast Comparator](https://artisan-roasterscope.blogspot.com/2020/05/roast-comparator.html) and many performance and stability improvements.<br><b>Release Sponsor: [Paolo Scimone Coffee Consulting](https://www.paoloscimone.com/)</b><br/>|
| [v2.10.0](https://github.com/artisan-roaster-scope/artisan/releases/tag/v2.10.0) | Nov&nbsp;28,&nbsp;2023 | Adds support for [Bühler Roastmaster](https://www.buhlergroup.com/global/de/products/roastmaster_coffeeroaster.html), [Joper](https://joper-roasters.com/), and [Cogen](https://cogen-company.com/) roasting machines, the Phidget [DAQ1000](https://phidgets.com/?prodid=622), [DAQ1200](https://phidgets.com/?prodid=623), [DAQ1300](https://phidgets.com/?prodid=624), [DAQ1301](https://phidgets.com/?prodid=625), macOS AppleSilicon support, Raspbian Bookworm 64bit build, extra devices to [Roast Comparator](https://artisan-roasterscope.blogspot.com/2020/05/roast-comparator.html) and many performance and stability improvements.<br><b>Release Sponsor: [Paolo Scimone Coffee Consulting](https://www.paoloscimone.com/)</b><br/>|
| [v2.8.4](https://github.com/artisan-roaster-scope/artisan/releases/tag/v2.8.4) | Jun&nbsp;21,&nbsp;2023 | Adds official integration with [Kaleido](https://www.kaleido-roaster.com/) roasters as well as dark mode support on Windows and Linux (last version supporting macOS 11, but newer legacy builds still support macOS 10.13 and newer)<br><b>Release Sponsor: [BC Roasters](https://bcroasters.com/)</b><br/>|
| [v2.8.2](https://github.com/artisan-roaster-scope/artisan/releases/tag/v2.8.2) | Dec&nbsp;21,&nbsp;2022 | Adds support for [Sivetz fluid bed roasting machines](https://artisan-scope.org/machines/sivetz/), [Santoker Q Series and R Series roasters](https://artisan-scope.org/machines/santoker/), the [Yocto Watt module](https://artisan-scope.org/devices/yoctopuce/#Yocto-Watt), the [Phidget DAQ1500](https://artisan-scope.org/devices/phidgets/#DAQ1500), and speeds up the [Designer](https://artisan-roasterscope.blogspot.com/2019/05/using-artisan-designer.html) (last version supporting macOS 10.15, but legacy builds of v2.8 still supports macOS 10.13+) |
| [v2.8.0](https://github.com/artisan-roaster-scope/artisan/releases/tag/v2.8.0) | Oct&nbsp;21,&nbsp;2022 | Adds support for new [Besca models](https://artisan-scope.org/machines/besca/), [Diedrich DR machines](https://artisan-scope.org/machines/diedrich/), [Titanium Roasters](https://artisan-scope.org/machines/titanium/), Eurotherm variants of [San Franciscan machines](https://artisan-scope.org/machines/sf/), the [Plugin Roast 2.0 module](https://www.pluginroast.com.br/) and [CMS machines from Coffee Machines Sale](https://artisan-scope.org/machines/cms/), adds [Roast Comparator](https://artisan-roasterscope.blogspot.com/2020/05/roast-comparator.html) phases widget and auto time axis modes<br><b>Release Sponsor: [Coffee Machines Sales](https://cmsale.com/)</b><br/>|
Expand Down
Binary file modified doc/help_dialogs/Input_files/keyboardshortcuts.xlsx
Binary file not shown.
4 changes: 2 additions & 2 deletions doc/help_dialogs/Output_html/keyboardshortcuts_help.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@
</tr>
<tr>
<td>Q,W,E,R + &lt;value&gt;</td>
<td>Quick Special Event Entry. The keys q,w,e, and r correspond to special events 1,2,3 and 4. A two digit numeric value must follow the shortcut letter, e.g. &#39;q75&#39;, when the corresponding event slider max value is 100 or less (default setting). When the slider max value is greater than 100, three digits must be entered and for values less than 100 a leading zero is required, e.g. &#39;q075&#39;. </td>
<td>Quick Special Event Entry. The keys q,w,e, and r correspond to special events 1,2,3 and 4. The new &lt;value&gt; is established using the ENTER/RETURN key. The last digit can be removed by using the backspace key.</td>
</tr>
<tr>
<td>V + &lt;value&gt;</td>
<td>Quick PID SV Entry. Value is a three digit number. For values less than 100 must be entered with a leading zero, e.g. &#39;v075&#39;.</td>
<td>Quick PID SV Entry. The new &lt;value&gt; is established using the ENTER/RETURN key. The last digit can be removed by using the backspace key.</td>
</tr>
<tr>
<td>OPTION+B + &lt;value&gt; [Mac]<br>CTRL+SHIFT+B + &lt;value&gt; [Win]</td>
Expand Down
33 changes: 27 additions & 6 deletions src/artisanlib/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,13 @@ class tgraphcanvas(FigureCanvas):
'segmentpickflag', 'segmentdeltathreshold', 'segmentsamplesthreshold', 'stats_summary_rect', 'title_text', 'title_artist', 'title_width',
'background_title_width', 'xlabel_text', 'xlabel_artist', 'xlabel_width', 'lazyredraw_on_resize_timer', 'mathdictionary_base',
'ambient_pressure_sampled', 'ambient_humidity_sampled', 'ambientTemp_sampled', 'backgroundmovespeed', 'chargeTimerPeriod', 'flavors_default_value',
'fmt_data_ON', 'l_subtitle', 'projectDeltaFlag', 'btbreak_params','bbpCache', 'glow']
'fmt_data_ON', 'l_subtitle', 'projectDeltaFlag', 'btbreak_params','bbpCache', 'glow',
'custom_event_dlg_default_type', 'custom_event_dlg_default_type', 'foreground_event_ind' , 'foreground_event_pos', 'foreground_event_pick_position',
'plus_lockSchedule_sent_account', 'plus_lockSchedule_sent_date', 'specialeventplaybackramp',
'CO2kg_per_BTU_default', 'CO2kg_per_BTU', 'Biogas_CO2_Reduction', 'Biogas_CO2_Reduction_default',
'meterunitnames', 'meterreads_default', 'meterreads', 'meterlabels_setup', 'meterlabels', 'meterunits_setup', 'meterunits',
'meterfuels_setup', 'meterfuels', 'metersources_setup', 'metersources'
]


def __init__(self, parent:QWidget, dpi:int, locale:str, aw:'ApplicationWindow') -> None:
Expand Down Expand Up @@ -1143,6 +1149,7 @@ def __init__(self, parent:QWidget, dpi:int, locale:str, aw:'ApplicationWindow')
self.oncpick_cid = self.fig.canvas.mpl_connect('pick_event', cast('Callable[[Event],None]', self.onpick)) # incompatible type "Callable[[PickEvent], None]"; expected "Callable[[Event], Any] # type: ignore[arg-type]
self.ondraw_cid = self.fig.canvas.mpl_connect('draw_event', self._draw_event)

self.custom_event_dlg_default_type:int = 4 # the default type remembered by the customEventDlg on adding events via a right click on the graph
self.foreground_event_ind:Optional[int] = None # index of the currently moved event marker in self.specialevents
self.foreground_event_pos:Optional[int] = None # position of the currently moved event marker in its 2DLine.xdata() value array
self.foreground_event_pick_position:Optional[Tuple[float,float]] = None # pick position, as (x-time,y-value) tuple, of the currently moved event
Expand Down Expand Up @@ -3132,15 +3139,22 @@ def onrelease_after_pick(self, _event:'Event') -> None:
event_annos[self.foreground_event_pos].set_text(f'{firstletter}{secondletter}{thirdletter}')
# redraw
self.fileDirty()
self.fig.canvas.draw_idle()
if self.flagon:
self.redraw_keep_view(recomputeAllDeltas=False)
else:
self.fig.canvas.draw_idle()
except Exception as e: # pylint: disable=broad-except
_log.exception(e)
# reset the moved marker
if self.foreground_event_ind is not None:
# reset the picked marker after 2sec
QTimer.singleShot(2000,self.release_picked_event)
if self.legend is not None:
QTimer.singleShot(1,self.updateBackground)

def release_picked_event(self) -> None:
self.foreground_event_ind = None
self.foreground_event_pos = None
self.foreground_event_pick_position = None
if self.legend is not None:
QTimer.singleShot(1,self.updateBackground)

def onrelease(self, event:'Event') -> None: # NOTE: onrelease() is connected/disconnected in togglecrosslines()
event = cast('MouseEvent', event)
Expand Down Expand Up @@ -3480,12 +3494,13 @@ def event_popup_action(self, action:QAction) -> None:
else:
# add a special event at the current timepoint
from artisanlib.events import customEventDlg
dlg = customEventDlg(self.aw, self.aw, action.key[1], value=action.key[2]) # type: ignore[attr-defined] # "QAction" has no attribute "key"
dlg = customEventDlg(self.aw, self.aw, action.key[1], value=action.key[2], event_type=self.custom_event_dlg_default_type) # type: ignore[attr-defined] # "QAction" has no attribute "key"
if dlg.exec():
self.addEvent(action.key[1], # type: ignore[attr-defined] # "QAction" has no attribute "key" # absolute time index
dlg.type, # default: "--"
dlg.description,
dlg.value)
self.custom_event_dlg_default_type = dlg.type
self.aw.orderEvents()
self.fileDirtySignal.emit()
self.redraw_keep_view(recomputeAllDeltas=(action.key[0] in {0, 6})) # type: ignore[attr-defined] # "QAction" has no attribute "key" # on moving CHARGE or DROP, we have to recompute the Deltas
Expand Down Expand Up @@ -17609,6 +17624,12 @@ def addEvent(self, event_time_idx:int, event_type:int, event_description:str, ev
self.specialeventsStrings.append(event_description)
self.specialeventsvalue.append(event_value)

def deleteEvent(self, event_time_idx:int) -> None:
del self.specialevents[event_time_idx]
del self.specialeventstype[event_time_idx]
del self.specialeventsStrings[event_time_idx]
del self.specialeventsvalue[event_time_idx]

def setEvent(self, idx:int, event_time_idx:int, event_type:int, event_description:str, event_value:float) -> None:
if -1 < idx < len(self.specialevents):
self.specialevents[idx] = event_time_idx
Expand Down
Loading

0 comments on commit d1cc6e7

Please sign in to comment.