コード例 #1
0
 def build_list_of_monitors_from_names(self, monitor_names, is_surface):
     self.next_monitors_dict = dict()
     monitors_dict = get_ui_name_to_monitor_dict(is_surface)
     count = 0
     for monitor_name in monitor_names:
         monitor_vm = monitors_dict[monitor_name].__name__
         self.next_monitors_dict[monitor_vm] = count
         count = count + 1
コード例 #2
0
 def set_monitors_list_on_simulator(self, session_stored_simulator,
                                    monitor_names):
     self.build_list_of_monitors_from_names(
         monitor_names, session_stored_simulator.is_surface_simulation)
     monitor_dict = get_ui_name_to_monitor_dict(
         session_stored_simulator.is_surface_simulation)
     session_stored_simulator.monitors = list(monitor_dict[monitor]()
                                              for monitor in monitor_names)
コード例 #3
0
ファイル: simulator_fragments.py プロジェクト: yop0/tvb-root
    def __init__(self, prefix='', project_id=None, is_surface_simulation=False):
        super(SimulatorMonitorFragment, self).__init__(prefix, project_id)

        self.monitor_choices = get_ui_name_to_monitor_dict(is_surface_simulation)

        self.monitor = SimpleSelectField(choices=self.monitor_choices, form=self, name='monitor', required=True,
                                         label=Simulator.monitors.label, doc=Simulator.monitors.doc)
        self.monitor.template = "form_fields/select_field.html"
コード例 #4
0
    def __init__(self, is_surface_simulation=False):
        super(SimulatorMonitorFragment, self).__init__()
        self.monitor_choices = get_ui_name_to_monitor_dict(
            is_surface_simulation)
        self.is_surface_simulation = is_surface_simulation

        self.monitors = MultiSelectField(List(
            of=str,
            label='Monitors',
            choices=tuple(self.monitor_choices.keys())),
                                         name='monitors')
コード例 #5
0
    def __init__(self, prefix='', project_id=None):
        super(SimulatorMonitorFragment, self).__init__(prefix, project_id)

        self.monitor_choices = get_ui_name_to_monitor_dict()

        self.monitor = SimpleSelectField(choices=self.monitor_choices,
                                         form=self,
                                         name='monitor',
                                         required=True,
                                         label=Simulator.monitors.label,
                                         doc=Simulator.monitors.doc)
        self.monitor.template = "select_field.jinja2"
コード例 #6
0
    def __init__(self):
        self.next_monitors_dict = None
        self.all_monitors_dict = get_ui_name_to_monitor_dict(True)

        for ui_name, monitor_vm in self.all_monitors_dict.items():
            self.all_monitors_dict[ui_name] = monitor_vm()