Beispiel #1
0
    def __init__(self, parent=None):
        self.btnFade = OptionButton()
        self.btnFade.setText("Fade")
        self.btnFade.setIcon(QIcon(":icons/preferences-desktop-screensaver"))

        self.btnOverlay = OptionButton()
        self.btnOverlay.setText("Overlay")
        self.btnOverlay.setIcon(QIcon(":icons/preferences-system-windows"))

        super(EclipseWidget, self).__init__(parent)
    def _modeControls(self):
        layout = QVBoxLayout()
        layout.addWidget(TitleLabel("Lighting Mode"))

        normal = OptionButton()
        normal.setText("Normal")
        _safelyConnect(normal.clicked, lambda: self.lights.execute("goto default"))
        layout.addWidget(normal)

        late = OptionButton()
        late.setText("8.15 Service")
        _safelyConnect(late.clicked, lambda: self.lights.execute("Goto 8:15"))
        layout.addWidget(late)

        test = OptionButton()
        test.setText("Test (All @50%)")
        _safelyConnect(test.clicked, lambda: self.lights.activate("St Aldate's.Section Zero.All at 50"))
        layout.addWidget(test)

        self.modes = QButtonGroup()
        self.modes.addButton(normal, 1)
        self.modes.addButton(late, 2)
        self.modes.addButton(test, 3)

        return layout
    def _welcomeAreaControls(self):
        def onOff(presetString):
            @handlePyroErrors
            def inner(isOn):
                if isOn:
                    self.lights.activate(presetString)
                else:
                    self.lights.deactivate(presetString)
            return inner

        layout = QHBoxLayout()

        gallery_ext = QVBoxLayout()

        gallery_ext.addWidget(TitleLabel("Gallery and External"))

        gallery = ExpandingButton()
        gallery.setText("Gallery")
        gallery.setCheckable(True)
        gallery.toggled.connect(onOff("St Aldate's.Welcome Area.gall on"))
        gallery_ext.addWidget(gallery)

        external = ExpandingButton()
        external.setText("External Lights")
        external.setCheckable(True)
        external.toggled.connect(onOff("EXTERIOR.Section Zero.ENTRA ONLY ON"))
        gallery_ext.addWidget(external)

        layout.addLayout(gallery_ext)

        welcomeArea = QVBoxLayout()

        welcomeArea.addWidget(TitleLabel("Welcome Area"))

        full = OptionButton()
        full.setText("100%")
        _safelyConnect(full.clicked, lambda: self.lights.activate("St Aldate's.Welcome Area.Welcome100%"))
        welcomeArea.addWidget(full)

        std = OptionButton()
        std.setText("70%")
        _safelyConnect(std.clicked, lambda: self.lights.activate("St Aldate's.Welcome Area.Welcome70%"))
        welcomeArea.addWidget(std)

        off = OptionButton()
        off.setText("Off")
        _safelyConnect(off.clicked, lambda: self.lights.activate("St Aldate's.Welcome Area.Ent&GalOFF"))
        welcomeArea.addWidget(off)

        self.welcomeArea = QButtonGroup()
        self.welcomeArea.addButton(full, 1)
        self.welcomeArea.addButton(std, 2)
        self.welcomeArea.addButton(off, 3)

        layout.addLayout(welcomeArea)

        return layout
Beispiel #4
0
    def __init__(self, parent=None):
        super(OverscanFreezeWidget, self).__init__(parent)

        self.btnOverscan = OptionButton()
        self.btnOverscan.setText("Overscan")
        self.btnOverscan.setChecked(True)
        self.btnOverscan.setIcon(QIcon(":icons/view-fullscreen"))

        self.btnFreeze = OptionButton()
        self.btnFreeze.setText("Freeze")
        self.btnFreeze.setIcon(QIcon(":icons/media-playback-pause"))

        self.layout()
Beispiel #5
0
class OverscanFreezeWidget(QWidget):

    def __init__(self, parent=None):
        super(OverscanFreezeWidget, self).__init__(parent)

        self.btnOverscan = OptionButton()
        self.btnOverscan.setText("Overscan")
        self.btnOverscan.setChecked(True)
        self.btnOverscan.setIcon(QIcon(":icons/view-fullscreen"))

        self.btnFreeze = OptionButton()
        self.btnFreeze.setText("Freeze")
        self.btnFreeze.setIcon(QIcon(":icons/media-playback-pause"))

        self.layout()

    def layout(self):
        layout = QVBoxLayout()
        layout.addWidget(self.btnOverscan)
        layout.addWidget(self.btnFreeze)

        self.setLayout(layout)
Beispiel #6
0
class EclipseWidget(OverscanFreezeWidget):

    def __init__(self, parent=None):
        self.btnFade = OptionButton()
        self.btnFade.setText("Fade")
        self.btnFade.setIcon(QIcon(":icons/preferences-desktop-screensaver"))

        self.btnOverlay = OptionButton()
        self.btnOverlay.setText("Overlay")
        self.btnOverlay.setIcon(QIcon(":icons/preferences-system-windows"))

        super(EclipseWidget, self).__init__(parent)

    def layout(self):
        layout = QGridLayout()
        layout.addWidget(self.btnOverlay, 0, 0)
        layout.addWidget(self.btnOverscan, 0, 1)
        layout.addWidget(self.btnFreeze, 1, 0)
        layout.addWidget(self.btnFade, 1, 1)
        self.setLayout(layout)
