Adding CDPSM package.
[PyCIM.git] / CIM14 / IEC61968 / Assets / AssetContainer.py
blob10c974d7f134e60a7ca353f5fa31dad785e1746c
1 # Copyright (C) 2010 Richard Lincoln
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA, USA
17 from CIM14.IEC61968.Assets.Asset import Asset
19 class AssetContainer(Asset):
20 """Asset that is aggregation of other assets such as conductors, transformers, switchgear, land, fences, buildings, equipment, vehicles, etc.
21 """
23 def __init__(self, Seals=None, Assets=None, *args, **kw_args):
24 """Initialises a new 'AssetContainer' instance.
26 @param Seals: All seals applied to this asset container.
27 @param Assets:
28 """
29 self._Seals = []
30 self.Seals = [] if Seals is None else Seals
32 self._Assets = []
33 self.Assets = [] if Assets is None else Assets
35 super(AssetContainer, self).__init__(*args, **kw_args)
37 _attrs = []
38 _attr_types = {}
39 _defaults = {}
40 _enums = {}
41 _refs = ["Seals", "Assets"]
42 _many_refs = ["Seals", "Assets"]
44 def getSeals(self):
45 """All seals applied to this asset container.
46 """
47 return self._Seals
49 def setSeals(self, value):
50 for x in self._Seals:
51 x.AssetContainer = None
52 for y in value:
53 y._AssetContainer = self
54 self._Seals = value
56 Seals = property(getSeals, setSeals)
58 def addSeals(self, *Seals):
59 for obj in Seals:
60 obj.AssetContainer = self
62 def removeSeals(self, *Seals):
63 for obj in Seals:
64 obj.AssetContainer = None
66 def getAssets(self):
68 return self._Assets
70 def setAssets(self, value):
71 for x in self._Assets:
72 x.AssetContainer = None
73 for y in value:
74 y._AssetContainer = self
75 self._Assets = value
77 Assets = property(getAssets, setAssets)
79 def addAssets(self, *Assets):
80 for obj in Assets:
81 obj.AssetContainer = self
83 def removeAssets(self, *Assets):
84 for obj in Assets:
85 obj.AssetContainer = None