def __init__(self, parent, name):
        BlissWidget.__init__(self, parent, name)

        """
        variables
        """
        self.YBeam  = None
        self.ZBeam  = None

        """
        property
        """
        self.addProperty("zoom", "string", "")
        self.hwZoom = None

        """
        signals
        """
        self.defineSignal("ChangeBeamPosition", ())

        """
        slots
        """
        self.defineSlot("getBeamPosition", ())
        self.defineSlot("beamPositionChanged", ())
        self.defineSlot("setBrickEnabled", ())

        self.buildInterface()
Exemple #2
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)
        self.__pid = -1
        self.__cmd = None
        self.__userHost = None
        self.__stringFont = None
        self.__startIdle = qt.QTimer(self)
        qt.QObject.connect(self.__startIdle, qt.SIGNAL("timeout()"),
                           self.__idleRun)

        self.__container = qttools.QtXEmbedContainer(self)
        qt.QObject.connect(self.__container, qt.SIGNAL("clientClosed()"),
                           self.run)
        layout = qt.QVBoxLayout(self)
        layout.addWidget(self.__container)
        self.__container.setSizePolicy(qt.QSizePolicy.Expanding,
                                       qt.QSizePolicy.Expanding)
        self.__container.setSizeIncrement(1, 12)
        qt.QObject.connect(qt.qApp, qt.SIGNAL("aboutToQuit()"),
                           self.__killTerm)

        ####### PROPERTY #######
        self.addProperty("command", "string", "")
        self.addProperty("users@host", "string", "")
        self.addProperty("font", "string", "")
Exemple #3
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.motor = None  # Hardware Object

        #
        # add properties and brick signals
        #
        self.addProperty("mnemonic", "string", "")
        self.addProperty("showButtons", "boolean", False)
        self.addProperty("mode", "combo", ("expert", "user"), "user")

        #
        # create GUI components
        #
        self.buttons = []
        self.lblUsername = QLabel("motor :", self)
        self.posButtonsPanel = QVButtonGroup(self)
        self.lstPositions = QComboBox(self)
        self.expertPanel = QVBox(self)
        self.motorWidget = MotorBrick.MotorBrick(self.expertPanel)
        expertPanelButtonsBox = QGrid(2, Qt.Vertical, self.expertPanel)
        QLabel("pos. name :", expertPanelButtonsBox)
        self.txtPositionName = QLineEdit(expertPanelButtonsBox)
        QLabel("", expertPanelButtonsBox)  # just a spacer in fact
        self.cmdSetPosition = QPushButton("Set pos.", expertPanelButtonsBox)

        #
        # configure GUI components
        #
        self.lstPositions.setEditable(False)
        QToolTip.add(self.lstPositions,
                     "Select a predefined position to move motor to")
        self.motorWidget["appearance"] = "tiny"
        self.motorWidget["allowDoubleClick"] = True
        self.posButtonsPanel.setInsideMargin(5)
        self.posButtonsPanel.setInsideSpacing(0)
        self.posButtonsPanel.setFrameStyle(QFrame.NoFrame)
        self.posButtonsPanel.setExclusive(True)
        expertPanelButtonsBox.setMargin(5)
        expertPanelButtonsBox.setSpacing(5)

        #
        # connect signals / slots
        #
        QObject.connect(self.lstPositions, SIGNAL("activated( int )"),
                        self.lstPositionsClicked)
        QObject.connect(self.cmdSetPosition, SIGNAL("clicked()"),
                        self.cmdSetPositionClicked)

        #
        # layout
        #
        self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)

        QVBoxLayout(self, 5, 5)
        self.layout().addWidget(self.lblUsername, 0)
        self.layout().addWidget(self.lstPositions, 0)
        self.layout().addWidget(self.posButtonsPanel, 0)
        self.layout().addWidget(self.expertPanel, 0)
Exemple #4
0
    def __init__(self, parent, name):
        BlissWidget.__init__(self, parent, name)

        """
        variables
        """
        self.firstTime = True
        self.layout1 = None
        self.layout2 = None
        self.displayWidget = None
        self.valueSize = 0
        self.titleSize = 0
        
        """
        properties
        """
        self.addProperty('file', 'string')
        self.hwFile = None
        self.addProperty('title', 'string')
        self.title = None
        self.addProperty('type', 'combo',
                    ("string", "integer", "float", "onoff", "offon", "motor"),
                    "string")
        self.varType = None
        self.addProperty('id', 'string')
        self.hwId = None
        self.nameId = None
        self.addProperty('orientation', 'combo', ("horizontal", "vertical"),
                         "horizontal")
        self.orientation = "horizontal"
        self.addProperty('title size', 'integer', 0)
        self.titleSize = 0
        self.addProperty('value size', 'integer', 0)
        self.valueSize = 0
    def __init__(self, parent, name):
        BlissWidget.__init__(self, parent, name)

        """
        variables
        """
        self.__brickStarted = False
        self.__lastPosition = None
        
        """
        properties
        """
        self.addProperty('appearance', "combo",
                        ("Display", "Move", "Configure", "Incremental"), "Move")
        self.appearance = None
        self.addProperty('mnemonic', 'string')
        self.hwro = None
        self.addProperty('check', 'boolean', False)
        self.checkMove = None

        """
        signals
        """
        self.defineSignal("clicked", ())
        self.defineSlot("setEnabled", ())
        
        """
        interface
        """
        self.buildInterface()
    def __init__(self, parent, name, **keys):
        BlissWidget.__init__(self, parent, name)
        self.__hMotor = None
        self.__vMotor = None
        self.__motor_pos_save = []
        self.__master_motor = None
        self.__masterPosition2Item = weakref.WeakValueDictionary()
        self.__currentCalib = None
        self.__currentBeamPos = None
        self.__camDecompNPlug = None
        self.mosaicView = None
        self.drawing = None
        self.__saveImageTreeDirName = '.'
        self.__imageMosaicPosition = None
        ####### Property #######
        self.addProperty('horizontal', 'string', '')
        self.addProperty('vertical', 'string', '')
        self.addProperty('save_motors', 'string', '')
        self.addProperty('master_motor', 'string', '')
        self.addProperty('focus_motor', 'string', '')
        self.addProperty('live_camera', 'string', '')
        self.addProperty("formatString", "formatString", "###.##")
        ####### SIGNAL #######
        self.defineSignal("getImage", ())
        self.defineSignal('getView', ())
        self.defineSignal('getMosaicView', ())
        ####### SLOT #######
        self.defineSlot("ChangePixelCalibration", ())
        self.defineSlot("ChangeBeamPosition", ())
        self.defineSlot('setMosaicImageSelected', ())

        self.__widgetTree = self.loadUIFile('CameraOffLineImageManager.ui')
        self.__frame = self.__widgetTree.child('__frame')
        self.__frame.reparent(self, qt.QPoint(0, 0))
        layout = qt.QHBoxLayout(self)
        layout.addWidget(self.__frame)

        snapButton = self.child('__snapShoot')
        iconSet = qt.QIconSet(loadIcon("snapshot.png"))
        snapButton.setIconSet(iconSet)
        qt.QObject.connect(snapButton, qt.SIGNAL('clicked()'), self.__snapCBK)

        liveCheckBox = self.child('__liveCheckBox')
        liveCheckBox.hide()
        qt.QObject.connect(liveCheckBox, qt.SIGNAL('toggled(bool)'), self.__liveOnOff)

        self.__imageList = self.child('__imageList')
        self.__imageList.setSelectionMode(qt.QListView.Extended)
        self.__imageList.setSortColumn(-1)
        self.__popUpMenu = qt.QPopupMenu(self)
        self.__popUpMenu.insertItem('layer up', self.__layerUp)
        self.__popUpMenu.insertItem('layer down', self.__layerDown)
        self.__popUpMenu.insertItem('remove', self.__removeImage)

        self.__popUpMenu.insertSeparator()
        self.__popUpMenu.insertItem('load', self.__loadImageTree)
        self.__popUpMenu.insertItem('save', self.__saveImageTree)

        qt.QObject.connect(self.__imageList, qt.SIGNAL('rightButtonPressed(QListViewItem*,const QPoint &,int)'),
                           self.__popUpDisplay)
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.firstTime = True

        self.addProperty('mnemonic', 'string', '')

        # Hadrware Object.
        self.hwo = None

        # electrometer
        self.elec    = None
        self._name   = None
        self._number = None

        # Electrometer Widget.
        self.elecWidget = None

        qt.QHBoxLayout(self, 0, 0)

        self.setSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Fixed)

        """
        GRAPHICAL INTERFACE
        """
        self.buildInterface()
        self.__idle = qt.QTimer()
        self.connect(self.__idle, qt.SIGNAL("timeout()"), self.__lastInit)
    def __init__(self, parent, name):
        BlissWidget.__init__(self, parent, name)

        """
        variables
        """
        self.drawingMgrRect = None
        self.infoDict = None

        """
        property
        """
        self.addProperty("bpm", "string", "")
        self.hwo = None

        """
        Signal
        """
        self.defineSignal('getView',())
        self.defineSignal('beamPositionChanged',())

        """
        Slot
        """

        """
        widgets
        """
        self.buildInterface()
Exemple #9
0
 def __init__(self, parent, name):
     BlissWidget.__init__(self, parent, name)
     """
     variables
     """
     self.__brickStarted = False
     self.__lastPosition = None
     """
     properties
     """
     self.addProperty('appearance', "combo",
                      ("Display", "Move", "Configure", "Incremental"),
                      "Move")
     self.appearance = None
     self.addProperty('mnemonic', 'string')
     self.hwro = None
     self.addProperty('check', 'boolean', False)
     self.checkMove = None
     """
     signals
     """
     self.defineSignal("clicked", ())
     self.defineSlot("setEnabled", ())
     """
     interface
     """
     self.buildInterface()
