示例#1
0
    def mount_sample_task(self):
        #items = self.get_selected_items()
        if self.beamline_setup_hwobj.diffractometer_hwobj.in_plate_mode():
            items = [self.plate_sample_to_mount]
        else:
            items = self.get_selected_items()

        if len(items) == 1:
            if not items[0].get_model().free_pin_mode:
                self.sample_centring_result = gevent.event.AsyncResult()
                try:
                    queue_entry.mount_sample(self.beamline_setup_hwobj,
                                             items[0], items[0].get_model(),
                                             self.centring_done,
                                             self.sample_centring_result)
                except Exception as e:
                    items[0].setText(1, "Error loading")
                    msg = "Error loading sample, please check" +\
                          " sample changer: " + str(e)
                    logging.getLogger("user_level_log").error(msg)
                finally:
                    self.enable_collect(True)
            else:
                logging.getLogger("user_level_log").\
                  info('Its not possible to mount samples in free pin mode')
示例#2
0
 def mount_sample_task(self):
     """
     Descript. :
     """
     items = self.get_selected_items()
     
     if len(items) == 1:
         if not items[0].get_model().free_pin_mode:
             self.sample_centring_result = gevent.event.AsyncResult()
             try:
                 print "mounttt 1"
                 if self.sample_mount_method == 1:
                     queue_entry.mount_sample(
                         self.beamline_setup_hwobj.sample_changer_one_hwobj, 
                         self.beamline_setup_hwobj,
                         items[0], items[0].get_model(), self.centring_done,
                         self.sample_centring_result)
                 elif self.sample_mount_method == 2:
                     queue_entry.mount_sample(
                         self.beamline_setup_hwobj.sample_changer_two_hwobj,   
                         self.beamline_setup_hwobj,
                         items[0], items[0].get_model(), self.centring_done,
                         self.sample_centring_result)
                 print "mounttt 2"
             except Exception as e:
                 items[0].setText(1, "Error loading")
                 msg = "Error loading sample, please check" +\
                       " sample changer: " + e.message
                 logging.getLogger("user_level_log").error(msg)
             finally:
                 self.enable_collect(True)
         else:
             logging.getLogger("user_level_log").\
               info('Its not possible to mount samples in free pin mode')
示例#3
0
    def mount_sample_task(self):
        # items = self.get_selected_items()
        if self.beamline_setup_hwobj.diffractometer_hwobj.in_plate_mode():
            items = [self.plate_sample_to_mount]
        else:
            items = self.get_selected_items()

        if len(items) == 1:
            if not items[0].get_model().free_pin_mode:
                self.sample_centring_result = gevent.event.AsyncResult()
                try:
                    queue_entry.mount_sample(
                        self.beamline_setup_hwobj,
                        items[0],
                        items[0].get_model(),
                        self.centring_done,
                        self.sample_centring_result,
                    )
                except Exception as e:
                    items[0].setText(1, "Error loading")
                    msg = (
                        "Error loading sample, please check"
                        + " sample changer: "
                        + str(e)
                    )
                    logging.getLogger("user_level_log").error(msg)
                finally:
                    self.enable_collect(True)
            else:
                logging.getLogger("user_level_log").info(
                    "Its not possible to mount samples in free pin mode"
                )
示例#4
0
    def mount_sample_task(self):
        """
        Descript. :
        """
        items = self.get_selected_items()

        if len(items) == 1:
            if not items[0].get_model().free_pin_mode:
                self.sample_centring_result = gevent.event.AsyncResult()
                try:
                    if self.sample_mount_method == 1:
                        queue_entry.mount_sample(
                            self.beamline_setup_hwobj.sample_changer_one_hwobj,
                            self.beamline_setup_hwobj, items[0],
                            items[0].get_model(), self.centring_done,
                            self.sample_centring_result)
                    elif self.sample_mount_method == 2:
                        queue_entry.mount_sample(
                            self.beamline_setup_hwobj.sample_changer_two_hwobj,
                            self.beamline_setup_hwobj, items[0],
                            items[0].get_model(), self.centring_done,
                            self.sample_centring_result)
                except Exception as e:
                    items[0].setText(1, "Error loading")
                    msg = "Error loading sample, please check" +\
                          " sample changer: " + e.message
                    logging.getLogger("user_level_log").error(msg)
                finally:
                    self.enable_collect(True)
            else:
                logging.getLogger("user_level_log").\
                  info('Its not possible to mount samples in free pin mode')