From e0ac4ed03f76b42524e0767268dc27c8015ef632 Mon Sep 17 00:00:00 2001 From: TEParsons Date: Wed, 27 Nov 2024 15:58:17 +0000 Subject: [PATCH 1/2] NF: Add Lumina support --- psychopy_cedrus/components/lumina.py | 28 ++++++++++++++++++++++++++++ psychopy_cedrus/lumina.py | 9 +++++++++ 2 files changed, 37 insertions(+) create mode 100644 psychopy_cedrus/components/lumina.py create mode 100644 psychopy_cedrus/lumina.py diff --git a/psychopy_cedrus/components/lumina.py b/psychopy_cedrus/components/lumina.py new file mode 100644 index 0000000..9576793 --- /dev/null +++ b/psychopy_cedrus/components/lumina.py @@ -0,0 +1,28 @@ +from psychopy.experiment.components.buttonBox import ButtonBoxComponent +from psychopy.experiment.plugins import DeviceBackend +from psychopy.localization import _translate +from . import util + + +class LuminaButtonBoxBackend(DeviceBackend): + key = "lumina" + label = _translate("Cedrus Lumina Series") + component = ButtonBoxComponent + deviceClasses = ["psychopy_cedrus.lumina.LuminaButtonGroup"] + + def getParams(self): + return util.getXidButtonBoxParams(key="lumina") + + def addRequirements(self: ButtonBoxComponent): + self.exp.requireImport( + importName="lumina", + importFrom="psychopy_cedrus" + ) + + def writeDeviceCode(self, buff): + return util.writeXidButtonBoxCode( + self, + buff, + cls="psychopy_cedrus.lumina.LuminaButtonGroup", + key="lumina" + ) \ No newline at end of file diff --git a/psychopy_cedrus/lumina.py b/psychopy_cedrus/lumina.py new file mode 100644 index 0000000..75ee2d0 --- /dev/null +++ b/psychopy_cedrus/lumina.py @@ -0,0 +1,9 @@ +from psychopy_cedrus.base import BaseXidDevice, BaseXidButtonGroup, BaseXidPhotodiodeGroup, BaseXidVoiceKeyGroup + + +class LuminaDevice(BaseXidDevice): + productId = b"0" + + +class LuminaButtonGroup(BaseXidButtonGroup): + parentCls = LuminaDevice From 144e751d37f5bb4153c76ffe8a8137202f58d71d Mon Sep 17 00:00:00 2001 From: TEParsons Date: Wed, 27 Nov 2024 16:05:19 +0000 Subject: [PATCH 2/2] FF: Add entry points for Lumina --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 82d1bb1..2a7a8d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,6 +58,7 @@ CedrusButtonBoxComponent = "psychopy_cedrus.components.cedrusBox:CedrusButtonBox RBButtonBoxBackend = "psychopy_cedrus.components.rb:RBButtonBoxBackend" RipondaButtonBoxBackend = "psychopy_cedrus.components.riponda:RipondaButtonBoxBackend" StimTrackerButtonBoxBackend = "psychopy_cedrus.components.stimtracker:StimTrackerButtonBoxBackend" +LuminaButtonBoxBackend = "psychopy_cedrus.components.lumina:LuminaButtonBoxBackend" # photodiode backends RBPhotodiodeValidatorBackend = "psychopy_cedrus.components.rb:RBPhotodiodeValidatorBackend" RipondaPhotodiodeValidatorBackend = "psychopy_cedrus.components.riponda:RipondaPhotodiodeValidatorBackend" @@ -79,3 +80,6 @@ StimTrackerDevice = "psychopy_cedrus.stimtracker:StimTrackerDevice" StimTrackerPhotodiodeGroup = "psychopy_cedrus.stimtracker:StimTrackerPhotodiodeGroup" StimTrackerButtonGroup = "psychopy_cedrus.stimtracker:StimTrackerButtonGroup" StimTrackerVoiceKey = "psychopy_cedrus.stimtracker:StimTrackerVoiceKeyGroup" +# Lumina series +LuminaDevice = "psychopy_cedrus.lumina:LuminaDevice" +LuminaButtonGroup = "psychopy_cedrus.lumina:LuminaButtonGroup"