wxmtxy
index
/home/oxygen18/JEMIAN/Documents/eclipse/usaxs/wxmtxy/trunk/wxmtxy.py

start the wxmtxy GUI
 
@version: 
########### SVN repository information ###################
# $Date: 2010-06-03 16:04:15 -0500 (Thu, 03 Jun 2010) $
# $Author: jemian $
# $Revision: 184 $
# $URL: https://subversion.xor.aps.anl.gov/bcdaext/wxmtxy/trunk/wxmtxy.py $
# $Id: wxmtxy.py 184 2010-06-03 21:04:15Z jemian $
########### SVN repository information ###################
 
README
 
    *wxmtxy* (an EPICS GUI tool) provides support for an X,Y positioner 
    (motor) pair by allowing users to define a table of known positions 
    and providing a one-button click to drive a chosen X,Y pair to a specific
    table setting.  Also can record current position into a setting.
 
    Several sets of X,Y positioners can be configured.  (Each set is 
    separate.)  In fact, the positioners do not have to be motors,
    but can be any type of EPICS PV that will accept a numeric value.
 
 
    wxmtxy is based on wxPython and relies on CaChannel to communicate 
    with EPICS. 
    
    In the Graphical User Interface (GUI), tooltips are provided for 
    most items.  Moving and pausing the mouse over a widget (GUI 
    component such as a button or a label) will cause a terse description 
    of that widget to be displayed. Moving the mouse away will cause that 
    tooltip to disappear. 
    
    For more help, explanations are provided in the HTML pages.
    
    TRAC wiki
    @see: https://subversion.xor.aps.anl.gov/trac/bcdaext/wiki/wxmtxy
    
    @note: subversion checkout:  svn co https://subversion.xor.aps.anl.gov/bcdaext/wxmtxy/
 
----
 @note: wxPython does not provide standard tear-off windows
 @see: http://wiki.python.org/moin/Distutils/Tutorial
 @see: http://www.py2exe.org/index.cgi/Tutorial
 @note: for an undo example, see: http://wiki.wxpython.org/AnotherTutorial

 
Modules
       
pvConnect
sys
wx
wxmtxy_root

 
Classes
       
wx._core.App(wx._core.PyApp)
BoaApp

 
class BoaApp(wx._core.App)
    Built using Boa-constructor (as a subclass of wx.App)
 
 
Method resolution order:
BoaApp
wx._core.App
wx._core.PyApp
wx._core.EvtHandler
wx._core.Object
__builtin__.object

Methods defined here:
OnInit(self)
demonstrate the use of this tool

Methods inherited from wx._core.App:
Destroy(self)
MainLoop(self)
Execute the main GUI event loop
OnPreInit(self)
Things that must be done after _BootstrapApp has done its
thing, but would be nice if they were already done by the time
that OnInit is called.
RedirectStdio(self, filename=None)
Redirect sys.stdout and sys.stderr to a file or a popup window.
RestoreStdio(self)
SetOutputWindowAttributes(self, title=None, pos=None, size=None)
Set the title, position and/or size of the output window if
the stdio has been redirected.  This should be called before
any output would cause the output window to be created.
SetTopWindow(self, frame)
Set the "main" top level window
__del__(self, destroy=<unbound method PyApp.<lambda>>)
__init__(self, redirect=False, filename=None, useBestVisual=False, clearSigInt=True)
Construct a ``wx.App`` object.  
 
:param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
    redirected?  Defaults to True on Windows and Mac, False
    otherwise.  If `filename` is None then output will be
    redirected to a window that pops up as needed.  (You can
    control what kind of window is created for the output by
    resetting the class variable ``outputWindowClass`` to a
    class of your choosing.)
 
:param filename: The name of a file to redirect output to, if
    redirect is True.
 
:param useBestVisual: Should the app try to use the best
    available visual provided by the system (only relevant on
    systems that have more than one visual.)  This parameter
    must be used instead of calling `SetUseBestVisual` later
    on because it must be set before the underlying GUI
    toolkit is initialized.
 
