Beispiel #1
0
    def traits_view(self):
        led_grp = HGroup(
            UItem('enabled',
                  editor=LEDEditor(colors=['red', 'green']),
                  style='custom',
                  height=-35),
            UItem('enable', editor=ButtonEditor(label_value='enable_label')))

        status_grp = HGroup(
            spring,
            CustomLabel(
                'status_text',
                weight='bold',
                use_color_background=False,
                # bgcolor='transparent',
                color='orange',
                size=40),
            spring)
        request_grp = HGroup(
            Item('requested_power',
                 style='readonly',
                 format_str='%0.2f',
                 width=100), Spring(springy=False, width=50),
            UItem('units', style='readonly'), spring)

        v = View(
            VGroup(led_grp,
                   spring,
                   status_grp,
                   spring,
                   request_grp,
                   show_border=True))
        return v
Beispiel #2
0
 def traits_view(self):
     grp = VGroup(
         HGroup(
             Item('enabled_led', show_label=False,
                  style='custom', editor=LEDEditor()),
             button_editor('enable', 'enable_label'),
             spring),
         HGroup(
             Item('action_readback', width=100, style='readonly', label='Action'),
             Item('status_readback', style='readonly', label='Status')),
         HGroup(button_editor('fire_button', 'fire_label'),
                Item('mode', show_label=False),
                enabled_when='object.enabled and object.status_readback=="Laser On"'),
         HGroup(
             Item('burst_shot', label='N Burst', enabled_when='mode=="Burst"'),
             Item('reprate', label='Rep. Rate')),
         HGroup(
             Item('burst_readback', label='Burst Rem.', width=50, style='readonly'),
             Item('energy_readback', label='Energy (mJ)',
                  style='readonly', format_str='%0.2f'),
             Item('pressure_readback', label='Pressure (mbar)',
                  style='readonly', width=100, format_str='%0.1f'),
             spring,
             enabled_when='object.enabled'))
     v = View(grp)
     return v
    def traits_view(self):
        '''
        '''
        cparams = VGroup(
            HGroup(
                Item('led', show_label=False, editor=LEDEditor()),
                Item('server_button',
                     show_label=False,
                     editor=ButtonEditor(label_value='server_label'),
                     enabled_when='_connected'),
            ),
            Item('host', visible_when='not _running'),
            Item('port', visible_when='not _running'),
            show_border=True,
            label='Connection',
        )
        stats = Group(Item('packets_received', style='readonly'),
                      Item('cur_rpacket', label='Received', style='readonly'),
                      Item('packets_sent', style='readonly'),
                      Item('cur_spacket', label='Sent', style='readonly'),
                      Item('repeater_fails', style='readonly'),
                      Item('run_time', style='readonly'),
                      show_border=True,
                      label='Statistics',
                      visible_when='_connected')

        buttons = HGroup(Item('save', show_label=False, enabled_when='_dirty'))
        v = View(
            VGroup(cparams, stats, buttons),
            handler=RCSHandler,
        )
        return v
