Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX nombre subestación en Identificador emplazamiento #649

Merged
merged 2 commits into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No cal això, a la posició [1] ja tenim el name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He vist que actúa un name_get de la subestació que afegeix el que hi ha a descripció entre cometes. https://github.com/gisce/erp/blob/developer/addons/gisce/GISCEMaster/giscedata_cts_subestacions/giscedata_cts_subestacions.py#L138

De l'estil:

  • name: S.E. 1
  • descripcio: Subestació Primera

Ens retorna "S.E. 1 "Subestacio Primera"". I només cal name. D'aquí que necessiti fer aquest parse. De manera anàloga es fa al B3.1 https://github.com/gisce/libCNMC/blob/master/libcnmc/cir_8_2021/FB3_1.py#L31

identificador_emplazamiento = sub_data.get('name', '')

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