Exemplo n.º 1
0
    def __init__(self, mm_px=0.2):
        super().__init__(name="stimulus/calibration_params")
        self.enabled = False

        self.mm_px = Param(mm_px)
        self.length_mm = Param(30., limits=(1, 800))
        self.length_px = Param(None)
        self.cam_to_proj = Param(None)
        self.proj_to_cam = Param(None)

        self.length_to_measure = "do not use the base class as a calibrator"

        self.sig_param_changed.connect(self.set_physical_scale)
Exemplo n.º 2
0
    def __init__(self):
        """
        Add standard parameters common to all kind of protocols.
        """
        try:
            assert len(self.__class__.name) > 0
        except AssertionError:
            raise ValueError("Protocol does not have a specified name")
        super().__init__(name="stimulus/protocol/" + self.__class__.name)

        self.pre_pause = Param(0.0, limits=(0.0, 10000.0))
        self.post_pause = Param(0.0, limits=(0.0, 10000.0))
        self.n_repeats = Param(1, limits=(1, 10000))
Exemplo n.º 3
0
 def __init__(self, *args, dh=80, r=1, **kwargs):
     super().__init__(*args, **kwargs)
     self.triangle_height = Param(dh, (2, 400))
     self.r = r
     self.length_px = dh * 2
     self.points = None
     self.points_cam = None
     self.length_to_measure = "longest side of the triangle"
Exemplo n.º 4
0
    def __init__(
        self,
        protocol_runner,
        calibrator,
        record_stim_framerate=None,
        gl=False,
        **kwargs
    ):
        """
        :param protocol_runner: ProtocolRunner object that handles the stim
        sequence.
        :param calibrator: Calibrator object
        :param record_stim_framerate: either None or the framerate at which
         the stimulus is to be recorded
        """
        super().__init__(
            name="stimulus/display_params", tree=protocol_runner.experiment.dc, **kwargs
        )
        self.setWindowTitle("Stytra stimulus display")

        # QOpenGLWidget is faster in painting complicated stimuli (but slower
        # with easy ones!) but does not allow stimulus recording. Therefore,
        # parent class for the StimDisplay window is created at runtime:

        if record_stim_framerate is not None or not gl:
            QWidgetClass = QWidget
        else:
            QWidgetClass = QOpenGLWidget

        StimDisplay = type("StimDisplay", (StimDisplayWidget, QWidgetClass), {})
        self.widget_display = StimDisplay(
            self,
            calibrator=calibrator,
            protocol_runner=protocol_runner,
            record_stim_framerate=record_stim_framerate,
        )
        self.widget_display.setMaximumSize(2000, 2000)

        self.pos = Param((0, 0))
        self.size = Param((400, 400))

        self.setStyleSheet("background-color:black;")
        self.sig_param_changed.connect(self.set_dims)
        self.set_dims()
Exemplo n.º 5
0
 def __init__(self):
     super().__init__()
     self.period_sec = Param(5.0)
     self.flash_duration = Param(2.0)