Ejemplo n.º 1
0
    def diff_analysis(self):
        self.debug("diff analysis")
        if not self.has_active_editor():
            return

        active_editor = self.active_editor
        if not isinstance(active_editor, RecallEditor):
            self.warning_dialog("Active tab must be a Recall tab")
            return

        left = active_editor.analysis

        recaller = self.application.get_service("pychron.mass_spec.mass_spec_recaller.MassSpecRecaller")
        if recaller is None:
            self.warning_dialog("Could not access MassSpec database")
            return

        if not recaller.connect():
            self.warning_dialog("Could not connect to MassSpec database. {}".format(recaller.db.datasource_url))
            return

        from pychron.pipeline.editors.diff_editor import DiffEditor

        editor = DiffEditor(recaller=recaller)
        # left.set_stored_value_states(True, save=True)

        if not left.check_has_n():
            left.load_raw_data(n_only=True)

        if editor.setup(left):
            editor.set_diff(left)
            self._open_editor(editor)
        else:
            self.warning_dialog("Failed to locate analysis {} in MassSpec database".format(left.record_id))
Ejemplo n.º 2
0
    def diff_analysis(self):
        self.debug('diff analysis')
        if not self.has_active_editor():
            return

        active_editor = self.active_editor
        if not isinstance(active_editor, RecallEditor):
            self.warning_dialog('Active tab must be a Recall tab')
            return

        left = active_editor.analysis

        recaller = self.application.get_service('pychron.mass_spec.mass_spec_recaller.MassSpecRecaller')
        if recaller is None:
            self.warning_dialog('Could not access MassSpec database')
            return

        if not recaller.connect():
            self.warning_dialog('Could not connect to MassSpec database. {}'.format(recaller.db.datasource_url))
            return

        from pychron.pipeline.editors.diff_editor import DiffEditor
        editor = DiffEditor(recaller=recaller)

        if not left.check_has_n():
            left.load_raw_data(n_only=True)

        if editor.setup(left):
            editor.set_diff(left)
            self._open_editor(editor)
        else:
            self.warning_dialog('Failed to locate analysis {} in MassSpec database'.format(left.record_id))
Ejemplo n.º 3
0
 def run(self, state):
     if state.unknowns:
         self.unknowns = state.unknowns
         self.recaller.connect()
         for left in state.unknowns:
             editor = DiffEditor(recaller=self.recaller)
             left.load_raw_data()
             if editor.setup(left):
                 editor.set_diff(left)
                 state.editors.append(editor)
Ejemplo n.º 4
0
 def run(self, state):
     if state.unknowns:
         self.unknowns = state.unknowns
         self.recaller.connect()
         for left in state.unknowns:
             editor = DiffEditor(recaller=self.recaller)
             left.load_raw_data()
             if editor.setup(left):
                 editor.set_diff(left)
                 state.editors.append(editor)