Skip to content

Commit

Permalink
Merge pull request #649 from gisce/bugfix/58161_obtain_tensio_value_f…
Browse files Browse the repository at this point in the history
…or_B4

FIX nombre subestación en Identificador emplazamiento
  • Loading branch information
ecarreras authored May 7, 2024
2 parents b488b05 + 113a23c commit 37ab382
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions libcnmc/cir_8_2021/FB4.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,24 @@ def get_cts_data(self, sub_id):
cts_data = o.GiscedataCts.read(cts_id['ct_id'][0], ['propietari', 'node_id', 'punt_frontera', 'model'])
return cts_data

def get_subestacio(self, sub_id):
"""
Returns the SE data
:param sub_id: ID of SE
:type sub_id: int
:return: Node, Name, CINI and CT-ID of the SE
:rtype: dict[str,str]
"""

o = self.connection
sub = o.GiscedataCtsSubestacions.read(
sub_id, ['name']
)
ret = {
"name": sub['name'],
}
return ret

def consumer(self):
"""
Generates the line of the file
Expand Down Expand Up @@ -251,12 +269,12 @@ def get_inst_name(element_id):
else data_ip

#IDENTIFICADOR_EMPLAZAMIENTO
if pos['parc_id']:
identificador_emplazamiento = ''
if pos.get('parc_id', False): # nom Parc
identificador_emplazamiento = pos['parc_id'][1]
else:
o_parc = pos['subestacio_id'][1] + "-"\
+ str(self.get_tensio(pos))
identificador_emplazamiento = "SUBESTACIO_NAME"
elif pos.get('subestacio_id', False): # nom Subestació
sub_data = self.get_subestacio(pos['subestacio_id'][0])
identificador_emplazamiento = sub_data.get('name', '')

#CODIGO CCUU
if pos['tipus_instalacio_cnmc_id']:
Expand Down

0 comments on commit 37ab382

Please sign in to comment.