Exemple #10
0
 def __init__(self, parent, name):
     BlissWidget.__init__(self, parent, name)
     """
     variables
     """
     self.firstTime = True
     self.layout1 = None
     self.layout2 = None
     self.displayWidget = None
     self.valueSize = 0
     self.titleSize = 0
     """
     properties
     """
     self.addProperty("file", "string")
     self.hwFile = None
     self.addProperty("title", "string")
     self.title = None
     self.addProperty(
         "type",
         "combo",
         ("string", "integer", "float", "onoff", "offon", "motor"),
         "string",
     )
     self.varType = None
     self.addProperty("id", "string")
     self.hwId = None
     self.nameId = None
     self.addProperty("orientation", "combo", ("horizontal", "vertical"),
                      "horizontal")
     self.orientation = "horizontal"
     self.addProperty("title size", "integer", 0)
     self.titleSize = 0
     self.addProperty("value size", "integer", 0)
     self.valueSize = 0
Exemple #11
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)
        self.specStateHO = None
        self.statusBar = None

        self.specStateLabel = None

        self.addProperty("specstate", "string", "")
        self.addProperty("statusSearchDepth", "integer", 3)

        self.defineSlot("setMessage", ())

        self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)

        # Information messages
        self.MAX_BUFFER_SIZE = 5
        self.messages = []
        self.read_idx = 0
        self.insert_idx = 0

        self.button = QPushButton("Add", self, "add_button")
        self.v_scroll = SpinBoxButtons(self, "v_scroll")

        QObject.connect(self.v_scroll, PYSIGNAL("scroll_up"), self.next_message)
        QObject.connect(self.v_scroll, PYSIGNAL("scroll_down"), self.prev_message)
Exemple #12
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.addProperty("mnemonic", "string", "")
        self.defineSignal("centringSuccessful", ())

        self.microdiff = None
         
        # GUI
        self.statusBox = QVGroupBox("Status", self)
        self.lblStatus = QLabel("", self.statusBox)
      
        self.statusBox.setInsideMargin(5)
        self.statusBox.setInsideSpacing(10)
        self.statusBox.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        self.lblStatus.setAlignment(Qt.AlignHCenter)
       
        self.chkBackground = QCheckBox("Auto-check automatic centring background", self)
        QObject.connect(self.chkBackground, SIGNAL("clicked()"), self.setAutocheckBackground)
 
        # final layout
        QVBoxLayout(self, 5, 5)
        self.layout().addWidget(self.statusBox)
        self.layout().addWidget(self.chkBackground)
        self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)        
Exemple #13
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.firstTime = True

        self.addProperty('mnemonic', 'string', '')

        # Hadrware Object.
        self.hwo = None

        # electrometer
        self.elec = None
        self._name = None
        self._number = None

        # Electrometer Widget.
        self.elecWidget = None

        qt.QHBoxLayout(self, 0, 0)

        self.setSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Fixed)
        """
        GRAPHICAL INTERFACE
        """
        self.buildInterface()
        self.__idle = qt.QTimer()
        self.connect(self.__idle, qt.SIGNAL("timeout()"), self.__lastInit)
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.collect_hwobj = None

        self.addProperty('mnemonic', 'string', '')
        self.addProperty('appearance','combo',('simple', 'normal'),'normal')
        self.addProperty('title', 'string','')
        self.addProperty('timeFormat','string','%H:%M:%S')

        self.executing = None
        self.time_total_sec = 0
        self.time_remaining_sec = 0
        self.time_format = None
        self.progress_task = None

        self.container_hbox = qt.QHGroupBox(self)
        self.container_hbox.setInsideMargin(4)
        self.container_hbox.setInsideSpacing(2)

        self.time_total_label = qt.QLabel('Total:',self.container_hbox)
        self.time_total_value_label = qt.QLabel('??:??:??',self.container_hbox)
        self.progressBar = qt.QProgressBar(self.container_hbox)
        self.progressBar.setCenterIndicator(True)
        self.time_remaining_label = qt.QLabel('Remaining:',self.container_hbox)
        self.time_remaining_value_label = qt.QLabel('??:??:??',self.container_hbox)

        qt.QVBoxLayout(self)
        self.setSizePolicy(qt.QSizePolicy.MinimumExpanding, qt.QSizePolicy.Fixed)
        self.layout().addWidget(self.container_hbox)

        self.setEnabled(False)
        self.instanceSynchronize("")
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.inExpert = None

        self.addProperty("mnemonic", "string", "")
        self.addProperty("safetyShutter", "string", "")
        self.addProperty("icons", "string", "")
        self.addProperty("iconsStopCancel", "string", "")
        self.addProperty("label", "string", "")
        self.addProperty("showBorder", "boolean", True)
        self.addProperty("confirmationMessages", "string", "")
        self.addProperty("toolTips", "string", "")
        self.addProperty("userModeMask", "string", "")
        self.addProperty("expertModeMask", "string", "")
        self.defineSlot("setEnabled", ())
        self.defineSignal("commandStarted", ())
        self.defineSignal("commandDone", ())
        self.defineSignal("commandFailed", ())
        # self.defineSlot('enable_widget', ())

        self.safetyShutter = None
        self.commandHO = None
        self.commandButtons = {}

        self.commands2Hide = []

        self.containerBox = QVBox(self)
        # self.containerBox.setInsideMargin(4)
        # self.containerBox.setInsideSpacing(2)

        QVBoxLayout(self)
        self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        self.containerBox.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        self.layout().addWidget(self.containerBox)
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.mainMenu = None
        self.instrumentationMenu = None
        self.instrumentationMenuId = None

        self.defineSignal("enableAutoStartLoopCentring", ())
        self.defineSignal("toggle_kappa", ())

        # Initialize HO
        self.cryostreamHO = None
        self.fluodetectorHO = None
        self.hutchtriggerHO = None
        self.lightHO = None
        self.scintillatorHO = None
        self.apertureHO = None

        self.addProperty("cryostream", "string", "")
        self.addProperty("fluodetector", "string", "")
        self.addProperty("hutchtrigger", "string", "")
        self.addProperty("light", "string", "")
        self.addProperty("scintillator", "string", "")
        self.addProperty("Kappa on/off", "string", "")
        self.addProperty("aperture", "string", "")
        self.addProperty("menuTitle", "string", "Instrumentation")
        self.addProperty("menuPosition", "integer", 1)
        self.addProperty("hutchtriggerDefaultMode", "combo", ("automatic", "manual"), "automatic")
        self.addProperty("scintillatorWarning", "string", "")
        self.addProperty("apertureWarning", "string", "")

        self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
Exemple #17
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.addProperty("mnemonic", "string", "")
        self.defineSignal("centringSuccessful", ())

        self.microdiff = None
         
        # GUI
        self.statusBox = QVGroupBox("Status", self)
        self.lblStatus = QLabel("", self.statusBox)
      
        self.statusBox.setInsideMargin(5)
        self.statusBox.setInsideSpacing(10)
        self.statusBox.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        self.lblStatus.setAlignment(Qt.AlignHCenter)
       
        self.chkBackground = QCheckBox("Auto-check automatic centring background", self)
        QObject.connect(self.chkBackground, SIGNAL("clicked()"), self.setAutocheckBackground)
 
        # final layout
        QVBoxLayout(self, 5, 5)
        self.layout().addWidget(self.statusBox)
        self.layout().addWidget(self.chkBackground)
        self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)        
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.inExpert = None

        self.addProperty('mnemonic', 'string', '')
        self.addProperty('safetyShutter', 'string', '')
        self.addProperty('icons', 'string', '')
        self.addProperty('iconsStopCancel', 'string', '')
        self.addProperty('label', 'string', '')
        self.addProperty('showBorder', 'boolean', True)
        self.addProperty('confirmationMessages', 'string', '')
        self.addProperty('toolTips', 'string', '')
        self.addProperty('userModeMask', 'string', '')
        self.addProperty('expertModeMask', 'string', '')
        self.defineSlot('setEnabled', ())
        self.defineSignal('commandStarted', ())
        self.defineSignal('commandDone', ())
        self.defineSignal('commandFailed', ())
        #self.defineSlot('enable_widget', ())

        self.safetyShutter = None
        self.commandHO = None
        self.commandButtons = {}

        self.commands2Hide = []

        self.containerBox = QVBox(self)
        #self.containerBox.setInsideMargin(4)
        #self.containerBox.setInsideSpacing(2)

        QVBoxLayout(self)
        self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        self.containerBox.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        self.layout().addWidget(self.containerBox)
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.collect_hwobj = None

        self.addProperty("mnemonic", "string", "")
        self.addProperty("appearance", "combo", ("simple", "normal"), "normal")
        self.addProperty("title", "string", "")
        self.addProperty("timeFormat", "string", "%H:%M:%S")

        self.executing = None
        self.time_total_sec = 0
        self.time_remaining_sec = 0
        self.time_format = None
        self.progress_task = None

        self.container_hbox = qt.QHGroupBox(self)
        self.container_hbox.setInsideMargin(4)
        self.container_hbox.setInsideSpacing(2)

        self.time_total_label = qt.QLabel("Total:", self.container_hbox)
        self.time_total_value_label = qt.QLabel("??:??:??", self.container_hbox)
        self.progressBar = qt.QProgressBar(self.container_hbox)
        self.progressBar.setCenterIndicator(True)
        self.time_remaining_label = qt.QLabel("Remaining:", self.container_hbox)
        self.time_remaining_value_label = qt.QLabel("??:??:??", self.container_hbox)

        qt.QVBoxLayout(self)
        self.setSizePolicy(qt.QSizePolicy.MinimumExpanding, qt.QSizePolicy.Fixed)
        self.layout().addWidget(self.container_hbox)

        self.setEnabled(False)
        self.instanceSynchronize("")
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.current_element = None
        self.current_edge = None

        self.addProperty('mnemonic', 'string', '')
        self.addProperty('title', 'string', '')
        self.addProperty('kevFormatString','formatString','##.####')
        self.addProperty('maximumWidth', 'integer', 525)

        self.defineSignal('edgeSelected',())
        self.defineSlot('setDisabled',())
        self.defineSlot('setEnabled',())
        self.defineSlot('setSession',())

        self.topBox = QHBox(self)
        #self.topBox.setInsideMargin(4)
        #self.topBox.setInsideSpacing(2)

        self.periodicTable=myPeriodicTable(self.topBox)
        self.connect(self.periodicTable,PYSIGNAL('edgeSelected'),self.edgeSelected)

        self.instanceSynchronize("periodicTable")

        QHBoxLayout(self)
        self.layout().addWidget(self.topBox)
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)
        
        self.addProperty('mnemonic', 'string')
        self.addProperty('numberFormatString', 'formatString', '+####.##')
        self.addProperty('title', 'string', '')
        self.addProperty('commands_channels', 'string', '', hidden=True)
 
        self.__brick_properties = self.propertyBag.properties.keys()
        self.__commands_channels = {}
        
        self.defineSlot("showBrick", ())

        self.hardwareObject = None

        self.cmdButtons = []
        self.channelLabels = []
        
        self.lblTitle = QLabel(self)
        self.channelsBox = QGrid(2, self)
        self.commandsBox = QVBox(self)
        self.lblTitle.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
        
        QVBoxLayout(self, 0, 0)
        self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        self.layout().addWidget(self.lblTitle)
        self.layout().addWidget(self.channelsBox, 0, Qt.AlignHCenter)
        self.layout().addWidget(self.commandsBox, 0, Qt.AlignHCenter)
