示例#1
0
 def traits_view(self):
     v = View(Readonly('level_production_name', label='Production'),
              Readonly('irradiation_tray', label='Irradiation Tray'),
              Readonly('monitor_age', label='Monitor Age'),
              Readonly('monitor_decay_constant', label='LambdaK Total'),
              VGroup(UItem('level_note', style='custom', editor=TextEditor(read_only=True)),
                     show_border=True, label='Note'))
     return v
示例#2
0
 def traits_view(self):
     v = View(VGroup(HGroup(UItem('enabled'), Readonly('name')),
                     VGroup(HGroup(Readonly('tag'),
                                   Readonly('period')),
                            HGroup(Readonly('last_time_str'),
                                   Readonly('last_value')),
                            VGroup(UItem('conditionals', editor=ListEditor(editor=InstanceEditor(),
                                                                           style='custom',
                                                                           mutable=False)),
                                   show_border=True,
                                   label='Conditionals'),
                            enabled_when='enabled')))
     return v
示例#3
0
    def traits_view(self):
        twodgrp = VGroup(HGroup(
            Item('color_map_name',
                 label='Color Map',
                 editor=EnumEditor(values=sorted(color_map_name_dict.keys()))),
            Item('levels')),
                         Item('model_kind'),
                         visible_when='plot_kind=="2D"')
        onedgrp = VGroup(Item('marker_size'), visible_when='plot_kind=="1D"')

        # ogrp = HGroup(Item('confirm_save',
        #                    label='Confirm Save', tooltip='Allow user to review evolutions '
        #                                                  'before saving to file'))
        grp = VGroup(Item('plot_kind'),
                     twodgrp,
                     onedgrp,
                     Item('selected_decay', label='Decay Const.'),
                     Readonly('lambda_k', label=u'Total \u03BB K'),
                     Item('monitor_age'),
                     Item('predicted_j_error_type', ),
                     Item('use_weighted_fit', ),
                     Item('monte_carlo_ntrials', ),
                     Item('use_monte_carlo', ),
                     label='Fits',
                     show_border=True)

        return self._make_view(grp)
 def traits_view(self):
     self.model.rescan_template_dir()
     plot_template_edit = ListStrEditor(selected="selected_plot_templates",
                                        multi_select=True,
                                        drag_move=False)
     delete_tooltip = "Deleting a template is irreversible."
     rescan_tooltip = "Rescanning the template directory will refresh " \
                      "the list of available templates."
     view = self.view_klass(VGroup(
         Spring(),
         Readonly('object.model.plot_template_directory'),
         Item('object.model.names',
              editor=plot_template_edit,
              label='Existing Plot Templates'),
         HGroup(
             Spring(),
             Item("delete_from_templates",
                  show_label=False,
                  tooltip=delete_tooltip,
                  enabled_when="is_selected"),
             Item("rescan_for_templates",
                  show_label=False,
                  tooltip=rescan_tooltip), Spring()),
         Spring(),
         show_border=True),
                            title="Manage plot templates...")
     return view
示例#5
0
    def traits_view(self):
        calc_grp = VGroup(
            Item('selected_decay', label='Flux Const.'),
            Readonly('lambda_k', label=u'Total \u03BB K'),
            Readonly('monitor_age'),
            BorderVGroup(
                Item('model_kind', label='Kind'),
                Item('error_kind', label='Mean J Error'),
                Item('predicted_j_error_type', label='Predicted J Error'),
                Item('use_weighted_fit'),
                Item('least_squares_fit',
                     visible_when='model_kind=="{}"'.format(LEAST_SQUARES_1D)),
                Item('one_d_axis',
                     label='Axis',
                     visible_when='model_kind in ("{}","{}")'.format(
                         LEAST_SQUARES_1D, WEIGHTED_MEAN_1D)),
                Item('n_neighbors',
                     label='N. Neighbors',
                     visible_when='model_kind == "{}"'.format(NN)),
                label='Model'),
            VGroup(
                HGroup(
                    Item('use_monte_carlo', label='Use'),
                    Item(
                        'monte_carlo_ntrials',
                        label='N. Trials',
                        tooltip=
                        'Number of trials to perform monte carlo simulation')),
                Item(
                    'position_error',
                    label='Position Error (Beta)',
                    tooltip=
                    'Set this value to the radius (same units as hole XY positions) of the '
                    'irradiation hole. '
                    'This is to test "monte carloing" the irradiation geometry'
                ),
                show_border=True,
                visible_when='model_kind not in ("{}", "{}", "{}")'.format(
                    MATCHING, BRACKETING, NN),
                label='Monte Carlo'),
            show_border=True,
            label='Calculations')

        grp = VGroup(Item('plot_kind'), calc_grp)

        return self._make_view(grp)
    def default_traits_view(self):
        """Default view containing both traits from the base class and
        any additional user-defined traits"""

        return View(
            Item('name',
                 object='model',
                 editor=EnumEditor(name='object._combobox_values')),
            Readonly('type', object='model'),
            Item('model', editor=InstanceEditor(), style='custom'))
