Adding CIM15 package.
[PyCIM.git] / CIM15 / IEC61970 / Informative / InfCore / ModelingAuthoritySet.py
blobbfa8421eb0941825f924dc3f20beee5a528c0d5d
1 # Copyright (C) 2010-2011 Richard Lincoln
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to
5 # deal in the Software without restriction, including without limitation the
6 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 # sell copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19 # IN THE SOFTWARE.
21 from CIM15.IEC61970.Core.IdentifiedObject import IdentifiedObject
23 class ModelingAuthoritySet(IdentifiedObject):
24 """A Modeling Authority Set is a group of objects in a network model where the data is supplied and maintained by the same Modeling Authority. This class is typically not included in instance data exchange as this information is tracked by other mechanisms in the exchange.A Modeling Authority Set is a group of objects in a network model where the data is supplied and maintained by the same Modeling Authority. This class is typically not included in instance data exchange as this information is tracked by other mechanisms in the exchange.
25 """
27 def __init__(self, IdentifiedObjects=None, ModelingAuthority=None, *args, **kw_args):
28 """Initialises a new 'ModelingAuthoritySet' instance.
30 @param IdentifiedObjects: An IdentifiedObject belongs to a Modeling Authority Set for purposes of defining a group of data maintained by the same Modeling Authority.
31 @param ModelingAuthority: A Modeling Authority set supplies and maintains the data for the objects in a Modeling Authority Set.
32 """
33 self._IdentifiedObjects = []
34 self.IdentifiedObjects = [] if IdentifiedObjects is None else IdentifiedObjects
36 self._ModelingAuthority = None
37 self.ModelingAuthority = ModelingAuthority
39 super(ModelingAuthoritySet, self).__init__(*args, **kw_args)
41 _attrs = []
42 _attr_types = {}
43 _defaults = {}
44 _enums = {}
45 _refs = ["IdentifiedObjects", "ModelingAuthority"]
46 _many_refs = ["IdentifiedObjects"]
48 def getIdentifiedObjects(self):
49 """An IdentifiedObject belongs to a Modeling Authority Set for purposes of defining a group of data maintained by the same Modeling Authority.
50 """
51 return self._IdentifiedObjects
53 def setIdentifiedObjects(self, value):
54 for x in self._IdentifiedObjects:
55 x.ModelingAuthoritySet = None
56 for y in value:
57 y._ModelingAuthoritySet = self
58 self._IdentifiedObjects = value
60 IdentifiedObjects = property(getIdentifiedObjects, setIdentifiedObjects)
62 def addIdentifiedObjects(self, *IdentifiedObjects):
63 for obj in IdentifiedObjects:
64 obj.ModelingAuthoritySet = self
66 def removeIdentifiedObjects(self, *IdentifiedObjects):
67 for obj in IdentifiedObjects:
68 obj.ModelingAuthoritySet = None
70 def getModelingAuthority(self):
71 """A Modeling Authority set supplies and maintains the data for the objects in a Modeling Authority Set.
72 """
73 return self._ModelingAuthority
75 def setModelingAuthority(self, value):
76 if self._ModelingAuthority is not None:
77 filtered = [x for x in self.ModelingAuthority.ModelingAuthoritySets if x != self]
78 self._ModelingAuthority._ModelingAuthoritySets = filtered
80 self._ModelingAuthority = value
81 if self._ModelingAuthority is not None:
82 if self not in self._ModelingAuthority._ModelingAuthoritySets:
83 self._ModelingAuthority._ModelingAuthoritySets.append(self)
85 ModelingAuthority = property(getModelingAuthority, setModelingAuthority)