Changeset 643


Ignore:
Timestamp:
Oct 4, 2011 5:24:14 PM (12 years ago)
Author:
jemian
Message:

add threading

Location:
moxy/trunk/src/moxy
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • moxy/trunk/src/moxy/examples/simple-test.xml

    r642 r643  
    11<?xml version="1.0" ?>
    2 <moxy date="2011-10-04" time="01:23:16" version="1.0">
     2<moxy date="2011-10-04" time="17:17:17" version="1.0">
    33  <XYpair name="a1y &amp; a2y test motors" selected="True">
    44    <EPICS_configuration>
     
    1717      <row name="0.2 mm below" x="-0.01997" y="24.98001"/>
    1818      <row name="my starting position" x="1.1" y="2.2"/>
     19      <row name="small change up" x="2" y="3"/>
     20      <row name="small change down" x="0.5" y="0.5"/>
     21      <row name="zero" x="0" y="0"/>
    1922    </tab>
    2023  </XYpair>
  • moxy/trunk/src/moxy/index.html

    r631 r643  
    2424                                                <h2>A GUI tool for EPICS</h2>
    2525                                                <br/><b>author: Pete R. Jemian (jemian@anl.gov)</b>
    26                                                 <br/><b>version: 0.5</b>
     26                                                <br/><b>version: 0.6</b>
    2727                                        </td>
    2828                                        <td valign="top"><img
  • moxy/trunk/src/moxy/moxy_axis.py

    r642 r643  
    2828import copy
    2929import time
     30import threading
    3031
    3132
     
    3334
    3435
    35 class Axis:
     36class Axis(threading.Thread):
    3637    '''
    37     EPICS PVs and connections for one axis
     38    EPICS PVs and connections for one axis.
     39    Run the EPICS PV monitors in a separate thread so the GUI can be updated.
    3840   
    3941    Example use::
     
    5254    def __init__(self):
    5355        '''declare initial storage'''
     56        threading.Thread.__init__(self)
    5457        self.db = {}                # internal data
    5558        self.pvname = {}            # actual PV name for each field
  • moxy/trunk/src/moxy/pair.py

    r642 r643  
    1111#*************************************************************************
    1212
    13 '''
    14 Define the GUI elements and interface for one X,Y pair
    15 
    16 @version:
    1713########### SVN repository information ###################
    1814# $Date$
     
    2218# $Id$
    2319########### SVN repository information ###################
     20
     21'''
     22Define the GUI elements and interface for one X,Y pair
    2423'''
    2524
     
    348347    def SetEpicsConfig(self, config):
    349348        '''define the EPICS PVs from a configuration
    350            @param config: Python dictionary with axes configurations'''
     349       
     350        :param dict config: Python dictionary with axes configurations
     351        '''
    351352        for axis in ['x', 'y']:
    352353            self.epics[axis].SetConfigure(copy.deepcopy(config[axis]))
     
    358359        field = kw['field']
    359360        value = kw['value']
    360         print "onChangePositions", axis, field, value
     361        #print "onChangePositions", axis, field, value
    361362        if 'precision' in kw:
    362363            # what about display precision?
     
    370371        else:
    371372            str_value = str(value)
    372         # TODO: either callbacks or widget updates should be in a different thread
    373373        self.widget[axis][field].SetLabel(str_value)
    374374        self.Layout()
     
    380380        field = kw['field']
    381381        value = kw['value']
    382         print "onChangePositions", axis, field, value
     382        #print "onChangeTitle", axis, field, value
    383383        self.titles[axis][field] = value
    384384        title = "%s, %s" % (self.titles[axis]['DESC'], self.titles[axis]['EGU'])
    385         # TODO: either callbacks or widget updates should be in a different thread
    386385        self.widget[axis]['title'].SetLabel(title)
    387386
     
    392391        axis = kw['axis']
    393392        value = kw['value']
    394         # TODO: either callbacks or widget updates should be in a different thread
    395393        self.SetMotorColor(axis, value == 1)
    396394
     
    410408            if not item.Connect(**redirects):
    411409                raise RuntimeError, "Did not connect %s axis" % axis
     410            # TODO: initial RBV connection does not generate a monitor, fake it here somehow
    412411
    413412    def ReleaseEpics(self):
Note: See TracChangeset for help on using the changeset viewer.