Exemple #22
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.addProperty("microdiff", "boolean", False)
        self.addProperty("mnemonic", "string", "")
        self.addProperty("defaultHolderLength", "integer", 22)

        #self.defineSignal("sampleLoaded", ())

        self.sampleChanger = None
        self.loading = False

        # GUI
        self.statusBox = QVGroupBox("Status", self)
        self.lblStatus = QLabel("", self.statusBox)
        abortResetBox = QHBox(self.statusBox)
        self.cmdReset = QToolButton(abortResetBox)
        sampleBox = QVBox(self)
        self.lblSampleLoadingState = QLabel(sampleBox)
        self.cmdBox = QGrid(3, sampleBox)
        self.basketSelectionWidget = BasketSelectionWidget(self.cmdBox)
        HorizontalSpacer(self.cmdBox)
        self.sampleSelectionWidget = SampleSelectionWidget(self.cmdBox)
        self.basketView = SampleBasketView(self.cmdBox, 5)
        self.loadSampleCmdWidget = LoadSampleCmdWidget(self.cmdBox)   
        self.sampleView = SampleBasketView(self.cmdBox, 10)

        self.statusBox.setInsideMargin(5)
        self.statusBox.setInsideSpacing(10)
        self.statusBox.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        self.cmdReset.setIconSet(QIconSet(Icons.load("reload")))
        self.cmdReset.setTextLabel("Reset")
        self.cmdReset.setUsesTextLabel(True)
        self.lblStatus.setAlignment(Qt.AlignHCenter)
        sampleBox.setMargin(5)
        sampleBox.setSpacing(5)
        self.lblSampleLoadingState.setAlignment(Qt.AlignHCenter)
        
        # final layout
        """
        QGridLayout(self.cmdBox, 3, 3, 5, 5)
        self.cmdBox.layout().addWidget(self.basketSelectionWidget, 0, 0)
        self.cmdBox.layout().addWidget(self.basketView, 1, 0)
        self.cmdBox.layout().addWidget(self.loadSampleCmdWidget, 2, 1, Qt.AlignBottom)
        self.cmdBox.layout().addWidget(hspacer, 0, 1)
        self.cmdBox.layout().addWidget(self.sampleSelectionWidget, 0, 2)
        self.cmdBox.layout().addWidget(self.sampleView, 1, 2)
        """

        QVBoxLayout(self, 5, 5)
        self.layout().addWidget(self.statusBox)
        self.layout().addWidget(sampleBox)
        self.layout().addItem(QSpacerItem(QSizePolicy.Fixed, QSizePolicy.MinimumExpanding))      

        QObject.connect(self.cmdReset, SIGNAL("clicked()"), self.resetSampleChanger)
        QObject.connect(self.basketSelectionWidget, PYSIGNAL("changeSelectedItem"), self.changeBasketClicked)
        QObject.connect(self.sampleSelectionWidget, PYSIGNAL("changeSelectedItem"), self.changeSampleClicked)
        QObject.connect(self.basketSelectionWidget, PYSIGNAL("scanBasket"), self.scanBasket)
        QObject.connect(self.loadSampleCmdWidget, PYSIGNAL("loadSample"), self.loadSample)
        QObject.connect(self.loadSampleCmdWidget, PYSIGNAL("unloadSample"), self.unloadSample)
Exemple #23
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)
        self.__widgetTree = self.loadUIFile("Centering.ui")
        self.__widgetTree.reparent(self, qt.QPoint(0, 0))
        layout = qt.QHBoxLayout(self, 11, 6, "layout")
        layout.addWidget(self.__widgetTree)
        self.__centeringPlug = None

        self.__currentXSize, self.__currentYSize = 0, 0  # current pixel size
        self.__verticalPhi = True
        self.pxclient = None

        self.beam_pos = (None, None)

        self.addProperty("mnemonic", "string", "")
        self.addProperty("clockwise", "boolean", False)
        self.addProperty("table_y_inverted", "boolean", False)
        self.addProperty("table_z_inverted", "boolean", False)

        ####### SIGNAL #######
        self.defineSignal("getView", ())
        self.defineSignal("getBeamPosition", ())

        ####### SLOTS #######
        self.defineSlot("changePixelScale", ())
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.inExpert=None

        self.addProperty('mnemonic', 'string', '')
        self.addProperty('safetyShutter', 'string', '')
        self.addProperty('icons', 'string', '')
        self.addProperty('iconsStopCancel', 'string', '')
        self.addProperty('label', 'string', '')
        self.addProperty('showBorder', 'boolean', True)
        self.addProperty('confirmationMessages', 'string', '')
        self.addProperty('toolTips', 'string', '')
        self.addProperty('userModeMask', 'string', '')
        self.addProperty('expertModeMask', 'string', '')
        self.defineSlot('setEnabled',())
        self.defineSignal('commandStarted',())
        self.defineSignal('commandDone',())
        self.defineSignal('commandFailed',())
        #self.defineSlot('enable_widget', ())

        self.safetyShutter = None
        self.commandHO = None
        self.commandButtons = {}

        self.commands2Hide=[]

        self.containerBox = QVBox(self)
        #self.containerBox.setInsideMargin(4)
        #self.containerBox.setInsideSpacing(2)

        QVBoxLayout(self)
        self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        self.containerBox.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        self.layout().addWidget(self.containerBox)
Exemple #25
0
    def __init__(self,*args) :
        BlissWidget.__init__(self,*args)
        self.__widgetTree = self.loadUIFile('Centering.ui')
        self.__widgetTree.reparent(self,qt.QPoint(0,0))
        layout = qt.QHBoxLayout(self,11,6,'layout')
        layout.addWidget(self.__widgetTree)
        self.__centeringPlug = None

        self.__currentXSize,self.__currentYSize = 0,0 # current pixel size
        self.__verticalPhi = True
        self.pxclient = None
       
        self.beam_pos = (None, None)
 
        self.addProperty('mnemonic', 'string', '')
        self.addProperty('clockwise','boolean',False)
        self.addProperty('table_y_inverted', 'boolean', False)
        self.addProperty('table_z_inverted', 'boolean', False)
 
                        ####### SIGNAL #######
        self.defineSignal('getView',())
        self.defineSignal('getBeamPosition',())
 
                        ####### SLOTS #######
        self.defineSlot("changePixelScale",())
