Changeset 771 for moxy


Ignore:
Timestamp:
Feb 1, 2012 4:45:03 PM (13 years ago)
Author:
jemian
Message:

checkpoint

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

Legend:

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

    r769 r771  
    7272        self.notebook = wx.Notebook( self )
    7373       
    74         self.operate_panel = SingleAxisOperatePanel(self.notebook,
    75                                 show_buttons)
     74        self.operate_panel = SingleAxisOperatePanel(self.notebook, self, show_buttons)
    7675        self.setup_panel = SingleAxisSetupPanel(self.notebook,
     76                                self,
    7777                                show_buttons,
    7878                                operate_panel = self.operate_panel)
     
    106106    and can be suppressed by adding  ``show_buttons = False``
    107107   
    108     :param obj parent: panel or frame that contains this panel
    109     :param axis: set of PVs that describe the operation of this axis
     108    :param obj parent: container of this panel
     109    :param obj axis_parent: container of the axis object
    110110    :param bool show_buttons: suppress display of certain buttons
    111111    '''
    112112   
    113     def __init__(self, parent, axis, show_buttons = True):
     113    def __init__(self, parent, axis_parent, show_buttons = True):
    114114        self.parent = parent
     115        self.axis_parent = axis_parent
    115116        self.show_buttons = show_buttons
    116117        self.connected = False
    117118
    118119        wx.Panel.__init__(self, id=wx.ID_ANY, parent=parent)
    119         self.SetToolTipString( self.GrandParent.axis.axis.get_pv('VAL').pvname )
     120        self.SetToolTipString( self.axis_parent.axis.axis.get_pv('VAL').pvname )
    120121        self._init_panel(self)
    121122        self.Fit()
     
    147148                                                      wx.ID_ANY, 'description')
    148149        self.gst_name.SetToolTipString(u'local name for this axis')
    149         self.gst_name.SetLabel( self.GrandParent.axis.name )
     150        self.gst_name.SetLabel( self.axis_parent.axis.name )
    150151       
    151152        self.w_desc = wx.lib.stattext.GenStaticText(parent,
     
    202203        obj = event.EventObject
    203204        if obj == self.w_target:
    204             if self.GrandParent.axis._connected:
     205            if self.axis_parent.axis._connected:
    205206                s = obj.GetValue()
    206207                try:
    207208                    value = float( s )
    208                     self.GrandParent.axis.move( value )
     209                    self.axis_parent.axis.move( value )
    209210                    self.SetStatus( 'new target' )
    210211                except ValueError:
     
    214215    def doStopButton(self, event):
    215216        '''stop this axis from moving'''
    216         self.GrandParent.axis.stopMotion()
     217        self.axis_parent.axis.stopMotion()
    217218        self.SetStatus( 'stopped' )
    218219
     
    224225        '''connect the PVs of this axis with EPICS'''
    225226        if not self.connected:
    226             the_axis = self.GrandParent.axis
     227            the_axis = self.axis_parent.axis
    227228            the_axis.connect(self.callback)
    228229            self.SetStatus( 'connected' )
     
    238239        '''connect the PVs of this axis from EPICS'''
    239240        if self.connected:
    240             self.GrandParent.axis.disconnect()
     241            self.axis_parent.axis.disconnect()
    241242            self.SetStatus( 'disconnected' )
    242243            self.w_target.SetEditable(False)
     
    300301   
    301302    :param obj parent: panel or frame that contains this panel
    302     :param axis: set of PVs that describe the operation of this axis
    303     :type axis: m_axis.SingleAxis object
     303    :param obj axis_parent: container of the axis object
    304304    :param bool show_buttons: suppress display of certain buttons
    305305    :param obj operate_panel: SingleAxisOperatePanel object to use with this class
    306306    '''
    307307   
    308     def __init__(self, parent, show_buttons = True, operate_panel = None):
     308    def __init__(self, parent, axis_parent, show_buttons = True, operate_panel = None):
    309309        self.parent = parent
     310        self.axis_parent = axis_parent
    310311        self.show_buttons = show_buttons
    311312        self.operate_panel = operate_panel
    312313
    313314        wx.Panel.__init__(self, id=wx.ID_ANY, parent=parent)
    314         self.SetToolTipString(self.GrandParent.axis.axis.get_pv('VAL').pvname)
     315        self.SetToolTipString(self.axis_parent.axis.axis.get_pv('VAL').pvname)
    315316        self._init_panel(self)
    316317        self.Fit()
     
    344345        label_STOP = wx.lib.stattext.GenStaticText(parent, wx.ID_ANY, 'STOP')
    345346       
    346         this_axis = self.GrandParent.axis
     347        this_axis = self.axis_parent.axis
    347348        self.w_name = Make_My_TextEntry(parent, this_axis.name,
    348349                        True, u'local name for this axis',
     
    503504        stop = self.w_STOP_pv.GetValue()
    504505       
    505         self.GrandParent.disconnect()
    506         self.GrandParent.axis = m_axis.SingleAxis(name, val, isMotorRecord, desc, dmov, egu, rbv, stop)
    507         self.GrandParent.connect()
    508         self.operate_panel.SetVAL( str(self.GrandParent.axis.axis.VAL) )
     506        self.axis_parent.disconnect()
     507        self.axis_parent.axis = m_axis.SingleAxis(name, val, isMotorRecord, desc, dmov, egu, rbv, stop)
     508        self.axis_parent.connect()
     509        self.operate_panel.SetVAL( str(self.axis_parent.axis.axis.VAL) )
    509510   
    510511    def revert(self):
    511512        '''revert to existing PV name'''
    512513        # restore widget fields from axis object
    513         this_axis = self.GrandParent.axis
     514        this_axis = self.axis_parent.axis
    514515        self.w_name.SetValue( this_axis.name )
    515516        self.w_VAL_pv.SetValue( this_axis.axis.get_pv('VAL').pvname )
  • TabularUnified moxy/trunk/src/moxy/vc_set.py

    r766 r771  
    8989        self.operate_list = []
    9090        for axis in self.aset.axes:
    91             obj = vc_axis.SingleAxisOperatePanel(panel, axis, False, None)
     91            obj = vc_axis.SingleAxisOperatePanel(panel, False, None)
    9292            self.operate_list.append( obj )
    9393       
Note: See TracChangeset for help on using the changeset viewer.