- Timestamp:
- Feb 1, 2012 4:45:03 PM (13 years ago)
- Location:
- moxy/trunk/src/moxy
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified moxy/trunk/src/moxy/vc_axis.py ¶
r769 r771 72 72 self.notebook = wx.Notebook( self ) 73 73 74 self.operate_panel = SingleAxisOperatePanel(self.notebook, 75 show_buttons) 74 self.operate_panel = SingleAxisOperatePanel(self.notebook, self, show_buttons) 76 75 self.setup_panel = SingleAxisSetupPanel(self.notebook, 76 self, 77 77 show_buttons, 78 78 operate_panel = self.operate_panel) … … 106 106 and can be suppressed by adding ``show_buttons = False`` 107 107 108 :param obj parent: panel or frame that containsthis panel109 :param axis: set of PVs that describe the operation of this axis108 :param obj parent: container of this panel 109 :param obj axis_parent: container of the axis object 110 110 :param bool show_buttons: suppress display of certain buttons 111 111 ''' 112 112 113 def __init__(self, parent, axis , show_buttons = True):113 def __init__(self, parent, axis_parent, show_buttons = True): 114 114 self.parent = parent 115 self.axis_parent = axis_parent 115 116 self.show_buttons = show_buttons 116 117 self.connected = False 117 118 118 119 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 ) 120 121 self._init_panel(self) 121 122 self.Fit() … … 147 148 wx.ID_ANY, 'description') 148 149 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 ) 150 151 151 152 self.w_desc = wx.lib.stattext.GenStaticText(parent, … … 202 203 obj = event.EventObject 203 204 if obj == self.w_target: 204 if self. GrandParent.axis._connected:205 if self.axis_parent.axis._connected: 205 206 s = obj.GetValue() 206 207 try: 207 208 value = float( s ) 208 self. GrandParent.axis.move( value )209 self.axis_parent.axis.move( value ) 209 210 self.SetStatus( 'new target' ) 210 211 except ValueError: … … 214 215 def doStopButton(self, event): 215 216 '''stop this axis from moving''' 216 self. GrandParent.axis.stopMotion()217 self.axis_parent.axis.stopMotion() 217 218 self.SetStatus( 'stopped' ) 218 219 … … 224 225 '''connect the PVs of this axis with EPICS''' 225 226 if not self.connected: 226 the_axis = self. GrandParent.axis227 the_axis = self.axis_parent.axis 227 228 the_axis.connect(self.callback) 228 229 self.SetStatus( 'connected' ) … … 238 239 '''connect the PVs of this axis from EPICS''' 239 240 if self.connected: 240 self. GrandParent.axis.disconnect()241 self.axis_parent.axis.disconnect() 241 242 self.SetStatus( 'disconnected' ) 242 243 self.w_target.SetEditable(False) … … 300 301 301 302 :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 304 304 :param bool show_buttons: suppress display of certain buttons 305 305 :param obj operate_panel: SingleAxisOperatePanel object to use with this class 306 306 ''' 307 307 308 def __init__(self, parent, show_buttons = True, operate_panel = None):308 def __init__(self, parent, axis_parent, show_buttons = True, operate_panel = None): 309 309 self.parent = parent 310 self.axis_parent = axis_parent 310 311 self.show_buttons = show_buttons 311 312 self.operate_panel = operate_panel 312 313 313 314 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) 315 316 self._init_panel(self) 316 317 self.Fit() … … 344 345 label_STOP = wx.lib.stattext.GenStaticText(parent, wx.ID_ANY, 'STOP') 345 346 346 this_axis = self. GrandParent.axis347 this_axis = self.axis_parent.axis 347 348 self.w_name = Make_My_TextEntry(parent, this_axis.name, 348 349 True, u'local name for this axis', … … 503 504 stop = self.w_STOP_pv.GetValue() 504 505 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) ) 509 510 510 511 def revert(self): 511 512 '''revert to existing PV name''' 512 513 # restore widget fields from axis object 513 this_axis = self. GrandParent.axis514 this_axis = self.axis_parent.axis 514 515 self.w_name.SetValue( this_axis.name ) 515 516 self.w_VAL_pv.SetValue( this_axis.axis.get_pv('VAL').pvname ) -
TabularUnified moxy/trunk/src/moxy/vc_set.py ¶
r766 r771 89 89 self.operate_list = [] 90 90 for axis in self.aset.axes: 91 obj = vc_axis.SingleAxisOperatePanel(panel, axis,False, None)91 obj = vc_axis.SingleAxisOperatePanel(panel, False, None) 92 92 self.operate_list.append( obj ) 93 93
Note: See TracChangeset
for help on using the changeset viewer.