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
21 from CIM15
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
23 class LandProperty(IdentifiedObject
):
24 """Information about a particular piece of (land) property such as its use. Ownership of the property may be determined through associations to Organisations and/or ErpPersons.Information about a particular piece of (land) property such as its use. Ownership of the property may be determined through associations to Organisations and/or ErpPersons.
27 def __init__(self
, kind
="store", externalRecordReference
='', demographicKind
="other", status
=None, LocationGrants
=None, ErpSiteLevelDatas
=None, ErpPersonRoles
=None, ErpOrganisationRoles
=None, AssetContainers
=None, Locations
=None, RightOfWays
=None, *args
, **kw_args
):
28 """Initialises a new 'LandProperty' instance.
30 @param kind: Kind of (land) property, categorised according to its main functional use from the utility's perspective. Values are: "store", "customerPremise", "building", "external", "gridSupplyPoint", "substation", "depot"
31 @param externalRecordReference: Reference allocated by the governing organisation (such as municipality) to this piece of land that has a formal reference to Surveyor General's records. The governing organisation is specified in associated Organisation.
32 @param demographicKind: Demographics around the site. Values are: "other", "urban", "rural"
34 @param LocationGrants: All location grants this land property has.
35 @param ErpSiteLevelDatas:
36 @param ErpPersonRoles:
37 @param ErpOrganisationRoles:
38 @param AssetContainers:
39 @param Locations: The spatail description of a piece of property.
40 @param RightOfWays: All rights of way this land property has.
42 #: Kind of (land) property, categorised according to its main functional use from the utility's perspective. Values are: "store", "customerPremise", "building", "external", "gridSupplyPoint", "substation", "depot"
45 #: Reference allocated by the governing organisation (such as municipality) to this piece of land that has a formal reference to Surveyor General's records. The governing organisation is specified in associated Organisation.
46 self
.externalRecordReference
= externalRecordReference
48 #: Demographics around the site. Values are: "other", "urban", "rural"
49 self
.demographicKind
= demographicKind
53 self
._LocationGrants
= []
54 self
.LocationGrants
= [] if LocationGrants
is None else LocationGrants
56 self
._ErpSiteLevelDatas
= []
57 self
.ErpSiteLevelDatas
= [] if ErpSiteLevelDatas
is None else ErpSiteLevelDatas
59 self
._ErpPersonRoles
= []
60 self
.ErpPersonRoles
= [] if ErpPersonRoles
is None else ErpPersonRoles
62 self
._ErpOrganisationRoles
= []
63 self
.ErpOrganisationRoles
= [] if ErpOrganisationRoles
is None else ErpOrganisationRoles
65 self
._AssetContainers
= []
66 self
.AssetContainers
= [] if AssetContainers
is None else AssetContainers
69 self
.Locations
= [] if Locations
is None else Locations
71 self
._RightOfWays
= []
72 self
.RightOfWays
= [] if RightOfWays
is None else RightOfWays
74 super(LandProperty
, self
).__init
__(*args
, **kw_args
)
76 _attrs
= ["kind", "externalRecordReference", "demographicKind"]
77 _attr_types
= {"kind": str, "externalRecordReference": str, "demographicKind": str}
78 _defaults
= {"kind": "store", "externalRecordReference": '', "demographicKind": "other"}
79 _enums
= {"kind": "LandPropertyKind", "demographicKind": "DemographicKind"}
80 _refs
= ["status", "LocationGrants", "ErpSiteLevelDatas", "ErpPersonRoles", "ErpOrganisationRoles", "AssetContainers", "Locations", "RightOfWays"]
81 _many_refs
= ["LocationGrants", "ErpSiteLevelDatas", "ErpPersonRoles", "ErpOrganisationRoles", "AssetContainers", "Locations", "RightOfWays"]
85 def getLocationGrants(self
):
86 """All location grants this land property has.
88 return self
._LocationGrants
90 def setLocationGrants(self
, value
):
91 for x
in self
._LocationGrants
:
94 y
._LandProperty
= self
95 self
._LocationGrants
= value
97 LocationGrants
= property(getLocationGrants
, setLocationGrants
)
99 def addLocationGrants(self
, *LocationGrants
):
100 for obj
in LocationGrants
:
101 obj
.LandProperty
= self
103 def removeLocationGrants(self
, *LocationGrants
):
104 for obj
in LocationGrants
:
105 obj
.LandProperty
= None
107 def getErpSiteLevelDatas(self
):
109 return self
._ErpSiteLevelDatas
111 def setErpSiteLevelDatas(self
, value
):
112 for x
in self
._ErpSiteLevelDatas
:
113 x
.LandProperty
= None
115 y
._LandProperty
= self
116 self
._ErpSiteLevelDatas
= value
118 ErpSiteLevelDatas
= property(getErpSiteLevelDatas
, setErpSiteLevelDatas
)
120 def addErpSiteLevelDatas(self
, *ErpSiteLevelDatas
):
121 for obj
in ErpSiteLevelDatas
:
122 obj
.LandProperty
= self
124 def removeErpSiteLevelDatas(self
, *ErpSiteLevelDatas
):
125 for obj
in ErpSiteLevelDatas
:
126 obj
.LandProperty
= None
128 def getErpPersonRoles(self
):
130 return self
._ErpPersonRoles
132 def setErpPersonRoles(self
, value
):
133 for x
in self
._ErpPersonRoles
:
134 x
.LandProperty
= None
136 y
._LandProperty
= self
137 self
._ErpPersonRoles
= value
139 ErpPersonRoles
= property(getErpPersonRoles
, setErpPersonRoles
)
141 def addErpPersonRoles(self
, *ErpPersonRoles
):
142 for obj
in ErpPersonRoles
:
143 obj
.LandProperty
= self
145 def removeErpPersonRoles(self
, *ErpPersonRoles
):
146 for obj
in ErpPersonRoles
:
147 obj
.LandProperty
= None
149 def getErpOrganisationRoles(self
):
151 return self
._ErpOrganisationRoles
153 def setErpOrganisationRoles(self
, value
):
154 for p
in self
._ErpOrganisationRoles
:
155 filtered
= [q
for q
in p
.LandProperty
if q
!= self
]
156 self
._ErpOrganisationRoles
._LandProperty
= filtered
158 if self
not in r
._LandProperty
:
159 r
._LandProperty
.append(self
)
160 self
._ErpOrganisationRoles
= value
162 ErpOrganisationRoles
= property(getErpOrganisationRoles
, setErpOrganisationRoles
)
164 def addErpOrganisationRoles(self
, *ErpOrganisationRoles
):
165 for obj
in ErpOrganisationRoles
:
166 if self
not in obj
._LandProperty
:
167 obj
._LandProperty
.append(self
)
168 self
._ErpOrganisationRoles
.append(obj
)
170 def removeErpOrganisationRoles(self
, *ErpOrganisationRoles
):
171 for obj
in ErpOrganisationRoles
:
172 if self
in obj
._LandProperty
:
173 obj
._LandProperty
.remove(self
)
174 self
._ErpOrganisationRoles
.remove(obj
)
176 def getAssetContainers(self
):
178 return self
._AssetContainers
180 def setAssetContainers(self
, value
):
181 for p
in self
._AssetContainers
:
182 filtered
= [q
for q
in p
.LandProperties
if q
!= self
]
183 self
._AssetContainers
._LandProperties
= filtered
185 if self
not in r
._LandProperties
:
186 r
._LandProperties
.append(self
)
187 self
._AssetContainers
= value
189 AssetContainers
= property(getAssetContainers
, setAssetContainers
)
191 def addAssetContainers(self
, *AssetContainers
):
192 for obj
in AssetContainers
:
193 if self
not in obj
._LandProperties
:
194 obj
._LandProperties
.append(self
)
195 self
._AssetContainers
.append(obj
)
197 def removeAssetContainers(self
, *AssetContainers
):
198 for obj
in AssetContainers
:
199 if self
in obj
._LandProperties
:
200 obj
._LandProperties
.remove(self
)
201 self
._AssetContainers
.remove(obj
)
203 def getLocations(self
):
204 """The spatail description of a piece of property.
206 return self
._Locations
208 def setLocations(self
, value
):
209 for p
in self
._Locations
:
210 filtered
= [q
for q
in p
.LandProperties
if q
!= self
]
211 self
._Locations
._LandProperties
= filtered
213 if self
not in r
._LandProperties
:
214 r
._LandProperties
.append(self
)
215 self
._Locations
= value
217 Locations
= property(getLocations
, setLocations
)
219 def addLocations(self
, *Locations
):
220 for obj
in Locations
:
221 if self
not in obj
._LandProperties
:
222 obj
._LandProperties
.append(self
)
223 self
._Locations
.append(obj
)
225 def removeLocations(self
, *Locations
):
226 for obj
in Locations
:
227 if self
in obj
._LandProperties
:
228 obj
._LandProperties
.remove(self
)
229 self
._Locations
.remove(obj
)
231 def getRightOfWays(self
):
232 """All rights of way this land property has.
234 return self
._RightOfWays
236 def setRightOfWays(self
, value
):
237 for p
in self
._RightOfWays
:
238 filtered
= [q
for q
in p
.LandProperties
if q
!= self
]
239 self
._RightOfWays
._LandProperties
= filtered
241 if self
not in r
._LandProperties
:
242 r
._LandProperties
.append(self
)
243 self
._RightOfWays
= value
245 RightOfWays
= property(getRightOfWays
, setRightOfWays
)
247 def addRightOfWays(self
, *RightOfWays
):
248 for obj
in RightOfWays
:
249 if self
not in obj
._LandProperties
:
250 obj
._LandProperties
.append(self
)
251 self
._RightOfWays
.append(obj
)
253 def removeRightOfWays(self
, *RightOfWays
):
254 for obj
in RightOfWays
:
255 if self
in obj
._LandProperties
:
256 obj
._LandProperties
.remove(self
)
257 self
._RightOfWays
.remove(obj
)