Changeset - 9bf9685f5aae
[Not reviewed]
default
0 1 0
David McClosky - 20 years ago 2005-06-17 17:59:37
dmcc@bigasterisk.com
curvecalc exprs can return a whole Submaster now
subterms will be ignored -- we only use the Submaster in this case
1 file changed with 10 insertions and 4 deletions:
0 comments (0 inline, 0 general)
bin/curvecalc
Show inline comments
 
@@ -124,10 +124,16 @@ class Subexprview(tk.Frame):
 

	
 
class Subterm:
 
    """one Submaster and its Subexpr"""
 
    def __init__(self,submaster,subexpr):
 
        make_attributes_from_args('submaster','subexpr')
 
    def scaled(self,t):
 
        return self.submaster * self.subexpr.eval(t)
 
    def __init__(self, submaster, subexpr):
 
        make_attributes_from_args('submaster', 'subexpr')
 
    def scaled(self, t):
 
        subexpr_eval = self.subexpr.eval(t)
 
        if isinstance(subexpr_eval, Submaster.Submaster):
 
            # if the expression returns a submaster, just return it
 
            return subexpr_eval
 
        else:
 
            # otherwise, return our submaster multiplied by the value returned
 
            return self.submaster * subexpr_eval
 

	
 
class Subtermview(tk.Frame):
 
    def __init__(self,master,st,**kw):
0 comments (0 inline, 0 general)