Changeset 764


Ignore:
Timestamp:
Jan 13, 2012 5:43:43 PM (13 years ago)
Author:
jemian
Message:

demo code is ready

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified moxy/trunk/src/moxy/wx_motorpanel.py

    r763 r764  
    11#!/usr/bin/env python
     2
     3########### SVN repository information ###################
     4# $Date$
     5# $Author$
     6# $Revision$
     7# $URL$
     8# $Id$
     9########### SVN repository information ###################
     10
     11
    212'''
    3 Creates a Frame containing one or more motor panels, per PyEpics description.
     13Creates a Frame containing one or more
     14motor panels, per PyEpics description.
    415
    516http://cars9.uchicago.edu/software/python/pyepics3/wx.html#wxmotorpanel-widget
    617
    7 @author: jemian
     18Call this with a command such as one of these:
     19
     20    wx_motorpanel.py  prefix:m1 prefix:m2 prefix:m3 prefix:m4 &
     21    wx_motorpanel.py  prefix:m{1,2,3,4} &
     22    wx_motorpanel.py  prj:m1 lax:m58:c2:m5 ioc:SM4 &
    823'''
     24
    925
    1026import wx
     
    1531class MainFrame(wx.Frame):
    1632    def __init__(self, motor_pvs):
    17         wx.Frame.__init__(self, None, title="wx_motorpanel")
     33        title = "motors: " + " ".join(motor_pvs)
     34        wx.Frame.__init__(self, None, title=title)
    1835
    19         # Here we create a panel and a notebook on the panel
     36        # Put a panel on the Frame, it's good practice
    2037        p = wx.Panel(self)
    2138        sizer = wx.BoxSizer(orient=wx.VERTICAL)
     39        p.SetSizer(sizer)
    2240
    23         # create the motor panels as directed
     41        # create one motor subpanel for each pv
    2442        for pv in motor_pvs:
    25             mp = epics.wx.motorpanel.MotorPanel(p, pv)
     43            mp = epics.wx.MotorPanel(p, pv)
    2644            sizer.Add(mp, 0, wx.EXPAND)
    2745
    28         p.SetSizer(sizer)
    29         self.Layout()
    30         self.Fit()
     46        p.Fit()         # needed to get initial size right
     47        self.Fit()      # needed to get initial size right
    3148
    3249
     
    3653        MainFrame(sys.argv[1:]).Show()
    3754        app.MainLoop()
    38 
    39 
Note: See TracChangeset for help on using the changeset viewer.