Changeset 644
- Timestamp:
- Oct 6, 2011 1:57:24 PM (12 years ago)
- Location:
- moxy/trunk/src/moxy
- Files:
-
- 1 added
- 7 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
moxy/trunk/src/moxy/axis_support.py
r643 r644 41 41 Example use:: 42 42 43 axis = moxy_axis.Axis()43 axis = axis_support.Axis() 44 44 axis.SetConfigure(config_dict): 45 45 if axis.Connect() -
moxy/trunk/src/moxy/examples/simple-test.xml
r643 r644 1 1 <?xml version="1.0" ?> 2 <moxy date="2011-10-0 4" time="17:17:17" version="1.0">2 <moxy date="2011-10-06" time="13:52:09" version="1.0"> 3 3 <XYpair name="a1y & a2y test motors" selected="True"> 4 4 <EPICS_configuration> … … 20 20 <row name="small change down" x="0.5" y="0.5"/> 21 21 <row name="zero" x="0" y="0"/> 22 <row name="nearby the start" x="1" y="2"/> 22 23 </tab> 23 24 </XYpair> -
moxy/trunk/src/moxy/examples/test-settings.xml
r642 r644 12 12 --> 13 13 14 < moxy date="2009-04-21" time="22:42:25" version="1.0">14 <wxmtxy date="2009-04-21" time="22:42:25" version="1.0"> 15 15 <XYpair name="a1y & a2y test motors" selected="True"> 16 16 <EPICS_configuration> … … 84 84 <tab/> 85 85 </XYpair> 86 -->87 86 <XYpair> 88 87 <EPICS_configuration> … … 113 112 </tab> 114 113 </XYpair> 114 --> 115 115 <XYpair name="sample"> 116 116 <EPICS_configuration> … … 144 144 </tab> 145 145 </XYpair> 146 </ moxy>146 </wxmtxy> -
moxy/trunk/src/moxy/moxy.py
r642 r644 92 92 93 93 94 def main(): 95 '''operate the tool''' 94 def main(args): 95 ''' 96 Run *moxy* as a tool. 97 98 :param list args: parameter list, typically sys.argv 99 ''' 96 100 application = wx.App() 97 101 settingsFile = None 98 if len( sys.argv) == 2:99 settingsFile = sys.argv[1]102 if len(args) == 2: 103 settingsFile = args[1] 100 104 root.root(None, settingsFile).Show() 101 105 application.MainLoop() … … 103 107 104 108 if __name__ == '__main__': 105 main( )109 main(sys.argv) -
moxy/trunk/src/moxy/pair.py
r643 r644 27 27 import tab 28 28 import row 29 import moxy_axis29 import axis_support 30 30 import wx.lib.scrolledpanel 31 31 import copy … … 212 212 def __init__(self, parent, name, root, rootCallback, newtab=False): 213 213 '''initialize an instance of this class 214 @param parent: object that owns this class 215 @param name: display test that describes this XYpair 216 @param root: root object 217 @param rootCallback: routine in the parent to handle Button events from the Tab 218 @param newtab: [Boolean] create a default Tab group?''' 214 215 :param obj parent: object that owns this class 216 :param str name: display text that describes this XYpair 217 :param obj root: root object 218 :param method rootCallback: routine in the parent to handle Button events from the Tab 219 :param bool newtab: create a default Tab group?''' 219 220 self.tab_count = 0 220 221 self.epics = {} 221 222 self.titles = {} 222 223 for axis in ['x', 'y']: 223 self.epics[axis] = moxy_axis.Axis()224 self.epics[axis] = axis_support.Axis() 224 225 self.titles[axis] = {} 225 226 for field in ['DESC', 'EGU']: … … 245 246 def NewTab(self, newrow=True): 246 247 '''make a new tab 247 @param newrow: [Boolean] option to create a first row''' 248 249 :param bool newrow: option to create a first row''' 248 250 panel = tab.Tab(parent=self.table, pair=self, 249 251 pairCallback=self.TabHandler, newrow=newrow) … … 265 267 def TabHandler(self, theTab, theRow, command): 266 268 '''Callback function to handle a command from a tab 267 @param theTab: tab.Tab object 268 @param theRow: row.Row object 269 @param command: [string] Row button action to pass upward for handling''' 269 270 :param theTab: tab.Tab object 271 :param theRow: row.Row object 272 :param command: [string] Row button action to pass upward for handling''' 270 273 self.rootCallback(self, theTab, theRow, command) 271 274 272 275 def GetSelection(self): 273 ''' @return index number of the selected tab object'''276 ''':return index number of the selected tab object''' 274 277 return self.table.GetSelection() 275 278 276 279 def GetTabSelection(self): 277 ''' @return selected tab object'''280 ''':return selected tab object''' 278 281 tabnum = self.GetSelection() 279 282 if tabnum < 0: … … 282 285 283 286 def GetPageTitle(self): 284 ''' @return page title'''287 ''':return page title''' 285 288 return self.title.GetLabel() 286 289 287 290 def SetPageTitle(self, title): 288 291 '''define the page title 289 @param title: [string] new page title''' 292 293 :param title: [string] new page title''' 290 294 self.title.SetLabel(title) 291 295 self.Layout() … … 293 297 def GetTabText(self, tabnum): 294 298 '''return the text of the tab numbered tabnum 295 @param tabnum: [int] index of selected tab''' 299 300 :param tabnum: [int] index of selected tab''' 296 301 return self.table.GetPageText(tabnum) 297 302 298 303 def SetTabText(self, tabnum, text): 299 304 '''set the text of the tab numbered tabnum 300 @param tabnum: [int] index of selected tab 301 @param text: [string] new text''' 305 306 :param tabnum: [int] index of selected tab 307 :param text: [string] new text''' 302 308 self.table.SetPageText(tabnum, text) 303 309 304 310 def GetAxisTitleX(self): 305 ''' @return X axis title'''311 ''':return X axis title''' 306 312 return self.lbl_x_title.GetLabel() 307 313 308 314 def GetAxisTitleY(self): 309 ''' @return Y axis title'''315 ''':return Y axis title''' 310 316 return self.lbl_y_title.GetLabel() 311 317 … … 313 319 '''change the background color of the RBV and VAL widgets 314 320 315 @param axis: [string] either "x" or "y"316 @param state: [Boolean], color is green if state == False, neutral if True321 :param axis: [string] either "x" or "y" 322 :param state: [Boolean], color is green if state == False, neutral if True 317 323 ''' 318 324 colormap = {False: self.COLOR_MOVING, True: self.COLOR_NOT_MOVING} … … 325 331 326 332 def GetRbvXY(self): 327 ''' @return readback values for X and Y as a tuple'''333 ''':return readback values for X and Y as a tuple''' 328 334 x = self.x_rbv.GetLabel() 329 335 y = self.y_rbv.GetLabel() … … 332 338 def SetAxisTitles(self, x_title, y_title): 333 339 '''define the axis titles 334 @param x_title: [string] X axis title 335 @param y_title: [string] Y axis title''' 340 341 :param x_title: [string] X axis title 342 :param y_title: [string] Y axis title''' 336 343 self.lbl_x_title.SetLabel(x_title) 337 344 self.lbl_y_title.SetLabel(y_title) … … 339 346 340 347 def GetEpicsConfig(self): 341 ''' @return deep copy of EPICS PV configuration'''348 ''':return deep copy of EPICS PV configuration''' 342 349 config = {} 343 350 for axis in ['x', 'y']: … … 395 402 def ConnectEpics(self): 396 403 '''try to connect the XY_pair PV names with EPICS''' 397 redirects = {404 callback_handlers = { 398 405 'VAL': self.onChangePositions, 399 406 'RBV': self.onChangePositions, … … 405 412 for axis in ['x', 'y']: 406 413 item = self.epics[axis] 407 redirects['axis'] = axis408 if not item.Connect(** redirects):414 callback_handlers['axis'] = axis 415 if not item.Connect(**callback_handlers): 409 416 raise RuntimeError, "Did not connect %s axis" % axis 410 # TODO: initial RBV connection does not generate a monitor, fake it here somehow417 self.causeInitialCallback(callback_handlers) 411 418 412 419 def ReleaseEpics(self): 413 420 '''release connections with the XY_pair EPICS PVs 414 @note: When will this be called?''' 421 422 :note: When will this be called?''' 415 423 for axis in ['x', 'y']: 416 424 self.epics[axis].Disconnect() … … 424 432 def MoveAxes(self, x, y): 425 433 '''Command both axes to move to new position 426 @param x: [float] new X position 427 @param y: [float] new Y position''' 434 435 :param float x: new X position 436 :param float y: new Y position 437 ''' 428 438 #print __name__, 'MoveAxes:', x, y 429 439 self.epics['x'].Move(x) 430 440 self.epics['y'].Move(y) 441 442 def causeInitialCallback(self, callbacks): 443 ''' 444 initial RBV and VAL connections do not generate a monitor, 445 cause those callbacks to happen here, somehow 446 447 :param float x: new X position 448 ''' 449 for field in ( 'RBV', 'VAL', ): 450 axis = callbacks['axis'] 451 ch = self.epics[axis].db[field] 452 value = ch.get() 453 handler = callbacks[field] 454 D = ch.get_ctrlvars() 455 handler(axis=axis, field=field, value=value, **D) 431 456 432 457 # ################################ … … 436 461 def OnStopButton(self, event): 437 462 '''user requested to stop the X and Y motors 438 @param event: wxPython event object''' 463 464 :param event: wxPython event object''' 439 465 self.TabHandler(self, None, 'stop') -
moxy/trunk/src/moxy/pvsetup.py
r642 r644 29 29 import epics 30 30 import pprint 31 import moxy_axis31 import axis_support 32 32 import inspect 33 33 import os … … 299 299 xref[field].SetValue(config[field]) 300 300 isMotorRec = config[field] 301 for field in moxy_axis.field_list:301 for field in axis_support.field_list: 302 302 if config.has_key(field): 303 303 #pprint.pprint(config) … … 333 333 334 334 :param str axis: "x" or "y" 335 :param str field: member of moxy_axis.field_list335 :param str field: member of axis_support.field_list 336 336 ''' 337 337 pv = self.widget[axis][field].GetValue() … … 359 359 field = 'isMotorRec' 360 360 config[axis][field]=self.widget[axis][field].GetValue() 361 for field in moxy_axis.field_list:361 for field in axis_support.field_list: 362 362 config[axis][field]=self.widget[axis][field].GetValue() 363 363 return config … … 425 425 ''' 426 426 config = {'isMotorRec': False} 427 for field in moxy_axis.field_list:427 for field in axis_support.field_list: 428 428 config[field] = '' 429 429 self._applyConfiguration_(self.widget[axis], config) -
moxy/trunk/src/moxy/root.py
r642 r644 30 30 import tab 31 31 import row 32 import moxy_xml32 import xml_support 33 33 import pvsetup 34 34 import version … … 447 447 @param settingsFile: [string] name of the XML file''' 448 448 try: 449 rc = moxy_xml.Settings(settingsFile)449 rc = xml_support.Settings(settingsFile) 450 450 result = rc.ReadXmlFile() 451 451 if result != None: … … 491 491 '''Save the current settings to the named settings file 492 492 @param settingsFile: [string] name of the XML file''' 493 rc = moxy_xml.Settings(settingsFile)493 rc = xml_support.Settings(settingsFile) 494 494 selectedpair = self.pagebook.GetSelection() 495 495 for pairnum in range(self.pagebook.GetPageCount()): -
moxy/trunk/src/moxy/version.py
r641 r644 13 13 ''' 14 14 15 '''15 __full_version_info__ = ''' 16 16 version information for moxy 17 17 -
moxy/trunk/src/moxy/xml_support.py
r643 r644 93 93 import datetime 94 94 import copy 95 import moxy_axis95 import axis_support 96 96 97 97 … … 101 101 def __init__(self, settingsFile=None): 102 102 '''prepare the settings file 103 :param settingsFile: [string] name of XML file with settings''' 103 104 :param settingsFile: [string] name of XML file with settings''' 104 105 self.rootElement = 'moxy' 105 # TODO: consider supporting legacy 'wxmtxy' root elements, too106 self.legacyRootElementList = [ 'wxmtxy', 'moxy', ] 106 107 self.Clear() 107 108 self.SetSettingsFile(settingsFile) … … 117 118 def SetSettingsFile(self, thefile): 118 119 '''set the name of XML settings file 119 :param thefile: [string] name of XML file with settings''' 120 121 :param thefile: [string] name of XML file with settings''' 120 122 self.settingsFile = thefile 121 123 … … 125 127 126 128 def NewPair(self, title=''): 127 ''' create space in the database (db) for a new pair 128 and sets defaults for fields 129 130 :param title: [string] the title of the XY_pair set (default="") 131 :return: the index number''' 129 ''' 130 create space in the database (db) for a new pair 131 and sets defaults for fields 132 133 :param title: [string] the title of the XY_pair set (default="") 134 :return: the index number''' 132 135 if self.CountPairs() == -1: 133 136 self.db[u"pairs"] = [] … … 140 143 def GetPairTitle(self, pairnum): 141 144 '''return the name of the XY_pair 142 :param pairnum: [int] index number of the XY_pair''' 145 146 :param pairnum: [int] index number of the XY_pair''' 143 147 return self.db[u"pairs"][pairnum][u"@name"] 144 148 145 149 def SetPairTitle(self, pairnum, title): 146 150 '''set the name of the XY_pair 147 :param pairnum: [int] index number of the XY_pair' 148 :param title: [string] name of the XY_pair''' 151 152 :param pairnum: [int] index number of the XY_pair' 153 :param title: [string] name of the XY_pair''' 149 154 self.db[u"pairs"][pairnum][u"@name"] = title 150 155 151 156 def SelectPair(self, pairnum): 152 157 '''set the "selected" attribute of the pair 153 :param pairnum: [int] index number of the XY_pair''' 158 159 :param pairnum: [int] index number of the XY_pair''' 154 160 for pair in self.db[u"pairs"]: # first, deselect all pairs 155 161 pair[u"@selected"] = False … … 178 184 def NewEpicsConfig(self, pairnum): 179 185 '''Create internal space for a new EPICS configuration 180 :param pairnum: [int] index number of the XY_pair''' 186 187 :param pairnum: [int] index number of the XY_pair''' 181 188 pairdb = self.db[u"pairs"][pairnum] 182 189 pairdb[u"epics"] = {} … … 185 192 epicsdb[axis] = {} 186 193 axisdb = epicsdb[axis] 187 for field in moxy_axis.field_list:194 for field in axis_support.field_list: 188 195 axisdb[field] = "" 189 196 axisdb[u"isMotorRec"] = False … … 191 198 def GetEpicsConfig(self, pairnum): 192 199 '''Get a deep copy Python dictionary of the current EPICS PV config. 193 :param pairnum: [int] index number of the XY_pair 194 :return: the current EPICS configuration''' 200 201 :param pairnum: [int] index number of the XY_pair 202 :return: the current EPICS configuration''' 195 203 return copy.deepcopy(self.db[u"pairs"][pairnum][u"epics"]) 196 204 197 205 def SetEpicsConfig(self, pairnum, config): 198 206 '''set the current EPICS configuration 199 :param pairnum: [int] index number of the XY_pair 200 :param config: Python dictionary of EPICS PV configuration''' 207 208 :param pairnum: [int] index number of the XY_pair 209 :param config: Python dictionary of EPICS PV configuration''' 201 210 pairdb = self.db[u"pairs"][pairnum] 202 211 deep = copy.deepcopy(config) … … 205 214 def SetEpicsField(self, pairnum, axis, field, value): 206 215 '''Define the EPICS config for a specific field 207 :param pairnum: [int] index number of the XY_pair' 208 :param axis: [string] "x" or "y"' 209 :param field: [string] member of moxy_axis.field_list' 210 :param value: [string] value of this field''' 216 217 :param pairnum: [int] index number of the XY_pair' 218 :param axis: [string] "x" or "y"' 219 :param field: [string] member of axis_support.field_list' 220 :param value: [string] value of this field''' 211 221 try: 212 222 axisdb = self.db[u"pairs"][pairnum][u"epics"][axis] … … 218 228 def NewTab(self, pairnum, title=''): 219 229 ''' create space in the database (db) pair for a new tab 220 221 222 223 224 230 and sets defaults for fields 231 232 :param pairnum: [int] index number of the XY_pair 233 :param title: the title of the pair set (default="") 234 :return the index number''' 225 235 pairdb = self.db[u"pairs"][pairnum] 226 236 if not pairdb.has_key(u"tabs"): … … 234 244 def GetTabTitle(self, pairnum, tabnum): 235 245 '''return the name of the tab 236 :param pairnum: [int] index number of the XY_pair 237 :param tabnum: [int] index number of the Tab object''' 246 247 :param pairnum: [int] index number of the XY_pair 248 :param tabnum: [int] index number of the Tab object''' 238 249 return self.db[u"pairs"][pairnum][u"tabs"][tabnum][u"@name"] 239 250 240 251 def SetTabTitle(self, pairnum, tabnum, title): 241 252 '''set the name attribute of the tab 242 :param pairnum: [int] index number of the XY_pair 243 :param tabnum: [int] index number of the Tab object 244 :param title: [string] title the Tab object''' 253 254 :param pairnum: [int] index number of the XY_pair 255 :param tabnum: [int] index number of the Tab object 256 :param title: [string] title the Tab object''' 245 257 self.db[u"pairs"][pairnum][u"tabs"][tabnum]["@name"] = title 246 258 247 259 def SelectTab(self, pairnum, tabnum): 248 260 '''set the selected attribute of the pair 249 :param pairnum: [int] index number of the XY_pair 250 :param tabnum: [int] index number of the Tab object''' 261 262 :param pairnum: [int] index number of the XY_pair 263 :param tabnum: [int] index number of the Tab object''' 251 264 pairdb = self.db[u"pairs"][pairnum] 252 265 for tab in pairdb[u"tabs"]: # first, deselect all tabs … … 256 269 def GetSelectedTab(self, pairnum): 257 270 '''return the index number of the selected tab 258 :param pairnum: [int] index number of the XY_pair''' 271 272 :param pairnum: [int] index number of the XY_pair''' 259 273 selected = -1 260 274 try: … … 270 284 def CountTabs(self, pairnum): 271 285 '''return the number of tabs 272 :param pairnum: [int] index number of the XY_pair''' 286 287 :param pairnum: [int] index number of the XY_pair''' 273 288 try: 274 289 return len(self.db[u"pairs"][pairnum][u"tabs"]) … … 278 293 def NewRow(self, pairnum, tabnum, title=''): 279 294 ''' create space in the database (db) pair for a new tab 280 281 282 283 284 285 295 and sets defaults for fields 296 297 :param pairnum: [int] index number of the XY_pair 298 :param tabnum: [int] index number of the Tab object 299 :param title: the title of the Tab object (default="") 300 :return the index number''' 286 301 tabdb = self.db[u"pairs"][pairnum][u"tabs"][tabnum] 287 302 if not tabdb.has_key(u"rows"): … … 297 312 def GetRowTitle(self, pairnum, tabnum, rownum): 298 313 '''return the name of the row 299 :param pairnum: [int] index number of the XY_pair 300 :param tabnum: [int] index number of the Tab object 301 :param rownum: [int] index number of the Row object''' 314 315 :param pairnum: [int] index number of the XY_pair 316 :param tabnum: [int] index number of the Tab object 317 :param rownum: [int] index number of the Row object''' 302 318 tabdb = self.db[u"pairs"][pairnum][u"tabs"][tabnum] 303 319 return tabdb[u"rows"][rownum][u"@name"] … … 305 321 def SetRowTitle(self, pairnum, tabnum, rownum, title): 306 322 '''set the name attribute of the row 307 :param pairnum: [int] index number of the XY_pair 308 :param tabnum: [int] index number of the Tab object 309 :param rownum: [int] index number of the Row object 310 :param title: [string] title the Tab object''' 323 324 :param pairnum: [int] index number of the XY_pair 325 :param tabnum: [int] index number of the Tab object 326 :param rownum: [int] index number of the Row object 327 :param title: [string] title the Tab object''' 311 328 tabdb = self.db[u"pairs"][pairnum][u"tabs"][tabnum] 312 329 tabdb[u"rows"][rownum][u"@name"] = title … … 314 331 def GetRowXY(self, pairnum, tabnum, rownum): 315 332 '''return the name of the row 316 :param pairnum: [int] index number of the XY_pair 317 :param tabnum: [int] index number of the Tab object 318 :param rownum: [int] index number of the Row object''' 333 334 :param pairnum: [int] index number of the XY_pair 335 :param tabnum: [int] index number of the Tab object 336 :param rownum: [int] index number of the Row object''' 319 337 tabdb = self.db[u"pairs"][pairnum][u"tabs"][tabnum] 320 338 x = tabdb[u"rows"][rownum][u"@x"] … … 324 342 def SetRowXY(self, pairnum, tabnum, rownum, x, y): 325 343 '''set the name attribute of the row 326 :param pairnum: [int] index number of the XY_pair 327 :param tabnum: [int] index number of the Tab object 328 :param x: [float] X axis position 329 :param y: [float] Y axis position''' 344 345 :param pairnum: [int] index number of the XY_pair 346 :param tabnum: [int] index number of the Tab object 347 :param x: [float] X axis position 348 :param y: [float] Y axis position''' 330 349 tabdb = self.db[u"pairs"][pairnum][u"tabs"][tabnum] 331 350 tabdb[u"rows"][rownum][u"@x"] = x … … 334 353 def CountRows(self, pairnum, tabnum): 335 354 '''return the number of rows 336 :param pairnum: [int] index number of the XY_pair 337 :param tabnum: [int] index number of the Tab object''' 355 356 :param pairnum: [int] index number of the XY_pair 357 :param tabnum: [int] index number of the Tab object''' 338 358 try: 339 359 return len(self.db[u"pairs"][pairnum][u"tabs"][tabnum][u"rows"]) … … 343 363 def GetSelectedRow(self, pairnum, tabnum): 344 364 '''return the index number of the selected row 345 :param pairnum: [int] index number of the XY_pair 346 :param tabnum: [int] index number of the Tab object''' 365 366 :param pairnum: [int] index number of the XY_pair 367 :param tabnum: [int] index number of the Tab object''' 347 368 selected = -1 348 369 try: … … 358 379 def SelectRow(self, pairnum, tabnum, rownum): 359 380 '''set the selected attribute of the pair 360 :param pairnum: [int] index number of the XY_pair 361 :param tabnum: [int] index number of the Tab object 362 :param rownum: [int] index number of the Row object''' 381 382 :param pairnum: [int] index number of the XY_pair 383 :param tabnum: [int] index number of the Tab object 384 :param rownum: [int] index number of the Row object''' 363 385 tabdb = self.db[u"pairs"][pairnum][u"tabs"][tabnum] 364 386 for row in tabdb[u"rows"]: # first, deselect all rows … … 369 391 '''read the settings from a file into an internal dictionary (self.db) 370 392 371 372 @see: http://docs.python.org/library/xml.dom.minidom.html393 :note: this method uses xml.dom.minidom (built into all Pythons) 394 :see: http://docs.python.org/library/xml.dom.minidom.html 373 395 ''' 374 396 try: 375 397 doc = minidom.parse(self.settingsFile) # parse an XML file by name 376 assert doc.documentElement.tagName == self.rootElement398 assert doc.documentElement.tagName in self.legacyRootElementList 377 399 except IOError: 378 400 return 'Could not read the XML file: ' + self.settingsFile 379 401 except AssertionError: 380 return 'XML root element is not ' + self.rootElement402 return 'XML root element is not one of ' + self.legacyRootElementList 381 403 #... read all attributes from the root element 382 404 docElem = doc.documentElement … … 429 451 def _get_attribute(self, node, key, default): 430 452 '''get a specific attribute or return the default 431 :param node: XML Node object 432 :param key: [string] name of attribute to find 433 :param default: [string] default value to return''' 453 454 :param node: XML Node object 455 :param key: [string] name of attribute to find 456 :param default: [string] default value to return''' 434 457 value = default 435 458 if node.attributes.has_key(key): … … 439 462 def SaveXmlFile(self): 440 463 '''save the internal dictionary (self.db) to an XML file 464 441 465 :note: What about using/saving a default stylesheet? 442 @see: http://www.boddie.org.uk/python/XML_intro.html466 :see: http://www.boddie.org.uk/python/XML_intro.html 443 467 ''' 444 468 out = open(self.settingsFile, 'w') … … 453 477 def _SetAttr(self, node, attribute, value): 454 478 '''add attributes that are not empty (but do not strip the whitespace) 455 :param node: XML Node object 456 :param attribute: [string] name of attribute 457 :param value: [string] value of attribute''' 479 480 :param node: XML Node object 481 :param attribute: [string] name of attribute 482 :param value: [string] value of attribute''' 458 483 if len(value) > 0: 459 484 node.setAttribute(attribute, value) … … 461 486 def _makeTextNode(self, doc, tag, value): 462 487 '''create a text node for the XML file 463 :param doc: [xml.dom.minidom documentElement object] 464 :param str tag: element name 465 :param str value: element text''' 488 489 :param doc: [xml.dom.minidom documentElement object] 490 :param str tag: element name 491 :param str value: element text''' 466 492 node = doc.createElement(tag) 467 493 text = doc.createTextNode(value) … … 471 497 def __repr__(self): 472 498 '''default representation of this structure is XML 473 :return: XML representation of internal database (db) 474 :note: What about a default stylesheet? 499 500 :return: XML representation of internal database (db) 501 :note: What about a default stylesheet? 475 502 ''' 476 503 t = datetime.datetime.now() … … 505 532 self._SetAttr(node, field, str(epicsdb[axis][field])) 506 533 axisnode.appendChild(node) 507 for field in moxy_axis.field_list:534 for field in axis_support.field_list: 508 535 if field in epicsdb[axis]: 509 536 if len(epicsdb[axis][field])>0:
Note: See TracChangeset
for help on using the changeset viewer.