Ejemplo n.º 1
0
    def OnBSetAqProtocolButton(self, event):
        """Set the current protocol (GUI callback).
        
        See also: PYME.Acquire.Protocols."""
        from PYME.Acquire import protocol
        pDlg = wx.SingleChoiceDialog(self, '', 'Select Protocol',
                                     protocol.get_protocol_list())

        ret = pDlg.ShowModal()
        #print 'Protocol choice: ', ret, wx.ID_OK
        if ret == wx.ID_OK:
            pname = pDlg.GetStringSelection()
            self.spoolController.SetProtocol(pname)
            # do this after setProtocol so that an error in SetProtocol avoids setting the new name
            self.stAqProtocol.SetLabel(pname)

        pDlg.Destroy()
Ejemplo n.º 2
0
    def OnQueue(self, event=None):
        from PYME.Acquire.actions import FunctionAction
        from PYME.Acquire import protocol
        tile_protocols = [p for p in protocol.get_protocol_list() if 'tile' in p]

        dialog = wx.SingleChoiceDialog(self, '', 'Select Protocol', tile_protocols)

        ret = dialog.ShowModal()

        if ret != wx.ID_OK:
            dialog.Destroy()
            return
        
        protocol_name = dialog.GetStringSelection()
        dialog.Destroy()

        self._shame_index = 0

        x_spacing = float(self.x_spacing_mm.GetValue()) * 1e3  # [mm -> um]
        y_spacing = float(self.y_spacing_mm.GetValue()) * 1e3  # [mm -> um]
        n_x = int(self.n_x.GetValue())
        n_y = int(self.n_y.GetValue())
        nice = int(self.nice.GetValue())

        curr_pos = self.scope.GetPos()

        x_wells, y_wells, names = self._get_positions(n_x, n_y, x_spacing, y_spacing, curr_pos)
        x_wells, y_wells, names = self._pop_wells(x_wells, y_wells, names, self._drop_wells)
        actions = self._get_action_list(x_wells, y_wells, names, protocol_name)
        
        actions.append(FunctionAction('turnAllLasersOff', {}))

        if self.cb_get_it_done.GetValue():
            actions.append(FunctionAction('multiwellpanel.requeue_missed', 
                                          {'n_x': n_x, 'n_y': n_y,
                                           'x_spacing': x_spacing, 'y_spacing': y_spacing,
                                           'start_pos': curr_pos, 
                                           'protocol_name': protocol_name,
                                           'nice': nice}))

        self.scope.actions.queue_actions(actions, nice)