Changeset 775 for moxy/trunk
- Timestamp:
- Feb 2, 2012 9:18:54 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified moxy/trunk/src/moxy/vc_axis.py ¶
r772 r775 25 25 import m_pv 26 26 import m_axis 27 import epics.wx 27 28 28 29 … … 125 126 description_sizer = self._Make_Description_Sizer( panel ) 126 127 position_sizer = self._Make_Positions_Sizer( panel ) 127 self.stopButton = Make_My_Button(panel, 128 129 controlsButton = Make_My_Button(panel, 130 label=u'more', 131 name='controlsButton', 132 tip=u'Access more controls for EPICS motors', 133 binding=self.doMotorControlsButton) 134 135 stopButton = Make_My_Button(panel, 128 136 label=u'Stop', 129 137 name='stopButton', 130 138 tip=u'Stop this axis from moving', 131 139 binding=self.doStopButton) 132 s elf.stopButton.SetBackgroundColour('red')133 s elf.stopButton.SetForegroundColour('yellow')140 stopButton.SetBackgroundColour('red') 141 stopButton.SetForegroundColour('yellow') 134 142 135 143 self.SetStatus( 'initialized' ) … … 139 147 sizer.AddSizer(description_sizer, 1, flag=wx.EXPAND) 140 148 sizer.AddSizer(position_sizer, 1, flag=wx.EXPAND) 141 sizer.AddSizer(self.stopButton, 0, flag=wx.EXPAND) 149 sizer.AddSizer(controlsButton, 0, flag=wx.EXPAND) 150 sizer.AddSizer(stopButton, 0, flag=wx.EXPAND) 142 151 143 152 def _Make_Description_Sizer(self, parent): … … 217 226 self.axis_parent.axis.stopMotion() 218 227 self.SetStatus( 'stopped' ) 228 229 def doMotorControlsButton(self, event): 230 '''stop this axis from moving''' 231 self.motorControlsDialog() 232 233 def motorControlsDialog(self): 234 # TODO: implement this with a button 235 if self.axis_parent.axis.isMotorRecord: 236 pv = self.axis_parent.axis.axis.get_pv('VAL').pvname 237 # FIXME: what is the correct parent to use here? 238 # TODO: Look at implementation of epics.wx.motordetailframe.MotorDetailFrame() 239 parent = wx.GetTopLevelParent(self.axis_parent) 240 dlog = MotorControlsDialog(parent, m_pv.GetBasePv(pv)) 241 dlog.Show() # needs to be a modeless dialog 242 #dlog.Destroy() 243 else: 244 msg = "This axis is not an EPICS motor record." 245 msg += " No motor control screen available." 246 AcknowledgeDialog(self.axis_parent, msg) 219 247 220 248 def SetStatus(self, value): … … 657 685 658 686 687 class MotorControlsDialog(wx.Dialog): 688 '''comment''' 689 690 def __init__(self, parent, pv): 691 ''' 692 modeless dialog that provides the motor controls panel from PyEpics 693 694 :param obj parent: WX parent 695 :param str pv: EPICS PV name for the motor record 696 ''' 697 # TODO: needs to be a new modeless dialog 698 wx.Dialog.__init__(self, None, -1, "controls for %s" % pv) 699 style = "small" # small | medium | full (default) 700 mp = epics.wx.MotorPanel(parent, pv, psize=style) 701 702 sizer = wx.BoxSizer( orient=wx.VERTICAL ) 703 sizer.AddSizer( mp, 1, flag=wx.EXPAND ) 704 self.SetSizer( sizer ) 705 sizer.Fit(self) 706 707 659 708 # - - - - - - - - - - - - - - - - - - methods 660 709
Note: See TracChangeset
for help on using the changeset viewer.