@@ -47,21 +47,22 @@ def __init__(
4747 states_opto_ttls = None ,
4848 states_opto_stop = None ,
4949 states_mask_ttls = None ,
50+ use_zapit = False
5051 ):
5152 super ().__init__ (bpod )
5253 self .is_opto_stimulation = is_opto_stimulation
5354 self .states_opto_ttls = states_opto_ttls or []
5455 self .states_opto_stop = states_opto_stop or []
5556 self .states_mask_ttls = states_mask_ttls or []
57+ self .use_zapit = use_zapit
5658
5759 def add_state (self , ** kwargs ):
5860 if self .is_opto_stimulation :
5961 if kwargs ['state_name' ] in self .states_opto_ttls :
60- kwargs ['output_actions' ] += [
61- ('SoftCode' , SOFTCODE_FIRE_ZAPIT ),
62- ('BNC2' , 255 ),
63- ]
64- elif kwargs ['state_name' ] in self .states_opto_stop :
62+ kwargs ['output_actions' ] += [('BNC2' , 255 )]
63+ if self .use_zapit :
64+ kwargs ['output_actions' ] += [('SoftCode' , SOFTCODE_FIRE_ZAPIT )]
65+ elif kwargs ['state_name' ] in self .states_opto_stop and self .use_zapit :
6566 kwargs ['output_actions' ] += [('SoftCode' , SOFTCODE_STOP_ZAPIT )]
6667 if kwargs ['state_name' ] in self .states_mask_ttls :
6768 kwargs ['output_actions' ] += [
@@ -153,6 +154,7 @@ def _instantiate_state_machine(self, trial_number=None):
153154 states_opto_ttls = self .task_params ['OPTO_TTL_STATES' ],
154155 states_opto_stop = self .task_params ['OPTO_STOP_STATES' ],
155156 states_mask_ttls = self .task_params ['MASK_TTL_STATES' ],
157+ use_zapit = self .task_params ['USE_ZAPIT' ]
156158 )
157159
158160 @staticmethod
0 commit comments