:param clearSigInt: Should SIGINT be cleared?  This allows the
    app to terminate upon a Ctrl-C in the console like other
    GUI apps will.
 
:note: You should override OnInit to do applicaition
    initialization to ensure that the system, toolkit and
    wxWidgets are fully initialized.

Data and other attributes inherited from wx._core.App:
outputWindowClass = <class wx._core.PyOnDemandOutputWindow at 0xf7b3295c>
A class that can be used for redirecting Python's stdout and
stderr streams.  It will do nothing until something is wrriten to
the stream at which point it will create a Frame with a text area
and write the text there.

Methods inherited from wx._core.PyApp:
Dispatch(*args, **kwargs)
Dispatch(self) -> bool
 
Process the first event in the event queue (blocks until an event
appears if there are none currently)
Exit(*args, **kwargs)
Exit(self)
 
Exit the main loop thus terminating the application.
:see: `wx.Exit`
ExitMainLoop(*args, **kwargs)
ExitMainLoop(self)
 
Exit the main GUI loop during the next iteration of the main
loop, (i.e. it does not stop the program immediately!)
GetAppName(*args, **kwargs)
GetAppName(self) -> String
 
Get the application name.
GetAssertMode(*args, **kwargs)
GetAssertMode(self) -> int
 
Get the current OnAssert behaviour setting.
GetClassName(*args, **kwargs)
GetClassName(self) -> String
 
Get the application's class name.
GetExitOnFrameDelete(*args, **kwargs)
GetExitOnFrameDelete(self) -> bool
 
Get the current exit behaviour setting.
GetLayoutDirection(*args, **kwargs)
GetLayoutDirection(self) -> int
 
Return the layout direction for the current locale.
GetPrintMode(*args, **kwargs)
GetPrintMode(self) -> int
GetTopWindow(*args, **kwargs)
GetTopWindow(self) -> Window
 
Return the *main* top level window (if it hadn't been set previously
with SetTopWindow(), will return just some top level window and, if
there not any, will return None)
GetTraits(*args, **kwargs)
GetTraits(self) -> wxAppTraits
 
Return (and create if necessary) the app traits object to which we
delegate for everything which either should be configurable by the
user (then he can change the default behaviour simply by overriding
CreateTraits() and returning his own traits object) or which is
GUI/console dependent as then wx.AppTraits allows us to abstract the
differences behind the common facade.
 
:todo: Add support for overriding CreateAppTraits in wxPython.
GetUseBestVisual(*args, **kwargs)
GetUseBestVisual(self) -> bool
 
Get current UseBestVisual setting.
GetVendorName(*args, **kwargs)
GetVendorName(self) -> String
 
Get the application's vendor name.
IsActive(*args, **kwargs)
IsActive(self) -> bool
 
Return True if our app has focus.
Pending(*args, **kwargs)
Pending(self) -> bool
 
Returns True if there are unprocessed events in the event queue.
ProcessIdle(*args, **kwargs)
ProcessIdle(self) -> bool
 
Called from the MainLoop when the application becomes idle (there are
no pending events) and sends a `wx.IdleEvent` to all interested
parties.  Returns True if more idle events are needed, False if not.
ProcessPendingEvents(*args, **kwargs)
ProcessPendingEvents(self)
 
Process all events in the Pending Events list -- it is necessary to
call this function to process posted events. This normally happens
during each event loop iteration.
SendIdleEvents(*args, **kwargs)
SendIdleEvents(self, Window win, IdleEvent event) -> bool
 
Send idle event to window and all subwindows.  Returns True if more
idle time is requested.
SetAppName(*args, **kwargs)
SetAppName(self, String name)
 
Set the application name. This value may be used automatically by
`wx.Config` and such.
SetAssertMode(*args, **kwargs)
SetAssertMode(self, int mode)
 
