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.
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.
30 self
.Seals
= [] if Seals
is None else Seals
33 self
.Assets
= [] if Assets
is None else Assets
35 super(AssetContainer
, self
).__init
__(*args
, **kw_args
)
41 _refs
= ["Seals", "Assets"]
42 _many_refs
= ["Seals", "Assets"]
45 """All seals applied to this asset container.
49 def setSeals(self
, value
):
51 x
.AssetContainer
= None
53 y
._AssetContainer
= self
56 Seals
= property(getSeals
, setSeals
)
58 def addSeals(self
, *Seals
):
60 obj
.AssetContainer
= self
62 def removeSeals(self
, *Seals
):
64 obj
.AssetContainer
= None
70 def setAssets(self
, value
):
71 for x
in self
._Assets
:
72 x
.AssetContainer
= None
74 y
._AssetContainer
= self
77 Assets
= property(getAssets
, setAssets
)
79 def addAssets(self
, *Assets
):
81 obj
.AssetContainer
= self
83 def removeAssets(self
, *Assets
):
85 obj
.AssetContainer
= None