# Applied Python PRISM
# (PRISM) PaRametrIc System Model
#
# Written by Charlie Taylor <cet@appliedpython.com>
# Oct,21 2005
from math import *
from prism.props import Materials
from prism.Summary import Summary
from prism.MassItem import MassItem
from prism.utils import Constants
class SimpleEqnMass( MassItem ):
def __init__(self, name="Simple Mass", type="inert", mass_lbm=0.0, eqn="1.2*1.1", desc='mass = simple eqn'):
MassItem.__init__(self, name, type=type)
self.eqn = eqn
self.desc = desc
self.reCalc()
def reCalc(self):
self.mass_lbm = eval( self.eqn )
def buildSummary(self):
summ = Summary( summName='Simple Equation Mass',
componentName=self.name, mass_lbm=self.mass_lbm, type=self.type)
# assumptions
if len(self.desc)>0:
summ.addAssumption( self.desc )
summ.addAssumption( 'Calc Wt from Eqn : ' + self.eqn )
return summ
if __name__ == "__main__": #self test
h = SimpleEqnMass(name="Whatchamahoozits")
print h.getMassStr()
print
print h.getSummary()