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
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
19 class ClearanceTag(IdentifiedObject
):
20 """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.
23 def __init__(self
, workStartTime
='', workDescription
='', workEndTime
='', authorityName
='', deenergizeReqFlag
=False, groundReqFlag
=False, tagIssueTime
='', phaseCheckReqFlag
=False, ClearanceTagType
=None, ConductingEquipment
=None, *args
, **kw_args
):
24 """Initialises a new 'ClearanceTag' instance.
26 @param workStartTime: The time at which the clearance tag is scheduled to be set.
27 @param workDescription: Description of the work to be performed
28 @param workEndTime: The time at which the clearance tag is scheduled to be removed
29 @param authorityName: The name of the person who is authorized to issue the tag
30 @param deenergizeReqFlag: Set true if equipment must be deenergized
31 @param groundReqFlag: Set true if equipment must be grounded
32 @param tagIssueTime: The time at which the clearance tag was issued
33 @param phaseCheckReqFlag: Set true if equipment phasing must be checked
34 @param ClearanceTagType: The type of tag, depending on the purpose of the work to be performed and/or the type of supervisory control allowed.
35 @param ConductingEquipment: Conducting equipment may have multiple clearance tags for authorized field work
37 #: The time at which the clearance tag is scheduled to be set.
38 self
.workStartTime
= workStartTime
40 #: Description of the work to be performed
41 self
.workDescription
= workDescription
43 #: The time at which the clearance tag is scheduled to be removed
44 self
.workEndTime
= workEndTime
46 #: The name of the person who is authorized to issue the tag
47 self
.authorityName
= authorityName
49 #: Set true if equipment must be deenergized
50 self
.deenergizeReqFlag
= deenergizeReqFlag
52 #: Set true if equipment must be grounded
53 self
.groundReqFlag
= groundReqFlag
55 #: The time at which the clearance tag was issued
56 self
.tagIssueTime
= tagIssueTime
58 #: Set true if equipment phasing must be checked
59 self
.phaseCheckReqFlag
= phaseCheckReqFlag
61 self
._ClearanceTagType
= None
62 self
.ClearanceTagType
= ClearanceTagType
64 self
._ConductingEquipment
= None
65 self
.ConductingEquipment
= ConductingEquipment
67 super(ClearanceTag
, self
).__init
__(*args
, **kw_args
)
69 _attrs
= ["workStartTime", "workDescription", "workEndTime", "authorityName", "deenergizeReqFlag", "groundReqFlag", "tagIssueTime", "phaseCheckReqFlag"]
70 _attr_types
= {"workStartTime": str, "workDescription": str, "workEndTime": str, "authorityName": str, "deenergizeReqFlag": bool, "groundReqFlag": bool, "tagIssueTime": str, "phaseCheckReqFlag": bool}
71 _defaults
= {"workStartTime": '', "workDescription": '', "workEndTime": '', "authorityName": '', "deenergizeReqFlag": False, "groundReqFlag": False, "tagIssueTime": '', "phaseCheckReqFlag": False}
73 _refs
= ["ClearanceTagType", "ConductingEquipment"]
76 def getClearanceTagType(self
):
77 """The type of tag, depending on the purpose of the work to be performed and/or the type of supervisory control allowed.
79 return self
._ClearanceTagType
81 def setClearanceTagType(self
, value
):
82 if self
._ClearanceTagType
is not None:
83 filtered
= [x
for x
in self
.ClearanceTagType
.ClearanceTags
if x
!= self
]
84 self
._ClearanceTagType
._ClearanceTags
= filtered
86 self
._ClearanceTagType
= value
87 if self
._ClearanceTagType
is not None:
88 if self
not in self
._ClearanceTagType
._ClearanceTags
:
89 self
._ClearanceTagType
._ClearanceTags
.append(self
)
91 ClearanceTagType
= property(getClearanceTagType
, setClearanceTagType
)
93 def getConductingEquipment(self
):
94 """Conducting equipment may have multiple clearance tags for authorized field work
96 return self
._ConductingEquipment
98 def setConductingEquipment(self
, value
):
99 if self
._ConductingEquipment
is not None:
100 filtered
= [x
for x
in self
.ConductingEquipment
.ClearanceTags
if x
!= self
]
101 self
._ConductingEquipment
._ClearanceTags
= filtered
103 self
._ConductingEquipment
= value
104 if self
._ConductingEquipment
is not None:
105 if self
not in self
._ConductingEquipment
._ClearanceTags
:
106 self
._ConductingEquipment
._ClearanceTags
.append(self
)
108 ConductingEquipment
= property(getConductingEquipment
, setConductingEquipment
)