Skip to content

Commit

Permalink
Merge pull request #615 from gisce/fix-b22-interruptor
Browse files Browse the repository at this point in the history
Utilitzar tipus element per saber interruptor
  • Loading branch information
ecarreras authored Oct 25, 2023
2 parents e02186e + 2473953 commit 2dc42b1
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions libcnmc/cir_8_2021/FB2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@
from libcnmc.utils import format_f
from libcnmc.core import StopMultiprocessBased

TIPUS_INST = {
'TI-174': 1,
'TI-187': 1,
'TI-182': 1,
'TI-183': 1,
'TI-187A': 1,
'TI-179': 0,
'TI-177': 0,
'TI-181': 2,
'TI-102V': 0,
}

class FB2_2(StopMultiprocessBased):
"""
Expand Down Expand Up @@ -115,7 +104,7 @@ def get_tipus_inst(self, ti_cnmc_id):
def consumer(self):
o = self.connection
fields_to_read = [
'installacio', 'name', 'propietari', 'data_pm', 'cini', 'tipus_instalacio_cnmc_id'
'installacio', 'name', 'propietari', 'data_pm', 'cini', 'tipus_element'
]
while True:
try:
Expand All @@ -138,8 +127,9 @@ def consumer(self):
o_propietari = int(celles['propietari'])
if o_propietari == 0:
o_maquina = ''
o_interruptor = self.get_tipus_inst(celles['tipus_instalacio_cnmc_id'])
o_interruptor_val = TIPUS_INST[o_interruptor]
o_interruptor_val = o.model('giscedata.celles.tipus.element').read(
celles['tipus_element'][0], ['interruptor']
)['interruptor']

o_data = ''
if celles['data_pm']:
Expand Down

0 comments on commit 2dc42b1

Please sign in to comment.