Beispiel #4
0
    def traits_view(self):
        pos_grp = VGroup(
            UItem('move_enabled_button'),
            VGroup(HGroup(
                Item('position'),
                UItem('object.stage_manager.stage_map_name',
                      editor=EnumEditor(
                          name='object.stage_manager.stage_map_names')),
                UItem('stage_stop_button')),
                   Item('x', editor=RangeEditor(low=-25.0, high=25.0)),
                   Item('y', editor=RangeEditor(low=-25.0, high=25.0)),
                   Item('z', editor=RangeEditor(low=-25.0, high=25.0)),
                   enabled_when='_move_enabled'),
            label='Positioning')

        calibration_grp = VGroup(
            UItem('tray_calibration.style',
                  enabled_when='not tray_calibration.isCalibrating()'),
            UItem('tray_calibration.calibrate',
                  editor=ButtonEditor(
                      label_value='tray_calibration.calibration_step')),
            HGroup(
                Item('tray_calibration.x',
                     format_str='%0.3f',
                     style='readonly'),
                Item('tray_calibration.y',
                     format_str='%0.3f',
                     style='readonly')),
            Item('tray_calibration.rotation',
                 format_str='%0.3f',
                 style='readonly'),
            Item('tray_calibration.scale',
                 format_str='%0.4f',
                 style='readonly'),
            Item('tray_calibration.error',
                 format_str='%0.2f',
                 style='readonly'),
            UItem('tray_calibration.calibrator',
                  style='custom',
                  editor=InstanceEditor()),
            CustomLabel('tray_calibration.calibration_help',
                        color='green',
                        height=75,
                        width=300),
            label='Tray Calibration')

        tgrp = Group(pos_grp, calibration_grp, layout='tabbed')

        egrp = HGroup(
            UItem('enabled_led', editor=LEDEditor()),
            UItem('enable', editor=ButtonEditor(label_value='enable_label')),
            UItem('fire_laser_button', enabled_when='enabled'),
            Item('output_power', label='Power'), UItem('units'), spring,
            icon_button_editor('snapshot_button', 'camera'),
            icon_button_editor('test_connection_button',
                               'connect',
                               tooltip='Test Connection'))
        v = View(VGroup(egrp, tgrp))
        return v
Beispiel #5
0
 def traits_view(self):
     """
     """
     v = View('path',
              HGroup(Item('led', editor=LEDEditor(), show_label=False),
                     Item('test', show_label=False)),
              handler=CRHandler)
     return v
Beispiel #6
0
    def traits_view(self):
        cancel_tt = '''Cancel current run and continue to next run'''
        stop_tt = '''Cancel current run and stop queue'''
        start_tt = '''Start current experiment queue. 
Will continue to next opened queue when completed'''
        truncate_tt = '''Stop the current measurement process and continue to 
the next step in the measurement script'''
        truncate_style_tt = '''Normal= measure_iteration stopped at current step
    script continues
Quick=   measure_iteration stopped at current step
    script continues using abbreviated_count_ratio*counts'''
        end_tt = '''Stop the queue and the end of the current run'''

        schedule_tt = '''Set a scheduled start time'''

        v = View(
            HGroup(
                UItem('alive',
                      editor=LEDEditor(colors=['red', 'green'], radius=30)),
                spacer(-20),
                icon_button_editor('pane.start_button',
                                   'start',
                                   enabled_when='can_start',
                                   tooltip=start_tt),
                icon_button_editor('pane.configure_scheduled_button',
                                   'calendar',
                                   enabled_when='can_start',
                                   tooltip=schedule_tt),
                icon_button_editor('pane.stop_button',
                                   'stop',
                                   enabled_when='not can_start',
                                   tooltip=stop_tt),
                spacer(-20),
                Item('end_at_run_completion',
                     label='Stop at Completion',
                     tooltip=end_tt),
                spacer(-20),
                icon_button_editor(
                    'pane.abort_run_button',
                    'cancel',
                    # enabled_when='can_cancel',
                    tooltip=cancel_tt),
                spacer(-20),
                icon_button_editor('pane.truncate_button',
                                   'lightning',
                                   enabled_when='measuring',
                                   tooltip=truncate_tt),
                UItem('truncate_style',
                      enabled_when='measuring',
                      tooltip=truncate_style_tt),
                UItem('pane.show_conditionals_button'),
                spacer(-75),
                CustomLabel('object.experiment_status.label',
                            color_name='object.experiment_status.color',
                            size=24,
                            weight='bold'),
                spring))
        return v
    def traits_view(self):
        c_grp = VGroup(HGroup(Item('setpoint'),
                              UItem('water_flow_led', editor=LEDEditor(label='H2O Flow')),
                              spring, icon_button_editor('pane.disable_button', 'cancel')),
                       VGroup(UItem('temperature_readback', editor=LCDEditor(width=100, height=50))),
                       label='Controller', show_border=True)

        v = View(c_grp)
        return v
Beispiel #8
0
 def simple_view(self):
     v = View(
         HGroup(
             Item('led', editor=LEDEditor(), show_label=False),
             Item('target_name',
                  style='readonly',
                  width=100,
                  show_label=False)))
     return v