Exemple #26
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.addProperty('mnemonic', 'string', '')
        self.addProperty('edna object', 'string', '')
        self.addProperty('workflows base dir', 'string', '')

        #when starting a workflow we emit this signal and expect
        #to get the beamline params through the slot
        self.defineSlot('updateBeamlineParameters', ())
        self.defineSlot("populate_workflow_widget",({}))  
        self.defineSignal('beamlineParametersNeeded', ())
        self.defineSignal('workflowAvailable', ())

        #we need the session id
        self.defineSlot('login_changed', ())

        self.beamline_params = dict()

        self.session_id = None
        self.params_widget = None
        self.workflow = None
        self.edna = None
        self.previous_workflow_state = None
        self.workflow_output_file = None
        self.process_dir = None
        QGridLayout(self, 4, 2)
        self.workflows_box = QHBoxLayout()
        self.ok_button = QPushButton('Continue', self)
        self.abort_button = QPushButton('Abort', self)

        self.workflow_list = QComboBox(self)
        self.workflow_list.hide()
        self.start_button = QPushButton('Start', self)
        self.start_button.hide()
        self.workflows_box.addWidget(self.workflow_list)
        self.workflows_box.addWidget(self.start_button)

        self.layout().addMultiCellLayout(self.workflows_box, 0, 0, 0, 1)

        self.info_label = QLabel(self)
        self.info_label.setSizePolicy(QSizePolicy.MinimumExpanding,
                                      QSizePolicy.Fixed)

        self.layout().addWidget(self.ok_button, 2, 0)
        self.layout().addWidget(self.abort_button, 2, 1)
        self.layout().addMultiCellWidget(self.info_label, 3, 3, 0, 1)

        QObject.connect(self.ok_button, SIGNAL('clicked()'),
                        self.send_parameters)
        QObject.connect(self.abort_button, SIGNAL('clicked()'),
                        self.abort_workflow)
        QObject.connect(self.start_button, SIGNAL('clicked()'),
                        self.start_workflow)
        QObject.connect(self.workflow_list, SIGNAL('activated ( const QString &)'),
                        self.workflow_selected)
        # name -> model path mapping
        self.workflows = dict()
Exemple #27
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.addProperty('mnemonic', 'string', '')

        self.specShell = None

        self.containerBox = QVGroupBox("Shortcut", self)
        self.containerBox.setInsideMargin(4)
        self.containerBox.setInsideSpacing(4)
        self.containerBox.setAlignment(QLabel.AlignLeft)

        self.optimiseButton = QToolButton(self.containerBox)
        self.optimiseButton.setUsesTextLabel(True)
        self.optimiseButton.setTextLabel("Optimise Beam")
        self.optimiseButton.setFixedWidth(130)
        self.optimiseButton.setEnabled(False)
        QObject.connect(self.optimiseButton, SIGNAL('clicked()'),
                        self.optimiseClicked)

        self.wikiButton = QToolButton(self.containerBox)
        self.wikiButton.setUsesTextLabel(True)
        self.wikiButton.setTextLabel("MAXlab Wiki")
        self.wikiButton.setEnabled(True)
        self.wikiButton.setFixedWidth(130)
        QObject.connect(self.wikiButton, SIGNAL('clicked()'), self.wikiClicked)

        self.stacButton = QToolButton(self.containerBox)
        self.stacButton.setUsesTextLabel(True)
        self.stacButton.setTextLabel("Run STAC")
        self.stacButton.setFixedWidth(130)
        self.stacButton.setEnabled(True)
        QObject.connect(self.stacButton, SIGNAL('clicked()'), self.stacClicked)

        self.detBeamstopBox = QHGroupBox("Detector Beamstop",
                                         self.containerBox)
        self.detBeamstopBox.setInsideMargin(4)
        self.detBeamstopBox.setInsideSpacing(0)
        self.detBeamstopBox.setAlignment(QLabel.AlignCenter)

        self.dbsInButton = QToolButton(self.detBeamstopBox)
        self.dbsInButton.setUsesTextLabel(True)
        self.dbsInButton.setTextLabel("In")
        self.dbsInButton.setEnabled(True)
        QObject.connect(self.dbsInButton, SIGNAL('clicked()'),
                        self.dbsInClicked)

        self.dbsOutButton = QToolButton(self.detBeamstopBox)
        self.dbsOutButton.setUsesTextLabel(True)
        self.dbsOutButton.setTextLabel("Out")
        self.dbsOutButton.setEnabled(True)
        QObject.connect(self.dbsOutButton, SIGNAL('clicked()'),
                        self.dbsOutClicked)

        QVBoxLayout(self)
        self.setSizePolicy(QSizePolicy.MinimumExpanding,
                           QSizePolicy.MinimumExpanding)
        self.layout().addWidget(self.containerBox)
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.addProperty("mnemonic", "string", "")
        self.addProperty("icons", "string", "")
        self.addProperty("formatString", "formatString", "###.##")

        self.defineSlot("setEnabled", ())
        self.defineSlot("transmissionRequest", ())

        self.attenuators = None
        self.transmissionLimits = None

        self.currentTransmissionValue = None

        self.topBox = QHGroupBox("Transmission", self)
        self.topBox.setInsideMargin(4)
        self.topBox.setInsideSpacing(2)

        self.paramsBox = QWidget(self.topBox)
        QGridLayout(self.paramsBox, 2, 3, 0, 2)

        label1 = QLabel("Current:", self.paramsBox)
        self.paramsBox.layout().addWidget(label1, 0, 0)

        self.currentTransmission = QLineEdit(self.paramsBox)
        self.currentTransmission.setReadOnly(True)
        self.currentTransmission.setFixedWidth(75)

        self.paramsBox.layout().addWidget(self.currentTransmission, 0, 1)

        label2 = QLabel("Set to:", self.paramsBox)
        self.paramsBox.layout().addWidget(label2, 1, 0)

        self.newTransmission = QLineEdit(self.paramsBox)
        self.newTransmission.setAlignment(QWidget.AlignRight)
        self.paramsBox.layout().addWidget(self.newTransmission, 1, 1)
        self.newTransmission.setFixedWidth(75)
        self.newTransmission.setValidator(QDoubleValidator(self))
        self.newTransmission.setPaletteBackgroundColor(self.CONNECTED_COLOR)
        QObject.connect(
            self.newTransmission,
            SIGNAL("returnPressed()"),
            self.changeCurrentTransmission,
        )
        QObject.connect(
            self.newTransmission,
            SIGNAL("textChanged(const QString &)"),
            self.inputFieldChanged,
        )
        self.newTransmission.createPopupMenu = self.openHistoryMenu

        self.instanceSynchronize("newTransmission")

        QVBoxLayout(self)
        self.layout().addWidget(self.topBox)
        self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.MinimumExpanding)
Exemple #29
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.motor = None #Hardware Object
        
        #
        # add properties and brick signals
        #
        self.addProperty('mnemonic', 'string', '')
        self.addProperty('showButtons', 'boolean', False)
        self.addProperty('mode', 'combo', ('expert', 'user'), 'user')
 
        #
        # create GUI components
        #
        self.buttons = []
        self.lblUsername = QLabel('motor :', self)
        self.posButtonsPanel = QVButtonGroup(self)
        self.lstPositions = QComboBox(self)
        self.expertPanel = QVBox(self)
        self.motorWidget = MotorBrick.MotorBrick(self.expertPanel)
        expertPanelButtonsBox = QGrid(2, Qt.Vertical, self.expertPanel)
        QLabel('pos. name :', expertPanelButtonsBox)
        self.txtPositionName = QLineEdit(expertPanelButtonsBox)
        QLabel('', expertPanelButtonsBox) #just a spacer in fact
        self.cmdSetPosition = QPushButton('Set pos.', expertPanelButtonsBox)

        #
        # configure GUI components
        #
        self.lstPositions.setEditable(False)
        QToolTip.add(self.lstPositions, 'Select a predefined position to move motor to')
        self.motorWidget['appearance'] = 'tiny'
        self.motorWidget['allowDoubleClick'] = True
        self.posButtonsPanel.setInsideMargin(5)
        self.posButtonsPanel.setInsideSpacing(0)
        self.posButtonsPanel.setFrameStyle(QFrame.NoFrame)
        self.posButtonsPanel.setExclusive(True)
        expertPanelButtonsBox.setMargin(5)
        expertPanelButtonsBox.setSpacing(5)        

        #
        # connect signals / slots
        #
        QObject.connect(self.lstPositions, SIGNAL('activated( int )'), self.lstPositionsClicked)
        QObject.connect(self.cmdSetPosition, SIGNAL('clicked()'), self.cmdSetPositionClicked)

        #
        # layout
        #
        self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) 

        QVBoxLayout(self, 5, 5)
        self.layout().addWidget(self.lblUsername, 0)
        self.layout().addWidget(self.lstPositions, 0)
        self.layout().addWidget(self.posButtonsPanel, 0)
        self.layout().addWidget(self.expertPanel, 0)
Exemple #30
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.defineSlot('setData', ())

        self.mcafit = McaAdvancedFit.McaAdvancedFit(self)
        self.mcafit.dismissButton.hide()
        QVBoxLayout(self)
        self.layout().addWidget(self.mcafit)
