Exemple #1
0
    def new_analysis_series(self):
        from pychron.system_monitor.tasks.series_search_criteria import SearchCriteria


        kw = {'mass_spectrometer': self.connection.system_name,
              'mass_spectrometers': [ci.system_name for ci in self.connections],
              'analysis_type': 'Air',
              'analysis_types': ANALYSIS_MAPPING.values()}

        if self.active_editor and hasattr(self.active_editor, 'search_tool'):
            for attr in ('weeks', 'hours', 'limit', 'days'):
                kw[attr] = getattr(self.active_editor.search_tool, attr)

        sc = SearchCriteria(**kw)
        while 1:
            info = sc.edit_traits()
            if not info.result:
                break

            at = next((k for k, v in ANALYSIS_MAPPING.iteritems() if v == sc.analysis_type))
            at = next((k for k, v in SPECIAL_MAPPING.iteritems() if v == at))

            ans = self.manager.analysis_series(sc.mass_spectrometer,
                                               analysis_type=at,
                                               weeks=sc.weeks,
                                               days=sc.days,
                                               hours=sc.hours,
                                               limit=sc.limit)
            if ans:
                self.new_series(ans)
                break
            else:
                if not self.confirmation_dialog('No analyses found given the provided search criteria. Try Again?'):
                    break
    def new_analysis_series(self):
        from pychron.system_monitor.tasks.series_search_criteria import SearchCriteria

        kw = {
            "mass_spectrometer": self.connection.system_name,
            "mass_spectrometers": [ci.system_name for ci in self.connections],
            "analysis_type": "Air",
            "analysis_types": ANALYSIS_MAPPING.values(),
        }

        if self.active_editor and hasattr(self.active_editor, "search_tool"):
            for attr in ("weeks", "hours", "limit", "days"):
                kw[attr] = getattr(self.active_editor.search_tool, attr)

        sc = SearchCriteria(**kw)
        while 1:
            info = sc.edit_traits()
            if not info.result:
                break

            at = next((k for k, v in ANALYSIS_MAPPING.iteritems() if v == sc.analysis_type))
            at = next((k for k, v in SPECIAL_MAPPING.iteritems() if v == at))

            ans = self.manager.analysis_series(
                sc.mass_spectrometer, analysis_type=at, weeks=sc.weeks, days=sc.days, hours=sc.hours, limit=sc.limit
            )
            if ans:
                self.new_series(ans)
                break
            else:
                if not self.confirmation_dialog("No analyses found given the provided search criteria. Try Again?"):
                    break
Exemple #3
0
    def _analysis_types_default(self):
        from pychron.experiment.utilities.identifier import ANALYSIS_MAPPING

        return ANALYSIS_MAPPING.values()
Exemple #4
0
    def _analysis_types_default(self):
        from pychron.experiment.utilities.identifier import ANALYSIS_MAPPING

        return ANALYSIS_MAPPING.values()