Changeset 843


Ignore:
Timestamp:
Apr 29, 2012 9:37:02 AM (10 years ago)
Author:
jemian
Message:

work-in-progress

Location:
moxy/trunk/src/moxy/qtlib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • moxy/trunk/src/moxy/qtlib/CaQLabel.py

    r842 r843  
    2828    # TODO: need to superclass a lot of this
    2929
    30     def __init__(self, text=''):
     30    def __init__(self):
    3131        '''
    3232        :param str text: initial Label text (really, we can ignore this)
    3333        '''
    34         self.text = text
    35         PySide.QtGui.QLabel.__init__(self, text)
     34        self.text = ' '*4
     35        PySide.QtGui.QLabel.__init__(self, self.text)
    3636
    3737        # define the signals we'll use in the camonitor handler to update the GUI
     
    141141    def __init__(self, parent=None, pvname=''):
    142142        PySide.QtGui.QWidget.__init__(self, parent)
    143         self.value  = CaQLabel(pvname)
     143        self.value  = CaQLabel()
    144144
    145145        grid = PySide.QtGui.QGridLayout()
  • moxy/trunk/src/moxy/qtlib/pv.py

    r842 r843  
    1414Copyright (c) 2009 - 2012, UChicago Argonne, LLC.
    1515See LICENSE file for details.
    16 
    17 GUI will look like this:
    18 
    19 ===========
    20 ===========
    21 upper panel
    22 lower panel
    23 ===========
    24 
    25 
    26 Upper Panel will look like this:
    27 
    28 =============  ======================
    29 =============  ======================
    30 PV name        [text entry]
    31 value          [label from CAmonitor]
    32 =============  ======================
    33 
    34 Lower Panel will look like this:
    35 =====================================
    36 =====================================
    37 [text entry for status messages]
    38 [text entry for debugging content]
    39 [btnConnect] [btnDisconnect]
    40 =====================================
    4116'''
    4217
     
    5934
    6035        name_label  = PySide.QtGui.QLabel("PV Name:")
    61         self.pvname = PySide.QtGui.QLineEdit()
    62         self.pvname.setText(pvname)
     36        self.pvname = PySide.QtGui.QLineEdit(pvname)
     37        self.pvname.returnPressed.connect(self.onPVNameReturn)
    6338        value_label = PySide.QtGui.QLabel("PV Value:")
    64         self.value  = CaQLabel(" "*4
     39        self.value  = CaQLabel(
    6540       
    6641        status_label  = PySide.QtGui.QLabel("status:")
     
    7651        self.sig_content = tools.CaQSignalDef()
    7752        self.sig_content.newText.connect(self.SetContent)
    78 
    79         self.pvname.returnPressed.connect(self.onPVNameReturn)
    8053
    8154        grid = PySide.QtGui.QGridLayout()
     
    9467            self.onPVNameReturn()
    9568
    96     def onPVNameReturn(self):
     69    def onPVNameReturn(self, *args, **kw):
    9770        self.value.connect(self.pvname.text(),
    9871                           ca_callback=self.pv_update,
     
    10780        self.sig_content.newText.emit()
    10881   
    109     def SetStatus(self):
     82    def SetStatus(self, *args, **kw):
    11083        self.status.setText(self.status_text)
    11184   
    112     def SetContent(self):
     85    def SetContent(self, *args, **kw):
    11386        self.content.setText(self.content_text)
    11487
Note: See TracChangeset for help on using the changeset viewer.