Changeset 635
- Timestamp:
- Sep 9, 2011 12:29:58 PM (12 years ago)
- Location:
- moxy/trunk/src/moxy
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
moxy/trunk/src/moxy/menuLauncher.py
r631 r635 37 37 ("xman", "X11 man pages", "xman -bothshown"), 38 38 ("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"), 40 40 ("separator", ), 41 41 ("xclock", "conventional analog clock", "xclock") -
moxy/trunk/src/moxy/moxy
r631 r635 1 1 #!/bin/bash 2 2 3 /APSshare/bin/python /APSshare/pythonlib/wxmtxy/wxmtxy.py $* 3 # TODO: refactor this 4 /APSshare/bin/python /APSshare/pythonlib/moxy/moxy.py $* 4 5 5 6 -
moxy/trunk/src/moxy/moxy.py
r631 r635 20 20 21 21 ''' 22 GUI for wxmtxy22 GUI for moxy 23 23 24 24 README 25 25 26 * wxmtxy* (an EPICS GUI tool) provides support for an X,Y positioner26 *moxy* (an EPICS GUI tool) provides support for an X,Y positioner 27 27 (motor) pair by allowing users to define a table of known positions 28 28 and providing a one-button click to drive a chosen X,Y pair to a specific … … 34 34 35 35 36 wxmtxy is based on wxPython and relies on CaChannel to communicate36 moxy is based on wxPython and relies on CaChannel to communicate 37 37 with EPICS. 38 38 … … 45 45 For more help, explanations are provided in the HTML pages. 46 46 47 :see: TRAC wiki https://subversion.xor.aps.anl.gov/trac/bcdaext/wiki/ wxmtxy47 :see: TRAC wiki https://subversion.xor.aps.anl.gov/trac/bcdaext/wiki/moxy 48 48 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/ 50 50 51 51 ---- -
moxy/trunk/src/moxy/moxy_xml.py
r631 r635 10 10 #************************************************************************* 11 11 12 '''@note: support the XML settings file for the wxmtxy application12 '''@note: support the XML settings file for the moxy application 13 13 14 14 This Python file provides routines to read and write XML settings 15 files for the wxmtxy application. An example of the XML file is15 files for the moxy application. An example of the XML file is 16 16 shown below. The routines manage the settings internally with a 17 17 Python dictionary. Interface routines are used to read and write … … 33 33 @note: Here is an example XML file: 34 34 <?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"> 36 36 <XYpair name="example" selected="True"> 37 37 <EPICS_configuration> … … 67 67 <tab name="page 3"> 68 68 </XYpair> 69 </ wxmtxy>69 </moxy> 70 70 71 71 @note: Here is an example Python dictionary of the EPICS configuration above: … … 91 91 import datetime 92 92 import copy 93 import wxmtxy_axis93 import moxy_axis 94 94 95 95 … … 100 100 '''prepare the settings file 101 101 @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 103 104 self.Clear() 104 105 self.SetSettingsFile(settingsFile) … … 182 183 epicsdb[axis] = {} 183 184 axisdb = epicsdb[axis] 184 for field in wxmtxy_axis.field_list:185 for field in moxy_axis.field_list: 185 186 axisdb[field] = "" 186 187 axisdb[u"isMotorRec"] = False … … 204 205 @param pairnum: [int] index number of the XY_pair' 205 206 @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' 207 208 @param value: [string] value of this field''' 208 209 try: … … 502 503 self._SetAttr(node, field, str(epicsdb[axis][field])) 503 504 axisnode.appendChild(node) 504 for field in wxmtxy_axis.field_list:505 for field in moxy_axis.field_list: 505 506 if field in epicsdb[axis]: 506 507 if len(epicsdb[axis][field])>0: -
moxy/trunk/src/moxy/pair.py
r631 r635 26 26 import wx 27 27 import wx.lib.stattext 28 import wxmtxy_tab29 import wxmtxy_row30 import wxmtxy_axis28 import tab 29 import row 30 import moxy_axis 31 31 import wx.lib.scrolledpanel 32 32 #import pvConnect … … 223 223 self.titles = {} 224 224 for axis in ['x', 'y']: 225 self.epics[axis] = wxmtxy_axis.Axis()225 self.epics[axis] = moxy_axis.Axis() 226 226 self.titles[axis] = {} 227 227 for field in ['DESC', 'EGU']: … … 248 248 '''make a new tab 249 249 @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, 251 251 pairCallback=self.TabHandler, newrow=newrow) 252 252 self.tab_count += 1 … … 267 267 def TabHandler(self, theTab, theRow, command): 268 268 '''Callback function to handle a command from a tab 269 @param theTab: wxmtxy_tab.Tab object270 @param theRow: wxmtxy_row.Row object269 @param theTab: tab.Tab object 270 @param theRow: row.Row object 271 271 @param command: [string] Row button action to pass upward for handling''' 272 272 self.rootCallback(self, theTab, theRow, command) … … 390 390 '''try to connect the XY_pair PV names with EPICS''' 391 391 #+++++++++++++++++++++++++++++++ 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() 393 393 #+++++++++++++++++++++++++++++++ 394 394 for axis in ['x', 'y']: -
moxy/trunk/src/moxy/pvsetup.py
r631 r635 29 29 import pvConnect 30 30 import pprint 31 import wxmtxy_axis31 import moxy_axis 32 32 import inspect 33 33 import os … … 296 296 xref[field].SetValue(config[field]) 297 297 isMotorRec = config[field] 298 for field in wxmtxy_axis.field_list:298 for field in moxy_axis.field_list: 299 299 if config.has_key(field): 300 300 #pprint.pprint(config) … … 327 327 '''change the background color on the given widgets 328 328 @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''' 330 330 pv = self.widget[axis][field].GetValue() 331 331 isMotorRec = self.widget[axis]['isMotorRec'].GetValue() … … 351 351 field = 'isMotorRec' 352 352 config[axis][field]=self.widget[axis][field].GetValue() 353 for field in wxmtxy_axis.field_list:353 for field in moxy_axis.field_list: 354 354 config[axis][field]=self.widget[axis][field].GetValue() 355 355 return config … … 379 379 @param axis: [string] "x" or "y"''' 380 380 config = {'isMotorRec': False} 381 for field in wxmtxy_axis.field_list:381 for field in moxy_axis.field_list: 382 382 config[field] = '' 383 383 self._applyConfiguration_(self.widget[axis], config) -
moxy/trunk/src/moxy/root.py
r631 r635 11 11 #************************************************************************* 12 12 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) 14 14 15 15 ########### SVN repository information ################### … … 27 27 import os, datetime, copy, inspect, wx 28 28 from wx.lib.wordwrap import wordwrap 29 import wxmtxy_pair30 import wxmtxy_tab31 import wxmtxy_row32 import wxmtxy_xml33 import wxmtxy_pvsetup34 import wxmtxy_version35 import wxmtxy_htmlview29 import pair 30 import tab 31 import row 32 import moxy_xml 33 import pvsetup 34 import version 35 import htmlview 36 36 37 37 … … 65 65 66 66 class root(wx.Frame): 67 ''' wxmtxy: Define the GUI elements and interface'''67 '''moxy: Define the GUI elements and interface''' 68 68 69 69 # see: http://wiki.wxpython.org/BoaFAQ … … 152 152 text='Preferences ...\tAlt+p') 153 153 parent.AppendSeparator() 154 parent.Append(help=u'Quit the wxmtxy application',154 parent.Append(help=u'Quit the moxy application', 155 155 id=wxID_ROOTMENUFILEEXIT, kind=wx.ITEM_NORMAL, text=u'Exit') 156 156 self.Bind(wx.EVT_MENU, self.OnMenuFileExitMenu, … … 177 177 parent.Append(help=u'Not ready yet', id=wxID_ROOTMENUABOUTHELP, 178 178 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', 180 180 id=wxID_ROOTMENUABOUTABOUT, kind=wx.ITEM_NORMAL, 181 181 text=u'About ...') … … 213 213 wx.Frame.__init__(self, id=wxID_ROOT, name=u'root', parent=prnt, 214 214 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') 216 216 self._init_utils() 217 217 self.SetClientSize(wx.Size(408, 470)) … … 255 255 def PairHandler(self, thePair, theTab, theRow, command): 256 256 '''Callback function to handle a command from a pair 257 @param thePair: wxmtxy_pair.XYpair object258 @param theTab: wxmtxy_tab.Tab object259 @param theRow: wxmtxy_row.Row object257 @param thePair: pair.XYpair object 258 @param theTab: tab.Tab object 259 @param theRow: row.Row object 260 260 @param command: [string] action from Row button''' 261 261 commandSet = ['delete', 'set', 'go', 'stop'] … … 287 287 name = 'panel' + repr(self.paircounter) 288 288 text = 'pair ' + repr(self.paircounter) 289 panel = wxmtxy_pair.XYpair(name=name, parent=self.pagebook,289 panel = pair.XYpair(name=name, parent=self.pagebook, 290 290 root=self, rootCallback=self.PairHandler, newtab=newtab) 291 291 self.pagebook.AddPage(imageId=-1, page=panel, select=True, text=text) … … 351 351 def DeleteRow(self, thePair, theTab, theRow): 352 352 '''Process a 'delete' command from a row button 353 @param thePair: wxmtxy_pair.XYpair object354 @param theTab: wxmtxy_tab.Tab object355 @param theRow: wxmtxy_row.Row object'''353 @param thePair: pair.XYpair object 354 @param theTab: tab.Tab object 355 @param theRow: row.Row object''' 356 356 text = 'Delete row labeled: %s' % theRow.GetLabel() 357 357 # confirm this step … … 365 365 def SetRow(self, thePair, theTab, theRow): 366 366 '''Process a 'set' command from a row button 367 @param thePair: wxmtxy_pair.XYpair object368 @param theTab: wxmtxy_tab.Tab object369 @param theRow: wxmtxy_row.Row object'''367 @param thePair: pair.XYpair object 368 @param theTab: tab.Tab object 369 @param theRow: row.Row object''' 370 370 text = theRow.GetLabel() 371 371 self.SetStatusText('Set X, Y on row labeled: %s' % text) … … 381 381 def GoRow(self, thePair, theTab, theRow): 382 382 '''Process a 'go' command from a row button 383 @param thePair: wxmtxy_pair.XYpair object384 @param theTab: wxmtxy_tab.Tab object385 @param theRow: wxmtxy_row.Row object'''383 @param thePair: pair.XYpair object 384 @param theTab: tab.Tab object 385 @param theRow: row.Row object''' 386 386 text = theRow.GetLabel() 387 387 self.SetStatusText('Move EPICS motors on row labeled: %s' % text) … … 401 401 '''Process a 'stop' command from a stop button. 402 402 Need to stop the two associated positioners. 403 @param thePair: wxmtxy_pair.XYpair object'''403 @param thePair: pair.XYpair object''' 404 404 thePair.StopAxes() 405 405 title = thePair.GetPageTitle() … … 442 442 @param settingsFile: [string] name of the XML file''' 443 443 try: 444 rc = wxmtxy_xml.Settings(settingsFile)444 rc = moxy_xml.Settings(settingsFile) 445 445 result = rc.ReadXmlFile() 446 446 if result != None: … … 486 486 '''Save the current settings to the named settings file 487 487 @param settingsFile: [string] name of the XML file''' 488 rc = wxmtxy_xml.Settings(settingsFile)488 rc = moxy_xml.Settings(settingsFile) 489 489 selectedpair = self.pagebook.GetSelection() 490 490 for pairnum in range(self.pagebook.GetPageCount()): … … 530 530 # First we create and fill the info object 531 531 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__ 535 535 description = '' 536 for line in wxmtxy_version.__documentation__.strip().splitlines():536 for line in version.__documentation__.strip().splitlines(): 537 537 item = line.strip() 538 538 if len(item) > 0: … … 541 541 description += '\n\n' 542 542 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__ 547 547 others = [ "author: ", author ] 548 others.extend( wxmtxy_version.__contributor_credits__)548 others.extend(version.__contributor_credits__) 549 549 info.Developers = others 550 info.License = wxmtxy_version.__license__550 info.License = version.__license__ 551 551 # Then we call wx.AboutBox giving it the info object 552 552 wx.AboutBox(info) … … 796 796 root_dir = os.path.split(inspect.getsourcefile(root))[0] 797 797 fullname = os.path.join(root_dir, page) 798 wxmtxy_htmlview.HtmlView(parent=None,798 htmlview.HtmlView(parent=None, 799 799 homepage=fullname, id=-1, 800 800 title='HtmlView: '+page).Show() … … 809 809 return # early 810 810 orig_cfg = copy.deepcopy(self.GetEpicsConfig(pagenum)) 811 dlg = wxmtxy_pvsetup.PvDialog(None, orig_cfg)811 dlg = pvsetup.PvDialog(None, orig_cfg) 812 812 try: 813 813 result = dlg.ShowModal() -
moxy/trunk/src/moxy/row.py
r631 r635 32 32 33 33 class Row(wx.Panel): 34 '''One row of settings in a wxmtxy table'''34 '''One row of settings in a moxy table''' 35 35 36 36 def _init_coll_sizer_Items(self, parent): -
moxy/trunk/src/moxy/tab.py
r631 r635 24 24 25 25 import wx 26 import wxmtxy_row26 import row 27 27 import wx.lib.scrolledpanel 28 28 … … 74 74 '''Make a new row and append it to the current tab 75 75 @param remap: [Boolean] option to call self.Remap()''' 76 panel = wxmtxy_row.Row(self, self.RowHandler)76 panel = row.Row(self, self.RowHandler) 77 77 self.sizer.AddWindow(panel, 0, border=2, flag=wx.GROW) 78 78 if remap: -
moxy/trunk/src/moxy/version.py
r631 r635 14 14 15 15 ''' 16 version information for wxmtxy16 version information for moxy 17 17 18 18 ########### SVN repository information ################### … … 40 40 #fp.close() 41 41 __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' 49 49 __documentation__ = ''' 50 * wxmtxy* (an EPICS GUI tool) provides support for an X,Y positioner50 *moxy* (an EPICS GUI tool) provides support for an X,Y positioner 51 51 (motor) pair by allowing users to define a table of known positions 52 52 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.