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 CIM14
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
23 class ClearanceTag(IdentifiedObject
):
24 """A clearance tag that is used to authorize and schedule work on conducting equipment in the field. Tagged equipment is not available for commercial service.
27 def __init__(self
, workStartTime
='', workDescription
='', workEndTime
='', authorityName
='', deenergizeReqFlag
=False, groundReqFlag
=False, tagIssueTime
='', phaseCheckReqFlag
=False, ClearanceTagType
=None, ConductingEquipment
=None, *args
, **kw_args
):
28 """Initialises a new 'ClearanceTag' instance.
30 @param workStartTime: The time at which the clearance tag is scheduled to be set.
31 @param workDescription: Description of the work to be performed
32 @param workEndTime: The time at which the clearance tag is scheduled to be removed
33 @param authorityName: The name of the person who is authorized to issue the tag
34 @param deenergizeReqFlag: Set true if equipment must be deenergized
35 @param groundReqFlag: Set true if equipment must be grounded
36 @param tagIssueTime: The time at which the clearance tag was issued
37 @param phaseCheckReqFlag: Set true if equipment phasing must be checked
38 @param ClearanceTagType: The type of tag, depending on the purpose of the work to be performed and/or the type of supervisory control allowed.
39 @param ConductingEquipment: Conducting equipment may have multiple clearance tags for authorized field work
41 #: The time at which the clearance tag is scheduled to be set.
42 self
.workStartTime
= workStartTime
44 #: Description of the work to be performed
45 self
.workDescription
= workDescription
47 #: The time at which the clearance tag is scheduled to be removed
48 self
.workEndTime
= workEndTime
50 #: The name of the person who is authorized to issue the tag
51 self
.authorityName
= authorityName
53 #: Set true if equipment must be deenergized
54 self
.deenergizeReqFlag
= deenergizeReqFlag
56 #: Set true if equipment must be grounded
57 self
.groundReqFlag
= groundReqFlag
59 #: The time at which the clearance tag was issued
60 self
.tagIssueTime
= tagIssueTime
62 #: Set true if equipment phasing must be checked
63 self
.phaseCheckReqFlag
= phaseCheckReqFlag
65 self
._ClearanceTagType
= None
66 self
.ClearanceTagType
= ClearanceTagType
68 self
._ConductingEquipment
= None
69 self
.ConductingEquipment
= ConductingEquipment
71 super(ClearanceTag
, self
).__init
__(*args
, **kw_args
)
73 _attrs
= ["workStartTime", "workDescription", "workEndTime", "authorityName", "deenergizeReqFlag", "groundReqFlag", "tagIssueTime", "phaseCheckReqFlag"]
74 _attr_types
= {"workStartTime": str, "workDescription": str, "workEndTime": str, "authorityName": str, "deenergizeReqFlag": bool, "groundReqFlag": bool, "tagIssueTime": str, "phaseCheckReqFlag": bool}
75 _defaults
= {"workStartTime": '', "workDescription": '', "workEndTime": '', "authorityName": '', "deenergizeReqFlag": False, "groundReqFlag": False, "tagIssueTime": '', "phaseCheckReqFlag": False}
77 _refs
= ["ClearanceTagType", "ConductingEquipment"]
80 def getClearanceTagType(self
):
81 """The type of tag, depending on the purpose of the work to be performed and/or the type of supervisory control allowed.
83 return self
._ClearanceTagType
85 def setClearanceTagType(self
, value
):
86 if self
._ClearanceTagType
is not None:
87 filtered
= [x
for x
in self
.ClearanceTagType
.ClearanceTags
if x
!= self
]
88 self
._ClearanceTagType
._ClearanceTags
= filtered
90 self
._ClearanceTagType
= value
91 if self
._ClearanceTagType
is not None:
92 if self
not in self
._ClearanceTagType
._ClearanceTags
:
93 self
._ClearanceTagType
._ClearanceTags
.append(self
)
95 ClearanceTagType
= property(getClearanceTagType
, setClearanceTagType
)
97 def getConductingEquipment(self
):
98 """Conducting equipment may have multiple clearance tags for authorized field work
100 return self
._ConductingEquipment
102 def setConductingEquipment(self
, value
):
103 if self
._ConductingEquipment
is not None:
104 filtered
= [x
for x
in self
.ConductingEquipment
.ClearanceTags
if x
!= self
]
105 self
._ConductingEquipment
._ClearanceTags
= filtered
107 self
._ConductingEquipment
= value
108 if self
._ConductingEquipment
is not None:
109 if self
not in self
._ConductingEquipment
._ClearanceTags
:
110 self
._ConductingEquipment
._ClearanceTags
.append(self
)
112 ConductingEquipment
= property(getConductingEquipment
, setConductingEquipment
)