Beispiel #7
0
    def makeContent(self):
        layout = QHBoxLayout()

        # self.exposureControls = ExposureControl(self.camera)
        # layout.addWidget(self.exposureControls)

        whiteBalanceGrid = QGridLayout()
        wbTitle = QLabel("White Balance")
        wbTitle.setAlignment(Qt.AlignCenter)
        whiteBalanceGrid.addWidget(wbTitle, 0, 0, 1, 2)

        btnAuto = OptionButton()
        btnAuto.setText("Auto")
        _safelyConnect(btnAuto.clicked, self.camera.whiteBalanceAuto)
        whiteBalanceGrid.addWidget(btnAuto, 1, 0)

        btnIndoor = OptionButton()
        btnIndoor.setText("Indoor")
        _safelyConnect(btnIndoor.clicked, self.camera.whiteBalanceIndoor)
        whiteBalanceGrid.addWidget(btnIndoor, 2, 0)

        btnOutdoor = OptionButton()
        btnOutdoor.setText("Outdoor")
        _safelyConnect(btnOutdoor.clicked, self.camera.whiteBalanceOutdoor)
        whiteBalanceGrid.addWidget(btnOutdoor, 3, 0)

        btnOnePush = OptionButton()
        btnOnePush.setText("One Push")
        _safelyConnect(btnOnePush.clicked, self.camera.whiteBalanceOnePush)
        whiteBalanceGrid.addWidget(btnOnePush, 4, 0)

        btnOnePushTrigger = ExpandingButton()
        btnOnePushTrigger.setText("Set")
        _safelyConnect(btnOnePushTrigger.clicked, self.camera.whiteBalanceOnePushTrigger)
        btnOnePushTrigger.setEnabled(False)
        whiteBalanceGrid.addWidget(btnOnePushTrigger, 4, 1)

        self.wbOpts = QButtonGroup()
        self.wbOpts.addButton(btnAuto, 1)
        self.wbOpts.addButton(btnIndoor, 2)
        self.wbOpts.addButton(btnOutdoor, 3)
        self.wbOpts.addButton(btnOnePush, 4)
        self.wbOpts.buttonClicked.connect(lambda: btnOnePushTrigger.setEnabled(self.wbOpts.checkedId() == 4))

        layout.addLayout(whiteBalanceGrid)

        return layout
Beispiel #8
0
    def initUI(self):
        layout = QGridLayout()

        title = QLabel("Exposure")
        title.setAlignment(Qt.AlignCenter)
        layout.addWidget(title, 0, 0, 1, 4)

        btnAuto = OptionButton()
        btnAuto.setText("Full Auto")
        _safelyConnect(btnAuto.clicked, self.camera.setAutoExposure)
        btnAuto.setChecked(True)

        layout.addWidget(btnAuto, 1, 0)

        btnTV = OptionButton()
        btnTV.setText("Tv")
        _safelyConnect(btnTV.clicked, self.camera.setShutterPriority)

        layout.addWidget(btnTV, 1, 1)

        btnAV = OptionButton()
        btnAV.setText("Av")
        _safelyConnect(btnAV.clicked, self.camera.setAperturePriority)

        layout.addWidget(btnAV, 1, 2)

        btnManual = OptionButton()
        btnManual.setText("M")
        _safelyConnect(btnManual.clicked, self.camera.setManualExposure)

        layout.addWidget(btnManual, 1, 3)

        layout.addWidget(QLabel("Aperture"), 2, 0)

        self.aperture = QComboBox(self)
        for a in list(Aperture):
            self.aperture.addItem(a.label, userData=a)
        self.aperture.currentIndexChanged.connect(self.setAperture)
        self.aperture.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        self.aperture.setEnabled(False)

        layout.addWidget(self.aperture, 2, 1, 1, 3)

        layout.addWidget(QLabel("Shutter"), 3, 0)

        self.shutter = QComboBox(self)
        for s in list(Shutter):
            self.shutter.addItem(s.label, userData=s)
        self.shutter.currentIndexChanged.connect(self.setShutter)
        self.shutter.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        self.shutter.setEnabled(False)

        layout.addWidget(self.shutter, 3, 1, 1, 3)

        layout.addWidget(QLabel("Gain"), 4, 0)

        self.gain = QComboBox(self)
        for g in list(Gain):
            self.gain.addItem(g.label, userData=g)
        self.gain.currentIndexChanged.connect(self.setGain)
        self.gain.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        self.gain.setEnabled(False)

        layout.addWidget(self.gain, 4, 1, 1, 3)

        self.exposureButtons = QButtonGroup()
        self.exposureButtons.addButton(btnAuto, self.Mode.AUTO.value)
        self.exposureButtons.addButton(btnTV, self.Mode.TV.value)
        self.exposureButtons.addButton(btnAV, self.Mode.AV.value)
        self.exposureButtons.addButton(btnManual, self.Mode.MANUAL.value)

        self.exposureButtons.buttonClicked.connect(self.onExposureMethodSelected)

        layout.setRowStretch(0, 0)
        layout.setRowStretch(1, 1)
        layout.setRowStretch(2, 1)
        layout.setRowStretch(3, 1)
        layout.setRowStretch(4, 1)

        self.setLayout(layout)