Beispiel #9
0
 def traits_view(self):
     v = View(
         HGroup(
             Item('led',
                  editor=LEDEditor(),
                  show_label=False,
                  style='custom'),
             Item('flow_button',
                  show_label=False,
                  editor=ButtonEditor(label_value='flow_label')),
             Spring(springy=False, width=20),
             CustomLabel('message', color='maroon', size=14, springy=True)))
     return v
Beispiel #10
0
 def traits_view(self):
     v = View(
         Item('test_connection_button', show_label=False),
         HGroup(
             UItem('enabled_led', editor=LEDEditor()),
             UItem('enable',
                   editor=ButtonEditor(label_value='enable_label'))),
         Item('position'),
         Item('x', editor=RangeEditor(low=-25.0, high=25.0)),
         Item('y', editor=RangeEditor(low=-25.0, high=25.0)),
         Item('z', editor=RangeEditor(low=-25.0, high=25.0)),
     )
     return v
Beispiel #11
0
 def traits_view(self):
     v = View(
         VGroup(HGroup(
             UItem('enabled_led',
                   editor=LEDEditor(),
                   style='custom',
                   height=-35),
             UItem('enable',
                   editor=ButtonEditor(label_value='enable_label'))),
                HGroup(
                    Item('requested_power',
                         style='readonly',
                         format_str='%0.2f',
                         width=100), Spring(springy=False, width=50),
                    UItem('units', style='readonly'), spring),
                show_border=True))
     return v
Beispiel #12
0
    def traits_view(self):
        pos_grp = VGroup(
            UItem('move_enabled_button'),
            VGroup(HGroup(
                Item('position'),
                UItem('object.stage_manager.stage_map_name',
                      editor=EnumEditor(
                          name='object.stage_manager.stage_map_names')),
                UItem('stage_stop_button')),
                   Item('x', editor=RangeEditor(low=-25.0, high=25.0)),
                   Item('y', editor=RangeEditor(low=-25.0, high=25.0)),
                   Item('z', editor=RangeEditor(low=-25.0, high=25.0)),
                   enabled_when='_move_enabled'),
            label='Positioning')

        # ogrp = Group(UItem('optics_client', style='custom'),
        #              label='Optics')
        # cgrp = Group(UItem('controls_client', style='custom'),
        #              defined_when='controls_client',
        #              label='Controls')

        tgrp = Group(
            # cgrp,
            # ogrp,
            pos_grp,
            layout='tabbed')

        egrp = HGroup(
            UItem('enabled_led', editor=LEDEditor()),
            UItem('enable', editor=ButtonEditor(label_value='enable_label')),
            UItem('fire_laser_button', enabled_when='enabled'),
            Item('output_power', label='Power'), UItem('units'), spring,
            icon_button_editor('snapshot_button', 'camera'),
            icon_button_editor('test_connection_button',
                               'connect',
                               tooltip='Test Connection'))
        v = View(VGroup(egrp, tgrp))
        return v
Beispiel #13
0
    def traits_view(self):
        pos_grp = VGroup(HGroup(Item('position'),
                                Item('use_autocenter', label='Autocenter')),
                         Item('x', editor=RangeEditor(low=-25.0, high=25.0)),
                         Item('y', editor=RangeEditor(low=-25.0, high=25.0)),
                         Item('z', editor=RangeEditor(low=-25.0, high=25.0)),
                         label='Positioning')

        ogrp = Group(UItem('optics_client', style='custom'), label='Optics')
        cgrp = Group(UItem('controls_client', style='custom'),
                     defined_when='controls_client',
                     label='Controls')

        tgrp = Group(
            cgrp,
            ogrp,
            #cgrp,
            pos_grp,
            layout='tabbed')

        #add_grp = self._get_additional_grp()
        #if add_grp:
        #    pos_grp.label = 'Positioning'
        #    tgrp = Group(pos_grp, add_grp,pos_grp, layout='tabbed')
        #else:
        #    tgrp = pos_grp

        egrp = HGroup(
            UItem('enabled_led', editor=LEDEditor()),
            UItem('enable', editor=ButtonEditor(label_value='enable_label')),
            spring,
            icon_button_editor('test_connection_button',
                               'connect',
                               tooltip='Test Connection'),
        )
        v = View(VGroup(egrp, tgrp))
        return v