Set the OnAssert behaviour for debug and hybrid builds.
SetClassName(*args, **kwargs)
SetClassName(self, String name)
 
Set the application's class name. This value may be used for
X-resources if applicable for the platform
SetExitOnFrameDelete(*args, **kwargs)
SetExitOnFrameDelete(self, bool flag)
 
Control the exit behaviour: by default, the program will exit the main
loop (and so, usually, terminate) when the last top-level program
window is deleted.  Beware that if you disable this behaviour (with
SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
explicitly from somewhere.
SetPrintMode(*args, **kwargs)
SetPrintMode(self, int mode)
SetUseBestVisual(*args, **kwargs)
SetUseBestVisual(self, bool flag, bool forceTrueColour=False)
 
Set whether the app should try to use the best available visual on
systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
SetVendorName(*args, **kwargs)
SetVendorName(self, String name)
 
Set the application's vendor name. This value may be used
automatically by `wx.Config` and such.
WakeUpIdle(*args, **kwargs)
WakeUpIdle(self)
 
Make sure that idle events are sent again.
:see: `wx.WakeUpIdle`
Yield(*args, **kwargs)
Yield(self, bool onlyIfNeeded=False) -> bool
 
Process all currently pending events right now, instead of waiting
until return to the event loop.  It is an error to call ``Yield``
recursively unless the value of ``onlyIfNeeded`` is True.
 
:warning: This function is dangerous as it can lead to unexpected
      reentrancies (i.e. when called from an event handler it may
      result in calling the same event handler again), use with
      extreme care or, better, don't use at all!
 
:see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
__repr__ = _swig_repr(self)

Static methods inherited from wx._core.PyApp:
GetComCtl32Version(*args, **kwargs)
GetComCtl32Version() -> int
 
Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
it wasn't found at all.  Raises an exception on non-Windows platforms.
GetMacAboutMenuItemId(*args, **kwargs)
GetMacAboutMenuItemId() -> long
GetMacExitMenuItemId(*args, **kwargs)
GetMacExitMenuItemId() -> long
GetMacHelpMenuTitleName(*args, **kwargs)
GetMacHelpMenuTitleName() -> String
GetMacPreferencesMenuItemId(*args, **kwargs)
GetMacPreferencesMenuItemId() -> long
GetMacSupportPCMenuShortcuts(*args, **kwargs)
GetMacSupportPCMenuShortcuts() -> bool
IsDisplayAvailable(*args, **kwargs)
IsDisplayAvailable() -> bool
 
Tests if it is possible to create a GUI in the current environment.
This will mean different things on the different platforms.
 
   * On X Windows systems this function will return ``False`` if it is
     not able to open a connection to the X display, which can happen
     if $DISPLAY is not set, or is not set correctly.
 
   * On Mac OS X a ``False`` return value will mean that wx is not
     able to access the window manager, which can happen if logged in
     remotely or if running from the normal version of python instead
     of the framework version, (i.e., pythonw.)
 
   * On MS Windows...
IsMainLoopRunning(*args, **kwargs)
IsMainLoopRunning() -> bool
 
Returns True if we're running the main loop, i.e. if the events can
currently be dispatched.
SetMacAboutMenuItemId(*args, **kwargs)
SetMacAboutMenuItemId(long val)
SetMacExitMenuItemId(*args, **kwargs)
SetMacExitMenuItemId(long val)
SetMacHelpMenuTitleName(*args, **kwargs)
SetMacHelpMenuTitleName(String val)
SetMacPreferencesMenuItemId(*args, **kwargs)
SetMacPreferencesMenuItemId(long val)
SetMacSupportPCMenuShortcuts(*args, **kwargs)
SetMacSupportPCMenuShortcuts(bool val)

Data descriptors inherited from wx._core.PyApp:
Active
IsActive(self) -> bool
 
Return True if our app has focus.
AppName
See `GetAppName` and `SetAppName`
AssertMode
See `GetAssertMode` and `SetAssertMode`
ClassName
See `GetClassName` and `SetClassName`
ExitOnFrameDelete
See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`
LayoutDirection
See `GetLayoutDirection`
PrintMode
See `GetPrintMode` and `SetPrintMode`
TopWindow
See `GetTopWindow` and `SetTopWindow`
Traits
See `GetTraits`
UseBestVisual
See `GetUseBestVisual` and `SetUseBestVisual`
VendorName
See `GetVendorName` and `SetVendorName`
thisown
The membership flag

Data and other attributes inherited from wx._core.PyApp:
__swig_destroy__ = <built-in function delete_PyApp>

Methods inherited from wx._core.EvtHandler:
AddPendingEvent(*args, **kwargs)
AddPendingEvent(self, Event event)
Bind(self, event, handler, source=None, id=-1, id2=-1)
Bind an event to an event handler.
 
:param event: One of the EVT_* objects that specifies the
              type of event to bind,
 
:param handler: A callable object to be invoked when the
              event is delivered to self.  Pass None to
              disconnect an event handler.
 
:param source: Sometimes the event originates from a
              different window than self, but you still
              want to catch it in self.  (For example, a
              button event delivered to a frame.)  By
              passing the source of the event, the event
              handling system is able to differentiate
              between the same event type from different
              controls.
 
:param id: Used to spcify the event source by ID instead
           of instance.
 
:param id2: Used when it is desirable to bind a handler
              to a range of IDs, such as with EVT_MENU_RANGE.
Connect(*args, **kwargs)
Connect(self, int id, int lastId, int eventType, PyObject func)
Disconnect(*args, **kwargs)
Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool
GetEvtHandlerEnabled(*args, **kwargs)
GetEvtHandlerEnabled(self) -> bool
GetNextHandler(*args, **kwargs)
GetNextHandler(self) -> EvtHandler
GetPreviousHandler(*args, **kwargs)
GetPreviousHandler(self) -> EvtHandler
ProcessEvent(*args, **kwargs)
ProcessEvent(self, Event event) -> bool
SetEvtHandlerEnabled(*args, **kwargs)
SetEvtHandlerEnabled(self, bool enabled)
SetNextHandler(*args, **kwargs)
SetNextHandler(self, EvtHandler handler)
SetPreviousHandler(*args, **kwargs)
SetPreviousHandler(self, EvtHandler handler)
Unbind(self, event, source=None, id=-1, id2=-1)
Disconencts the event handler binding for event from self.
Returns True if successful.

Data descriptors inherited from wx._core.EvtHandler:
EvtHandlerEnabled
See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`
NextHandler
See `GetNextHandler` and `SetNextHandler`
PreviousHandler
See `GetPreviousHandler` and `SetPreviousHandler`

Methods inherited from wx._core.Object:
IsSameAs(*args, **kwargs)
IsSameAs(self, Object p) -> bool
 
For wx.Objects that use C++ reference counting internally, this method
can be used to determine if two objects are referencing the same data
object.

Data descriptors inherited from wx._core.Object:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
main()
operate the tool
on_exit(timer, epics_db)
Exit handler to stop the ca.poll()
@param timer: CaPollWx object
@param epics_db: Python list of pvConnect.EpicsPv objects to be released

 
Data
        modules = {u'wxmtxy_htmlview': [0, 'HtmlView to view HTML-formatted help files', u'wxmtxy_htmlview.py'], u'wxmtxy_pair': [0, 'configuration for X,Y pair of EPICS positioners', u'wxmtxy_pair.py'], u'wxmtxy_pvsetup': [0, 'configure EPICS for X,Y pair', u'wxmtxy_pvsetup.py'], u'wxmtxy_root': [1, 'Main frame of Application', u'wxmtxy_root.py'], u'wxmtxy_row': [0, 'one row of settings', u'wxmtxy_row.py'], u'wxmtxy_tab': [0, 'set of rows with positioner settings', u'wxmtxy_tab.py']}