Changeset 635


Ignore:
Timestamp:
Sep 9, 2011 12:29:58 PM (12 years ago)
Author:
jemian
Message:

fix the imports, add some TODO items - more to come

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

Legend:

Unmodified
Added
Removed
  • moxy/trunk/src/moxy/menuLauncher.py

    r631 r635  
    3737            ("xman", "X11 man pages", "xman -bothshown"),
    3838            ("xeyes", "Here's looking at you, kid!", "xeyes"),
    39             ("wxmtxy", "motor tool", "/APSshare/bin/python ./wxmtxy.py"),
     39            ("moxy", "motor tool", "/APSshare/bin/python ./moxy.py"),
    4040            ("separator", ),
    4141            ("xclock", "conventional analog clock", "xclock")
  • moxy/trunk/src/moxy/moxy

    r631 r635  
    11#!/bin/bash
    22
    3 /APSshare/bin/python  /APSshare/pythonlib/wxmtxy/wxmtxy.py $*
     3# TODO: refactor this
     4/APSshare/bin/python  /APSshare/pythonlib/moxy/moxy.py $*
    45
    56
  • moxy/trunk/src/moxy/moxy.py

    r631 r635  
    2020
    2121'''
    22 GUI for wxmtxy
     22GUI for moxy
    2323
    2424README
    2525
    26     *wxmtxy* (an EPICS GUI tool) provides support for an X,Y positioner
     26    *moxy* (an EPICS GUI tool) provides support for an X,Y positioner
    2727    (motor) pair by allowing users to define a table of known positions
    2828    and providing a one-button click to drive a chosen X,Y pair to a specific
     
    3434
    3535
    36     wxmtxy is based on wxPython and relies on CaChannel to communicate
     36    moxy is based on wxPython and relies on CaChannel to communicate
    3737    with EPICS.
    3838   
     
    4545    For more help, explanations are provided in the HTML pages.
    4646   
    47     :see: TRAC wiki https://subversion.xor.aps.anl.gov/trac/bcdaext/wiki/wxmtxy
     47    :see: TRAC wiki https://subversion.xor.aps.anl.gov/trac/bcdaext/wiki/moxy
    4848   
    49     :note: subversion checkout:  svn co https://subversion.xor.aps.anl.gov/bcdaext/wxmtxy/
     49    :note: subversion checkout:  svn co https://subversion.xor.aps.anl.gov/bcdaext/moxy/
    5050
    5151----
  • moxy/trunk/src/moxy/moxy_xml.py

    r631 r635  
    1010#*************************************************************************
    1111
    12 '''@note: support the XML settings file for the wxmtxy application
     12'''@note: support the XML settings file for the moxy application
    1313
    1414This Python file provides routines to read and write XML settings
    15 files for the wxmtxy application.  An example of the XML file is
     15files for the moxy application.  An example of the XML file is
    1616shown below.  The routines manage the settings internally with a
    1717Python dictionary.  Interface routines are used to read and write
     
    3333@note: Here is an example XML file:
    3434<?xml version="1.0" ?>
    35 <wxmtxy date="2009-04-09" time="10:27:00" version="1.0">
     35<moxy date="2009-04-09" time="10:27:00" version="1.0">
    3636  <XYpair name="example" selected="True">
    3737    <EPICS_configuration>
     
    6767    <tab name="page 3">
    6868  </XYpair>
    69 </wxmtxy>
     69</moxy>
    7070
    7171@note: Here is an example Python dictionary of the EPICS configuration above:
     
    9191import datetime
    9292import copy
    93 import wxmtxy_axis
     93import moxy_axis
    9494
    9595
     
    100100        '''prepare the settings file
    101101            @param settingsFile: [string] name of XML file with settings'''
    102         self.rootElement = 'wxmtxy'
     102        self.rootElement = 'moxy'
     103        # TODO: consider supporting legacy 'wxmtxy' root elements, too
    103104        self.Clear()
    104105        self.SetSettingsFile(settingsFile)
     
    182183            epicsdb[axis] = {}
    183184            axisdb = epicsdb[axis]
    184             for field in wxmtxy_axis.field_list:
     185            for field in moxy_axis.field_list:
    185186                axisdb[field] = ""
    186187            axisdb[u"isMotorRec"] = False
     
    204205            @param pairnum: [int] index number of the XY_pair'
    205206            @param axis: [string] "x" or "y"'
    206             @param field: [string] member of wxmtxy_axis.field_list'
     207            @param field: [string] member of moxy_axis.field_list'
    207208            @param value: [string] value of this field'''
    208209        try:
     
    502503                        self._SetAttr(node, field, str(epicsdb[axis][field]))
    503504                        axisnode.appendChild(node)
    504                     for field in wxmtxy_axis.field_list:
     505                    for field in moxy_axis.field_list:
    505506                        if field in epicsdb[axis]:
    506507                            if len(epicsdb[axis][field])>0:
  • moxy/trunk/src/moxy/pair.py

    r631 r635  
    2626import wx
    2727import wx.lib.stattext
    28 import wxmtxy_tab
    29 import wxmtxy_row
    30 import wxmtxy_axis
     28import tab
     29import row
     30import moxy_axis
    3131import wx.lib.scrolledpanel
    3232#import pvConnect
     
    223223        self.titles = {}
    224224        for axis in ['x', 'y']:
    225             self.epics[axis] = wxmtxy_axis.Axis()
     225            self.epics[axis] = moxy_axis.Axis()
    226226            self.titles[axis] = {}
    227227            for field in ['DESC', 'EGU']:
     
    248248        '''make a new tab
    249249           @param newrow: [Boolean] option to create a first row'''
    250         panel = wxmtxy_tab.Tab(parent=self.table, pair=self,
     250        panel = tab.Tab(parent=self.table, pair=self,
    251251                       pairCallback=self.TabHandler, newrow=newrow)
    252252        self.tab_count += 1
     
    267267    def TabHandler(self, theTab, theRow, command):
    268268        '''Callback function to handle a command from a tab
    269            @param theTab: wxmtxy_tab.Tab object
    270            @param theRow: wxmtxy_row.Row object
     269           @param theTab: tab.Tab object
     270           @param theRow: row.Row object
    271271           @param command: [string] Row button action to pass upward for handling'''
    272272        self.rootCallback(self, theTab, theRow, command)
     
    390390        '''try to connect the XY_pair PV names with EPICS'''
    391391        #+++++++++++++++++++++++++++++++
    392         # need to replace this starting from the example in wxmtxy_axis.main()
     392        # need to replace this starting from the example in moxy_axis.main()
    393393        #+++++++++++++++++++++++++++++++
    394394        for axis in ['x', 'y']:
  • moxy/trunk/src/moxy/pvsetup.py

    r631 r635  
    2929import pvConnect
    3030import pprint
    31 import wxmtxy_axis
     31import moxy_axis
    3232import inspect
    3333import os
     
    296296            xref[field].SetValue(config[field])
    297297            isMotorRec = config[field]
    298         for field in wxmtxy_axis.field_list:
     298        for field in moxy_axis.field_list:
    299299            if config.has_key(field):
    300300                #pprint.pprint(config)
     
    327327        '''change the background color on the given widgets
    328328            @param axis: [string] "x" or "y"
    329             @param field: [string] member of wxmtxy_axis.field_list'''
     329            @param field: [string] member of moxy_axis.field_list'''
    330330        pv = self.widget[axis][field].GetValue()
    331331        isMotorRec = self.widget[axis]['isMotorRec'].GetValue()
     
    351351            field = 'isMotorRec'
    352352            config[axis][field]=self.widget[axis][field].GetValue()
    353             for field in wxmtxy_axis.field_list:
     353            for field in moxy_axis.field_list:
    354354                config[axis][field]=self.widget[axis][field].GetValue()
    355355        return config
     
    379379           @param axis: [string] "x" or "y"'''
    380380        config = {'isMotorRec': False}
    381         for field in wxmtxy_axis.field_list:
     381        for field in moxy_axis.field_list:
    382382            config[field] = ''
    383383        self._applyConfiguration_(self.widget[axis], config)
  • moxy/trunk/src/moxy/root.py

    r631 r635  
    1111#*************************************************************************
    1212
    13 '''wxmtxy_root: Define the GUI elements and interface (this is the main code)
     13'''root: Define the GUI elements and interface (this is the main code)
    1414
    1515########### SVN repository information ###################
     
    2727import os, datetime, copy, inspect, wx
    2828from wx.lib.wordwrap import wordwrap
    29 import wxmtxy_pair
    30 import wxmtxy_tab
    31 import wxmtxy_row
    32 import wxmtxy_xml
    33 import wxmtxy_pvsetup
    34 import wxmtxy_version
    35 import wxmtxy_htmlview
     29import pair
     30import tab
     31import row
     32import moxy_xml
     33import pvsetup
     34import version
     35import htmlview
    3636
    3737
     
    6565
    6666class root(wx.Frame):
    67     '''wxmtxy: Define the GUI elements and interface'''
     67    '''moxy: Define the GUI elements and interface'''
    6868
    6969    # see:  http://wiki.wxpython.org/BoaFAQ   
     
    152152              text='Preferences ...\tAlt+p')
    153153        parent.AppendSeparator()
    154         parent.Append(help=u'Quit the wxmtxy application',
     154        parent.Append(help=u'Quit the moxy application',
    155155              id=wxID_ROOTMENUFILEEXIT, kind=wx.ITEM_NORMAL, text=u'Exit')
    156156        self.Bind(wx.EVT_MENU, self.OnMenuFileExitMenu,
     
    177177        parent.Append(help=u'Not ready yet', id=wxID_ROOTMENUABOUTHELP,
    178178              kind=wx.ITEM_NORMAL, text=u'Help')
    179         parent.Append(help=u'General information about wxmtxy',
     179        parent.Append(help=u'General information about moxy',
    180180              id=wxID_ROOTMENUABOUTABOUT, kind=wx.ITEM_NORMAL,
    181181              text=u'About ...')
     
    213213        wx.Frame.__init__(self, id=wxID_ROOT, name=u'root', parent=prnt,
    214214              pos=wx.Point(312, 25), size=wx.Size(416, 504),
    215               style=wx.DEFAULT_FRAME_STYLE, title=u'wxmtxy')
     215              style=wx.DEFAULT_FRAME_STYLE, title=u'moxy')
    216216        self._init_utils()
    217217        self.SetClientSize(wx.Size(408, 470))
     
    255255    def PairHandler(self, thePair, theTab, theRow, command):
    256256        '''Callback function to handle a command from a pair
    257             @param thePair: wxmtxy_pair.XYpair object
    258             @param theTab: wxmtxy_tab.Tab object
    259             @param theRow: wxmtxy_row.Row object
     257            @param thePair: pair.XYpair object
     258            @param theTab: tab.Tab object
     259            @param theRow: row.Row object
    260260            @param command: [string] action from Row button'''
    261261        commandSet = ['delete', 'set', 'go', 'stop']
     
    287287        name = 'panel' + repr(self.paircounter)
    288288        text = 'pair ' + repr(self.paircounter)
    289         panel = wxmtxy_pair.XYpair(name=name, parent=self.pagebook,
     289        panel = pair.XYpair(name=name, parent=self.pagebook,
    290290                   root=self, rootCallback=self.PairHandler, newtab=newtab)
    291291        self.pagebook.AddPage(imageId=-1, page=panel, select=True, text=text)
     
    351351    def DeleteRow(self, thePair, theTab, theRow):
    352352        '''Process a 'delete' command from a row button
    353             @param thePair: wxmtxy_pair.XYpair object
    354             @param theTab: wxmtxy_tab.Tab object
    355             @param theRow: wxmtxy_row.Row object'''
     353            @param thePair: pair.XYpair object
     354            @param theTab: tab.Tab object
     355            @param theRow: row.Row object'''
    356356        text = 'Delete row labeled: %s' % theRow.GetLabel()
    357357        # confirm this step
     
    365365    def SetRow(self, thePair, theTab, theRow):
    366366        '''Process a 'set' command from a row button
    367             @param thePair: wxmtxy_pair.XYpair object
    368             @param theTab: wxmtxy_tab.Tab object
    369             @param theRow: wxmtxy_row.Row object'''
     367            @param thePair: pair.XYpair object
     368            @param theTab: tab.Tab object
     369            @param theRow: row.Row object'''
    370370        text = theRow.GetLabel()
    371371        self.SetStatusText('Set X, Y on row labeled: %s' % text)
     
    381381    def GoRow(self, thePair, theTab, theRow):
    382382        '''Process a 'go' command from a row button
    383             @param thePair: wxmtxy_pair.XYpair object
    384             @param theTab: wxmtxy_tab.Tab object
    385             @param theRow: wxmtxy_row.Row object'''
     383            @param thePair: pair.XYpair object
     384            @param theTab: tab.Tab object
     385            @param theRow: row.Row object'''
    386386        text = theRow.GetLabel()
    387387        self.SetStatusText('Move EPICS motors on row labeled: %s' % text)
     
    401401        '''Process a 'stop' command from a stop button.
    402402           Need to stop the two associated positioners.
    403             @param thePair: wxmtxy_pair.XYpair object'''
     403            @param thePair: pair.XYpair object'''
    404404        thePair.StopAxes()
    405405        title = thePair.GetPageTitle()
     
    442442            @param settingsFile: [string] name of the XML file'''
    443443        try:
    444             rc = wxmtxy_xml.Settings(settingsFile)
     444            rc = moxy_xml.Settings(settingsFile)
    445445            result = rc.ReadXmlFile()
    446446            if result != None:
     
    486486        '''Save the current settings to the named settings file
    487487            @param settingsFile: [string] name of the XML file'''
    488         rc = wxmtxy_xml.Settings(settingsFile)
     488        rc = moxy_xml.Settings(settingsFile)
    489489        selectedpair = self.pagebook.GetSelection()
    490490        for pairnum in range(self.pagebook.GetPageCount()):
     
    530530        # First we create and fill the info object
    531531        info = wx.AboutDialogInfo()
    532         info.Name = wxmtxy_version.__summary__
    533         info.Version = wxmtxy_version.__version__
    534         info.Copyright = wxmtxy_version.__copyright__
     532        info.Name = version.__summary__
     533        info.Version = version.__version__
     534        info.Copyright = version.__copyright__
    535535        description = ''
    536         for line in wxmtxy_version.__documentation__.strip().splitlines():
     536        for line in version.__documentation__.strip().splitlines():
    537537            item = line.strip()
    538538            if len(item) > 0:
     
    541541                description += '\n\n'
    542542        info.Description = wordwrap(description, 400, wx.ClientDC(self))
    543         URL = wxmtxy_version.__url__
    544         info.WebSite = (URL, wxmtxy_version.__svndesc__)
    545         author = wxmtxy_version.__author__
    546         author += ", " + wxmtxy_version.__author_email__
     543        URL = version.__url__
     544        info.WebSite = (URL, version.__svndesc__)
     545        author = version.__author__
     546        author += ", " + version.__author_email__
    547547        others = [ "author: ", author ]
    548         others.extend(wxmtxy_version.__contributor_credits__)
     548        others.extend(version.__contributor_credits__)
    549549        info.Developers = others
    550         info.License = wxmtxy_version.__license__
     550        info.License = version.__license__
    551551        # Then we call wx.AboutBox giving it the info object
    552552        wx.AboutBox(info)
     
    796796        root_dir = os.path.split(inspect.getsourcefile(root))[0]
    797797        fullname = os.path.join(root_dir, page)
    798         wxmtxy_htmlview.HtmlView(parent=None,
     798        htmlview.HtmlView(parent=None,
    799799            homepage=fullname, id=-1,
    800800            title='HtmlView: '+page).Show()
     
    809809            return      # early
    810810        orig_cfg = copy.deepcopy(self.GetEpicsConfig(pagenum))
    811         dlg = wxmtxy_pvsetup.PvDialog(None, orig_cfg)
     811        dlg = pvsetup.PvDialog(None, orig_cfg)
    812812        try:
    813813            result = dlg.ShowModal()
  • moxy/trunk/src/moxy/row.py

    r631 r635  
    3232
    3333class Row(wx.Panel):
    34     '''One row of settings in a wxmtxy table'''
     34    '''One row of settings in a moxy table'''
    3535
    3636    def _init_coll_sizer_Items(self, parent):
  • moxy/trunk/src/moxy/tab.py

    r631 r635  
    2424
    2525import wx
    26 import wxmtxy_row
     26import row
    2727import wx.lib.scrolledpanel
    2828
     
    7474        '''Make a new row and append it to the current tab
    7575            @param remap: [Boolean] option to call self.Remap()'''
    76         panel = wxmtxy_row.Row(self, self.RowHandler)
     76        panel = row.Row(self, self.RowHandler)
    7777        self.sizer.AddWindow(panel, 0, border=2, flag=wx.GROW)
    7878        if remap:
  • moxy/trunk/src/moxy/version.py

    r631 r635  
    1414
    1515'''
    16 version information for wxmtxy
     16version information for moxy
    1717
    1818########### SVN repository information ###################
     
    4040#fp.close()
    4141__license__ = "APS extensions license.  See LICENSE file for details"
    42 __long_description__ = '''wxmtxy is an EPICS GUI tool to assist users in routine operation of positioning devices'''
    43 __main_script__ = "wxmtxy.py"
    44 __summary__ = "wxmtxy: a GUI tool for EPICS"
    45 __target_name__ = "wxmtxy"
    46 __url__ = "https://subversion.xor.aps.anl.gov/trac/bcdaext/wiki/wxmtxy"
    47 __urlsvn__ = "https://subversion.xor.aps.anl.gov/bcdaext/wxmtxy"
    48 __svndesc__ = 'wxmtxy SVN repo page'
     42__long_description__ = '''moxy is an EPICS GUI tool to assist users in routine operation of positioning devices'''
     43__main_script__ = "moxy.py"
     44__summary__ = "moxy: a GUI tool for EPICS"
     45__target_name__ = "moxy"
     46__url__ = "https://subversion.xor.aps.anl.gov/trac/bcdaext/wiki/moxy"
     47__urlsvn__ = "https://subversion.xor.aps.anl.gov/bcdaext/moxy"
     48__svndesc__ = 'moxy SVN repo page'
    4949__documentation__ = '''
    50     *wxmtxy* (an EPICS GUI tool) provides support for an X,Y positioner
     50    *moxy* (an EPICS GUI tool) provides support for an X,Y positioner
    5151    (motor) pair by allowing users to define a table of known positions
    5252    and providing a one-button click to drive a chosen X,Y pair to a specific
Note: See TracChangeset for help on using the changeset viewer.