Beispiel #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('water_flow_led', editor=LEDEditor(label='H2O Flow')),
                              spring, icon_button_editor('pane.disable_button', 'cancel')),
                       VGroup(UItem('temperature_readback', editor=LCDEditor())),
                       label='Controller', show_border=True)

        feeder_grp = VGroup(HGroup(Item('stage_manager.calibrated_position_entry', label='Hole'),
                                   icon_button_editor('pane.toggle_advanced_view_button', 'cog')),
                            VGroup(Item('stage_manager.feeder.position', label='Position (units)'),
                                   Item('stage_manager.feeder.velocity'),
                                   Item('pane.feeder_set_home_button'),
                                   HGroup(icon_button_editor('pane.feeder_slew_positive', 'arrow_left'),
                                          icon_button_editor('pane.feeder_slew_negative', 'arrow_right'),
                                          icon_button_editor('pane.feeder_stop_button', 'cancel')),
                                   visible_when='pane._advanced_view_state'),
                            show_border=True, label='Position')

        funnel_grp = VGroup(HGroup(icon_button_editor('pane.funnel_up_button', 'arrow_up',
                                                      enabled_when='funnel_up_enabled', tooltip='Raise Funnel'),
                                   icon_button_editor('pane.funnel_down_button', 'arrow_down', tooltip='Lower Funnel',
                                                      enabled_when='funnel_down_enabled')),
                            show_border=True, label='Funnel')
        jitter_grp = HGroup(UItem('pane.jitter_button', editor=ButtonEditor(label_value='pane.jitter_label')),
                            icon_button_editor('pane.configure_jitter_button', 'cog', tooltip='Configure Jitter'),
                            show_border=True, label='Jitter')

        dump_grp = HGroup(UItem('pane.dump_sample_button',
                                tooltip='Complete sample dumping procedure'),
                          UItem('pane.fire_magnets_button',
                                enabled_when='not magnets_firing',
                                tooltip='Execute the magnet sequence'),
                          show_border=True, label='Dump')

        d1 = VGroup(feeder_grp, funnel_grp, jitter_grp, dump_grp)
        d2 = VGroup(
            # UItem('pane.refresh_states_button'),
            UItem('dumper_canvas', editor=ComponentEditor()))
        d_grp = HGroup(d1, d2, label='Dumper', show_border=True)

        v_grp = VGroup(UItem('video_canvas', editor=VideoComponentEditor()),
                       visible_when='video_enabled',
                       label='Camera')

        g_grp = VGroup(Item('graph_scan_width', label='Scan Width (mins)'),
                       HGroup(Item('graph_scale', label='Scale'),
                              Item('graph_y_auto', label='Autoscale Y'),
                              Item('graph_ymax', label='Max', format_str='%0.3f', enabled_when='not graph_y_auto'),
                              Item('graph_ymin', label='Min', format_str='%0.3f', enabled_when='not graph_y_auto')),
                       HGroup(icon_button_editor('clear_button', 'clear',
                                                 tooltip='Clear and reset graph'), spring),
                       HGroup(icon_button_editor('start_record_button', 'media-record',
                                                 tooltip='Start recording',
                                                 enabled_when='not _recording'),
                              icon_button_editor('stop_record_button',
                                                 'media-playback-stop',
                                                 tooltip='Stop recording',
                                                 enabled_when='_recording'),
                              icon_button_editor('add_marker_button', 'flag',
                                                 enabled_when='_recording'),
                              show_border=True,
                              label='Record Scan'),
                       HGroup(icon_button_editor('snapshot_button', 'camera'),
                              show_border=True, label='Snapshot', ),
                       label='Graph')
        v = View(VGroup(c_grp,
                        HGroup(Tabbed(d_grp, v_grp, g_grp))))
        return v