diff options
| author | blendoit <blendoit@gmail.com> | 2019-10-07 02:18:34 -0700 |
|---|---|---|
| committer | blendoit <blendoit@gmail.com> | 2019-10-07 02:18:34 -0700 |
| commit | 445a834e6a5e790a7f37730d6e5d8824b8f598f4 (patch) | |
| tree | abd6b56bc912bfaa74bb74e2c88733eb84c7deae /creator/base.py | |
| parent | e05225247b4873fa1825a2adeee23f247c77ff03 (diff) | |
Component tree replaced with subcomponent list
Diffstat (limited to 'creator/base.py')
| -rw-r--r-- | creator/base.py | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/creator/base.py b/creator/base.py index f6342c8..5d90efd 100644 --- a/creator/base.py +++ b/creator/base.py @@ -13,23 +13,17 @@ logging.basicConfig(filename='log.txt', class Aircraft: """This class tracks all sub-components and is fed to the evaluator.""" def __init__(self, evaluator, name): - self.tree = {name: None} - if type(self).__name__ not in evaluator.tree: - evaluator.tree[name] = self.tree - else: - evaluator.tree[name] = self.tree + evaluator.aircrafts.append(self) self.evaluator = evaluator self.name = name + self.fuselage = None + self.propulsion = None + self.wing = None + class Component: """Basic component providing coordinates, tools and a component tree.""" def __init__(self, parent, name): - self.tree = {type(self).__name__: name} - # print(type(self).__name__) - if type(self).__name__ not in parent.tree: - parent.tree.update(self.tree) - else: - parent.tree[name] = self.tree self.parent = parent self.name = name self.x = np.array([]) @@ -37,10 +31,6 @@ class Component: self.material = None self.mass = float() - def set_material(self, material): - """Set the component bulk material.""" - self.material = material - def info_print(self, round): """Print all the component's coordinates to the terminal.""" name = f' CREATOR DATA FOR {str(self).upper()} ' |