Skip to content

Commit

Permalink
Merge pull request #17 from TEParsons/main-nf-lumina
Browse files Browse the repository at this point in the history
NF: Add Lumina support
  • Loading branch information
TEParsons authored Nov 27, 2024
2 parents dcab357 + 144e751 commit 38704f0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
28 changes: 28 additions & 0 deletions psychopy_cedrus/components/lumina.py
Original file line number Diff line number Diff line change
@@ -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"
)
9 changes: 9 additions & 0 deletions psychopy_cedrus/lumina.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from psychopy_cedrus.base import BaseXidDevice, BaseXidButtonGroup, BaseXidPhotodiodeGroup, BaseXidVoiceKeyGroup


class LuminaDevice(BaseXidDevice):
productId = b"0"


class LuminaButtonGroup(BaseXidButtonGroup):
parentCls = LuminaDevice
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

0 comments on commit 38704f0

Please sign in to comment.