Ejemplo n.º 1
0
def create(parent):
    GridLayoutFactory.swtDefaults().applyTo(parent)
    # Create icons
    resourceManager = UIResourceManager('au.gov.ansto.bragg.nbi.workbench',
                                        parent)
    image1 = resourceManager.createImage('icons/thread_view.gif')
    image2 = resourceManager.createImage('icons/hh1_16x16.png')
    image3 = resourceManager.createImage('icons/hh2_16x16.png')
    # Set background
    parent.setBackgroundImage(SharedImage.CRUISE_BG.getImage())
    # Create and configure widget
    deviceStatusWidget = DeviceStatusWidget(parent, SWT.NONE)
    deviceStatusWidget.setForeground(
        UIResources.getSystemColor(SWT.COLOR_WHITE))
    deviceStatusWidget\
        .addSeparator()\
        .addDevice('/sample/dummy_motor', 'Dummy Motor', image1)\
        .addSeparator()\
        .addDevice('/monitor/bm1_event_rate', 'Beam Monitor 1', image2)\
        .addDevice('/monitor/bm2_event_rate', 'Beam Monitor 2', image3)\
        .addSeparator()
    injectObject(deviceStatusWidget)
    # Set Layout
    GridDataFactory.swtDefaults().align(SWT.CENTER, SWT.CENTER)\
        .grab(True, True).hint(300, SWT.DEFAULT).applyTo(deviceStatusWidget)
Ejemplo n.º 2
0
def create(parent):
    GridLayoutFactory.swtDefaults().applyTo(parent)
    deviceStatusWidget = DeviceStatusWidget(parent, SWT.NONE)
    deviceStatusWidget\
        .addDevice('/experiment/title', 'Proposal')\
        .addSeparator()\
        .addDevice('/user/name', 'User')\
        .addDevice('/user/email', 'Email')\
        .addDevice('/user/phone', 'Phone')\
        .addSeparator()\
        .addDevice('/sample/name', 'Sample')
    injectObject(deviceStatusWidget)
    GridDataFactory.swtDefaults().align(SWT.CENTER, SWT.CENTER)\
        .grab(True, True).hint(300, SWT.DEFAULT).applyTo(deviceStatusWidget)
Ejemplo n.º 3
0
def create(parent):
    GridLayoutFactory.swtDefaults().applyTo(parent)
    # Set device to update every 5 sec
    global delayEventExecutor
    delayEventExecutor = ReducedDelayEventExecutor(5 * 1000).activate()
    # Create and configure widget
    deviceStatusWidget = DeviceStatusWidget(parent, SWT.NONE, widgetDisposed=dispose)
    deviceStatusWidget.setDelayEventExecutor(delayEventExecutor)
    deviceStatusWidget\
        .addSeparator()\
        .addDevice('/sample/dummy_motor', 'Dummy Motor')\
        .addSeparator()\
        .addDevice('/monitor/bm1_event_rate', 'Beam Monitor 1')\
        .addDevice('/monitor/bm2_event_rate', 'Beam Monitor 2')\
        .addSeparator()
    injectObject(deviceStatusWidget)
    # Set Layout
    GridDataFactory.swtDefaults().align(SWT.CENTER, SWT.CENTER)\
        .grab(True, True).hint(300, SWT.DEFAULT).applyTo(deviceStatusWidget)
Ejemplo n.º 4
0
def create(parent):
    GridLayoutFactory.swtDefaults().applyTo(parent)
    # Set device to update every 5 sec
    global delayEventExecutor
    delayEventExecutor = ReducedDelayEventExecutor(5 * 1000).activate()
    # Create and configure widget
    deviceStatusWidget = DeviceStatusWidget(parent,
                                            SWT.NONE,
                                            widgetDisposed=dispose)
    deviceStatusWidget.setDelayEventExecutor(delayEventExecutor)
    deviceStatusWidget\
        .addSeparator()\
        .addDevice('/sample/dummy_motor', 'Dummy Motor')\
        .addSeparator()\
        .addDevice('/monitor/bm1_event_rate', 'Beam Monitor 1')\
        .addDevice('/monitor/bm2_event_rate', 'Beam Monitor 2')\
        .addSeparator()
    injectObject(deviceStatusWidget)
    # Set Layout
    GridDataFactory.swtDefaults().align(SWT.CENTER, SWT.CENTER)\
        .grab(True, True).hint(300, SWT.DEFAULT).applyTo(deviceStatusWidget)
Ejemplo n.º 5
0
def create(parent):
    GridLayoutFactory.swtDefaults().applyTo(parent)
    # Create icons
    resourceManager = UIResourceManager('au.gov.ansto.bragg.nbi.workbench', parent)
    image1 = resourceManager.createImage('icons/thread_view.gif')
    image2 = resourceManager.createImage('icons/hh1_16x16.png')
    image3 = resourceManager.createImage('icons/hh2_16x16.png')
    # Set background
    parent.setBackgroundImage(SharedImage.CRUISE_BG.getImage())
    # Create and configure widget
    deviceStatusWidget = DeviceStatusWidget(parent, SWT.NONE)
    deviceStatusWidget.setForeground(UIResources.getSystemColor(SWT.COLOR_WHITE))
    deviceStatusWidget\
        .addSeparator()\
        .addDevice('/sample/dummy_motor', 'Dummy Motor', image1)\
        .addSeparator()\
        .addDevice('/monitor/bm1_event_rate', 'Beam Monitor 1', image2)\
        .addDevice('/monitor/bm2_event_rate', 'Beam Monitor 2', image3)\
        .addSeparator()
    injectObject(deviceStatusWidget)
    # Set Layout
    GridDataFactory.swtDefaults().align(SWT.CENTER, SWT.CENTER)\
        .grab(True, True).hint(300, SWT.DEFAULT).applyTo(deviceStatusWidget)
Ejemplo n.º 6
0
def create(parent):
    GridLayoutFactory.swtDefaults().applyTo(parent)
    shutterStatusWidget = ShutterStatusWidget(parent, SWT.NONE)
    injectObject(shutterStatusWidget)
    GridDataFactory.swtDefaults().align(SWT.CENTER, SWT.CENTER)\
        .grab(True, True).hint(200, 200).applyTo(shutterStatusWidget)