Beispiel #1
0
    def _update_cascade_selection(self):
        composite_model_name = self.modelSelection.currentText()
        cascade_models = list_cascade_models(composite_model_name)

        previous_cascade_selection = self.cascadeSelection.currentText()

        cascade_type_names = [
            get_meta_info('cascade_models', model)['cascade_type_name']
            for model in cascade_models
        ]

        self.cascadeSelection.clear()
        self.cascadeSelection.addItems(cascade_type_names)

        if previous_cascade_selection in cascade_type_names:
            self.cascadeSelection.setCurrentText(previous_cascade_selection)
        elif 'Cascade' in cascade_type_names:
            self.cascadeSelection.setCurrentText('Cascade')

        if not cascade_type_names:
            self.noCascades.setChecked(True)
            self._update_cascade_selection_possible()
            self.useCascades.setDisabled(True)
        else:
            self.useCascades.setEnabled(True)
            self.useCascades.setChecked(True)
            self._update_cascade_selection_possible()
Beispiel #2
0
def get_models_meta_info():
    """Get the meta information tags for all the models returned by get_models_list()

    Returns:
        dict of dict: The first dictionary indexes the model names to the meta tags, the second holds the meta
            information.
    """
    from mdt.lib.components import get_meta_info, get_component_list
    return {model: get_meta_info('composite_models', model) for model in get_component_list('composite_models')}
Beispiel #3
0
def get_models_meta_info():
    """Get the meta information tags for all the models returned by get_models_list()

    Returns:
        dict of dict: The first dictionary indexes the model names to the meta tags, the second holds the meta
            information.
    """
    from mdt.lib.components import list_cascade_models, list_composite_models, get_meta_info, get_component_list
    meta_info = {}
    for model_type in ('composite_models', 'cascade_models'):
        model_list = get_component_list(model_type)
        for model in model_list:
            meta_info.update({model: get_meta_info(model_type, model)})
    return meta_info