Exemple #31
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.addProperty("mnemonic", "string", "")
        self.addProperty("defaultHolderLength", "integer", 22)
        self.addProperty("icons", "string", "")

        self.defineSignal("scanBasketUpdate", ())
        self.defineSignal("sampleGotLoaded", ())
        self.defineSlot("setSession", ())
        self.defineSlot("setCollecting", ())

        self.sampleChanger = None
        self.vialStateMap = {}
        self.inExpert = None

        self.contentsBox = QVGroupBox("Sample changer", self)
        self.contentsBox.setInsideMargin(4)
        self.contentsBox.setInsideSpacing(2)

        self.status = QLabel(self.contentsBox)
        self.io = {}

        self.baskets = []
        for i in range(3):
            self.baskets.append(SampleChangerBrick3.BasketView(self.contentsBox, i + 1))
            QObject.connect(
                self.baskets[i], PYSIGNAL("loadThisSample"), self.loadThisSample
            )
            self.baskets[i].contentsBox.setCheckable(True)
            QObject.connect(
                self.baskets[i].contentsBox,
                SIGNAL("toggled(bool)"),
                self.toggleBasketPresence,
            )
            self.baskets[i].setEnabled(True)

        self.unmount_button = QPushButton("Unmount sample", self.contentsBox)
        self.unmount_button.setEnabled(False)
        QObject.connect(self.unmount_button, SIGNAL("clicked()"), self.unloadSample)

        self.sampleChangerStateChanged("UNKNOWN")

        lidctrlbox = QHBox(self)
        self.lidStatusLabel = QLabel("Lid ?", lidctrlbox)
        self.lidButton = QPushButton("Open", lidctrlbox)
        QObject.connect(self.lidButton, SIGNAL("clicked()"), self.openCloseDewar)
        ln2box = QHBox(self)
        self.ln2level = QLabel("LN2 level", ln2box)

        QVBoxLayout(self)
        self.layout().addWidget(ln2box)
        self.layout().addWidget(self.contentsBox)
        self.layout().addWidget(lidctrlbox)

        self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Minimum)
        self.contentsBox.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Minimum)
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.motor = None  # Hardware Object

        #
        # add properties and brick signals
        #
        self.addProperty("mnemonic", "string", "")
        self.addProperty("showButtons", "boolean", False)
        self.addProperty("mode", "combo", ("expert", "user"), "user")

        #
        # create GUI components
        #
        self.buttons = []
        self.lblUsername = QLabel("motor :", self)
        self.posButtonsPanel = QVButtonGroup(self)
        self.lstPositions = QComboBox(self)
        self.expertPanel = QVBox(self)
        self.motorWidget = MotorBrick.MotorBrick(self.expertPanel)
        expertPanelButtonsBox = QGrid(2, Qt.Vertical, self.expertPanel)
        QLabel("pos. name :", expertPanelButtonsBox)
        self.txtPositionName = QLineEdit(expertPanelButtonsBox)
        QLabel("", expertPanelButtonsBox)  # just a spacer in fact
        self.cmdSetPosition = QPushButton("Set pos.", expertPanelButtonsBox)

        #
        # configure GUI components
        #
        self.lstPositions.setEditable(False)
        QToolTip.add(self.lstPositions, "Select a predefined position to move motor to")
        self.motorWidget["appearance"] = "tiny"
        self.motorWidget["allowDoubleClick"] = True
        self.posButtonsPanel.setInsideMargin(5)
        self.posButtonsPanel.setInsideSpacing(0)
        self.posButtonsPanel.setFrameStyle(QFrame.NoFrame)
        self.posButtonsPanel.setExclusive(True)
        expertPanelButtonsBox.setMargin(5)
        expertPanelButtonsBox.setSpacing(5)

        #
        # connect signals / slots
        #
        QObject.connect(self.lstPositions, SIGNAL("activated( int )"), self.lstPositionsClicked)
        QObject.connect(self.cmdSetPosition, SIGNAL("clicked()"), self.cmdSetPositionClicked)

        #
        # layout
        #
        self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)

        QVBoxLayout(self, 5, 5)
        self.layout().addWidget(self.lblUsername, 0)
        self.layout().addWidget(self.lstPositions, 0)
        self.layout().addWidget(self.posButtonsPanel, 0)
        self.layout().addWidget(self.expertPanel, 0)
Exemple #33
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.addProperty("mnemonic", "string", "")
        self.addProperty("icons", "string", "")
        self.addProperty("formatString", "formatString", "###.##")

        self.defineSlot("setEnabled", ())
        self.defineSlot("transmissionRequest", ())

        self.attenuators = None
        self.transmissionLimits = None

        self.currentTransmissionValue = None

        self.topBox = QHGroupBox("Transmission", self)
        self.topBox.setInsideMargin(4)
        self.topBox.setInsideSpacing(2)

        self.paramsBox = QWidget(self.topBox)
        QGridLayout(self.paramsBox, 2, 3, 0, 2)

        label1 = QLabel("Current:", self.paramsBox)
        self.paramsBox.layout().addWidget(label1, 0, 0)

        self.currentTransmission = QLineEdit(self.paramsBox)
        self.currentTransmission.setReadOnly(True)
        self.currentTransmission.setFixedWidth(75)

        self.paramsBox.layout().addWidget(self.currentTransmission, 0, 1)

        label2 = QLabel("Set to:", self.paramsBox)
        self.paramsBox.layout().addWidget(label2, 1, 0)

        self.newTransmission = QLineEdit(self.paramsBox)
        self.newTransmission.setAlignment(QWidget.AlignRight)
        self.paramsBox.layout().addWidget(self.newTransmission, 1, 1)
        self.newTransmission.setFixedWidth(75)
        self.newTransmission.setValidator(QDoubleValidator(self))
        self.newTransmission.setPaletteBackgroundColor(self.CONNECTED_COLOR)
        QObject.connect(
            self.newTransmission,
            SIGNAL("returnPressed()"),
            self.changeCurrentTransmission,
        )
        QObject.connect(
            self.newTransmission,
            SIGNAL("textChanged(const QString &)"),
            self.inputFieldChanged,
        )
        self.newTransmission.createPopupMenu = self.openHistoryMenu

        self.instanceSynchronize("newTransmission")

        QVBoxLayout(self)
        self.layout().addWidget(self.topBox)
        self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.MinimumExpanding)
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.defineSlot('setData',())
        
        self.mcafit = McaAdvancedFit.McaAdvancedFit(self)
        self.mcafit.dismissButton.hide()
        QVBoxLayout(self)        
        self.layout().addWidget(self.mcafit)
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        actions = []

        self.__zoomList = QubZoomListAction(
            place="toolbar",
            zoomValList=[0.1, 0.25, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4],
            show=1,
            group="zoom",
        )
        actions.append(self.__zoomList)

        self.__zoomFitOrFill = QubZoomAction(
            place="toolbar", keepROI=True, group="zoom"
        )
        self.__zoomFitOrFill.setList(self.__zoomList)
        self.__zoomList.setActionZoomMode(self.__zoomFitOrFill)
        actions.append(self.__zoomFitOrFill)

        zoomAction = QubZoomRectangle(
            label="Zoom Crop",
            place="toolbar",
            show=1,
            group="zoom",
            activate_click_drag=True,
            drawingObjectLayer=2 ** 31,
            unactiveActionWhenDub=True,
        )
        qt.QObject.connect(
            zoomAction, qt.PYSIGNAL("RectangleSelected"), self.__rectangleZoomChanged
        )
        actions.append(zoomAction)

        ####### CHANGE FOREGROUND COLOR #######
        fcoloraction = QubForegroundColorAction(name="color", group="image")
        actions.append(fcoloraction)

        ####### MEASURE #######
        measureAction = QubOpenDialogAction(
            parent=self,
            name="measure",
            iconName="measure",
            label="Measure",
            group="Tools",
        )
        measureAction.setConnectCallBack(self._measure_dialog_new)
        actions.append(measureAction)

        self.__mainView = QubMosaicView(self, actions=actions)

        layout = qt.QHBoxLayout(self)
        layout.addWidget(self.__mainView)

        ####### SLOT #######
        self.defineSlot("getView", ())
Exemple #36
0
  def __init__(self, *args):
      BlissWidget.__init__(self, *args)
  
      self.flag = False
 
      self.addProperty('specversion', 'string')
      self.addProperty('specWatchVar','string')
      self.specversion = self.specWatchVar = None
      self.setFixedSize(0,0)
      self.hide()
    def __init__(self, parent, name):
        BlissWidget.__init__(self, parent, name)

        self.addProperty("xmlFile", "string", "")
        self.addProperty("uiFile", "string", "")
        self.addProperty("expert_channels", "string", "", hidden=True)
        self.__brick_properties = list(self.propertyBag.properties.keys())
        self.hwo = None
        self.expert_channels = []
        self.property_expert_channels = {}
    def __init__(self, parent, name):
        BlissWidget.__init__(self, parent, name)

        self.addProperty("xmlFile", "string", "")
        self.addProperty("uiFile", "string", "")
        self.addProperty("expert_channels", "string", "", hidden=True)
        self.__brick_properties = self.propertyBag.properties.keys()
        self.hwo = None
        self.expert_channels = []
        self.property_expert_channels = {}
Exemple #39
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        actions = []

        self.__zoomList = QubZoomListAction(
            place="toolbar",
            zoomValList=[0.1, 0.25, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4],
            show=1,
            group="zoom",
        )
        actions.append(self.__zoomList)

        self.__zoomFitOrFill = QubZoomAction(place="toolbar",
                                             keepROI=True,
                                             group="zoom")
        self.__zoomFitOrFill.setList(self.__zoomList)
        self.__zoomList.setActionZoomMode(self.__zoomFitOrFill)
        actions.append(self.__zoomFitOrFill)

        zoomAction = QubZoomRectangle(
            label="Zoom Crop",
            place="toolbar",
            show=1,
            group="zoom",
            activate_click_drag=True,
            drawingObjectLayer=2**31,
            unactiveActionWhenDub=True,
        )
        qt.QObject.connect(zoomAction, qt.PYSIGNAL("RectangleSelected"),
                           self.__rectangleZoomChanged)
        actions.append(zoomAction)

        ####### CHANGE FOREGROUND COLOR #######
        fcoloraction = QubForegroundColorAction(name="color", group="image")
        actions.append(fcoloraction)

        ####### MEASURE #######
        measureAction = QubOpenDialogAction(
            parent=self,
            name="measure",
            iconName="measure",
            label="Measure",
            group="Tools",
        )
        measureAction.setConnectCallBack(self._measure_dialog_new)
        actions.append(measureAction)

        self.__mainView = QubMosaicView(self, actions=actions)

        layout = qt.QHBoxLayout(self)
        layout.addWidget(self.__mainView)

        ####### SLOT #######
        self.defineSlot("getView", ())
