source: trunk/python/Rappture/number.py @ 55

Last change on this file since 55 was 55, checked in by dkearney, 19 years ago

python/Rappture/number.py

  • added ability for number to choose between default and current tags
  • changed structure of init so the basePath and the id are separate arguments to keep compatibility with how the driver program expects a number xml structure

python/Rappture/interface.py

  • included a more complete xml structure including tool and command i structures, for writing the xml to the file when the -g option is used
  • adjusted the finish() function to utilize the new Rappture.result() function

examples/app-fermi/fermi_io.py

  • adjusted the Rappture.number() fxn call to split the path and id.
  • commented out the result = [] because we now write the result to xml

examples/app-fermi/fermi.py

  • added output section with curve xml details for writing to xml
  • directly write the results to xml instead of to a result[] array

gui/apps/rerun

  • added script to re-visualize output from previously created run.xml file
File size: 1.0 KB
Line 
1# ----------------------------------------------------------------------
2#  COMPONENT: number
3#
4# ======================================================================
5#  AUTHOR:  Michael McLennan, Purdue University
6#  Copyright (c) 2005  Purdue Research Foundation, West Lafayette, IN
7# ======================================================================
8import Rappture
9
10class number:
11    def __init__(self,path,id,**kwargs):
12        """
13        Blah, blah...
14        """
15
16        self.basePath = path
17        self.path = path + ".number(" + id + ")"
18        self.id = id
19        self.attribs = kwargs
20
21    def put(self,lib):
22        lib.put(self.path)
23        for key,val in self.attribs.items():
24            lib.put(self.path+'.'+key, str(val))
25
26    def __coerce__(self,other):
27        attrList = Rappture.driver.children(self.path, "id")
28        attrName = 'default'
29        for attr in attrList:
30            if attr == 'current':
31                attrName = attr
32        s = Rappture.driver.get(self.path+'.'+attrName)
33        return (float(s),other)
Note: See TracBrowser for help on using the repository browser.