Changeset 810
- Timestamp:
- Apr 22, 2012 5:45:27 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
moxy/trunk/src/test/SimpleTraitsEpicsTest.py
r795 r810 9 9 ########### SVN repository information ################### 10 10 11 doc= '''11 DOC = ''' 12 12 Demonstration of EPICS Probe Application 13 13 using Traits and … … 28 28 29 29 choose_Qt4 = True 30 #choose_Qt4 = False30 choose_Qt4 = False 31 31 from traits.etsconfig.api import ETSConfig 32 32 if choose_Qt4: … … 66 66 logger = logging.getLogger(__name__) 67 67 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']) 70 70 71 71 def ca_connect_callback(self, **kw): … … 74 74 event information will be in kw dictionary 75 75 ''' 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'])) 78 78 79 79 def do_watch(self, uinfo): … … 149 149 self.define_gui(uinfo) 150 150 self._gui.SetStatus('showing About box') 151 ShowAbout( ).edit_traits()151 ShowAbout(text=DOC).edit_traits() 152 152 153 153 def show_info(self, uinfo): … … 156 156 if self._watching and self._ch is not None: 157 157 self._gui.SetStatus('showing PV info') 158 ShowInfo( self._ch).edit_traits()158 ShowInfo(text=self._ch.info).edit_traits() 159 159 else: 160 160 self._gui.SetStatus('must Watch a PV first') … … 174 174 175 175 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"), 177 177 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"), 179 179 Action(name="About", action='show_about', desc="describe this application"), 180 180 ] … … 223 223 '''dead simple PV Info box''' 224 224 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 ...' ) 231 226 232 227 233 228 class ShowAbout( HasTraits ): 234 229 '''dead simple About box''' 235 desc = Str(doc)236 view = View( UReadonly(' desc'))230 text = Str 231 view = View( UReadonly('text'), title='About ...' ) 237 232 238 233
Note: See TracChangeset
for help on using the changeset viewer.