Exemple #40
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.inExpert = None
        self.slitbox = None
        self.minidiff = None

        self.motorsDialog = MotorsDialog(self)

        self.addProperty('slitbox', 'string', '')
        self.addProperty('minidiff', 'string', '')
        self.addProperty('icons', 'string', '')
        self.addProperty('motorIcons', 'string', '')
        #self.addProperty('title', 'string', 'Beam size')
        self.addProperty('formatString', 'formatString', '##.####')
        self.addProperty('decimalPlaces', 'string', '4')
        self.addProperty('expertOnly', 'boolean', False)

        self.topBox = QHBoxLayout(self)
        self.topBox.setMargin(5)
        self.topBox.setSpacing(20)

        self.beamHorSize = MotorSpinBoxBrick.MotorSpinBoxBrick(self)
        self.topBox.addWidget(self.beamHorSize)
        self.beamHorSize['showMoveButtons'] = False
        self.beamHorSize['showBox'] = False
        self.beamHorSize['showLabel'] = True
        self.beamHorSize['label'] = "Hor"
        self.beamHorSize['showStep'] = False
        self.beamHorSize['showStepList'] = True

        self.beamVerSize = MotorSpinBoxBrick.MotorSpinBoxBrick(self)
        self.topBox.addWidget(self.beamVerSize)
        self.beamVerSize['showMoveButtons'] = False
        self.beamVerSize['showBox'] = False
        self.beamVerSize['showLabel'] = True
        self.beamVerSize['label'] = "Ver"
        self.beamVerSize['showStep'] = False
        self.beamVerSize['showStepList'] = True

        #self.topBox.addSpace(10)
        self.offset_layout = QHBoxLayout(self.topBox, 5)
        self.offsetsLabel = QLabel("Move:", self)
        self.offset_layout.addWidget(self.offsetsLabel)
        self.offsetsButton = QToolButton(self)
        self.offset_layout.addWidget(self.offsetsButton)
        self.offsetsButton.setTextLabel("Offsets")
        self.offsetsButton.setUsesTextLabel(True)
        self.offsetsButton.setTextPosition(QToolButton.BesideIcon)
        QObject.connect(self.offsetsButton, SIGNAL('clicked()'),
                        self.openOffsetsDialog)

        #QVBoxLayout(self)
        #self.layout().addLayout(self.topBox)
        self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
Exemple #41
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.inExpert = None
        self.slitbox = None
        self.minidiff = None

        self.motorsDialog = MotorsDialog(self)

        self.addProperty("slitbox", "string", "")
        self.addProperty("minidiff", "string", "")
        self.addProperty("icons", "string", "")
        self.addProperty("motorIcons", "string", "")
        # self.addProperty('title', 'string', 'Beam size')
        self.addProperty("formatString", "formatString", "##.####")
        self.addProperty("decimalPlaces", "string", "4")
        self.addProperty("expertOnly", "boolean", False)

        self.topBox = QHBoxLayout(self)
        self.topBox.setMargin(5)
        self.topBox.setSpacing(20)

        self.beamHorSize = MotorSpinBoxBrick.MotorSpinBoxBrick(self)
        self.topBox.addWidget(self.beamHorSize)
        self.beamHorSize["showMoveButtons"] = False
        self.beamHorSize["showBox"] = False
        self.beamHorSize["showLabel"] = True
        self.beamHorSize["label"] = "Hor"
        self.beamHorSize["showStep"] = False
        self.beamHorSize["showStepList"] = True

        self.beamVerSize = MotorSpinBoxBrick.MotorSpinBoxBrick(self)
        self.topBox.addWidget(self.beamVerSize)
        self.beamVerSize["showMoveButtons"] = False
        self.beamVerSize["showBox"] = False
        self.beamVerSize["showLabel"] = True
        self.beamVerSize["label"] = "Ver"
        self.beamVerSize["showStep"] = False
        self.beamVerSize["showStepList"] = True

        # self.topBox.addSpace(10)
        self.offset_layout = QHBoxLayout(self.topBox, 5)
        self.offsetsLabel = QLabel("Move:", self)
        self.offset_layout.addWidget(self.offsetsLabel)
        self.offsetsButton = QToolButton(self)
        self.offset_layout.addWidget(self.offsetsButton)
        self.offsetsButton.setTextLabel("Offsets")
        self.offsetsButton.setUsesTextLabel(True)
        self.offsetsButton.setTextPosition(QToolButton.BesideIcon)
        QObject.connect(self.offsetsButton, SIGNAL("clicked()"),
                        self.openOffsetsDialog)

        # QVBoxLayout(self)
        # self.layout().addLayout(self.topBox)
        self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
Exemple #42
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.inExpert=None
        self.slitbox=None
        self.minidiff=None

        self.motorsDialog=MotorsDialog(self)

        self.addProperty('slitbox', 'string', '')
        self.addProperty('minidiff', 'string', '')
        self.addProperty('icons', 'string', '')
        self.addProperty('motorIcons', 'string', '')
        #self.addProperty('title', 'string', 'Beam size')
        self.addProperty('formatString','formatString','##.####')
        self.addProperty('decimalPlaces', 'string', '4')
        self.addProperty('expertOnly', 'boolean', False)

        self.topBox = QHBoxLayout(self)
        self.topBox.setMargin(5)
        self.topBox.setSpacing(20)

        self.beamHorSize=MotorSpinBoxBrick.MotorSpinBoxBrick(self)
        self.topBox.addWidget(self.beamHorSize)
        self.beamHorSize['showMoveButtons']=False
        self.beamHorSize['showBox']=False
        self.beamHorSize['showLabel']=True
        self.beamHorSize['label']="Hor"
        self.beamHorSize['showStep']=False
        self.beamHorSize['showStepList']=True
        
        self.beamVerSize=MotorSpinBoxBrick.MotorSpinBoxBrick(self)
        self.topBox.addWidget(self.beamVerSize)
        self.beamVerSize['showMoveButtons']=False
        self.beamVerSize['showBox']=False
        self.beamVerSize['showLabel']=True
        self.beamVerSize['label']="Ver"
        self.beamVerSize['showStep']=False
        self.beamVerSize['showStepList']=True

        #self.topBox.addSpace(10)
        self.offset_layout = QHBoxLayout(self.topBox, 5)
        self.offsetsLabel=QLabel("Move:",self)
        self.offset_layout.addWidget(self.offsetsLabel)
        self.offsetsButton=QToolButton(self)
        self.offset_layout.addWidget(self.offsetsButton)
        self.offsetsButton.setTextLabel("Offsets")
        self.offsetsButton.setUsesTextLabel(True)
        self.offsetsButton.setTextPosition(QToolButton.BesideIcon)
        QObject.connect(self.offsetsButton, SIGNAL('clicked()'), self.openOffsetsDialog)

        #QVBoxLayout(self)
        #self.layout().addLayout(self.topBox)
        self.setSizePolicy(QSizePolicy.Minimum,QSizePolicy.Fixed)
Exemple #43
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.defineSlot("updateCollectParameters", ())

        self.minikappa = None
        self.motors = {}
        self.__refs = {}
        self.motorSteps = {}
        self.currentMotorName = None

        self.kappaOnOngoing = None
        self.kappaOffOngoing = None

        self.addProperty('mnemonic', 'string', '')
        self.addProperty('commandIcons', 'string', '')
        self.addProperty('motorIcons', 'string', '')
        self.addProperty('formatString', 'formatString', '###.###')
        self.addProperty('decimalPlaces', 'string', '')
        self.addProperty('maxMotorsPerLine', 'integer', 3)

        self.topBox = QHGroupBox("Minikappa", self)
        self.topBox.setInsideMargin(4)
        self.topBox.setInsideSpacing(2)
        self.topBox.setCheckable(True)
        QObject.connect(self.topBox, SIGNAL('toggled(bool)'),
                        self.enableChanged)

        self.motorBox = QVGroupBox("Motors", self.topBox)
        box1 = QHBox(self.motorBox)
        self.motorBox.setInsideMargin(4)
        self.motorBox.setInsideSpacing(2)
        self.motorsList = QComboBox(box1)
        QObject.connect(self.motorsList, SIGNAL('activated(const QString &)'),
                        self.motorChanged)
        self.currentMotor = MotorSpinBoxBrick.MotorSpinBoxBrick(box1)
        self.currentMotor['showMoveButtons'] = False
        self.currentMotor['showBox'] = False
        self.currentMotor['showLabel'] = False
        self.currentMotor['showStep'] = False
        self.currentMotor['showStepList'] = True

        self.motorsGrid = QWidget(self.motorBox)
        QGridLayout(self.motorsGrid, 0, 0, 2, 2)

        self.commands = CommandMenuBrick.CommandMenuBrick(self.topBox)
        self.commands.hideCommands(self.MINIKAPPA_ONOFF_COMMANDS)
        self.kappaOnCmd = None
        self.kappaOffCmd = None
        self.kappaInUseChan = None

        QVBoxLayout(self)
        self.layout().addWidget(self.topBox)
        self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
