Ejemplo n.º 1
0
 def link_to(self, logview):
     jsdlink((self.filter, 'value'), (logview, 'search_filter'))
     jsdlink((self.info, 'value'), (logview, 'filter_info'))
     jsdlink((self.warn, 'value'), (logview, 'filter_warning'))
     jsdlink((self.error, 'value'), (logview, 'filter_error'))
     jsdlink((self.debug, 'value'), (logview, 'filter_debug'))
     jsdlink((self.case, 'value'), (logview, 'case_sensitive'))
     self._logviews.append(logview)
Ejemplo n.º 2
0
    def __init__(self, *args, **kwargs):
        super(Heartbeat, self).__init__(*args,
                                        **kwargs)  # initializes traitlets

        self.pulseout = widgets.FloatText(value=time.time())  #发出脉冲
        self.pulsein = widgets.FloatText(value=time.time())  #读取引脚脉冲
        self.link = widgets.jsdlink((self.pulseout, 'value'),
                                    (self.pulsein, 'value'))
        self.start()
    def update(self):
        xl, xh = (widgets.IntSlider(description="Lower Bound Scaling",
                                    min=0,
                                    max=len(self.txs)-1,
                                    value=0,
                                    step=1.0),
                  widgets.IntSlider(description="Upper Bound Scaling",
                                    min=0,
                                    max=len(self.txs)-1,
                                    value=len(self.txs)-1,
                                    step=1.0))

        dl = widgets.jsdlink((xl, 'value'), (xh, 'min'))
        w = widgets.interact(self.plotting, xl=xl, xh=xh)
Ejemplo n.º 4
0
    def update(self):
        xl, xh = (widgets.IntSlider(description="Lower Bound Scaling",
                                    min=0,
                                    max=len(self.txs) - 1,
                                    value=0,
                                    step=1.0),
                  widgets.IntSlider(description="Upper Bound Scaling",
                                    min=0,
                                    max=len(self.txs) - 1,
                                    value=len(self.txs) - 1,
                                    step=1.0))

        dl = widgets.jsdlink((xl, 'value'), (xh, 'min'))
        w = widgets.interact(self.plotting, xl=xl, xh=xh)
Ejemplo n.º 5
0
    return jpeg_image

time.sleep(1)
traitlets.dlink((camera, 'value'), (image_widget, 'value'), transform=bgr8_to_jpeg)
traitlets.dlink((camera, 'value'), (target_widget, 'value'), transform=display_xy)

display(widgets.HBox([image_widget, target_widget]), x_slider, y_slider)
###############################################################################

###############################################################################
controller = widgets.Controller(index=0)
display(controller)
###############################################################################

### Connect Gamepad Controller to Label Images
widgets.jsdlink((controller.axes[0], 'value'), (x_slider, 'value'))
widgets.jsdlink((controller.axes[1], 'value'), (y_slider, 'value'))

###############################################################################
### Collect Data
DATASET_DIR = 'dataset_xy'
# we have this "try/except" statement because these next functions can throw an error if the directories exist already
try:
    os.makedirs(DATASET_DIR)
except FileExistsError:
    print('Directories not created becasue they already exist')

for b in controller.buttons:
    b.unobserve_all()

count_widget = widgets.IntText(description='count', value=len(glob.glob(os.path.join(DATASET_DIR, '*.jpg'))))