예제 #1
0
    def __init__(self, dev, cmd, parentTask):
        ## make a few changes for compatibility with multiclamp
        if 'daqProtocol' not in cmd:
            cmd['daqProtocol'] = {}

        daqP = cmd['daqProtocol']

        if 'command' in cmd:
            if 'holding' in cmd:
                daqP['command'] = {
                    'command': cmd['command'],
                    'holding': cmd['holding']
                }
            else:
                daqP['command'] = {'command': cmd['command']}
        daqP['command']['lowLevelConf'] = {'mockFunc': self.write}

        cmd['daqProtocol']['primary'] = {
            'record': True,
            'lowLevelConf': {
                'mockFunc': self.read
            }
        }
        DAQGenericTask.__init__(self, dev, cmd['daqProtocol'], parentTask)

        self.cmd = cmd

        modPath = os.path.abspath(os.path.split(__file__)[0])
예제 #2
0
파일: Laser.py 프로젝트: neurodebian/acq4
    def __init__(self, dev, cmd, parentTask):
        self.cmd = cmd
        self.dev = dev ## this happens in DAQGeneric initialization, but we need it here too since it is used in making the waveforms that go into DaqGeneric.__init__
        if 'shutterMode' not in cmd:
            cmd['shutterMode'] = 'auto'
            
        ## create task structure to pass to daqGeneric, and retain a pointer to it here; DAQGeneric tasks will get filled in from LaserTask when self.configure() gets called
        cmd['daqProtocol'] = {}
        if 'shutter' in dev.config:
            cmd['daqProtocol']['shutter'] = {}
        if 'qSwitch' in dev.config:
            cmd['daqProtocol']['qSwitch'] = {}
        if 'pCell' in dev.config:
            cmd['daqProtocol']['pCell'] = {}
            
        #cmd['daqProtocol']['power'] = {}
        
        if cmd.get('alignMode', False):
            alignConfig = self.dev.config.get('alignmentMode', None)
            #if alignConfig is None:
            #    raise Exception("Laser alignment mode requested, but this laser has no 'alignmentMode' in its configuration.")
            if alignConfig is not None:
                if 'shutter' in alignConfig:
                    cmd['daqProtocol']['shutter']['preset'] = 1 if alignConfig['shutter'] else 0
                if 'qSwitch' in alignConfig:
                    cmd['daqProtocol']['qSwitch']['preset'] = 1 if alignConfig['qSwitch'] else 0
                if 'pCell' in alignConfig:
                    cmd['daqProtocol']['pCell']['preset'] = alignConfig['pCell']
                elif 'power' in alignConfig:
                    raise Exception("Alignment mode by power not implemented yet.")
                

        DAQGenericTask.__init__(self, dev, cmd['daqProtocol'], parentTask)
예제 #3
0
파일: Camera.py 프로젝트: travis-open/acq4
    def __init__(self, dev, cmd, parentTask):
        #print "Camera task:", cmd
        daqCmd = {}
        if 'channels' in cmd:
            daqCmd = cmd['channels']
        DAQGenericTask.__init__(self, dev, daqCmd, parentTask)

        self.__startOrder = [], []
        self.camCmd = cmd
        self.lock = Mutex()
        self.recordHandle = None
        self.stopAfter = False
        self.stoppedCam = False
        self.returnState = {}
        self.frames = []
        self.recording = False
        self.stopRecording = False
        self.resultObj = None
예제 #4
0
파일: Camera.py 프로젝트: hiuwo/acq4
 def __init__(self, dev, cmd, parentTask):
     #print "Camera task:", cmd
     daqCmd = {}
     if 'channels' in cmd:
         daqCmd = cmd['channels']
     DAQGenericTask.__init__(self, dev, daqCmd, parentTask)
     
     self.__startOrder = [], []
     self.camCmd = cmd
     self.lock = Mutex()
     self.recordHandle = None
     self.stopAfter = False
     self.stoppedCam = False
     self.returnState = {}
     self.frames = []
     self.recording = False
     self.stopRecording = False
     self.resultObj = None
예제 #5
0
    def __init__(self, dev, cmd, parentTask):
        ## make a few changes for compatibility with multiclamp        
        if 'daqProtocol' not in cmd:
            cmd['daqProtocol'] = {}
            
        daqP = cmd['daqProtocol']
            
        if 'command' in cmd:
            if 'holding' in cmd:
                daqP['command'] = {'command': cmd['command'], 'holding': cmd['holding']}
            else:
                daqP['command'] = {'command': cmd['command']}
        daqP['command']['lowLevelConf'] = {'mockFunc': self.write}
        
        
        cmd['daqProtocol']['primary'] = {'record': True, 'lowLevelConf': {'mockFunc': self.read}}
        DAQGenericTask.__init__(self, dev, cmd['daqProtocol'], parentTask)
        
        self.cmd = cmd

        modPath = os.path.abspath(os.path.split(__file__)[0])