Exemple #44
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.defineSlot("newScan", ())

        self.defineSlot("newScanPoint", ())

        self.scanObject = None
        self.xdata = []
        self.ydata = []

        self.isConnected = None
        self.canAddPoint = True

        self.addProperty("specVersion", "string", "")
        self.addProperty("backgroundColor", "combo", ("white", "default"),
                         "white")
        self.addProperty("graphColor", "combo", ("white", "default"), "white")
        self.lblTitle = QLabel(self)
        self.graphPanel = QFrame(self)
        buttonBox = QHBox(self)
        self.lblPosition = QLabel(buttonBox)
        self.graph = QtBlissGraph(self.graphPanel)

        QObject.connect(self.graph, PYSIGNAL("QtBlissGraphSignal"),
                        self.handleBlissGraphSignal)
        QObject.disconnect(
            self.graph,
            SIGNAL("plotMousePressed(const QMouseEvent&)"),
            self.graph.onMousePressed,
        )
        QObject.disconnect(
            self.graph,
            SIGNAL("plotMouseReleased(const QMouseEvent&)"),
            self.graph.onMouseReleased,
        )
        self.graph.canvas().setMouseTracking(True)
        self.graph.enableLegend(False)
        self.graph.enableZoom(False)
        self.graph.setAutoLegend(False)
        self.lblPosition.setAlignment(Qt.AlignRight)
        self.lblTitle.setAlignment(Qt.AlignHCenter)
        self.lblTitle.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        self.lblPosition.setSizePolicy(QSizePolicy.Expanding,
                                       QSizePolicy.Fixed)
        buttonBox.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)

        QVBoxLayout(self.graphPanel)
        self.graphPanel.layout().addWidget(self.graph)

        QVBoxLayout(self)
        self.layout().addWidget(self.lblTitle)
        self.layout().addWidget(buttonBox)
        self.layout().addWidget(self.graphPanel)
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.defineSignal('newScan', ())

        self.scanObject = None
        self.xdata = []
        self.ylable = ""
        self.mylog = 0

        self.isConnected = None
        #self.canAddPoint = None
        self.canAddPoint = True

        self.addProperty('specVersion', 'string', '')
        self.addProperty('backgroundColor', 'combo', ('white', 'default'), 'white')
        self.addProperty('graphColor', 'combo', ('white', 'default'), 'white')
        self.lblTitle = QLabel(self)
        self.graphPanel = QFrame(self)
        buttonBox = QHBox(self)
        #self.cmdZoomIn = QToolButton(buttonBox)
        #self.cmdZoomOut = QToolButton(buttonBox)
        self.lblPosition = QLabel(buttonBox)
        self.graph = QtBlissGraph(self.graphPanel)
                         
        QObject.connect(self.graph, PYSIGNAL('QtBlissGraphSignal'), self.handleBlissGraphSignal)
        QObject.disconnect(self.graph, SIGNAL('plotMousePressed(const QMouseEvent&)'), self.graph.onMousePressed)
        QObject.disconnect(self.graph, SIGNAL('plotMouseReleased(const QMouseEvent&)'), self.graph.onMouseReleased)
        #QObject.connect(self.cmdZoomIn, SIGNAL('clicked()'), self.cmdZoomInClicked)
        #QObject.connect(self.cmdZoomOut, SIGNAL('clicked()'), self.cmdZoomOutClicked)

        #self.cmdZoomIn.setIconSet(QIconSet(Icons.load("zoomin")))
        #self.cmdZoomOut.setIconSet(QIconSet(Icons.load("zoomout")))
        #self.cmdZoomIn.setToggleButton(True)
        #self.cmdZoomOut.setToggleButton(True)
        #self.cmdZoomIn.setUsesTextLabel(False)
        #self.cmdZoomOut.setUsesTextLabel(False)
        self.graph.canvas().setMouseTracking(True)
        self.graph.enableLegend(False)
        self.graph.enableZoom(False)
        self.graph.setAutoLegend(False)
        self.lblPosition.setAlignment(Qt.AlignRight)
        self.lblTitle.setAlignment(Qt.AlignHCenter)
        self.lblTitle.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        self.lblPosition.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        buttonBox.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        
        QVBoxLayout(self.graphPanel)
        self.graphPanel.layout().addWidget(self.graph)

        QVBoxLayout(self)
        self.layout().addWidget(self.lblTitle)
        self.layout().addWidget(buttonBox)
        self.layout().addWidget(self.graphPanel)
Exemple #46
0
    def __init__(self, parent, name, uifile='', cmd_name=None):
        BlissWidget.__init__(self, parent, name)

        self._widgetTree = self.loadUIFile(uifile)
        self._widgetTree.reparent(self, qt.QPoint(0, 0))
        layout = qt.QHBoxLayout(self)
        layout.addWidget(self._widgetTree)

        self.addProperty('horizontal', 'string', '')
        self.addProperty('vertical', 'string', '')
        self.addProperty('command', 'string', '')
        self.addProperty("formatString", "formatString", "###.##")
        ####### SIGNAL #######
        self.defineSignal('getView', ())
        self.defineSignal('scanFinished', ())
        ####### SLOT #######
        self.defineSlot("ChangePixelCalibration", ())
        self.defineSlot("ChangeBeamPosition", ())

        self._view = None
        self._beamx, self._beamy = 0, 0
        self._XSize, self._YSize = 1, 1
        self._horizontalMotors = []
        self._verticalMotors = []
        self._graphicSelection = None
        self._SpecCmd = None
        self.__commandName = cmd_name
        self._logArgs = {}
        self._formatString = '%f'

        ####### GUI INIT #######
        gButton = self._widgetTree.child('__grabButton')
        gButton.hide()

        showgButton = self._widgetTree.child('__showGrab')
        showgButton.hide()

        try:
            mvButton = self._widgetTree.child('__movetoStart')
            qt.QObject.connect(mvButton, qt.SIGNAL('clicked()'),
                               self._movetoStart)
            mvButton.hide()
        except:
            pass

        startButton = self._widgetTree.child('__startScan')
        qt.QObject.connect(startButton, qt.SIGNAL('clicked()'),
                           self._startScan)
        startButton.setEnabled(False)

        stopButton = self._widgetTree.child('__stopScan')
        qt.QObject.connect(stopButton, qt.SIGNAL('clicked()'), self._stopScan)
        stopButton.setEnabled(False)
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.defineSlot("newScan", ())

        self.defineSlot("newScanPoint", ())

        self.scanObject = None
        self.xdata = []
        self.ydata = []

        self.isConnected = None
        self.canAddPoint = True

        self.addProperty("specVersion", "string", "")
        self.addProperty("backgroundColor", "combo", ("white", "default"), "white")
        self.addProperty("graphColor", "combo", ("white", "default"), "white")
        self.lblTitle = QLabel(self)
        self.graphPanel = QFrame(self)
        buttonBox = QHBox(self)
        self.lblPosition = QLabel(buttonBox)
        self.graph = QtBlissGraph(self.graphPanel)

        QObject.connect(
            self.graph, PYSIGNAL("QtBlissGraphSignal"), self.handleBlissGraphSignal
        )
        QObject.disconnect(
            self.graph,
            SIGNAL("plotMousePressed(const QMouseEvent&)"),
            self.graph.onMousePressed,
        )
        QObject.disconnect(
            self.graph,
            SIGNAL("plotMouseReleased(const QMouseEvent&)"),
            self.graph.onMouseReleased,
        )
        self.graph.canvas().setMouseTracking(True)
        self.graph.enableLegend(False)
        self.graph.enableZoom(False)
        self.graph.setAutoLegend(False)
        self.lblPosition.setAlignment(Qt.AlignRight)
        self.lblTitle.setAlignment(Qt.AlignHCenter)
        self.lblTitle.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        self.lblPosition.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        buttonBox.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)

        QVBoxLayout(self.graphPanel)
        self.graphPanel.layout().addWidget(self.graph)

        QVBoxLayout(self)
        self.layout().addWidget(self.lblTitle)
        self.layout().addWidget(buttonBox)
        self.layout().addWidget(self.graphPanel)
Exemple #48
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.addProperty("help_url", "string", "http://intranet")
        self.addProperty("browser", "combo", ("default", "mozilla", "netscape"), "default")

        self.cmdShowHelp = ToolButton(self, "rescue", "Help !", self.cmdShowHelpClicked, "Open help web page")

        QVBoxLayout(self)
        self.layout().addWidget(self.cmdShowHelp)

        self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)
Exemple #49
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.addProperty("mnemonic", "string", "")
        self.addProperty("formatString", "formatString", "###.#")
        self.addProperty("warningTemp", "integer", 110)

        self.cryodev = None  # Cryo Hardware Object

        self.containerBox = QVGroupBox("Cryo", self)
        self.containerBox.setInsideMargin(4)
        self.containerBox.setInsideSpacing(0)
        self.containerBox.setAlignment(QLabel.AlignCenter)

        self.temperature = QLabel(self.containerBox)
        self.temperature.setAlignment(QLabel.AlignCenter)
        self.temperature.setPaletteForegroundColor(widget_colors.WHITE)
        # self.temperature.setPaletteBackgroundColor(widget_colors.LIGHT_BLUE)
        font = self.temperature.font()
        font.setStyleHint(QFont.OldEnglish)
        self.temperature.setFont(font)

        # self.level=QProgressBar(self.containerBox)

        # grid1=QWidget(self.containerBox)
        # QGridLayout(grid1, 3, 2, 2, 1)

        # label1=QLabel("Dry:",grid1)
        # grid1.layout().addWidget(label1, 0, 0)
        # self.dryState=QLabel(grid1)
        # self.dryState.setAlignment(QLabel.AlignCenter)
        # self.dryState.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed)
        # grid1.layout().addWidget(self.dryState, 0, 1)

        # label2=QLabel("Superdry:",grid1)
        # grid1.layout().addWidget(label2, 1, 0)
        # self.superdryState=QLabel(grid1)
        # self.superdryState.setAlignment(QLabel.AlignCenter)
        # self.superdryState.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed)
        # grid1.layout().addWidget(self.superdryState, 1, 1)

        # label3=QLabel("Icing:",grid1)
        # grid1.layout().addWidget(label3, 2, 0)
        # self.icingState=QLabel(grid1)
        # self.icingState.setAlignment(QLabel.AlignCenter)
        # self.icingState.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed)
        # grid1.layout().addWidget(self.icingState, 2, 1)

        self.containerBox.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)

        QVBoxLayout(self)
        self.layout().addWidget(self.containerBox)
 def __init__(self,*args) :
     BlissWidget.__init__(self,*args)
     self.__view = None
     self.__drawing = None
     self.__line = None
     self.__pointSelected = None
     self.__graphs = None
     self.__refreshTimer = qt.QTimer(self)
     qt.QObject.connect(self.__refreshTimer,qt.SIGNAL('timeout()'),self.__refreshGraph)
     # Properties
                     ####### SIGNAL #######
     self.defineSignal('getView',())
     self.defineSignal('getImage',())
     self.setFixedSize(0,0)
