Changeset 810


Ignore:
Timestamp:
Apr 22, 2012 5:45:27 PM (12 years ago)
Author:
jemian
Message:

updates and simplifications

File:
1 edited

Legend:

Unmodified
Added
Removed
  • moxy/trunk/src/test/SimpleTraitsEpicsTest.py

    r795 r810  
    99########### SVN repository information ###################
    1010
    11 doc = '''
     11DOC = '''
    1212Demonstration of EPICS Probe Application
    1313using Traits and
     
    2828
    2929choose_Qt4 = True
    30 #choose_Qt4 = False
     30choose_Qt4 = False
    3131from traits.etsconfig.api import ETSConfig
    3232if choose_Qt4:
     
    6666        logger = logging.getLogger(__name__)
    6767        logger.debug("callback: %s = %s" % (kw['pvname'], kw['char_value']))
    68         #self._gui.pv_value = kw['char_value']
    69         GUI.invoke_later(self._gui.SetPvValue, kw['char_value'])
     68        self._gui.pv_value = kw['char_value']
     69        #GUI.invoke_later(self._gui.SetPvValue, kw['char_value'])
    7070   
    7171    def ca_connect_callback(self, **kw):
     
    7474        event information will be in kw dictionary
    7575        '''
    76         GUI.invoke_later(self._gui.SetStatus, "%s connected=%s" % (kw['pvname'], kw['conn']))
    77         #self._gui.SetStatus("%s connected=%s" % (kw['pvname'], kw['conn']))
     76        self._gui.SetStatus("%s connected=%s" % (kw['pvname'], kw['conn']))
     77        #GUI.invoke_later(self._gui.SetStatus, "%s connected=%s" % (kw['pvname'], kw['conn']))
    7878   
    7979    def do_watch(self, uinfo):
     
    149149        self.define_gui(uinfo)
    150150        self._gui.SetStatus('showing About box')
    151         ShowAbout().edit_traits()
     151        ShowAbout(text=DOC).edit_traits()
    152152   
    153153    def show_info(self, uinfo):
     
    156156        if self._watching and self._ch is not None:
    157157            self._gui.SetStatus('showing PV info')
    158             ShowInfo(self._ch).edit_traits()
     158            ShowInfo(text=self._ch.info).edit_traits()
    159159        else:
    160160            self._gui.SetStatus('must Watch a PV first')
     
    174174
    175175    my_button_actions = [
    176         Action(name="Watch",  action="do_watch",   desc="start monitoring PV"),
     176        Action(name="Start",  action="do_watch",   desc="start monitoring PV"),
    177177        Action(name="Info",   action="show_info",  desc="show PV info"),
    178         Action(name="Ignore", action="undo_watch", desc="stop monitoring PV"),
     178        Action(name="Stop",  action="undo_watch", desc="stop monitoring PV"),
    179179        Action(name="About",  action='show_about', desc="describe this application"),
    180180    ]
     
    223223    '''dead simple PV Info box'''
    224224    text = Str
    225     view = View( UReadonly('text'))
    226 
    227     def __init__(self, ch, **kwtraits):
    228         '''sets initial status message'''
    229         super(ShowInfo, self).__init__(**kwtraits)
    230         self.text = str(ch.info)
     225    view = View( UReadonly('text'), title='PV info ...' )
    231226   
    232227
    233228class ShowAbout( HasTraits ):
    234229    '''dead simple About box'''
    235     desc = Str(doc)
    236     view = View( UReadonly('desc'))
     230    text = Str
     231    view = View( UReadonly('text'), title='About ...' )
    237232
    238233
Note: See TracChangeset for help on using the changeset viewer.