예제 #6
0
파일: AxoPatch200.py 프로젝트: hiuwo/acq4
    def __init__(self, dev, cmd, parentTask):
        ## make a few changes for compatibility with multiclamp
        if "daqProtocol" not in cmd:
            cmd["daqProtocol"] = {}
        if "command" in cmd:
            if "holding" in cmd:
                cmd["daqProtocol"]["command"] = {"command": cmd["command"], "holding": cmd["holding"]}
            else:
                cmd["daqProtocol"]["command"] = {"command": cmd["command"]}

        ## Make sure we're recording from the correct secondary channel
        if dev.hasSecondaryChannel:
            if "mode" in cmd:
                mode = cmd["mode"]
            else:
                mode = dev.getMode()
            dev.reconfigureSecondaryChannel(mode)
            cmd["daqProtocol"]["secondary"] = {"record": True}

        cmd["daqProtocol"]["primary"] = {"record": True}
        DAQGenericTask.__init__(self, dev, cmd["daqProtocol"], parentTask)
        self.cmd = cmd
예제 #7
0
 def __init__(self, dev, cmd, parentTask):
     ## make a few changes for compatibility with multiclamp        
     if 'daqProtocol' not in cmd:
         cmd['daqProtocol'] = {}
     if 'command' in cmd:
         if 'holding' in cmd:
             cmd['daqProtocol']['command'] = {'command': cmd['command'], 'holding': cmd['holding']}
         else:
             cmd['daqProtocol']['command'] = {'command': cmd['command']}
 
     ## Make sure we're recording from the correct secondary channel
     if dev.hasSecondaryChannel:
         if 'mode' in cmd:
             mode = cmd['mode']
         else:
             mode = dev.getMode()
         dev.reconfigureSecondaryChannel(mode)
         cmd['daqProtocol']['secondary'] = {'record': True}
     
     
     cmd['daqProtocol']['primary'] = {'record': True}
     DAQGenericTask.__init__(self, dev, cmd['daqProtocol'], parentTask)
     self.cmd = cmd
예제 #8
0
 def __init__(self, dev, cmd, parentTask):
     ## make a few changes for compatibility with multiclamp        
     if 'daqProtocol' not in cmd:
         cmd['daqProtocol'] = {}
     if 'command' in cmd:
         if 'holding' in cmd:
             cmd['daqProtocol']['command'] = {'command': cmd['command'], 'holding': cmd['holding']}
         else:
             cmd['daqProtocol']['command'] = {'command': cmd['command']}
 
     ## Make sure we're recording from the correct secondary channel
     if dev.hasSecondaryChannel:
         if 'mode' in cmd:
             mode = cmd['mode']
         else:
             mode = dev.getMode()
         dev.reconfigureSecondaryChannel(mode)
         cmd['daqProtocol']['secondary'] = {'record': True}
     
     
     cmd['daqProtocol']['primary'] = {'record': True}
     DAQGenericTask.__init__(self, dev, cmd['daqProtocol'], parentTask)
     self.cmd = cmd
예제 #9
0
파일: Laser.py 프로젝트: reneurossance/acq4
    def __init__(self, dev, cmd, parentTask):
        self.cmd = cmd
        self.dev = dev  ## this happens in DAQGeneric initialization, but we need it here too since it is used in making the waveforms that go into DaqGeneric.__init__
        if 'shutterMode' not in cmd:
            cmd['shutterMode'] = 'auto'

        ## create task structure to pass to daqGeneric, and retain a pointer to it here; DAQGeneric tasks will get filled in from LaserTask when self.configure() gets called
        cmd['daqProtocol'] = {}
        if 'shutter' in dev.config:
            cmd['daqProtocol']['shutter'] = {}
        if 'qSwitch' in dev.config:
            cmd['daqProtocol']['qSwitch'] = {}
        if 'pCell' in dev.config:
            cmd['daqProtocol']['pCell'] = {}

        #cmd['daqProtocol']['power'] = {}

        if cmd.get('alignMode', False):
            alignConfig = self.dev.config.get('alignmentMode', None)
            #if alignConfig is None:
            #    raise Exception("Laser alignment mode requested, but this laser has no 'alignmentMode' in its configuration.")
            if alignConfig is not None:
                if 'shutter' in alignConfig:
                    cmd['daqProtocol']['shutter'][
                        'preset'] = 1 if alignConfig['shutter'] else 0
                if 'qSwitch' in alignConfig:
                    cmd['daqProtocol']['qSwitch'][
                        'preset'] = 1 if alignConfig['qSwitch'] else 0
                if 'pCell' in alignConfig:
                    cmd['daqProtocol']['pCell']['preset'] = alignConfig[
                        'pCell']
                elif 'power' in alignConfig:
                    raise Exception(
                        "Alignment mode by power not implemented yet.")

        DAQGenericTask.__init__(self, dev, cmd['daqProtocol'], parentTask)