示例#7
0
    def traits_view(self):
        gen_grp = VGroup(HGroup(Readonly('nruns', width=150, label='Total Runs'),
                                UReadonly('total_time')),
                         HGroup(Readonly('nruns_finished', width=150, label='Completed'),
                                UReadonly('elapsed')),
                         Readonly('remaining', label='Remaining'),
                         Readonly('etf', label='Est. finish'),
                         show_border=True, label='General')
        cur_grp = VGroup(Readonly('current_run_duration', ),
                         Readonly('run_elapsed'),
                         show_border=True,
                         label='Current')
        sel_grp = VGroup(Readonly('start_at'),
                         Readonly('end_at'),
                         Readonly('run_duration'),

                         label='Selection', show_border=True)
        v = View(VGroup(gen_grp, cur_grp, sel_grp))
        return v
示例#8
0
    def traits_view(self):
        transfer_grp = VGroup(Item('include_j',
                                   label='J',
                                   tooltip='Transfer J data'),
                              Item('include_note',
                                   label='Note',
                                   tooltip='Transfer Notes'),
                              label='Transfer',
                              show_border=True)

        v = okcancel_view(VGroup(
            Readonly('massspecname', label='Mass Spec DB Name'), transfer_grp,
            Item('forward_transfer', label='MassSpec to Pychron'),
            Item('auto_save',
                 tooltip='Automatically save transferred J to the database')),
                          title='Configure J Transfer')
        return v
    def traits_view(self):
        ideogram_grp = VGroup(UItem('ideogram_graph',
                                    visible_when='ideogram_visible',
                                    editor=ComponentEditor()),
                              label='Ideogram')

        spectrum_grp = VGroup(UItem('spectrum_graph',
                                    visible_when='spectrum_visible',
                                    editor=ComponentEditor()),
                              label='Spectrum')

        fmt = '%0.4f'
        age_grp = HGroup(Readonly('min_age', format_str=fmt, label='Min.'),
                         Readonly('max_age', format_str=fmt, label='Max.'),
                         Readonly(
                             'mean',
                             format_str=fmt,
                         ),
                         Readonly('weighted_mean',
                                  format_str=fmt,
                                  label='Wtd. Mean'),
                         label='Age',
                         show_border=True)

        mswd_grp = HGroup(
            Readonly('mswd', format_str=fmt, label='MSWD'),
            HGroup(Readonly('mswd_low', format_str=fmt, label='Low'),
                   Readonly('mswd_high', format_str=fmt, label='High'),
                   show_border=True,
                   label='Acceptable Range'))

        analyses_grp = UItem('analyses',
                             editor=TabularEditor(adapter=AnalysisAdapter()))

        stats_grp = VGroup(Readonly('n'),
                           analyses_grp,
                           age_grp,
                           mswd_grp,
                           label='Stats')

        vg = Tabbed(stats_grp, ideogram_grp, spectrum_grp)
        v = View(vg)
        return v
示例#10
0
 def traits_view(self):
     v = View(
         HGroup(Readonly('teststr', width=-200), Readonly('state'), spring))
     return v
示例#11
0
 def traits_view(self):
     v = View(VGroup(
         VGroup(Readonly('local_path'), Readonly('remote_path')),
         VGroup(UItem('image', editor=ImageEditor()))),
              title='Snapshot')
     return v
 def default_traits_view(self):
     """Returns a traits view with all visible UI objects. This is
     mainly used by the SurfactantContributedUI class"""
     return View(Readonly("name"), Readonly("mass"), Item("price"))