Exemple #51
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.addProperty("paths", "string", "")

        self.contentsBox = QHGroupBox("Free disk space", self)

        self.diskDisplay = QLabel("********", self.contentsBox)

        self.timer = QTimer()

        QHBoxLayout(self)
        self.setSizePolicy(QSizePolicy.MinimumExpanding,
                           QSizePolicy.MinimumExpanding)
        self.layout().addWidget(self.contentsBox)
Exemple #52
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.addProperty("mnemonic", "string", "")
        self.addProperty("icons", "string", "")
        self.addProperty("formatString", "formatString", "###.##")

        self.beamstop_hwobj = None

        self.top_gbox = qt.QHGroupBox("Beamstop distance", self)
        self.top_gbox.setInsideMargin(4)
        self.top_gbox.setInsideSpacing(2)

        self.params_widget = qt.QWidget(self.top_gbox)
        qt.QGridLayout(self.params_widget, 2, 3, 0, 2)

        label1 = qt.QLabel("Current:", self.params_widget)
        label1.setFixedWidth(70)
        self.params_widget.layout().addWidget(label1, 0, 0)

        self.current_position_ledit = qt.QLineEdit(self.params_widget)
        self.current_position_ledit.setReadOnly(True)
        self.params_widget.layout().addWidget(self.current_position_ledit, 0,
                                              1)

        label2 = qt.QLabel("Set to:", self.params_widget)
        label2.setFixedWidth(70)
        self.params_widget.layout().addWidget(label2, 1, 0)

        self.new_position_ledit = qt.QLineEdit(self.params_widget)
        self.new_position_ledit.setAlignment(qt.QWidget.AlignRight)
        self.params_widget.layout().addWidget(self.new_position_ledit, 1, 1)
        self.new_position_ledit.setValidator(qt.QDoubleValidator(self))
        self.new_position_ledit.setPaletteBackgroundColor(
            BeamstopDistanceBrick.CONNECTED_COLOR)

        qt.QObject.connect(self.new_position_ledit,
                           qt.SIGNAL("returnPressed()"), self.change_position)
        qt.QObject.connect(
            self.new_position_ledit,
            qt.SIGNAL("textChanged(const QString &)"),
            self.input_field_changed,
        )

        self.instanceSynchronize("new_position_ledit")

        qt.QVBoxLayout(self)
        self.layout().addWidget(self.top_gbox)
Exemple #53
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        #
        # add properties
        #
        self.addProperty("iconFile", "file",
                         "Images (*.bmp *.gif *.jpg *.png *.xpm)")
        self.addProperty("hint", "string", "")
        self.addProperty("showSynoptic", "boolean", True)
        self.addProperty("showBorder", "boolean", False)
        self.addProperty("showTitle", "boolean", True)
        self.addProperty("alignment", "combo", ("top", "bottom", "center"),
                         "top")
        self.addProperty("title", "string", "")

        #
        # define BRICK signals/slots
        #
        self.defineSignal("synopticClicked", ())  # signal with no arguments

        #
        # GUI components
        #
        self.__topPanel = QFrame(self)
        self.containerBox = QVBox(self.__topPanel)
        self.__lblTitle = QLabel(self.__topPanel)
        self.__lblTitle.setAutoResize(True)
        self.__synoptic = QLabel(self.__topPanel)

        #
        # layout
        #
        self.setSizePolicy(QSizePolicy.MinimumExpanding,
                           QSizePolicy.MinimumExpanding)

        QVBoxLayout(self, 0, 0)
        self.layout().addWidget(self.__topPanel, 0,
                                Qt.AlignTop | Qt.AlignHCenter)

        QVBoxLayout(self.__topPanel, 2, 2)  # margin, spacing
        self.__topPanel.layout().addWidget(self.__lblTitle, 0,
                                           Qt.AlignTop | Qt.AlignHCenter)
        self.__topPanel.layout().addWidget(self.__synoptic, 0,
                                           Qt.AlignTop | Qt.AlignHCenter)
        self.__topPanel.layout().addWidget(self.containerBox, 0,
                                           Qt.AlignTop | Qt.AlignHCenter)
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        #
        # add properties
        #
        self.addProperty('iconFile', 'file',
                         'Images (*.bmp *.gif *.jpg *.png *.xpm)')
        self.addProperty('hint', 'string', '')
        self.addProperty('showSynoptic', 'boolean', True)
        self.addProperty('showBorder', 'boolean', False)
        self.addProperty('showTitle', 'boolean', True)
        self.addProperty('alignment', 'combo', ('top', 'bottom', 'center'),
                         'top')
        self.addProperty('title', 'string', '')

        #
        # define BRICK signals/slots
        #
        self.defineSignal('synopticClicked', ())  #signal with no arguments

        #
        # GUI components
        #
        self.__topPanel = QFrame(self)
        self.containerBox = QVBox(self.__topPanel)
        self.__lblTitle = QLabel(self.__topPanel)
        self.__lblTitle.setAutoResize(True)
        self.__synoptic = QLabel(self.__topPanel)

        #
        # layout
        #
        self.setSizePolicy(QSizePolicy.MinimumExpanding,
                           QSizePolicy.MinimumExpanding)

        QVBoxLayout(self, 0, 0)
        self.layout().addWidget(self.__topPanel, 0,
                                Qt.AlignTop | Qt.AlignHCenter)

        QVBoxLayout(self.__topPanel, 2, 2)  #margin, spacing
        self.__topPanel.layout().addWidget(self.__lblTitle, 0,
                                           Qt.AlignTop | Qt.AlignHCenter)
        self.__topPanel.layout().addWidget(self.__synoptic, 0,
                                           Qt.AlignTop | Qt.AlignHCenter)
        self.__topPanel.layout().addWidget(self.containerBox, 0,
                                           Qt.AlignTop | Qt.AlignHCenter)
Exemple #55
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)
        self.__pid = -1
        self.__startIdle = qt.QTimer(self)
        qt.QObject.connect(self.__startIdle, qt.SIGNAL('timeout()'),
                           self.__idleRun)

        self.__container = qttools.QtXEmbedContainer(self)
        qt.QObject.connect(self.__container, qt.SIGNAL('clientClosed()'),
                           self.run)
        layout = qt.QVBoxLayout(self)
        layout.addWidget(self.__container)
        self.__container.setSizePolicy(qt.QSizePolicy.Expanding,
                                       qt.QSizePolicy.Expanding)

        qt.QObject.connect(qt.qApp, qt.SIGNAL('aboutToQuit()'),
                           self.__killOxidis)
Exemple #56
0
    def __init__(self, *args):
        BlissWidget.__init__(self, *args)

        self.addProperty("mnemonic", "string", "")

        self.dataCollect = None
        self.stages = {}

        self.containerBox = QVGroupBox(DEFAULT_TITLE, self)
        self.containerBox.setInsideMargin(4)
        self.containerBox.setInsideSpacing(0)
        self.containerBox.setAlignment(QLabel.AlignCenter)

        self.stageBox = QWidget(self.containerBox)
        QGridLayout(self.stageBox, 6, 2, 0, 0)

        self.pic1 = QLabel("<i>1.</i>", self.stageBox)
        self.stageBox.layout().addWidget(self.pic1, 0, 0)
        self.label1 = QLabel("Preparing beamline", self.stageBox)
        self.stageBox.layout().addWidget(self.label1, 0, 1)

        self.pic2 = QLabel("<i>2.</i>", self.stageBox)
        self.stageBox.layout().addWidget(self.pic2, 1, 0)
        self.label2 = QLabel("Mounting sample", self.stageBox)
        self.stageBox.layout().addWidget(self.label2, 1, 1)

        self.pic3 = QLabel("<i>3.</i>", self.stageBox)
        self.stageBox.layout().addWidget(self.pic3, 2, 0)
        self.label3 = QLabel("Centring sample", self.stageBox)
        self.stageBox.layout().addWidget(self.label3, 2, 1)

        self.pic4 = QLabel("<i>4.</i>", self.stageBox)
        self.stageBox.layout().addWidget(self.pic4, 3, 0)
        self.label4 = QLabel("Collecting images", self.stageBox)
        self.stageBox.layout().addWidget(self.label4, 3, 1)

        #self.pic5=QLabel("<i>5.</i>",self.stageBox)
        #self.stageBox.layout().addWidget(self.pic5, 4, 0)
        #self.label5=QLabel("Unmounting sample",self.stageBox)
        #self.stageBox.layout().addWidget(self.label5, 4, 1)

        self.containerBox.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)

        QVBoxLayout(self)
        self.layout().addWidget(self.containerBox)