示例#13
0
    def traits_view(self):
        unk_cols = [
            column(klass=CheckboxColumn,
                   name='save',
                   label='Save',
                   editable=True,
                   width=30),
            column(name='hole_id', label='Hole'),
            column(name='identifier', label='Identifier'),
            column(name='sample', label='Sample', width=115),
            column(name='bracket_a',
                   editable=True,
                   label='Bracket A',
                   editor=EnumEditor(name='available_positions')),
            column(name='bracket_b',
                   editable=True,
                   label='Bracket B',
                   editor=EnumEditor(name='available_positions')),
            column(name='saved_j', label='Saved J', format_func=sciformat),
            column(name='saved_jerr',
                   label=PLUSMINUS_ONE_SIGMA,
                   format_func=sciformat),
            column(name='percent_saved_error', label='%', format_func=ff),
            column(name='j', label='Pred. J', format_func=sciformat, width=75),
            column(name='jerr',
                   format_func=sciformat,
                   label=PLUSMINUS_ONE_SIGMA,
                   width=75),
            column(name='percent_pred_error', label='%', format_func=ff),
            column(name='dev', label='dev', format='%0.2f', width=70)
        ]

        unk_editor = TableEditor(columns=unk_cols,
                                 sortable=False,
                                 reorderable=False)

        pgrp = VGroup(HGroup(UItem('monitor_positions', editor=MONITOR_EDITOR),
                             show_border=True,
                             label='Monitors'),
                      HGroup(UItem('unknown_positions', editor=unk_editor),
                             show_border=True,
                             label='Unknowns'),
                      label='Tables')

        tgrp = HGroup(
            UItem('recalculate_button'),
            Item('min_j', format_str='%0.4e', style='readonly',
                 label='Min. J'),
            Item('max_j', style='readonly', format_str='%0.4e',
                 label='Max. J'),
            Item('percent_j_change',
                 style='readonly',
                 format_func=floatfmt,
                 label='Delta J(%)'),
            Readonly('holder', label='Tray'),
            # Item('j_gradient',
            #      style='readonly',
            #      format_func=floatfmt,
            #      label='Gradient J(%/cm)'),
            spring,
            icon_button_editor('save_unknowns_button',
                               'dialog-ok-5',
                               tooltip='Toggle "save" for unknown positions'),
            icon_button_editor('save_all_button',
                               'dialog-ok-apply-5',
                               tooltip='Toggle "save" for all positions'))

        ggrp = UItem('graph', style='custom')
        v = View(VGroup(tgrp, Tabbed(ggrp, pgrp)))
        return v
示例#14
0
    def traits_view(self):
        cali_grp = VGroup(UItem(
            'tray_manager.calibrate',
            enabled_when='stage_manager.stage_map_name',
            editor=ButtonEditor(label_value='tray_manager.calibration_step')),
                          HGroup(
                              Readonly('tray_manager.x', format_str='%0.3f'),
                              Readonly('tray_manager.y', format_str='%0.3f')),
                          Readonly('tray_manager.rotation',
                                   format_str='%0.3f'),
                          Readonly('tray_manager.scale', format_str='%0.4f'),
                          Readonly('tray_manager.error', format_str='%0.2f'),
                          UItem('tray_manager.calibrator',
                                style='custom',
                                editor=InstanceEditor()),
                          CustomLabel('tray_manager.calibration_help',
                                      color='green',
                                      height=75,
                                      width=300),
                          show_border=True,
                          label='Calibration')

        # c_grp = VGroup(HGroup(Item('setpoint'),
        #                       UItem('setpoint_readback')),
        #                UItem('setpoint_readback',
        #                      enabled_when='0',
        #                      editor=RangeEditor(mode='slider',
        #                                         low_name='setpoint_readback_min',
        #                                         high_name='setpoint_readback_max')),
        #
        #                label='Controller', show_border=True)
        c_grp = VGroup(Item('setpoint'),
                       VGroup(UItem('setpoint_readback', editor=LCDEditor())),
                       label='Controller',
                       show_border=True)
        d_grp = VGroup(
            Item('stage_manager.calibrated_position_entry', label='Hole'),
            Item('stage_manager.sample_linear_holder.position',
                 editor=RangeEditor(
                     mode='slider',
                     low_name='stage_manager.sample_linear_holder.min_value',
                     high_name='stage_manager.sample_linear_holder.max_value',
                 )),
            HGroup(
                UItem('pane.dump_sample_button',
                      tooltip='Complete sample dumping procedure'),
                icon_button_editor('pane.funnel_up_button',
                                   'arrow_up',
                                   enabled_when='pane.funnel_up_enabled',
                                   editor_kw={'label': 'Funnel Up'}),
                icon_button_editor('pane.funnel_down_button',
                                   'arrow_down',
                                   enabled_when='pane.funnel_down_enabled',
                                   editor_kw={'label': 'Funnel Down'}),
                spring),
            UItem('dumper_canvas', editor=ComponentEditor()),
            # UItem('pane.lower_funnel_button', enabled_when='stage_manager.funnel.min_limit'),
            # UItem('pane.raise_funnel_button', enabled_when='stage_manager.funnel.max_limit'),
            label='Dumper',
            show_border=True)

        v = View(VGroup(c_grp, HGroup(Tabbed(d_grp, cali_grp))))
        return v